var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var require_index_001 = __commonJS({
  "assets/index-DrxgbQVp.js"(exports, module) {
    /**
    * @vue/shared v3.5.13
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    /*! #__NO_SIDE_EFFECTS__ */
    // @__NO_SIDE_EFFECTS__
    function makeMap(str) {
      const map2 = /* @__PURE__ */ Object.create(null);
      for (const key of str.split(",")) map2[key] = 1;
      return (val) => val in map2;
    }
    const EMPTY_OBJ$1 = {};
    const EMPTY_ARR = [];
    const NOOP = () => {
    };
    const NO = () => false;
    const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
    (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
    const isModelListener = (key) => key.startsWith("onUpdate:");
    const extend$2 = Object.assign;
    const remove = (arr, el) => {
      const i2 = arr.indexOf(el);
      if (i2 > -1) {
        arr.splice(i2, 1);
      }
    };
    const hasOwnProperty$f = Object.prototype.hasOwnProperty;
    const hasOwn$1 = (val, key) => hasOwnProperty$f.call(val, key);
    const isArray$5 = Array.isArray;
    const isMap$1 = (val) => toTypeString(val) === "[object Map]";
    const isSet$1 = (val) => toTypeString(val) === "[object Set]";
    const isDate$1 = (val) => toTypeString(val) === "[object Date]";
    const isFunction$4 = (val) => typeof val === "function";
    const isString$3 = (val) => typeof val === "string";
    const isSymbol$1 = (val) => typeof val === "symbol";
    const isObject$7 = (val) => val !== null && typeof val === "object";
    const isPromise$1 = (val) => {
      return (isObject$7(val) || isFunction$4(val)) && isFunction$4(val.then) && isFunction$4(val.catch);
    };
    const objectToString$1 = Object.prototype.toString;
    const toTypeString = (value) => objectToString$1.call(value);
    const toRawType = (value) => {
      return toTypeString(value).slice(8, -1);
    };
    const isPlainObject$2 = (val) => toTypeString(val) === "[object Object]";
    const isIntegerKey = (key) => isString$3(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
    const isReservedProp = /* @__PURE__ */ makeMap(
      // the leading comma is intentional so empty string "" is also included
      ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
    );
    const cacheStringFunction = (fn2) => {
      const cache2 = /* @__PURE__ */ Object.create(null);
      return (str) => {
        const hit = cache2[str];
        return hit || (cache2[str] = fn2(str));
      };
    };
    const camelizeRE = /-(\w)/g;
    const camelize = cacheStringFunction(
      (str) => {
        return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
      }
    );
    const hyphenateRE = /\B([A-Z])/g;
    const hyphenate = cacheStringFunction(
      (str) => str.replace(hyphenateRE, "-$1").toLowerCase()
    );
    const capitalize$2 = cacheStringFunction((str) => {
      return str.charAt(0).toUpperCase() + str.slice(1);
    });
    const toHandlerKey = cacheStringFunction(
      (str) => {
        const s2 = str ? `on${capitalize$2(str)}` : ``;
        return s2;
      }
    );
    const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
    const invokeArrayFns = (fns, ...arg) => {
      for (let i2 = 0; i2 < fns.length; i2++) {
        fns[i2](...arg);
      }
    };
    const def = (obj, key, value, writable = false) => {
      Object.defineProperty(obj, key, {
        configurable: true,
        enumerable: false,
        writable,
        value
      });
    };
    const looseToNumber = (val) => {
      const n = parseFloat(val);
      return isNaN(n) ? val : n;
    };
    const toNumber$1 = (val) => {
      const n = isString$3(val) ? Number(val) : NaN;
      return isNaN(n) ? val : n;
    };
    let _globalThis;
    const getGlobalThis = () => {
      return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
    };
    function normalizeStyle$1(value) {
      if (isArray$5(value)) {
        const res = {};
        for (let i2 = 0; i2 < value.length; i2++) {
          const item = value[i2];
          const normalized = isString$3(item) ? parseStringStyle(item) : normalizeStyle$1(item);
          if (normalized) {
            for (const key in normalized) {
              res[key] = normalized[key];
            }
          }
        }
        return res;
      } else if (isString$3(value) || isObject$7(value)) {
        return value;
      }
    }
    const listDelimiterRE = /;(?![^(]*\))/g;
    const propertyDelimiterRE = /:([^]+)/;
    const styleCommentRE = /\/\*[^]*?\*\//g;
    function parseStringStyle(cssText) {
      const ret = {};
      cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
        if (item) {
          const tmp = item.split(propertyDelimiterRE);
          tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
        }
      });
      return ret;
    }
    function normalizeClass(value) {
      let res = "";
      if (isString$3(value)) {
        res = value;
      } else if (isArray$5(value)) {
        for (let i2 = 0; i2 < value.length; i2++) {
          const normalized = normalizeClass(value[i2]);
          if (normalized) {
            res += normalized + " ";
          }
        }
      } else if (isObject$7(value)) {
        for (const name in value) {
          if (value[name]) {
            res += name + " ";
          }
        }
      }
      return res.trim();
    }
    function normalizeProps(props2) {
      if (!props2) return null;
      let { class: klass, style } = props2;
      if (klass && !isString$3(klass)) {
        props2.class = normalizeClass(klass);
      }
      if (style) {
        props2.style = normalizeStyle$1(style);
      }
      return props2;
    }
    const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
    const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
    function includeBooleanAttr(value) {
      return !!value || value === "";
    }
    function looseCompareArrays(a2, b2) {
      if (a2.length !== b2.length) return false;
      let equal = true;
      for (let i2 = 0; equal && i2 < a2.length; i2++) {
        equal = looseEqual(a2[i2], b2[i2]);
      }
      return equal;
    }
    function looseEqual(a2, b2) {
      if (a2 === b2) return true;
      let aValidType = isDate$1(a2);
      let bValidType = isDate$1(b2);
      if (aValidType || bValidType) {
        return aValidType && bValidType ? a2.getTime() === b2.getTime() : false;
      }
      aValidType = isSymbol$1(a2);
      bValidType = isSymbol$1(b2);
      if (aValidType || bValidType) {
        return a2 === b2;
      }
      aValidType = isArray$5(a2);
      bValidType = isArray$5(b2);
      if (aValidType || bValidType) {
        return aValidType && bValidType ? looseCompareArrays(a2, b2) : false;
      }
      aValidType = isObject$7(a2);
      bValidType = isObject$7(b2);
      if (aValidType || bValidType) {
        if (!aValidType || !bValidType) {
          return false;
        }
        const aKeysCount = Object.keys(a2).length;
        const bKeysCount = Object.keys(b2).length;
        if (aKeysCount !== bKeysCount) {
          return false;
        }
        for (const key in a2) {
          const aHasKey = a2.hasOwnProperty(key);
          const bHasKey = b2.hasOwnProperty(key);
          if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) {
            return false;
          }
        }
      }
      return String(a2) === String(b2);
    }
    function looseIndexOf(arr, val) {
      return arr.findIndex((item) => looseEqual(item, val));
    }
    const isRef$1 = (val) => {
      return !!(val && val["__v_isRef"] === true);
    };
    const toDisplayString = (val) => {
      return isString$3(val) ? val : val == null ? "" : isArray$5(val) || isObject$7(val) && (val.toString === objectToString$1 || !isFunction$4(val.toString)) ? isRef$1(val) ? toDisplayString(val.value) : JSON.stringify(val, replacer, 2) : String(val);
    };
    const replacer = (_key, val) => {
      if (isRef$1(val)) {
        return replacer(_key, val.value);
      } else if (isMap$1(val)) {
        return {
          [`Map(${val.size})`]: [...val.entries()].reduce(
            (entries, [key, val2], i2) => {
              entries[stringifySymbol(key, i2) + " =>"] = val2;
              return entries;
            },
            {}
          )
        };
      } else if (isSet$1(val)) {
        return {
          [`Set(${val.size})`]: [...val.values()].map((v4) => stringifySymbol(v4))
        };
      } else if (isSymbol$1(val)) {
        return stringifySymbol(val);
      } else if (isObject$7(val) && !isArray$5(val) && !isPlainObject$2(val)) {
        return String(val);
      }
      return val;
    };
    const stringifySymbol = (v4, i2 = "") => {
      var _a2;
      return (
        // Symbol.description in es2019+ so we need to cast here to pass
        // the lib: es2016 check
        isSymbol$1(v4) ? `Symbol(${(_a2 = v4.description) != null ? _a2 : i2})` : v4
      );
    };
    /**
    * @vue/reactivity v3.5.13
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    let activeEffectScope;
    class EffectScope {
      constructor(detached = false) {
        this.detached = detached;
        this._active = true;
        this.effects = [];
        this.cleanups = [];
        this._isPaused = false;
        this.parent = activeEffectScope;
        if (!detached && activeEffectScope) {
          this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
            this
          ) - 1;
        }
      }
      get active() {
        return this._active;
      }
      pause() {
        if (this._active) {
          this._isPaused = true;
          let i2, l2;
          if (this.scopes) {
            for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
              this.scopes[i2].pause();
            }
          }
          for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
            this.effects[i2].pause();
          }
        }
      }
      /**
       * Resumes the effect scope, including all child scopes and effects.
       */
      resume() {
        if (this._active) {
          if (this._isPaused) {
            this._isPaused = false;
            let i2, l2;
            if (this.scopes) {
              for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
                this.scopes[i2].resume();
              }
            }
            for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
              this.effects[i2].resume();
            }
          }
        }
      }
      run(fn2) {
        if (this._active) {
          const currentEffectScope = activeEffectScope;
          try {
            activeEffectScope = this;
            return fn2();
          } finally {
            activeEffectScope = currentEffectScope;
          }
        }
      }
      /**
       * This should only be called on non-detached scopes
       * @internal
       */
      on() {
        activeEffectScope = this;
      }
      /**
       * This should only be called on non-detached scopes
       * @internal
       */
      off() {
        activeEffectScope = this.parent;
      }
      stop(fromParent) {
        if (this._active) {
          this._active = false;
          let i2, l2;
          for (i2 = 0, l2 = this.effects.length; i2 < l2; i2++) {
            this.effects[i2].stop();
          }
          this.effects.length = 0;
          for (i2 = 0, l2 = this.cleanups.length; i2 < l2; i2++) {
            this.cleanups[i2]();
          }
          this.cleanups.length = 0;
          if (this.scopes) {
            for (i2 = 0, l2 = this.scopes.length; i2 < l2; i2++) {
              this.scopes[i2].stop(true);
            }
            this.scopes.length = 0;
          }
          if (!this.detached && this.parent && !fromParent) {
            const last2 = this.parent.scopes.pop();
            if (last2 && last2 !== this) {
              this.parent.scopes[this.index] = last2;
              last2.index = this.index;
            }
          }
          this.parent = void 0;
        }
      }
    }
    function effectScope(detached) {
      return new EffectScope(detached);
    }
    function getCurrentScope() {
      return activeEffectScope;
    }
    function onScopeDispose(fn2, failSilently = false) {
      if (activeEffectScope) {
        activeEffectScope.cleanups.push(fn2);
      }
    }
    let activeSub;
    const pausedQueueEffects = /* @__PURE__ */ new WeakSet();
    class ReactiveEffect {
      constructor(fn2) {
        this.fn = fn2;
        this.deps = void 0;
        this.depsTail = void 0;
        this.flags = 1 | 4;
        this.next = void 0;
        this.cleanup = void 0;
        this.scheduler = void 0;
        if (activeEffectScope && activeEffectScope.active) {
          activeEffectScope.effects.push(this);
        }
      }
      pause() {
        this.flags |= 64;
      }
      resume() {
        if (this.flags & 64) {
          this.flags &= -65;
          if (pausedQueueEffects.has(this)) {
            pausedQueueEffects.delete(this);
            this.trigger();
          }
        }
      }
      /**
       * @internal
       */
      notify() {
        if (this.flags & 2 && !(this.flags & 32)) {
          return;
        }
        if (!(this.flags & 8)) {
          batch(this);
        }
      }
      run() {
        if (!(this.flags & 1)) {
          return this.fn();
        }
        this.flags |= 2;
        cleanupEffect(this);
        prepareDeps(this);
        const prevEffect = activeSub;
        const prevShouldTrack = shouldTrack;
        activeSub = this;
        shouldTrack = true;
        try {
          return this.fn();
        } finally {
          cleanupDeps(this);
          activeSub = prevEffect;
          shouldTrack = prevShouldTrack;
          this.flags &= -3;
        }
      }
      stop() {
        if (this.flags & 1) {
          for (let link = this.deps; link; link = link.nextDep) {
            removeSub(link);
          }
          this.deps = this.depsTail = void 0;
          cleanupEffect(this);
          this.onStop && this.onStop();
          this.flags &= -2;
        }
      }
      trigger() {
        if (this.flags & 64) {
          pausedQueueEffects.add(this);
        } else if (this.scheduler) {
          this.scheduler();
        } else {
          this.runIfDirty();
        }
      }
      /**
       * @internal
       */
      runIfDirty() {
        if (isDirty(this)) {
          this.run();
        }
      }
      get dirty() {
        return isDirty(this);
      }
    }
    let batchDepth = 0;
    let batchedSub;
    let batchedComputed;
    function batch(sub2, isComputed = false) {
      sub2.flags |= 8;
      if (isComputed) {
        sub2.next = batchedComputed;
        batchedComputed = sub2;
        return;
      }
      sub2.next = batchedSub;
      batchedSub = sub2;
    }
    function startBatch() {
      batchDepth++;
    }
    function endBatch() {
      if (--batchDepth > 0) {
        return;
      }
      if (batchedComputed) {
        let e2 = batchedComputed;
        batchedComputed = void 0;
        while (e2) {
          const next = e2.next;
          e2.next = void 0;
          e2.flags &= -9;
          e2 = next;
        }
      }
      let error;
      while (batchedSub) {
        let e2 = batchedSub;
        batchedSub = void 0;
        while (e2) {
          const next = e2.next;
          e2.next = void 0;
          e2.flags &= -9;
          if (e2.flags & 1) {
            try {
              ;
              e2.trigger();
            } catch (err) {
              if (!error) error = err;
            }
          }
          e2 = next;
        }
      }
      if (error) throw error;
    }
    function prepareDeps(sub2) {
      for (let link = sub2.deps; link; link = link.nextDep) {
        link.version = -1;
        link.prevActiveLink = link.dep.activeLink;
        link.dep.activeLink = link;
      }
    }
    function cleanupDeps(sub2) {
      let head;
      let tail = sub2.depsTail;
      let link = tail;
      while (link) {
        const prev = link.prevDep;
        if (link.version === -1) {
          if (link === tail) tail = prev;
          removeSub(link);
          removeDep(link);
        } else {
          head = link;
        }
        link.dep.activeLink = link.prevActiveLink;
        link.prevActiveLink = void 0;
        link = prev;
      }
      sub2.deps = head;
      sub2.depsTail = tail;
    }
    function isDirty(sub2) {
      for (let link = sub2.deps; link; link = link.nextDep) {
        if (link.dep.version !== link.version || link.dep.computed && (refreshComputed(link.dep.computed) || link.dep.version !== link.version)) {
          return true;
        }
      }
      if (sub2._dirty) {
        return true;
      }
      return false;
    }
    function refreshComputed(computed2) {
      if (computed2.flags & 4 && !(computed2.flags & 16)) {
        return;
      }
      computed2.flags &= -17;
      if (computed2.globalVersion === globalVersion) {
        return;
      }
      computed2.globalVersion = globalVersion;
      const dep = computed2.dep;
      computed2.flags |= 2;
      if (dep.version > 0 && !computed2.isSSR && computed2.deps && !isDirty(computed2)) {
        computed2.flags &= -3;
        return;
      }
      const prevSub = activeSub;
      const prevShouldTrack = shouldTrack;
      activeSub = computed2;
      shouldTrack = true;
      try {
        prepareDeps(computed2);
        const value = computed2.fn(computed2._value);
        if (dep.version === 0 || hasChanged(value, computed2._value)) {
          computed2._value = value;
          dep.version++;
        }
      } catch (err) {
        dep.version++;
        throw err;
      } finally {
        activeSub = prevSub;
        shouldTrack = prevShouldTrack;
        cleanupDeps(computed2);
        computed2.flags &= -3;
      }
    }
    function removeSub(link, soft = false) {
      const { dep, prevSub, nextSub } = link;
      if (prevSub) {
        prevSub.nextSub = nextSub;
        link.prevSub = void 0;
      }
      if (nextSub) {
        nextSub.prevSub = prevSub;
        link.nextSub = void 0;
      }
      if (dep.subs === link) {
        dep.subs = prevSub;
        if (!prevSub && dep.computed) {
          dep.computed.flags &= -5;
          for (let l2 = dep.computed.deps; l2; l2 = l2.nextDep) {
            removeSub(l2, true);
          }
        }
      }
      if (!soft && !--dep.sc && dep.map) {
        dep.map.delete(dep.key);
      }
    }
    function removeDep(link) {
      const { prevDep, nextDep } = link;
      if (prevDep) {
        prevDep.nextDep = nextDep;
        link.prevDep = void 0;
      }
      if (nextDep) {
        nextDep.prevDep = prevDep;
        link.nextDep = void 0;
      }
    }
    let shouldTrack = true;
    const trackStack = [];
    function pauseTracking() {
      trackStack.push(shouldTrack);
      shouldTrack = false;
    }
    function resetTracking() {
      const last2 = trackStack.pop();
      shouldTrack = last2 === void 0 ? true : last2;
    }
    function cleanupEffect(e2) {
      const { cleanup } = e2;
      e2.cleanup = void 0;
      if (cleanup) {
        const prevSub = activeSub;
        activeSub = void 0;
        try {
          cleanup();
        } finally {
          activeSub = prevSub;
        }
      }
    }
    let globalVersion = 0;
    let Link$1 = class Link {
      constructor(sub2, dep) {
        this.sub = sub2;
        this.dep = dep;
        this.version = dep.version;
        this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
      }
    };
    class Dep {
      constructor(computed2) {
        this.computed = computed2;
        this.version = 0;
        this.activeLink = void 0;
        this.subs = void 0;
        this.map = void 0;
        this.key = void 0;
        this.sc = 0;
      }
      track(debugInfo) {
        if (!activeSub || !shouldTrack || activeSub === this.computed) {
          return;
        }
        let link = this.activeLink;
        if (link === void 0 || link.sub !== activeSub) {
          link = this.activeLink = new Link$1(activeSub, this);
          if (!activeSub.deps) {
            activeSub.deps = activeSub.depsTail = link;
          } else {
            link.prevDep = activeSub.depsTail;
            activeSub.depsTail.nextDep = link;
            activeSub.depsTail = link;
          }
          addSub(link);
        } else if (link.version === -1) {
          link.version = this.version;
          if (link.nextDep) {
            const next = link.nextDep;
            next.prevDep = link.prevDep;
            if (link.prevDep) {
              link.prevDep.nextDep = next;
            }
            link.prevDep = activeSub.depsTail;
            link.nextDep = void 0;
            activeSub.depsTail.nextDep = link;
            activeSub.depsTail = link;
            if (activeSub.deps === link) {
              activeSub.deps = next;
            }
          }
        }
        return link;
      }
      trigger(debugInfo) {
        this.version++;
        globalVersion++;
        this.notify(debugInfo);
      }
      notify(debugInfo) {
        startBatch();
        try {
          if (false) ;
          for (let link = this.subs; link; link = link.prevSub) {
            if (link.sub.notify()) {
              ;
              link.sub.dep.notify();
            }
          }
        } finally {
          endBatch();
        }
      }
    }
    function addSub(link) {
      link.dep.sc++;
      if (link.sub.flags & 4) {
        const computed2 = link.dep.computed;
        if (computed2 && !link.dep.subs) {
          computed2.flags |= 4 | 16;
          for (let l2 = computed2.deps; l2; l2 = l2.nextDep) {
            addSub(l2);
          }
        }
        const currentTail = link.dep.subs;
        if (currentTail !== link) {
          link.prevSub = currentTail;
          if (currentTail) currentTail.nextSub = link;
        }
        link.dep.subs = link;
      }
    }
    const targetMap = /* @__PURE__ */ new WeakMap();
    const ITERATE_KEY = Symbol(
      ""
    );
    const MAP_KEY_ITERATE_KEY = Symbol(
      ""
    );
    const ARRAY_ITERATE_KEY = Symbol(
      ""
    );
    function track(target, type, key) {
      if (shouldTrack && activeSub) {
        let depsMap = targetMap.get(target);
        if (!depsMap) {
          targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
        }
        let dep = depsMap.get(key);
        if (!dep) {
          depsMap.set(key, dep = new Dep());
          dep.map = depsMap;
          dep.key = key;
        }
        {
          dep.track();
        }
      }
    }
    function trigger$2(target, type, key, newValue, oldValue, oldTarget) {
      const depsMap = targetMap.get(target);
      if (!depsMap) {
        globalVersion++;
        return;
      }
      const run = (dep) => {
        if (dep) {
          {
            dep.trigger();
          }
        }
      };
      startBatch();
      if (type === "clear") {
        depsMap.forEach(run);
      } else {
        const targetIsArray = isArray$5(target);
        const isArrayIndex = targetIsArray && isIntegerKey(key);
        if (targetIsArray && key === "length") {
          const newLength = Number(newValue);
          depsMap.forEach((dep, key2) => {
            if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol$1(key2) && key2 >= newLength) {
              run(dep);
            }
          });
        } else {
          if (key !== void 0 || depsMap.has(void 0)) {
            run(depsMap.get(key));
          }
          if (isArrayIndex) {
            run(depsMap.get(ARRAY_ITERATE_KEY));
          }
          switch (type) {
            case "add":
              if (!targetIsArray) {
                run(depsMap.get(ITERATE_KEY));
                if (isMap$1(target)) {
                  run(depsMap.get(MAP_KEY_ITERATE_KEY));
                }
              } else if (isArrayIndex) {
                run(depsMap.get("length"));
              }
              break;
            case "delete":
              if (!targetIsArray) {
                run(depsMap.get(ITERATE_KEY));
                if (isMap$1(target)) {
                  run(depsMap.get(MAP_KEY_ITERATE_KEY));
                }
              }
              break;
            case "set":
              if (isMap$1(target)) {
                run(depsMap.get(ITERATE_KEY));
              }
              break;
          }
        }
      }
      endBatch();
    }
    function getDepFromReactive(object, key) {
      const depMap = targetMap.get(object);
      return depMap && depMap.get(key);
    }
    function reactiveReadArray(array) {
      const raw = toRaw(array);
      if (raw === array) return raw;
      track(raw, "iterate", ARRAY_ITERATE_KEY);
      return isShallow(array) ? raw : raw.map(toReactive);
    }
    function shallowReadArray(arr) {
      track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
      return arr;
    }
    const arrayInstrumentations = {
      __proto__: null,
      [Symbol.iterator]() {
        return iterator$2(this, Symbol.iterator, toReactive);
      },
      concat(...args) {
        return reactiveReadArray(this).concat(
          ...args.map((x2) => isArray$5(x2) ? reactiveReadArray(x2) : x2)
        );
      },
      entries() {
        return iterator$2(this, "entries", (value) => {
          value[1] = toReactive(value[1]);
          return value;
        });
      },
      every(fn2, thisArg) {
        return apply$1(this, "every", fn2, thisArg, void 0, arguments);
      },
      filter(fn2, thisArg) {
        return apply$1(this, "filter", fn2, thisArg, (v4) => v4.map(toReactive), arguments);
      },
      find(fn2, thisArg) {
        return apply$1(this, "find", fn2, thisArg, toReactive, arguments);
      },
      findIndex(fn2, thisArg) {
        return apply$1(this, "findIndex", fn2, thisArg, void 0, arguments);
      },
      findLast(fn2, thisArg) {
        return apply$1(this, "findLast", fn2, thisArg, toReactive, arguments);
      },
      findLastIndex(fn2, thisArg) {
        return apply$1(this, "findLastIndex", fn2, thisArg, void 0, arguments);
      },
      // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
      forEach(fn2, thisArg) {
        return apply$1(this, "forEach", fn2, thisArg, void 0, arguments);
      },
      includes(...args) {
        return searchProxy(this, "includes", args);
      },
      indexOf(...args) {
        return searchProxy(this, "indexOf", args);
      },
      join(separator) {
        return reactiveReadArray(this).join(separator);
      },
      // keys() iterator only reads `length`, no optimisation required
      lastIndexOf(...args) {
        return searchProxy(this, "lastIndexOf", args);
      },
      map(fn2, thisArg) {
        return apply$1(this, "map", fn2, thisArg, void 0, arguments);
      },
      pop() {
        return noTracking(this, "pop");
      },
      push(...args) {
        return noTracking(this, "push", args);
      },
      reduce(fn2, ...args) {
        return reduce$1(this, "reduce", fn2, args);
      },
      reduceRight(fn2, ...args) {
        return reduce$1(this, "reduceRight", fn2, args);
      },
      shift() {
        return noTracking(this, "shift");
      },
      // slice could use ARRAY_ITERATE but also seems to beg for range tracking
      some(fn2, thisArg) {
        return apply$1(this, "some", fn2, thisArg, void 0, arguments);
      },
      splice(...args) {
        return noTracking(this, "splice", args);
      },
      toReversed() {
        return reactiveReadArray(this).toReversed();
      },
      toSorted(comparer) {
        return reactiveReadArray(this).toSorted(comparer);
      },
      toSpliced(...args) {
        return reactiveReadArray(this).toSpliced(...args);
      },
      unshift(...args) {
        return noTracking(this, "unshift", args);
      },
      values() {
        return iterator$2(this, "values", toReactive);
      }
    };
    function iterator$2(self2, method, wrapValue) {
      const arr = shallowReadArray(self2);
      const iter = arr[method]();
      if (arr !== self2 && !isShallow(self2)) {
        iter._next = iter.next;
        iter.next = () => {
          const result = iter._next();
          if (result.value) {
            result.value = wrapValue(result.value);
          }
          return result;
        };
      }
      return iter;
    }
    const arrayProto$2 = Array.prototype;
    function apply$1(self2, method, fn2, thisArg, wrappedRetFn, args) {
      const arr = shallowReadArray(self2);
      const needsWrap = arr !== self2 && !isShallow(self2);
      const methodFn = arr[method];
      if (methodFn !== arrayProto$2[method]) {
        const result2 = methodFn.apply(self2, args);
        return needsWrap ? toReactive(result2) : result2;
      }
      let wrappedFn = fn2;
      if (arr !== self2) {
        if (needsWrap) {
          wrappedFn = function(item, index) {
            return fn2.call(this, toReactive(item), index, self2);
          };
        } else if (fn2.length > 2) {
          wrappedFn = function(item, index) {
            return fn2.call(this, item, index, self2);
          };
        }
      }
      const result = methodFn.call(arr, wrappedFn, thisArg);
      return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result;
    }
    function reduce$1(self2, method, fn2, args) {
      const arr = shallowReadArray(self2);
      let wrappedFn = fn2;
      if (arr !== self2) {
        if (!isShallow(self2)) {
          wrappedFn = function(acc, item, index) {
            return fn2.call(this, acc, toReactive(item), index, self2);
          };
        } else if (fn2.length > 3) {
          wrappedFn = function(acc, item, index) {
            return fn2.call(this, acc, item, index, self2);
          };
        }
      }
      return arr[method](wrappedFn, ...args);
    }
    function searchProxy(self2, method, args) {
      const arr = toRaw(self2);
      track(arr, "iterate", ARRAY_ITERATE_KEY);
      const res = arr[method](...args);
      if ((res === -1 || res === false) && isProxy(args[0])) {
        args[0] = toRaw(args[0]);
        return arr[method](...args);
      }
      return res;
    }
    function noTracking(self2, method, args = []) {
      pauseTracking();
      startBatch();
      const res = toRaw(self2)[method].apply(self2, args);
      endBatch();
      resetTracking();
      return res;
    }
    const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
    const builtInSymbols = new Set(
      /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1)
    );
    function hasOwnProperty$e(key) {
      if (!isSymbol$1(key)) key = String(key);
      const obj = toRaw(this);
      track(obj, "has", key);
      return obj.hasOwnProperty(key);
    }
    class BaseReactiveHandler {
      constructor(_isReadonly = false, _isShallow = false) {
        this._isReadonly = _isReadonly;
        this._isShallow = _isShallow;
      }
      get(target, key, receiver) {
        if (key === "__v_skip") return target["__v_skip"];
        const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
        if (key === "__v_isReactive") {
          return !isReadonly2;
        } else if (key === "__v_isReadonly") {
          return isReadonly2;
        } else if (key === "__v_isShallow") {
          return isShallow2;
        } else if (key === "__v_raw") {
          if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
          // this means the receiver is a user proxy of the reactive proxy
          Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
            return target;
          }
          return;
        }
        const targetIsArray = isArray$5(target);
        if (!isReadonly2) {
          let fn2;
          if (targetIsArray && (fn2 = arrayInstrumentations[key])) {
            return fn2;
          }
          if (key === "hasOwnProperty") {
            return hasOwnProperty$e;
          }
        }
        const res = Reflect.get(
          target,
          key,
          // if this is a proxy wrapping a ref, return methods using the raw ref
          // as receiver so that we don't have to call `toRaw` on the ref in all
          // its class methods
          isRef(target) ? target : receiver
        );
        if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
          return res;
        }
        if (!isReadonly2) {
          track(target, "get", key);
        }
        if (isShallow2) {
          return res;
        }
        if (isRef(res)) {
          return targetIsArray && isIntegerKey(key) ? res : res.value;
        }
        if (isObject$7(res)) {
          return isReadonly2 ? readonly(res) : reactive(res);
        }
        return res;
      }
    }
    class MutableReactiveHandler extends BaseReactiveHandler {
      constructor(isShallow2 = false) {
        super(false, isShallow2);
      }
      set(target, key, value, receiver) {
        let oldValue = target[key];
        if (!this._isShallow) {
          const isOldValueReadonly = isReadonly(oldValue);
          if (!isShallow(value) && !isReadonly(value)) {
            oldValue = toRaw(oldValue);
            value = toRaw(value);
          }
          if (!isArray$5(target) && isRef(oldValue) && !isRef(value)) {
            if (isOldValueReadonly) {
              return false;
            } else {
              oldValue.value = value;
              return true;
            }
          }
        }
        const hadKey = isArray$5(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key);
        const result = Reflect.set(
          target,
          key,
          value,
          isRef(target) ? target : receiver
        );
        if (target === toRaw(receiver)) {
          if (!hadKey) {
            trigger$2(target, "add", key, value);
          } else if (hasChanged(value, oldValue)) {
            trigger$2(target, "set", key, value);
          }
        }
        return result;
      }
      deleteProperty(target, key) {
        const hadKey = hasOwn$1(target, key);
        target[key];
        const result = Reflect.deleteProperty(target, key);
        if (result && hadKey) {
          trigger$2(target, "delete", key, void 0);
        }
        return result;
      }
      has(target, key) {
        const result = Reflect.has(target, key);
        if (!isSymbol$1(key) || !builtInSymbols.has(key)) {
          track(target, "has", key);
        }
        return result;
      }
      ownKeys(target) {
        track(
          target,
          "iterate",
          isArray$5(target) ? "length" : ITERATE_KEY
        );
        return Reflect.ownKeys(target);
      }
    }
    class ReadonlyReactiveHandler extends BaseReactiveHandler {
      constructor(isShallow2 = false) {
        super(true, isShallow2);
      }
      set(target, key) {
        return true;
      }
      deleteProperty(target, key) {
        return true;
      }
    }
    const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
    const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
    const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true);
    const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
    const toShallow = (value) => value;
    const getProto = (v4) => Reflect.getPrototypeOf(v4);
    function createIterableMethod(method, isReadonly2, isShallow2) {
      return function(...args) {
        const target = this["__v_raw"];
        const rawTarget = toRaw(target);
        const targetIsMap = isMap$1(rawTarget);
        const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
        const isKeyOnly = method === "keys" && targetIsMap;
        const innerIterator = target[method](...args);
        const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
        !isReadonly2 && track(
          rawTarget,
          "iterate",
          isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
        );
        return {
          // iterator protocol
          next() {
            const { value, done } = innerIterator.next();
            return done ? { value, done } : {
              value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),
              done
            };
          },
          // iterable protocol
          [Symbol.iterator]() {
            return this;
          }
        };
      };
    }
    function createReadonlyMethod(type) {
      return function(...args) {
        return type === "delete" ? false : type === "clear" ? void 0 : this;
      };
    }
    function createInstrumentations(readonly2, shallow) {
      const instrumentations = {
        get(key) {
          const target = this["__v_raw"];
          const rawTarget = toRaw(target);
          const rawKey = toRaw(key);
          if (!readonly2) {
            if (hasChanged(key, rawKey)) {
              track(rawTarget, "get", key);
            }
            track(rawTarget, "get", rawKey);
          }
          const { has: has2 } = getProto(rawTarget);
          const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
          if (has2.call(rawTarget, key)) {
            return wrap(target.get(key));
          } else if (has2.call(rawTarget, rawKey)) {
            return wrap(target.get(rawKey));
          } else if (target !== rawTarget) {
            target.get(key);
          }
        },
        get size() {
          const target = this["__v_raw"];
          !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
          return Reflect.get(target, "size", target);
        },
        has(key) {
          const target = this["__v_raw"];
          const rawTarget = toRaw(target);
          const rawKey = toRaw(key);
          if (!readonly2) {
            if (hasChanged(key, rawKey)) {
              track(rawTarget, "has", key);
            }
            track(rawTarget, "has", rawKey);
          }
          return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
        },
        forEach(callback, thisArg) {
          const observed = this;
          const target = observed["__v_raw"];
          const rawTarget = toRaw(target);
          const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive;
          !readonly2 && track(rawTarget, "iterate", ITERATE_KEY);
          return target.forEach((value, key) => {
            return callback.call(thisArg, wrap(value), wrap(key), observed);
          });
        }
      };
      extend$2(
        instrumentations,
        readonly2 ? {
          add: createReadonlyMethod("add"),
          set: createReadonlyMethod("set"),
          delete: createReadonlyMethod("delete"),
          clear: createReadonlyMethod("clear")
        } : {
          add(value) {
            if (!shallow && !isShallow(value) && !isReadonly(value)) {
              value = toRaw(value);
            }
            const target = toRaw(this);
            const proto2 = getProto(target);
            const hadKey = proto2.has.call(target, value);
            if (!hadKey) {
              target.add(value);
              trigger$2(target, "add", value, value);
            }
            return this;
          },
          set(key, value) {
            if (!shallow && !isShallow(value) && !isReadonly(value)) {
              value = toRaw(value);
            }
            const target = toRaw(this);
            const { has: has2, get: get2 } = getProto(target);
            let hadKey = has2.call(target, key);
            if (!hadKey) {
              key = toRaw(key);
              hadKey = has2.call(target, key);
            }
            const oldValue = get2.call(target, key);
            target.set(key, value);
            if (!hadKey) {
              trigger$2(target, "add", key, value);
            } else if (hasChanged(value, oldValue)) {
              trigger$2(target, "set", key, value);
            }
            return this;
          },
          delete(key) {
            const target = toRaw(this);
            const { has: has2, get: get2 } = getProto(target);
            let hadKey = has2.call(target, key);
            if (!hadKey) {
              key = toRaw(key);
              hadKey = has2.call(target, key);
            }
            get2 ? get2.call(target, key) : void 0;
            const result = target.delete(key);
            if (hadKey) {
              trigger$2(target, "delete", key, void 0);
            }
            return result;
          },
          clear() {
            const target = toRaw(this);
            const hadItems = target.size !== 0;
            const result = target.clear();
            if (hadItems) {
              trigger$2(
                target,
                "clear",
                void 0,
                void 0
              );
            }
            return result;
          }
        }
      );
      const iteratorMethods = [
        "keys",
        "values",
        "entries",
        Symbol.iterator
      ];
      iteratorMethods.forEach((method) => {
        instrumentations[method] = createIterableMethod(method, readonly2, shallow);
      });
      return instrumentations;
    }
    function createInstrumentationGetter(isReadonly2, shallow) {
      const instrumentations = createInstrumentations(isReadonly2, shallow);
      return (target, key, receiver) => {
        if (key === "__v_isReactive") {
          return !isReadonly2;
        } else if (key === "__v_isReadonly") {
          return isReadonly2;
        } else if (key === "__v_raw") {
          return target;
        }
        return Reflect.get(
          hasOwn$1(instrumentations, key) && key in target ? instrumentations : target,
          key,
          receiver
        );
      };
    }
    const mutableCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(false, false)
    };
    const shallowCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(false, true)
    };
    const readonlyCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(true, false)
    };
    const shallowReadonlyCollectionHandlers = {
      get: /* @__PURE__ */ createInstrumentationGetter(true, true)
    };
    const reactiveMap = /* @__PURE__ */ new WeakMap();
    const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
    const readonlyMap = /* @__PURE__ */ new WeakMap();
    const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
    function targetTypeMap(rawType) {
      switch (rawType) {
        case "Object":
        case "Array":
          return 1;
        case "Map":
        case "Set":
        case "WeakMap":
        case "WeakSet":
          return 2;
        default:
          return 0;
      }
    }
    function getTargetType(value) {
      return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));
    }
    function reactive(target) {
      if (isReadonly(target)) {
        return target;
      }
      return createReactiveObject(
        target,
        false,
        mutableHandlers,
        mutableCollectionHandlers,
        reactiveMap
      );
    }
    function shallowReactive(target) {
      return createReactiveObject(
        target,
        false,
        shallowReactiveHandlers,
        shallowCollectionHandlers,
        shallowReactiveMap
      );
    }
    function readonly(target) {
      return createReactiveObject(
        target,
        true,
        readonlyHandlers,
        readonlyCollectionHandlers,
        readonlyMap
      );
    }
    function shallowReadonly(target) {
      return createReactiveObject(
        target,
        true,
        shallowReadonlyHandlers,
        shallowReadonlyCollectionHandlers,
        shallowReadonlyMap
      );
    }
    function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
      if (!isObject$7(target)) {
        return target;
      }
      if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
        return target;
      }
      const existingProxy = proxyMap.get(target);
      if (existingProxy) {
        return existingProxy;
      }
      const targetType = getTargetType(target);
      if (targetType === 0) {
        return target;
      }
      const proxy = new Proxy(
        target,
        targetType === 2 ? collectionHandlers : baseHandlers
      );
      proxyMap.set(target, proxy);
      return proxy;
    }
    function isReactive(value) {
      if (isReadonly(value)) {
        return isReactive(value["__v_raw"]);
      }
      return !!(value && value["__v_isReactive"]);
    }
    function isReadonly(value) {
      return !!(value && value["__v_isReadonly"]);
    }
    function isShallow(value) {
      return !!(value && value["__v_isShallow"]);
    }
    function isProxy(value) {
      return value ? !!value["__v_raw"] : false;
    }
    function toRaw(observed) {
      const raw = observed && observed["__v_raw"];
      return raw ? toRaw(raw) : observed;
    }
    function markRaw(value) {
      if (!hasOwn$1(value, "__v_skip") && Object.isExtensible(value)) {
        def(value, "__v_skip", true);
      }
      return value;
    }
    const toReactive = (value) => isObject$7(value) ? reactive(value) : value;
    const toReadonly = (value) => isObject$7(value) ? readonly(value) : value;
    function isRef(r) {
      return r ? r["__v_isRef"] === true : false;
    }
    function ref(value) {
      return createRef(value, false);
    }
    function shallowRef(value) {
      return createRef(value, true);
    }
    function createRef(rawValue, shallow) {
      if (isRef(rawValue)) {
        return rawValue;
      }
      return new RefImpl(rawValue, shallow);
    }
    class RefImpl {
      constructor(value, isShallow2) {
        this.dep = new Dep();
        this["__v_isRef"] = true;
        this["__v_isShallow"] = false;
        this._rawValue = isShallow2 ? value : toRaw(value);
        this._value = isShallow2 ? value : toReactive(value);
        this["__v_isShallow"] = isShallow2;
      }
      get value() {
        {
          this.dep.track();
        }
        return this._value;
      }
      set value(newValue) {
        const oldValue = this._rawValue;
        const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
        newValue = useDirectValue ? newValue : toRaw(newValue);
        if (hasChanged(newValue, oldValue)) {
          this._rawValue = newValue;
          this._value = useDirectValue ? newValue : toReactive(newValue);
          {
            this.dep.trigger();
          }
        }
      }
    }
    function unref(ref2) {
      return isRef(ref2) ? ref2.value : ref2;
    }
    const shallowUnwrapHandlers = {
      get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
      set: (target, key, value, receiver) => {
        const oldValue = target[key];
        if (isRef(oldValue) && !isRef(value)) {
          oldValue.value = value;
          return true;
        } else {
          return Reflect.set(target, key, value, receiver);
        }
      }
    };
    function proxyRefs(objectWithRefs) {
      return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
    }
    class CustomRefImpl {
      constructor(factory) {
        this["__v_isRef"] = true;
        this._value = void 0;
        const dep = this.dep = new Dep();
        const { get: get2, set: set2 } = factory(dep.track.bind(dep), dep.trigger.bind(dep));
        this._get = get2;
        this._set = set2;
      }
      get value() {
        return this._value = this._get();
      }
      set value(newVal) {
        this._set(newVal);
      }
    }
    function customRef(factory) {
      return new CustomRefImpl(factory);
    }
    function toRefs(object) {
      const ret = isArray$5(object) ? new Array(object.length) : {};
      for (const key in object) {
        ret[key] = propertyToRef(object, key);
      }
      return ret;
    }
    class ObjectRefImpl {
      constructor(_object, _key, _defaultValue) {
        this._object = _object;
        this._key = _key;
        this._defaultValue = _defaultValue;
        this["__v_isRef"] = true;
        this._value = void 0;
      }
      get value() {
        const val = this._object[this._key];
        return this._value = val === void 0 ? this._defaultValue : val;
      }
      set value(newVal) {
        this._object[this._key] = newVal;
      }
      get dep() {
        return getDepFromReactive(toRaw(this._object), this._key);
      }
    }
    class GetterRefImpl {
      constructor(_getter) {
        this._getter = _getter;
        this["__v_isRef"] = true;
        this["__v_isReadonly"] = true;
        this._value = void 0;
      }
      get value() {
        return this._value = this._getter();
      }
    }
    function toRef(source, key, defaultValue) {
      if (isRef(source)) {
        return source;
      } else if (isFunction$4(source)) {
        return new GetterRefImpl(source);
      } else if (isObject$7(source) && arguments.length > 1) {
        return propertyToRef(source, key, defaultValue);
      } else {
        return ref(source);
      }
    }
    function propertyToRef(source, key, defaultValue) {
      const val = source[key];
      return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
    }
    class ComputedRefImpl {
      constructor(fn2, setter, isSSR) {
        this.fn = fn2;
        this.setter = setter;
        this._value = void 0;
        this.dep = new Dep(this);
        this.__v_isRef = true;
        this.deps = void 0;
        this.depsTail = void 0;
        this.flags = 16;
        this.globalVersion = globalVersion - 1;
        this.next = void 0;
        this.effect = this;
        this["__v_isReadonly"] = !setter;
        this.isSSR = isSSR;
      }
      /**
       * @internal
       */
      notify() {
        this.flags |= 16;
        if (!(this.flags & 8) && // avoid infinite self recursion
        activeSub !== this) {
          batch(this, true);
          return true;
        }
      }
      get value() {
        const link = this.dep.track();
        refreshComputed(this);
        if (link) {
          link.version = this.dep.version;
        }
        return this._value;
      }
      set value(newValue) {
        if (this.setter) {
          this.setter(newValue);
        }
      }
    }
    function computed$1(getterOrOptions, debugOptions, isSSR = false) {
      let getter;
      let setter;
      if (isFunction$4(getterOrOptions)) {
        getter = getterOrOptions;
      } else {
        getter = getterOrOptions.get;
        setter = getterOrOptions.set;
      }
      const cRef = new ComputedRefImpl(getter, setter, isSSR);
      return cRef;
    }
    const INITIAL_WATCHER_VALUE = {};
    const cleanupMap = /* @__PURE__ */ new WeakMap();
    let activeWatcher = void 0;
    function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) {
      if (owner) {
        let cleanups = cleanupMap.get(owner);
        if (!cleanups) cleanupMap.set(owner, cleanups = []);
        cleanups.push(cleanupFn);
      }
    }
    function watch$1(source, cb, options = EMPTY_OBJ$1) {
      const { immediate, deep, once, scheduler, augmentJob, call } = options;
      const reactiveGetter = (source2) => {
        if (deep) return source2;
        if (isShallow(source2) || deep === false || deep === 0)
          return traverse(source2, 1);
        return traverse(source2);
      };
      let effect2;
      let getter;
      let cleanup;
      let boundCleanup;
      let forceTrigger = false;
      let isMultiSource = false;
      if (isRef(source)) {
        getter = () => source.value;
        forceTrigger = isShallow(source);
      } else if (isReactive(source)) {
        getter = () => reactiveGetter(source);
        forceTrigger = true;
      } else if (isArray$5(source)) {
        isMultiSource = true;
        forceTrigger = source.some((s2) => isReactive(s2) || isShallow(s2));
        getter = () => source.map((s2) => {
          if (isRef(s2)) {
            return s2.value;
          } else if (isReactive(s2)) {
            return reactiveGetter(s2);
          } else if (isFunction$4(s2)) {
            return call ? call(s2, 2) : s2();
          } else ;
        });
      } else if (isFunction$4(source)) {
        if (cb) {
          getter = call ? () => call(source, 2) : source;
        } else {
          getter = () => {
            if (cleanup) {
              pauseTracking();
              try {
                cleanup();
              } finally {
                resetTracking();
              }
            }
            const currentEffect = activeWatcher;
            activeWatcher = effect2;
            try {
              return call ? call(source, 3, [boundCleanup]) : source(boundCleanup);
            } finally {
              activeWatcher = currentEffect;
            }
          };
        }
      } else {
        getter = NOOP;
      }
      if (cb && deep) {
        const baseGetter = getter;
        const depth = deep === true ? Infinity : deep;
        getter = () => traverse(baseGetter(), depth);
      }
      const scope = getCurrentScope();
      const watchHandle = () => {
        effect2.stop();
        if (scope && scope.active) {
          remove(scope.effects, effect2);
        }
      };
      if (once && cb) {
        const _cb = cb;
        cb = (...args) => {
          _cb(...args);
          watchHandle();
        };
      }
      let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
      const job = (immediateFirstRun) => {
        if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) {
          return;
        }
        if (cb) {
          const newValue = effect2.run();
          if (deep || forceTrigger || (isMultiSource ? newValue.some((v4, i2) => hasChanged(v4, oldValue[i2])) : hasChanged(newValue, oldValue))) {
            if (cleanup) {
              cleanup();
            }
            const currentWatcher = activeWatcher;
            activeWatcher = effect2;
            try {
              const args = [
                newValue,
                // pass undefined as the old value when it's changed for the first time
                oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
                boundCleanup
              ];
              call ? call(cb, 3, args) : (
                // @ts-expect-error
                cb(...args)
              );
              oldValue = newValue;
            } finally {
              activeWatcher = currentWatcher;
            }
          }
        } else {
          effect2.run();
        }
      };
      if (augmentJob) {
        augmentJob(job);
      }
      effect2 = new ReactiveEffect(getter);
      effect2.scheduler = scheduler ? () => scheduler(job, false) : job;
      boundCleanup = (fn2) => onWatcherCleanup(fn2, false, effect2);
      cleanup = effect2.onStop = () => {
        const cleanups = cleanupMap.get(effect2);
        if (cleanups) {
          if (call) {
            call(cleanups, 4);
          } else {
            for (const cleanup2 of cleanups) cleanup2();
          }
          cleanupMap.delete(effect2);
        }
      };
      if (cb) {
        if (immediate) {
          job(true);
        } else {
          oldValue = effect2.run();
        }
      } else if (scheduler) {
        scheduler(job.bind(null, true), true);
      } else {
        effect2.run();
      }
      watchHandle.pause = effect2.pause.bind(effect2);
      watchHandle.resume = effect2.resume.bind(effect2);
      watchHandle.stop = watchHandle;
      return watchHandle;
    }
    function traverse(value, depth = Infinity, seen) {
      if (depth <= 0 || !isObject$7(value) || value["__v_skip"]) {
        return value;
      }
      seen = seen || /* @__PURE__ */ new Set();
      if (seen.has(value)) {
        return value;
      }
      seen.add(value);
      depth--;
      if (isRef(value)) {
        traverse(value.value, depth, seen);
      } else if (isArray$5(value)) {
        for (let i2 = 0; i2 < value.length; i2++) {
          traverse(value[i2], depth, seen);
        }
      } else if (isSet$1(value) || isMap$1(value)) {
        value.forEach((v4) => {
          traverse(v4, depth, seen);
        });
      } else if (isPlainObject$2(value)) {
        for (const key in value) {
          traverse(value[key], depth, seen);
        }
        for (const key of Object.getOwnPropertySymbols(value)) {
          if (Object.prototype.propertyIsEnumerable.call(value, key)) {
            traverse(value[key], depth, seen);
          }
        }
      }
      return value;
    }
    /**
    * @vue/runtime-core v3.5.13
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    const stack = [];
    let isWarning = false;
    function warn$1(msg, ...args) {
      if (isWarning) return;
      isWarning = true;
      pauseTracking();
      const instance = stack.length ? stack[stack.length - 1].component : null;
      const appWarnHandler = instance && instance.appContext.config.warnHandler;
      const trace = getComponentTrace();
      if (appWarnHandler) {
        callWithErrorHandling(
          appWarnHandler,
          instance,
          11,
          [
            // eslint-disable-next-line no-restricted-syntax
            msg + args.map((a2) => {
              var _a2, _b2;
              return (_b2 = (_a2 = a2.toString) == null ? void 0 : _a2.call(a2)) != null ? _b2 : JSON.stringify(a2);
            }).join(""),
            instance && instance.proxy,
            trace.map(
              ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
            ).join("\n"),
            trace
          ]
        );
      } else {
        const warnArgs = [`[Vue warn]: ${msg}`, ...args];
        if (trace.length && // avoid spamming console during tests
        true) {
          warnArgs.push(`
`, ...formatTrace(trace));
        }
        console.warn(...warnArgs);
      }
      resetTracking();
      isWarning = false;
    }
    function getComponentTrace() {
      let currentVNode = stack[stack.length - 1];
      if (!currentVNode) {
        return [];
      }
      const normalizedStack = [];
      while (currentVNode) {
        const last2 = normalizedStack[0];
        if (last2 && last2.vnode === currentVNode) {
          last2.recurseCount++;
        } else {
          normalizedStack.push({
            vnode: currentVNode,
            recurseCount: 0
          });
        }
        const parentInstance = currentVNode.component && currentVNode.component.parent;
        currentVNode = parentInstance && parentInstance.vnode;
      }
      return normalizedStack;
    }
    function formatTrace(trace) {
      const logs = [];
      trace.forEach((entry, i2) => {
        logs.push(...i2 === 0 ? [] : [`
`], ...formatTraceEntry(entry));
      });
      return logs;
    }
    function formatTraceEntry({ vnode, recurseCount }) {
      const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
      const isRoot = vnode.component ? vnode.component.parent == null : false;
      const open2 = ` at <${formatComponentName(
        vnode.component,
        vnode.type,
        isRoot
      )}`;
      const close2 = `>` + postfix;
      return vnode.props ? [open2, ...formatProps(vnode.props), close2] : [open2 + close2];
    }
    function formatProps(props2) {
      const res = [];
      const keys2 = Object.keys(props2);
      keys2.slice(0, 3).forEach((key) => {
        res.push(...formatProp(key, props2[key]));
      });
      if (keys2.length > 3) {
        res.push(` ...`);
      }
      return res;
    }
    function formatProp(key, value, raw) {
      if (isString$3(value)) {
        value = JSON.stringify(value);
        return raw ? value : [`${key}=${value}`];
      } else if (typeof value === "number" || typeof value === "boolean" || value == null) {
        return raw ? value : [`${key}=${value}`];
      } else if (isRef(value)) {
        value = formatProp(key, toRaw(value.value), true);
        return raw ? value : [`${key}=Ref<`, value, `>`];
      } else if (isFunction$4(value)) {
        return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
      } else {
        value = toRaw(value);
        return raw ? value : [`${key}=`, value];
      }
    }
    function callWithErrorHandling(fn2, instance, type, args) {
      try {
        return args ? fn2(...args) : fn2();
      } catch (err) {
        handleError(err, instance, type);
      }
    }
    function callWithAsyncErrorHandling(fn2, instance, type, args) {
      if (isFunction$4(fn2)) {
        const res = callWithErrorHandling(fn2, instance, type, args);
        if (res && isPromise$1(res)) {
          res.catch((err) => {
            handleError(err, instance, type);
          });
        }
        return res;
      }
      if (isArray$5(fn2)) {
        const values = [];
        for (let i2 = 0; i2 < fn2.length; i2++) {
          values.push(callWithAsyncErrorHandling(fn2[i2], instance, type, args));
        }
        return values;
      }
    }
    function handleError(err, instance, type, throwInDev = true) {
      const contextVNode = instance ? instance.vnode : null;
      const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ$1;
      if (instance) {
        let cur = instance.parent;
        const exposedInstance = instance.proxy;
        const errorInfo = `https://vuejs.org/error-reference/#runtime-${type}`;
        while (cur) {
          const errorCapturedHooks = cur.ec;
          if (errorCapturedHooks) {
            for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
              if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
                return;
              }
            }
          }
          cur = cur.parent;
        }
        if (errorHandler) {
          pauseTracking();
          callWithErrorHandling(errorHandler, null, 10, [
            err,
            exposedInstance,
            errorInfo
          ]);
          resetTracking();
          return;
        }
      }
      logError$1(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction);
    }
    function logError$1(err, type, contextVNode, throwInDev = true, throwInProd = false) {
      if (throwInProd) {
        throw err;
      } else {
        console.error(err);
      }
    }
    const queue = [];
    let flushIndex = -1;
    const pendingPostFlushCbs = [];
    let activePostFlushCbs = null;
    let postFlushIndex = 0;
    const resolvedPromise = /* @__PURE__ */ Promise.resolve();
    let currentFlushPromise = null;
    function nextTick(fn2) {
      const p2 = currentFlushPromise || resolvedPromise;
      return fn2 ? p2.then(this ? fn2.bind(this) : fn2) : p2;
    }
    function findInsertionIndex$1(id) {
      let start2 = flushIndex + 1;
      let end2 = queue.length;
      while (start2 < end2) {
        const middle = start2 + end2 >>> 1;
        const middleJob = queue[middle];
        const middleJobId = getId$1(middleJob);
        if (middleJobId < id || middleJobId === id && middleJob.flags & 2) {
          start2 = middle + 1;
        } else {
          end2 = middle;
        }
      }
      return start2;
    }
    function queueJob(job) {
      if (!(job.flags & 1)) {
        const jobId = getId$1(job);
        const lastJob = queue[queue.length - 1];
        if (!lastJob || // fast path when the job id is larger than the tail
        !(job.flags & 2) && jobId >= getId$1(lastJob)) {
          queue.push(job);
        } else {
          queue.splice(findInsertionIndex$1(jobId), 0, job);
        }
        job.flags |= 1;
        queueFlush();
      }
    }
    function queueFlush() {
      if (!currentFlushPromise) {
        currentFlushPromise = resolvedPromise.then(flushJobs);
      }
    }
    function queuePostFlushCb(cb) {
      if (!isArray$5(cb)) {
        if (activePostFlushCbs && cb.id === -1) {
          activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
        } else if (!(cb.flags & 1)) {
          pendingPostFlushCbs.push(cb);
          cb.flags |= 1;
        }
      } else {
        pendingPostFlushCbs.push(...cb);
      }
      queueFlush();
    }
    function flushPreFlushCbs(instance, seen, i2 = flushIndex + 1) {
      for (; i2 < queue.length; i2++) {
        const cb = queue[i2];
        if (cb && cb.flags & 2) {
          if (instance && cb.id !== instance.uid) {
            continue;
          }
          queue.splice(i2, 1);
          i2--;
          if (cb.flags & 4) {
            cb.flags &= -2;
          }
          cb();
          if (!(cb.flags & 4)) {
            cb.flags &= -2;
          }
        }
      }
    }
    function flushPostFlushCbs(seen) {
      if (pendingPostFlushCbs.length) {
        const deduped = [...new Set(pendingPostFlushCbs)].sort(
          (a2, b2) => getId$1(a2) - getId$1(b2)
        );
        pendingPostFlushCbs.length = 0;
        if (activePostFlushCbs) {
          activePostFlushCbs.push(...deduped);
          return;
        }
        activePostFlushCbs = deduped;
        for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
          const cb = activePostFlushCbs[postFlushIndex];
          if (cb.flags & 4) {
            cb.flags &= -2;
          }
          if (!(cb.flags & 8)) cb();
          cb.flags &= -2;
        }
        activePostFlushCbs = null;
        postFlushIndex = 0;
      }
    }
    const getId$1 = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
    function flushJobs(seen) {
      try {
        for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
          const job = queue[flushIndex];
          if (job && !(job.flags & 8)) {
            if (false) ;
            if (job.flags & 4) {
              job.flags &= ~1;
            }
            callWithErrorHandling(
              job,
              job.i,
              job.i ? 15 : 14
            );
            if (!(job.flags & 4)) {
              job.flags &= ~1;
            }
          }
        }
      } finally {
        for (; flushIndex < queue.length; flushIndex++) {
          const job = queue[flushIndex];
          if (job) {
            job.flags &= -2;
          }
        }
        flushIndex = -1;
        queue.length = 0;
        flushPostFlushCbs();
        currentFlushPromise = null;
        if (queue.length || pendingPostFlushCbs.length) {
          flushJobs();
        }
      }
    }
    let currentRenderingInstance = null;
    let currentScopeId = null;
    function setCurrentRenderingInstance(instance) {
      const prev = currentRenderingInstance;
      currentRenderingInstance = instance;
      currentScopeId = instance && instance.type.__scopeId || null;
      return prev;
    }
    function withCtx(fn2, ctx = currentRenderingInstance, isNonScopedSlot) {
      if (!ctx) return fn2;
      if (fn2._n) {
        return fn2;
      }
      const renderFnWithContext = (...args) => {
        if (renderFnWithContext._d) {
          setBlockTracking(-1);
        }
        const prevInstance = setCurrentRenderingInstance(ctx);
        let res;
        try {
          res = fn2(...args);
        } finally {
          setCurrentRenderingInstance(prevInstance);
          if (renderFnWithContext._d) {
            setBlockTracking(1);
          }
        }
        return res;
      };
      renderFnWithContext._n = true;
      renderFnWithContext._c = true;
      renderFnWithContext._d = true;
      return renderFnWithContext;
    }
    function withDirectives(vnode, directives) {
      if (currentRenderingInstance === null) {
        return vnode;
      }
      const instance = getComponentPublicInstance(currentRenderingInstance);
      const bindings = vnode.dirs || (vnode.dirs = []);
      for (let i2 = 0; i2 < directives.length; i2++) {
        let [dir3, value, arg, modifiers = EMPTY_OBJ$1] = directives[i2];
        if (dir3) {
          if (isFunction$4(dir3)) {
            dir3 = {
              mounted: dir3,
              updated: dir3
            };
          }
          if (dir3.deep) {
            traverse(value);
          }
          bindings.push({
            dir: dir3,
            instance,
            value,
            oldValue: void 0,
            arg,
            modifiers
          });
        }
      }
      return vnode;
    }
    function invokeDirectiveHook(vnode, prevVNode, instance, name) {
      const bindings = vnode.dirs;
      const oldBindings = prevVNode && prevVNode.dirs;
      for (let i2 = 0; i2 < bindings.length; i2++) {
        const binding = bindings[i2];
        if (oldBindings) {
          binding.oldValue = oldBindings[i2].value;
        }
        let hook = binding.dir[name];
        if (hook) {
          pauseTracking();
          callWithAsyncErrorHandling(hook, instance, 8, [
            vnode.el,
            binding,
            vnode,
            prevVNode
          ]);
          resetTracking();
        }
      }
    }
    const TeleportEndKey = Symbol("_vte");
    const isTeleport = (type) => type.__isTeleport;
    const isTeleportDisabled = (props2) => props2 && (props2.disabled || props2.disabled === "");
    const isTeleportDeferred = (props2) => props2 && (props2.defer || props2.defer === "");
    const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
    const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
    const resolveTarget = (props2, select) => {
      const targetSelector = props2 && props2.to;
      if (isString$3(targetSelector)) {
        if (!select) {
          return null;
        } else {
          const target = select(targetSelector);
          return target;
        }
      } else {
        return targetSelector;
      }
    };
    const TeleportImpl = {
      name: "Teleport",
      __isTeleport: true,
      process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
        const {
          mc: mountChildren,
          pc: patchChildren,
          pbc: patchBlockChildren,
          o: { insert, querySelector, createText, createComment }
        } = internals;
        const disabled = isTeleportDisabled(n2.props);
        let { shapeFlag, children, dynamicChildren } = n2;
        if (n1 == null) {
          const placeholder = n2.el = createText("");
          const mainAnchor = n2.anchor = createText("");
          insert(placeholder, container, anchor);
          insert(mainAnchor, container, anchor);
          const mount = (container2, anchor2) => {
            if (shapeFlag & 16) {
              if (parentComponent && parentComponent.isCE) {
                parentComponent.ce._teleportTarget = container2;
              }
              mountChildren(
                children,
                container2,
                anchor2,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            }
          };
          const mountToTarget = () => {
            const target = n2.target = resolveTarget(n2.props, querySelector);
            const targetAnchor = prepareAnchor(target, n2, createText, insert);
            if (target) {
              if (namespace !== "svg" && isTargetSVG(target)) {
                namespace = "svg";
              } else if (namespace !== "mathml" && isTargetMathML(target)) {
                namespace = "mathml";
              }
              if (!disabled) {
                mount(target, targetAnchor);
                updateCssVars(n2, false);
              }
            }
          };
          if (disabled) {
            mount(container, mainAnchor);
            updateCssVars(n2, true);
          }
          if (isTeleportDeferred(n2.props)) {
            queuePostRenderEffect(() => {
              mountToTarget();
              n2.el.__isMounted = true;
            }, parentSuspense);
          } else {
            mountToTarget();
          }
        } else {
          if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
            queuePostRenderEffect(() => {
              TeleportImpl.process(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized,
                internals
              );
              delete n1.el.__isMounted;
            }, parentSuspense);
            return;
          }
          n2.el = n1.el;
          n2.targetStart = n1.targetStart;
          const mainAnchor = n2.anchor = n1.anchor;
          const target = n2.target = n1.target;
          const targetAnchor = n2.targetAnchor = n1.targetAnchor;
          const wasDisabled = isTeleportDisabled(n1.props);
          const currentContainer = wasDisabled ? container : target;
          const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
          if (namespace === "svg" || isTargetSVG(target)) {
            namespace = "svg";
          } else if (namespace === "mathml" || isTargetMathML(target)) {
            namespace = "mathml";
          }
          if (dynamicChildren) {
            patchBlockChildren(
              n1.dynamicChildren,
              dynamicChildren,
              currentContainer,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds
            );
            traverseStaticChildren(n1, n2, true);
          } else if (!optimized) {
            patchChildren(
              n1,
              n2,
              currentContainer,
              currentAnchor,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              false
            );
          }
          if (disabled) {
            if (!wasDisabled) {
              moveTeleport(
                n2,
                container,
                mainAnchor,
                internals,
                1
              );
            } else {
              if (n2.props && n1.props && n2.props.to !== n1.props.to) {
                n2.props.to = n1.props.to;
              }
            }
          } else {
            if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {
              const nextTarget = n2.target = resolveTarget(
                n2.props,
                querySelector
              );
              if (nextTarget) {
                moveTeleport(
                  n2,
                  nextTarget,
                  null,
                  internals,
                  0
                );
              }
            } else if (wasDisabled) {
              moveTeleport(
                n2,
                target,
                targetAnchor,
                internals,
                1
              );
            }
          }
          updateCssVars(n2, disabled);
        }
      },
      remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
        const {
          shapeFlag,
          children,
          anchor,
          targetStart,
          targetAnchor,
          target,
          props: props2
        } = vnode;
        if (target) {
          hostRemove(targetStart);
          hostRemove(targetAnchor);
        }
        doRemove && hostRemove(anchor);
        if (shapeFlag & 16) {
          const shouldRemove = doRemove || !isTeleportDisabled(props2);
          for (let i2 = 0; i2 < children.length; i2++) {
            const child = children[i2];
            unmount(
              child,
              parentComponent,
              parentSuspense,
              shouldRemove,
              !!child.dynamicChildren
            );
          }
        }
      },
      move: moveTeleport,
      hydrate: hydrateTeleport
    };
    function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2) {
      if (moveType === 0) {
        insert(vnode.targetAnchor, container, parentAnchor);
      }
      const { el, anchor, shapeFlag, children, props: props2 } = vnode;
      const isReorder = moveType === 2;
      if (isReorder) {
        insert(el, container, parentAnchor);
      }
      if (!isReorder || isTeleportDisabled(props2)) {
        if (shapeFlag & 16) {
          for (let i2 = 0; i2 < children.length; i2++) {
            move(
              children[i2],
              container,
              parentAnchor,
              2
            );
          }
        }
      }
      if (isReorder) {
        insert(anchor, container, parentAnchor);
      }
    }
    function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
      o: { nextSibling: nextSibling2, parentNode: parentNode2, querySelector, insert, createText }
    }, hydrateChildren) {
      const target = vnode.target = resolveTarget(
        vnode.props,
        querySelector
      );
      if (target) {
        const disabled = isTeleportDisabled(vnode.props);
        const targetNode = target._lpa || target.firstChild;
        if (vnode.shapeFlag & 16) {
          if (disabled) {
            vnode.anchor = hydrateChildren(
              nextSibling2(node),
              vnode,
              parentNode2(node),
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized
            );
            vnode.targetStart = targetNode;
            vnode.targetAnchor = targetNode && nextSibling2(targetNode);
          } else {
            vnode.anchor = nextSibling2(node);
            let targetAnchor = targetNode;
            while (targetAnchor) {
              if (targetAnchor && targetAnchor.nodeType === 8) {
                if (targetAnchor.data === "teleport start anchor") {
                  vnode.targetStart = targetAnchor;
                } else if (targetAnchor.data === "teleport anchor") {
                  vnode.targetAnchor = targetAnchor;
                  target._lpa = vnode.targetAnchor && nextSibling2(vnode.targetAnchor);
                  break;
                }
              }
              targetAnchor = nextSibling2(targetAnchor);
            }
            if (!vnode.targetAnchor) {
              prepareAnchor(target, vnode, createText, insert);
            }
            hydrateChildren(
              targetNode && nextSibling2(targetNode),
              vnode,
              target,
              parentComponent,
              parentSuspense,
              slotScopeIds,
              optimized
            );
          }
        }
        updateCssVars(vnode, disabled);
      }
      return vnode.anchor && nextSibling2(vnode.anchor);
    }
    const Teleport$1 = TeleportImpl;
    function updateCssVars(vnode, isDisabled) {
      const ctx = vnode.ctx;
      if (ctx && ctx.ut) {
        let node, anchor;
        if (isDisabled) {
          node = vnode.el;
          anchor = vnode.anchor;
        } else {
          node = vnode.targetStart;
          anchor = vnode.targetAnchor;
        }
        while (node && node !== anchor) {
          if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
          node = node.nextSibling;
        }
        ctx.ut();
      }
    }
    function prepareAnchor(target, vnode, createText, insert) {
      const targetStart = vnode.targetStart = createText("");
      const targetAnchor = vnode.targetAnchor = createText("");
      targetStart[TeleportEndKey] = targetAnchor;
      if (target) {
        insert(targetStart, target);
        insert(targetAnchor, target);
      }
      return targetAnchor;
    }
    const leaveCbKey = Symbol("_leaveCb");
    const enterCbKey$1 = Symbol("_enterCb");
    function useTransitionState() {
      const state = {
        isMounted: false,
        isLeaving: false,
        isUnmounting: false,
        leavingVNodes: /* @__PURE__ */ new Map()
      };
      onMounted(() => {
        state.isMounted = true;
      });
      onBeforeUnmount(() => {
        state.isUnmounting = true;
      });
      return state;
    }
    const TransitionHookValidator = [Function, Array];
    const BaseTransitionPropsValidators = {
      mode: String,
      appear: Boolean,
      persisted: Boolean,
      // enter
      onBeforeEnter: TransitionHookValidator,
      onEnter: TransitionHookValidator,
      onAfterEnter: TransitionHookValidator,
      onEnterCancelled: TransitionHookValidator,
      // leave
      onBeforeLeave: TransitionHookValidator,
      onLeave: TransitionHookValidator,
      onAfterLeave: TransitionHookValidator,
      onLeaveCancelled: TransitionHookValidator,
      // appear
      onBeforeAppear: TransitionHookValidator,
      onAppear: TransitionHookValidator,
      onAfterAppear: TransitionHookValidator,
      onAppearCancelled: TransitionHookValidator
    };
    const recursiveGetSubtree = (instance) => {
      const subTree = instance.subTree;
      return subTree.component ? recursiveGetSubtree(subTree.component) : subTree;
    };
    const BaseTransitionImpl = {
      name: `BaseTransition`,
      props: BaseTransitionPropsValidators,
      setup(props2, { slots }) {
        const instance = getCurrentInstance();
        const state = useTransitionState();
        return () => {
          const children = slots.default && getTransitionRawChildren(slots.default(), true);
          if (!children || !children.length) {
            return;
          }
          const child = findNonCommentChild(children);
          const rawProps = toRaw(props2);
          const { mode } = rawProps;
          if (state.isLeaving) {
            return emptyPlaceholder(child);
          }
          const innerChild = getInnerChild$1(child);
          if (!innerChild) {
            return emptyPlaceholder(child);
          }
          let enterHooks = resolveTransitionHooks(
            innerChild,
            rawProps,
            state,
            instance,
            // #11061, ensure enterHooks is fresh after clone
            (hooks) => enterHooks = hooks
          );
          if (innerChild.type !== Comment) {
            setTransitionHooks(innerChild, enterHooks);
          }
          let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
          if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
            let leavingHooks = resolveTransitionHooks(
              oldInnerChild,
              rawProps,
              state,
              instance
            );
            setTransitionHooks(oldInnerChild, leavingHooks);
            if (mode === "out-in" && innerChild.type !== Comment) {
              state.isLeaving = true;
              leavingHooks.afterLeave = () => {
                state.isLeaving = false;
                if (!(instance.job.flags & 8)) {
                  instance.update();
                }
                delete leavingHooks.afterLeave;
                oldInnerChild = void 0;
              };
              return emptyPlaceholder(child);
            } else if (mode === "in-out" && innerChild.type !== Comment) {
              leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {
                const leavingVNodesCache = getLeavingNodesForType(
                  state,
                  oldInnerChild
                );
                leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;
                el[leaveCbKey] = () => {
                  earlyRemove();
                  el[leaveCbKey] = void 0;
                  delete enterHooks.delayedLeave;
                  oldInnerChild = void 0;
                };
                enterHooks.delayedLeave = () => {
                  delayedLeave();
                  delete enterHooks.delayedLeave;
                  oldInnerChild = void 0;
                };
              };
            } else {
              oldInnerChild = void 0;
            }
          } else if (oldInnerChild) {
            oldInnerChild = void 0;
          }
          return child;
        };
      }
    };
    function findNonCommentChild(children) {
      let child = children[0];
      if (children.length > 1) {
        for (const c2 of children) {
          if (c2.type !== Comment) {
            child = c2;
            break;
          }
        }
      }
      return child;
    }
    const BaseTransition = BaseTransitionImpl;
    function getLeavingNodesForType(state, vnode) {
      const { leavingVNodes } = state;
      let leavingVNodesCache = leavingVNodes.get(vnode.type);
      if (!leavingVNodesCache) {
        leavingVNodesCache = /* @__PURE__ */ Object.create(null);
        leavingVNodes.set(vnode.type, leavingVNodesCache);
      }
      return leavingVNodesCache;
    }
    function resolveTransitionHooks(vnode, props2, state, instance, postClone) {
      const {
        appear,
        mode,
        persisted = false,
        onBeforeEnter,
        onEnter,
        onAfterEnter,
        onEnterCancelled,
        onBeforeLeave,
        onLeave: onLeave2,
        onAfterLeave,
        onLeaveCancelled,
        onBeforeAppear,
        onAppear,
        onAfterAppear,
        onAppearCancelled
      } = props2;
      const key = String(vnode.key);
      const leavingVNodesCache = getLeavingNodesForType(state, vnode);
      const callHook2 = (hook, args) => {
        hook && callWithAsyncErrorHandling(
          hook,
          instance,
          9,
          args
        );
      };
      const callAsyncHook = (hook, args) => {
        const done = args[1];
        callHook2(hook, args);
        if (isArray$5(hook)) {
          if (hook.every((hook2) => hook2.length <= 1)) done();
        } else if (hook.length <= 1) {
          done();
        }
      };
      const hooks = {
        mode,
        persisted,
        beforeEnter(el) {
          let hook = onBeforeEnter;
          if (!state.isMounted) {
            if (appear) {
              hook = onBeforeAppear || onBeforeEnter;
            } else {
              return;
            }
          }
          if (el[leaveCbKey]) {
            el[leaveCbKey](
              true
              /* cancelled */
            );
          }
          const leavingVNode = leavingVNodesCache[key];
          if (leavingVNode && isSameVNodeType(vnode, leavingVNode) && leavingVNode.el[leaveCbKey]) {
            leavingVNode.el[leaveCbKey]();
          }
          callHook2(hook, [el]);
        },
        enter(el) {
          let hook = onEnter;
          let afterHook = onAfterEnter;
          let cancelHook = onEnterCancelled;
          if (!state.isMounted) {
            if (appear) {
              hook = onAppear || onEnter;
              afterHook = onAfterAppear || onAfterEnter;
              cancelHook = onAppearCancelled || onEnterCancelled;
            } else {
              return;
            }
          }
          let called = false;
          const done = el[enterCbKey$1] = (cancelled) => {
            if (called) return;
            called = true;
            if (cancelled) {
              callHook2(cancelHook, [el]);
            } else {
              callHook2(afterHook, [el]);
            }
            if (hooks.delayedLeave) {
              hooks.delayedLeave();
            }
            el[enterCbKey$1] = void 0;
          };
          if (hook) {
            callAsyncHook(hook, [el, done]);
          } else {
            done();
          }
        },
        leave(el, remove2) {
          const key2 = String(vnode.key);
          if (el[enterCbKey$1]) {
            el[enterCbKey$1](
              true
              /* cancelled */
            );
          }
          if (state.isUnmounting) {
            return remove2();
          }
          callHook2(onBeforeLeave, [el]);
          let called = false;
          const done = el[leaveCbKey] = (cancelled) => {
            if (called) return;
            called = true;
            remove2();
            if (cancelled) {
              callHook2(onLeaveCancelled, [el]);
            } else {
              callHook2(onAfterLeave, [el]);
            }
            el[leaveCbKey] = void 0;
            if (leavingVNodesCache[key2] === vnode) {
              delete leavingVNodesCache[key2];
            }
          };
          leavingVNodesCache[key2] = vnode;
          if (onLeave2) {
            callAsyncHook(onLeave2, [el, done]);
          } else {
            done();
          }
        },
        clone(vnode2) {
          const hooks2 = resolveTransitionHooks(
            vnode2,
            props2,
            state,
            instance,
            postClone
          );
          if (postClone) postClone(hooks2);
          return hooks2;
        }
      };
      return hooks;
    }
    function emptyPlaceholder(vnode) {
      if (isKeepAlive(vnode)) {
        vnode = cloneVNode(vnode);
        vnode.children = null;
        return vnode;
      }
    }
    function getInnerChild$1(vnode) {
      if (!isKeepAlive(vnode)) {
        if (isTeleport(vnode.type) && vnode.children) {
          return findNonCommentChild(vnode.children);
        }
        return vnode;
      }
      const { shapeFlag, children } = vnode;
      if (children) {
        if (shapeFlag & 16) {
          return children[0];
        }
        if (shapeFlag & 32 && isFunction$4(children.default)) {
          return children.default();
        }
      }
    }
    function setTransitionHooks(vnode, hooks) {
      if (vnode.shapeFlag & 6 && vnode.component) {
        vnode.transition = hooks;
        setTransitionHooks(vnode.component.subTree, hooks);
      } else if (vnode.shapeFlag & 128) {
        vnode.ssContent.transition = hooks.clone(vnode.ssContent);
        vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
      } else {
        vnode.transition = hooks;
      }
    }
    function getTransitionRawChildren(children, keepComment = false, parentKey) {
      let ret = [];
      let keyedFragmentCount = 0;
      for (let i2 = 0; i2 < children.length; i2++) {
        let child = children[i2];
        const key = parentKey == null ? child.key : String(parentKey) + String(child.key != null ? child.key : i2);
        if (child.type === Fragment) {
          if (child.patchFlag & 128) keyedFragmentCount++;
          ret = ret.concat(
            getTransitionRawChildren(child.children, keepComment, key)
          );
        } else if (keepComment || child.type !== Comment) {
          ret.push(key != null ? cloneVNode(child, { key }) : child);
        }
      }
      if (keyedFragmentCount > 1) {
        for (let i2 = 0; i2 < ret.length; i2++) {
          ret[i2].patchFlag = -2;
        }
      }
      return ret;
    }
    /*! #__NO_SIDE_EFFECTS__ */
    // @__NO_SIDE_EFFECTS__
    function defineComponent(options, extraOptions) {
      return isFunction$4(options) ? (
        // #8236: extend call and options.name access are considered side-effects
        // by Rollup, so we have to wrap it in a pure-annotated IIFE.
        /* @__PURE__ */ (() => extend$2({ name: options.name }, extraOptions, { setup: options }))()
      ) : options;
    }
    function markAsyncBoundary(instance) {
      instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
    }
    function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
      if (isArray$5(rawRef)) {
        rawRef.forEach(
          (r, i2) => setRef(
            r,
            oldRawRef && (isArray$5(oldRawRef) ? oldRawRef[i2] : oldRawRef),
            parentSuspense,
            vnode,
            isUnmount
          )
        );
        return;
      }
      if (isAsyncWrapper(vnode) && !isUnmount) {
        if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
          setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
        }
        return;
      }
      const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
      const value = isUnmount ? null : refValue;
      const { i: owner, r: ref3 } = rawRef;
      const oldRef = oldRawRef && oldRawRef.r;
      const refs = owner.refs === EMPTY_OBJ$1 ? owner.refs = {} : owner.refs;
      const setupState = owner.setupState;
      const rawSetupState = toRaw(setupState);
      const canSetSetupRef = setupState === EMPTY_OBJ$1 ? () => false : (key) => {
        return hasOwn$1(rawSetupState, key);
      };
      if (oldRef != null && oldRef !== ref3) {
        if (isString$3(oldRef)) {
          refs[oldRef] = null;
          if (canSetSetupRef(oldRef)) {
            setupState[oldRef] = null;
          }
        } else if (isRef(oldRef)) {
          oldRef.value = null;
        }
      }
      if (isFunction$4(ref3)) {
        callWithErrorHandling(ref3, owner, 12, [value, refs]);
      } else {
        const _isString = isString$3(ref3);
        const _isRef = isRef(ref3);
        if (_isString || _isRef) {
          const doSet = () => {
            if (rawRef.f) {
              const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : ref3.value;
              if (isUnmount) {
                isArray$5(existing) && remove(existing, refValue);
              } else {
                if (!isArray$5(existing)) {
                  if (_isString) {
                    refs[ref3] = [refValue];
                    if (canSetSetupRef(ref3)) {
                      setupState[ref3] = refs[ref3];
                    }
                  } else {
                    ref3.value = [refValue];
                    if (rawRef.k) refs[rawRef.k] = ref3.value;
                  }
                } else if (!existing.includes(refValue)) {
                  existing.push(refValue);
                }
              }
            } else if (_isString) {
              refs[ref3] = value;
              if (canSetSetupRef(ref3)) {
                setupState[ref3] = value;
              }
            } else if (_isRef) {
              ref3.value = value;
              if (rawRef.k) refs[rawRef.k] = value;
            } else ;
          };
          if (value) {
            doSet.id = -1;
            queuePostRenderEffect(doSet, parentSuspense);
          } else {
            doSet();
          }
        }
      }
    }
    getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
    getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
    const isAsyncWrapper = (i2) => !!i2.type.__asyncLoader;
    const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
    function onActivated(hook, target) {
      registerKeepAliveHook(hook, "a", target);
    }
    function onDeactivated(hook, target) {
      registerKeepAliveHook(hook, "da", target);
    }
    function registerKeepAliveHook(hook, type, target = currentInstance) {
      const wrappedHook = hook.__wdc || (hook.__wdc = () => {
        let current = target;
        while (current) {
          if (current.isDeactivated) {
            return;
          }
          current = current.parent;
        }
        return hook();
      });
      injectHook(type, wrappedHook, target);
      if (target) {
        let current = target.parent;
        while (current && current.parent) {
          if (isKeepAlive(current.parent.vnode)) {
            injectToKeepAliveRoot(wrappedHook, type, target, current);
          }
          current = current.parent;
        }
      }
    }
    function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
      const injected = injectHook(
        type,
        hook,
        keepAliveRoot,
        true
        /* prepend */
      );
      onUnmounted(() => {
        remove(keepAliveRoot[type], injected);
      }, target);
    }
    function injectHook(type, hook, target = currentInstance, prepend = false) {
      if (target) {
        const hooks = target[type] || (target[type] = []);
        const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
          pauseTracking();
          const reset = setCurrentInstance(target);
          const res = callWithAsyncErrorHandling(hook, target, type, args);
          reset();
          resetTracking();
          return res;
        });
        if (prepend) {
          hooks.unshift(wrappedHook);
        } else {
          hooks.push(wrappedHook);
        }
        return wrappedHook;
      }
    }
    const createHook = (lifecycle2) => (hook, target = currentInstance) => {
      if (!isInSSRComponentSetup || lifecycle2 === "sp") {
        injectHook(lifecycle2, (...args) => hook(...args), target);
      }
    };
    const onBeforeMount = createHook("bm");
    const onMounted = createHook("m");
    const onBeforeUpdate = createHook(
      "bu"
    );
    const onUpdated = createHook("u");
    const onBeforeUnmount = createHook(
      "bum"
    );
    const onUnmounted = createHook("um");
    const onServerPrefetch = createHook(
      "sp"
    );
    const onRenderTriggered = createHook("rtg");
    const onRenderTracked = createHook("rtc");
    function onErrorCaptured(hook, target = currentInstance) {
      injectHook("ec", hook, target);
    }
    const COMPONENTS = "components";
    const DIRECTIVES = "directives";
    function resolveComponent(name, maybeSelfReference) {
      return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
    }
    const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
    function resolveDynamicComponent(component2) {
      if (isString$3(component2)) {
        return resolveAsset(COMPONENTS, component2, false) || component2;
      } else {
        return component2 || NULL_DYNAMIC_COMPONENT;
      }
    }
    function resolveDirective(name) {
      return resolveAsset(DIRECTIVES, name);
    }
    function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
      const instance = currentRenderingInstance || currentInstance;
      if (instance) {
        const Component = instance.type;
        if (type === COMPONENTS) {
          const selfName = getComponentName(
            Component,
            false
          );
          if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize$2(camelize(name)))) {
            return Component;
          }
        }
        const res = (
          // local registration
          // check instance[type] first which is resolved for options API
          resolve(instance[type] || Component[type], name) || // global registration
          resolve(instance.appContext[type], name)
        );
        if (!res && maybeSelfReference) {
          return Component;
        }
        return res;
      }
    }
    function resolve(registry, name) {
      return registry && (registry[name] || registry[camelize(name)] || registry[capitalize$2(camelize(name))]);
    }
    function renderList(source, renderItem, cache2, index) {
      let ret;
      const cached = cache2;
      const sourceIsArray = isArray$5(source);
      if (sourceIsArray || isString$3(source)) {
        const sourceIsReactiveArray = sourceIsArray && isReactive(source);
        let needsWrap = false;
        if (sourceIsReactiveArray) {
          needsWrap = !isShallow(source);
          source = shallowReadArray(source);
        }
        ret = new Array(source.length);
        for (let i2 = 0, l2 = source.length; i2 < l2; i2++) {
          ret[i2] = renderItem(
            needsWrap ? toReactive(source[i2]) : source[i2],
            i2,
            void 0,
            cached
          );
        }
      } else if (typeof source === "number") {
        ret = new Array(source);
        for (let i2 = 0; i2 < source; i2++) {
          ret[i2] = renderItem(i2 + 1, i2, void 0, cached);
        }
      } else if (isObject$7(source)) {
        if (source[Symbol.iterator]) {
          ret = Array.from(
            source,
            (item, i2) => renderItem(item, i2, void 0, cached)
          );
        } else {
          const keys2 = Object.keys(source);
          ret = new Array(keys2.length);
          for (let i2 = 0, l2 = keys2.length; i2 < l2; i2++) {
            const key = keys2[i2];
            ret[i2] = renderItem(source[key], key, i2, cached);
          }
        }
      } else {
        ret = [];
      }
      return ret;
    }
    function createSlots(slots, dynamicSlots) {
      for (let i2 = 0; i2 < dynamicSlots.length; i2++) {
        const slot = dynamicSlots[i2];
        if (isArray$5(slot)) {
          for (let j = 0; j < slot.length; j++) {
            slots[slot[j].name] = slot[j].fn;
          }
        } else if (slot) {
          slots[slot.name] = slot.key ? (...args) => {
            const res = slot.fn(...args);
            if (res) res.key = slot.key;
            return res;
          } : slot.fn;
        }
      }
      return slots;
    }
    function renderSlot(slots, name, props2 = {}, fallback, noSlotted) {
      if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
        if (name !== "default") props2.name = name;
        return openBlock(), createBlock(
          Fragment,
          null,
          [createVNode$1("slot", props2, fallback && fallback())],
          64
        );
      }
      let slot = slots[name];
      if (slot && slot._c) {
        slot._d = false;
      }
      openBlock();
      const validSlotContent = slot && ensureValidVNode(slot(props2));
      const slotKey = props2.key || // slot content array of a dynamic conditional slot may have a branch
      // key attached in the `createSlots` helper, respect that
      validSlotContent && validSlotContent.key;
      const rendered = createBlock(
        Fragment,
        {
          key: (slotKey && !isSymbol$1(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
          (!validSlotContent && fallback ? "_fb" : "")
        },
        validSlotContent || (fallback ? fallback() : []),
        validSlotContent && slots._ === 1 ? 64 : -2
      );
      if (rendered.scopeId) {
        rendered.slotScopeIds = [rendered.scopeId + "-s"];
      }
      if (slot && slot._c) {
        slot._d = true;
      }
      return rendered;
    }
    function ensureValidVNode(vnodes) {
      return vnodes.some((child) => {
        if (!isVNode(child)) return true;
        if (child.type === Comment) return false;
        if (child.type === Fragment && !ensureValidVNode(child.children))
          return false;
        return true;
      }) ? vnodes : null;
    }
    function toHandlers(obj, preserveCaseIfNecessary) {
      const ret = {};
      for (const key in obj) {
        ret[toHandlerKey(key)] = obj[key];
      }
      return ret;
    }
    const getPublicInstance = (i2) => {
      if (!i2) return null;
      if (isStatefulComponent(i2)) return getComponentPublicInstance(i2);
      return getPublicInstance(i2.parent);
    };
    const publicPropertiesMap = (
      // Move PURE marker to new line to workaround compiler discarding it
      // due to type annotation
      /* @__PURE__ */ extend$2(/* @__PURE__ */ Object.create(null), {
        $: (i2) => i2,
        $el: (i2) => i2.vnode.el,
        $data: (i2) => i2.data,
        $props: (i2) => i2.props,
        $attrs: (i2) => i2.attrs,
        $slots: (i2) => i2.slots,
        $refs: (i2) => i2.refs,
        $parent: (i2) => getPublicInstance(i2.parent),
        $root: (i2) => getPublicInstance(i2.root),
        $host: (i2) => i2.ce,
        $emit: (i2) => i2.emit,
        $options: (i2) => resolveMergedOptions(i2),
        $forceUpdate: (i2) => i2.f || (i2.f = () => {
          queueJob(i2.update);
        }),
        $nextTick: (i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)),
        $watch: (i2) => instanceWatch.bind(i2)
      })
    );
    const hasSetupBinding = (state, key) => state !== EMPTY_OBJ$1 && !state.__isScriptSetup && hasOwn$1(state, key);
    const PublicInstanceProxyHandlers = {
      get({ _: instance }, key) {
        if (key === "__v_skip") {
          return true;
        }
        const { ctx, setupState, data, props: props2, accessCache, type, appContext } = instance;
        let normalizedProps;
        if (key[0] !== "$") {
          const n = accessCache[key];
          if (n !== void 0) {
            switch (n) {
              case 1:
                return setupState[key];
              case 2:
                return data[key];
              case 4:
                return ctx[key];
              case 3:
                return props2[key];
            }
          } else if (hasSetupBinding(setupState, key)) {
            accessCache[key] = 1;
            return setupState[key];
          } else if (data !== EMPTY_OBJ$1 && hasOwn$1(data, key)) {
            accessCache[key] = 2;
            return data[key];
          } else if (
            // only cache other properties when instance has declared (thus stable)
            // props
            (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key)
          ) {
            accessCache[key] = 3;
            return props2[key];
          } else if (ctx !== EMPTY_OBJ$1 && hasOwn$1(ctx, key)) {
            accessCache[key] = 4;
            return ctx[key];
          } else if (shouldCacheAccess) {
            accessCache[key] = 0;
          }
        }
        const publicGetter = publicPropertiesMap[key];
        let cssModule, globalProperties;
        if (publicGetter) {
          if (key === "$attrs") {
            track(instance.attrs, "get", "");
          }
          return publicGetter(instance);
        } else if (
          // css module (injected by vue-loader)
          (cssModule = type.__cssModules) && (cssModule = cssModule[key])
        ) {
          return cssModule;
        } else if (ctx !== EMPTY_OBJ$1 && hasOwn$1(ctx, key)) {
          accessCache[key] = 4;
          return ctx[key];
        } else if (
          // global properties
          globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key)
        ) {
          {
            return globalProperties[key];
          }
        } else ;
      },
      set({ _: instance }, key, value) {
        const { data, setupState, ctx } = instance;
        if (hasSetupBinding(setupState, key)) {
          setupState[key] = value;
          return true;
        } else if (data !== EMPTY_OBJ$1 && hasOwn$1(data, key)) {
          data[key] = value;
          return true;
        } else if (hasOwn$1(instance.props, key)) {
          return false;
        }
        if (key[0] === "$" && key.slice(1) in instance) {
          return false;
        } else {
          {
            ctx[key] = value;
          }
        }
        return true;
      },
      has({
        _: { data, setupState, accessCache, ctx, appContext, propsOptions }
      }, key) {
        let normalizedProps;
        return !!accessCache[key] || data !== EMPTY_OBJ$1 && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key);
      },
      defineProperty(target, key, descriptor) {
        if (descriptor.get != null) {
          target._.accessCache[key] = 0;
        } else if (hasOwn$1(descriptor, "value")) {
          this.set(target, key, descriptor.value, null);
        }
        return Reflect.defineProperty(target, key, descriptor);
      }
    };
    function useSlots() {
      return getContext().slots;
    }
    function useAttrs$1() {
      return getContext().attrs;
    }
    function getContext() {
      const i2 = getCurrentInstance();
      return i2.setupContext || (i2.setupContext = createSetupContext(i2));
    }
    function normalizePropsOrEmits(props2) {
      return isArray$5(props2) ? props2.reduce(
        (normalized, p2) => (normalized[p2] = null, normalized),
        {}
      ) : props2;
    }
    let shouldCacheAccess = true;
    function applyOptions(instance) {
      const options = resolveMergedOptions(instance);
      const publicThis = instance.proxy;
      const ctx = instance.ctx;
      shouldCacheAccess = false;
      if (options.beforeCreate) {
        callHook$1(options.beforeCreate, instance, "bc");
      }
      const {
        // state
        data: dataOptions,
        computed: computedOptions,
        methods,
        watch: watchOptions,
        provide: provideOptions,
        inject: injectOptions,
        // lifecycle
        created,
        beforeMount,
        mounted,
        beforeUpdate,
        updated,
        activated,
        deactivated,
        beforeDestroy,
        beforeUnmount,
        destroyed,
        unmounted,
        render: render2,
        renderTracked,
        renderTriggered,
        errorCaptured,
        serverPrefetch,
        // public API
        expose,
        inheritAttrs,
        // assets
        components,
        directives,
        filters
      } = options;
      const checkDuplicateProperties = null;
      if (injectOptions) {
        resolveInjections(injectOptions, ctx, checkDuplicateProperties);
      }
      if (methods) {
        for (const key in methods) {
          const methodHandler = methods[key];
          if (isFunction$4(methodHandler)) {
            {
              ctx[key] = methodHandler.bind(publicThis);
            }
          }
        }
      }
      if (dataOptions) {
        const data = dataOptions.call(publicThis, publicThis);
        if (!isObject$7(data)) ;
        else {
          instance.data = reactive(data);
        }
      }
      shouldCacheAccess = true;
      if (computedOptions) {
        for (const key in computedOptions) {
          const opt = computedOptions[key];
          const get2 = isFunction$4(opt) ? opt.bind(publicThis, publicThis) : isFunction$4(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP;
          const set2 = !isFunction$4(opt) && isFunction$4(opt.set) ? opt.set.bind(publicThis) : NOOP;
          const c2 = computed({
            get: get2,
            set: set2
          });
          Object.defineProperty(ctx, key, {
            enumerable: true,
            configurable: true,
            get: () => c2.value,
            set: (v4) => c2.value = v4
          });
        }
      }
      if (watchOptions) {
        for (const key in watchOptions) {
          createWatcher(watchOptions[key], ctx, publicThis, key);
        }
      }
      if (provideOptions) {
        const provides = isFunction$4(provideOptions) ? provideOptions.call(publicThis) : provideOptions;
        Reflect.ownKeys(provides).forEach((key) => {
          provide(key, provides[key]);
        });
      }
      if (created) {
        callHook$1(created, instance, "c");
      }
      function registerLifecycleHook(register2, hook) {
        if (isArray$5(hook)) {
          hook.forEach((_hook) => register2(_hook.bind(publicThis)));
        } else if (hook) {
          register2(hook.bind(publicThis));
        }
      }
      registerLifecycleHook(onBeforeMount, beforeMount);
      registerLifecycleHook(onMounted, mounted);
      registerLifecycleHook(onBeforeUpdate, beforeUpdate);
      registerLifecycleHook(onUpdated, updated);
      registerLifecycleHook(onActivated, activated);
      registerLifecycleHook(onDeactivated, deactivated);
      registerLifecycleHook(onErrorCaptured, errorCaptured);
      registerLifecycleHook(onRenderTracked, renderTracked);
      registerLifecycleHook(onRenderTriggered, renderTriggered);
      registerLifecycleHook(onBeforeUnmount, beforeUnmount);
      registerLifecycleHook(onUnmounted, unmounted);
      registerLifecycleHook(onServerPrefetch, serverPrefetch);
      if (isArray$5(expose)) {
        if (expose.length) {
          const exposed = instance.exposed || (instance.exposed = {});
          expose.forEach((key) => {
            Object.defineProperty(exposed, key, {
              get: () => publicThis[key],
              set: (val) => publicThis[key] = val
            });
          });
        } else if (!instance.exposed) {
          instance.exposed = {};
        }
      }
      if (render2 && instance.render === NOOP) {
        instance.render = render2;
      }
      if (inheritAttrs != null) {
        instance.inheritAttrs = inheritAttrs;
      }
      if (components) instance.components = components;
      if (directives) instance.directives = directives;
      if (serverPrefetch) {
        markAsyncBoundary(instance);
      }
    }
    function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
      if (isArray$5(injectOptions)) {
        injectOptions = normalizeInject(injectOptions);
      }
      for (const key in injectOptions) {
        const opt = injectOptions[key];
        let injected;
        if (isObject$7(opt)) {
          if ("default" in opt) {
            injected = inject(
              opt.from || key,
              opt.default,
              true
            );
          } else {
            injected = inject(opt.from || key);
          }
        } else {
          injected = inject(opt);
        }
        if (isRef(injected)) {
          Object.defineProperty(ctx, key, {
            enumerable: true,
            configurable: true,
            get: () => injected.value,
            set: (v4) => injected.value = v4
          });
        } else {
          ctx[key] = injected;
        }
      }
    }
    function callHook$1(hook, instance, type) {
      callWithAsyncErrorHandling(
        isArray$5(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy),
        instance,
        type
      );
    }
    function createWatcher(raw, ctx, publicThis, key) {
      let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
      if (isString$3(raw)) {
        const handler = ctx[raw];
        if (isFunction$4(handler)) {
          {
            watch(getter, handler);
          }
        }
      } else if (isFunction$4(raw)) {
        {
          watch(getter, raw.bind(publicThis));
        }
      } else if (isObject$7(raw)) {
        if (isArray$5(raw)) {
          raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
        } else {
          const handler = isFunction$4(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler];
          if (isFunction$4(handler)) {
            watch(getter, handler, raw);
          }
        }
      } else ;
    }
    function resolveMergedOptions(instance) {
      const base2 = instance.type;
      const { mixins, extends: extendsOptions } = base2;
      const {
        mixins: globalMixins,
        optionsCache: cache2,
        config: { optionMergeStrategies }
      } = instance.appContext;
      const cached = cache2.get(base2);
      let resolved;
      if (cached) {
        resolved = cached;
      } else if (!globalMixins.length && !mixins && !extendsOptions) {
        {
          resolved = base2;
        }
      } else {
        resolved = {};
        if (globalMixins.length) {
          globalMixins.forEach(
            (m2) => mergeOptions$2(resolved, m2, optionMergeStrategies, true)
          );
        }
        mergeOptions$2(resolved, base2, optionMergeStrategies);
      }
      if (isObject$7(base2)) {
        cache2.set(base2, resolved);
      }
      return resolved;
    }
    function mergeOptions$2(to, from, strats, asMixin = false) {
      const { mixins, extends: extendsOptions } = from;
      if (extendsOptions) {
        mergeOptions$2(to, extendsOptions, strats, true);
      }
      if (mixins) {
        mixins.forEach(
          (m2) => mergeOptions$2(to, m2, strats, true)
        );
      }
      for (const key in from) {
        if (asMixin && key === "expose") ;
        else {
          const strat = internalOptionMergeStrats[key] || strats && strats[key];
          to[key] = strat ? strat(to[key], from[key]) : from[key];
        }
      }
      return to;
    }
    const internalOptionMergeStrats = {
      data: mergeDataFn,
      props: mergeEmitsOrPropsOptions,
      emits: mergeEmitsOrPropsOptions,
      // objects
      methods: mergeObjectOptions,
      computed: mergeObjectOptions,
      // lifecycle
      beforeCreate: mergeAsArray,
      created: mergeAsArray,
      beforeMount: mergeAsArray,
      mounted: mergeAsArray,
      beforeUpdate: mergeAsArray,
      updated: mergeAsArray,
      beforeDestroy: mergeAsArray,
      beforeUnmount: mergeAsArray,
      destroyed: mergeAsArray,
      unmounted: mergeAsArray,
      activated: mergeAsArray,
      deactivated: mergeAsArray,
      errorCaptured: mergeAsArray,
      serverPrefetch: mergeAsArray,
      // assets
      components: mergeObjectOptions,
      directives: mergeObjectOptions,
      // watch
      watch: mergeWatchOptions,
      // provide / inject
      provide: mergeDataFn,
      inject: mergeInject
    };
    function mergeDataFn(to, from) {
      if (!from) {
        return to;
      }
      if (!to) {
        return from;
      }
      return function mergedDataFn() {
        return extend$2(
          isFunction$4(to) ? to.call(this, this) : to,
          isFunction$4(from) ? from.call(this, this) : from
        );
      };
    }
    function mergeInject(to, from) {
      return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
    }
    function normalizeInject(raw) {
      if (isArray$5(raw)) {
        const res = {};
        for (let i2 = 0; i2 < raw.length; i2++) {
          res[raw[i2]] = raw[i2];
        }
        return res;
      }
      return raw;
    }
    function mergeAsArray(to, from) {
      return to ? [...new Set([].concat(to, from))] : from;
    }
    function mergeObjectOptions(to, from) {
      return to ? extend$2(/* @__PURE__ */ Object.create(null), to, from) : from;
    }
    function mergeEmitsOrPropsOptions(to, from) {
      if (to) {
        if (isArray$5(to) && isArray$5(from)) {
          return [.../* @__PURE__ */ new Set([...to, ...from])];
        }
        return extend$2(
          /* @__PURE__ */ Object.create(null),
          normalizePropsOrEmits(to),
          normalizePropsOrEmits(from != null ? from : {})
        );
      } else {
        return from;
      }
    }
    function mergeWatchOptions(to, from) {
      if (!to) return from;
      if (!from) return to;
      const merged = extend$2(/* @__PURE__ */ Object.create(null), to);
      for (const key in from) {
        merged[key] = mergeAsArray(to[key], from[key]);
      }
      return merged;
    }
    function createAppContext() {
      return {
        app: null,
        config: {
          isNativeTag: NO,
          performance: false,
          globalProperties: {},
          optionMergeStrategies: {},
          errorHandler: void 0,
          warnHandler: void 0,
          compilerOptions: {}
        },
        mixins: [],
        components: {},
        directives: {},
        provides: /* @__PURE__ */ Object.create(null),
        optionsCache: /* @__PURE__ */ new WeakMap(),
        propsCache: /* @__PURE__ */ new WeakMap(),
        emitsCache: /* @__PURE__ */ new WeakMap()
      };
    }
    let uid$1 = 0;
    function createAppAPI(render2, hydrate) {
      return function createApp2(rootComponent, rootProps = null) {
        if (!isFunction$4(rootComponent)) {
          rootComponent = extend$2({}, rootComponent);
        }
        if (rootProps != null && !isObject$7(rootProps)) {
          rootProps = null;
        }
        const context = createAppContext();
        const installedPlugins = /* @__PURE__ */ new WeakSet();
        const pluginCleanupFns = [];
        let isMounted = false;
        const app2 = context.app = {
          _uid: uid$1++,
          _component: rootComponent,
          _props: rootProps,
          _container: null,
          _context: context,
          _instance: null,
          version: version$1,
          get config() {
            return context.config;
          },
          set config(v4) {
          },
          use(plugin, ...options) {
            if (installedPlugins.has(plugin)) ;
            else if (plugin && isFunction$4(plugin.install)) {
              installedPlugins.add(plugin);
              plugin.install(app2, ...options);
            } else if (isFunction$4(plugin)) {
              installedPlugins.add(plugin);
              plugin(app2, ...options);
            } else ;
            return app2;
          },
          mixin(mixin2) {
            {
              if (!context.mixins.includes(mixin2)) {
                context.mixins.push(mixin2);
              }
            }
            return app2;
          },
          component(name, component2) {
            if (!component2) {
              return context.components[name];
            }
            context.components[name] = component2;
            return app2;
          },
          directive(name, directive) {
            if (!directive) {
              return context.directives[name];
            }
            context.directives[name] = directive;
            return app2;
          },
          mount(rootContainer, isHydrate, namespace) {
            if (!isMounted) {
              const vnode = app2._ceVNode || createVNode$1(rootComponent, rootProps);
              vnode.appContext = context;
              if (namespace === true) {
                namespace = "svg";
              } else if (namespace === false) {
                namespace = void 0;
              }
              {
                render2(vnode, rootContainer, namespace);
              }
              isMounted = true;
              app2._container = rootContainer;
              rootContainer.__vue_app__ = app2;
              return getComponentPublicInstance(vnode.component);
            }
          },
          onUnmount(cleanupFn) {
            pluginCleanupFns.push(cleanupFn);
          },
          unmount() {
            if (isMounted) {
              callWithAsyncErrorHandling(
                pluginCleanupFns,
                app2._instance,
                16
              );
              render2(null, app2._container);
              delete app2._container.__vue_app__;
            }
          },
          provide(key, value) {
            context.provides[key] = value;
            return app2;
          },
          runWithContext(fn2) {
            const lastApp = currentApp;
            currentApp = app2;
            try {
              return fn2();
            } finally {
              currentApp = lastApp;
            }
          }
        };
        return app2;
      };
    }
    let currentApp = null;
    function provide(key, value) {
      if (!currentInstance) ;
      else {
        let provides = currentInstance.provides;
        const parentProvides = currentInstance.parent && currentInstance.parent.provides;
        if (parentProvides === provides) {
          provides = currentInstance.provides = Object.create(parentProvides);
        }
        provides[key] = value;
      }
    }
    function inject(key, defaultValue, treatDefaultAsFactory = false) {
      const instance = currentInstance || currentRenderingInstance;
      if (instance || currentApp) {
        const provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0;
        if (provides && key in provides) {
          return provides[key];
        } else if (arguments.length > 1) {
          return treatDefaultAsFactory && isFunction$4(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue;
        } else ;
      }
    }
    const internalObjectProto = {};
    const createInternalObject = () => Object.create(internalObjectProto);
    const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
    function initProps$1(instance, rawProps, isStateful, isSSR = false) {
      const props2 = {};
      const attrs = createInternalObject();
      instance.propsDefaults = /* @__PURE__ */ Object.create(null);
      setFullProps(instance, rawProps, props2, attrs);
      for (const key in instance.propsOptions[0]) {
        if (!(key in props2)) {
          props2[key] = void 0;
        }
      }
      if (isStateful) {
        instance.props = isSSR ? props2 : shallowReactive(props2);
      } else {
        if (!instance.type.props) {
          instance.props = attrs;
        } else {
          instance.props = props2;
        }
      }
      instance.attrs = attrs;
    }
    function updateProps$2(instance, rawProps, rawPrevProps, optimized) {
      const {
        props: props2,
        attrs,
        vnode: { patchFlag }
      } = instance;
      const rawCurrentProps = toRaw(props2);
      const [options] = instance.propsOptions;
      let hasAttrsChanged = false;
      if (
        // always force full diff in dev
        // - #1942 if hmr is enabled with sfc component
        // - vite#872 non-sfc component used by sfc component
        (optimized || patchFlag > 0) && !(patchFlag & 16)
      ) {
        if (patchFlag & 8) {
          const propsToUpdate = instance.vnode.dynamicProps;
          for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
            let key = propsToUpdate[i2];
            if (isEmitListener(instance.emitsOptions, key)) {
              continue;
            }
            const value = rawProps[key];
            if (options) {
              if (hasOwn$1(attrs, key)) {
                if (value !== attrs[key]) {
                  attrs[key] = value;
                  hasAttrsChanged = true;
                }
              } else {
                const camelizedKey = camelize(key);
                props2[camelizedKey] = resolvePropValue(
                  options,
                  rawCurrentProps,
                  camelizedKey,
                  value,
                  instance,
                  false
                );
              }
            } else {
              if (value !== attrs[key]) {
                attrs[key] = value;
                hasAttrsChanged = true;
              }
            }
          }
        }
      } else {
        if (setFullProps(instance, rawProps, props2, attrs)) {
          hasAttrsChanged = true;
        }
        let kebabKey;
        for (const key in rawCurrentProps) {
          if (!rawProps || // for camelCase
          !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case
          // and converted to camelCase (#955)
          ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) {
            if (options) {
              if (rawPrevProps && // for camelCase
              (rawPrevProps[key] !== void 0 || // for kebab-case
              rawPrevProps[kebabKey] !== void 0)) {
                props2[key] = resolvePropValue(
                  options,
                  rawCurrentProps,
                  key,
                  void 0,
                  instance,
                  true
                );
              }
            } else {
              delete props2[key];
            }
          }
        }
        if (attrs !== rawCurrentProps) {
          for (const key in attrs) {
            if (!rawProps || !hasOwn$1(rawProps, key) && true) {
              delete attrs[key];
              hasAttrsChanged = true;
            }
          }
        }
      }
      if (hasAttrsChanged) {
        trigger$2(instance.attrs, "set", "");
      }
    }
    function setFullProps(instance, rawProps, props2, attrs) {
      const [options, needCastKeys] = instance.propsOptions;
      let hasAttrsChanged = false;
      let rawCastValues;
      if (rawProps) {
        for (let key in rawProps) {
          if (isReservedProp(key)) {
            continue;
          }
          const value = rawProps[key];
          let camelKey;
          if (options && hasOwn$1(options, camelKey = camelize(key))) {
            if (!needCastKeys || !needCastKeys.includes(camelKey)) {
              props2[camelKey] = value;
            } else {
              (rawCastValues || (rawCastValues = {}))[camelKey] = value;
            }
          } else if (!isEmitListener(instance.emitsOptions, key)) {
            if (!(key in attrs) || value !== attrs[key]) {
              attrs[key] = value;
              hasAttrsChanged = true;
            }
          }
        }
      }
      if (needCastKeys) {
        const rawCurrentProps = toRaw(props2);
        const castValues = rawCastValues || EMPTY_OBJ$1;
        for (let i2 = 0; i2 < needCastKeys.length; i2++) {
          const key = needCastKeys[i2];
          props2[key] = resolvePropValue(
            options,
            rawCurrentProps,
            key,
            castValues[key],
            instance,
            !hasOwn$1(castValues, key)
          );
        }
      }
      return hasAttrsChanged;
    }
    function resolvePropValue(options, props2, key, value, instance, isAbsent2) {
      const opt = options[key];
      if (opt != null) {
        const hasDefault = hasOwn$1(opt, "default");
        if (hasDefault && value === void 0) {
          const defaultValue = opt.default;
          if (opt.type !== Function && !opt.skipFactory && isFunction$4(defaultValue)) {
            const { propsDefaults } = instance;
            if (key in propsDefaults) {
              value = propsDefaults[key];
            } else {
              const reset = setCurrentInstance(instance);
              value = propsDefaults[key] = defaultValue.call(
                null,
                props2
              );
              reset();
            }
          } else {
            value = defaultValue;
          }
          if (instance.ce) {
            instance.ce._setProp(key, value);
          }
        }
        if (opt[
          0
          /* shouldCast */
        ]) {
          if (isAbsent2 && !hasDefault) {
            value = false;
          } else if (opt[
            1
            /* shouldCastTrue */
          ] && (value === "" || value === hyphenate(key))) {
            value = true;
          }
        }
      }
      return value;
    }
    const mixinPropsCache = /* @__PURE__ */ new WeakMap();
    function normalizePropsOptions(comp, appContext, asMixin = false) {
      const cache2 = asMixin ? mixinPropsCache : appContext.propsCache;
      const cached = cache2.get(comp);
      if (cached) {
        return cached;
      }
      const raw = comp.props;
      const normalized = {};
      const needCastKeys = [];
      let hasExtends = false;
      if (!isFunction$4(comp)) {
        const extendProps = (raw2) => {
          hasExtends = true;
          const [props2, keys2] = normalizePropsOptions(raw2, appContext, true);
          extend$2(normalized, props2);
          if (keys2) needCastKeys.push(...keys2);
        };
        if (!asMixin && appContext.mixins.length) {
          appContext.mixins.forEach(extendProps);
        }
        if (comp.extends) {
          extendProps(comp.extends);
        }
        if (comp.mixins) {
          comp.mixins.forEach(extendProps);
        }
      }
      if (!raw && !hasExtends) {
        if (isObject$7(comp)) {
          cache2.set(comp, EMPTY_ARR);
        }
        return EMPTY_ARR;
      }
      if (isArray$5(raw)) {
        for (let i2 = 0; i2 < raw.length; i2++) {
          const normalizedKey = camelize(raw[i2]);
          if (validatePropName(normalizedKey)) {
            normalized[normalizedKey] = EMPTY_OBJ$1;
          }
        }
      } else if (raw) {
        for (const key in raw) {
          const normalizedKey = camelize(key);
          if (validatePropName(normalizedKey)) {
            const opt = raw[key];
            const prop = normalized[normalizedKey] = isArray$5(opt) || isFunction$4(opt) ? { type: opt } : extend$2({}, opt);
            const propType = prop.type;
            let shouldCast = false;
            let shouldCastTrue = true;
            if (isArray$5(propType)) {
              for (let index = 0; index < propType.length; ++index) {
                const type = propType[index];
                const typeName = isFunction$4(type) && type.name;
                if (typeName === "Boolean") {
                  shouldCast = true;
                  break;
                } else if (typeName === "String") {
                  shouldCastTrue = false;
                }
              }
            } else {
              shouldCast = isFunction$4(propType) && propType.name === "Boolean";
            }
            prop[
              0
              /* shouldCast */
            ] = shouldCast;
            prop[
              1
              /* shouldCastTrue */
            ] = shouldCastTrue;
            if (shouldCast || hasOwn$1(prop, "default")) {
              needCastKeys.push(normalizedKey);
            }
          }
        }
      }
      const res = [normalized, needCastKeys];
      if (isObject$7(comp)) {
        cache2.set(comp, res);
      }
      return res;
    }
    function validatePropName(key) {
      if (key[0] !== "$" && !isReservedProp(key)) {
        return true;
      }
      return false;
    }
    const isInternalKey = (key) => key[0] === "_" || key === "$stable";
    const normalizeSlotValue = (value) => isArray$5(value) ? value.map(normalizeVNode) : [normalizeVNode(value)];
    const normalizeSlot$1 = (key, rawSlot, ctx) => {
      if (rawSlot._n) {
        return rawSlot;
      }
      const normalized = withCtx((...args) => {
        if (false) ;
        return normalizeSlotValue(rawSlot(...args));
      }, ctx);
      normalized._c = false;
      return normalized;
    };
    const normalizeObjectSlots = (rawSlots, slots, instance) => {
      const ctx = rawSlots._ctx;
      for (const key in rawSlots) {
        if (isInternalKey(key)) continue;
        const value = rawSlots[key];
        if (isFunction$4(value)) {
          slots[key] = normalizeSlot$1(key, value, ctx);
        } else if (value != null) {
          const normalized = normalizeSlotValue(value);
          slots[key] = () => normalized;
        }
      }
    };
    const normalizeVNodeSlots = (instance, children) => {
      const normalized = normalizeSlotValue(children);
      instance.slots.default = () => normalized;
    };
    const assignSlots = (slots, children, optimized) => {
      for (const key in children) {
        if (optimized || key !== "_") {
          slots[key] = children[key];
        }
      }
    };
    const initSlots = (instance, children, optimized) => {
      const slots = instance.slots = createInternalObject();
      if (instance.vnode.shapeFlag & 32) {
        const type = children._;
        if (type) {
          assignSlots(slots, children, optimized);
          if (optimized) {
            def(slots, "_", type, true);
          }
        } else {
          normalizeObjectSlots(children, slots);
        }
      } else if (children) {
        normalizeVNodeSlots(instance, children);
      }
    };
    const updateSlots = (instance, children, optimized) => {
      const { vnode, slots } = instance;
      let needDeletionCheck = true;
      let deletionComparisonTarget = EMPTY_OBJ$1;
      if (vnode.shapeFlag & 32) {
        const type = children._;
        if (type) {
          if (optimized && type === 1) {
            needDeletionCheck = false;
          } else {
            assignSlots(slots, children, optimized);
          }
        } else {
          needDeletionCheck = !children.$stable;
          normalizeObjectSlots(children, slots);
        }
        deletionComparisonTarget = children;
      } else if (children) {
        normalizeVNodeSlots(instance, children);
        deletionComparisonTarget = { default: 1 };
      }
      if (needDeletionCheck) {
        for (const key in slots) {
          if (!isInternalKey(key) && deletionComparisonTarget[key] == null) {
            delete slots[key];
          }
        }
      }
    };
    const queuePostRenderEffect = queueEffectWithSuspense;
    function createRenderer(options) {
      return baseCreateRenderer(options);
    }
    function baseCreateRenderer(options, createHydrationFns) {
      const target = getGlobalThis();
      target.__VUE__ = true;
      const {
        insert: hostInsert,
        remove: hostRemove,
        patchProp: hostPatchProp,
        createElement: hostCreateElement,
        createText: hostCreateText,
        createComment: hostCreateComment,
        setText: hostSetText,
        setElementText: hostSetElementText,
        parentNode: hostParentNode,
        nextSibling: hostNextSibling,
        setScopeId: hostSetScopeId = NOOP,
        insertStaticContent: hostInsertStaticContent
      } = options;
      const patch2 = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!n2.dynamicChildren) => {
        if (n1 === n2) {
          return;
        }
        if (n1 && !isSameVNodeType(n1, n2)) {
          anchor = getNextHostNode(n1);
          unmount(n1, parentComponent, parentSuspense, true);
          n1 = null;
        }
        if (n2.patchFlag === -2) {
          optimized = false;
          n2.dynamicChildren = null;
        }
        const { type, ref: ref3, shapeFlag } = n2;
        switch (type) {
          case Text$1:
            processText(n1, n2, container, anchor);
            break;
          case Comment:
            processCommentNode(n1, n2, container, anchor);
            break;
          case Static:
            if (n1 == null) {
              mountStaticNode(n2, container, anchor, namespace);
            }
            break;
          case Fragment:
            processFragment(
              n1,
              n2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
            break;
          default:
            if (shapeFlag & 1) {
              processElement(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            } else if (shapeFlag & 6) {
              processComponent(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            } else if (shapeFlag & 64) {
              type.process(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized,
                internals
              );
            } else if (shapeFlag & 128) {
              type.process(
                n1,
                n2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized,
                internals
              );
            } else ;
        }
        if (ref3 != null && parentComponent) {
          setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2);
        }
      };
      const processText = (n1, n2, container, anchor) => {
        if (n1 == null) {
          hostInsert(
            n2.el = hostCreateText(n2.children),
            container,
            anchor
          );
        } else {
          const el = n2.el = n1.el;
          if (n2.children !== n1.children) {
            hostSetText(el, n2.children);
          }
        }
      };
      const processCommentNode = (n1, n2, container, anchor) => {
        if (n1 == null) {
          hostInsert(
            n2.el = hostCreateComment(n2.children || ""),
            container,
            anchor
          );
        } else {
          n2.el = n1.el;
        }
      };
      const mountStaticNode = (n2, container, anchor, namespace) => {
        [n2.el, n2.anchor] = hostInsertStaticContent(
          n2.children,
          container,
          anchor,
          namespace,
          n2.el,
          n2.anchor
        );
      };
      const moveStaticNode = ({ el, anchor }, container, nextSibling2) => {
        let next;
        while (el && el !== anchor) {
          next = hostNextSibling(el);
          hostInsert(el, container, nextSibling2);
          el = next;
        }
        hostInsert(anchor, container, nextSibling2);
      };
      const removeStaticNode = ({ el, anchor }) => {
        let next;
        while (el && el !== anchor) {
          next = hostNextSibling(el);
          hostRemove(el);
          el = next;
        }
        hostRemove(anchor);
      };
      const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        if (n2.type === "svg") {
          namespace = "svg";
        } else if (n2.type === "math") {
          namespace = "mathml";
        }
        if (n1 == null) {
          mountElement(
            n2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else {
          patchElement(
            n1,
            n2,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
      };
      const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        let el;
        let vnodeHook;
        const { props: props2, shapeFlag, transition, dirs } = vnode;
        el = vnode.el = hostCreateElement(
          vnode.type,
          namespace,
          props2 && props2.is,
          props2
        );
        if (shapeFlag & 8) {
          hostSetElementText(el, vnode.children);
        } else if (shapeFlag & 16) {
          mountChildren(
            vnode.children,
            el,
            null,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(vnode, namespace),
            slotScopeIds,
            optimized
          );
        }
        if (dirs) {
          invokeDirectiveHook(vnode, null, parentComponent, "created");
        }
        setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
        if (props2) {
          for (const key in props2) {
            if (key !== "value" && !isReservedProp(key)) {
              hostPatchProp(el, key, null, props2[key], namespace, parentComponent);
            }
          }
          if ("value" in props2) {
            hostPatchProp(el, "value", null, props2.value, namespace);
          }
          if (vnodeHook = props2.onVnodeBeforeMount) {
            invokeVNodeHook(vnodeHook, parentComponent, vnode);
          }
        }
        if (dirs) {
          invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
        }
        const needCallTransitionHooks = needTransition(parentSuspense, transition);
        if (needCallTransitionHooks) {
          transition.beforeEnter(el);
        }
        hostInsert(el, container, anchor);
        if ((vnodeHook = props2 && props2.onVnodeMounted) || needCallTransitionHooks || dirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
            needCallTransitionHooks && transition.enter(el);
            dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
          }, parentSuspense);
        }
      };
      const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {
        if (scopeId) {
          hostSetScopeId(el, scopeId);
        }
        if (slotScopeIds) {
          for (let i2 = 0; i2 < slotScopeIds.length; i2++) {
            hostSetScopeId(el, slotScopeIds[i2]);
          }
        }
        if (parentComponent) {
          let subTree = parentComponent.subTree;
          if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
            const parentVNode = parentComponent.vnode;
            setScopeId(
              el,
              parentVNode,
              parentVNode.scopeId,
              parentVNode.slotScopeIds,
              parentComponent.parent
            );
          }
        }
      };
      const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start2 = 0) => {
        for (let i2 = start2; i2 < children.length; i2++) {
          const child = children[i2] = optimized ? cloneIfMounted(children[i2]) : normalizeVNode(children[i2]);
          patch2(
            null,
            child,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
      };
      const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        const el = n2.el = n1.el;
        let { patchFlag, dynamicChildren, dirs } = n2;
        patchFlag |= n1.patchFlag & 16;
        const oldProps = n1.props || EMPTY_OBJ$1;
        const newProps = n2.props || EMPTY_OBJ$1;
        let vnodeHook;
        parentComponent && toggleRecurse(parentComponent, false);
        if (vnodeHook = newProps.onVnodeBeforeUpdate) {
          invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
        }
        if (dirs) {
          invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate");
        }
        parentComponent && toggleRecurse(parentComponent, true);
        if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) {
          hostSetElementText(el, "");
        }
        if (dynamicChildren) {
          patchBlockChildren(
            n1.dynamicChildren,
            dynamicChildren,
            el,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(n2, namespace),
            slotScopeIds
          );
        } else if (!optimized) {
          patchChildren(
            n1,
            n2,
            el,
            null,
            parentComponent,
            parentSuspense,
            resolveChildrenNamespace(n2, namespace),
            slotScopeIds,
            false
          );
        }
        if (patchFlag > 0) {
          if (patchFlag & 16) {
            patchProps(el, oldProps, newProps, parentComponent, namespace);
          } else {
            if (patchFlag & 2) {
              if (oldProps.class !== newProps.class) {
                hostPatchProp(el, "class", null, newProps.class, namespace);
              }
            }
            if (patchFlag & 4) {
              hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
            }
            if (patchFlag & 8) {
              const propsToUpdate = n2.dynamicProps;
              for (let i2 = 0; i2 < propsToUpdate.length; i2++) {
                const key = propsToUpdate[i2];
                const prev = oldProps[key];
                const next = newProps[key];
                if (next !== prev || key === "value") {
                  hostPatchProp(el, key, prev, next, namespace, parentComponent);
                }
              }
            }
          }
          if (patchFlag & 1) {
            if (n1.children !== n2.children) {
              hostSetElementText(el, n2.children);
            }
          }
        } else if (!optimized && dynamicChildren == null) {
          patchProps(el, oldProps, newProps, parentComponent, namespace);
        }
        if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
            dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated");
          }, parentSuspense);
        }
      };
      const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
        for (let i2 = 0; i2 < newChildren.length; i2++) {
          const oldVNode = oldChildren[i2];
          const newVNode = newChildren[i2];
          const container = (
            // oldVNode may be an errored async setup() component inside Suspense
            // which will not have a mounted element
            oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent
            // of the Fragment itself so it can move its children.
            (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement
            // which also requires the correct parent container
            !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything.
            oldVNode.shapeFlag & (6 | 64)) ? hostParentNode(oldVNode.el) : (
              // In other cases, the parent container is not actually used so we
              // just pass the block element here to avoid a DOM parentNode call.
              fallbackContainer
            )
          );
          patch2(
            oldVNode,
            newVNode,
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            true
          );
        }
      };
      const patchProps = (el, oldProps, newProps, parentComponent, namespace) => {
        if (oldProps !== newProps) {
          if (oldProps !== EMPTY_OBJ$1) {
            for (const key in oldProps) {
              if (!isReservedProp(key) && !(key in newProps)) {
                hostPatchProp(
                  el,
                  key,
                  oldProps[key],
                  null,
                  namespace,
                  parentComponent
                );
              }
            }
          }
          for (const key in newProps) {
            if (isReservedProp(key)) continue;
            const next = newProps[key];
            const prev = oldProps[key];
            if (next !== prev && key !== "value") {
              hostPatchProp(el, key, prev, next, namespace, parentComponent);
            }
          }
          if ("value" in newProps) {
            hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
          }
        }
      };
      const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
        const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
        let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
        if (fragmentSlotScopeIds) {
          slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds;
        }
        if (n1 == null) {
          hostInsert(fragmentStartAnchor, container, anchor);
          hostInsert(fragmentEndAnchor, container, anchor);
          mountChildren(
            // #10007
            // such fragment like `<></>` will be compiled into
            // a fragment which doesn't have a children.
            // In this case fallback to an empty array
            n2.children || [],
            container,
            fragmentEndAnchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        } else {
          if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result
          // of renderSlot() with no valid children
          n1.dynamicChildren) {
            patchBlockChildren(
              n1.dynamicChildren,
              dynamicChildren,
              container,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds
            );
            if (
              // #2080 if the stable fragment has a key, it's a <template v-for> that may
              //  get moved around. Make sure all root level vnodes inherit el.
              // #2134 or if it's a component root, it may also get moved around
              // as the component is being moved.
              n2.key != null || parentComponent && n2 === parentComponent.subTree
            ) {
              traverseStaticChildren(
                n1,
                n2,
                true
                /* shallow */
              );
            }
          } else {
            patchChildren(
              n1,
              n2,
              container,
              fragmentEndAnchor,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
          }
        }
      };
      const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        n2.slotScopeIds = slotScopeIds;
        if (n1 == null) {
          if (n2.shapeFlag & 512) {
            parentComponent.ctx.activate(
              n2,
              container,
              anchor,
              namespace,
              optimized
            );
          } else {
            mountComponent(
              n2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace,
              optimized
            );
          }
        } else {
          updateComponent(n1, n2, optimized);
        }
      };
      const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
        const instance = initialVNode.component = createComponentInstance(
          initialVNode,
          parentComponent,
          parentSuspense
        );
        if (isKeepAlive(initialVNode)) {
          instance.ctx.renderer = internals;
        }
        {
          setupComponent(instance, false, optimized);
        }
        if (instance.asyncDep) {
          parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
          if (!initialVNode.el) {
            const placeholder = instance.subTree = createVNode$1(Comment);
            processCommentNode(null, placeholder, container, anchor);
          }
        } else {
          setupRenderEffect(
            instance,
            initialVNode,
            container,
            anchor,
            parentSuspense,
            namespace,
            optimized
          );
        }
      };
      const updateComponent = (n1, n2, optimized) => {
        const instance = n2.component = n1.component;
        if (shouldUpdateComponent(n1, n2, optimized)) {
          if (instance.asyncDep && !instance.asyncResolved) {
            updateComponentPreRender(instance, n2, optimized);
            return;
          } else {
            instance.next = n2;
            instance.update();
          }
        } else {
          n2.el = n1.el;
          instance.vnode = n2;
        }
      };
      const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
        const componentUpdateFn = () => {
          if (!instance.isMounted) {
            let vnodeHook;
            const { el, props: props2 } = initialVNode;
            const { bm, m: m2, parent: parent2, root: root2, type } = instance;
            const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
            toggleRecurse(instance, false);
            if (bm) {
              invokeArrayFns(bm);
            }
            if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeBeforeMount)) {
              invokeVNodeHook(vnodeHook, parent2, initialVNode);
            }
            toggleRecurse(instance, true);
            {
              if (root2.ce) {
                root2.ce._injectChildStyle(type);
              }
              const subTree = instance.subTree = renderComponentRoot(instance);
              patch2(
                null,
                subTree,
                container,
                anchor,
                instance,
                parentSuspense,
                namespace
              );
              initialVNode.el = subTree.el;
            }
            if (m2) {
              queuePostRenderEffect(m2, parentSuspense);
            }
            if (!isAsyncWrapperVNode && (vnodeHook = props2 && props2.onVnodeMounted)) {
              const scopedInitialVNode = initialVNode;
              queuePostRenderEffect(
                () => invokeVNodeHook(vnodeHook, parent2, scopedInitialVNode),
                parentSuspense
              );
            }
            if (initialVNode.shapeFlag & 256 || parent2 && isAsyncWrapper(parent2.vnode) && parent2.vnode.shapeFlag & 256) {
              instance.a && queuePostRenderEffect(instance.a, parentSuspense);
            }
            instance.isMounted = true;
            initialVNode = container = anchor = null;
          } else {
            let { next, bu, u: u2, parent: parent2, vnode } = instance;
            {
              const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
              if (nonHydratedAsyncRoot) {
                if (next) {
                  next.el = vnode.el;
                  updateComponentPreRender(instance, next, optimized);
                }
                nonHydratedAsyncRoot.asyncDep.then(() => {
                  if (!instance.isUnmounted) {
                    componentUpdateFn();
                  }
                });
                return;
              }
            }
            let originNext = next;
            let vnodeHook;
            toggleRecurse(instance, false);
            if (next) {
              next.el = vnode.el;
              updateComponentPreRender(instance, next, optimized);
            } else {
              next = vnode;
            }
            if (bu) {
              invokeArrayFns(bu);
            }
            if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) {
              invokeVNodeHook(vnodeHook, parent2, next, vnode);
            }
            toggleRecurse(instance, true);
            const nextTree = renderComponentRoot(instance);
            const prevTree = instance.subTree;
            instance.subTree = nextTree;
            patch2(
              prevTree,
              nextTree,
              // parent may have changed if it's in a teleport
              hostParentNode(prevTree.el),
              // anchor may have changed if it's in a fragment
              getNextHostNode(prevTree),
              instance,
              parentSuspense,
              namespace
            );
            next.el = nextTree.el;
            if (originNext === null) {
              updateHOCHostEl(instance, nextTree.el);
            }
            if (u2) {
              queuePostRenderEffect(u2, parentSuspense);
            }
            if (vnodeHook = next.props && next.props.onVnodeUpdated) {
              queuePostRenderEffect(
                () => invokeVNodeHook(vnodeHook, parent2, next, vnode),
                parentSuspense
              );
            }
          }
        };
        instance.scope.on();
        const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn);
        instance.scope.off();
        const update = instance.update = effect2.run.bind(effect2);
        const job = instance.job = effect2.runIfDirty.bind(effect2);
        job.i = instance;
        job.id = instance.uid;
        effect2.scheduler = () => queueJob(job);
        toggleRecurse(instance, true);
        update();
      };
      const updateComponentPreRender = (instance, nextVNode, optimized) => {
        nextVNode.component = instance;
        const prevProps = instance.vnode.props;
        instance.vnode = nextVNode;
        instance.next = null;
        updateProps$2(instance, nextVNode.props, prevProps, optimized);
        updateSlots(instance, nextVNode.children, optimized);
        pauseTracking();
        flushPreFlushCbs(instance);
        resetTracking();
      };
      const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
        const c1 = n1 && n1.children;
        const prevShapeFlag = n1 ? n1.shapeFlag : 0;
        const c2 = n2.children;
        const { patchFlag, shapeFlag } = n2;
        if (patchFlag > 0) {
          if (patchFlag & 128) {
            patchKeyedChildren(
              c1,
              c2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
            return;
          } else if (patchFlag & 256) {
            patchUnkeyedChildren(
              c1,
              c2,
              container,
              anchor,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
            return;
          }
        }
        if (shapeFlag & 8) {
          if (prevShapeFlag & 16) {
            unmountChildren(c1, parentComponent, parentSuspense);
          }
          if (c2 !== c1) {
            hostSetElementText(container, c2);
          }
        } else {
          if (prevShapeFlag & 16) {
            if (shapeFlag & 16) {
              patchKeyedChildren(
                c1,
                c2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            } else {
              unmountChildren(c1, parentComponent, parentSuspense, true);
            }
          } else {
            if (prevShapeFlag & 8) {
              hostSetElementText(container, "");
            }
            if (shapeFlag & 16) {
              mountChildren(
                c2,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            }
          }
        }
      };
      const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        c1 = c1 || EMPTY_ARR;
        c2 = c2 || EMPTY_ARR;
        const oldLength = c1.length;
        const newLength = c2.length;
        const commonLength = Math.min(oldLength, newLength);
        let i2;
        for (i2 = 0; i2 < commonLength; i2++) {
          const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
          patch2(
            c1[i2],
            nextChild,
            container,
            null,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized
          );
        }
        if (oldLength > newLength) {
          unmountChildren(
            c1,
            parentComponent,
            parentSuspense,
            true,
            false,
            commonLength
          );
        } else {
          mountChildren(
            c2,
            container,
            anchor,
            parentComponent,
            parentSuspense,
            namespace,
            slotScopeIds,
            optimized,
            commonLength
          );
        }
      };
      const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
        let i2 = 0;
        const l2 = c2.length;
        let e1 = c1.length - 1;
        let e2 = l2 - 1;
        while (i2 <= e1 && i2 <= e2) {
          const n1 = c1[i2];
          const n2 = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
          if (isSameVNodeType(n1, n2)) {
            patch2(
              n1,
              n2,
              container,
              null,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
          } else {
            break;
          }
          i2++;
        }
        while (i2 <= e1 && i2 <= e2) {
          const n1 = c1[e1];
          const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]);
          if (isSameVNodeType(n1, n2)) {
            patch2(
              n1,
              n2,
              container,
              null,
              parentComponent,
              parentSuspense,
              namespace,
              slotScopeIds,
              optimized
            );
          } else {
            break;
          }
          e1--;
          e2--;
        }
        if (i2 > e1) {
          if (i2 <= e2) {
            const nextPos = e2 + 1;
            const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;
            while (i2 <= e2) {
              patch2(
                null,
                c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]),
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
              i2++;
            }
          }
        } else if (i2 > e2) {
          while (i2 <= e1) {
            unmount(c1[i2], parentComponent, parentSuspense, true);
            i2++;
          }
        } else {
          const s1 = i2;
          const s2 = i2;
          const keyToNewIndexMap = /* @__PURE__ */ new Map();
          for (i2 = s2; i2 <= e2; i2++) {
            const nextChild = c2[i2] = optimized ? cloneIfMounted(c2[i2]) : normalizeVNode(c2[i2]);
            if (nextChild.key != null) {
              keyToNewIndexMap.set(nextChild.key, i2);
            }
          }
          let j;
          let patched = 0;
          const toBePatched = e2 - s2 + 1;
          let moved = false;
          let maxNewIndexSoFar = 0;
          const newIndexToOldIndexMap = new Array(toBePatched);
          for (i2 = 0; i2 < toBePatched; i2++) newIndexToOldIndexMap[i2] = 0;
          for (i2 = s1; i2 <= e1; i2++) {
            const prevChild = c1[i2];
            if (patched >= toBePatched) {
              unmount(prevChild, parentComponent, parentSuspense, true);
              continue;
            }
            let newIndex;
            if (prevChild.key != null) {
              newIndex = keyToNewIndexMap.get(prevChild.key);
            } else {
              for (j = s2; j <= e2; j++) {
                if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) {
                  newIndex = j;
                  break;
                }
              }
            }
            if (newIndex === void 0) {
              unmount(prevChild, parentComponent, parentSuspense, true);
            } else {
              newIndexToOldIndexMap[newIndex - s2] = i2 + 1;
              if (newIndex >= maxNewIndexSoFar) {
                maxNewIndexSoFar = newIndex;
              } else {
                moved = true;
              }
              patch2(
                prevChild,
                c2[newIndex],
                container,
                null,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
              patched++;
            }
          }
          const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR;
          j = increasingNewIndexSequence.length - 1;
          for (i2 = toBePatched - 1; i2 >= 0; i2--) {
            const nextIndex = s2 + i2;
            const nextChild = c2[nextIndex];
            const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;
            if (newIndexToOldIndexMap[i2] === 0) {
              patch2(
                null,
                nextChild,
                container,
                anchor,
                parentComponent,
                parentSuspense,
                namespace,
                slotScopeIds,
                optimized
              );
            } else if (moved) {
              if (j < 0 || i2 !== increasingNewIndexSequence[j]) {
                move(nextChild, container, anchor, 2);
              } else {
                j--;
              }
            }
          }
        }
      };
      const move = (vnode, container, anchor, moveType, parentSuspense = null) => {
        const { el, type, transition, children, shapeFlag } = vnode;
        if (shapeFlag & 6) {
          move(vnode.component.subTree, container, anchor, moveType);
          return;
        }
        if (shapeFlag & 128) {
          vnode.suspense.move(container, anchor, moveType);
          return;
        }
        if (shapeFlag & 64) {
          type.move(vnode, container, anchor, internals);
          return;
        }
        if (type === Fragment) {
          hostInsert(el, container, anchor);
          for (let i2 = 0; i2 < children.length; i2++) {
            move(children[i2], container, anchor, moveType);
          }
          hostInsert(vnode.anchor, container, anchor);
          return;
        }
        if (type === Static) {
          moveStaticNode(vnode, container, anchor);
          return;
        }
        const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
        if (needTransition2) {
          if (moveType === 0) {
            transition.beforeEnter(el);
            hostInsert(el, container, anchor);
            queuePostRenderEffect(() => transition.enter(el), parentSuspense);
          } else {
            const { leave, delayLeave, afterLeave } = transition;
            const remove22 = () => hostInsert(el, container, anchor);
            const performLeave = () => {
              leave(el, () => {
                remove22();
                afterLeave && afterLeave();
              });
            };
            if (delayLeave) {
              delayLeave(el, remove22, performLeave);
            } else {
              performLeave();
            }
          }
        } else {
          hostInsert(el, container, anchor);
        }
      };
      const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {
        const {
          type,
          props: props2,
          ref: ref3,
          children,
          dynamicChildren,
          shapeFlag,
          patchFlag,
          dirs,
          cacheIndex
        } = vnode;
        if (patchFlag === -2) {
          optimized = false;
        }
        if (ref3 != null) {
          setRef(ref3, null, parentSuspense, vnode, true);
        }
        if (cacheIndex != null) {
          parentComponent.renderCache[cacheIndex] = void 0;
        }
        if (shapeFlag & 256) {
          parentComponent.ctx.deactivate(vnode);
          return;
        }
        const shouldInvokeDirs = shapeFlag & 1 && dirs;
        const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);
        let vnodeHook;
        if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeBeforeUnmount)) {
          invokeVNodeHook(vnodeHook, parentComponent, vnode);
        }
        if (shapeFlag & 6) {
          unmountComponent(vnode.component, parentSuspense, doRemove);
        } else {
          if (shapeFlag & 128) {
            vnode.suspense.unmount(parentSuspense, doRemove);
            return;
          }
          if (shouldInvokeDirs) {
            invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount");
          }
          if (shapeFlag & 64) {
            vnode.type.remove(
              vnode,
              parentComponent,
              parentSuspense,
              internals,
              doRemove
            );
          } else if (dynamicChildren && // #5154
          // when v-once is used inside a block, setBlockTracking(-1) marks the
          // parent block with hasOnce: true
          // so that it doesn't take the fast path during unmount - otherwise
          // components nested in v-once are never unmounted.
          !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
          (type !== Fragment || patchFlag > 0 && patchFlag & 64)) {
            unmountChildren(
              dynamicChildren,
              parentComponent,
              parentSuspense,
              false,
              true
            );
          } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) {
            unmountChildren(children, parentComponent, parentSuspense);
          }
          if (doRemove) {
            remove2(vnode);
          }
        }
        if (shouldInvokeVnodeHook && (vnodeHook = props2 && props2.onVnodeUnmounted) || shouldInvokeDirs) {
          queuePostRenderEffect(() => {
            vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
            shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
          }, parentSuspense);
        }
      };
      const remove2 = (vnode) => {
        const { type, el, anchor, transition } = vnode;
        if (type === Fragment) {
          {
            removeFragment(el, anchor);
          }
          return;
        }
        if (type === Static) {
          removeStaticNode(vnode);
          return;
        }
        const performRemove = () => {
          hostRemove(el);
          if (transition && !transition.persisted && transition.afterLeave) {
            transition.afterLeave();
          }
        };
        if (vnode.shapeFlag & 1 && transition && !transition.persisted) {
          const { leave, delayLeave } = transition;
          const performLeave = () => leave(el, performRemove);
          if (delayLeave) {
            delayLeave(vnode.el, performRemove, performLeave);
          } else {
            performLeave();
          }
        } else {
          performRemove();
        }
      };
      const removeFragment = (cur, end2) => {
        let next;
        while (cur !== end2) {
          next = hostNextSibling(cur);
          hostRemove(cur);
          cur = next;
        }
        hostRemove(end2);
      };
      const unmountComponent = (instance, parentSuspense, doRemove) => {
        const { bum, scope, job, subTree, um, m: m2, a: a2 } = instance;
        invalidateMount(m2);
        invalidateMount(a2);
        if (bum) {
          invokeArrayFns(bum);
        }
        scope.stop();
        if (job) {
          job.flags |= 8;
          unmount(subTree, instance, parentSuspense, doRemove);
        }
        if (um) {
          queuePostRenderEffect(um, parentSuspense);
        }
        queuePostRenderEffect(() => {
          instance.isUnmounted = true;
        }, parentSuspense);
        if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
          parentSuspense.deps--;
          if (parentSuspense.deps === 0) {
            parentSuspense.resolve();
          }
        }
      };
      const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start2 = 0) => {
        for (let i2 = start2; i2 < children.length; i2++) {
          unmount(children[i2], parentComponent, parentSuspense, doRemove, optimized);
        }
      };
      const getNextHostNode = (vnode) => {
        if (vnode.shapeFlag & 6) {
          return getNextHostNode(vnode.component.subTree);
        }
        if (vnode.shapeFlag & 128) {
          return vnode.suspense.next();
        }
        const el = hostNextSibling(vnode.anchor || vnode.el);
        const teleportEnd = el && el[TeleportEndKey];
        return teleportEnd ? hostNextSibling(teleportEnd) : el;
      };
      let isFlushing = false;
      const render2 = (vnode, container, namespace) => {
        if (vnode == null) {
          if (container._vnode) {
            unmount(container._vnode, null, null, true);
          }
        } else {
          patch2(
            container._vnode || null,
            vnode,
            container,
            null,
            null,
            null,
            namespace
          );
        }
        container._vnode = vnode;
        if (!isFlushing) {
          isFlushing = true;
          flushPreFlushCbs();
          flushPostFlushCbs();
          isFlushing = false;
        }
      };
      const internals = {
        p: patch2,
        um: unmount,
        m: move,
        r: remove2,
        mt: mountComponent,
        mc: mountChildren,
        pc: patchChildren,
        pbc: patchBlockChildren,
        n: getNextHostNode,
        o: options
      };
      let hydrate;
      return {
        render: render2,
        hydrate,
        createApp: createAppAPI(render2)
      };
    }
    function resolveChildrenNamespace({ type, props: props2 }, currentNamespace) {
      return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props2 && props2.encoding && props2.encoding.includes("html") ? void 0 : currentNamespace;
    }
    function toggleRecurse({ effect: effect2, job }, allowed) {
      if (allowed) {
        effect2.flags |= 32;
        job.flags |= 4;
      } else {
        effect2.flags &= -33;
        job.flags &= -5;
      }
    }
    function needTransition(parentSuspense, transition) {
      return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
    }
    function traverseStaticChildren(n1, n2, shallow = false) {
      const ch1 = n1.children;
      const ch2 = n2.children;
      if (isArray$5(ch1) && isArray$5(ch2)) {
        for (let i2 = 0; i2 < ch1.length; i2++) {
          const c1 = ch1[i2];
          let c2 = ch2[i2];
          if (c2.shapeFlag & 1 && !c2.dynamicChildren) {
            if (c2.patchFlag <= 0 || c2.patchFlag === 32) {
              c2 = ch2[i2] = cloneIfMounted(ch2[i2]);
              c2.el = c1.el;
            }
            if (!shallow && c2.patchFlag !== -2)
              traverseStaticChildren(c1, c2);
          }
          if (c2.type === Text$1) {
            c2.el = c1.el;
          }
        }
      }
    }
    function getSequence(arr) {
      const p2 = arr.slice();
      const result = [0];
      let i2, j, u2, v4, c2;
      const len2 = arr.length;
      for (i2 = 0; i2 < len2; i2++) {
        const arrI = arr[i2];
        if (arrI !== 0) {
          j = result[result.length - 1];
          if (arr[j] < arrI) {
            p2[i2] = j;
            result.push(i2);
            continue;
          }
          u2 = 0;
          v4 = result.length - 1;
          while (u2 < v4) {
            c2 = u2 + v4 >> 1;
            if (arr[result[c2]] < arrI) {
              u2 = c2 + 1;
            } else {
              v4 = c2;
            }
          }
          if (arrI < arr[result[u2]]) {
            if (u2 > 0) {
              p2[i2] = result[u2 - 1];
            }
            result[u2] = i2;
          }
        }
      }
      u2 = result.length;
      v4 = result[u2 - 1];
      while (u2-- > 0) {
        result[u2] = v4;
        v4 = p2[v4];
      }
      return result;
    }
    function locateNonHydratedAsyncRoot(instance) {
      const subComponent = instance.subTree.component;
      if (subComponent) {
        if (subComponent.asyncDep && !subComponent.asyncResolved) {
          return subComponent;
        } else {
          return locateNonHydratedAsyncRoot(subComponent);
        }
      }
    }
    function invalidateMount(hooks) {
      if (hooks) {
        for (let i2 = 0; i2 < hooks.length; i2++)
          hooks[i2].flags |= 8;
      }
    }
    const ssrContextKey = Symbol.for("v-scx");
    const useSSRContext = () => {
      {
        const ctx = inject(ssrContextKey);
        return ctx;
      }
    };
    function watchEffect(effect2, options) {
      return doWatch(effect2, null, options);
    }
    function watch(source, cb, options) {
      return doWatch(source, cb, options);
    }
    function doWatch(source, cb, options = EMPTY_OBJ$1) {
      const { immediate, deep, flush, once } = options;
      const baseWatchOptions = extend$2({}, options);
      const runsImmediately = cb && immediate || !cb && flush !== "post";
      let ssrCleanup;
      if (isInSSRComponentSetup) {
        if (flush === "sync") {
          const ctx = useSSRContext();
          ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
        } else if (!runsImmediately) {
          const watchStopHandle = () => {
          };
          watchStopHandle.stop = NOOP;
          watchStopHandle.resume = NOOP;
          watchStopHandle.pause = NOOP;
          return watchStopHandle;
        }
      }
      const instance = currentInstance;
      baseWatchOptions.call = (fn2, type, args) => callWithAsyncErrorHandling(fn2, instance, type, args);
      let isPre = false;
      if (flush === "post") {
        baseWatchOptions.scheduler = (job) => {
          queuePostRenderEffect(job, instance && instance.suspense);
        };
      } else if (flush !== "sync") {
        isPre = true;
        baseWatchOptions.scheduler = (job, isFirstRun) => {
          if (isFirstRun) {
            job();
          } else {
            queueJob(job);
          }
        };
      }
      baseWatchOptions.augmentJob = (job) => {
        if (cb) {
          job.flags |= 4;
        }
        if (isPre) {
          job.flags |= 2;
          if (instance) {
            job.id = instance.uid;
            job.i = instance;
          }
        }
      };
      const watchHandle = watch$1(source, cb, baseWatchOptions);
      if (isInSSRComponentSetup) {
        if (ssrCleanup) {
          ssrCleanup.push(watchHandle);
        } else if (runsImmediately) {
          watchHandle();
        }
      }
      return watchHandle;
    }
    function instanceWatch(source, value, options) {
      const publicThis = this.proxy;
      const getter = isString$3(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
      let cb;
      if (isFunction$4(value)) {
        cb = value;
      } else {
        cb = value.handler;
        options = value;
      }
      const reset = setCurrentInstance(this);
      const res = doWatch(getter, cb.bind(publicThis), options);
      reset();
      return res;
    }
    function createPathGetter(ctx, path) {
      const segments = path.split(".");
      return () => {
        let cur = ctx;
        for (let i2 = 0; i2 < segments.length && cur; i2++) {
          cur = cur[segments[i2]];
        }
        return cur;
      };
    }
    const getModelModifiers = (props2, modelName) => {
      return modelName === "modelValue" || modelName === "model-value" ? props2.modelModifiers : props2[`${modelName}Modifiers`] || props2[`${camelize(modelName)}Modifiers`] || props2[`${hyphenate(modelName)}Modifiers`];
    };
    function emit(instance, event, ...rawArgs) {
      if (instance.isUnmounted) return;
      const props2 = instance.vnode.props || EMPTY_OBJ$1;
      let args = rawArgs;
      const isModelListener2 = event.startsWith("update:");
      const modifiers = isModelListener2 && getModelModifiers(props2, event.slice(7));
      if (modifiers) {
        if (modifiers.trim) {
          args = rawArgs.map((a2) => isString$3(a2) ? a2.trim() : a2);
        }
        if (modifiers.number) {
          args = rawArgs.map(looseToNumber);
        }
      }
      let handlerName;
      let handler = props2[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
      props2[handlerName = toHandlerKey(camelize(event))];
      if (!handler && isModelListener2) {
        handler = props2[handlerName = toHandlerKey(hyphenate(event))];
      }
      if (handler) {
        callWithAsyncErrorHandling(
          handler,
          instance,
          6,
          args
        );
      }
      const onceHandler = props2[handlerName + `Once`];
      if (onceHandler) {
        if (!instance.emitted) {
          instance.emitted = {};
        } else if (instance.emitted[handlerName]) {
          return;
        }
        instance.emitted[handlerName] = true;
        callWithAsyncErrorHandling(
          onceHandler,
          instance,
          6,
          args
        );
      }
    }
    function normalizeEmitsOptions(comp, appContext, asMixin = false) {
      const cache2 = appContext.emitsCache;
      const cached = cache2.get(comp);
      if (cached !== void 0) {
        return cached;
      }
      const raw = comp.emits;
      let normalized = {};
      let hasExtends = false;
      if (!isFunction$4(comp)) {
        const extendEmits = (raw2) => {
          const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
          if (normalizedFromExtend) {
            hasExtends = true;
            extend$2(normalized, normalizedFromExtend);
          }
        };
        if (!asMixin && appContext.mixins.length) {
          appContext.mixins.forEach(extendEmits);
        }
        if (comp.extends) {
          extendEmits(comp.extends);
        }
        if (comp.mixins) {
          comp.mixins.forEach(extendEmits);
        }
      }
      if (!raw && !hasExtends) {
        if (isObject$7(comp)) {
          cache2.set(comp, null);
        }
        return null;
      }
      if (isArray$5(raw)) {
        raw.forEach((key) => normalized[key] = null);
      } else {
        extend$2(normalized, raw);
      }
      if (isObject$7(comp)) {
        cache2.set(comp, normalized);
      }
      return normalized;
    }
    function isEmitListener(options, key) {
      if (!options || !isOn(key)) {
        return false;
      }
      key = key.slice(2).replace(/Once$/, "");
      return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key);
    }
    function markAttrsAccessed() {
    }
    function renderComponentRoot(instance) {
      const {
        type: Component,
        vnode,
        proxy,
        withProxy,
        propsOptions: [propsOptions],
        slots,
        attrs,
        emit: emit2,
        render: render2,
        renderCache,
        props: props2,
        data,
        setupState,
        ctx,
        inheritAttrs
      } = instance;
      const prev = setCurrentRenderingInstance(instance);
      let result;
      let fallthroughAttrs;
      try {
        if (vnode.shapeFlag & 4) {
          const proxyToUse = withProxy || proxy;
          const thisProxy = false ? new Proxy(proxyToUse, {
            get(target, key, receiver) {
              warn$1(
                `Property '${String(
                  key
                )}' was accessed via 'this'. Avoid using 'this' in templates.`
              );
              return Reflect.get(target, key, receiver);
            }
          }) : proxyToUse;
          result = normalizeVNode(
            render2.call(
              thisProxy,
              proxyToUse,
              renderCache,
              false ? shallowReadonly(props2) : props2,
              setupState,
              data,
              ctx
            )
          );
          fallthroughAttrs = attrs;
        } else {
          const render22 = Component;
          if (false) ;
          result = normalizeVNode(
            render22.length > 1 ? render22(
              false ? shallowReadonly(props2) : props2,
              false ? {
                get attrs() {
                  markAttrsAccessed();
                  return shallowReadonly(attrs);
                },
                slots,
                emit: emit2
              } : { attrs, slots, emit: emit2 }
            ) : render22(
              false ? shallowReadonly(props2) : props2,
              null
            )
          );
          fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
        }
      } catch (err) {
        blockStack.length = 0;
        handleError(err, instance, 1);
        result = createVNode$1(Comment);
      }
      let root2 = result;
      if (fallthroughAttrs && inheritAttrs !== false) {
        const keys2 = Object.keys(fallthroughAttrs);
        const { shapeFlag } = root2;
        if (keys2.length) {
          if (shapeFlag & (1 | 6)) {
            if (propsOptions && keys2.some(isModelListener)) {
              fallthroughAttrs = filterModelListeners(
                fallthroughAttrs,
                propsOptions
              );
            }
            root2 = cloneVNode(root2, fallthroughAttrs, false, true);
          }
        }
      }
      if (vnode.dirs) {
        root2 = cloneVNode(root2, null, false, true);
        root2.dirs = root2.dirs ? root2.dirs.concat(vnode.dirs) : vnode.dirs;
      }
      if (vnode.transition) {
        setTransitionHooks(root2, vnode.transition);
      }
      {
        result = root2;
      }
      setCurrentRenderingInstance(prev);
      return result;
    }
    const getFunctionalFallthrough = (attrs) => {
      let res;
      for (const key in attrs) {
        if (key === "class" || key === "style" || isOn(key)) {
          (res || (res = {}))[key] = attrs[key];
        }
      }
      return res;
    };
    const filterModelListeners = (attrs, props2) => {
      const res = {};
      for (const key in attrs) {
        if (!isModelListener(key) || !(key.slice(9) in props2)) {
          res[key] = attrs[key];
        }
      }
      return res;
    };
    function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
      const { props: prevProps, children: prevChildren, component: component2 } = prevVNode;
      const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
      const emits = component2.emitsOptions;
      if (nextVNode.dirs || nextVNode.transition) {
        return true;
      }
      if (optimized && patchFlag >= 0) {
        if (patchFlag & 1024) {
          return true;
        }
        if (patchFlag & 16) {
          if (!prevProps) {
            return !!nextProps;
          }
          return hasPropsChanged(prevProps, nextProps, emits);
        } else if (patchFlag & 8) {
          const dynamicProps = nextVNode.dynamicProps;
          for (let i2 = 0; i2 < dynamicProps.length; i2++) {
            const key = dynamicProps[i2];
            if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
              return true;
            }
          }
        }
      } else {
        if (prevChildren || nextChildren) {
          if (!nextChildren || !nextChildren.$stable) {
            return true;
          }
        }
        if (prevProps === nextProps) {
          return false;
        }
        if (!prevProps) {
          return !!nextProps;
        }
        if (!nextProps) {
          return true;
        }
        return hasPropsChanged(prevProps, nextProps, emits);
      }
      return false;
    }
    function hasPropsChanged(prevProps, nextProps, emitsOptions) {
      const nextKeys = Object.keys(nextProps);
      if (nextKeys.length !== Object.keys(prevProps).length) {
        return true;
      }
      for (let i2 = 0; i2 < nextKeys.length; i2++) {
        const key = nextKeys[i2];
        if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
          return true;
        }
      }
      return false;
    }
    function updateHOCHostEl({ vnode, parent: parent2 }, el) {
      while (parent2) {
        const root2 = parent2.subTree;
        if (root2.suspense && root2.suspense.activeBranch === vnode) {
          root2.el = vnode.el;
        }
        if (root2 === vnode) {
          (vnode = parent2.vnode).el = el;
          parent2 = parent2.parent;
        } else {
          break;
        }
      }
    }
    const isSuspense = (type) => type.__isSuspense;
    function queueEffectWithSuspense(fn2, suspense) {
      if (suspense && suspense.pendingBranch) {
        if (isArray$5(fn2)) {
          suspense.effects.push(...fn2);
        } else {
          suspense.effects.push(fn2);
        }
      } else {
        queuePostFlushCb(fn2);
      }
    }
    const Fragment = Symbol.for("v-fgt");
    const Text$1 = Symbol.for("v-txt");
    const Comment = Symbol.for("v-cmt");
    const Static = Symbol.for("v-stc");
    const blockStack = [];
    let currentBlock = null;
    function openBlock(disableTracking = false) {
      blockStack.push(currentBlock = disableTracking ? null : []);
    }
    function closeBlock() {
      blockStack.pop();
      currentBlock = blockStack[blockStack.length - 1] || null;
    }
    let isBlockTreeEnabled = 1;
    function setBlockTracking(value, inVOnce = false) {
      isBlockTreeEnabled += value;
      if (value < 0 && currentBlock && inVOnce) {
        currentBlock.hasOnce = true;
      }
    }
    function setupBlock(vnode) {
      vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;
      closeBlock();
      if (isBlockTreeEnabled > 0 && currentBlock) {
        currentBlock.push(vnode);
      }
      return vnode;
    }
    function createElementBlock(type, props2, children, patchFlag, dynamicProps, shapeFlag) {
      return setupBlock(
        createBaseVNode(
          type,
          props2,
          children,
          patchFlag,
          dynamicProps,
          shapeFlag,
          true
        )
      );
    }
    function createBlock(type, props2, children, patchFlag, dynamicProps) {
      return setupBlock(
        createVNode$1(
          type,
          props2,
          children,
          patchFlag,
          dynamicProps,
          true
        )
      );
    }
    function isVNode(value) {
      return value ? value.__v_isVNode === true : false;
    }
    function isSameVNodeType(n1, n2) {
      return n1.type === n2.type && n1.key === n2.key;
    }
    const normalizeKey = ({ key }) => key != null ? key : null;
    const normalizeRef = ({
      ref: ref3,
      ref_key,
      ref_for
    }) => {
      if (typeof ref3 === "number") {
        ref3 = "" + ref3;
      }
      return ref3 != null ? isString$3(ref3) || isRef(ref3) || isFunction$4(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null;
    };
    function createBaseVNode(type, props2 = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) {
      const vnode = {
        __v_isVNode: true,
        __v_skip: true,
        type,
        props: props2,
        key: props2 && normalizeKey(props2),
        ref: props2 && normalizeRef(props2),
        scopeId: currentScopeId,
        slotScopeIds: null,
        children,
        component: null,
        suspense: null,
        ssContent: null,
        ssFallback: null,
        dirs: null,
        transition: null,
        el: null,
        anchor: null,
        target: null,
        targetStart: null,
        targetAnchor: null,
        staticCount: 0,
        shapeFlag,
        patchFlag,
        dynamicProps,
        dynamicChildren: null,
        appContext: null,
        ctx: currentRenderingInstance
      };
      if (needFullChildrenNormalization) {
        normalizeChildren(vnode, children);
        if (shapeFlag & 128) {
          type.normalize(vnode);
        }
      } else if (children) {
        vnode.shapeFlag |= isString$3(children) ? 8 : 16;
      }
      if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself
      !isBlockNode && // has current parent block
      currentBlock && // presence of a patch flag indicates this node needs patching on updates.
      // component nodes also should always be patched, because even if the
      // component doesn't need to update, it needs to persist the instance on to
      // the next vnode so that it can be properly unmounted later.
      (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
      // vnode should not be considered dynamic due to handler caching.
      vnode.patchFlag !== 32) {
        currentBlock.push(vnode);
      }
      return vnode;
    }
    const createVNode$1 = _createVNode;
    function _createVNode(type, props2 = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
      if (!type || type === NULL_DYNAMIC_COMPONENT) {
        type = Comment;
      }
      if (isVNode(type)) {
        const cloned = cloneVNode(
          type,
          props2,
          true
          /* mergeRef: true */
        );
        if (children) {
          normalizeChildren(cloned, children);
        }
        if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) {
          if (cloned.shapeFlag & 6) {
            currentBlock[currentBlock.indexOf(type)] = cloned;
          } else {
            currentBlock.push(cloned);
          }
        }
        cloned.patchFlag = -2;
        return cloned;
      }
      if (isClassComponent(type)) {
        type = type.__vccOpts;
      }
      if (props2) {
        props2 = guardReactiveProps(props2);
        let { class: klass, style } = props2;
        if (klass && !isString$3(klass)) {
          props2.class = normalizeClass(klass);
        }
        if (isObject$7(style)) {
          if (isProxy(style) && !isArray$5(style)) {
            style = extend$2({}, style);
          }
          props2.style = normalizeStyle$1(style);
        }
      }
      const shapeFlag = isString$3(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$7(type) ? 4 : isFunction$4(type) ? 2 : 0;
      return createBaseVNode(
        type,
        props2,
        children,
        patchFlag,
        dynamicProps,
        shapeFlag,
        isBlockNode,
        true
      );
    }
    function guardReactiveProps(props2) {
      if (!props2) return null;
      return isProxy(props2) || isInternalObject(props2) ? extend$2({}, props2) : props2;
    }
    function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
      const { props: props2, ref: ref3, patchFlag, children, transition } = vnode;
      const mergedProps = extraProps ? mergeProps(props2 || {}, extraProps) : props2;
      const cloned = {
        __v_isVNode: true,
        __v_skip: true,
        type: vnode.type,
        props: mergedProps,
        key: mergedProps && normalizeKey(mergedProps),
        ref: extraProps && extraProps.ref ? (
          // #2078 in the case of <component :is="vnode" ref="extra"/>
          // if the vnode itself already has a ref, cloneVNode will need to merge
          // the refs so the single vnode can be set on multiple refs
          mergeRef && ref3 ? isArray$5(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps)
        ) : ref3,
        scopeId: vnode.scopeId,
        slotScopeIds: vnode.slotScopeIds,
        children,
        target: vnode.target,
        targetStart: vnode.targetStart,
        targetAnchor: vnode.targetAnchor,
        staticCount: vnode.staticCount,
        shapeFlag: vnode.shapeFlag,
        // if the vnode is cloned with extra props, we can no longer assume its
        // existing patch flag to be reliable and need to add the FULL_PROPS flag.
        // note: preserve flag for fragments since they use the flag for children
        // fast paths only.
        patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16 : patchFlag | 16 : patchFlag,
        dynamicProps: vnode.dynamicProps,
        dynamicChildren: vnode.dynamicChildren,
        appContext: vnode.appContext,
        dirs: vnode.dirs,
        transition,
        // These should technically only be non-null on mounted VNodes. However,
        // they *should* be copied for kept-alive vnodes. So we just always copy
        // them since them being non-null during a mount doesn't affect the logic as
        // they will simply be overwritten.
        component: vnode.component,
        suspense: vnode.suspense,
        ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
        ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
        el: vnode.el,
        anchor: vnode.anchor,
        ctx: vnode.ctx,
        ce: vnode.ce
      };
      if (transition && cloneTransition) {
        setTransitionHooks(
          cloned,
          transition.clone(cloned)
        );
      }
      return cloned;
    }
    function createTextVNode(text = " ", flag = 0) {
      return createVNode$1(Text$1, null, text, flag);
    }
    function createStaticVNode(content2, numberOfNodes) {
      const vnode = createVNode$1(Static, null, content2);
      vnode.staticCount = numberOfNodes;
      return vnode;
    }
    function createCommentVNode(text = "", asBlock = false) {
      return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode$1(Comment, null, text);
    }
    function normalizeVNode(child) {
      if (child == null || typeof child === "boolean") {
        return createVNode$1(Comment);
      } else if (isArray$5(child)) {
        return createVNode$1(
          Fragment,
          null,
          // #3666, avoid reference pollution when reusing vnode
          child.slice()
        );
      } else if (isVNode(child)) {
        return cloneIfMounted(child);
      } else {
        return createVNode$1(Text$1, null, String(child));
      }
    }
    function cloneIfMounted(child) {
      return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child);
    }
    function normalizeChildren(vnode, children) {
      let type = 0;
      const { shapeFlag } = vnode;
      if (children == null) {
        children = null;
      } else if (isArray$5(children)) {
        type = 16;
      } else if (typeof children === "object") {
        if (shapeFlag & (1 | 64)) {
          const slot = children.default;
          if (slot) {
            slot._c && (slot._d = false);
            normalizeChildren(vnode, slot());
            slot._c && (slot._d = true);
          }
          return;
        } else {
          type = 32;
          const slotFlag = children._;
          if (!slotFlag && !isInternalObject(children)) {
            children._ctx = currentRenderingInstance;
          } else if (slotFlag === 3 && currentRenderingInstance) {
            if (currentRenderingInstance.slots._ === 1) {
              children._ = 1;
            } else {
              children._ = 2;
              vnode.patchFlag |= 1024;
            }
          }
        }
      } else if (isFunction$4(children)) {
        children = { default: children, _ctx: currentRenderingInstance };
        type = 32;
      } else {
        children = String(children);
        if (shapeFlag & 64) {
          type = 16;
          children = [createTextVNode(children)];
        } else {
          type = 8;
        }
      }
      vnode.children = children;
      vnode.shapeFlag |= type;
    }
    function mergeProps(...args) {
      const ret = {};
      for (let i2 = 0; i2 < args.length; i2++) {
        const toMerge = args[i2];
        for (const key in toMerge) {
          if (key === "class") {
            if (ret.class !== toMerge.class) {
              ret.class = normalizeClass([ret.class, toMerge.class]);
            }
          } else if (key === "style") {
            ret.style = normalizeStyle$1([ret.style, toMerge.style]);
          } else if (isOn(key)) {
            const existing = ret[key];
            const incoming = toMerge[key];
            if (incoming && existing !== incoming && !(isArray$5(existing) && existing.includes(incoming))) {
              ret[key] = existing ? [].concat(existing, incoming) : incoming;
            }
          } else if (key !== "") {
            ret[key] = toMerge[key];
          }
        }
      }
      return ret;
    }
    function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
      callWithAsyncErrorHandling(hook, instance, 7, [
        vnode,
        prevVNode
      ]);
    }
    const emptyAppContext = createAppContext();
    let uid$2 = 0;
    function createComponentInstance(vnode, parent2, suspense) {
      const type = vnode.type;
      const appContext = (parent2 ? parent2.appContext : vnode.appContext) || emptyAppContext;
      const instance = {
        uid: uid$2++,
        vnode,
        type,
        parent: parent2,
        appContext,
        root: null,
        // to be immediately set
        next: null,
        subTree: null,
        // will be set synchronously right after creation
        effect: null,
        update: null,
        // will be set synchronously right after creation
        job: null,
        scope: new EffectScope(
          true
          /* detached */
        ),
        render: null,
        proxy: null,
        exposed: null,
        exposeProxy: null,
        withProxy: null,
        provides: parent2 ? parent2.provides : Object.create(appContext.provides),
        ids: parent2 ? parent2.ids : ["", 0, 0],
        accessCache: null,
        renderCache: [],
        // local resolved assets
        components: null,
        directives: null,
        // resolved props and emits options
        propsOptions: normalizePropsOptions(type, appContext),
        emitsOptions: normalizeEmitsOptions(type, appContext),
        // emit
        emit: null,
        // to be set immediately
        emitted: null,
        // props default value
        propsDefaults: EMPTY_OBJ$1,
        // inheritAttrs
        inheritAttrs: type.inheritAttrs,
        // state
        ctx: EMPTY_OBJ$1,
        data: EMPTY_OBJ$1,
        props: EMPTY_OBJ$1,
        attrs: EMPTY_OBJ$1,
        slots: EMPTY_OBJ$1,
        refs: EMPTY_OBJ$1,
        setupState: EMPTY_OBJ$1,
        setupContext: null,
        // suspense related
        suspense,
        suspenseId: suspense ? suspense.pendingId : 0,
        asyncDep: null,
        asyncResolved: false,
        // lifecycle hooks
        // not using enums here because it results in computed properties
        isMounted: false,
        isUnmounted: false,
        isDeactivated: false,
        bc: null,
        c: null,
        bm: null,
        m: null,
        bu: null,
        u: null,
        um: null,
        bum: null,
        da: null,
        a: null,
        rtg: null,
        rtc: null,
        ec: null,
        sp: null
      };
      {
        instance.ctx = { _: instance };
      }
      instance.root = parent2 ? parent2.root : instance;
      instance.emit = emit.bind(null, instance);
      if (vnode.ce) {
        vnode.ce(instance);
      }
      return instance;
    }
    let currentInstance = null;
    const getCurrentInstance = () => currentInstance || currentRenderingInstance;
    let internalSetCurrentInstance;
    let setInSSRSetupState;
    {
      const g = getGlobalThis();
      const registerGlobalSetter = (key, setter) => {
        let setters;
        if (!(setters = g[key])) setters = g[key] = [];
        setters.push(setter);
        return (v4) => {
          if (setters.length > 1) setters.forEach((set2) => set2(v4));
          else setters[0](v4);
        };
      };
      internalSetCurrentInstance = registerGlobalSetter(
        `__VUE_INSTANCE_SETTERS__`,
        (v4) => currentInstance = v4
      );
      setInSSRSetupState = registerGlobalSetter(
        `__VUE_SSR_SETTERS__`,
        (v4) => isInSSRComponentSetup = v4
      );
    }
    const setCurrentInstance = (instance) => {
      const prev = currentInstance;
      internalSetCurrentInstance(instance);
      instance.scope.on();
      return () => {
        instance.scope.off();
        internalSetCurrentInstance(prev);
      };
    };
    const unsetCurrentInstance = () => {
      currentInstance && currentInstance.scope.off();
      internalSetCurrentInstance(null);
    };
    function isStatefulComponent(instance) {
      return instance.vnode.shapeFlag & 4;
    }
    let isInSSRComponentSetup = false;
    function setupComponent(instance, isSSR = false, optimized = false) {
      isSSR && setInSSRSetupState(isSSR);
      const { props: props2, children } = instance.vnode;
      const isStateful = isStatefulComponent(instance);
      initProps$1(instance, props2, isStateful, isSSR);
      initSlots(instance, children, optimized);
      const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
      isSSR && setInSSRSetupState(false);
      return setupResult;
    }
    function setupStatefulComponent(instance, isSSR) {
      const Component = instance.type;
      instance.accessCache = /* @__PURE__ */ Object.create(null);
      instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
      const { setup } = Component;
      if (setup) {
        pauseTracking();
        const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
        const reset = setCurrentInstance(instance);
        const setupResult = callWithErrorHandling(
          setup,
          instance,
          0,
          [
            instance.props,
            setupContext
          ]
        );
        const isAsyncSetup = isPromise$1(setupResult);
        resetTracking();
        reset();
        if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
          markAsyncBoundary(instance);
        }
        if (isAsyncSetup) {
          setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
          if (isSSR) {
            return setupResult.then((resolvedResult) => {
              handleSetupResult(instance, resolvedResult);
            }).catch((e2) => {
              handleError(e2, instance, 0);
            });
          } else {
            instance.asyncDep = setupResult;
          }
        } else {
          handleSetupResult(instance, setupResult);
        }
      } else {
        finishComponentSetup(instance);
      }
    }
    function handleSetupResult(instance, setupResult, isSSR) {
      if (isFunction$4(setupResult)) {
        if (instance.type.__ssrInlineRender) {
          instance.ssrRender = setupResult;
        } else {
          instance.render = setupResult;
        }
      } else if (isObject$7(setupResult)) {
        instance.setupState = proxyRefs(setupResult);
      } else ;
      finishComponentSetup(instance);
    }
    function finishComponentSetup(instance, isSSR, skipOptions) {
      const Component = instance.type;
      if (!instance.render) {
        instance.render = Component.render || NOOP;
      }
      {
        const reset = setCurrentInstance(instance);
        pauseTracking();
        try {
          applyOptions(instance);
        } finally {
          resetTracking();
          reset();
        }
      }
    }
    const attrsProxyHandlers = {
      get(target, key) {
        track(target, "get", "");
        return target[key];
      }
    };
    function createSetupContext(instance) {
      const expose = (exposed) => {
        instance.exposed = exposed || {};
      };
      {
        return {
          attrs: new Proxy(instance.attrs, attrsProxyHandlers),
          slots: instance.slots,
          emit: instance.emit,
          expose
        };
      }
    }
    function getComponentPublicInstance(instance) {
      if (instance.exposed) {
        return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
          get(target, key) {
            if (key in target) {
              return target[key];
            } else if (key in publicPropertiesMap) {
              return publicPropertiesMap[key](instance);
            }
          },
          has(target, key) {
            return key in target || key in publicPropertiesMap;
          }
        }));
      } else {
        return instance.proxy;
      }
    }
    const classifyRE = /(?:^|[-_])(\w)/g;
    const classify = (str) => str.replace(classifyRE, (c2) => c2.toUpperCase()).replace(/[-_]/g, "");
    function getComponentName(Component, includeInferred = true) {
      return isFunction$4(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
    }
    function formatComponentName(instance, Component, isRoot = false) {
      let name = getComponentName(Component);
      if (!name && Component.__file) {
        const match = Component.__file.match(/([^/\\]+)\.\w+$/);
        if (match) {
          name = match[1];
        }
      }
      if (!name && instance && instance.parent) {
        const inferFromRegistry = (registry) => {
          for (const key in registry) {
            if (registry[key] === Component) {
              return key;
            }
          }
        };
        name = inferFromRegistry(
          instance.components || instance.parent.type.components
        ) || inferFromRegistry(instance.appContext.components);
      }
      return name ? classify(name) : isRoot ? `App` : `Anonymous`;
    }
    function isClassComponent(value) {
      return isFunction$4(value) && "__vccOpts" in value;
    }
    const computed = (getterOrOptions, debugOptions) => {
      const c2 = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
      return c2;
    };
    function h$1(type, propsOrChildren, children) {
      const l2 = arguments.length;
      if (l2 === 2) {
        if (isObject$7(propsOrChildren) && !isArray$5(propsOrChildren)) {
          if (isVNode(propsOrChildren)) {
            return createVNode$1(type, null, [propsOrChildren]);
          }
          return createVNode$1(type, propsOrChildren);
        } else {
          return createVNode$1(type, null, propsOrChildren);
        }
      } else {
        if (l2 > 3) {
          children = Array.prototype.slice.call(arguments, 2);
        } else if (l2 === 3 && isVNode(children)) {
          children = [children];
        }
        return createVNode$1(type, propsOrChildren, children);
      }
    }
    const version$1 = "3.5.13";
    const warn = NOOP;
    /**
    * @vue/runtime-dom v3.5.13
    * (c) 2018-present Yuxi (Evan) You and Vue contributors
    * @license MIT
    **/
    let policy = void 0;
    const tt$1 = typeof window !== "undefined" && window.trustedTypes;
    if (tt$1) {
      try {
        policy = /* @__PURE__ */ tt$1.createPolicy("vue", {
          createHTML: (val) => val
        });
      } catch (e2) {
      }
    }
    const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val;
    const svgNS = "http://www.w3.org/2000/svg";
    const mathmlNS = "http://www.w3.org/1998/Math/MathML";
    const doc = typeof document !== "undefined" ? document : null;
    const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
    const nodeOps = {
      insert: (child, parent2, anchor) => {
        parent2.insertBefore(child, anchor || null);
      },
      remove: (child) => {
        const parent2 = child.parentNode;
        if (parent2) {
          parent2.removeChild(child);
        }
      },
      createElement: (tag, namespace, is, props2) => {
        const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : is ? doc.createElement(tag, { is }) : doc.createElement(tag);
        if (tag === "select" && props2 && props2.multiple != null) {
          el.setAttribute("multiple", props2.multiple);
        }
        return el;
      },
      createText: (text) => doc.createTextNode(text),
      createComment: (text) => doc.createComment(text),
      setText: (node, text) => {
        node.nodeValue = text;
      },
      setElementText: (el, text) => {
        el.textContent = text;
      },
      parentNode: (node) => node.parentNode,
      nextSibling: (node) => node.nextSibling,
      querySelector: (selector2) => doc.querySelector(selector2),
      setScopeId(el, id) {
        el.setAttribute(id, "");
      },
      // __UNSAFE__
      // Reason: innerHTML.
      // Static content here can only come from compiled templates.
      // As long as the user only uses trusted templates, this is safe.
      insertStaticContent(content2, parent2, anchor, namespace, start2, end2) {
        const before = anchor ? anchor.previousSibling : parent2.lastChild;
        if (start2 && (start2 === end2 || start2.nextSibling)) {
          while (true) {
            parent2.insertBefore(start2.cloneNode(true), anchor);
            if (start2 === end2 || !(start2 = start2.nextSibling)) break;
          }
        } else {
          templateContainer.innerHTML = unsafeToTrustedHTML(
            namespace === "svg" ? `<svg>${content2}</svg>` : namespace === "mathml" ? `<math>${content2}</math>` : content2
          );
          const template = templateContainer.content;
          if (namespace === "svg" || namespace === "mathml") {
            const wrapper = template.firstChild;
            while (wrapper.firstChild) {
              template.appendChild(wrapper.firstChild);
            }
            template.removeChild(wrapper);
          }
          parent2.insertBefore(template, anchor);
        }
        return [
          // first
          before ? before.nextSibling : parent2.firstChild,
          // last
          anchor ? anchor.previousSibling : parent2.lastChild
        ];
      }
    };
    const TRANSITION = "transition";
    const ANIMATION = "animation";
    const vtcKey = Symbol("_vtc");
    const DOMTransitionPropsValidators = {
      name: String,
      type: String,
      css: {
        type: Boolean,
        default: true
      },
      duration: [String, Number, Object],
      enterFromClass: String,
      enterActiveClass: String,
      enterToClass: String,
      appearFromClass: String,
      appearActiveClass: String,
      appearToClass: String,
      leaveFromClass: String,
      leaveActiveClass: String,
      leaveToClass: String
    };
    const TransitionPropsValidators = /* @__PURE__ */ extend$2(
      {},
      BaseTransitionPropsValidators,
      DOMTransitionPropsValidators
    );
    const decorate$1 = (t) => {
      t.displayName = "Transition";
      t.props = TransitionPropsValidators;
      return t;
    };
    const Transition = /* @__PURE__ */ decorate$1(
      (props2, { slots }) => h$1(BaseTransition, resolveTransitionProps(props2), slots)
    );
    const callHook = (hook, args = []) => {
      if (isArray$5(hook)) {
        hook.forEach((h2) => h2(...args));
      } else if (hook) {
        hook(...args);
      }
    };
    const hasExplicitCallback = (hook) => {
      return hook ? isArray$5(hook) ? hook.some((h2) => h2.length > 1) : hook.length > 1 : false;
    };
    function resolveTransitionProps(rawProps) {
      const baseProps = {};
      for (const key in rawProps) {
        if (!(key in DOMTransitionPropsValidators)) {
          baseProps[key] = rawProps[key];
        }
      }
      if (rawProps.css === false) {
        return baseProps;
      }
      const {
        name = "v",
        type,
        duration: duration2,
        enterFromClass = `${name}-enter-from`,
        enterActiveClass = `${name}-enter-active`,
        enterToClass = `${name}-enter-to`,
        appearFromClass = enterFromClass,
        appearActiveClass = enterActiveClass,
        appearToClass = enterToClass,
        leaveFromClass = `${name}-leave-from`,
        leaveActiveClass = `${name}-leave-active`,
        leaveToClass = `${name}-leave-to`
      } = rawProps;
      const durations = normalizeDuration(duration2);
      const enterDuration = durations && durations[0];
      const leaveDuration = durations && durations[1];
      const {
        onBeforeEnter,
        onEnter,
        onEnterCancelled,
        onLeave: onLeave2,
        onLeaveCancelled,
        onBeforeAppear = onBeforeEnter,
        onAppear = onEnter,
        onAppearCancelled = onEnterCancelled
      } = baseProps;
      const finishEnter = (el, isAppear, done, isCancelled) => {
        el._enterCancelled = isCancelled;
        removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
        removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
        done && done();
      };
      const finishLeave = (el, done) => {
        el._isLeaving = false;
        removeTransitionClass(el, leaveFromClass);
        removeTransitionClass(el, leaveToClass);
        removeTransitionClass(el, leaveActiveClass);
        done && done();
      };
      const makeEnterHook = (isAppear) => {
        return (el, done) => {
          const hook = isAppear ? onAppear : onEnter;
          const resolve2 = () => finishEnter(el, isAppear, done);
          callHook(hook, [el, resolve2]);
          nextFrame(() => {
            removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
            addTransitionClass(el, isAppear ? appearToClass : enterToClass);
            if (!hasExplicitCallback(hook)) {
              whenTransitionEnds(el, type, enterDuration, resolve2);
            }
          });
        };
      };
      return extend$2(baseProps, {
        onBeforeEnter(el) {
          callHook(onBeforeEnter, [el]);
          addTransitionClass(el, enterFromClass);
          addTransitionClass(el, enterActiveClass);
        },
        onBeforeAppear(el) {
          callHook(onBeforeAppear, [el]);
          addTransitionClass(el, appearFromClass);
          addTransitionClass(el, appearActiveClass);
        },
        onEnter: makeEnterHook(false),
        onAppear: makeEnterHook(true),
        onLeave(el, done) {
          el._isLeaving = true;
          const resolve2 = () => finishLeave(el, done);
          addTransitionClass(el, leaveFromClass);
          if (!el._enterCancelled) {
            forceReflow();
            addTransitionClass(el, leaveActiveClass);
          } else {
            addTransitionClass(el, leaveActiveClass);
            forceReflow();
          }
          nextFrame(() => {
            if (!el._isLeaving) {
              return;
            }
            removeTransitionClass(el, leaveFromClass);
            addTransitionClass(el, leaveToClass);
            if (!hasExplicitCallback(onLeave2)) {
              whenTransitionEnds(el, type, leaveDuration, resolve2);
            }
          });
          callHook(onLeave2, [el, resolve2]);
        },
        onEnterCancelled(el) {
          finishEnter(el, false, void 0, true);
          callHook(onEnterCancelled, [el]);
        },
        onAppearCancelled(el) {
          finishEnter(el, true, void 0, true);
          callHook(onAppearCancelled, [el]);
        },
        onLeaveCancelled(el) {
          finishLeave(el);
          callHook(onLeaveCancelled, [el]);
        }
      });
    }
    function normalizeDuration(duration2) {
      if (duration2 == null) {
        return null;
      } else if (isObject$7(duration2)) {
        return [NumberOf(duration2.enter), NumberOf(duration2.leave)];
      } else {
        const n = NumberOf(duration2);
        return [n, n];
      }
    }
    function NumberOf(val) {
      const res = toNumber$1(val);
      return res;
    }
    function addTransitionClass(el, cls) {
      cls.split(/\s+/).forEach((c2) => c2 && el.classList.add(c2));
      (el[vtcKey] || (el[vtcKey] = /* @__PURE__ */ new Set())).add(cls);
    }
    function removeTransitionClass(el, cls) {
      cls.split(/\s+/).forEach((c2) => c2 && el.classList.remove(c2));
      const _vtc = el[vtcKey];
      if (_vtc) {
        _vtc.delete(cls);
        if (!_vtc.size) {
          el[vtcKey] = void 0;
        }
      }
    }
    function nextFrame(cb) {
      requestAnimationFrame(() => {
        requestAnimationFrame(cb);
      });
    }
    let endId = 0;
    function whenTransitionEnds(el, expectedType, explicitTimeout, resolve2) {
      const id = el._endId = ++endId;
      const resolveIfNotStale = () => {
        if (id === el._endId) {
          resolve2();
        }
      };
      if (explicitTimeout != null) {
        return setTimeout(resolveIfNotStale, explicitTimeout);
      }
      const { type, timeout, propCount } = getTransitionInfo(el, expectedType);
      if (!type) {
        return resolve2();
      }
      const endEvent = type + "end";
      let ended = 0;
      const end2 = () => {
        el.removeEventListener(endEvent, onEnd);
        resolveIfNotStale();
      };
      const onEnd = (e2) => {
        if (e2.target === el && ++ended >= propCount) {
          end2();
        }
      };
      setTimeout(() => {
        if (ended < propCount) {
          end2();
        }
      }, timeout + 1);
      el.addEventListener(endEvent, onEnd);
    }
    function getTransitionInfo(el, expectedType) {
      const styles = window.getComputedStyle(el);
      const getStyleProperties = (key) => (styles[key] || "").split(", ");
      const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
      const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
      const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
      const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
      const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
      const animationTimeout = getTimeout(animationDelays, animationDurations);
      let type = null;
      let timeout = 0;
      let propCount = 0;
      if (expectedType === TRANSITION) {
        if (transitionTimeout > 0) {
          type = TRANSITION;
          timeout = transitionTimeout;
          propCount = transitionDurations.length;
        }
      } else if (expectedType === ANIMATION) {
        if (animationTimeout > 0) {
          type = ANIMATION;
          timeout = animationTimeout;
          propCount = animationDurations.length;
        }
      } else {
        timeout = Math.max(transitionTimeout, animationTimeout);
        type = timeout > 0 ? transitionTimeout > animationTimeout ? TRANSITION : ANIMATION : null;
        propCount = type ? type === TRANSITION ? transitionDurations.length : animationDurations.length : 0;
      }
      const hasTransform = type === TRANSITION && /\b(transform|all)(,|$)/.test(
        getStyleProperties(`${TRANSITION}Property`).toString()
      );
      return {
        type,
        timeout,
        propCount,
        hasTransform
      };
    }
    function getTimeout(delays, durations) {
      while (delays.length < durations.length) {
        delays = delays.concat(delays);
      }
      return Math.max(...durations.map((d2, i2) => toMs(d2) + toMs(delays[i2])));
    }
    function toMs(s2) {
      if (s2 === "auto") return 0;
      return Number(s2.slice(0, -1).replace(",", ".")) * 1e3;
    }
    function forceReflow() {
      return document.body.offsetHeight;
    }
    function patchClass(el, value, isSVG2) {
      const transitionClasses = el[vtcKey];
      if (transitionClasses) {
        value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" ");
      }
      if (value == null) {
        el.removeAttribute("class");
      } else if (isSVG2) {
        el.setAttribute("class", value);
      } else {
        el.className = value;
      }
    }
    const vShowOriginalDisplay = Symbol("_vod");
    const vShowHidden = Symbol("_vsh");
    const vShow = {
      beforeMount(el, { value }, { transition }) {
        el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display;
        if (transition && value) {
          transition.beforeEnter(el);
        } else {
          setDisplay(el, value);
        }
      },
      mounted(el, { value }, { transition }) {
        if (transition && value) {
          transition.enter(el);
        }
      },
      updated(el, { value, oldValue }, { transition }) {
        if (!value === !oldValue) return;
        if (transition) {
          if (value) {
            transition.beforeEnter(el);
            setDisplay(el, true);
            transition.enter(el);
          } else {
            transition.leave(el, () => {
              setDisplay(el, false);
            });
          }
        } else {
          setDisplay(el, value);
        }
      },
      beforeUnmount(el, { value }) {
        setDisplay(el, value);
      }
    };
    function setDisplay(el, value) {
      el.style.display = value ? el[vShowOriginalDisplay] : "none";
      el[vShowHidden] = !value;
    }
    const CSS_VAR_TEXT = Symbol("");
    const displayRE = /(^|;)\s*display\s*:/;
    function patchStyle(el, prev, next) {
      const style = el.style;
      const isCssString = isString$3(next);
      let hasControlledDisplay = false;
      if (next && !isCssString) {
        if (prev) {
          if (!isString$3(prev)) {
            for (const key in prev) {
              if (next[key] == null) {
                setStyle$1(style, key, "");
              }
            }
          } else {
            for (const prevStyle of prev.split(";")) {
              const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim();
              if (next[key] == null) {
                setStyle$1(style, key, "");
              }
            }
          }
        }
        for (const key in next) {
          if (key === "display") {
            hasControlledDisplay = true;
          }
          setStyle$1(style, key, next[key]);
        }
      } else {
        if (isCssString) {
          if (prev !== next) {
            const cssVarText = style[CSS_VAR_TEXT];
            if (cssVarText) {
              next += ";" + cssVarText;
            }
            style.cssText = next;
            hasControlledDisplay = displayRE.test(next);
          }
        } else if (prev) {
          el.removeAttribute("style");
        }
      }
      if (vShowOriginalDisplay in el) {
        el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : "";
        if (el[vShowHidden]) {
          style.display = "none";
        }
      }
    }
    const importantRE = /\s*!important$/;
    function setStyle$1(style, name, val) {
      if (isArray$5(val)) {
        val.forEach((v4) => setStyle$1(style, name, v4));
      } else {
        if (val == null) val = "";
        if (name.startsWith("--")) {
          style.setProperty(name, val);
        } else {
          const prefixed = autoPrefix(style, name);
          if (importantRE.test(val)) {
            style.setProperty(
              hyphenate(prefixed),
              val.replace(importantRE, ""),
              "important"
            );
          } else {
            style[prefixed] = val;
          }
        }
      }
    }
    const prefixes = ["Webkit", "Moz", "ms"];
    const prefixCache = {};
    function autoPrefix(style, rawName) {
      const cached = prefixCache[rawName];
      if (cached) {
        return cached;
      }
      let name = camelize(rawName);
      if (name !== "filter" && name in style) {
        return prefixCache[rawName] = name;
      }
      name = capitalize$2(name);
      for (let i2 = 0; i2 < prefixes.length; i2++) {
        const prefixed = prefixes[i2] + name;
        if (prefixed in style) {
          return prefixCache[rawName] = prefixed;
        }
      }
      return rawName;
    }
    const xlinkNS = "http://www.w3.org/1999/xlink";
    function patchAttr(el, key, value, isSVG2, instance, isBoolean2 = isSpecialBooleanAttr(key)) {
      if (isSVG2 && key.startsWith("xlink:")) {
        if (value == null) {
          el.removeAttributeNS(xlinkNS, key.slice(6, key.length));
        } else {
          el.setAttributeNS(xlinkNS, key, value);
        }
      } else {
        if (value == null || isBoolean2 && !includeBooleanAttr(value)) {
          el.removeAttribute(key);
        } else {
          el.setAttribute(
            key,
            isBoolean2 ? "" : isSymbol$1(value) ? String(value) : value
          );
        }
      }
    }
    function patchDOMProp(el, key, value, parentComponent, attrName) {
      if (key === "innerHTML" || key === "textContent") {
        if (value != null) {
          el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
        }
        return;
      }
      const tag = el.tagName;
      if (key === "value" && tag !== "PROGRESS" && // custom elements may use _value internally
      !tag.includes("-")) {
        const oldValue = tag === "OPTION" ? el.getAttribute("value") || "" : el.value;
        const newValue = value == null ? (
          // #11647: value should be set as empty string for null and undefined,
          // but <input type="checkbox"> should be set as 'on'.
          el.type === "checkbox" ? "on" : ""
        ) : String(value);
        if (oldValue !== newValue || !("_value" in el)) {
          el.value = newValue;
        }
        if (value == null) {
          el.removeAttribute(key);
        }
        el._value = value;
        return;
      }
      let needRemove = false;
      if (value === "" || value == null) {
        const type = typeof el[key];
        if (type === "boolean") {
          value = includeBooleanAttr(value);
        } else if (value == null && type === "string") {
          value = "";
          needRemove = true;
        } else if (type === "number") {
          value = 0;
          needRemove = true;
        }
      }
      try {
        el[key] = value;
      } catch (e2) {
      }
      needRemove && el.removeAttribute(attrName || key);
    }
    function addEventListener$1(el, event, handler, options) {
      el.addEventListener(event, handler, options);
    }
    function removeEventListener$1(el, event, handler, options) {
      el.removeEventListener(event, handler, options);
    }
    const veiKey = Symbol("_vei");
    function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
      const invokers = el[veiKey] || (el[veiKey] = {});
      const existingInvoker = invokers[rawName];
      if (nextValue && existingInvoker) {
        existingInvoker.value = nextValue;
      } else {
        const [name, options] = parseName(rawName);
        if (nextValue) {
          const invoker = invokers[rawName] = createInvoker(
            nextValue,
            instance
          );
          addEventListener$1(el, name, invoker, options);
        } else if (existingInvoker) {
          removeEventListener$1(el, name, existingInvoker, options);
          invokers[rawName] = void 0;
        }
      }
    }
    const optionsModifierRE = /(?:Once|Passive|Capture)$/;
    function parseName(name) {
      let options;
      if (optionsModifierRE.test(name)) {
        options = {};
        let m2;
        while (m2 = name.match(optionsModifierRE)) {
          name = name.slice(0, name.length - m2[0].length);
          options[m2[0].toLowerCase()] = true;
        }
      }
      const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2));
      return [event, options];
    }
    let cachedNow = 0;
    const p$1 = /* @__PURE__ */ Promise.resolve();
    const getNow = () => cachedNow || (p$1.then(() => cachedNow = 0), cachedNow = Date.now());
    function createInvoker(initialValue, instance) {
      const invoker = (e2) => {
        if (!e2._vts) {
          e2._vts = Date.now();
        } else if (e2._vts <= invoker.attached) {
          return;
        }
        callWithAsyncErrorHandling(
          patchStopImmediatePropagation(e2, invoker.value),
          instance,
          5,
          [e2]
        );
      };
      invoker.value = initialValue;
      invoker.attached = getNow();
      return invoker;
    }
    function patchStopImmediatePropagation(e2, value) {
      if (isArray$5(value)) {
        const originalStop = e2.stopImmediatePropagation;
        e2.stopImmediatePropagation = () => {
          originalStop.call(e2);
          e2._stopped = true;
        };
        return value.map(
          (fn2) => (e22) => !e22._stopped && fn2 && fn2(e22)
        );
      } else {
        return value;
      }
    }
    const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
    key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
    const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => {
      const isSVG2 = namespace === "svg";
      if (key === "class") {
        patchClass(el, nextValue, isSVG2);
      } else if (key === "style") {
        patchStyle(el, prevValue, nextValue);
      } else if (isOn(key)) {
        if (!isModelListener(key)) {
          patchEvent(el, key, prevValue, nextValue, parentComponent);
        }
      } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG2)) {
        patchDOMProp(el, key, nextValue);
        if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) {
          patchAttr(el, key, nextValue, isSVG2, parentComponent, key !== "value");
        }
      } else if (
        // #11081 force set props for possible async custom element
        el._isVueCE && (/[A-Z]/.test(key) || !isString$3(nextValue))
      ) {
        patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
      } else {
        if (key === "true-value") {
          el._trueValue = nextValue;
        } else if (key === "false-value") {
          el._falseValue = nextValue;
        }
        patchAttr(el, key, nextValue, isSVG2);
      }
    };
    function shouldSetAsProp(el, key, value, isSVG2) {
      if (isSVG2) {
        if (key === "innerHTML" || key === "textContent") {
          return true;
        }
        if (key in el && isNativeOn(key) && isFunction$4(value)) {
          return true;
        }
        return false;
      }
      if (key === "spellcheck" || key === "draggable" || key === "translate") {
        return false;
      }
      if (key === "form") {
        return false;
      }
      if (key === "list" && el.tagName === "INPUT") {
        return false;
      }
      if (key === "type" && el.tagName === "TEXTAREA") {
        return false;
      }
      if (key === "width" || key === "height") {
        const tag = el.tagName;
        if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
          return false;
        }
      }
      if (isNativeOn(key) && isString$3(value)) {
        return false;
      }
      return key in el;
    }
    const positionMap = /* @__PURE__ */ new WeakMap();
    const newPositionMap = /* @__PURE__ */ new WeakMap();
    const moveCbKey = Symbol("_moveCb");
    const enterCbKey = Symbol("_enterCb");
    const decorate = (t) => {
      delete t.props.mode;
      return t;
    };
    const TransitionGroupImpl = /* @__PURE__ */ decorate({
      name: "TransitionGroup",
      props: /* @__PURE__ */ extend$2({}, TransitionPropsValidators, {
        tag: String,
        moveClass: String
      }),
      setup(props2, { slots }) {
        const instance = getCurrentInstance();
        const state = useTransitionState();
        let prevChildren;
        let children;
        onUpdated(() => {
          if (!prevChildren.length) {
            return;
          }
          const moveClass = props2.moveClass || `${props2.name || "v"}-move`;
          if (!hasCSSTransform(
            prevChildren[0].el,
            instance.vnode.el,
            moveClass
          )) {
            return;
          }
          prevChildren.forEach(callPendingCbs);
          prevChildren.forEach(recordPosition);
          const movedChildren = prevChildren.filter(applyTranslation);
          forceReflow();
          movedChildren.forEach((c2) => {
            const el = c2.el;
            const style = el.style;
            addTransitionClass(el, moveClass);
            style.transform = style.webkitTransform = style.transitionDuration = "";
            const cb = el[moveCbKey] = (e2) => {
              if (e2 && e2.target !== el) {
                return;
              }
              if (!e2 || /transform$/.test(e2.propertyName)) {
                el.removeEventListener("transitionend", cb);
                el[moveCbKey] = null;
                removeTransitionClass(el, moveClass);
              }
            };
            el.addEventListener("transitionend", cb);
          });
        });
        return () => {
          const rawProps = toRaw(props2);
          const cssTransitionProps = resolveTransitionProps(rawProps);
          let tag = rawProps.tag || Fragment;
          prevChildren = [];
          if (children) {
            for (let i2 = 0; i2 < children.length; i2++) {
              const child = children[i2];
              if (child.el && child.el instanceof Element) {
                prevChildren.push(child);
                setTransitionHooks(
                  child,
                  resolveTransitionHooks(
                    child,
                    cssTransitionProps,
                    state,
                    instance
                  )
                );
                positionMap.set(
                  child,
                  child.el.getBoundingClientRect()
                );
              }
            }
          }
          children = slots.default ? getTransitionRawChildren(slots.default()) : [];
          for (let i2 = 0; i2 < children.length; i2++) {
            const child = children[i2];
            if (child.key != null) {
              setTransitionHooks(
                child,
                resolveTransitionHooks(child, cssTransitionProps, state, instance)
              );
            }
          }
          return createVNode$1(tag, null, children);
        };
      }
    });
    const TransitionGroup = TransitionGroupImpl;
    function callPendingCbs(c2) {
      const el = c2.el;
      if (el[moveCbKey]) {
        el[moveCbKey]();
      }
      if (el[enterCbKey]) {
        el[enterCbKey]();
      }
    }
    function recordPosition(c2) {
      newPositionMap.set(c2, c2.el.getBoundingClientRect());
    }
    function applyTranslation(c2) {
      const oldPos = positionMap.get(c2);
      const newPos = newPositionMap.get(c2);
      const dx = oldPos.left - newPos.left;
      const dy = oldPos.top - newPos.top;
      if (dx || dy) {
        const s2 = c2.el.style;
        s2.transform = s2.webkitTransform = `translate(${dx}px,${dy}px)`;
        s2.transitionDuration = "0s";
        return c2;
      }
    }
    function hasCSSTransform(el, root2, moveClass) {
      const clone2 = el.cloneNode();
      const _vtc = el[vtcKey];
      if (_vtc) {
        _vtc.forEach((cls) => {
          cls.split(/\s+/).forEach((c2) => c2 && clone2.classList.remove(c2));
        });
      }
      moveClass.split(/\s+/).forEach((c2) => c2 && clone2.classList.add(c2));
      clone2.style.display = "none";
      const container = root2.nodeType === 1 ? root2 : root2.parentNode;
      container.appendChild(clone2);
      const { hasTransform } = getTransitionInfo(clone2);
      container.removeChild(clone2);
      return hasTransform;
    }
    const getModelAssigner = (vnode) => {
      const fn2 = vnode.props["onUpdate:modelValue"] || false;
      return isArray$5(fn2) ? (value) => invokeArrayFns(fn2, value) : fn2;
    };
    function onCompositionStart(e2) {
      e2.target.composing = true;
    }
    function onCompositionEnd(e2) {
      const target = e2.target;
      if (target.composing) {
        target.composing = false;
        target.dispatchEvent(new Event("input"));
      }
    }
    const assignKey = Symbol("_assign");
    const vModelText = {
      created(el, { modifiers: { lazy, trim: trim2, number } }, vnode) {
        el[assignKey] = getModelAssigner(vnode);
        const castToNumber = number || vnode.props && vnode.props.type === "number";
        addEventListener$1(el, lazy ? "change" : "input", (e2) => {
          if (e2.target.composing) return;
          let domValue = el.value;
          if (trim2) {
            domValue = domValue.trim();
          }
          if (castToNumber) {
            domValue = looseToNumber(domValue);
          }
          el[assignKey](domValue);
        });
        if (trim2) {
          addEventListener$1(el, "change", () => {
            el.value = el.value.trim();
          });
        }
        if (!lazy) {
          addEventListener$1(el, "compositionstart", onCompositionStart);
          addEventListener$1(el, "compositionend", onCompositionEnd);
          addEventListener$1(el, "change", onCompositionEnd);
        }
      },
      // set value on mounted so it's after min/max for type="range"
      mounted(el, { value }) {
        el.value = value == null ? "" : value;
      },
      beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim: trim2, number } }, vnode) {
        el[assignKey] = getModelAssigner(vnode);
        if (el.composing) return;
        const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
        const newValue = value == null ? "" : value;
        if (elValue === newValue) {
          return;
        }
        if (document.activeElement === el && el.type !== "range") {
          if (lazy && value === oldValue) {
            return;
          }
          if (trim2 && el.value.trim() === newValue) {
            return;
          }
        }
        el.value = newValue;
      }
    };
    const vModelCheckbox = {
      // #4096 array checkboxes need to be deep traversed
      deep: true,
      created(el, _2, vnode) {
        el[assignKey] = getModelAssigner(vnode);
        addEventListener$1(el, "change", () => {
          const modelValue = el._modelValue;
          const elementValue = getValue$2(el);
          const checked = el.checked;
          const assign2 = el[assignKey];
          if (isArray$5(modelValue)) {
            const index = looseIndexOf(modelValue, elementValue);
            const found = index !== -1;
            if (checked && !found) {
              assign2(modelValue.concat(elementValue));
            } else if (!checked && found) {
              const filtered = [...modelValue];
              filtered.splice(index, 1);
              assign2(filtered);
            }
          } else if (isSet$1(modelValue)) {
            const cloned = new Set(modelValue);
            if (checked) {
              cloned.add(elementValue);
            } else {
              cloned.delete(elementValue);
            }
            assign2(cloned);
          } else {
            assign2(getCheckboxValue(el, checked));
          }
        });
      },
      // set initial checked on mount to wait for true-value/false-value
      mounted: setChecked,
      beforeUpdate(el, binding, vnode) {
        el[assignKey] = getModelAssigner(vnode);
        setChecked(el, binding, vnode);
      }
    };
    function setChecked(el, { value, oldValue }, vnode) {
      el._modelValue = value;
      let checked;
      if (isArray$5(value)) {
        checked = looseIndexOf(value, vnode.props.value) > -1;
      } else if (isSet$1(value)) {
        checked = value.has(vnode.props.value);
      } else {
        if (value === oldValue) return;
        checked = looseEqual(value, getCheckboxValue(el, true));
      }
      if (el.checked !== checked) {
        el.checked = checked;
      }
    }
    const vModelRadio = {
      created(el, { value }, vnode) {
        el.checked = looseEqual(value, vnode.props.value);
        el[assignKey] = getModelAssigner(vnode);
        addEventListener$1(el, "change", () => {
          el[assignKey](getValue$2(el));
        });
      },
      beforeUpdate(el, { value, oldValue }, vnode) {
        el[assignKey] = getModelAssigner(vnode);
        if (value !== oldValue) {
          el.checked = looseEqual(value, vnode.props.value);
        }
      }
    };
    function getValue$2(el) {
      return "_value" in el ? el._value : el.value;
    }
    function getCheckboxValue(el, checked) {
      const key = checked ? "_trueValue" : "_falseValue";
      return key in el ? el[key] : checked;
    }
    const systemModifiers = ["ctrl", "shift", "alt", "meta"];
    const modifierGuards = {
      stop: (e2) => e2.stopPropagation(),
      prevent: (e2) => e2.preventDefault(),
      self: (e2) => e2.target !== e2.currentTarget,
      ctrl: (e2) => !e2.ctrlKey,
      shift: (e2) => !e2.shiftKey,
      alt: (e2) => !e2.altKey,
      meta: (e2) => !e2.metaKey,
      left: (e2) => "button" in e2 && e2.button !== 0,
      middle: (e2) => "button" in e2 && e2.button !== 1,
      right: (e2) => "button" in e2 && e2.button !== 2,
      exact: (e2, modifiers) => systemModifiers.some((m2) => e2[`${m2}Key`] && !modifiers.includes(m2))
    };
    const withModifiers = (fn2, modifiers) => {
      const cache2 = fn2._withMods || (fn2._withMods = {});
      const cacheKey = modifiers.join(".");
      return cache2[cacheKey] || (cache2[cacheKey] = (event, ...args) => {
        for (let i2 = 0; i2 < modifiers.length; i2++) {
          const guard = modifierGuards[modifiers[i2]];
          if (guard && guard(event, modifiers)) return;
        }
        return fn2(event, ...args);
      });
    };
    const keyNames = {
      esc: "escape",
      space: " ",
      up: "arrow-up",
      left: "arrow-left",
      right: "arrow-right",
      down: "arrow-down",
      delete: "backspace"
    };
    const withKeys = (fn2, modifiers) => {
      const cache2 = fn2._withKeys || (fn2._withKeys = {});
      const cacheKey = modifiers.join(".");
      return cache2[cacheKey] || (cache2[cacheKey] = (event) => {
        if (!("key" in event)) {
          return;
        }
        const eventKey = hyphenate(event.key);
        if (modifiers.some(
          (k2) => k2 === eventKey || keyNames[k2] === eventKey
        )) {
          return fn2(event);
        }
      });
    };
    const rendererOptions = /* @__PURE__ */ extend$2({ patchProp }, nodeOps);
    let renderer;
    function ensureRenderer() {
      return renderer || (renderer = createRenderer(rendererOptions));
    }
    const render$1 = (...args) => {
      ensureRenderer().render(...args);
    };
    const createApp = (...args) => {
      const app2 = ensureRenderer().createApp(...args);
      const { mount } = app2;
      app2.mount = (containerOrSelector) => {
        const container = normalizeContainer(containerOrSelector);
        if (!container) return;
        const component2 = app2._component;
        if (!isFunction$4(component2) && !component2.render && !component2.template) {
          component2.template = container.innerHTML;
        }
        if (container.nodeType === 1) {
          container.textContent = "";
        }
        const proxy = mount(container, false, resolveRootNamespace(container));
        if (container instanceof Element) {
          container.removeAttribute("v-cloak");
          container.setAttribute("data-v-app", "");
        }
        return proxy;
      };
      return app2;
    };
    function resolveRootNamespace(container) {
      if (container instanceof SVGElement) {
        return "svg";
      }
      if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
        return "mathml";
      }
    }
    function normalizeContainer(container) {
      if (isString$3(container)) {
        const res = document.querySelector(container);
        return res;
      }
      return container;
    }
    const _export_sfc$1 = (sfc, props2) => {
      const target = sfc.__vccOpts || sfc;
      for (const [key, val] of props2) {
        target[key] = val;
      }
      return target;
    };
    const _sfc_main$2G = {
      name: "App"
    };
    const _hoisted_1$8 = { class: "app-container" };
    function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_router_view = resolveComponent("router-view");
      return openBlock(), createElementBlock("div", _hoisted_1$8, [
        createVNode$1(_component_router_view)
      ]);
    }
    const App = /* @__PURE__ */ _export_sfc$1(_sfc_main$2G, [["render", _sfc_render$y]]);
    function getDevtoolsGlobalHook() {
      return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
    }
    function getTarget() {
      return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : {};
    }
    const isProxyAvailable = typeof Proxy === "function";
    const HOOK_SETUP = "devtools-plugin:setup";
    const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set";
    let supported;
    let perf;
    function isPerformanceSupported() {
      var _a2;
      if (supported !== void 0) {
        return supported;
      }
      if (typeof window !== "undefined" && window.performance) {
        supported = true;
        perf = window.performance;
      } else if (typeof globalThis !== "undefined" && ((_a2 = globalThis.perf_hooks) === null || _a2 === void 0 ? void 0 : _a2.performance)) {
        supported = true;
        perf = globalThis.perf_hooks.performance;
      } else {
        supported = false;
      }
      return supported;
    }
    function now$1() {
      return isPerformanceSupported() ? perf.now() : Date.now();
    }
    class ApiProxy {
      constructor(plugin, hook) {
        this.target = null;
        this.targetQueue = [];
        this.onQueue = [];
        this.plugin = plugin;
        this.hook = hook;
        const defaultSettings = {};
        if (plugin.settings) {
          for (const id in plugin.settings) {
            const item = plugin.settings[id];
            defaultSettings[id] = item.defaultValue;
          }
        }
        const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
        let currentSettings = Object.assign({}, defaultSettings);
        try {
          const raw = localStorage.getItem(localSettingsSaveId);
          const data = JSON.parse(raw);
          Object.assign(currentSettings, data);
        } catch (e2) {
        }
        this.fallbacks = {
          getSettings() {
            return currentSettings;
          },
          setSettings(value) {
            try {
              localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
            } catch (e2) {
            }
            currentSettings = value;
          },
          now() {
            return now$1();
          }
        };
        if (hook) {
          hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
            if (pluginId === this.plugin.id) {
              this.fallbacks.setSettings(value);
            }
          });
        }
        this.proxiedOn = new Proxy({}, {
          get: (_target, prop) => {
            if (this.target) {
              return this.target.on[prop];
            } else {
              return (...args) => {
                this.onQueue.push({
                  method: prop,
                  args
                });
              };
            }
          }
        });
        this.proxiedTarget = new Proxy({}, {
          get: (_target, prop) => {
            if (this.target) {
              return this.target[prop];
            } else if (prop === "on") {
              return this.proxiedOn;
            } else if (Object.keys(this.fallbacks).includes(prop)) {
              return (...args) => {
                this.targetQueue.push({
                  method: prop,
                  args,
                  resolve: () => {
                  }
                });
                return this.fallbacks[prop](...args);
              };
            } else {
              return (...args) => {
                return new Promise((resolve2) => {
                  this.targetQueue.push({
                    method: prop,
                    args,
                    resolve: resolve2
                  });
                });
              };
            }
          }
        });
      }
      async setRealTarget(target) {
        this.target = target;
        for (const item of this.onQueue) {
          this.target.on[item.method](...item.args);
        }
        for (const item of this.targetQueue) {
          item.resolve(await this.target[item.method](...item.args));
        }
      }
    }
    function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
      const descriptor = pluginDescriptor;
      const target = getTarget();
      const hook = getDevtoolsGlobalHook();
      const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy;
      if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
        hook.emit(HOOK_SETUP, pluginDescriptor, setupFn);
      } else {
        const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null;
        const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
        list.push({
          pluginDescriptor: descriptor,
          setupFn,
          proxy
        });
        if (proxy) {
          setupFn(proxy.proxiedTarget);
        }
      }
    }
    /*!
      * vue-router v4.5.1
      * (c) 2025 Eduardo San Martin Morote
      * @license MIT
      */
    const isBrowser = typeof document !== "undefined";
    function isRouteComponent(component2) {
      return typeof component2 === "object" || "displayName" in component2 || "props" in component2 || "__vccOpts" in component2;
    }
    function isESModule(obj) {
      return obj.__esModule || obj[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
      // add the Module string tag
      obj.default && isRouteComponent(obj.default);
    }
    const assign = Object.assign;
    function applyToParams(fn2, params) {
      const newParams = {};
      for (const key in params) {
        const value = params[key];
        newParams[key] = isArray$4(value) ? value.map(fn2) : fn2(value);
      }
      return newParams;
    }
    const noop$4 = () => {
    };
    const isArray$4 = Array.isArray;
    const HASH_RE = /#/g;
    const AMPERSAND_RE = /&/g;
    const SLASH_RE = /\//g;
    const EQUAL_RE = /=/g;
    const IM_RE = /\?/g;
    const PLUS_RE = /\+/g;
    const ENC_BRACKET_OPEN_RE = /%5B/g;
    const ENC_BRACKET_CLOSE_RE = /%5D/g;
    const ENC_CARET_RE = /%5E/g;
    const ENC_BACKTICK_RE = /%60/g;
    const ENC_CURLY_OPEN_RE = /%7B/g;
    const ENC_PIPE_RE = /%7C/g;
    const ENC_CURLY_CLOSE_RE = /%7D/g;
    const ENC_SPACE_RE = /%20/g;
    function commonEncode(text) {
      return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
    }
    function encodeHash(text) {
      return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
    }
    function encodeQueryValue(text) {
      return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
    }
    function encodeQueryKey(text) {
      return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
    }
    function encodePath(text) {
      return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
    }
    function encodeParam(text) {
      return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
    }
    function decode$3(text) {
      try {
        return decodeURIComponent("" + text);
      } catch (err) {
      }
      return "" + text;
    }
    const TRAILING_SLASH_RE = /\/$/;
    const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
    function parseURL(parseQuery2, location2, currentLocation = "/") {
      let path, query = {}, searchString = "", hash = "";
      const hashPos = location2.indexOf("#");
      let searchPos = location2.indexOf("?");
      if (hashPos < searchPos && hashPos >= 0) {
        searchPos = -1;
      }
      if (searchPos > -1) {
        path = location2.slice(0, searchPos);
        searchString = location2.slice(searchPos + 1, hashPos > -1 ? hashPos : location2.length);
        query = parseQuery2(searchString);
      }
      if (hashPos > -1) {
        path = path || location2.slice(0, hashPos);
        hash = location2.slice(hashPos, location2.length);
      }
      path = resolveRelativePath(path != null ? path : location2, currentLocation);
      return {
        fullPath: path + (searchString && "?") + searchString + hash,
        path,
        query,
        hash: decode$3(hash)
      };
    }
    function stringifyURL(stringifyQuery2, location2) {
      const query = location2.query ? stringifyQuery2(location2.query) : "";
      return location2.path + (query && "?") + query + (location2.hash || "");
    }
    function stripBase(pathname, base2) {
      if (!base2 || !pathname.toLowerCase().startsWith(base2.toLowerCase()))
        return pathname;
      return pathname.slice(base2.length) || "/";
    }
    function isSameRouteLocation(stringifyQuery2, a2, b2) {
      const aLastIndex = a2.matched.length - 1;
      const bLastIndex = b2.matched.length - 1;
      return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a2.matched[aLastIndex], b2.matched[bLastIndex]) && isSameRouteLocationParams(a2.params, b2.params) && stringifyQuery2(a2.query) === stringifyQuery2(b2.query) && a2.hash === b2.hash;
    }
    function isSameRouteRecord(a2, b2) {
      return (a2.aliasOf || a2) === (b2.aliasOf || b2);
    }
    function isSameRouteLocationParams(a2, b2) {
      if (Object.keys(a2).length !== Object.keys(b2).length)
        return false;
      for (const key in a2) {
        if (!isSameRouteLocationParamsValue(a2[key], b2[key]))
          return false;
      }
      return true;
    }
    function isSameRouteLocationParamsValue(a2, b2) {
      return isArray$4(a2) ? isEquivalentArray(a2, b2) : isArray$4(b2) ? isEquivalentArray(b2, a2) : a2 === b2;
    }
    function isEquivalentArray(a2, b2) {
      return isArray$4(b2) ? a2.length === b2.length && a2.every((value, i2) => value === b2[i2]) : a2.length === 1 && a2[0] === b2;
    }
    function resolveRelativePath(to, from) {
      if (to.startsWith("/"))
        return to;
      if (!to)
        return from;
      const fromSegments = from.split("/");
      const toSegments = to.split("/");
      const lastToSegment = toSegments[toSegments.length - 1];
      if (lastToSegment === ".." || lastToSegment === ".") {
        toSegments.push("");
      }
      let position2 = fromSegments.length - 1;
      let toPosition;
      let segment;
      for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
        segment = toSegments[toPosition];
        if (segment === ".")
          continue;
        if (segment === "..") {
          if (position2 > 1)
            position2--;
        } else
          break;
      }
      return fromSegments.slice(0, position2).join("/") + "/" + toSegments.slice(toPosition).join("/");
    }
    const START_LOCATION_NORMALIZED = {
      path: "/",
      // TODO: could we use a symbol in the future?
      name: void 0,
      params: {},
      query: {},
      hash: "",
      fullPath: "/",
      matched: [],
      meta: {},
      redirectedFrom: void 0
    };
    var NavigationType;
    (function(NavigationType2) {
      NavigationType2["pop"] = "pop";
      NavigationType2["push"] = "push";
    })(NavigationType || (NavigationType = {}));
    var NavigationDirection;
    (function(NavigationDirection2) {
      NavigationDirection2["back"] = "back";
      NavigationDirection2["forward"] = "forward";
      NavigationDirection2["unknown"] = "";
    })(NavigationDirection || (NavigationDirection = {}));
    function normalizeBase(base2) {
      if (!base2) {
        if (isBrowser) {
          const baseEl = document.querySelector("base");
          base2 = baseEl && baseEl.getAttribute("href") || "/";
          base2 = base2.replace(/^\w+:\/\/[^\/]+/, "");
        } else {
          base2 = "/";
        }
      }
      if (base2[0] !== "/" && base2[0] !== "#")
        base2 = "/" + base2;
      return removeTrailingSlash(base2);
    }
    const BEFORE_HASH_RE = /^[^#]+#/;
    function createHref(base2, location2) {
      return base2.replace(BEFORE_HASH_RE, "#") + location2;
    }
    function getElementPosition(el, offset2) {
      const docRect = document.documentElement.getBoundingClientRect();
      const elRect = el.getBoundingClientRect();
      return {
        behavior: offset2.behavior,
        left: elRect.left - docRect.left - (offset2.left || 0),
        top: elRect.top - docRect.top - (offset2.top || 0)
      };
    }
    const computeScrollPosition = () => ({
      left: window.scrollX,
      top: window.scrollY
    });
    function scrollToPosition(position2) {
      let scrollToOptions;
      if ("el" in position2) {
        const positionEl = position2.el;
        const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
        const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
        if (!el) {
          return;
        }
        scrollToOptions = getElementPosition(el, position2);
      } else {
        scrollToOptions = position2;
      }
      if ("scrollBehavior" in document.documentElement.style)
        window.scrollTo(scrollToOptions);
      else {
        window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
      }
    }
    function getScrollKey(path, delta) {
      const position2 = history.state ? history.state.position - delta : -1;
      return position2 + path;
    }
    const scrollPositions = /* @__PURE__ */ new Map();
    function saveScrollPosition(key, scrollPosition) {
      scrollPositions.set(key, scrollPosition);
    }
    function getSavedScrollPosition(key) {
      const scroll = scrollPositions.get(key);
      scrollPositions.delete(key);
      return scroll;
    }
    let createBaseLocation = () => location.protocol + "//" + location.host;
    function createCurrentLocation(base2, location2) {
      const { pathname, search, hash } = location2;
      const hashPos = base2.indexOf("#");
      if (hashPos > -1) {
        let slicePos = hash.includes(base2.slice(hashPos)) ? base2.slice(hashPos).length : 1;
        let pathFromHash = hash.slice(slicePos);
        if (pathFromHash[0] !== "/")
          pathFromHash = "/" + pathFromHash;
        return stripBase(pathFromHash, "");
      }
      const path = stripBase(pathname, base2);
      return path + search + hash;
    }
    function useHistoryListeners(base2, historyState, currentLocation, replace) {
      let listeners = [];
      let teardowns = [];
      let pauseState = null;
      const popStateHandler = ({ state }) => {
        const to = createCurrentLocation(base2, location);
        const from = currentLocation.value;
        const fromState = historyState.value;
        let delta = 0;
        if (state) {
          currentLocation.value = to;
          historyState.value = state;
          if (pauseState && pauseState === from) {
            pauseState = null;
            return;
          }
          delta = fromState ? state.position - fromState.position : 0;
        } else {
          replace(to);
        }
        listeners.forEach((listener) => {
          listener(currentLocation.value, from, {
            delta,
            type: NavigationType.pop,
            direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
          });
        });
      };
      function pauseListeners() {
        pauseState = currentLocation.value;
      }
      function listen(callback) {
        listeners.push(callback);
        const teardown = () => {
          const index = listeners.indexOf(callback);
          if (index > -1)
            listeners.splice(index, 1);
        };
        teardowns.push(teardown);
        return teardown;
      }
      function beforeUnloadListener() {
        const { history: history2 } = window;
        if (!history2.state)
          return;
        history2.replaceState(assign({}, history2.state, { scroll: computeScrollPosition() }), "");
      }
      function destroy() {
        for (const teardown of teardowns)
          teardown();
        teardowns = [];
        window.removeEventListener("popstate", popStateHandler);
        window.removeEventListener("beforeunload", beforeUnloadListener);
      }
      window.addEventListener("popstate", popStateHandler);
      window.addEventListener("beforeunload", beforeUnloadListener, {
        passive: true
      });
      return {
        pauseListeners,
        listen,
        destroy
      };
    }
    function buildState(back, current, forward, replaced = false, computeScroll = false) {
      return {
        back,
        current,
        forward,
        replaced,
        position: window.history.length,
        scroll: computeScroll ? computeScrollPosition() : null
      };
    }
    function useHistoryStateNavigation(base2) {
      const { history: history2, location: location2 } = window;
      const currentLocation = {
        value: createCurrentLocation(base2, location2)
      };
      const historyState = { value: history2.state };
      if (!historyState.value) {
        changeLocation(currentLocation.value, {
          back: null,
          current: currentLocation.value,
          forward: null,
          // the length is off by one, we need to decrease it
          position: history2.length - 1,
          replaced: true,
          // don't add a scroll as the user may have an anchor, and we want
          // scrollBehavior to be triggered without a saved position
          scroll: null
        }, true);
      }
      function changeLocation(to, state, replace2) {
        const hashIndex = base2.indexOf("#");
        const url = hashIndex > -1 ? (location2.host && document.querySelector("base") ? base2 : base2.slice(hashIndex)) + to : createBaseLocation() + base2 + to;
        try {
          history2[replace2 ? "replaceState" : "pushState"](state, "", url);
          historyState.value = state;
        } catch (err) {
          {
            console.error(err);
          }
          location2[replace2 ? "replace" : "assign"](url);
        }
      }
      function replace(to, data) {
        const state = assign({}, history2.state, buildState(
          historyState.value.back,
          // keep back and forward entries but override current position
          to,
          historyState.value.forward,
          true
        ), data, { position: historyState.value.position });
        changeLocation(to, state, true);
        currentLocation.value = to;
      }
      function push2(to, data) {
        const currentState = assign(
          {},
          // use current history state to gracefully handle a wrong call to
          // history.replaceState
          // https://github.com/vuejs/router/issues/366
          historyState.value,
          history2.state,
          {
            forward: to,
            scroll: computeScrollPosition()
          }
        );
        changeLocation(currentState.current, currentState, true);
        const state = assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);
        changeLocation(to, state, false);
        currentLocation.value = to;
      }
      return {
        location: currentLocation,
        state: historyState,
        push: push2,
        replace
      };
    }
    function createWebHistory(base2) {
      base2 = normalizeBase(base2);
      const historyNavigation = useHistoryStateNavigation(base2);
      const historyListeners = useHistoryListeners(base2, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
      function go(delta, triggerListeners = true) {
        if (!triggerListeners)
          historyListeners.pauseListeners();
        history.go(delta);
      }
      const routerHistory = assign({
        // it's overridden right after
        location: "",
        base: base2,
        go,
        createHref: createHref.bind(null, base2)
      }, historyNavigation, historyListeners);
      Object.defineProperty(routerHistory, "location", {
        enumerable: true,
        get: () => historyNavigation.location.value
      });
      Object.defineProperty(routerHistory, "state", {
        enumerable: true,
        get: () => historyNavigation.state.value
      });
      return routerHistory;
    }
    function isRouteLocation(route) {
      return typeof route === "string" || route && typeof route === "object";
    }
    function isRouteName(name) {
      return typeof name === "string" || typeof name === "symbol";
    }
    const NavigationFailureSymbol = Symbol("");
    var NavigationFailureType;
    (function(NavigationFailureType2) {
      NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
      NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
      NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
    })(NavigationFailureType || (NavigationFailureType = {}));
    function createRouterError(type, params) {
      {
        return assign(new Error(), {
          type,
          [NavigationFailureSymbol]: true
        }, params);
      }
    }
    function isNavigationFailure(error, type) {
      return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
    }
    const BASE_PARAM_PATTERN = "[^/]+?";
    const BASE_PATH_PARSER_OPTIONS = {
      sensitive: false,
      strict: false,
      start: true,
      end: true
    };
    const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
    function tokensToParser(segments, extraOptions) {
      const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
      const score = [];
      let pattern = options.start ? "^" : "";
      const keys2 = [];
      for (const segment of segments) {
        const segmentScores = segment.length ? [] : [
          90
          /* PathScore.Root */
        ];
        if (options.strict && !segment.length)
          pattern += "/";
        for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
          const token = segment[tokenIndex];
          let subSegmentScore = 40 + (options.sensitive ? 0.25 : 0);
          if (token.type === 0) {
            if (!tokenIndex)
              pattern += "/";
            pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
            subSegmentScore += 40;
          } else if (token.type === 1) {
            const { value, repeatable, optional, regexp: regexp3 } = token;
            keys2.push({
              name: value,
              repeatable,
              optional
            });
            const re2 = regexp3 ? regexp3 : BASE_PARAM_PATTERN;
            if (re2 !== BASE_PARAM_PATTERN) {
              subSegmentScore += 10;
              try {
                new RegExp(`(${re2})`);
              } catch (err) {
                throw new Error(`Invalid custom RegExp for param "${value}" (${re2}): ` + err.message);
              }
            }
            let subPattern = repeatable ? `((?:${re2})(?:/(?:${re2}))*)` : `(${re2})`;
            if (!tokenIndex)
              subPattern = // avoid an optional / if there are more segments e.g. /:p?-static
              // or /:p?-:p2
              optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
            if (optional)
              subPattern += "?";
            pattern += subPattern;
            subSegmentScore += 20;
            if (optional)
              subSegmentScore += -8;
            if (repeatable)
              subSegmentScore += -20;
            if (re2 === ".*")
              subSegmentScore += -50;
          }
          segmentScores.push(subSegmentScore);
        }
        score.push(segmentScores);
      }
      if (options.strict && options.end) {
        const i2 = score.length - 1;
        score[i2][score[i2].length - 1] += 0.7000000000000001;
      }
      if (!options.strict)
        pattern += "/?";
      if (options.end)
        pattern += "$";
      else if (options.strict && !pattern.endsWith("/"))
        pattern += "(?:/|$)";
      const re = new RegExp(pattern, options.sensitive ? "" : "i");
      function parse2(path) {
        const match = path.match(re);
        const params = {};
        if (!match)
          return null;
        for (let i2 = 1; i2 < match.length; i2++) {
          const value = match[i2] || "";
          const key = keys2[i2 - 1];
          params[key.name] = value && key.repeatable ? value.split("/") : value;
        }
        return params;
      }
      function stringify2(params) {
        let path = "";
        let avoidDuplicatedSlash = false;
        for (const segment of segments) {
          if (!avoidDuplicatedSlash || !path.endsWith("/"))
            path += "/";
          avoidDuplicatedSlash = false;
          for (const token of segment) {
            if (token.type === 0) {
              path += token.value;
            } else if (token.type === 1) {
              const { value, repeatable, optional } = token;
              const param = value in params ? params[value] : "";
              if (isArray$4(param) && !repeatable) {
                throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
              }
              const text = isArray$4(param) ? param.join("/") : param;
              if (!text) {
                if (optional) {
                  if (segment.length < 2) {
                    if (path.endsWith("/"))
                      path = path.slice(0, -1);
                    else
                      avoidDuplicatedSlash = true;
                  }
                } else
                  throw new Error(`Missing required param "${value}"`);
              }
              path += text;
            }
          }
        }
        return path || "/";
      }
      return {
        re,
        score,
        keys: keys2,
        parse: parse2,
        stringify: stringify2
      };
    }
    function compareScoreArray(a2, b2) {
      let i2 = 0;
      while (i2 < a2.length && i2 < b2.length) {
        const diff = b2[i2] - a2[i2];
        if (diff)
          return diff;
        i2++;
      }
      if (a2.length < b2.length) {
        return a2.length === 1 && a2[0] === 40 + 40 ? -1 : 1;
      } else if (a2.length > b2.length) {
        return b2.length === 1 && b2[0] === 40 + 40 ? 1 : -1;
      }
      return 0;
    }
    function comparePathParserScore(a2, b2) {
      let i2 = 0;
      const aScore = a2.score;
      const bScore = b2.score;
      while (i2 < aScore.length && i2 < bScore.length) {
        const comp = compareScoreArray(aScore[i2], bScore[i2]);
        if (comp)
          return comp;
        i2++;
      }
      if (Math.abs(bScore.length - aScore.length) === 1) {
        if (isLastScoreNegative(aScore))
          return 1;
        if (isLastScoreNegative(bScore))
          return -1;
      }
      return bScore.length - aScore.length;
    }
    function isLastScoreNegative(score) {
      const last2 = score[score.length - 1];
      return score.length > 0 && last2[last2.length - 1] < 0;
    }
    const ROOT_TOKEN = {
      type: 0,
      value: ""
    };
    const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
    function tokenizePath(path) {
      if (!path)
        return [[]];
      if (path === "/")
        return [[ROOT_TOKEN]];
      if (!path.startsWith("/")) {
        throw new Error(`Invalid path "${path}"`);
      }
      function crash(message2) {
        throw new Error(`ERR (${state})/"${buffer}": ${message2}`);
      }
      let state = 0;
      let previousState = state;
      const tokens = [];
      let segment;
      function finalizeSegment() {
        if (segment)
          tokens.push(segment);
        segment = [];
      }
      let i2 = 0;
      let char;
      let buffer = "";
      let customRe = "";
      function consumeBuffer() {
        if (!buffer)
          return;
        if (state === 0) {
          segment.push({
            type: 0,
            value: buffer
          });
        } else if (state === 1 || state === 2 || state === 3) {
          if (segment.length > 1 && (char === "*" || char === "+"))
            crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
          segment.push({
            type: 1,
            value: buffer,
            regexp: customRe,
            repeatable: char === "*" || char === "+",
            optional: char === "*" || char === "?"
          });
        } else {
          crash("Invalid state to consume buffer");
        }
        buffer = "";
      }
      function addCharToBuffer() {
        buffer += char;
      }
      while (i2 < path.length) {
        char = path[i2++];
        if (char === "\\" && state !== 2) {
          previousState = state;
          state = 4;
          continue;
        }
        switch (state) {
          case 0:
            if (char === "/") {
              if (buffer) {
                consumeBuffer();
              }
              finalizeSegment();
            } else if (char === ":") {
              consumeBuffer();
              state = 1;
            } else {
              addCharToBuffer();
            }
            break;
          case 4:
            addCharToBuffer();
            state = previousState;
            break;
          case 1:
            if (char === "(") {
              state = 2;
            } else if (VALID_PARAM_RE.test(char)) {
              addCharToBuffer();
            } else {
              consumeBuffer();
              state = 0;
              if (char !== "*" && char !== "?" && char !== "+")
                i2--;
            }
            break;
          case 2:
            if (char === ")") {
              if (customRe[customRe.length - 1] == "\\")
                customRe = customRe.slice(0, -1) + char;
              else
                state = 3;
            } else {
              customRe += char;
            }
            break;
          case 3:
            consumeBuffer();
            state = 0;
            if (char !== "*" && char !== "?" && char !== "+")
              i2--;
            customRe = "";
            break;
          default:
            crash("Unknown state");
            break;
        }
      }
      if (state === 2)
        crash(`Unfinished custom RegExp for param "${buffer}"`);
      consumeBuffer();
      finalizeSegment();
      return tokens;
    }
    function createRouteRecordMatcher(record, parent2, options) {
      const parser = tokensToParser(tokenizePath(record.path), options);
      const matcher = assign(parser, {
        record,
        parent: parent2,
        // these needs to be populated by the parent
        children: [],
        alias: []
      });
      if (parent2) {
        if (!matcher.record.aliasOf === !parent2.record.aliasOf)
          parent2.children.push(matcher);
      }
      return matcher;
    }
    function createRouterMatcher(routes2, globalOptions) {
      const matchers2 = [];
      const matcherMap = /* @__PURE__ */ new Map();
      globalOptions = mergeOptions$1({ strict: false, end: true, sensitive: false }, globalOptions);
      function getRecordMatcher(name) {
        return matcherMap.get(name);
      }
      function addRoute(record, parent2, originalRecord) {
        const isRootAdd = !originalRecord;
        const mainNormalizedRecord = normalizeRouteRecord(record);
        mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
        const options = mergeOptions$1(globalOptions, record);
        const normalizedRecords = [mainNormalizedRecord];
        if ("alias" in record) {
          const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
          for (const alias of aliases) {
            normalizedRecords.push(
              // we need to normalize again to ensure the `mods` property
              // being non enumerable
              normalizeRouteRecord(assign({}, mainNormalizedRecord, {
                // this allows us to hold a copy of the `components` option
                // so that async components cache is hold on the original record
                components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
                path: alias,
                // we might be the child of an alias
                aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
                // the aliases are always of the same kind as the original since they
                // are defined on the same record
              }))
            );
          }
        }
        let matcher;
        let originalMatcher;
        for (const normalizedRecord of normalizedRecords) {
          const { path } = normalizedRecord;
          if (parent2 && path[0] !== "/") {
            const parentPath = parent2.record.path;
            const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
            normalizedRecord.path = parent2.record.path + (path && connectingSlash + path);
          }
          matcher = createRouteRecordMatcher(normalizedRecord, parent2, options);
          if (originalRecord) {
            originalRecord.alias.push(matcher);
          } else {
            originalMatcher = originalMatcher || matcher;
            if (originalMatcher !== matcher)
              originalMatcher.alias.push(matcher);
            if (isRootAdd && record.name && !isAliasRecord(matcher)) {
              removeRoute(record.name);
            }
          }
          if (isMatchable(matcher)) {
            insertMatcher(matcher);
          }
          if (mainNormalizedRecord.children) {
            const children = mainNormalizedRecord.children;
            for (let i2 = 0; i2 < children.length; i2++) {
              addRoute(children[i2], matcher, originalRecord && originalRecord.children[i2]);
            }
          }
          originalRecord = originalRecord || matcher;
        }
        return originalMatcher ? () => {
          removeRoute(originalMatcher);
        } : noop$4;
      }
      function removeRoute(matcherRef) {
        if (isRouteName(matcherRef)) {
          const matcher = matcherMap.get(matcherRef);
          if (matcher) {
            matcherMap.delete(matcherRef);
            matchers2.splice(matchers2.indexOf(matcher), 1);
            matcher.children.forEach(removeRoute);
            matcher.alias.forEach(removeRoute);
          }
        } else {
          const index = matchers2.indexOf(matcherRef);
          if (index > -1) {
            matchers2.splice(index, 1);
            if (matcherRef.record.name)
              matcherMap.delete(matcherRef.record.name);
            matcherRef.children.forEach(removeRoute);
            matcherRef.alias.forEach(removeRoute);
          }
        }
      }
      function getRoutes() {
        return matchers2;
      }
      function insertMatcher(matcher) {
        const index = findInsertionIndex(matcher, matchers2);
        matchers2.splice(index, 0, matcher);
        if (matcher.record.name && !isAliasRecord(matcher))
          matcherMap.set(matcher.record.name, matcher);
      }
      function resolve2(location2, currentLocation) {
        let matcher;
        let params = {};
        let path;
        let name;
        if ("name" in location2 && location2.name) {
          matcher = matcherMap.get(location2.name);
          if (!matcher)
            throw createRouterError(1, {
              location: location2
            });
          name = matcher.record.name;
          params = assign(
            // paramsFromLocation is a new object
            paramsFromLocation(
              currentLocation.params,
              // only keep params that exist in the resolved location
              // only keep optional params coming from a parent record
              matcher.keys.filter((k2) => !k2.optional).concat(matcher.parent ? matcher.parent.keys.filter((k2) => k2.optional) : []).map((k2) => k2.name)
            ),
            // discard any existing params in the current location that do not exist here
            // #1497 this ensures better active/exact matching
            location2.params && paramsFromLocation(location2.params, matcher.keys.map((k2) => k2.name))
          );
          path = matcher.stringify(params);
        } else if (location2.path != null) {
          path = location2.path;
          matcher = matchers2.find((m2) => m2.re.test(path));
          if (matcher) {
            params = matcher.parse(path);
            name = matcher.record.name;
          }
        } else {
          matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers2.find((m2) => m2.re.test(currentLocation.path));
          if (!matcher)
            throw createRouterError(1, {
              location: location2,
              currentLocation
            });
          name = matcher.record.name;
          params = assign({}, currentLocation.params, location2.params);
          path = matcher.stringify(params);
        }
        const matched = [];
        let parentMatcher = matcher;
        while (parentMatcher) {
          matched.unshift(parentMatcher.record);
          parentMatcher = parentMatcher.parent;
        }
        return {
          name,
          path,
          params,
          matched,
          meta: mergeMetaFields(matched)
        };
      }
      routes2.forEach((route) => addRoute(route));
      function clearRoutes() {
        matchers2.length = 0;
        matcherMap.clear();
      }
      return {
        addRoute,
        resolve: resolve2,
        removeRoute,
        clearRoutes,
        getRoutes,
        getRecordMatcher
      };
    }
    function paramsFromLocation(params, keys2) {
      const newParams = {};
      for (const key of keys2) {
        if (key in params)
          newParams[key] = params[key];
      }
      return newParams;
    }
    function normalizeRouteRecord(record) {
      const normalized = {
        path: record.path,
        redirect: record.redirect,
        name: record.name,
        meta: record.meta || {},
        aliasOf: record.aliasOf,
        beforeEnter: record.beforeEnter,
        props: normalizeRecordProps(record),
        children: record.children || [],
        instances: {},
        leaveGuards: /* @__PURE__ */ new Set(),
        updateGuards: /* @__PURE__ */ new Set(),
        enterCallbacks: {},
        // must be declared afterwards
        // mods: {},
        components: "components" in record ? record.components || null : record.component && { default: record.component }
      };
      Object.defineProperty(normalized, "mods", {
        value: {}
      });
      return normalized;
    }
    function normalizeRecordProps(record) {
      const propsObject = {};
      const props2 = record.props || false;
      if ("component" in record) {
        propsObject.default = props2;
      } else {
        for (const name in record.components)
          propsObject[name] = typeof props2 === "object" ? props2[name] : props2;
      }
      return propsObject;
    }
    function isAliasRecord(record) {
      while (record) {
        if (record.record.aliasOf)
          return true;
        record = record.parent;
      }
      return false;
    }
    function mergeMetaFields(matched) {
      return matched.reduce((meta, record) => assign(meta, record.meta), {});
    }
    function mergeOptions$1(defaults2, partialOptions) {
      const options = {};
      for (const key in defaults2) {
        options[key] = key in partialOptions ? partialOptions[key] : defaults2[key];
      }
      return options;
    }
    function findInsertionIndex(matcher, matchers2) {
      let lower = 0;
      let upper = matchers2.length;
      while (lower !== upper) {
        const mid = lower + upper >> 1;
        const sortOrder = comparePathParserScore(matcher, matchers2[mid]);
        if (sortOrder < 0) {
          upper = mid;
        } else {
          lower = mid + 1;
        }
      }
      const insertionAncestor = getInsertionAncestor(matcher);
      if (insertionAncestor) {
        upper = matchers2.lastIndexOf(insertionAncestor, upper - 1);
      }
      return upper;
    }
    function getInsertionAncestor(matcher) {
      let ancestor = matcher;
      while (ancestor = ancestor.parent) {
        if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) {
          return ancestor;
        }
      }
      return;
    }
    function isMatchable({ record }) {
      return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
    }
    function parseQuery(search) {
      const query = {};
      if (search === "" || search === "?")
        return query;
      const hasLeadingIM = search[0] === "?";
      const searchParams = (hasLeadingIM ? search.slice(1) : search).split("&");
      for (let i2 = 0; i2 < searchParams.length; ++i2) {
        const searchParam = searchParams[i2].replace(PLUS_RE, " ");
        const eqPos = searchParam.indexOf("=");
        const key = decode$3(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
        const value = eqPos < 0 ? null : decode$3(searchParam.slice(eqPos + 1));
        if (key in query) {
          let currentValue = query[key];
          if (!isArray$4(currentValue)) {
            currentValue = query[key] = [currentValue];
          }
          currentValue.push(value);
        } else {
          query[key] = value;
        }
      }
      return query;
    }
    function stringifyQuery(query) {
      let search = "";
      for (let key in query) {
        const value = query[key];
        key = encodeQueryKey(key);
        if (value == null) {
          if (value !== void 0) {
            search += (search.length ? "&" : "") + key;
          }
          continue;
        }
        const values = isArray$4(value) ? value.map((v4) => v4 && encodeQueryValue(v4)) : [value && encodeQueryValue(value)];
        values.forEach((value2) => {
          if (value2 !== void 0) {
            search += (search.length ? "&" : "") + key;
            if (value2 != null)
              search += "=" + value2;
          }
        });
      }
      return search;
    }
    function normalizeQuery(query) {
      const normalizedQuery = {};
      for (const key in query) {
        const value = query[key];
        if (value !== void 0) {
          normalizedQuery[key] = isArray$4(value) ? value.map((v4) => v4 == null ? null : "" + v4) : value == null ? value : "" + value;
        }
      }
      return normalizedQuery;
    }
    const matchedRouteKey = Symbol("");
    const viewDepthKey = Symbol("");
    const routerKey = Symbol("");
    const routeLocationKey = Symbol("");
    const routerViewLocationKey = Symbol("");
    function useCallbacks() {
      let handlers2 = [];
      function add2(handler) {
        handlers2.push(handler);
        return () => {
          const i2 = handlers2.indexOf(handler);
          if (i2 > -1)
            handlers2.splice(i2, 1);
        };
      }
      function reset() {
        handlers2 = [];
      }
      return {
        add: add2,
        list: () => handlers2.slice(),
        reset
      };
    }
    function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn2) => fn2()) {
      const enterCallbackArray = record && // name is defined if record is because of the function overload
      (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
      return () => new Promise((resolve2, reject) => {
        const next = (valid) => {
          if (valid === false) {
            reject(createRouterError(4, {
              from,
              to
            }));
          } else if (valid instanceof Error) {
            reject(valid);
          } else if (isRouteLocation(valid)) {
            reject(createRouterError(2, {
              from: to,
              to: valid
            }));
          } else {
            if (enterCallbackArray && // since enterCallbackArray is truthy, both record and name also are
            record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") {
              enterCallbackArray.push(valid);
            }
            resolve2();
          }
        };
        const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
        let guardCall = Promise.resolve(guardReturn);
        if (guard.length < 3)
          guardCall = guardCall.then(next);
        guardCall.catch((err) => reject(err));
      });
    }
    function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn2) => fn2()) {
      const guards = [];
      for (const record of matched) {
        for (const name in record.components) {
          let rawComponent = record.components[name];
          if (guardType !== "beforeRouteEnter" && !record.instances[name])
            continue;
          if (isRouteComponent(rawComponent)) {
            const options = rawComponent.__vccOpts || rawComponent;
            const guard = options[guardType];
            guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
          } else {
            let componentPromise = rawComponent();
            guards.push(() => componentPromise.then((resolved) => {
              if (!resolved)
                throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
              const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
              record.mods[name] = resolved;
              record.components[name] = resolvedComponent;
              const options = resolvedComponent.__vccOpts || resolvedComponent;
              const guard = options[guardType];
              return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
            }));
          }
        }
      }
      return guards;
    }
    function useLink(props2) {
      const router2 = inject(routerKey);
      const currentRoute = inject(routeLocationKey);
      const route = computed(() => {
        const to = unref(props2.to);
        return router2.resolve(to);
      });
      const activeRecordIndex = computed(() => {
        const { matched } = route.value;
        const { length } = matched;
        const routeMatched = matched[length - 1];
        const currentMatched = currentRoute.matched;
        if (!routeMatched || !currentMatched.length)
          return -1;
        const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
        if (index > -1)
          return index;
        const parentRecordPath = getOriginalPath(matched[length - 2]);
        return (
          // we are dealing with nested routes
          length > 1 && // if the parent and matched route have the same path, this link is
          // referring to the empty child. Or we currently are on a different
          // child of the same parent
          getOriginalPath(routeMatched) === parentRecordPath && // avoid comparing the child with its parent
          currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index
        );
      });
      const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
      const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
      function navigate(e2 = {}) {
        if (guardEvent(e2)) {
          const p2 = router2[unref(props2.replace) ? "replace" : "push"](
            unref(props2.to)
            // avoid uncaught errors are they are logged anyway
          ).catch(noop$4);
          if (props2.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) {
            document.startViewTransition(() => p2);
          }
          return p2;
        }
        return Promise.resolve();
      }
      return {
        route,
        href: computed(() => route.value.href),
        isActive,
        isExactActive,
        navigate
      };
    }
    function preferSingleVNode(vnodes) {
      return vnodes.length === 1 ? vnodes[0] : vnodes;
    }
    const RouterLinkImpl = /* @__PURE__ */ defineComponent({
      name: "RouterLink",
      compatConfig: { MODE: 3 },
      props: {
        to: {
          type: [String, Object],
          required: true
        },
        replace: Boolean,
        activeClass: String,
        // inactiveClass: String,
        exactActiveClass: String,
        custom: Boolean,
        ariaCurrentValue: {
          type: String,
          default: "page"
        },
        viewTransition: Boolean
      },
      useLink,
      setup(props2, { slots }) {
        const link = reactive(useLink(props2));
        const { options } = inject(routerKey);
        const elClass = computed(() => ({
          [getLinkClass(props2.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
          // [getLinkClass(
          //   props.inactiveClass,
          //   options.linkInactiveClass,
          //   'router-link-inactive'
          // )]: !link.isExactActive,
          [getLinkClass(props2.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
        }));
        return () => {
          const children = slots.default && preferSingleVNode(slots.default(link));
          return props2.custom ? children : h$1("a", {
            "aria-current": link.isExactActive ? props2.ariaCurrentValue : null,
            href: link.href,
            // this would override user added attrs but Vue will still add
            // the listener, so we end up triggering both
            onClick: link.navigate,
            class: elClass.value
          }, children);
        };
      }
    });
    const RouterLink = RouterLinkImpl;
    function guardEvent(e2) {
      if (e2.metaKey || e2.altKey || e2.ctrlKey || e2.shiftKey)
        return;
      if (e2.defaultPrevented)
        return;
      if (e2.button !== void 0 && e2.button !== 0)
        return;
      if (e2.currentTarget && e2.currentTarget.getAttribute) {
        const target = e2.currentTarget.getAttribute("target");
        if (/\b_blank\b/i.test(target))
          return;
      }
      if (e2.preventDefault)
        e2.preventDefault();
      return true;
    }
    function includesParams(outer, inner2) {
      for (const key in inner2) {
        const innerValue = inner2[key];
        const outerValue = outer[key];
        if (typeof innerValue === "string") {
          if (innerValue !== outerValue)
            return false;
        } else {
          if (!isArray$4(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i2) => value !== outerValue[i2]))
            return false;
        }
      }
      return true;
    }
    function getOriginalPath(record) {
      return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
    }
    const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
    const RouterViewImpl = /* @__PURE__ */ defineComponent({
      name: "RouterView",
      // #674 we manually inherit them
      inheritAttrs: false,
      props: {
        name: {
          type: String,
          default: "default"
        },
        route: Object
      },
      // Better compat for @vue/compat users
      // https://github.com/vuejs/router/issues/1315
      compatConfig: { MODE: 3 },
      setup(props2, { attrs, slots }) {
        const injectedRoute = inject(routerViewLocationKey);
        const routeToDisplay = computed(() => props2.route || injectedRoute.value);
        const injectedDepth = inject(viewDepthKey, 0);
        const depth = computed(() => {
          let initialDepth = unref(injectedDepth);
          const { matched } = routeToDisplay.value;
          let matchedRoute;
          while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) {
            initialDepth++;
          }
          return initialDepth;
        });
        const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
        provide(viewDepthKey, computed(() => depth.value + 1));
        provide(matchedRouteKey, matchedRouteRef);
        provide(routerViewLocationKey, routeToDisplay);
        const viewRef = ref();
        watch(() => [viewRef.value, matchedRouteRef.value, props2.name], ([instance, to, name], [oldInstance, from, oldName]) => {
          if (to) {
            to.instances[name] = instance;
            if (from && from !== to && instance && instance === oldInstance) {
              if (!to.leaveGuards.size) {
                to.leaveGuards = from.leaveGuards;
              }
              if (!to.updateGuards.size) {
                to.updateGuards = from.updateGuards;
              }
            }
          }
          if (instance && to && // if there is no instance but to and from are the same this might be
          // the first visit
          (!from || !isSameRouteRecord(to, from) || !oldInstance)) {
            (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
          }
        }, { flush: "post" });
        return () => {
          const route = routeToDisplay.value;
          const currentName = props2.name;
          const matchedRoute = matchedRouteRef.value;
          const ViewComponent = matchedRoute && matchedRoute.components[currentName];
          if (!ViewComponent) {
            return normalizeSlot(slots.default, { Component: ViewComponent, route });
          }
          const routePropsOption = matchedRoute.props[currentName];
          const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
          const onVnodeUnmounted = (vnode) => {
            if (vnode.component.isUnmounted) {
              matchedRoute.instances[currentName] = null;
            }
          };
          const component2 = h$1(ViewComponent, assign({}, routeProps, attrs, {
            onVnodeUnmounted,
            ref: viewRef
          }));
          return (
            // pass the vnode to the slot as a prop.
            // h and <component :is="..."> both accept vnodes
            normalizeSlot(slots.default, { Component: component2, route }) || component2
          );
        };
      }
    });
    function normalizeSlot(slot, data) {
      if (!slot)
        return null;
      const slotContent = slot(data);
      return slotContent.length === 1 ? slotContent[0] : slotContent;
    }
    const RouterView = RouterViewImpl;
    function createRouter(options) {
      const matcher = createRouterMatcher(options.routes, options);
      const parseQuery$1 = options.parseQuery || parseQuery;
      const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
      const routerHistory = options.history;
      const beforeGuards = useCallbacks();
      const beforeResolveGuards = useCallbacks();
      const afterGuards = useCallbacks();
      const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
      let pendingLocation = START_LOCATION_NORMALIZED;
      if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) {
        history.scrollRestoration = "manual";
      }
      const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
      const encodeParams = applyToParams.bind(null, encodeParam);
      const decodeParams = (
        // @ts-expect-error: intentionally avoid the type check
        applyToParams.bind(null, decode$3)
      );
      function addRoute(parentOrRoute, route) {
        let parent2;
        let record;
        if (isRouteName(parentOrRoute)) {
          parent2 = matcher.getRecordMatcher(parentOrRoute);
          record = route;
        } else {
          record = parentOrRoute;
        }
        return matcher.addRoute(record, parent2);
      }
      function removeRoute(name) {
        const recordMatcher = matcher.getRecordMatcher(name);
        if (recordMatcher) {
          matcher.removeRoute(recordMatcher);
        }
      }
      function getRoutes() {
        return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
      }
      function hasRoute(name) {
        return !!matcher.getRecordMatcher(name);
      }
      function resolve2(rawLocation, currentLocation) {
        currentLocation = assign({}, currentLocation || currentRoute.value);
        if (typeof rawLocation === "string") {
          const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
          const matchedRoute2 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
          const href2 = routerHistory.createHref(locationNormalized.fullPath);
          return assign(locationNormalized, matchedRoute2, {
            params: decodeParams(matchedRoute2.params),
            hash: decode$3(locationNormalized.hash),
            redirectedFrom: void 0,
            href: href2
          });
        }
        let matcherLocation;
        if (rawLocation.path != null) {
          matcherLocation = assign({}, rawLocation, {
            path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path
          });
        } else {
          const targetParams = assign({}, rawLocation.params);
          for (const key in targetParams) {
            if (targetParams[key] == null) {
              delete targetParams[key];
            }
          }
          matcherLocation = assign({}, rawLocation, {
            params: encodeParams(targetParams)
          });
          currentLocation.params = encodeParams(currentLocation.params);
        }
        const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
        const hash = rawLocation.hash || "";
        matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
        const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
          hash: encodeHash(hash),
          path: matchedRoute.path
        }));
        const href = routerHistory.createHref(fullPath);
        return assign({
          fullPath,
          // keep the hash encoded so fullPath is effectively path + encodedQuery +
          // hash
          hash,
          query: (
            // if the user is using a custom query lib like qs, we might have
            // nested objects, so we keep the query as is, meaning it can contain
            // numbers at `$route.query`, but at the point, the user will have to
            // use their own type anyway.
            // https://github.com/vuejs/router/issues/328#issuecomment-649481567
            stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
          )
        }, matchedRoute, {
          redirectedFrom: void 0,
          href
        });
      }
      function locationAsObject(to) {
        return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
      }
      function checkCanceledNavigation(to, from) {
        if (pendingLocation !== to) {
          return createRouterError(8, {
            from,
            to
          });
        }
      }
      function push2(to) {
        return pushWithRedirect(to);
      }
      function replace(to) {
        return push2(assign(locationAsObject(to), { replace: true }));
      }
      function handleRedirectRecord(to) {
        const lastMatched = to.matched[to.matched.length - 1];
        if (lastMatched && lastMatched.redirect) {
          const { redirect } = lastMatched;
          let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
          if (typeof newTargetLocation === "string") {
            newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : (
              // force empty params
              { path: newTargetLocation }
            );
            newTargetLocation.params = {};
          }
          return assign({
            query: to.query,
            hash: to.hash,
            // avoid transferring params if the redirect has a path
            params: newTargetLocation.path != null ? {} : to.params
          }, newTargetLocation);
        }
      }
      function pushWithRedirect(to, redirectedFrom) {
        const targetLocation = pendingLocation = resolve2(to);
        const from = currentRoute.value;
        const data = to.state;
        const force = to.force;
        const replace2 = to.replace === true;
        const shouldRedirect = handleRedirectRecord(targetLocation);
        if (shouldRedirect)
          return pushWithRedirect(
            assign(locationAsObject(shouldRedirect), {
              state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
              force,
              replace: replace2
            }),
            // keep original redirectedFrom if it exists
            redirectedFrom || targetLocation
          );
        const toLocation = targetLocation;
        toLocation.redirectedFrom = redirectedFrom;
        let failure;
        if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
          failure = createRouterError(16, { to: toLocation, from });
          handleScroll2(
            from,
            from,
            // this is a push, the only way for it to be triggered from a
            // history.listen is with a redirect, which makes it become a push
            true,
            // This cannot be the first navigation because the initial location
            // cannot be manually navigated to
            false
          );
        }
        return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? (
          // navigation redirects still mark the router as ready
          isNavigationFailure(
            error,
            2
            /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
          ) ? error : markAsReady(error)
        ) : (
          // reject any unknown error
          triggerError(error, toLocation, from)
        )).then((failure2) => {
          if (failure2) {
            if (isNavigationFailure(
              failure2,
              2
              /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
            )) {
              return pushWithRedirect(
                // keep options
                assign({
                  // preserve an existing replacement but allow the redirect to override it
                  replace: replace2
                }, locationAsObject(failure2.to), {
                  state: typeof failure2.to === "object" ? assign({}, data, failure2.to.state) : data,
                  force
                }),
                // preserve the original redirectedFrom if any
                redirectedFrom || toLocation
              );
            }
          } else {
            failure2 = finalizeNavigation(toLocation, from, true, replace2, data);
          }
          triggerAfterEach(toLocation, from, failure2);
          return failure2;
        });
      }
      function checkCanceledNavigationAndReject(to, from) {
        const error = checkCanceledNavigation(to, from);
        return error ? Promise.reject(error) : Promise.resolve();
      }
      function runWithContext(fn2) {
        const app2 = installedApps.values().next().value;
        return app2 && typeof app2.runWithContext === "function" ? app2.runWithContext(fn2) : fn2();
      }
      function navigate(to, from) {
        let guards;
        const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
        guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
        for (const record of leavingRecords) {
          record.leaveGuards.forEach((guard) => {
            guards.push(guardToPromiseFn(guard, to, from));
          });
        }
        const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
        guards.push(canceledNavigationCheck);
        return runGuardQueue(guards).then(() => {
          guards = [];
          for (const guard of beforeGuards.list()) {
            guards.push(guardToPromiseFn(guard, to, from));
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
          for (const record of updatingRecords) {
            record.updateGuards.forEach((guard) => {
              guards.push(guardToPromiseFn(guard, to, from));
            });
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = [];
          for (const record of enteringRecords) {
            if (record.beforeEnter) {
              if (isArray$4(record.beforeEnter)) {
                for (const beforeEnter of record.beforeEnter)
                  guards.push(guardToPromiseFn(beforeEnter, to, from));
              } else {
                guards.push(guardToPromiseFn(record.beforeEnter, to, from));
              }
            }
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          to.matched.forEach((record) => record.enterCallbacks = {});
          guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).then(() => {
          guards = [];
          for (const guard of beforeResolveGuards.list()) {
            guards.push(guardToPromiseFn(guard, to, from));
          }
          guards.push(canceledNavigationCheck);
          return runGuardQueue(guards);
        }).catch((err) => isNavigationFailure(
          err,
          8
          /* ErrorTypes.NAVIGATION_CANCELLED */
        ) ? err : Promise.reject(err));
      }
      function triggerAfterEach(to, from, failure) {
        afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
      }
      function finalizeNavigation(toLocation, from, isPush, replace2, data) {
        const error = checkCanceledNavigation(toLocation, from);
        if (error)
          return error;
        const isFirstNavigation = from === START_LOCATION_NORMALIZED;
        const state = !isBrowser ? {} : history.state;
        if (isPush) {
          if (replace2 || isFirstNavigation)
            routerHistory.replace(toLocation.fullPath, assign({
              scroll: isFirstNavigation && state && state.scroll
            }, data));
          else
            routerHistory.push(toLocation.fullPath, data);
        }
        currentRoute.value = toLocation;
        handleScroll2(toLocation, from, isPush, isFirstNavigation);
        markAsReady();
      }
      let removeHistoryListener;
      function setupListeners() {
        if (removeHistoryListener)
          return;
        removeHistoryListener = routerHistory.listen((to, _from, info) => {
          if (!router2.listening)
            return;
          const toLocation = resolve2(to);
          const shouldRedirect = handleRedirectRecord(toLocation);
          if (shouldRedirect) {
            pushWithRedirect(assign(shouldRedirect, { replace: true, force: true }), toLocation).catch(noop$4);
            return;
          }
          pendingLocation = toLocation;
          const from = currentRoute.value;
          if (isBrowser) {
            saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
          }
          navigate(toLocation, from).catch((error) => {
            if (isNavigationFailure(
              error,
              4 | 8
              /* ErrorTypes.NAVIGATION_CANCELLED */
            )) {
              return error;
            }
            if (isNavigationFailure(
              error,
              2
              /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
            )) {
              pushWithRedirect(
                assign(locationAsObject(error.to), {
                  force: true
                }),
                toLocation
                // avoid an uncaught rejection, let push call triggerError
              ).then((failure) => {
                if (isNavigationFailure(
                  failure,
                  4 | 16
                  /* ErrorTypes.NAVIGATION_DUPLICATED */
                ) && !info.delta && info.type === NavigationType.pop) {
                  routerHistory.go(-1, false);
                }
              }).catch(noop$4);
              return Promise.reject();
            }
            if (info.delta) {
              routerHistory.go(-info.delta, false);
            }
            return triggerError(error, toLocation, from);
          }).then((failure) => {
            failure = failure || finalizeNavigation(
              // after navigation, all matched components are resolved
              toLocation,
              from,
              false
            );
            if (failure) {
              if (info.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
              // entry while a different route is displayed
              !isNavigationFailure(
                failure,
                8
                /* ErrorTypes.NAVIGATION_CANCELLED */
              )) {
                routerHistory.go(-info.delta, false);
              } else if (info.type === NavigationType.pop && isNavigationFailure(
                failure,
                4 | 16
                /* ErrorTypes.NAVIGATION_DUPLICATED */
              )) {
                routerHistory.go(-1, false);
              }
            }
            triggerAfterEach(toLocation, from, failure);
          }).catch(noop$4);
        });
      }
      let readyHandlers = useCallbacks();
      let errorListeners = useCallbacks();
      let ready;
      function triggerError(error, to, from) {
        markAsReady(error);
        const list = errorListeners.list();
        if (list.length) {
          list.forEach((handler) => handler(error, to, from));
        } else {
          console.error(error);
        }
        return Promise.reject(error);
      }
      function isReady() {
        if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)
          return Promise.resolve();
        return new Promise((resolve22, reject) => {
          readyHandlers.add([resolve22, reject]);
        });
      }
      function markAsReady(err) {
        if (!ready) {
          ready = !err;
          setupListeners();
          readyHandlers.list().forEach(([resolve22, reject]) => err ? reject(err) : resolve22());
          readyHandlers.reset();
        }
        return err;
      }
      function handleScroll2(to, from, isPush, isFirstNavigation) {
        const { scrollBehavior } = options;
        if (!isBrowser || !scrollBehavior)
          return Promise.resolve();
        const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
        return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position2) => position2 && scrollToPosition(position2)).catch((err) => triggerError(err, to, from));
      }
      const go = (delta) => routerHistory.go(delta);
      let started;
      const installedApps = /* @__PURE__ */ new Set();
      const router2 = {
        currentRoute,
        listening: true,
        addRoute,
        removeRoute,
        clearRoutes: matcher.clearRoutes,
        hasRoute,
        getRoutes,
        resolve: resolve2,
        options,
        push: push2,
        replace,
        go,
        back: () => go(-1),
        forward: () => go(1),
        beforeEach: beforeGuards.add,
        beforeResolve: beforeResolveGuards.add,
        afterEach: afterGuards.add,
        onError: errorListeners.add,
        isReady,
        install(app2) {
          const router22 = this;
          app2.component("RouterLink", RouterLink);
          app2.component("RouterView", RouterView);
          app2.config.globalProperties.$router = router22;
          Object.defineProperty(app2.config.globalProperties, "$route", {
            enumerable: true,
            get: () => unref(currentRoute)
          });
          if (isBrowser && // used for the initial navigation client side to avoid pushing
          // multiple times when the router is used in multiple apps
          !started && currentRoute.value === START_LOCATION_NORMALIZED) {
            started = true;
            push2(routerHistory.location).catch((err) => {
            });
          }
          const reactiveRoute = {};
          for (const key in START_LOCATION_NORMALIZED) {
            Object.defineProperty(reactiveRoute, key, {
              get: () => currentRoute.value[key],
              enumerable: true
            });
          }
          app2.provide(routerKey, router22);
          app2.provide(routeLocationKey, shallowReactive(reactiveRoute));
          app2.provide(routerViewLocationKey, currentRoute);
          const unmountApp = app2.unmount;
          installedApps.add(app2);
          app2.unmount = function() {
            installedApps.delete(app2);
            if (installedApps.size < 1) {
              pendingLocation = START_LOCATION_NORMALIZED;
              removeHistoryListener && removeHistoryListener();
              removeHistoryListener = null;
              currentRoute.value = START_LOCATION_NORMALIZED;
              started = false;
              ready = false;
            }
            unmountApp();
          };
        }
      };
      function runGuardQueue(guards) {
        return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
      }
      return router2;
    }
    function extractChangingRecords(to, from) {
      const leavingRecords = [];
      const updatingRecords = [];
      const enteringRecords = [];
      const len2 = Math.max(from.matched.length, to.matched.length);
      for (let i2 = 0; i2 < len2; i2++) {
        const recordFrom = from.matched[i2];
        if (recordFrom) {
          if (to.matched.find((record) => isSameRouteRecord(record, recordFrom)))
            updatingRecords.push(recordFrom);
          else
            leavingRecords.push(recordFrom);
        }
        const recordTo = to.matched[i2];
        if (recordTo) {
          if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) {
            enteringRecords.push(recordTo);
          }
        }
      }
      return [leavingRecords, updatingRecords, enteringRecords];
    }
    function useRouter() {
      return inject(routerKey);
    }
    const version = "2.9.10";
    const INSTALLED_KEY = Symbol("INSTALLED_KEY");
    const configProviderContextKey = Symbol();
    const defaultNamespace = "el";
    const statePrefix = "is-";
    const _bem = (namespace, block, blockSuffix, element, modifier) => {
      let cls = `${namespace}-${block}`;
      if (blockSuffix) {
        cls += `-${blockSuffix}`;
      }
      if (element) {
        cls += `__${element}`;
      }
      if (modifier) {
        cls += `--${modifier}`;
      }
      return cls;
    };
    const namespaceContextKey = Symbol("namespaceContextKey");
    const useGetDerivedNamespace = (namespaceOverrides) => {
      const derivedNamespace = namespaceOverrides || (getCurrentInstance() ? inject(namespaceContextKey, ref(defaultNamespace)) : ref(defaultNamespace));
      const namespace = computed(() => {
        return unref(derivedNamespace) || defaultNamespace;
      });
      return namespace;
    };
    const useNamespace = (block, namespaceOverrides) => {
      const namespace = useGetDerivedNamespace(namespaceOverrides);
      const b2 = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
      const e2 = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
      const m2 = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
      const be2 = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
      const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
      const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
      const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
      const is = (name, ...args) => {
        const state = args.length >= 1 ? args[0] : true;
        return name && state ? `${statePrefix}${name}` : "";
      };
      const cssVar = (object) => {
        const styles = {};
        for (const key in object) {
          if (object[key]) {
            styles[`--${namespace.value}-${key}`] = object[key];
          }
        }
        return styles;
      };
      const cssVarBlock = (object) => {
        const styles = {};
        for (const key in object) {
          if (object[key]) {
            styles[`--${namespace.value}-${block}-${key}`] = object[key];
          }
        }
        return styles;
      };
      const cssVarName = (name) => `--${namespace.value}-${name}`;
      const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
      return {
        namespace,
        b: b2,
        e: e2,
        m: m2,
        be: be2,
        em,
        bm,
        bem,
        is,
        cssVar,
        cssVarName,
        cssVarBlock,
        cssVarBlockName
      };
    };
    var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
    var freeSelf = typeof self == "object" && self && self.Object === Object && self;
    var root = freeGlobal || freeSelf || Function("return this")();
    var Symbol$2 = root.Symbol;
    var objectProto$f = Object.prototype;
    var hasOwnProperty$d = objectProto$f.hasOwnProperty;
    var nativeObjectToString$1 = objectProto$f.toString;
    var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
    function getRawTag(value) {
      var isOwn = hasOwnProperty$d.call(value, symToStringTag$1), tag = value[symToStringTag$1];
      try {
        value[symToStringTag$1] = void 0;
        var unmasked = true;
      } catch (e2) {
      }
      var result = nativeObjectToString$1.call(value);
      if (unmasked) {
        if (isOwn) {
          value[symToStringTag$1] = tag;
        } else {
          delete value[symToStringTag$1];
        }
      }
      return result;
    }
    var objectProto$e = Object.prototype;
    var nativeObjectToString = objectProto$e.toString;
    function objectToString(value) {
      return nativeObjectToString.call(value);
    }
    var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
    var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
    function baseGetTag(value) {
      if (value == null) {
        return value === void 0 ? undefinedTag : nullTag;
      }
      return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
    }
    function isObjectLike(value) {
      return value != null && typeof value == "object";
    }
    var symbolTag$3 = "[object Symbol]";
    function isSymbol(value) {
      return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
    }
    function arrayMap(array, iteratee) {
      var index = -1, length = array == null ? 0 : array.length, result = Array(length);
      while (++index < length) {
        result[index] = iteratee(array[index], index, array);
      }
      return result;
    }
    var isArray$3 = Array.isArray;
    var symbolProto$2 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
    function baseToString(value) {
      if (typeof value == "string") {
        return value;
      }
      if (isArray$3(value)) {
        return arrayMap(value, baseToString) + "";
      }
      if (isSymbol(value)) {
        return symbolToString ? symbolToString.call(value) : "";
      }
      var result = value + "";
      return result == "0" && 1 / value == -Infinity ? "-0" : result;
    }
    var reWhitespace = /\s/;
    function trimmedEndIndex(string2) {
      var index = string2.length;
      while (index-- && reWhitespace.test(string2.charAt(index))) {
      }
      return index;
    }
    var reTrimStart = /^\s+/;
    function baseTrim(string2) {
      return string2 ? string2.slice(0, trimmedEndIndex(string2) + 1).replace(reTrimStart, "") : string2;
    }
    function isObject$6(value) {
      var type = typeof value;
      return value != null && (type == "object" || type == "function");
    }
    var NAN = 0 / 0;
    var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
    var reIsBinary = /^0b[01]+$/i;
    var reIsOctal = /^0o[0-7]+$/i;
    var freeParseInt = parseInt;
    function toNumber(value) {
      if (typeof value == "number") {
        return value;
      }
      if (isSymbol(value)) {
        return NAN;
      }
      if (isObject$6(value)) {
        var other = typeof value.valueOf == "function" ? value.valueOf() : value;
        value = isObject$6(other) ? other + "" : other;
      }
      if (typeof value != "string") {
        return value === 0 ? value : +value;
      }
      value = baseTrim(value);
      var isBinary = reIsBinary.test(value);
      return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
    }
    function identity$2(value) {
      return value;
    }
    var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
    function isFunction$3(value) {
      if (!isObject$6(value)) {
        return false;
      }
      var tag = baseGetTag(value);
      return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
    }
    var coreJsData = root["__core-js_shared__"];
    var maskSrcKey = function() {
      var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
      return uid2 ? "Symbol(src)_1." + uid2 : "";
    }();
    function isMasked(func) {
      return !!maskSrcKey && maskSrcKey in func;
    }
    var funcProto$2 = Function.prototype;
    var funcToString$2 = funcProto$2.toString;
    function toSource(func) {
      if (func != null) {
        try {
          return funcToString$2.call(func);
        } catch (e2) {
        }
        try {
          return func + "";
        } catch (e2) {
        }
      }
      return "";
    }
    var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
    var reIsHostCtor = /^\[object .+?Constructor\]$/;
    var funcProto$1 = Function.prototype, objectProto$d = Object.prototype;
    var funcToString$1 = funcProto$1.toString;
    var hasOwnProperty$c = objectProto$d.hasOwnProperty;
    var reIsNative = RegExp(
      "^" + funcToString$1.call(hasOwnProperty$c).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
    );
    function baseIsNative(value) {
      if (!isObject$6(value) || isMasked(value)) {
        return false;
      }
      var pattern = isFunction$3(value) ? reIsNative : reIsHostCtor;
      return pattern.test(toSource(value));
    }
    function getValue$1(object, key) {
      return object == null ? void 0 : object[key];
    }
    function getNative(object, key) {
      var value = getValue$1(object, key);
      return baseIsNative(value) ? value : void 0;
    }
    var WeakMap$2 = getNative(root, "WeakMap");
    var objectCreate = Object.create;
    var baseCreate = /* @__PURE__ */ function() {
      function object() {
      }
      return function(proto2) {
        if (!isObject$6(proto2)) {
          return {};
        }
        if (objectCreate) {
          return objectCreate(proto2);
        }
        object.prototype = proto2;
        var result = new object();
        object.prototype = void 0;
        return result;
      };
    }();
    function apply(func, thisArg, args) {
      switch (args.length) {
        case 0:
          return func.call(thisArg);
        case 1:
          return func.call(thisArg, args[0]);
        case 2:
          return func.call(thisArg, args[0], args[1]);
        case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
      }
      return func.apply(thisArg, args);
    }
    function noop$3() {
    }
    function copyArray(source, array) {
      var index = -1, length = source.length;
      array || (array = Array(length));
      while (++index < length) {
        array[index] = source[index];
      }
      return array;
    }
    var HOT_COUNT = 800, HOT_SPAN = 16;
    var nativeNow = Date.now;
    function shortOut(func) {
      var count2 = 0, lastCalled = 0;
      return function() {
        var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
        lastCalled = stamp;
        if (remaining > 0) {
          if (++count2 >= HOT_COUNT) {
            return arguments[0];
          }
        } else {
          count2 = 0;
        }
        return func.apply(void 0, arguments);
      };
    }
    function constant(value) {
      return function() {
        return value;
      };
    }
    var defineProperty = function() {
      try {
        var func = getNative(Object, "defineProperty");
        func({}, "", {});
        return func;
      } catch (e2) {
      }
    }();
    var baseSetToString = !defineProperty ? identity$2 : function(func, string2) {
      return defineProperty(func, "toString", {
        "configurable": true,
        "enumerable": false,
        "value": constant(string2),
        "writable": true
      });
    };
    var setToString = shortOut(baseSetToString);
    function arrayEach(array, iteratee) {
      var index = -1, length = array == null ? 0 : array.length;
      while (++index < length) {
        if (iteratee(array[index], index, array) === false) {
          break;
        }
      }
      return array;
    }
    function baseFindIndex(array, predicate, fromIndex, fromRight) {
      var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
      while (fromRight ? index-- : ++index < length) {
        if (predicate(array[index], index, array)) {
          return index;
        }
      }
      return -1;
    }
    function baseIsNaN(value) {
      return value !== value;
    }
    function strictIndexOf(array, value, fromIndex) {
      var index = fromIndex - 1, length = array.length;
      while (++index < length) {
        if (array[index] === value) {
          return index;
        }
      }
      return -1;
    }
    function baseIndexOf(array, value, fromIndex) {
      return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
    }
    function arrayIncludes(array, value) {
      var length = array == null ? 0 : array.length;
      return !!length && baseIndexOf(array, value, 0) > -1;
    }
    var MAX_SAFE_INTEGER$2 = 9007199254740991;
    var reIsUint = /^(?:0|[1-9]\d*)$/;
    function isIndex(value, length) {
      var type = typeof value;
      length = length == null ? MAX_SAFE_INTEGER$2 : length;
      return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
    }
    function baseAssignValue(object, key, value) {
      if (key == "__proto__" && defineProperty) {
        defineProperty(object, key, {
          "configurable": true,
          "enumerable": true,
          "value": value,
          "writable": true
        });
      } else {
        object[key] = value;
      }
    }
    function eq(value, other) {
      return value === other || value !== value && other !== other;
    }
    var objectProto$c = Object.prototype;
    var hasOwnProperty$b = objectProto$c.hasOwnProperty;
    function assignValue(object, key, value) {
      var objValue = object[key];
      if (!(hasOwnProperty$b.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function copyObject(source, props2, object, customizer) {
      var isNew = !object;
      object || (object = {});
      var index = -1, length = props2.length;
      while (++index < length) {
        var key = props2[index];
        var newValue = void 0;
        if (newValue === void 0) {
          newValue = source[key];
        }
        if (isNew) {
          baseAssignValue(object, key, newValue);
        } else {
          assignValue(object, key, newValue);
        }
      }
      return object;
    }
    var nativeMax$1 = Math.max;
    function overRest(func, start2, transform2) {
      start2 = nativeMax$1(start2 === void 0 ? func.length - 1 : start2, 0);
      return function() {
        var args = arguments, index = -1, length = nativeMax$1(args.length - start2, 0), array = Array(length);
        while (++index < length) {
          array[index] = args[start2 + index];
        }
        index = -1;
        var otherArgs = Array(start2 + 1);
        while (++index < start2) {
          otherArgs[index] = args[index];
        }
        otherArgs[start2] = transform2(array);
        return apply(func, this, otherArgs);
      };
    }
    function baseRest(func, start2) {
      return setToString(overRest(func, start2, identity$2), func + "");
    }
    var MAX_SAFE_INTEGER$1 = 9007199254740991;
    function isLength$1(value) {
      return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
    }
    function isArrayLike$1(value) {
      return value != null && isLength$1(value.length) && !isFunction$3(value);
    }
    function isIterateeCall(value, index, object) {
      if (!isObject$6(object)) {
        return false;
      }
      var type = typeof index;
      if (type == "number" ? isArrayLike$1(object) && isIndex(index, object.length) : type == "string" && index in object) {
        return eq(object[index], value);
      }
      return false;
    }
    function createAssigner(assigner) {
      return baseRest(function(object, sources) {
        var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
        customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
        if (guard && isIterateeCall(sources[0], sources[1], guard)) {
          customizer = length < 3 ? void 0 : customizer;
          length = 1;
        }
        object = Object(object);
        while (++index < length) {
          var source = sources[index];
          if (source) {
            assigner(object, source, index, customizer);
          }
        }
        return object;
      });
    }
    var objectProto$b = Object.prototype;
    function isPrototype(value) {
      var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto$b;
      return value === proto2;
    }
    function baseTimes(n, iteratee) {
      var index = -1, result = Array(n);
      while (++index < n) {
        result[index] = iteratee(index);
      }
      return result;
    }
    var argsTag$3 = "[object Arguments]";
    function baseIsArguments(value) {
      return isObjectLike(value) && baseGetTag(value) == argsTag$3;
    }
    var objectProto$a = Object.prototype;
    var hasOwnProperty$a = objectProto$a.hasOwnProperty;
    var propertyIsEnumerable$1 = objectProto$a.propertyIsEnumerable;
    var isArguments = baseIsArguments(/* @__PURE__ */ function() {
      return arguments;
    }()) ? baseIsArguments : function(value) {
      return isObjectLike(value) && hasOwnProperty$a.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
    };
    function stubFalse() {
      return false;
    }
    var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
    var Buffer$2 = moduleExports$2 ? root.Buffer : void 0;
    var nativeIsBuffer = Buffer$2 ? Buffer$2.isBuffer : void 0;
    var isBuffer$1 = nativeIsBuffer || stubFalse;
    var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
    var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
    var typedArrayTags = {};
    typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
    typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
    function baseIsTypedArray(value) {
      return isObjectLike(value) && isLength$1(value.length) && !!typedArrayTags[baseGetTag(value)];
    }
    function baseUnary(func) {
      return function(value) {
        return func(value);
      };
    }
    var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
    var freeProcess = moduleExports$1 && freeGlobal.process;
    var nodeUtil = function() {
      try {
        var types2 = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
        if (types2) {
          return types2;
        }
        return freeProcess && freeProcess.binding && freeProcess.binding("util");
      } catch (e2) {
      }
    }();
    var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
    var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
    var objectProto$9 = Object.prototype;
    var hasOwnProperty$9 = objectProto$9.hasOwnProperty;
    function arrayLikeKeys(value, inherited) {
      var isArr = isArray$3(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$2(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
      for (var key in value) {
        if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
        (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
        isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
        isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
        isIndex(key, length)))) {
          result.push(key);
        }
      }
      return result;
    }
    function overArg(func, transform2) {
      return function(arg) {
        return func(transform2(arg));
      };
    }
    var nativeKeys = overArg(Object.keys, Object);
    var objectProto$8 = Object.prototype;
    var hasOwnProperty$8 = objectProto$8.hasOwnProperty;
    function baseKeys(object) {
      if (!isPrototype(object)) {
        return nativeKeys(object);
      }
      var result = [];
      for (var key in Object(object)) {
        if (hasOwnProperty$8.call(object, key) && key != "constructor") {
          result.push(key);
        }
      }
      return result;
    }
    function keys$2(object) {
      return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
    }
    function nativeKeysIn(object) {
      var result = [];
      if (object != null) {
        for (var key in Object(object)) {
          result.push(key);
        }
      }
      return result;
    }
    var objectProto$7 = Object.prototype;
    var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
    function baseKeysIn(object) {
      if (!isObject$6(object)) {
        return nativeKeysIn(object);
      }
      var isProto = isPrototype(object), result = [];
      for (var key in object) {
        if (!(key == "constructor" && (isProto || !hasOwnProperty$7.call(object, key)))) {
          result.push(key);
        }
      }
      return result;
    }
    function keysIn(object) {
      return isArrayLike$1(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
    }
    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
    function isKey(value, object) {
      if (isArray$3(value)) {
        return false;
      }
      var type = typeof value;
      if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
        return true;
      }
      return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
    }
    var nativeCreate = getNative(Object, "create");
    function hashClear() {
      this.__data__ = nativeCreate ? nativeCreate(null) : {};
      this.size = 0;
    }
    function hashDelete(key) {
      var result = this.has(key) && delete this.__data__[key];
      this.size -= result ? 1 : 0;
      return result;
    }
    var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
    var objectProto$6 = Object.prototype;
    var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
    function hashGet(key) {
      var data = this.__data__;
      if (nativeCreate) {
        var result = data[key];
        return result === HASH_UNDEFINED$2 ? void 0 : result;
      }
      return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
    }
    var objectProto$5 = Object.prototype;
    var hasOwnProperty$5 = objectProto$5.hasOwnProperty;
    function hashHas(key) {
      var data = this.__data__;
      return nativeCreate ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
    }
    var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
    function hashSet(key, value) {
      var data = this.__data__;
      this.size += this.has(key) ? 0 : 1;
      data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
      return this;
    }
    function Hash(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    Hash.prototype.clear = hashClear;
    Hash.prototype["delete"] = hashDelete;
    Hash.prototype.get = hashGet;
    Hash.prototype.has = hashHas;
    Hash.prototype.set = hashSet;
    function listCacheClear() {
      this.__data__ = [];
      this.size = 0;
    }
    function assocIndexOf(array, key) {
      var length = array.length;
      while (length--) {
        if (eq(array[length][0], key)) {
          return length;
        }
      }
      return -1;
    }
    var arrayProto$1 = Array.prototype;
    var splice = arrayProto$1.splice;
    function listCacheDelete(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        return false;
      }
      var lastIndex = data.length - 1;
      if (index == lastIndex) {
        data.pop();
      } else {
        splice.call(data, index, 1);
      }
      --this.size;
      return true;
    }
    function listCacheGet$1(key) {
      var data = this.__data__, index = assocIndexOf(data, key);
      return index < 0 ? void 0 : data[index][1];
    }
    function listCacheHas(key) {
      return assocIndexOf(this.__data__, key) > -1;
    }
    function listCacheSet$1(key, value) {
      var data = this.__data__, index = assocIndexOf(data, key);
      if (index < 0) {
        ++this.size;
        data.push([key, value]);
      } else {
        data[index][1] = value;
      }
      return this;
    }
    function ListCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    ListCache.prototype.clear = listCacheClear;
    ListCache.prototype["delete"] = listCacheDelete;
    ListCache.prototype.get = listCacheGet$1;
    ListCache.prototype.has = listCacheHas;
    ListCache.prototype.set = listCacheSet$1;
    var Map$1 = getNative(root, "Map");
    function mapCacheClear() {
      this.size = 0;
      this.__data__ = {
        "hash": new Hash(),
        "map": new (Map$1 || ListCache)(),
        "string": new Hash()
      };
    }
    function isKeyable(value) {
      var type = typeof value;
      return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
    }
    function getMapData(map2, key) {
      var data = map2.__data__;
      return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
    }
    function mapCacheDelete(key) {
      var result = getMapData(this, key)["delete"](key);
      this.size -= result ? 1 : 0;
      return result;
    }
    function mapCacheGet(key) {
      return getMapData(this, key).get(key);
    }
    function mapCacheHas(key) {
      return getMapData(this, key).has(key);
    }
    function mapCacheSet(key, value) {
      var data = getMapData(this, key), size = data.size;
      data.set(key, value);
      this.size += data.size == size ? 0 : 1;
      return this;
    }
    function MapCache(entries) {
      var index = -1, length = entries == null ? 0 : entries.length;
      this.clear();
      while (++index < length) {
        var entry = entries[index];
        this.set(entry[0], entry[1]);
      }
    }
    MapCache.prototype.clear = mapCacheClear;
    MapCache.prototype["delete"] = mapCacheDelete;
    MapCache.prototype.get = mapCacheGet;
    MapCache.prototype.has = mapCacheHas;
    MapCache.prototype.set = mapCacheSet;
    var FUNC_ERROR_TEXT$2 = "Expected a function";
    function memoize(func, resolver) {
      if (typeof func != "function" || resolver != null && typeof resolver != "function") {
        throw new TypeError(FUNC_ERROR_TEXT$2);
      }
      var memoized = function() {
        var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache;
        if (cache2.has(key)) {
          return cache2.get(key);
        }
        var result = func.apply(this, args);
        memoized.cache = cache2.set(key, result) || cache2;
        return result;
      };
      memoized.cache = new (memoize.Cache || MapCache)();
      return memoized;
    }
    memoize.Cache = MapCache;
    var MAX_MEMOIZE_SIZE = 500;
    function memoizeCapped(func) {
      var result = memoize(func, function(key) {
        if (cache2.size === MAX_MEMOIZE_SIZE) {
          cache2.clear();
        }
        return key;
      });
      var cache2 = result.cache;
      return result;
    }
    var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
    var reEscapeChar = /\\(\\)?/g;
    var stringToPath = memoizeCapped(function(string2) {
      var result = [];
      if (string2.charCodeAt(0) === 46) {
        result.push("");
      }
      string2.replace(rePropName, function(match, number, quote, subString) {
        result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
      });
      return result;
    });
    function toString$1(value) {
      return value == null ? "" : baseToString(value);
    }
    function castPath(value, object) {
      if (isArray$3(value)) {
        return value;
      }
      return isKey(value, object) ? [value] : stringToPath(toString$1(value));
    }
    function toKey(value) {
      if (typeof value == "string" || isSymbol(value)) {
        return value;
      }
      var result = value + "";
      return result == "0" && 1 / value == -Infinity ? "-0" : result;
    }
    function baseGet(object, path) {
      path = castPath(path, object);
      var index = 0, length = path.length;
      while (object != null && index < length) {
        object = object[toKey(path[index++])];
      }
      return index && index == length ? object : void 0;
    }
    function get$1(object, path, defaultValue) {
      var result = object == null ? void 0 : baseGet(object, path);
      return result === void 0 ? defaultValue : result;
    }
    function arrayPush(array, values) {
      var index = -1, length = values.length, offset2 = array.length;
      while (++index < length) {
        array[offset2 + index] = values[index];
      }
      return array;
    }
    var spreadableSymbol = Symbol$2 ? Symbol$2.isConcatSpreadable : void 0;
    function isFlattenable(value) {
      return isArray$3(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
    }
    function baseFlatten(array, depth, predicate, isStrict, result) {
      var index = -1, length = array.length;
      predicate || (predicate = isFlattenable);
      result || (result = []);
      while (++index < length) {
        var value = array[index];
        if (depth > 0 && predicate(value)) {
          if (depth > 1) {
            baseFlatten(value, depth - 1, predicate, isStrict, result);
          } else {
            arrayPush(result, value);
          }
        } else if (!isStrict) {
          result[result.length] = value;
        }
      }
      return result;
    }
    function flatten(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseFlatten(array, 1) : [];
    }
    function flatRest(func) {
      return setToString(overRest(func, void 0, flatten), func + "");
    }
    var getPrototype = overArg(Object.getPrototypeOf, Object);
    var objectTag$3 = "[object Object]";
    var funcProto = Function.prototype, objectProto$4 = Object.prototype;
    var funcToString = funcProto.toString;
    var hasOwnProperty$4 = objectProto$4.hasOwnProperty;
    var objectCtorString = funcToString.call(Object);
    function isPlainObject$1(value) {
      if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
        return false;
      }
      var proto2 = getPrototype(value);
      if (proto2 === null) {
        return true;
      }
      var Ctor = hasOwnProperty$4.call(proto2, "constructor") && proto2.constructor;
      return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
    }
    function baseSlice(array, start2, end2) {
      var index = -1, length = array.length;
      if (start2 < 0) {
        start2 = -start2 > length ? 0 : length + start2;
      }
      end2 = end2 > length ? length : end2;
      if (end2 < 0) {
        end2 += length;
      }
      length = start2 > end2 ? 0 : end2 - start2 >>> 0;
      start2 >>>= 0;
      var result = Array(length);
      while (++index < length) {
        result[index] = array[index + start2];
      }
      return result;
    }
    function castArray$1() {
      if (!arguments.length) {
        return [];
      }
      var value = arguments[0];
      return isArray$3(value) ? value : [value];
    }
    function stackClear() {
      this.__data__ = new ListCache();
      this.size = 0;
    }
    function stackDelete(key) {
      var data = this.__data__, result = data["delete"](key);
      this.size = data.size;
      return result;
    }
    function stackGet(key) {
      return this.__data__.get(key);
    }
    function stackHas(key) {
      return this.__data__.has(key);
    }
    var LARGE_ARRAY_SIZE$1 = 200;
    function stackSet(key, value) {
      var data = this.__data__;
      if (data instanceof ListCache) {
        var pairs = data.__data__;
        if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
          pairs.push([key, value]);
          this.size = ++data.size;
          return this;
        }
        data = this.__data__ = new MapCache(pairs);
      }
      data.set(key, value);
      this.size = data.size;
      return this;
    }
    function Stack(entries) {
      var data = this.__data__ = new ListCache(entries);
      this.size = data.size;
    }
    Stack.prototype.clear = stackClear;
    Stack.prototype["delete"] = stackDelete;
    Stack.prototype.get = stackGet;
    Stack.prototype.has = stackHas;
    Stack.prototype.set = stackSet;
    function baseAssign(object, source) {
      return object && copyObject(source, keys$2(source), object);
    }
    function baseAssignIn(object, source) {
      return object && copyObject(source, keysIn(source), object);
    }
    var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
    var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
    var moduleExports = freeModule && freeModule.exports === freeExports;
    var Buffer$1 = moduleExports ? root.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
    function cloneBuffer(buffer, isDeep) {
      if (isDeep) {
        return buffer.slice();
      }
      var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
      buffer.copy(result);
      return result;
    }
    function arrayFilter(array, predicate) {
      var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
      while (++index < length) {
        var value = array[index];
        if (predicate(value, index, array)) {
          result[resIndex++] = value;
        }
      }
      return result;
    }
    function stubArray() {
      return [];
    }
    var objectProto$3 = Object.prototype;
    var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
    var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
    var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
      if (object == null) {
        return [];
      }
      object = Object(object);
      return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
        return propertyIsEnumerable.call(object, symbol);
      });
    };
    function copySymbols(source, object) {
      return copyObject(source, getSymbols(source), object);
    }
    var nativeGetSymbols = Object.getOwnPropertySymbols;
    var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
      var result = [];
      while (object) {
        arrayPush(result, getSymbols(object));
        object = getPrototype(object);
      }
      return result;
    };
    function copySymbolsIn(source, object) {
      return copyObject(source, getSymbolsIn(source), object);
    }
    function baseGetAllKeys(object, keysFunc, symbolsFunc) {
      var result = keysFunc(object);
      return isArray$3(object) ? result : arrayPush(result, symbolsFunc(object));
    }
    function getAllKeys(object) {
      return baseGetAllKeys(object, keys$2, getSymbols);
    }
    function getAllKeysIn(object) {
      return baseGetAllKeys(object, keysIn, getSymbolsIn);
    }
    var DataView$2 = getNative(root, "DataView");
    var Promise$1 = getNative(root, "Promise");
    var Set$1 = getNative(root, "Set");
    var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
    var dataViewTag$3 = "[object DataView]";
    var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$2);
    var getTag = baseGetTag;
    if (DataView$2 && getTag(new DataView$2(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag$1) {
      getTag = function(value) {
        var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
        if (ctorString) {
          switch (ctorString) {
            case dataViewCtorString:
              return dataViewTag$3;
            case mapCtorString:
              return mapTag$4;
            case promiseCtorString:
              return promiseTag;
            case setCtorString:
              return setTag$4;
            case weakMapCtorString:
              return weakMapTag$1;
          }
        }
        return result;
      };
    }
    var objectProto$2 = Object.prototype;
    var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
    function initCloneArray(array) {
      var length = array.length, result = new array.constructor(length);
      if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
        result.index = array.index;
        result.input = array.input;
      }
      return result;
    }
    var Uint8Array$1 = root.Uint8Array;
    function cloneArrayBuffer(arrayBuffer) {
      var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
      new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
      return result;
    }
    function cloneDataView(dataView, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
      return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
    }
    var reFlags = /\w*$/;
    function cloneRegExp(regexp3) {
      var result = new regexp3.constructor(regexp3.source, reFlags.exec(regexp3));
      result.lastIndex = regexp3.lastIndex;
      return result;
    }
    var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
    function cloneSymbol(symbol) {
      return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
    }
    function cloneTypedArray(typedArray, isDeep) {
      var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
      return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
    }
    var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
    var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
    function initCloneByTag(object, tag, isDeep) {
      var Ctor = object.constructor;
      switch (tag) {
        case arrayBufferTag$2:
          return cloneArrayBuffer(object);
        case boolTag$2:
        case dateTag$2:
          return new Ctor(+object);
        case dataViewTag$2:
          return cloneDataView(object, isDeep);
        case float32Tag$1:
        case float64Tag$1:
        case int8Tag$1:
        case int16Tag$1:
        case int32Tag$1:
        case uint8Tag$1:
        case uint8ClampedTag$1:
        case uint16Tag$1:
        case uint32Tag$1:
          return cloneTypedArray(object, isDeep);
        case mapTag$3:
          return new Ctor();
        case numberTag$2:
        case stringTag$2:
          return new Ctor(object);
        case regexpTag$2:
          return cloneRegExp(object);
        case setTag$3:
          return new Ctor();
        case symbolTag$2:
          return cloneSymbol(object);
      }
    }
    function initCloneObject(object) {
      return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
    }
    var mapTag$2 = "[object Map]";
    function baseIsMap(value) {
      return isObjectLike(value) && getTag(value) == mapTag$2;
    }
    var nodeIsMap = nodeUtil && nodeUtil.isMap;
    var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
    var setTag$2 = "[object Set]";
    function baseIsSet(value) {
      return isObjectLike(value) && getTag(value) == setTag$2;
    }
    var nodeIsSet = nodeUtil && nodeUtil.isSet;
    var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
    var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$3 = 4;
    var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
    var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
    var cloneableTags = {};
    cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
    cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
    function baseClone(value, bitmask, customizer, key, object, stack2) {
      var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$3;
      if (customizer) {
        result = object ? customizer(value, key, object, stack2) : customizer(value);
      }
      if (result !== void 0) {
        return result;
      }
      if (!isObject$6(value)) {
        return value;
      }
      var isArr = isArray$3(value);
      if (isArr) {
        result = initCloneArray(value);
        if (!isDeep) {
          return copyArray(value, result);
        }
      } else {
        var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
        if (isBuffer$1(value)) {
          return cloneBuffer(value, isDeep);
        }
        if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
          result = isFlat || isFunc ? {} : initCloneObject(value);
          if (!isDeep) {
            return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
          }
        } else {
          if (!cloneableTags[tag]) {
            return object ? value : {};
          }
          result = initCloneByTag(value, tag, isDeep);
        }
      }
      stack2 || (stack2 = new Stack());
      var stacked = stack2.get(value);
      if (stacked) {
        return stacked;
      }
      stack2.set(value, result);
      if (isSet(value)) {
        value.forEach(function(subValue) {
          result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2));
        });
      } else if (isMap(value)) {
        value.forEach(function(subValue, key2) {
          result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
        });
      }
      var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys$2;
      var props2 = isArr ? void 0 : keysFunc(value);
      arrayEach(props2 || value, function(subValue, key2) {
        if (props2) {
          key2 = subValue;
          subValue = value[key2];
        }
        assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack2));
      });
      return result;
    }
    var CLONE_SYMBOLS_FLAG$2 = 4;
    function clone$5(value) {
      return baseClone(value, CLONE_SYMBOLS_FLAG$2);
    }
    var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
    function cloneDeep(value) {
      return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
    }
    var HASH_UNDEFINED = "__lodash_hash_undefined__";
    function setCacheAdd(value) {
      this.__data__.set(value, HASH_UNDEFINED);
      return this;
    }
    function setCacheHas(value) {
      return this.__data__.has(value);
    }
    function SetCache(values) {
      var index = -1, length = values == null ? 0 : values.length;
      this.__data__ = new MapCache();
      while (++index < length) {
        this.add(values[index]);
      }
    }
    SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
    SetCache.prototype.has = setCacheHas;
    function arraySome(array, predicate) {
      var index = -1, length = array == null ? 0 : array.length;
      while (++index < length) {
        if (predicate(array[index], index, array)) {
          return true;
        }
      }
      return false;
    }
    function cacheHas(cache2, key) {
      return cache2.has(key);
    }
    var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
    function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
      if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
        return false;
      }
      var arrStacked = stack2.get(array);
      var othStacked = stack2.get(other);
      if (arrStacked && othStacked) {
        return arrStacked == other && othStacked == array;
      }
      var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
      stack2.set(array, other);
      stack2.set(other, array);
      while (++index < arrLength) {
        var arrValue = array[index], othValue = other[index];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack2) : customizer(arrValue, othValue, index, array, other, stack2);
        }
        if (compared !== void 0) {
          if (compared) {
            continue;
          }
          result = false;
          break;
        }
        if (seen) {
          if (!arraySome(other, function(othValue2, othIndex) {
            if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) {
              return seen.push(othIndex);
            }
          })) {
            result = false;
            break;
          }
        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) {
          result = false;
          break;
        }
      }
      stack2["delete"](array);
      stack2["delete"](other);
      return result;
    }
    function mapToArray(map2) {
      var index = -1, result = Array(map2.size);
      map2.forEach(function(value, key) {
        result[++index] = [key, value];
      });
      return result;
    }
    function setToArray(set2) {
      var index = -1, result = Array(set2.size);
      set2.forEach(function(value) {
        result[++index] = value;
      });
      return result;
    }
    var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
    var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
    var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
    var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
    function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) {
      switch (tag) {
        case dataViewTag:
          if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
            return false;
          }
          object = object.buffer;
          other = other.buffer;
        case arrayBufferTag:
          if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) {
            return false;
          }
          return true;
        case boolTag:
        case dateTag:
        case numberTag:
          return eq(+object, +other);
        case errorTag:
          return object.name == other.name && object.message == other.message;
        case regexpTag:
        case stringTag:
          return object == other + "";
        case mapTag:
          var convert = mapToArray;
        case setTag:
          var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
          convert || (convert = setToArray);
          if (object.size != other.size && !isPartial) {
            return false;
          }
          var stacked = stack2.get(object);
          if (stacked) {
            return stacked == other;
          }
          bitmask |= COMPARE_UNORDERED_FLAG$2;
          stack2.set(object, other);
          var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2);
          stack2["delete"](object);
          return result;
        case symbolTag:
          if (symbolValueOf) {
            return symbolValueOf.call(object) == symbolValueOf.call(other);
          }
      }
      return false;
    }
    var COMPARE_PARTIAL_FLAG$3 = 1;
    var objectProto$1 = Object.prototype;
    var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
    function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) {
      var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
      if (objLength != othLength && !isPartial) {
        return false;
      }
      var index = objLength;
      while (index--) {
        var key = objProps[index];
        if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) {
          return false;
        }
      }
      var objStacked = stack2.get(object);
      var othStacked = stack2.get(other);
      if (objStacked && othStacked) {
        return objStacked == other && othStacked == object;
      }
      var result = true;
      stack2.set(object, other);
      stack2.set(other, object);
      var skipCtor = isPartial;
      while (++index < objLength) {
        key = objProps[index];
        var objValue = object[key], othValue = other[key];
        if (customizer) {
          var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2);
        }
        if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) {
          result = false;
          break;
        }
        skipCtor || (skipCtor = key == "constructor");
      }
      if (result && !skipCtor) {
        var objCtor = object.constructor, othCtor = other.constructor;
        if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
          result = false;
        }
      }
      stack2["delete"](object);
      stack2["delete"](other);
      return result;
    }
    var COMPARE_PARTIAL_FLAG$2 = 1;
    var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
    var objectProto = Object.prototype;
    var hasOwnProperty$1 = objectProto.hasOwnProperty;
    function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) {
      var objIsArr = isArray$3(object), othIsArr = isArray$3(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
      objTag = objTag == argsTag ? objectTag : objTag;
      othTag = othTag == argsTag ? objectTag : othTag;
      var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
      if (isSameTag && isBuffer$1(object)) {
        if (!isBuffer$1(other)) {
          return false;
        }
        objIsArr = true;
        objIsObj = false;
      }
      if (isSameTag && !objIsObj) {
        stack2 || (stack2 = new Stack());
        return objIsArr || isTypedArray$2(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2);
      }
      if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
        var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
        if (objIsWrapped || othIsWrapped) {
          var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
          stack2 || (stack2 = new Stack());
          return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2);
        }
      }
      if (!isSameTag) {
        return false;
      }
      stack2 || (stack2 = new Stack());
      return equalObjects(object, other, bitmask, customizer, equalFunc, stack2);
    }
    function baseIsEqual(value, other, bitmask, customizer, stack2) {
      if (value === other) {
        return true;
      }
      if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
        return value !== value && other !== other;
      }
      return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2);
    }
    var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
    function baseIsMatch(object, source, matchData, customizer) {
      var index = matchData.length, length = index;
      if (object == null) {
        return !length;
      }
      object = Object(object);
      while (index--) {
        var data = matchData[index];
        if (data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
          return false;
        }
      }
      while (++index < length) {
        data = matchData[index];
        var key = data[0], objValue = object[key], srcValue = data[1];
        if (data[2]) {
          if (objValue === void 0 && !(key in object)) {
            return false;
          }
        } else {
          var stack2 = new Stack();
          var result;
          if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack2) : result)) {
            return false;
          }
        }
      }
      return true;
    }
    function isStrictComparable(value) {
      return value === value && !isObject$6(value);
    }
    function getMatchData(object) {
      var result = keys$2(object), length = result.length;
      while (length--) {
        var key = result[length], value = object[key];
        result[length] = [key, value, isStrictComparable(value)];
      }
      return result;
    }
    function matchesStrictComparable(key, srcValue) {
      return function(object) {
        if (object == null) {
          return false;
        }
        return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
      };
    }
    function baseMatches(source) {
      var matchData = getMatchData(source);
      if (matchData.length == 1 && matchData[0][2]) {
        return matchesStrictComparable(matchData[0][0], matchData[0][1]);
      }
      return function(object) {
        return object === source || baseIsMatch(object, source, matchData);
      };
    }
    function baseHasIn(object, key) {
      return object != null && key in Object(object);
    }
    function hasPath(object, path, hasFunc) {
      path = castPath(path, object);
      var index = -1, length = path.length, result = false;
      while (++index < length) {
        var key = toKey(path[index]);
        if (!(result = object != null && hasFunc(object, key))) {
          break;
        }
        object = object[key];
      }
      if (result || ++index != length) {
        return result;
      }
      length = object == null ? 0 : object.length;
      return !!length && isLength$1(length) && isIndex(key, length) && (isArray$3(object) || isArguments(object));
    }
    function hasIn(object, path) {
      return object != null && hasPath(object, path, baseHasIn);
    }
    var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
    function baseMatchesProperty(path, srcValue) {
      if (isKey(path) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path), srcValue);
      }
      return function(object) {
        var objValue = get$1(object, path);
        return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
      };
    }
    function baseProperty(key) {
      return function(object) {
        return object == null ? void 0 : object[key];
      };
    }
    function basePropertyDeep(path) {
      return function(object) {
        return baseGet(object, path);
      };
    }
    function property(path) {
      return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
    }
    function baseIteratee(value) {
      if (typeof value == "function") {
        return value;
      }
      if (value == null) {
        return identity$2;
      }
      if (typeof value == "object") {
        return isArray$3(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
      }
      return property(value);
    }
    function createBaseFor(fromRight) {
      return function(object, iteratee, keysFunc) {
        var index = -1, iterable = Object(object), props2 = keysFunc(object), length = props2.length;
        while (length--) {
          var key = props2[++index];
          if (iteratee(iterable[key], key, iterable) === false) {
            break;
          }
        }
        return object;
      };
    }
    var baseFor = createBaseFor();
    function baseForOwn(object, iteratee) {
      return object && baseFor(object, iteratee, keys$2);
    }
    function createBaseEach(eachFunc, fromRight) {
      return function(collection, iteratee) {
        if (collection == null) {
          return collection;
        }
        if (!isArrayLike$1(collection)) {
          return eachFunc(collection, iteratee);
        }
        var length = collection.length, index = -1, iterable = Object(collection);
        while (++index < length) {
          if (iteratee(iterable[index], index, iterable) === false) {
            break;
          }
        }
        return collection;
      };
    }
    var baseEach = createBaseEach(baseForOwn);
    var now = function() {
      return root.Date.now();
    };
    var FUNC_ERROR_TEXT$1 = "Expected a function";
    var nativeMax = Math.max, nativeMin = Math.min;
    function debounce(func, wait, options) {
      var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT$1);
      }
      wait = toNumber(wait) || 0;
      if (isObject$6(options)) {
        leading = !!options.leading;
        maxing = "maxWait" in options;
        maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      function invokeFunc(time2) {
        var args = lastArgs, thisArg = lastThis;
        lastArgs = lastThis = void 0;
        lastInvokeTime = time2;
        result = func.apply(thisArg, args);
        return result;
      }
      function leadingEdge(time2) {
        lastInvokeTime = time2;
        timerId = setTimeout(timerExpired, wait);
        return leading ? invokeFunc(time2) : result;
      }
      function remainingWait(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
        return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
      }
      function shouldInvoke(time2) {
        var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
        return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
      }
      function timerExpired() {
        var time2 = now();
        if (shouldInvoke(time2)) {
          return trailingEdge(time2);
        }
        timerId = setTimeout(timerExpired, remainingWait(time2));
      }
      function trailingEdge(time2) {
        timerId = void 0;
        if (trailing && lastArgs) {
          return invokeFunc(time2);
        }
        lastArgs = lastThis = void 0;
        return result;
      }
      function cancel() {
        if (timerId !== void 0) {
          clearTimeout(timerId);
        }
        lastInvokeTime = 0;
        lastArgs = lastCallTime = lastThis = timerId = void 0;
      }
      function flush() {
        return timerId === void 0 ? result : trailingEdge(now());
      }
      function debounced() {
        var time2 = now(), isInvoking = shouldInvoke(time2);
        lastArgs = arguments;
        lastThis = this;
        lastCallTime = time2;
        if (isInvoking) {
          if (timerId === void 0) {
            return leadingEdge(lastCallTime);
          }
          if (maxing) {
            clearTimeout(timerId);
            timerId = setTimeout(timerExpired, wait);
            return invokeFunc(lastCallTime);
          }
        }
        if (timerId === void 0) {
          timerId = setTimeout(timerExpired, wait);
        }
        return result;
      }
      debounced.cancel = cancel;
      debounced.flush = flush;
      return debounced;
    }
    function assignMergeValue(object, key, value) {
      if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
        baseAssignValue(object, key, value);
      }
    }
    function isArrayLikeObject(value) {
      return isObjectLike(value) && isArrayLike$1(value);
    }
    function safeGet(object, key) {
      if (key === "constructor" && typeof object[key] === "function") {
        return;
      }
      if (key == "__proto__") {
        return;
      }
      return object[key];
    }
    function toPlainObject(value) {
      return copyObject(value, keysIn(value));
    }
    function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) {
      var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue);
      if (stacked) {
        assignMergeValue(object, key, stacked);
        return;
      }
      var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : void 0;
      var isCommon = newValue === void 0;
      if (isCommon) {
        var isArr = isArray$3(srcValue), isBuff = !isArr && isBuffer$1(srcValue), isTyped = !isArr && !isBuff && isTypedArray$2(srcValue);
        newValue = srcValue;
        if (isArr || isBuff || isTyped) {
          if (isArray$3(objValue)) {
            newValue = objValue;
          } else if (isArrayLikeObject(objValue)) {
            newValue = copyArray(objValue);
          } else if (isBuff) {
            isCommon = false;
            newValue = cloneBuffer(srcValue, true);
          } else if (isTyped) {
            isCommon = false;
            newValue = cloneTypedArray(srcValue, true);
          } else {
            newValue = [];
          }
        } else if (isPlainObject$1(srcValue) || isArguments(srcValue)) {
          newValue = objValue;
          if (isArguments(objValue)) {
            newValue = toPlainObject(objValue);
          } else if (!isObject$6(objValue) || isFunction$3(objValue)) {
            newValue = initCloneObject(srcValue);
          }
        } else {
          isCommon = false;
        }
      }
      if (isCommon) {
        stack2.set(srcValue, newValue);
        mergeFunc(newValue, srcValue, srcIndex, customizer, stack2);
        stack2["delete"](srcValue);
      }
      assignMergeValue(object, key, newValue);
    }
    function baseMerge(object, source, srcIndex, customizer, stack2) {
      if (object === source) {
        return;
      }
      baseFor(source, function(srcValue, key) {
        stack2 || (stack2 = new Stack());
        if (isObject$6(srcValue)) {
          baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2);
        } else {
          var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : void 0;
          if (newValue === void 0) {
            newValue = srcValue;
          }
          assignMergeValue(object, key, newValue);
        }
      }, keysIn);
    }
    function last(array) {
      var length = array == null ? 0 : array.length;
      return length ? array[length - 1] : void 0;
    }
    function findLastIndex(array, predicate, fromIndex) {
      var length = array == null ? 0 : array.length;
      if (!length) {
        return -1;
      }
      var index = length - 1;
      return baseFindIndex(array, baseIteratee(predicate), index, true);
    }
    function baseMap(collection, iteratee) {
      var index = -1, result = isArrayLike$1(collection) ? Array(collection.length) : [];
      baseEach(collection, function(value, key, collection2) {
        result[++index] = iteratee(value, key, collection2);
      });
      return result;
    }
    function map$2(collection, iteratee) {
      var func = isArray$3(collection) ? arrayMap : baseMap;
      return func(collection, baseIteratee(iteratee));
    }
    function flatMap(collection, iteratee) {
      return baseFlatten(map$2(collection, iteratee), 1);
    }
    var INFINITY$1 = 1 / 0;
    function flattenDeep(array) {
      var length = array == null ? 0 : array.length;
      return length ? baseFlatten(array, INFINITY$1) : [];
    }
    function fromPairs(pairs) {
      var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
      while (++index < length) {
        var pair = pairs[index];
        result[pair[0]] = pair[1];
      }
      return result;
    }
    function parent(object, path) {
      return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
    }
    function isEqual$1(value, other) {
      return baseIsEqual(value, other);
    }
    function isNil(value) {
      return value == null;
    }
    function isNull(value) {
      return value === null;
    }
    function isUndefined$2(value) {
      return value === void 0;
    }
    var merge$2 = createAssigner(function(object, source, srcIndex) {
      baseMerge(object, source, srcIndex);
    });
    function baseUnset(object, path) {
      path = castPath(path, object);
      object = parent(object, path);
      return object == null || delete object[toKey(last(path))];
    }
    function customOmitClone(value) {
      return isPlainObject$1(value) ? void 0 : value;
    }
    var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
    var omit = flatRest(function(object, paths) {
      var result = {};
      if (object == null) {
        return result;
      }
      var isDeep = false;
      paths = arrayMap(paths, function(path) {
        path = castPath(path, object);
        isDeep || (isDeep = path.length > 1);
        return path;
      });
      copyObject(object, getAllKeysIn(object), result);
      if (isDeep) {
        result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
      }
      var length = paths.length;
      while (length--) {
        baseUnset(result, paths[length]);
      }
      return result;
    });
    function baseSet(object, path, value, customizer) {
      if (!isObject$6(object)) {
        return object;
      }
      path = castPath(path, object);
      var index = -1, length = path.length, lastIndex = length - 1, nested = object;
      while (nested != null && ++index < length) {
        var key = toKey(path[index]), newValue = value;
        if (key === "__proto__" || key === "constructor" || key === "prototype") {
          return object;
        }
        if (index != lastIndex) {
          var objValue = nested[key];
          newValue = void 0;
          if (newValue === void 0) {
            newValue = isObject$6(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
          }
        }
        assignValue(nested, key, newValue);
        nested = nested[key];
      }
      return object;
    }
    function basePickBy(object, paths, predicate) {
      var index = -1, length = paths.length, result = {};
      while (++index < length) {
        var path = paths[index], value = baseGet(object, path);
        if (predicate(value, path)) {
          baseSet(result, castPath(path, object), value);
        }
      }
      return result;
    }
    function basePick(object, paths) {
      return basePickBy(object, paths, function(value, path) {
        return hasIn(object, path);
      });
    }
    var pick = flatRest(function(object, paths) {
      return object == null ? {} : basePick(object, paths);
    });
    function set$2(object, path, value) {
      return object == null ? object : baseSet(object, path, value);
    }
    var FUNC_ERROR_TEXT = "Expected a function";
    function throttle$2(func, wait, options) {
      var leading = true, trailing = true;
      if (typeof func != "function") {
        throw new TypeError(FUNC_ERROR_TEXT);
      }
      if (isObject$6(options)) {
        leading = "leading" in options ? !!options.leading : leading;
        trailing = "trailing" in options ? !!options.trailing : trailing;
      }
      return debounce(func, wait, {
        "leading": leading,
        "maxWait": wait,
        "trailing": trailing
      });
    }
    var INFINITY = 1 / 0;
    var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? noop$3 : function(values) {
      return new Set$1(values);
    };
    var LARGE_ARRAY_SIZE = 200;
    function baseUniq(array, iteratee, comparator) {
      var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
      if (length >= LARGE_ARRAY_SIZE) {
        var set2 = createSet(array);
        if (set2) {
          return setToArray(set2);
        }
        isCommon = false;
        includes = cacheHas;
        seen = new SetCache();
      } else {
        seen = result;
      }
      outer:
        while (++index < length) {
          var value = array[index], computed2 = value;
          value = value !== 0 ? value : 0;
          if (isCommon && computed2 === computed2) {
            var seenIndex = seen.length;
            while (seenIndex--) {
              if (seen[seenIndex] === computed2) {
                continue outer;
              }
            }
            result.push(value);
          } else if (!includes(seen, computed2, comparator)) {
            if (seen !== result) {
              seen.push(computed2);
            }
            result.push(value);
          }
        }
      return result;
    }
    var union = baseRest(function(arrays) {
      return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
    });
    const isUndefined$1 = (val) => val === void 0;
    const isBoolean$1 = (val) => typeof val === "boolean";
    const isNumber$2 = (val) => typeof val === "number";
    const isEmpty = (val) => !val && val !== 0 || isArray$5(val) && val.length === 0 || isObject$7(val) && !Object.keys(val).length;
    const isElement$1 = (e2) => {
      if (typeof Element === "undefined")
        return false;
      return e2 instanceof Element;
    };
    const isPropAbsent = (prop) => isNil(prop);
    const isStringNumber = (val) => {
      if (!isString$3(val)) {
        return false;
      }
      return !Number.isNaN(Number(val));
    };
    const isWindow = (val) => val === window;
    var __defProp$9 = Object.defineProperty;
    var __defProps$6 = Object.defineProperties;
    var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
    var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
    var __hasOwnProp$b = Object.prototype.hasOwnProperty;
    var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
    var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
    var __spreadValues$9 = (a2, b2) => {
      for (var prop in b2 || (b2 = {}))
        if (__hasOwnProp$b.call(b2, prop))
          __defNormalProp$9(a2, prop, b2[prop]);
      if (__getOwnPropSymbols$b)
        for (var prop of __getOwnPropSymbols$b(b2)) {
          if (__propIsEnum$b.call(b2, prop))
            __defNormalProp$9(a2, prop, b2[prop]);
        }
      return a2;
    };
    var __spreadProps$6 = (a2, b2) => __defProps$6(a2, __getOwnPropDescs$6(b2));
    function computedEager(fn2, options) {
      var _a2;
      const result = shallowRef();
      watchEffect(() => {
        result.value = fn2();
      }, __spreadProps$6(__spreadValues$9({}, options), {
        flush: (_a2 = void 0) != null ? _a2 : "sync"
      }));
      return readonly(result);
    }
    var _a$1;
    const isClient = typeof window !== "undefined";
    const isDef$1 = (val) => typeof val !== "undefined";
    const isFunction$2 = (val) => typeof val === "function";
    const isString$2 = (val) => typeof val === "string";
    const noop$2 = () => {
    };
    const isIOS = isClient && ((_a$1 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
    function resolveUnref(r) {
      return typeof r === "function" ? r() : unref(r);
    }
    function createFilterWrapper(filter2, fn2) {
      function wrapper(...args) {
        return new Promise((resolve2, reject) => {
          Promise.resolve(filter2(() => fn2.apply(this, args), { fn: fn2, thisArg: this, args })).then(resolve2).catch(reject);
        });
      }
      return wrapper;
    }
    function debounceFilter(ms, options = {}) {
      let timer;
      let maxTimer;
      let lastRejector = noop$2;
      const _clearTimeout = (timer2) => {
        clearTimeout(timer2);
        lastRejector();
        lastRejector = noop$2;
      };
      const filter2 = (invoke) => {
        const duration2 = resolveUnref(ms);
        const maxDuration = resolveUnref(options.maxWait);
        if (timer)
          _clearTimeout(timer);
        if (duration2 <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
          if (maxTimer) {
            _clearTimeout(maxTimer);
            maxTimer = null;
          }
          return Promise.resolve(invoke());
        }
        return new Promise((resolve2, reject) => {
          lastRejector = options.rejectOnCancel ? reject : resolve2;
          if (maxDuration && !maxTimer) {
            maxTimer = setTimeout(() => {
              if (timer)
                _clearTimeout(timer);
              maxTimer = null;
              resolve2(invoke());
            }, maxDuration);
          }
          timer = setTimeout(() => {
            if (maxTimer)
              _clearTimeout(maxTimer);
            maxTimer = null;
            resolve2(invoke());
          }, duration2);
        });
      };
      return filter2;
    }
    function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {
      let lastExec = 0;
      let timer;
      let isLeading = true;
      let lastRejector = noop$2;
      let lastValue;
      const clear2 = () => {
        if (timer) {
          clearTimeout(timer);
          timer = void 0;
          lastRejector();
          lastRejector = noop$2;
        }
      };
      const filter2 = (_invoke) => {
        const duration2 = resolveUnref(ms);
        const elapsed = Date.now() - lastExec;
        const invoke = () => {
          return lastValue = _invoke();
        };
        clear2();
        if (duration2 <= 0) {
          lastExec = Date.now();
          return invoke();
        }
        if (elapsed > duration2 && (leading || !isLeading)) {
          lastExec = Date.now();
          invoke();
        } else if (trailing) {
          lastValue = new Promise((resolve2, reject) => {
            lastRejector = rejectOnCancel ? reject : resolve2;
            timer = setTimeout(() => {
              lastExec = Date.now();
              isLeading = true;
              resolve2(invoke());
              clear2();
            }, Math.max(0, duration2 - elapsed));
          });
        }
        if (!leading && !timer)
          timer = setTimeout(() => isLeading = true, duration2);
        isLeading = false;
        return lastValue;
      };
      return filter2;
    }
    function identity$1(arg) {
      return arg;
    }
    function computedWithControl(source, fn2) {
      let v4 = void 0;
      let track2;
      let trigger2;
      const dirty = ref(true);
      const update = () => {
        dirty.value = true;
        trigger2();
      };
      watch(source, update, { flush: "sync" });
      const get2 = isFunction$2(fn2) ? fn2 : fn2.get;
      const set2 = isFunction$2(fn2) ? void 0 : fn2.set;
      const result = customRef((_track, _trigger) => {
        track2 = _track;
        trigger2 = _trigger;
        return {
          get() {
            if (dirty.value) {
              v4 = get2();
              dirty.value = false;
            }
            track2();
            return v4;
          },
          set(v22) {
            set2 == null ? void 0 : set2(v22);
          }
        };
      });
      if (Object.isExtensible(result))
        result.trigger = update;
      return result;
    }
    function tryOnScopeDispose(fn2) {
      if (getCurrentScope()) {
        onScopeDispose(fn2);
        return true;
      }
      return false;
    }
    function useDebounceFn(fn2, ms = 200, options = {}) {
      return createFilterWrapper(debounceFilter(ms, options), fn2);
    }
    function refDebounced(value, ms = 200, options = {}) {
      const debounced = ref(value.value);
      const updater = useDebounceFn(() => {
        debounced.value = value.value;
      }, ms, options);
      watch(value, () => updater());
      return debounced;
    }
    function useThrottleFn(fn2, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
      return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn2);
    }
    function tryOnMounted(fn2, sync = true) {
      if (getCurrentInstance())
        onMounted(fn2);
      else if (sync)
        fn2();
      else
        nextTick(fn2);
    }
    function useTimeoutFn(cb, interval, options = {}) {
      const {
        immediate = true
      } = options;
      const isPending = ref(false);
      let timer = null;
      function clear2() {
        if (timer) {
          clearTimeout(timer);
          timer = null;
        }
      }
      function stop2() {
        isPending.value = false;
        clear2();
      }
      function start2(...args) {
        clear2();
        isPending.value = true;
        timer = setTimeout(() => {
          isPending.value = false;
          timer = null;
          cb(...args);
        }, resolveUnref(interval));
      }
      if (immediate) {
        isPending.value = true;
        if (isClient)
          start2();
      }
      tryOnScopeDispose(stop2);
      return {
        isPending: readonly(isPending),
        start: start2,
        stop: stop2
      };
    }
    function unrefElement(elRef) {
      var _a2;
      const plain = resolveUnref(elRef);
      return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
    }
    const defaultWindow = isClient ? window : void 0;
    const defaultDocument = isClient ? window.document : void 0;
    function useEventListener(...args) {
      let target;
      let events;
      let listeners;
      let options;
      if (isString$2(args[0]) || Array.isArray(args[0])) {
        [events, listeners, options] = args;
        target = defaultWindow;
      } else {
        [target, events, listeners, options] = args;
      }
      if (!target)
        return noop$2;
      if (!Array.isArray(events))
        events = [events];
      if (!Array.isArray(listeners))
        listeners = [listeners];
      const cleanups = [];
      const cleanup = () => {
        cleanups.forEach((fn2) => fn2());
        cleanups.length = 0;
      };
      const register2 = (el, event, listener, options2) => {
        el.addEventListener(event, listener, options2);
        return () => el.removeEventListener(event, listener, options2);
      };
      const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
        cleanup();
        if (!el)
          return;
        cleanups.push(...events.flatMap((event) => {
          return listeners.map((listener) => register2(el, event, listener, options2));
        }));
      }, { immediate: true, flush: "post" });
      const stop2 = () => {
        stopWatch();
        cleanup();
      };
      tryOnScopeDispose(stop2);
      return stop2;
    }
    let _iOSWorkaround = false;
    function onClickOutside(target, handler, options = {}) {
      const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
      if (!window2)
        return;
      if (isIOS && !_iOSWorkaround) {
        _iOSWorkaround = true;
        Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$2));
      }
      let shouldListen = true;
      const shouldIgnore = (event) => {
        return ignore.some((target2) => {
          if (typeof target2 === "string") {
            return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
          } else {
            const el = unrefElement(target2);
            return el && (event.target === el || event.composedPath().includes(el));
          }
        });
      };
      const listener = (event) => {
        const el = unrefElement(target);
        if (!el || el === event.target || event.composedPath().includes(el))
          return;
        if (event.detail === 0)
          shouldListen = !shouldIgnore(event);
        if (!shouldListen) {
          shouldListen = true;
          return;
        }
        handler(event);
      };
      const cleanup = [
        useEventListener(window2, "click", listener, { passive: true, capture }),
        useEventListener(window2, "pointerdown", (e2) => {
          const el = unrefElement(target);
          if (el)
            shouldListen = !e2.composedPath().includes(el) && !shouldIgnore(e2);
        }, { passive: true }),
        detectIframe && useEventListener(window2, "blur", (event) => {
          var _a2;
          const el = unrefElement(target);
          if (((_a2 = window2.document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
            handler(event);
        })
      ].filter(Boolean);
      const stop2 = () => cleanup.forEach((fn2) => fn2());
      return stop2;
    }
    function useActiveElement(options = {}) {
      var _a2;
      const { window: window2 = defaultWindow } = options;
      const document2 = (_a2 = options.document) != null ? _a2 : window2 == null ? void 0 : window2.document;
      const activeElement = computedWithControl(() => null, () => document2 == null ? void 0 : document2.activeElement);
      if (window2) {
        useEventListener(window2, "blur", (event) => {
          if (event.relatedTarget !== null)
            return;
          activeElement.trigger();
        }, true);
        useEventListener(window2, "focus", activeElement.trigger, true);
      }
      return activeElement;
    }
    function useSupported(callback, sync = false) {
      const isSupported = ref();
      const update = () => isSupported.value = Boolean(callback());
      update();
      tryOnMounted(update, sync);
      return isSupported;
    }
    function cloneFnJSON(source) {
      return JSON.parse(JSON.stringify(source));
    }
    const _global$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
    const globalKey = "__vueuse_ssr_handlers__";
    _global$1[globalKey] = _global$1[globalKey] || {};
    function useCssVar(prop, target, { window: window2 = defaultWindow, initialValue = "" } = {}) {
      const variable = ref(initialValue);
      const elRef = computed(() => {
        var _a2;
        return unrefElement(target) || ((_a2 = window2 == null ? void 0 : window2.document) == null ? void 0 : _a2.documentElement);
      });
      watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => {
        var _a2;
        if (el && window2) {
          const value = (_a2 = window2.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a2.trim();
          variable.value = value || initialValue;
        }
      }, { immediate: true });
      watch(variable, (val) => {
        var _a2;
        if ((_a2 = elRef.value) == null ? void 0 : _a2.style)
          elRef.value.style.setProperty(resolveUnref(prop), val);
      });
      return variable;
    }
    function useDocumentVisibility({ document: document2 = defaultDocument } = {}) {
      if (!document2)
        return ref("visible");
      const visibility2 = ref(document2.visibilityState);
      useEventListener(document2, "visibilitychange", () => {
        visibility2.value = document2.visibilityState;
      });
      return visibility2;
    }
    var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
    var __hasOwnProp$g = Object.prototype.hasOwnProperty;
    var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
    var __objRest$2 = (source, exclude) => {
      var target = {};
      for (var prop in source)
        if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
          target[prop] = source[prop];
      if (source != null && __getOwnPropSymbols$g)
        for (var prop of __getOwnPropSymbols$g(source)) {
          if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
            target[prop] = source[prop];
        }
      return target;
    };
    function useResizeObserver(target, callback, options = {}) {
      const _a2 = options, { window: window2 = defaultWindow } = _a2, observerOptions = __objRest$2(_a2, ["window"]);
      let observer;
      const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
      const cleanup = () => {
        if (observer) {
          observer.disconnect();
          observer = void 0;
        }
      };
      const stopWatch = watch(() => unrefElement(target), (el) => {
        cleanup();
        if (isSupported.value && window2 && el) {
          observer = new ResizeObserver(callback);
          observer.observe(el, observerOptions);
        }
      }, { immediate: true, flush: "post" });
      const stop2 = () => {
        cleanup();
        stopWatch();
      };
      tryOnScopeDispose(stop2);
      return {
        isSupported,
        stop: stop2
      };
    }
    function useElementBounding(target, options = {}) {
      const {
        reset = true,
        windowResize = true,
        windowScroll = true,
        immediate = true
      } = options;
      const height = ref(0);
      const bottom = ref(0);
      const left = ref(0);
      const right = ref(0);
      const top = ref(0);
      const width = ref(0);
      const x2 = ref(0);
      const y = ref(0);
      function update() {
        const el = unrefElement(target);
        if (!el) {
          if (reset) {
            height.value = 0;
            bottom.value = 0;
            left.value = 0;
            right.value = 0;
            top.value = 0;
            width.value = 0;
            x2.value = 0;
            y.value = 0;
          }
          return;
        }
        const rect = el.getBoundingClientRect();
        height.value = rect.height;
        bottom.value = rect.bottom;
        left.value = rect.left;
        right.value = rect.right;
        top.value = rect.top;
        width.value = rect.width;
        x2.value = rect.x;
        y.value = rect.y;
      }
      useResizeObserver(target, update);
      watch(() => unrefElement(target), (ele) => !ele && update());
      if (windowScroll)
        useEventListener("scroll", update, { capture: true, passive: true });
      if (windowResize)
        useEventListener("resize", update, { passive: true });
      tryOnMounted(() => {
        if (immediate)
          update();
      });
      return {
        height,
        bottom,
        left,
        right,
        top,
        width,
        x: x2,
        y,
        update
      };
    }
    var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
    var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
    var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
    var __objRest$1 = (source, exclude) => {
      var target = {};
      for (var prop in source)
        if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
          target[prop] = source[prop];
      if (source != null && __getOwnPropSymbols$8)
        for (var prop of __getOwnPropSymbols$8(source)) {
          if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
            target[prop] = source[prop];
        }
      return target;
    };
    function useMutationObserver(target, callback, options = {}) {
      const _a2 = options, { window: window2 = defaultWindow } = _a2, mutationOptions = __objRest$1(_a2, ["window"]);
      let observer;
      const isSupported = useSupported(() => window2 && "MutationObserver" in window2);
      const cleanup = () => {
        if (observer) {
          observer.disconnect();
          observer = void 0;
        }
      };
      const stopWatch = watch(() => unrefElement(target), (el) => {
        cleanup();
        if (isSupported.value && window2 && el) {
          observer = new MutationObserver(callback);
          observer.observe(el, mutationOptions);
        }
      }, { immediate: true });
      const stop2 = () => {
        cleanup();
        stopWatch();
      };
      tryOnScopeDispose(stop2);
      return {
        isSupported,
        stop: stop2
      };
    }
    var SwipeDirection;
    (function(SwipeDirection2) {
      SwipeDirection2["UP"] = "UP";
      SwipeDirection2["RIGHT"] = "RIGHT";
      SwipeDirection2["DOWN"] = "DOWN";
      SwipeDirection2["LEFT"] = "LEFT";
      SwipeDirection2["NONE"] = "NONE";
    })(SwipeDirection || (SwipeDirection = {}));
    var __defProp = Object.defineProperty;
    var __getOwnPropSymbols = Object.getOwnPropertySymbols;
    var __hasOwnProp = Object.prototype.hasOwnProperty;
    var __propIsEnum = Object.prototype.propertyIsEnumerable;
    var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
    var __spreadValues = (a2, b2) => {
      for (var prop in b2 || (b2 = {}))
        if (__hasOwnProp.call(b2, prop))
          __defNormalProp(a2, prop, b2[prop]);
      if (__getOwnPropSymbols)
        for (var prop of __getOwnPropSymbols(b2)) {
          if (__propIsEnum.call(b2, prop))
            __defNormalProp(a2, prop, b2[prop]);
        }
      return a2;
    };
    const _TransitionPresets = {
      easeInSine: [0.12, 0, 0.39, 0],
      easeOutSine: [0.61, 1, 0.88, 1],
      easeInOutSine: [0.37, 0, 0.63, 1],
      easeInQuad: [0.11, 0, 0.5, 0],
      easeOutQuad: [0.5, 1, 0.89, 1],
      easeInOutQuad: [0.45, 0, 0.55, 1],
      easeInCubic: [0.32, 0, 0.67, 0],
      easeOutCubic: [0.33, 1, 0.68, 1],
      easeInOutCubic: [0.65, 0, 0.35, 1],
      easeInQuart: [0.5, 0, 0.75, 0],
      easeOutQuart: [0.25, 1, 0.5, 1],
      easeInOutQuart: [0.76, 0, 0.24, 1],
      easeInQuint: [0.64, 0, 0.78, 0],
      easeOutQuint: [0.22, 1, 0.36, 1],
      easeInOutQuint: [0.83, 0, 0.17, 1],
      easeInExpo: [0.7, 0, 0.84, 0],
      easeOutExpo: [0.16, 1, 0.3, 1],
      easeInOutExpo: [0.87, 0, 0.13, 1],
      easeInCirc: [0.55, 0, 1, 0.45],
      easeOutCirc: [0, 0.55, 0.45, 1],
      easeInOutCirc: [0.85, 0, 0.15, 1],
      easeInBack: [0.36, 0, 0.66, -0.56],
      easeOutBack: [0.34, 1.56, 0.64, 1],
      easeInOutBack: [0.68, -0.6, 0.32, 1.6]
    };
    __spreadValues({
      linear: identity$1
    }, _TransitionPresets);
    function useVModel(props2, key, emit2, options = {}) {
      var _a2, _b2, _c2;
      const {
        clone: clone2 = false,
        passive = false,
        eventName,
        deep = false,
        defaultValue
      } = options;
      const vm = getCurrentInstance();
      const _emit = emit2 || (vm == null ? void 0 : vm.emit) || ((_a2 = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a2.bind(vm)) || ((_c2 = (_b2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b2.$emit) == null ? void 0 : _c2.bind(vm == null ? void 0 : vm.proxy));
      let event = eventName;
      if (!key) {
        {
          key = "modelValue";
        }
      }
      event = eventName || event || `update:${key.toString()}`;
      const cloneFn = (val) => !clone2 ? val : isFunction$2(clone2) ? clone2(val) : cloneFnJSON(val);
      const getValue2 = () => isDef$1(props2[key]) ? cloneFn(props2[key]) : defaultValue;
      if (passive) {
        const initialValue = getValue2();
        const proxy = ref(initialValue);
        watch(() => props2[key], (v4) => proxy.value = cloneFn(v4));
        watch(proxy, (v4) => {
          if (v4 !== props2[key] || deep)
            _emit(event, v4);
        }, { deep });
        return proxy;
      } else {
        return computed({
          get() {
            return getValue2();
          },
          set(value) {
            _emit(event, value);
          }
        });
      }
    }
    function useWindowFocus({ window: window2 = defaultWindow } = {}) {
      if (!window2)
        return ref(false);
      const focused = ref(window2.document.hasFocus());
      useEventListener(window2, "blur", () => {
        focused.value = false;
      });
      useEventListener(window2, "focus", () => {
        focused.value = true;
      });
      return focused;
    }
    function useWindowSize(options = {}) {
      const {
        window: window2 = defaultWindow,
        initialWidth = Infinity,
        initialHeight = Infinity,
        listenOrientation = true,
        includeScrollbar = true
      } = options;
      const width = ref(initialWidth);
      const height = ref(initialHeight);
      const update = () => {
        if (window2) {
          if (includeScrollbar) {
            width.value = window2.innerWidth;
            height.value = window2.innerHeight;
          } else {
            width.value = window2.document.documentElement.clientWidth;
            height.value = window2.document.documentElement.clientHeight;
          }
        }
      };
      update();
      tryOnMounted(update);
      useEventListener("resize", update, { passive: true });
      if (listenOrientation)
        useEventListener("orientationchange", update, { passive: true });
      return { width, height };
    }
    class ElementPlusError extends Error {
      constructor(m2) {
        super(m2);
        this.name = "ElementPlusError";
      }
    }
    function throwError$1(scope, m2) {
      throw new ElementPlusError(`[${scope}] ${m2}`);
    }
    function debugWarn(scope, message2) {
    }
    const initial = {
      current: 0
    };
    const zIndex$1 = ref(0);
    const defaultInitialZIndex = 2e3;
    const ZINDEX_INJECTION_KEY = Symbol("elZIndexContextKey");
    const zIndexContextKey = Symbol("zIndexContextKey");
    const useZIndex = (zIndexOverrides) => {
      const increasingInjection = getCurrentInstance() ? inject(ZINDEX_INJECTION_KEY, initial) : initial;
      const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0);
      const initialZIndex = computed(() => {
        const zIndexFromInjection = unref(zIndexInjection);
        return isNumber$2(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
      });
      const currentZIndex = computed(() => initialZIndex.value + zIndex$1.value);
      const nextZIndex = () => {
        increasingInjection.current++;
        zIndex$1.value = increasingInjection.current;
        return currentZIndex.value;
      };
      if (!isClient && !inject(ZINDEX_INJECTION_KEY)) ;
      return {
        initialZIndex,
        currentZIndex,
        nextZIndex
      };
    };
    var English = {
      name: "en",
      el: {
        breadcrumb: {
          label: "Breadcrumb"
        },
        colorpicker: {
          confirm: "OK",
          clear: "Clear",
          defaultLabel: "color picker",
          description: "current color is {color}. press enter to select a new color.",
          alphaLabel: "pick alpha value"
        },
        datepicker: {
          now: "Now",
          today: "Today",
          cancel: "Cancel",
          clear: "Clear",
          confirm: "OK",
          dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
          monthTablePrompt: "Use the arrow keys and enter to select the month",
          yearTablePrompt: "Use the arrow keys and enter to select the year",
          selectedDate: "Selected date",
          selectDate: "Select date",
          selectTime: "Select time",
          startDate: "Start Date",
          startTime: "Start Time",
          endDate: "End Date",
          endTime: "End Time",
          prevYear: "Previous Year",
          nextYear: "Next Year",
          prevMonth: "Previous Month",
          nextMonth: "Next Month",
          year: "",
          month1: "January",
          month2: "February",
          month3: "March",
          month4: "April",
          month5: "May",
          month6: "June",
          month7: "July",
          month8: "August",
          month9: "September",
          month10: "October",
          month11: "November",
          month12: "December",
          week: "week",
          weeks: {
            sun: "Sun",
            mon: "Mon",
            tue: "Tue",
            wed: "Wed",
            thu: "Thu",
            fri: "Fri",
            sat: "Sat"
          },
          weeksFull: {
            sun: "Sunday",
            mon: "Monday",
            tue: "Tuesday",
            wed: "Wednesday",
            thu: "Thursday",
            fri: "Friday",
            sat: "Saturday"
          },
          months: {
            jan: "Jan",
            feb: "Feb",
            mar: "Mar",
            apr: "Apr",
            may: "May",
            jun: "Jun",
            jul: "Jul",
            aug: "Aug",
            sep: "Sep",
            oct: "Oct",
            nov: "Nov",
            dec: "Dec"
          }
        },
        inputNumber: {
          decrease: "decrease number",
          increase: "increase number"
        },
        select: {
          loading: "Loading",
          noMatch: "No matching data",
          noData: "No data",
          placeholder: "Select"
        },
        mention: {
          loading: "Loading"
        },
        dropdown: {
          toggleDropdown: "Toggle Dropdown"
        },
        cascader: {
          noMatch: "No matching data",
          loading: "Loading",
          placeholder: "Select",
          noData: "No data"
        },
        pagination: {
          goto: "Go to",
          pagesize: "/page",
          total: "Total {total}",
          pageClassifier: "",
          page: "Page",
          prev: "Go to previous page",
          next: "Go to next page",
          currentPage: "page {pager}",
          prevPages: "Previous {pager} pages",
          nextPages: "Next {pager} pages",
          deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
        },
        dialog: {
          close: "Close this dialog"
        },
        drawer: {
          close: "Close this dialog"
        },
        messagebox: {
          title: "Message",
          confirm: "OK",
          cancel: "Cancel",
          error: "Illegal input",
          close: "Close this dialog"
        },
        upload: {
          deleteTip: "press delete to remove",
          delete: "Delete",
          preview: "Preview",
          continue: "Continue"
        },
        slider: {
          defaultLabel: "slider between {min} and {max}",
          defaultRangeStartLabel: "pick start value",
          defaultRangeEndLabel: "pick end value"
        },
        table: {
          emptyText: "No Data",
          confirmFilter: "Confirm",
          resetFilter: "Reset",
          clearFilter: "All",
          sumText: "Sum"
        },
        tour: {
          next: "Next",
          previous: "Previous",
          finish: "Finish"
        },
        tree: {
          emptyText: "No Data"
        },
        transfer: {
          noMatch: "No matching data",
          noData: "No data",
          titles: ["List 1", "List 2"],
          filterPlaceholder: "Enter keyword",
          noCheckedFormat: "{total} items",
          hasCheckedFormat: "{checked}/{total} checked"
        },
        image: {
          error: "FAILED"
        },
        pageHeader: {
          title: "Back"
        },
        popconfirm: {
          confirmButtonText: "Yes",
          cancelButtonText: "No"
        },
        carousel: {
          leftArrow: "Carousel arrow left",
          rightArrow: "Carousel arrow right",
          indicator: "Carousel switch to index {index}"
        }
      }
    };
    const buildTranslator = (locale) => (path, option) => translate$1(path, option, unref(locale));
    const translate$1 = (path, option, locale) => get$1(locale, path, path).replace(/\{(\w+)\}/g, (_2, key) => {
      var _a2;
      return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`;
    });
    const buildLocaleContext = (locale) => {
      const lang = computed(() => unref(locale).name);
      const localeRef = isRef(locale) ? locale : ref(locale);
      return {
        lang,
        locale: localeRef,
        t: buildTranslator(locale)
      };
    };
    const localeContextKey = Symbol("localeContextKey");
    const useLocale = (localeOverrides) => {
      const locale = localeOverrides || inject(localeContextKey, ref());
      return buildLocaleContext(computed(() => locale.value || English));
    };
    const epPropKey = "__epPropKey";
    const definePropType = (val) => val;
    const isEpProp = (val) => isObject$7(val) && !!val[epPropKey];
    const buildProp = (prop, key) => {
      if (!isObject$7(prop) || isEpProp(prop))
        return prop;
      const { values, required, default: defaultValue, type, validator: validator2 } = prop;
      const _validator = values || validator2 ? (val) => {
        let valid = false;
        let allowedValues = [];
        if (values) {
          allowedValues = Array.from(values);
          if (hasOwn$1(prop, "default")) {
            allowedValues.push(defaultValue);
          }
          valid || (valid = allowedValues.includes(val));
        }
        if (validator2)
          valid || (valid = validator2(val));
        if (!valid && allowedValues.length > 0) {
          const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
          warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
        }
        return valid;
      } : void 0;
      const epProp = {
        type,
        required: !!required,
        validator: _validator,
        [epPropKey]: true
      };
      if (hasOwn$1(prop, "default"))
        epProp.default = defaultValue;
      return epProp;
    };
    const buildProps = (props2) => fromPairs(Object.entries(props2).map(([key, option]) => [
      key,
      buildProp(option, key)
    ]));
    const componentSizes = ["", "default", "small", "large"];
    const useSizeProp = buildProp({
      type: String,
      values: componentSizes,
      required: false
    });
    const SIZE_INJECTION_KEY = Symbol("size");
    const useGlobalSize = () => {
      const injectedSize = inject(SIZE_INJECTION_KEY, {});
      return computed(() => {
        return unref(injectedSize.size) || "";
      });
    };
    const emptyValuesContextKey = Symbol("emptyValuesContextKey");
    const DEFAULT_EMPTY_VALUES = ["", void 0, null];
    const DEFAULT_VALUE_ON_CLEAR = void 0;
    const useEmptyValuesProps = buildProps({
      emptyValues: Array,
      valueOnClear: {
        type: [String, Number, Boolean, Function],
        default: void 0,
        validator: (val) => isFunction$4(val) ? !val() : !val
      }
    });
    const useEmptyValues = (props2, defaultValue) => {
      const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
      const emptyValues = computed(() => props2.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES);
      const valueOnClear = computed(() => {
        if (isFunction$4(props2.valueOnClear)) {
          return props2.valueOnClear();
        } else if (props2.valueOnClear !== void 0) {
          return props2.valueOnClear;
        } else if (isFunction$4(config.value.valueOnClear)) {
          return config.value.valueOnClear();
        } else if (config.value.valueOnClear !== void 0) {
          return config.value.valueOnClear;
        }
        return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR;
      });
      const isEmptyValue2 = (value) => {
        return emptyValues.value.includes(value);
      };
      if (!emptyValues.value.includes(valueOnClear.value)) ;
      return {
        emptyValues,
        valueOnClear,
        isEmptyValue: isEmptyValue2
      };
    };
    const keysOf = (arr) => Object.keys(arr);
    const entriesOf = (arr) => Object.entries(arr);
    const getProp = (obj, path, defaultValue) => {
      return {
        get value() {
          return get$1(obj, path, defaultValue);
        },
        set value(val) {
          set$2(obj, path, val);
        }
      };
    };
    const globalConfig = ref();
    function useGlobalConfig(key, defaultValue = void 0) {
      const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
      if (key) {
        return computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = config.value) == null ? void 0 : _a2[key]) != null ? _b2 : defaultValue;
        });
      } else {
        return config;
      }
    }
    function useGlobalComponentSettings(block, sizeFallback) {
      const config = useGlobalConfig();
      const ns = useNamespace(block, computed(() => {
        var _a2;
        return ((_a2 = config.value) == null ? void 0 : _a2.namespace) || defaultNamespace;
      }));
      const locale = useLocale(computed(() => {
        var _a2;
        return (_a2 = config.value) == null ? void 0 : _a2.locale;
      }));
      const zIndex2 = useZIndex(computed(() => {
        var _a2;
        return ((_a2 = config.value) == null ? void 0 : _a2.zIndex) || defaultInitialZIndex;
      }));
      const size = computed(() => {
        var _a2;
        return unref(sizeFallback) || ((_a2 = config.value) == null ? void 0 : _a2.size) || "";
      });
      provideGlobalConfig(computed(() => unref(config) || {}));
      return {
        ns,
        locale,
        zIndex: zIndex2,
        size
      };
    }
    const provideGlobalConfig = (config, app2, global2 = false) => {
      var _a2;
      const inSetup = !!getCurrentInstance();
      const oldConfig = inSetup ? useGlobalConfig() : void 0;
      const provideFn = (_a2 = app2 == null ? void 0 : app2.provide) != null ? _a2 : inSetup ? provide : void 0;
      if (!provideFn) {
        return;
      }
      const context = computed(() => {
        const cfg = unref(config);
        if (!(oldConfig == null ? void 0 : oldConfig.value))
          return cfg;
        return mergeConfig$2(oldConfig.value, cfg);
      });
      provideFn(configProviderContextKey, context);
      provideFn(localeContextKey, computed(() => context.value.locale));
      provideFn(namespaceContextKey, computed(() => context.value.namespace));
      provideFn(zIndexContextKey, computed(() => context.value.zIndex));
      provideFn(SIZE_INJECTION_KEY, {
        size: computed(() => context.value.size || "")
      });
      provideFn(emptyValuesContextKey, computed(() => ({
        emptyValues: context.value.emptyValues,
        valueOnClear: context.value.valueOnClear
      })));
      if (global2 || !globalConfig.value) {
        globalConfig.value = context.value;
      }
      return context;
    };
    const mergeConfig$2 = (a2, b2) => {
      const keys2 = [.../* @__PURE__ */ new Set([...keysOf(a2), ...keysOf(b2)])];
      const obj = {};
      for (const key of keys2) {
        obj[key] = b2[key] !== void 0 ? b2[key] : a2[key];
      }
      return obj;
    };
    const makeInstaller = (components = []) => {
      const install2 = (app2, options) => {
        if (app2[INSTALLED_KEY])
          return;
        app2[INSTALLED_KEY] = true;
        components.forEach((c2) => app2.use(c2));
        if (options)
          provideGlobalConfig(options, app2, true);
      };
      return {
        version,
        install: install2
      };
    };
    const UPDATE_MODEL_EVENT = "update:modelValue";
    const CHANGE_EVENT = "change";
    const INPUT_EVENT = "input";
    const affixProps = buildProps({
      zIndex: {
        type: definePropType([Number, String]),
        default: 100
      },
      target: {
        type: String,
        default: ""
      },
      offset: {
        type: Number,
        default: 0
      },
      position: {
        type: String,
        values: ["top", "bottom"],
        default: "top"
      }
    });
    const affixEmits = {
      scroll: ({ scrollTop, fixed }) => isNumber$2(scrollTop) && isBoolean$1(fixed),
      [CHANGE_EVENT]: (fixed) => isBoolean$1(fixed)
    };
    var _export_sfc = (sfc, props2) => {
      const target = sfc.__vccOpts || sfc;
      for (const [key, val] of props2) {
        target[key] = val;
      }
      return target;
    };
    function easeInOutCubic(t, b2, c2, d2) {
      const cc = c2 - b2;
      t /= d2 / 2;
      if (t < 1) {
        return cc / 2 * t * t * t + b2;
      }
      return cc / 2 * ((t -= 2) * t * t + 2) + b2;
    }
    const rAF = (fn2) => isClient ? window.requestAnimationFrame(fn2) : setTimeout(fn2, 16);
    const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
    const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
    const hasClass = (el, cls) => {
      if (!el || !cls)
        return false;
      if (cls.includes(" "))
        throw new Error("className should not contain space.");
      return el.classList.contains(cls);
    };
    const addClass = (el, cls) => {
      if (!el || !cls.trim())
        return;
      el.classList.add(...classNameToArray(cls));
    };
    const removeClass = (el, cls) => {
      if (!el || !cls.trim())
        return;
      el.classList.remove(...classNameToArray(cls));
    };
    const getStyle$1 = (element, styleName) => {
      var _a2;
      if (!isClient || !element || !styleName)
        return "";
      let key = camelize(styleName);
      if (key === "float")
        key = "cssFloat";
      try {
        const style = element.style[key];
        if (style)
          return style;
        const computed2 = (_a2 = document.defaultView) == null ? void 0 : _a2.getComputedStyle(element, "");
        return computed2 ? computed2[key] : "";
      } catch (e2) {
        return element.style[key];
      }
    };
    const setStyle = (element, styleName, value) => {
      if (!element || !styleName)
        return;
      if (isObject$7(styleName)) {
        entriesOf(styleName).forEach(([prop, value2]) => setStyle(element, prop, value2));
      } else {
        const key = camelize(styleName);
        element.style[key] = value;
      }
    };
    function addUnit(value, defaultUnit = "px") {
      if (!value)
        return "";
      if (isNumber$2(value) || isStringNumber(value)) {
        return `${value}${defaultUnit}`;
      } else if (isString$3(value)) {
        return value;
      }
    }
    const isScroll = (el, isVertical) => {
      if (!isClient)
        return false;
      const key = {
        undefined: "overflow",
        true: "overflow-y",
        false: "overflow-x"
      }[String(isVertical)];
      const overflow2 = getStyle$1(el, key);
      return ["scroll", "auto", "overlay"].some((s2) => overflow2.includes(s2));
    };
    const getScrollContainer = (el, isVertical) => {
      if (!isClient)
        return;
      let parent2 = el;
      while (parent2) {
        if ([window, document, document.documentElement].includes(parent2))
          return window;
        if (isScroll(parent2, isVertical))
          return parent2;
        parent2 = parent2.parentNode;
      }
      return parent2;
    };
    let scrollBarWidth;
    const getScrollBarWidth = (namespace) => {
      var _a2;
      if (!isClient)
        return 0;
      if (scrollBarWidth !== void 0)
        return scrollBarWidth;
      const outer = document.createElement("div");
      outer.className = `${namespace}-scrollbar__wrap`;
      outer.style.visibility = "hidden";
      outer.style.width = "100px";
      outer.style.position = "absolute";
      outer.style.top = "-9999px";
      document.body.appendChild(outer);
      const widthNoScroll = outer.offsetWidth;
      outer.style.overflow = "scroll";
      const inner2 = document.createElement("div");
      inner2.style.width = "100%";
      outer.appendChild(inner2);
      const widthWithScroll = inner2.offsetWidth;
      (_a2 = outer.parentNode) == null ? void 0 : _a2.removeChild(outer);
      scrollBarWidth = widthNoScroll - widthWithScroll;
      return scrollBarWidth;
    };
    function scrollIntoView(container, selected) {
      if (!isClient)
        return;
      if (!selected) {
        container.scrollTop = 0;
        return;
      }
      const offsetParents = [];
      let pointer = selected.offsetParent;
      while (pointer !== null && container !== pointer && container.contains(pointer)) {
        offsetParents.push(pointer);
        pointer = pointer.offsetParent;
      }
      const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
      const bottom = top + selected.offsetHeight;
      const viewRectTop = container.scrollTop;
      const viewRectBottom = viewRectTop + container.clientHeight;
      if (top < viewRectTop) {
        container.scrollTop = top;
      } else if (bottom > viewRectBottom) {
        container.scrollTop = bottom - container.clientHeight;
      }
    }
    function animateScrollTo(container, from, to, duration2, callback) {
      const startTime = Date.now();
      let handle;
      const scroll = () => {
        const timestamp = Date.now();
        const time2 = timestamp - startTime;
        const nextScrollTop = easeInOutCubic(time2 > duration2 ? duration2 : time2, from, to, duration2);
        if (isWindow(container)) {
          container.scrollTo(window.pageXOffset, nextScrollTop);
        } else {
          container.scrollTop = nextScrollTop;
        }
        if (time2 < duration2) {
          handle = rAF(scroll);
        } else if (isFunction$4(callback)) {
          callback();
        }
      };
      scroll();
      return () => {
        handle && cAF(handle);
      };
    }
    const getScrollElement = (target, container) => {
      if (isWindow(container)) {
        return target.ownerDocument.documentElement;
      }
      return container;
    };
    const getScrollTop = (container) => {
      if (isWindow(container)) {
        return window.scrollY;
      }
      return container.scrollTop;
    };
    const COMPONENT_NAME$p = "ElAffix";
    const __default__$1U = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$p
    });
    const _sfc_main$2F = /* @__PURE__ */ defineComponent({
      ...__default__$1U,
      props: affixProps,
      emits: affixEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("affix");
        const target = shallowRef();
        const root2 = shallowRef();
        const scrollContainer = shallowRef();
        const { height: windowHeight } = useWindowSize();
        const {
          height: rootHeight,
          width: rootWidth,
          top: rootTop,
          bottom: rootBottom,
          update: updateRoot
        } = useElementBounding(root2, { windowScroll: false });
        const targetRect = useElementBounding(target);
        const fixed = ref(false);
        const scrollTop = ref(0);
        const transform2 = ref(0);
        const rootStyle = computed(() => {
          return {
            height: fixed.value ? `${rootHeight.value}px` : "",
            width: fixed.value ? `${rootWidth.value}px` : ""
          };
        });
        const affixStyle = computed(() => {
          if (!fixed.value)
            return {};
          const offset2 = props2.offset ? addUnit(props2.offset) : 0;
          return {
            height: `${rootHeight.value}px`,
            width: `${rootWidth.value}px`,
            top: props2.position === "top" ? offset2 : "",
            bottom: props2.position === "bottom" ? offset2 : "",
            transform: transform2.value ? `translateY(${transform2.value}px)` : "",
            zIndex: props2.zIndex
          };
        });
        const update = () => {
          if (!scrollContainer.value)
            return;
          scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
          const { position: position2, target: target2, offset: offset2 } = props2;
          const rootHeightOffset = offset2 + rootHeight.value;
          if (position2 === "top") {
            if (target2) {
              const difference = targetRect.bottom.value - rootHeightOffset;
              fixed.value = offset2 > rootTop.value && targetRect.bottom.value > 0;
              transform2.value = difference < 0 ? difference : 0;
            } else {
              fixed.value = offset2 > rootTop.value;
            }
          } else if (target2) {
            const difference = windowHeight.value - targetRect.top.value - rootHeightOffset;
            fixed.value = windowHeight.value - offset2 < rootBottom.value && windowHeight.value > targetRect.top.value;
            transform2.value = difference < 0 ? -difference : 0;
          } else {
            fixed.value = windowHeight.value - offset2 < rootBottom.value;
          }
        };
        const handleScroll2 = async () => {
          updateRoot();
          await nextTick();
          emit2("scroll", {
            scrollTop: scrollTop.value,
            fixed: fixed.value
          });
        };
        watch(fixed, (val) => emit2(CHANGE_EVENT, val));
        onMounted(() => {
          var _a2;
          if (props2.target) {
            target.value = (_a2 = document.querySelector(props2.target)) != null ? _a2 : void 0;
            if (!target.value)
              throwError$1(COMPONENT_NAME$p, `Target does not exist: ${props2.target}`);
          } else {
            target.value = document.documentElement;
          }
          scrollContainer.value = getScrollContainer(root2.value, true);
          updateRoot();
        });
        useEventListener(scrollContainer, "scroll", handleScroll2);
        watchEffect(update);
        expose({
          update,
          updateRoot
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "root",
            ref: root2,
            class: normalizeClass(unref(ns).b()),
            style: normalizeStyle$1(unref(rootStyle))
          }, [
            createBaseVNode("div", {
              class: normalizeClass({ [unref(ns).m("fixed")]: fixed.value }),
              style: normalizeStyle$1(unref(affixStyle))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 6)
          ], 6);
        };
      }
    });
    var Affix = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__file", "affix.vue"]]);
    const withInstall = (main, extra) => {
      main.install = (app2) => {
        for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
          app2.component(comp.name, comp);
        }
      };
      if (extra) {
        for (const [key, comp] of Object.entries(extra)) {
          main[key] = comp;
        }
      }
      return main;
    };
    const withInstallFunction = (fn2, name) => {
      fn2.install = (app2) => {
        fn2._context = app2._context;
        app2.config.globalProperties[name] = fn2;
      };
      return fn2;
    };
    const withInstallDirective = (directive, name) => {
      directive.install = (app2) => {
        app2.directive(name, directive);
      };
      return directive;
    };
    const withNoopInstall = (component2) => {
      component2.install = NOOP;
      return component2;
    };
    const ElAffix = withInstall(Affix);
    const iconProps = buildProps({
      size: {
        type: definePropType([Number, String])
      },
      color: {
        type: String
      }
    });
    const __default__$1T = /* @__PURE__ */ defineComponent({
      name: "ElIcon",
      inheritAttrs: false
    });
    const _sfc_main$2E = /* @__PURE__ */ defineComponent({
      ...__default__$1T,
      props: iconProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("icon");
        const style = computed(() => {
          const { size, color: color2 } = props2;
          if (!size && !color2)
            return {};
          return {
            fontSize: isUndefined$1(size) ? void 0 : addUnit(size),
            "--color": color2
          };
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("i", mergeProps({
            class: unref(ns).b(),
            style: unref(style)
          }, _ctx.$attrs), [
            renderSlot(_ctx.$slots, "default")
          ], 16);
        };
      }
    });
    var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$2E, [["__file", "icon.vue"]]);
    const ElIcon = withInstall(Icon);
    /*! Element Plus Icons Vue v2.3.1 */
    var add_location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "AddLocation",
      __name: "add-location",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 384h96a32 32 0 1 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0z"
          })
        ]));
      }
    });
    var add_location_default = add_location_vue_vue_type_script_setup_true_lang_default;
    var aim_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Aim",
      __name: "aim",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"
          })
        ]));
      }
    });
    var aim_default = aim_vue_vue_type_script_setup_true_lang_default;
    var alarm_clock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "AlarmClock",
      __name: "alarm-clock",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 832a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m292.288 824.576 55.424 32-48 83.136a32 32 0 1 1-55.424-32zm439.424 0-55.424 32 48 83.136a32 32 0 1 0 55.424-32zM512 512h160a32 32 0 1 1 0 64H480a32 32 0 0 1-32-32V320a32 32 0 0 1 64 0zM90.496 312.256A160 160 0 0 1 312.32 90.496l-46.848 46.848a96 96 0 0 0-128 128L90.56 312.256zm835.264 0A160 160 0 0 0 704 90.496l46.848 46.848a96 96 0 0 1 128 128z"
          })
        ]));
      }
    });
    var alarm_clock_default = alarm_clock_vue_vue_type_script_setup_true_lang_default;
    var apple_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Apple",
      __name: "apple",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M599.872 203.776a189.44 189.44 0 0 1 64.384-4.672l2.624.128c31.168 1.024 51.2 4.096 79.488 16.32 37.632 16.128 74.496 45.056 111.488 89.344 96.384 115.264 82.752 372.8-34.752 521.728-7.68 9.728-32 41.6-30.72 39.936a426.624 426.624 0 0 1-30.08 35.776c-31.232 32.576-65.28 49.216-110.08 50.048-31.36.64-53.568-5.312-84.288-18.752l-6.528-2.88c-20.992-9.216-30.592-11.904-47.296-11.904-18.112 0-28.608 2.88-51.136 12.672l-6.464 2.816c-28.416 12.224-48.32 18.048-76.16 19.2-74.112 2.752-116.928-38.08-180.672-132.16-96.64-142.08-132.608-349.312-55.04-486.4 46.272-81.92 129.92-133.632 220.672-135.04 32.832-.576 60.288 6.848 99.648 22.72 27.136 10.88 34.752 13.76 37.376 14.272 16.256-20.16 27.776-36.992 34.56-50.24 13.568-26.304 27.2-59.968 40.704-100.8a32 32 0 1 1 60.8 20.224c-12.608 37.888-25.408 70.4-38.528 97.664zm-51.52 78.08c-14.528 17.792-31.808 37.376-51.904 58.816a32 32 0 1 1-46.72-43.776l12.288-13.248c-28.032-11.2-61.248-26.688-95.68-26.112-70.4 1.088-135.296 41.6-171.648 105.792C121.6 492.608 176 684.16 247.296 788.992c34.816 51.328 76.352 108.992 130.944 106.944 52.48-2.112 72.32-34.688 135.872-34.688 63.552 0 81.28 34.688 136.96 33.536 56.448-1.088 75.776-39.04 126.848-103.872 107.904-136.768 107.904-362.752 35.776-449.088-72.192-86.272-124.672-84.096-151.68-85.12-41.472-4.288-81.6 12.544-113.664 25.152z"
          })
        ]));
      }
    });
    var apple_default = apple_vue_vue_type_script_setup_true_lang_default;
    var arrow_down_bold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowDownBold",
      __name: "arrow-down-bold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M104.704 338.752a64 64 0 0 1 90.496 0l316.8 316.8 316.8-316.8a64 64 0 0 1 90.496 90.496L557.248 791.296a64 64 0 0 1-90.496 0L104.704 429.248a64 64 0 0 1 0-90.496z"
          })
        ]));
      }
    });
    var arrow_down_bold_default = arrow_down_bold_vue_vue_type_script_setup_true_lang_default;
    var arrow_down_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowDown",
      __name: "arrow-down",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
          })
        ]));
      }
    });
    var arrow_down_default = arrow_down_vue_vue_type_script_setup_true_lang_default;
    var arrow_left_bold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowLeftBold",
      __name: "arrow-left-bold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M685.248 104.704a64 64 0 0 1 0 90.496L368.448 512l316.8 316.8a64 64 0 0 1-90.496 90.496L232.704 557.248a64 64 0 0 1 0-90.496l362.048-362.048a64 64 0 0 1 90.496 0z"
          })
        ]));
      }
    });
    var arrow_left_bold_default = arrow_left_bold_vue_vue_type_script_setup_true_lang_default;
    var arrow_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowLeft",
      __name: "arrow-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
          })
        ]));
      }
    });
    var arrow_left_default = arrow_left_vue_vue_type_script_setup_true_lang_default;
    var arrow_right_bold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowRightBold",
      __name: "arrow-right-bold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M338.752 104.704a64 64 0 0 0 0 90.496l316.8 316.8-316.8 316.8a64 64 0 0 0 90.496 90.496l362.048-362.048a64 64 0 0 0 0-90.496L429.248 104.704a64 64 0 0 0-90.496 0z"
          })
        ]));
      }
    });
    var arrow_right_bold_default = arrow_right_bold_vue_vue_type_script_setup_true_lang_default;
    var arrow_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowRight",
      __name: "arrow-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
          })
        ]));
      }
    });
    var arrow_right_default = arrow_right_vue_vue_type_script_setup_true_lang_default;
    var arrow_up_bold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowUpBold",
      __name: "arrow-up-bold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M104.704 685.248a64 64 0 0 0 90.496 0l316.8-316.8 316.8 316.8a64 64 0 0 0 90.496-90.496L557.248 232.704a64 64 0 0 0-90.496 0L104.704 594.752a64 64 0 0 0 0 90.496z"
          })
        ]));
      }
    });
    var arrow_up_bold_default = arrow_up_bold_vue_vue_type_script_setup_true_lang_default;
    var arrow_up_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ArrowUp",
      __name: "arrow-up",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"
          })
        ]));
      }
    });
    var arrow_up_default = arrow_up_vue_vue_type_script_setup_true_lang_default;
    var avatar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Avatar",
      __name: "avatar",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0"
          })
        ]));
      }
    });
    var avatar_default = avatar_vue_vue_type_script_setup_true_lang_default;
    var back_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Back",
      __name: "back",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"
          })
        ]));
      }
    });
    var back_default = back_vue_vue_type_script_setup_true_lang_default;
    var baseball_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Baseball",
      __name: "baseball",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M195.2 828.8a448 448 0 1 1 633.6-633.6 448 448 0 0 1-633.6 633.6zm45.248-45.248a384 384 0 1 0 543.104-543.104 384 384 0 0 0-543.104 543.104"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M497.472 96.896c22.784 4.672 44.416 9.472 64.896 14.528a256.128 256.128 0 0 0 350.208 350.208c5.056 20.48 9.856 42.112 14.528 64.896A320.128 320.128 0 0 1 497.472 96.896zM108.48 491.904a320.128 320.128 0 0 1 423.616 423.68c-23.04-3.648-44.992-7.424-65.728-11.52a256.128 256.128 0 0 0-346.496-346.432 1736.64 1736.64 0 0 1-11.392-65.728z"
          })
        ]));
      }
    });
    var baseball_default = baseball_vue_vue_type_script_setup_true_lang_default;
    var basketball_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Basketball",
      __name: "basketball",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M778.752 788.224a382.464 382.464 0 0 0 116.032-245.632 256.512 256.512 0 0 0-241.728-13.952 762.88 762.88 0 0 1 125.696 259.584zm-55.04 44.224a699.648 699.648 0 0 0-125.056-269.632 256.128 256.128 0 0 0-56.064 331.968 382.72 382.72 0 0 0 181.12-62.336m-254.08 61.248A320.128 320.128 0 0 1 557.76 513.6a715.84 715.84 0 0 0-48.192-48.128 320.128 320.128 0 0 1-379.264 88.384 382.4 382.4 0 0 0 110.144 229.696 382.4 382.4 0 0 0 229.184 110.08zM129.28 481.088a256.128 256.128 0 0 0 331.072-56.448 699.648 699.648 0 0 0-268.8-124.352 382.656 382.656 0 0 0-62.272 180.8m106.56-235.84a762.88 762.88 0 0 1 258.688 125.056 256.512 256.512 0 0 0-13.44-241.088A382.464 382.464 0 0 0 235.84 245.248zm318.08-114.944c40.576 89.536 37.76 193.92-8.448 281.344a779.84 779.84 0 0 1 66.176 66.112 320.832 320.832 0 0 1 282.112-8.128 382.4 382.4 0 0 0-110.144-229.12 382.4 382.4 0 0 0-229.632-110.208zM828.8 828.8a448 448 0 1 1-633.6-633.6 448 448 0 0 1 633.6 633.6"
          })
        ]));
      }
    });
    var basketball_default = basketball_vue_vue_type_script_setup_true_lang_default;
    var bell_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "BellFilled",
      __name: "bell-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 832a128 128 0 0 1-256 0zm192-64H134.4a38.4 38.4 0 0 1 0-76.8H192V448c0-154.88 110.08-284.16 256.32-313.6a64 64 0 1 1 127.36 0A320.128 320.128 0 0 1 832 448v243.2h57.6a38.4 38.4 0 0 1 0 76.8z"
          })
        ]));
      }
    });
    var bell_filled_default = bell_filled_vue_vue_type_script_setup_true_lang_default;
    var bell_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Bell",
      __name: "bell",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a64 64 0 0 1 64 64v64H448v-64a64 64 0 0 1 64-64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 768h512V448a256 256 0 1 0-512 0zm256-640a320 320 0 0 1 320 320v384H192V448a320 320 0 0 1 320-320"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M96 768h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32m352 128h128a64 64 0 0 1-128 0"
          })
        ]));
      }
    });
    var bell_default = bell_vue_vue_type_script_setup_true_lang_default;
    var bicycle_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Bicycle",
      __name: "bicycle",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 672h320q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 832a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 192a32 32 0 0 1 0-64h160a32 32 0 0 1 31.04 24.256l96 384a32 32 0 0 1-62.08 15.488L615.04 192zM96 384a32 32 0 0 1 0-64h128a32 32 0 0 1 30.336 21.888l64 192a32 32 0 1 1-60.672 20.224L200.96 384z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m373.376 599.808-42.752-47.616 320-288 42.752 47.616z"
          })
        ]));
      }
    });
    var bicycle_default = bicycle_vue_vue_type_script_setup_true_lang_default;
    var bottom_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "BottomLeft",
      __name: "bottom-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 768h416a32 32 0 1 1 0 64H224a32 32 0 0 1-32-32V352a32 32 0 0 1 64 0z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M246.656 822.656a32 32 0 0 1-45.312-45.312l544-544a32 32 0 0 1 45.312 45.312l-544 544z"
          })
        ]));
      }
    });
    var bottom_left_default = bottom_left_vue_vue_type_script_setup_true_lang_default;
    var bottom_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "BottomRight",
      __name: "bottom-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 768a32 32 0 1 0 0 64h448a32 32 0 0 0 32-32V352a32 32 0 0 0-64 0v416z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M777.344 822.656a32 32 0 0 0 45.312-45.312l-544-544a32 32 0 0 0-45.312 45.312z"
          })
        ]));
      }
    });
    var bottom_right_default = bottom_right_vue_vue_type_script_setup_true_lang_default;
    var bottom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Bottom",
      __name: "bottom",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 805.888V168a32 32 0 1 0-64 0v637.888L246.656 557.952a30.72 30.72 0 0 0-45.312 0 35.52 35.52 0 0 0 0 48.064l288 306.048a30.72 30.72 0 0 0 45.312 0l288-306.048a35.52 35.52 0 0 0 0-48 30.72 30.72 0 0 0-45.312 0L544 805.824z"
          })
        ]));
      }
    });
    var bottom_default = bottom_vue_vue_type_script_setup_true_lang_default;
    var bowl_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Bowl",
      __name: "bowl",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M714.432 704a351.744 351.744 0 0 0 148.16-256H161.408a351.744 351.744 0 0 0 148.16 256zM288 766.592A415.68 415.68 0 0 1 96 416a32 32 0 0 1 32-32h768a32 32 0 0 1 32 32 415.68 415.68 0 0 1-192 350.592V832a64 64 0 0 1-64 64H352a64 64 0 0 1-64-64zM493.248 320h-90.496l254.4-254.4a32 32 0 1 1 45.248 45.248zm187.328 0h-128l269.696-155.712a32 32 0 0 1 32 55.424zM352 768v64h320v-64z"
          })
        ]));
      }
    });
    var bowl_default = bowl_vue_vue_type_script_setup_true_lang_default;
    var box_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Box",
      __name: "box",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M317.056 128 128 344.064V896h768V344.064L706.944 128zm-14.528-64h418.944a32 32 0 0 1 24.064 10.88l206.528 236.096A32 32 0 0 1 960 332.032V928a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V332.032a32 32 0 0 1 7.936-21.12L278.4 75.008A32 32 0 0 1 302.528 64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M64 320h896v64H64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 327.872V640h128V327.872L526.08 128h-28.16zM448 64h128l64 256v352a32 32 0 0 1-32 32H416a32 32 0 0 1-32-32V320z"
          })
        ]));
      }
    });
    var box_default = box_vue_vue_type_script_setup_true_lang_default;
    var briefcase_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Briefcase",
      __name: "briefcase",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M320 320V128h384v192h192v192H128V320zM128 576h768v320H128zm256-256h256.064V192H384z"
          })
        ]));
      }
    });
    var briefcase_default = briefcase_vue_vue_type_script_setup_true_lang_default;
    var brush_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "BrushFilled",
      __name: "brush-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M608 704v160a96 96 0 0 1-192 0V704h-96a128 128 0 0 1-128-128h640a128 128 0 0 1-128 128zM192 512V128.064h640V512z"
          })
        ]));
      }
    });
    var brush_filled_default = brush_filled_vue_vue_type_script_setup_true_lang_default;
    var brush_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Brush",
      __name: "brush",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M896 448H128v192a64 64 0 0 0 64 64h192v192h256V704h192a64 64 0 0 0 64-64zm-770.752-64c0-47.552 5.248-90.24 15.552-128 14.72-54.016 42.496-107.392 83.2-160h417.28l-15.36 70.336L736 96h211.2c-24.832 42.88-41.92 96.256-51.2 160a663.872 663.872 0 0 0-6.144 128H960v256a128 128 0 0 1-128 128H704v160a32 32 0 0 1-32 32H352a32 32 0 0 1-32-32V768H192A128 128 0 0 1 64 640V384h61.248zm64 0h636.544c-2.048-45.824.256-91.584 6.848-137.216 4.48-30.848 10.688-59.776 18.688-86.784h-96.64l-221.12 141.248L561.92 160H256.512c-25.856 37.888-43.776 75.456-53.952 112.832-8.768 32.064-13.248 69.12-13.312 111.168z"
          })
        ]));
      }
    });
    var brush_default = brush_vue_vue_type_script_setup_true_lang_default;
    var burger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Burger",
      __name: "burger",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 512a32 32 0 0 0-32 32v64a32 32 0 0 0 30.08 32H864a32 32 0 0 0 32-32v-64a32 32 0 0 0-32-32zm736-58.56A96 96 0 0 1 960 544v64a96 96 0 0 1-51.968 85.312L855.36 833.6a96 96 0 0 1-89.856 62.272H258.496A96 96 0 0 1 168.64 833.6l-52.608-140.224A96 96 0 0 1 64 608v-64a96 96 0 0 1 64-90.56V448a384 384 0 1 1 768 5.44M832 448a320 320 0 0 0-640 0zM512 704H188.352l40.192 107.136a32 32 0 0 0 29.952 20.736h507.008a32 32 0 0 0 29.952-20.736L835.648 704z"
          })
        ]));
      }
    });
    var burger_default = burger_vue_vue_type_script_setup_true_lang_default;
    var calendar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Calendar",
      __name: "calendar",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"
          })
        ]));
      }
    });
    var calendar_default = calendar_vue_vue_type_script_setup_true_lang_default;
    var camera_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CameraFilled",
      __name: "camera-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 224a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h704a64 64 0 0 0 64-64V288a64 64 0 0 0-64-64H748.416l-46.464-92.672A64 64 0 0 0 644.736 96H379.328a64 64 0 0 0-57.216 35.392L275.776 224zm352 435.2a115.2 115.2 0 1 0 0-230.4 115.2 115.2 0 0 0 0 230.4m0 140.8a256 256 0 1 1 0-512 256 256 0 0 1 0 512"
          })
        ]));
      }
    });
    var camera_filled_default = camera_filled_vue_vue_type_script_setup_true_lang_default;
    var camera_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Camera",
      __name: "camera",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"
          })
        ]));
      }
    });
    var camera_default = camera_vue_vue_type_script_setup_true_lang_default;
    var caret_bottom_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CaretBottom",
      __name: "caret-bottom",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m192 384 320 384 320-384z"
          })
        ]));
      }
    });
    var caret_bottom_default = caret_bottom_vue_vue_type_script_setup_true_lang_default;
    var caret_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CaretLeft",
      __name: "caret-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M672 192 288 511.936 672 832z"
          })
        ]));
      }
    });
    var caret_left_default = caret_left_vue_vue_type_script_setup_true_lang_default;
    var caret_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CaretRight",
      __name: "caret-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 192v640l384-320.064z"
          })
        ]));
      }
    });
    var caret_right_default = caret_right_vue_vue_type_script_setup_true_lang_default;
    var caret_top_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CaretTop",
      __name: "caret-top",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 320 192 704h639.936z"
          })
        ]));
      }
    });
    var caret_top_default = caret_top_vue_vue_type_script_setup_true_lang_default;
    var cellphone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Cellphone",
      __name: "cellphone",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 128a64 64 0 0 0-64 64v640a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h512a128 128 0 0 1 128 128v640a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V192A128 128 0 0 1 256 64m128 128h256a32 32 0 1 1 0 64H384a32 32 0 0 1 0-64m128 640a64 64 0 1 1 0-128 64 64 0 0 1 0 128"
          })
        ]));
      }
    });
    var cellphone_default = cellphone_vue_vue_type_script_setup_true_lang_default;
    var chat_dot_round_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatDotRound",
      __name: "chat-dot-round",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m174.72 855.68 135.296-45.12 23.68 11.84C388.096 849.536 448.576 864 512 864c211.84 0 384-166.784 384-352S723.84 160 512 160 128 326.784 128 512c0 69.12 24.96 139.264 70.848 199.232l22.08 28.8-46.272 115.584zm-45.248 82.56A32 32 0 0 1 89.6 896l58.368-145.92C94.72 680.32 64 596.864 64 512 64 299.904 256 96 512 96s448 203.904 448 416-192 416-448 416a461.056 461.056 0 0 1-206.912-48.384l-175.616 58.56z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 563.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4m-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4"
          })
        ]));
      }
    });
    var chat_dot_round_default = chat_dot_round_vue_vue_type_script_setup_true_lang_default;
    var chat_dot_square_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatDotSquare",
      __name: "chat-dot-square",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64v570.88zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 499.2a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4zm192 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4zm-384 0a51.2 51.2 0 1 1 0-102.4 51.2 51.2 0 0 1 0 102.4z"
          })
        ]));
      }
    });
    var chat_dot_square_default = chat_dot_square_vue_vue_type_script_setup_true_lang_default;
    var chat_line_round_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatLineRound",
      __name: "chat-line-round",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m174.72 855.68 135.296-45.12 23.68 11.84C388.096 849.536 448.576 864 512 864c211.84 0 384-166.784 384-352S723.84 160 512 160 128 326.784 128 512c0 69.12 24.96 139.264 70.848 199.232l22.08 28.8-46.272 115.584zm-45.248 82.56A32 32 0 0 1 89.6 896l58.368-145.92C94.72 680.32 64 596.864 64 512 64 299.904 256 96 512 96s448 203.904 448 416-192 416-448 416a461.056 461.056 0 0 1-206.912-48.384l-175.616 58.56z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 576h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m32-192h256q32 0 32 32t-32 32H384q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var chat_line_round_default = chat_line_round_vue_vue_type_script_setup_true_lang_default;
    var chat_line_square_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatLineSquare",
      __name: "chat-line-square",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 826.88 273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 512h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m0-192h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var chat_line_square_default = chat_line_square_vue_vue_type_script_setup_true_lang_default;
    var chat_round_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatRound",
      __name: "chat-round",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m174.72 855.68 130.048-43.392 23.424 11.392C382.4 849.984 444.352 864 512 864c223.744 0 384-159.872 384-352 0-192.832-159.104-352-384-352S128 319.168 128 512a341.12 341.12 0 0 0 69.248 204.288l21.632 28.8-44.16 110.528zm-45.248 82.56A32 32 0 0 1 89.6 896l56.512-141.248A405.12 405.12 0 0 1 64 512C64 299.904 235.648 96 512 96s448 203.904 448 416-173.44 416-448 416c-79.68 0-150.848-17.152-211.712-46.72l-170.88 56.96z"
          })
        ]));
      }
    });
    var chat_round_default = chat_round_vue_vue_type_script_setup_true_lang_default;
    var chat_square_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChatSquare",
      __name: "chat-square",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M273.536 736H800a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64H224a64 64 0 0 0-64 64v570.88zM296 800 147.968 918.4A32 32 0 0 1 96 893.44V256a128 128 0 0 1 128-128h576a128 128 0 0 1 128 128v416a128 128 0 0 1-128 128z"
          })
        ]));
      }
    });
    var chat_square_default = chat_square_vue_vue_type_script_setup_true_lang_default;
    var check_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Check",
      __name: "check",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
          })
        ]));
      }
    });
    var check_default = check_vue_vue_type_script_setup_true_lang_default;
    var checked_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Checked",
      __name: "checked",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 192h160v736H160V192h160.064v64H704zM311.616 537.28l-45.312 45.248L447.36 763.52l316.8-316.8-45.312-45.184L447.36 673.024zM384 192V96h256v96z"
          })
        ]));
      }
    });
    var checked_default = checked_vue_vue_type_script_setup_true_lang_default;
    var cherry_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Cherry",
      __name: "cherry",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M261.056 449.6c13.824-69.696 34.88-128.96 63.36-177.728 23.744-40.832 61.12-88.64 112.256-143.872H320a32 32 0 0 1 0-64h384a32 32 0 1 1 0 64H554.752c14.912 39.168 41.344 86.592 79.552 141.76 47.36 68.48 84.8 106.752 106.304 114.304a224 224 0 1 1-84.992 14.784c-22.656-22.912-47.04-53.76-73.92-92.608-38.848-56.128-67.008-105.792-84.352-149.312-55.296 58.24-94.528 107.52-117.76 147.2-23.168 39.744-41.088 88.768-53.568 147.072a224.064 224.064 0 1 1-64.96-1.6zM288 832a160 160 0 1 0 0-320 160 160 0 0 0 0 320m448-64a160 160 0 1 0 0-320 160 160 0 0 0 0 320"
          })
        ]));
      }
    });
    var cherry_default = cherry_vue_vue_type_script_setup_true_lang_default;
    var chicken_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Chicken",
      __name: "chicken",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M349.952 716.992 478.72 588.16a106.688 106.688 0 0 1-26.176-19.072 106.688 106.688 0 0 1-19.072-26.176L304.704 671.744c.768 3.072 1.472 6.144 2.048 9.216l2.048 31.936 31.872 1.984c3.136.64 6.208 1.28 9.28 2.112zm57.344 33.152a128 128 0 1 1-216.32 114.432l-1.92-32-32-1.92a128 128 0 1 1 114.432-216.32L416.64 469.248c-2.432-101.44 58.112-239.104 149.056-330.048 107.328-107.328 231.296-85.504 316.8 0 85.44 85.44 107.328 209.408 0 316.8-91.008 90.88-228.672 151.424-330.112 149.056L407.296 750.08zm90.496-226.304c49.536 49.536 233.344-7.04 339.392-113.088 78.208-78.208 63.232-163.072 0-226.304-63.168-63.232-148.032-78.208-226.24 0C504.896 290.496 448.32 474.368 497.792 523.84M244.864 708.928a64 64 0 1 0-59.84 59.84l56.32-3.52zm8.064 127.68a64 64 0 1 0 59.84-59.84l-56.32 3.52-3.52 56.32z"
          })
        ]));
      }
    });
    var chicken_default = chicken_vue_vue_type_script_setup_true_lang_default;
    var chrome_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ChromeFilled",
      __name: "chrome-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M938.67 512.01c0-44.59-6.82-87.6-19.54-128H682.67a212.372 212.372 0 0 1 42.67 128c.06 38.71-10.45 76.7-30.42 109.87l-182.91 316.8c235.65-.01 426.66-191.02 426.66-426.67z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M576.79 401.63a127.92 127.92 0 0 0-63.56-17.6c-22.36-.22-44.39 5.43-63.89 16.38s-35.79 26.82-47.25 46.02a128.005 128.005 0 0 0-2.16 127.44l1.24 2.13a127.906 127.906 0 0 0 46.36 46.61 127.907 127.907 0 0 0 63.38 17.44c22.29.2 44.24-5.43 63.68-16.33a127.94 127.94 0 0 0 47.16-45.79v-.01l1.11-1.92a127.984 127.984 0 0 0 .29-127.46 127.957 127.957 0 0 0-46.36-46.91"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M394.45 333.96A213.336 213.336 0 0 1 512 298.67h369.58A426.503 426.503 0 0 0 512 85.34a425.598 425.598 0 0 0-171.74 35.98 425.644 425.644 0 0 0-142.62 102.22l118.14 204.63a213.397 213.397 0 0 1 78.67-94.21m117.56 604.72H512zm-97.25-236.73a213.284 213.284 0 0 1-89.54-86.81L142.48 298.6c-36.35 62.81-57.13 135.68-57.13 213.42 0 203.81 142.93 374.22 333.95 416.55h.04l118.19-204.71a213.315 213.315 0 0 1-122.77-21.91z"
          })
        ]));
      }
    });
    var chrome_filled_default = chrome_filled_vue_vue_type_script_setup_true_lang_default;
    var circle_check_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CircleCheckFilled",
      __name: "circle-check-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
          })
        ]));
      }
    });
    var circle_check_filled_default = circle_check_filled_vue_vue_type_script_setup_true_lang_default;
    var circle_check_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CircleCheck",
      __name: "circle-check",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
          })
        ]));
      }
    });
    var circle_check_default = circle_check_vue_vue_type_script_setup_true_lang_default;
    var circle_close_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CircleCloseFilled",
      __name: "circle-close-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"
          })
        ]));
      }
    });
    var circle_close_filled_default = circle_close_filled_vue_vue_type_script_setup_true_lang_default;
    var circle_close_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CircleClose",
      __name: "circle-close",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          })
        ]));
      }
    });
    var circle_close_default = circle_close_vue_vue_type_script_setup_true_lang_default;
    var circle_plus_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CirclePlusFilled",
      __name: "circle-plus-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z"
          })
        ]));
      }
    });
    var circle_plus_filled_default = circle_plus_filled_vue_vue_type_script_setup_true_lang_default;
    var circle_plus_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CirclePlus",
      __name: "circle-plus",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 672V352a32 32 0 1 1 64 0v320a32 32 0 0 1-64 0"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          })
        ]));
      }
    });
    var circle_plus_default = circle_plus_vue_vue_type_script_setup_true_lang_default;
    var clock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Clock",
      __name: "clock",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var clock_default = clock_vue_vue_type_script_setup_true_lang_default;
    var close_bold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CloseBold",
      __name: "close-bold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z"
          })
        ]));
      }
    });
    var close_bold_default = close_bold_vue_vue_type_script_setup_true_lang_default;
    var close_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Close",
      __name: "close",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
          })
        ]));
      }
    });
    var close_default = close_vue_vue_type_script_setup_true_lang_default;
    var cloudy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Cloudy",
      __name: "cloudy",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M598.4 831.872H328.192a256 256 0 0 1-34.496-510.528A352 352 0 1 1 598.4 831.872m-271.36-64h272.256a288 288 0 1 0-248.512-417.664L335.04 381.44l-34.816 3.584a192 192 0 0 0 26.88 382.848z"
          })
        ]));
      }
    });
    var cloudy_default = cloudy_vue_vue_type_script_setup_true_lang_default;
    var coffee_cup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CoffeeCup",
      __name: "coffee-cup",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 192a192 192 0 1 1-8 383.808A256.128 256.128 0 0 1 512 768H320A256 256 0 0 1 64 512V160a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 64v256a128 128 0 1 0 0-256M96 832h640a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64m32-640v320a192 192 0 0 0 192 192h192a192 192 0 0 0 192-192V192z"
          })
        ]));
      }
    });
    var coffee_cup_default = coffee_cup_vue_vue_type_script_setup_true_lang_default;
    var coffee_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Coffee",
      __name: "coffee",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M822.592 192h14.272a32 32 0 0 1 31.616 26.752l21.312 128A32 32 0 0 1 858.24 384h-49.344l-39.04 546.304A32 32 0 0 1 737.92 960H285.824a32 32 0 0 1-32-29.696L214.912 384H165.76a32 32 0 0 1-31.552-37.248l21.312-128A32 32 0 0 1 187.136 192h14.016l-6.72-93.696A32 32 0 0 1 226.368 64h571.008a32 32 0 0 1 31.936 34.304zm-64.128 0 4.544-64H260.736l4.544 64h493.184m-548.16 128H820.48l-10.688-64H214.208l-10.688 64h6.784m68.736 64 36.544 512H708.16l36.544-512z"
          })
        ]));
      }
    });
    var coffee_default = coffee_vue_vue_type_script_setup_true_lang_default;
    var coin_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Coin",
      __name: "coin",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m161.92 580.736 29.888 58.88C171.328 659.776 160 681.728 160 704c0 82.304 155.328 160 352 160s352-77.696 352-160c0-22.272-11.392-44.16-31.808-64.32l30.464-58.432C903.936 615.808 928 657.664 928 704c0 129.728-188.544 224-416 224S96 833.728 96 704c0-46.592 24.32-88.576 65.92-123.264z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m161.92 388.736 29.888 58.88C171.328 467.84 160 489.792 160 512c0 82.304 155.328 160 352 160s352-77.696 352-160c0-22.272-11.392-44.16-31.808-64.32l30.464-58.432C903.936 423.808 928 465.664 928 512c0 129.728-188.544 224-416 224S96 641.728 96 512c0-46.592 24.32-88.576 65.92-123.264z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 544c-227.456 0-416-94.272-416-224S284.544 96 512 96s416 94.272 416 224-188.544 224-416 224m0-64c196.672 0 352-77.696 352-160S708.672 160 512 160s-352 77.696-352 160 155.328 160 352 160"
          })
        ]));
      }
    });
    var coin_default = coin_vue_vue_type_script_setup_true_lang_default;
    var cold_drink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ColdDrink",
      __name: "cold-drink",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 64a192 192 0 1 1-69.952 370.88L480 725.376V896h96a32 32 0 1 1 0 64H320a32 32 0 1 1 0-64h96V725.376L76.8 273.536a64 64 0 0 1-12.8-38.4v-10.688a32 32 0 0 1 32-32h71.808l-65.536-83.84a32 32 0 0 1 50.432-39.424l96.256 123.264h337.728A192.064 192.064 0 0 1 768 64M656.896 192.448H800a32 32 0 0 1 32 32v10.624a64 64 0 0 1-12.8 38.4l-80.448 107.2a128 128 0 1 0-81.92-188.16v-.064zm-357.888 64 129.472 165.76a32 32 0 0 1-50.432 39.36l-160.256-205.12H144l304 404.928 304-404.928z"
          })
        ]));
      }
    });
    var cold_drink_default = cold_drink_vue_vue_type_script_setup_true_lang_default;
    var collection_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CollectionTag",
      __name: "collection-tag",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 128v698.88l196.032-156.864a96 96 0 0 1 119.936 0L768 826.816V128zm-32-64h576a32 32 0 0 1 32 32v797.44a32 32 0 0 1-51.968 24.96L531.968 720a32 32 0 0 0-39.936 0L243.968 918.4A32 32 0 0 1 192 893.44V96a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var collection_tag_default = collection_tag_vue_vue_type_script_setup_true_lang_default;
    var collection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Collection",
      __name: "collection",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 736h640V128H256a64 64 0 0 0-64 64zm64-672h608a32 32 0 0 1 32 32v672a32 32 0 0 1-32 32H160l-32 57.536V192A128 128 0 0 1 256 64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M240 800a48 48 0 1 0 0 96h592v-96zm0-64h656v160a64 64 0 0 1-64 64H240a112 112 0 0 1 0-224m144-608v250.88l96-76.8 96 76.8V128zm-64-64h320v381.44a32 32 0 0 1-51.968 24.96L480 384l-108.032 86.4A32 32 0 0 1 320 445.44z"
          })
        ]));
      }
    });
    var collection_default = collection_vue_vue_type_script_setup_true_lang_default;
    var comment_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Comment",
      __name: "comment",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112m-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112M128 128v640h192v160l224-160h352V128z"
          })
        ]));
      }
    });
    var comment_default = comment_vue_vue_type_script_setup_true_lang_default;
    var compass_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Compass",
      __name: "compass",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M725.888 315.008C676.48 428.672 624 513.28 568.576 568.64c-55.424 55.424-139.968 107.904-253.568 157.312a12.8 12.8 0 0 1-16.896-16.832c49.536-113.728 102.016-198.272 157.312-253.632 55.36-55.296 139.904-107.776 253.632-157.312a12.8 12.8 0 0 1 16.832 16.832"
          })
        ]));
      }
    });
    var compass_default = compass_vue_vue_type_script_setup_true_lang_default;
    var connection_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Connection",
      __name: "connection",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 384v64H448a128 128 0 0 0-128 128v128a128 128 0 0 0 128 128h320a128 128 0 0 0 128-128V576a128 128 0 0 0-64-110.848V394.88c74.56 26.368 128 97.472 128 181.056v128a192 192 0 0 1-192 192H448a192 192 0 0 1-192-192V576a192 192 0 0 1 192-192z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 640v-64h192a128 128 0 0 0 128-128V320a128 128 0 0 0-128-128H256a128 128 0 0 0-128 128v128a128 128 0 0 0 64 110.848v70.272A192.064 192.064 0 0 1 64 448V320a192 192 0 0 1 192-192h320a192 192 0 0 1 192 192v128a192 192 0 0 1-192 192z"
          })
        ]));
      }
    });
    var connection_default = connection_vue_vue_type_script_setup_true_lang_default;
    var coordinate_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Coordinate",
      __name: "coordinate",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 512h64v320h-64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 896h640a64 64 0 0 0-64-64H256a64 64 0 0 0-64 64m64-128h512a128 128 0 0 1 128 128v64H128v-64a128 128 0 0 1 128-128m256-256a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512"
          })
        ]));
      }
    });
    var coordinate_default = coordinate_vue_vue_type_script_setup_true_lang_default;
    var copy_document_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CopyDocument",
      __name: "copy-document",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"
          })
        ]));
      }
    });
    var copy_document_default = copy_document_vue_vue_type_script_setup_true_lang_default;
    var cpu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Cpu",
      __name: "cpu",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M320 256a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h384a64 64 0 0 0 64-64V320a64 64 0 0 0-64-64zm0-64h384a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128H320a128 128 0 0 1-128-128V320a128 128 0 0 1 128-128"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m160 0a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m-320 0a32 32 0 0 1 32 32v128h-64V96a32 32 0 0 1 32-32m160 896a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32m160 0a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32m-320 0a32 32 0 0 1-32-32V800h64v128a32 32 0 0 1-32 32M64 512a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m0-160a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m0 320a32 32 0 0 1 32-32h128v64H96a32 32 0 0 1-32-32m896-160a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32m0-160a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32m0 320a32 32 0 0 1-32 32H800v-64h128a32 32 0 0 1 32 32"
          })
        ]));
      }
    });
    var cpu_default = cpu_vue_vue_type_script_setup_true_lang_default;
    var credit_card_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "CreditCard",
      __name: "credit-card",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M896 324.096c0-42.368-2.496-55.296-9.536-68.48a52.352 52.352 0 0 0-22.144-22.08c-13.12-7.04-26.048-9.536-68.416-9.536H228.096c-42.368 0-55.296 2.496-68.48 9.536a52.352 52.352 0 0 0-22.08 22.144c-7.04 13.12-9.536 26.048-9.536 68.416v375.808c0 42.368 2.496 55.296 9.536 68.48a52.352 52.352 0 0 0 22.144 22.08c13.12 7.04 26.048 9.536 68.416 9.536h567.808c42.368 0 55.296-2.496 68.48-9.536a52.352 52.352 0 0 0 22.08-22.144c7.04-13.12 9.536-26.048 9.536-68.416zm64 0v375.808c0 57.088-5.952 77.76-17.088 98.56-11.136 20.928-27.52 37.312-48.384 48.448-20.864 11.136-41.6 17.088-98.56 17.088H228.032c-57.088 0-77.76-5.952-98.56-17.088a116.288 116.288 0 0 1-48.448-48.384c-11.136-20.864-17.088-41.6-17.088-98.56V324.032c0-57.088 5.952-77.76 17.088-98.56 11.136-20.928 27.52-37.312 48.384-48.448 20.864-11.136 41.6-17.088 98.56-17.088H795.84c57.088 0 77.76 5.952 98.56 17.088 20.928 11.136 37.312 27.52 48.448 48.384 11.136 20.864 17.088 41.6 17.088 98.56z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M64 320h896v64H64zm0 128h896v64H64zm128 192h256v64H192z"
          })
        ]));
      }
    });
    var credit_card_default = credit_card_vue_vue_type_script_setup_true_lang_default;
    var crop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Crop",
      __name: "crop",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 768h672a32 32 0 1 1 0 64H224a32 32 0 0 1-32-32V96a32 32 0 0 1 64 0z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 224v704a32 32 0 1 1-64 0V256H96a32 32 0 0 1 0-64h704a32 32 0 0 1 32 32"
          })
        ]));
      }
    });
    var crop_default = crop_vue_vue_type_script_setup_true_lang_default;
    var d_arrow_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DArrowLeft",
      __name: "d-arrow-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224zm256 0a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224z"
          })
        ]));
      }
    });
    var d_arrow_left_default = d_arrow_left_vue_vue_type_script_setup_true_lang_default;
    var d_arrow_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DArrowRight",
      __name: "d-arrow-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L764.736 512 452.864 192a30.592 30.592 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L508.736 512 196.864 192a30.592 30.592 0 0 1 0-42.688z"
          })
        ]));
      }
    });
    var d_arrow_right_default = d_arrow_right_vue_vue_type_script_setup_true_lang_default;
    var d_caret_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DCaret",
      __name: "d-caret",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m512 128 288 320H224zM224 576h576L512 896z"
          })
        ]));
      }
    });
    var d_caret_default = d_caret_vue_vue_type_script_setup_true_lang_default;
    var data_analysis_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DataAnalysis",
      __name: "data-analysis",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m665.216 768 110.848 192h-73.856L591.36 768H433.024L322.176 960H248.32l110.848-192H160a32 32 0 0 1-32-32V192H64a32 32 0 0 1 0-64h896a32 32 0 1 1 0 64h-64v544a32 32 0 0 1-32 32zM832 192H192v512h640zM352 448a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0v-64a32 32 0 0 1 32-32m160-64a32 32 0 0 1 32 32v128a32 32 0 0 1-64 0V416a32 32 0 0 1 32-32m160-64a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V352a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var data_analysis_default = data_analysis_vue_vue_type_script_setup_true_lang_default;
    var data_board_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DataBoard",
      __name: "data-board",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M32 128h960v64H32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 192v512h640V192zm-64-64h768v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M322.176 960H248.32l144.64-250.56 55.424 32zm453.888 0h-73.856L576 741.44l55.424-32z"
          })
        ]));
      }
    });
    var data_board_default = data_board_vue_vue_type_script_setup_true_lang_default;
    var data_line_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DataLine",
      __name: "data-line",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M359.168 768H160a32 32 0 0 1-32-32V192H64a32 32 0 0 1 0-64h896a32 32 0 1 1 0 64h-64v544a32 32 0 0 1-32 32H665.216l110.848 192h-73.856L591.36 768H433.024L322.176 960H248.32zM832 192H192v512h640zM342.656 534.656a32 32 0 1 1-45.312-45.312L444.992 341.76l125.44 94.08L679.04 300.032a32 32 0 1 1 49.92 39.936L581.632 524.224 451.008 426.24 342.656 534.592z"
          })
        ]));
      }
    });
    var data_line_default = data_line_vue_vue_type_script_setup_true_lang_default;
    var delete_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DeleteFilled",
      __name: "delete-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 192V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64H96a32 32 0 0 1 0-64zm64 0h192v-64H416zM192 960a32 32 0 0 1-32-32V256h704v672a32 32 0 0 1-32 32zm224-192a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32m192 0a32 32 0 0 0 32-32V416a32 32 0 0 0-64 0v320a32 32 0 0 0 32 32"
          })
        ]));
      }
    });
    var delete_filled_default = delete_filled_vue_vue_type_script_setup_true_lang_default;
    var delete_location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DeleteLocation",
      __name: "delete-location",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 384h256q32 0 32 32t-32 32H384q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var delete_location_default = delete_location_vue_vue_type_script_setup_true_lang_default;
    var delete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Delete",
      __name: "delete",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
          })
        ]));
      }
    });
    var delete_default = delete_vue_vue_type_script_setup_true_lang_default;
    var dessert_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Dessert",
      __name: "dessert",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 416v-48a144 144 0 0 1 168.64-141.888 224.128 224.128 0 0 1 430.72 0A144 144 0 0 1 896 368v48a384 384 0 0 1-352 382.72V896h-64v-97.28A384 384 0 0 1 128 416m287.104-32.064h193.792a143.808 143.808 0 0 1 58.88-132.736 160.064 160.064 0 0 0-311.552 0 143.808 143.808 0 0 1 58.88 132.8zm-72.896 0a72 72 0 1 0-140.48 0h140.48m339.584 0h140.416a72 72 0 1 0-140.48 0zM512 736a320 320 0 0 0 318.4-288.064H193.6A320 320 0 0 0 512 736M384 896.064h256a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64"
          })
        ]));
      }
    });
    var dessert_default = dessert_vue_vue_type_script_setup_true_lang_default;
    var discount_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Discount",
      __name: "discount",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 704h576V318.336L552.512 115.84a64 64 0 0 0-81.024 0L224 318.336zm0 64v128h576V768zM593.024 66.304l259.2 212.096A32 32 0 0 1 864 303.168V928a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V303.168a32 32 0 0 1 11.712-24.768l259.2-212.096a128 128 0 0 1 162.112 0"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          })
        ]));
      }
    });
    var discount_default = discount_vue_vue_type_script_setup_true_lang_default;
    var dish_dot_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DishDot",
      __name: "dish-dot",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m384.064 274.56.064-50.688A128 128 0 0 1 512.128 96c70.528 0 127.68 57.152 127.68 127.68v50.752A448.192 448.192 0 0 1 955.392 768H68.544A448.192 448.192 0 0 1 384 274.56zM96 832h832a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64m32-128h768a384 384 0 1 0-768 0m447.808-448v-32.32a63.68 63.68 0 0 0-63.68-63.68 64 64 0 0 0-64 63.936V256z"
          })
        ]));
      }
    });
    var dish_dot_default = dish_dot_vue_vue_type_script_setup_true_lang_default;
    var dish_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Dish",
      __name: "dish",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 257.152V192h-96a32 32 0 0 1 0-64h256a32 32 0 1 1 0 64h-96v65.152A448 448 0 0 1 955.52 768H68.48A448 448 0 0 1 480 257.152M128 704h768a384 384 0 1 0-768 0M96 832h832a32 32 0 1 1 0 64H96a32 32 0 1 1 0-64"
          })
        ]));
      }
    });
    var dish_default = dish_vue_vue_type_script_setup_true_lang_default;
    var document_add_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DocumentAdd",
      __name: "document-add",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m320 512V448h64v128h128v64H544v128h-64V640H352v-64z"
          })
        ]));
      }
    });
    var document_add_default = document_add_vue_vue_type_script_setup_true_lang_default;
    var document_checked_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DocumentChecked",
      __name: "document-checked",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m318.4 582.144 180.992-180.992L704.64 510.4 478.4 736.64 320 578.304l45.248-45.312z"
          })
        ]));
      }
    });
    var document_checked_default = document_checked_vue_vue_type_script_setup_true_lang_default;
    var document_copy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DocumentCopy",
      __name: "document-copy",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"
          })
        ]));
      }
    });
    var document_copy_default = document_copy_vue_vue_type_script_setup_true_lang_default;
    var document_delete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DocumentDelete",
      __name: "document-delete",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m308.992 546.304-90.496-90.624 45.248-45.248 90.56 90.496 90.496-90.432 45.248 45.248-90.496 90.56 90.496 90.496-45.248 45.248-90.496-90.496-90.56 90.496-45.248-45.248 90.496-90.496z"
          })
        ]));
      }
    });
    var document_delete_default = document_delete_vue_vue_type_script_setup_true_lang_default;
    var document_remove_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "DocumentRemove",
      __name: "document-remove",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m192 512h320v64H352z"
          })
        ]));
      }
    });
    var document_remove_default = document_remove_vue_vue_type_script_setup_true_lang_default;
    var document_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Document",
      __name: "document",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
          })
        ]));
      }
    });
    var document_default = document_vue_vue_type_script_setup_true_lang_default;
    var download_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Download",
      __name: "download",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
          })
        ]));
      }
    });
    var download_default = download_vue_vue_type_script_setup_true_lang_default;
    var drizzling_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Drizzling",
      __name: "drizzling",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m739.328 291.328-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 97.28 78.72 175.936 175.808 175.936h400a192 192 0 0 0 35.776-380.672zM959.552 480a256 256 0 0 1-256 256h-400A239.808 239.808 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 959.552 480M288 800h64v64h-64zm192 0h64v64h-64zm-96 96h64v64h-64zm192 0h64v64h-64zm96-96h64v64h-64z"
          })
        ]));
      }
    });
    var drizzling_default = drizzling_vue_vue_type_script_setup_true_lang_default;
    var edit_pen_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "EditPen",
      __name: "edit-pen",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112-56.64 98.112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64h-448z"
          })
        ]));
      }
    });
    var edit_pen_default = edit_pen_vue_vue_type_script_setup_true_lang_default;
    var edit_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Edit",
      __name: "edit",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
          })
        ]));
      }
    });
    var edit_default = edit_vue_vue_type_script_setup_true_lang_default;
    var eleme_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ElemeFilled",
      __name: "eleme-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M176 64h672c61.824 0 112 50.176 112 112v672a112 112 0 0 1-112 112H176A112 112 0 0 1 64 848V176c0-61.824 50.176-112 112-112m150.528 173.568c-152.896 99.968-196.544 304.064-97.408 456.96a330.688 330.688 0 0 0 456.96 96.64c9.216-5.888 17.6-11.776 25.152-18.56a18.24 18.24 0 0 0 4.224-24.32L700.352 724.8a47.552 47.552 0 0 0-65.536-14.272A234.56 234.56 0 0 1 310.592 641.6C240 533.248 271.104 387.968 379.456 316.48a234.304 234.304 0 0 1 276.352 15.168c1.664.832 2.56 2.56 3.392 4.224 5.888 8.384 3.328 19.328-5.12 25.216L456.832 489.6a47.552 47.552 0 0 0-14.336 65.472l16 24.384c5.888 8.384 16.768 10.88 25.216 5.056l308.224-199.936a19.584 19.584 0 0 0 6.72-23.488v-.896c-4.992-9.216-10.048-17.6-15.104-26.88-99.968-151.168-304.064-194.88-456.96-95.744zM786.88 504.704l-62.208 40.32c-8.32 5.888-10.88 16.768-4.992 25.216L760 632.32c5.888 8.448 16.768 11.008 25.152 5.12l31.104-20.16a55.36 55.36 0 0 0 16-76.48l-20.224-31.04a19.52 19.52 0 0 0-25.152-5.12z"
          })
        ]));
      }
    });
    var eleme_filled_default = eleme_filled_vue_vue_type_script_setup_true_lang_default;
    var eleme_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Eleme",
      __name: "eleme",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M300.032 188.8c174.72-113.28 408-63.36 522.24 109.44 5.76 10.56 11.52 20.16 17.28 30.72v.96a22.4 22.4 0 0 1-7.68 26.88l-352.32 228.48c-9.6 6.72-22.08 3.84-28.8-5.76l-18.24-27.84a54.336 54.336 0 0 1 16.32-74.88l225.6-146.88c9.6-6.72 12.48-19.2 5.76-28.8-.96-1.92-1.92-3.84-3.84-4.8a267.84 267.84 0 0 0-315.84-17.28c-123.84 81.6-159.36 247.68-78.72 371.52a268.096 268.096 0 0 0 370.56 78.72 54.336 54.336 0 0 1 74.88 16.32l17.28 26.88c5.76 9.6 3.84 21.12-4.8 27.84-8.64 7.68-18.24 14.4-28.8 21.12a377.92 377.92 0 0 1-522.24-110.4c-113.28-174.72-63.36-408 111.36-522.24zm526.08 305.28a22.336 22.336 0 0 1 28.8 5.76l23.04 35.52a63.232 63.232 0 0 1-18.24 87.36l-35.52 23.04c-9.6 6.72-22.08 3.84-28.8-5.76l-46.08-71.04c-6.72-9.6-3.84-22.08 5.76-28.8l71.04-46.08z"
          })
        ]));
      }
    });
    var eleme_default = eleme_vue_vue_type_script_setup_true_lang_default;
    var element_plus_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ElementPlus",
      __name: "element-plus",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M839.7 734.7c0 33.3-17.9 41-17.9 41S519.7 949.8 499.2 960c-10.2 5.1-20.5 5.1-30.7 0 0 0-314.9-184.3-325.1-192-5.1-5.1-10.2-12.8-12.8-20.5V368.6c0-17.9 20.5-28.2 20.5-28.2L466 158.6c12.8-5.1 25.6-5.1 38.4 0 0 0 279 161.3 309.8 179.2 17.9 7.7 28.2 25.6 25.6 46.1-.1-5-.1 317.5-.1 350.8M714.2 371.2c-64-35.8-217.6-125.4-217.6-125.4-7.7-5.1-20.5-5.1-30.7 0L217.6 389.1s-17.9 10.2-17.9 23v297c0 5.1 5.1 12.8 7.7 17.9 7.7 5.1 256 148.5 256 148.5 7.7 5.1 17.9 5.1 25.6 0 15.4-7.7 250.9-145.9 250.9-145.9s12.8-5.1 12.8-30.7v-74.2l-276.5 169v-64c0-17.9 7.7-30.7 20.5-46.1L745 535c5.1-7.7 10.2-20.5 10.2-30.7v-66.6l-279 169v-69.1c0-15.4 5.1-30.7 17.9-38.4l220.1-128zM919 135.7c0-5.1-5.1-7.7-7.7-7.7h-58.9V66.6c0-5.1-5.1-5.1-10.2-5.1l-30.7 5.1c-5.1 0-5.1 2.6-5.1 5.1V128h-56.3c-5.1 0-5.1 5.1-7.7 5.1v38.4h69.1v64c0 5.1 5.1 5.1 10.2 5.1l30.7-5.1c5.1 0 5.1-2.6 5.1-5.1v-56.3h64l-2.5-38.4z"
          })
        ]));
      }
    });
    var element_plus_default = element_plus_vue_vue_type_script_setup_true_lang_default;
    var expand_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Expand",
      __name: "expand",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192h768v128H128zm0 256h512v128H128zm0 256h768v128H128zm576-352 192 160-192 128z"
          })
        ]));
      }
    });
    var expand_default = expand_vue_vue_type_script_setup_true_lang_default;
    var failed_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Failed",
      __name: "failed",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m557.248 608 135.744-135.744-45.248-45.248-135.68 135.744-135.808-135.68-45.248 45.184L466.752 608l-135.68 135.68 45.184 45.312L512 653.248l135.744 135.744 45.248-45.248L557.312 608zM704 192h160v736H160V192h160v64h384zm-320 0V96h256v96z"
          })
        ]));
      }
    });
    var failed_default = failed_vue_vue_type_script_setup_true_lang_default;
    var female_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Female",
      __name: "female",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 640a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 640q32 0 32 32v256q0 32-32 32t-32-32V672q0-32 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 800h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var female_default = female_vue_vue_type_script_setup_true_lang_default;
    var files_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Files",
      __name: "files",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 384v448h768V384zm-32-64h832a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32m64-128h704v64H160zm96-128h512v64H256z"
          })
        ]));
      }
    });
    var files_default = files_vue_vue_type_script_setup_true_lang_default;
    var film_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Film",
      __name: "film",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M320 288V128h64v352h256V128h64v160h160v64H704v128h160v64H704v128h160v64H704v160h-64V544H384v352h-64V736H128v-64h192V544H128v-64h192V352H128v-64z"
          })
        ]));
      }
    });
    var film_default = film_vue_vue_type_script_setup_true_lang_default;
    var filter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Filter",
      __name: "filter",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 523.392V928a32 32 0 0 0 46.336 28.608l192-96A32 32 0 0 0 640 832V523.392l280.768-343.104a32 32 0 1 0-49.536-40.576l-288 352A32 32 0 0 0 576 512v300.224l-128 64V512a32 32 0 0 0-7.232-20.288L195.52 192H704a32 32 0 1 0 0-64H128a32 32 0 0 0-24.768 52.288z"
          })
        ]));
      }
    });
    var filter_default = filter_vue_vue_type_script_setup_true_lang_default;
    var finished_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Finished",
      __name: "finished",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M280.768 753.728 691.456 167.04a32 32 0 1 1 52.416 36.672L314.24 817.472a32 32 0 0 1-45.44 7.296l-230.4-172.8a32 32 0 0 1 38.4-51.2l203.968 152.96zM736 448a32 32 0 1 1 0-64h192a32 32 0 1 1 0 64zM608 640a32 32 0 0 1 0-64h319.936a32 32 0 1 1 0 64zM480 832a32 32 0 1 1 0-64h447.936a32 32 0 1 1 0 64z"
          })
        ]));
      }
    });
    var finished_default = finished_vue_vue_type_script_setup_true_lang_default;
    var first_aid_kit_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FirstAidKit",
      __name: "first-aid-kit",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 256a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V320a64 64 0 0 0-64-64zm0-64h640a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H192A128 128 0 0 1 64 768V320a128 128 0 0 1 128-128"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 512h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96v-96a32 32 0 0 1 64 0zM352 128v64h320v-64zm-32-64h384a32 32 0 0 1 32 32v128a32 32 0 0 1-32 32H320a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var first_aid_kit_default = first_aid_kit_vue_vue_type_script_setup_true_lang_default;
    var flag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Flag",
      __name: "flag",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 128h608L736 384l160 256H288v320h-96V64h96z"
          })
        ]));
      }
    });
    var flag_default = flag_vue_vue_type_script_setup_true_lang_default;
    var fold_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Fold",
      __name: "fold",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M896 192H128v128h768zm0 256H384v128h512zm0 256H128v128h768zM320 384 128 512l192 128z"
          })
        ]));
      }
    });
    var fold_default = fold_vue_vue_type_script_setup_true_lang_default;
    var folder_add_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FolderAdd",
      __name: "folder-add",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m384 416V416h64v128h128v64H544v128h-64V608H352v-64z"
          })
        ]));
      }
    });
    var folder_add_default = folder_add_vue_vue_type_script_setup_true_lang_default;
    var folder_checked_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FolderChecked",
      __name: "folder-checked",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m414.08 502.144 180.992-180.992L736.32 494.4 510.08 720.64l-158.4-158.336 45.248-45.312z"
          })
        ]));
      }
    });
    var folder_checked_default = folder_checked_vue_vue_type_script_setup_true_lang_default;
    var folder_delete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FolderDelete",
      __name: "folder-delete",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m370.752 448-90.496-90.496 45.248-45.248L512 530.752l90.496-90.496 45.248 45.248L557.248 576l90.496 90.496-45.248 45.248L512 621.248l-90.496 90.496-45.248-45.248z"
          })
        ]));
      }
    });
    var folder_delete_default = folder_delete_vue_vue_type_script_setup_true_lang_default;
    var folder_opened_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FolderOpened",
      __name: "folder-opened",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"
          })
        ]));
      }
    });
    var folder_opened_default = folder_opened_vue_vue_type_script_setup_true_lang_default;
    var folder_remove_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FolderRemove",
      __name: "folder-remove",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m256 416h320v64H352z"
          })
        ]));
      }
    });
    var folder_remove_default = folder_remove_vue_vue_type_script_setup_true_lang_default;
    var folder_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Folder",
      __name: "folder",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var folder_default = folder_vue_vue_type_script_setup_true_lang_default;
    var food_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Food",
      __name: "food",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 352.576V352a288 288 0 0 1 491.072-204.224 192 192 0 0 1 274.24 204.48 64 64 0 0 1 57.216 74.24C921.6 600.512 850.048 710.656 736 756.992V800a96 96 0 0 1-96 96H384a96 96 0 0 1-96-96v-43.008c-114.048-46.336-185.6-156.48-214.528-330.496A64 64 0 0 1 128 352.64zm64-.576h64a160 160 0 0 1 320 0h64a224 224 0 0 0-448 0m128 0h192a96 96 0 0 0-192 0m439.424 0h68.544A128.256 128.256 0 0 0 704 192c-15.36 0-29.952 2.688-43.52 7.616 11.328 18.176 20.672 37.76 27.84 58.304A64.128 64.128 0 0 1 759.424 352M672 768H352v32a32 32 0 0 0 32 32h256a32 32 0 0 0 32-32zm-342.528-64h365.056c101.504-32.64 165.76-124.928 192.896-288H136.576c27.136 163.072 91.392 255.36 192.896 288"
          })
        ]));
      }
    });
    var food_default = food_vue_vue_type_script_setup_true_lang_default;
    var football_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Football",
      __name: "football",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896m0-64a384 384 0 1 0 0-768 384 384 0 0 0 0 768"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M186.816 268.288c16-16.384 31.616-31.744 46.976-46.08 17.472 30.656 39.808 58.112 65.984 81.28l-32.512 56.448a385.984 385.984 0 0 1-80.448-91.648zm653.696-5.312a385.92 385.92 0 0 1-83.776 96.96l-32.512-56.384a322.923 322.923 0 0 0 68.48-85.76c15.552 14.08 31.488 29.12 47.808 45.184zM465.984 445.248l11.136-63.104a323.584 323.584 0 0 0 69.76 0l11.136 63.104a387.968 387.968 0 0 1-92.032 0m-62.72-12.8A381.824 381.824 0 0 1 320 396.544l32-55.424a319.885 319.885 0 0 0 62.464 27.712l-11.2 63.488zm300.8-35.84a381.824 381.824 0 0 1-83.328 35.84l-11.2-63.552A319.885 319.885 0 0 0 672 341.184l32 55.424zm-520.768 364.8a385.92 385.92 0 0 1 83.968-97.28l32.512 56.32c-26.88 23.936-49.856 52.352-67.52 84.032-16-13.44-32.32-27.712-48.96-43.072zm657.536.128a1442.759 1442.759 0 0 1-49.024 43.072 321.408 321.408 0 0 0-67.584-84.16l32.512-56.32c33.216 27.456 61.696 60.352 84.096 97.408zM465.92 578.752a387.968 387.968 0 0 1 92.032 0l-11.136 63.104a323.584 323.584 0 0 0-69.76 0zm-62.72 12.8 11.2 63.552a319.885 319.885 0 0 0-62.464 27.712L320 627.392a381.824 381.824 0 0 1 83.264-35.84zm300.8 35.84-32 55.424a318.272 318.272 0 0 0-62.528-27.712l11.2-63.488c29.44 8.64 57.28 20.736 83.264 35.776z"
          })
        ]));
      }
    });
    var football_default = football_vue_vue_type_script_setup_true_lang_default;
    var fork_spoon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ForkSpoon",
      __name: "fork-spoon",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 410.304V96a32 32 0 0 1 64 0v314.304a96 96 0 0 0 64-90.56V96a32 32 0 0 1 64 0v223.744a160 160 0 0 1-128 156.8V928a32 32 0 1 1-64 0V476.544a160 160 0 0 1-128-156.8V96a32 32 0 0 1 64 0v223.744a96 96 0 0 0 64 90.56zM672 572.48C581.184 552.128 512 446.848 512 320c0-141.44 85.952-256 192-256s192 114.56 192 256c0 126.848-69.184 232.128-160 252.48V928a32 32 0 1 1-64 0zM704 512c66.048 0 128-82.56 128-192s-61.952-192-128-192-128 82.56-128 192 61.952 192 128 192"
          })
        ]));
      }
    });
    var fork_spoon_default = fork_spoon_vue_vue_type_script_setup_true_lang_default;
    var fries_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Fries",
      __name: "fries",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M608 224v-64a32 32 0 0 0-64 0v336h26.88A64 64 0 0 0 608 484.096zm101.12 160A64 64 0 0 0 672 395.904V384h64V224a32 32 0 1 0-64 0v160zm74.88 0a92.928 92.928 0 0 1 91.328 110.08l-60.672 323.584A96 96 0 0 1 720.32 896H303.68a96 96 0 0 1-94.336-78.336L148.672 494.08A92.928 92.928 0 0 1 240 384h-16V224a96 96 0 0 1 188.608-25.28A95.744 95.744 0 0 1 480 197.44V160a96 96 0 0 1 188.608-25.28A96 96 0 0 1 800 224v160zM670.784 512a128 128 0 0 1-99.904 48H453.12a128 128 0 0 1-99.84-48H352v-1.536a128.128 128.128 0 0 1-9.984-14.976L314.88 448H240a28.928 28.928 0 0 0-28.48 34.304L241.088 640h541.824l29.568-157.696A28.928 28.928 0 0 0 784 448h-74.88l-27.136 47.488A132.405 132.405 0 0 1 672 510.464V512zM480 288a32 32 0 0 0-64 0v196.096A64 64 0 0 0 453.12 496H480zm-128 96V224a32 32 0 0 0-64 0v160zh-37.12A64 64 0 0 1 352 395.904zm-98.88 320 19.072 101.888A32 32 0 0 0 303.68 832h416.64a32 32 0 0 0 31.488-26.112L770.88 704z"
          })
        ]));
      }
    });
    var fries_default = fries_vue_vue_type_script_setup_true_lang_default;
    var full_screen_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "FullScreen",
      __name: "full-screen",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
          })
        ]));
      }
    });
    var full_screen_default = full_screen_vue_vue_type_script_setup_true_lang_default;
    var goblet_full_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "GobletFull",
      __name: "goblet-full",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 320h512c0-78.592-12.608-142.4-36.928-192h-434.24C269.504 192.384 256 256.256 256 320m503.936 64H264.064a256.128 256.128 0 0 0 495.872 0zM544 638.4V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.4A320 320 0 0 1 192 320c0-85.632 21.312-170.944 64-256h512c42.688 64.32 64 149.632 64 256a320 320 0 0 1-288 318.4"
          })
        ]));
      }
    });
    var goblet_full_default = goblet_full_vue_vue_type_script_setup_true_lang_default;
    var goblet_square_full_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "GobletSquareFull",
      __name: "goblet-square-full",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 270.912c10.048 6.72 22.464 14.912 28.992 18.624a220.16 220.16 0 0 0 114.752 30.72c30.592 0 49.408-9.472 91.072-41.152l.64-.448c52.928-40.32 82.368-55.04 132.288-54.656 55.552.448 99.584 20.8 142.72 57.408l1.536 1.28V128H256v142.912zm.96 76.288C266.368 482.176 346.88 575.872 512 576c157.44.064 237.952-85.056 253.248-209.984a952.32 952.32 0 0 1-40.192-35.712c-32.704-27.776-63.36-41.92-101.888-42.24-31.552-.256-50.624 9.28-93.12 41.6l-.576.448c-52.096 39.616-81.024 54.208-129.792 54.208-54.784 0-100.48-13.376-142.784-37.056zM480 638.848C250.624 623.424 192 442.496 192 319.68V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v224c0 122.816-58.624 303.68-288 318.912V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96z"
          })
        ]));
      }
    });
    var goblet_square_full_default = goblet_square_full_vue_vue_type_script_setup_true_lang_default;
    var goblet_square_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "GobletSquare",
      __name: "goblet-square",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 638.912V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.848C250.624 623.424 192 442.496 192 319.68V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v224c0 122.816-58.624 303.68-288 318.912M256 319.68c0 149.568 80 256.192 256 256.256C688.128 576 768 469.568 768 320V128H256z"
          })
        ]));
      }
    });
    var goblet_square_default = goblet_square_vue_vue_type_script_setup_true_lang_default;
    var goblet_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Goblet",
      __name: "goblet",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 638.4V896h96a32 32 0 1 1 0 64H384a32 32 0 1 1 0-64h96V638.4A320 320 0 0 1 192 320c0-85.632 21.312-170.944 64-256h512c42.688 64.32 64 149.632 64 256a320 320 0 0 1-288 318.4M256 320a256 256 0 1 0 512 0c0-78.592-12.608-142.4-36.928-192h-434.24C269.504 192.384 256 256.256 256 320"
          })
        ]));
      }
    });
    var goblet_default = goblet_vue_vue_type_script_setup_true_lang_default;
    var gold_medal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "GoldMedal",
      __name: "gold-medal",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m772.13 452.84 53.86-351.81c1.32-10.01-1.17-18.68-7.49-26.02S804.35 64 795.01 64H228.99v-.01h-.06c-9.33 0-17.15 3.67-23.49 11.01s-8.83 16.01-7.49 26.02l53.87 351.89C213.54 505.73 193.59 568.09 192 640c2 90.67 33.17 166.17 93.5 226.5S421.33 957.99 512 960c90.67-2 166.17-33.17 226.5-93.5 60.33-60.34 91.49-135.83 93.5-226.5-1.59-71.94-21.56-134.32-59.87-187.16zM640.01 128h117.02l-39.01 254.02c-20.75-10.64-40.74-19.73-59.94-27.28-5.92-3-11.95-5.8-18.08-8.41V128h.01zM576 128v198.76c-13.18-2.58-26.74-4.43-40.67-5.55-8.07-.8-15.85-1.2-23.33-1.2-10.54 0-21.09.66-31.64 1.96a359.844 359.844 0 0 0-32.36 4.79V128zm-192 0h.04v218.3c-6.22 2.66-12.34 5.5-18.36 8.56-19.13 7.54-39.02 16.6-59.66 27.16L267.01 128zm308.99 692.99c-48 48-108.33 73-180.99 75.01-72.66-2.01-132.99-27.01-180.99-75.01S258.01 712.66 256 640c2.01-72.66 27.01-132.99 75.01-180.99 19.67-19.67 41.41-35.47 65.22-47.41 38.33-15.04 71.15-23.92 98.44-26.65 5.07-.41 10.2-.7 15.39-.88.63-.01 1.28-.03 1.91-.03.66 0 1.35.03 2.02.04 5.11.17 10.15.46 15.13.86 27.4 2.71 60.37 11.65 98.91 26.79 23.71 11.93 45.36 27.69 64.96 47.29 48 48 73 108.33 75.01 180.99-2.01 72.65-27.01 132.98-75.01 180.98z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 480H416v64h64v192h-64v64h192v-64h-64z"
          })
        ]));
      }
    });
    var gold_medal_default = gold_medal_vue_vue_type_script_setup_true_lang_default;
    var goods_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "GoodsFilled",
      __name: "goods-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 352h640l64 544H128zm128 224h64V448h-64zm320 0h64V448h-64zM384 288h-64a192 192 0 1 1 384 0h-64a128 128 0 1 0-256 0"
          })
        ]));
      }
    });
    var goods_filled_default = goods_filled_vue_vue_type_script_setup_true_lang_default;
    var goods_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Goods",
      __name: "goods",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M320 288v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4h131.072a32 32 0 0 1 31.808 28.8l57.6 576a32 32 0 0 1-31.808 35.2H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320zm64 0h256v-22.336C640 189.248 582.272 128 512 128c-70.272 0-128 61.248-128 137.664v22.4zm-64 64H217.92l-51.2 512h690.56l-51.264-512H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0z"
          })
        ]));
      }
    });
    var goods_default = goods_vue_vue_type_script_setup_true_lang_default;
    var grape_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Grape",
      __name: "grape",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 195.2a160 160 0 0 1 96 60.8 160 160 0 1 1 146.24 254.976 160 160 0 0 1-128 224 160 160 0 1 1-292.48 0 160 160 0 0 1-128-224A160 160 0 1 1 384 256a160 160 0 0 1 96-60.8V128h-64a32 32 0 0 1 0-64h192a32 32 0 0 1 0 64h-64zM512 448a96 96 0 1 0 0-192 96 96 0 0 0 0 192m-256 0a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128 224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128 224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128-224a96 96 0 1 0 0-192 96 96 0 0 0 0 192m128-224a96 96 0 1 0 0-192 96 96 0 0 0 0 192"
          })
        ]));
      }
    });
    var grape_default = grape_vue_vue_type_script_setup_true_lang_default;
    var grid_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Grid",
      __name: "grid",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 384v256H384V384zm64 0h192v256H704zm-64 512H384V704h256zm64 0V704h192v192zm-64-768v192H384V128zm64 0h192v192H704zM320 384v256H128V384zm0 512H128V704h192zm0-768v192H128V128z"
          })
        ]));
      }
    });
    var grid_default = grid_vue_vue_type_script_setup_true_lang_default;
    var guide_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Guide",
      __name: "guide",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 608h-64V416h64zm0 160v160a32 32 0 0 1-32 32H416a32 32 0 0 1-32-32V768h64v128h128V768zM384 608V416h64v192zm256-352h-64V128H448v128h-64V96a32 32 0 0 1 32-32h192a32 32 0 0 1 32 32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m220.8 256-71.232 80 71.168 80H768V256H220.8zm-14.4-64H800a32 32 0 0 1 32 32v224a32 32 0 0 1-32 32H206.4a32 32 0 0 1-23.936-10.752l-99.584-112a32 32 0 0 1 0-42.496l99.584-112A32 32 0 0 1 206.4 192m678.784 496-71.104 80H266.816V608h547.2l71.168 80zm-56.768-144H234.88a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h593.6a32 32 0 0 0 23.936-10.752l99.584-112a32 32 0 0 0 0-42.496l-99.584-112A32 32 0 0 0 828.48 544z"
          })
        ]));
      }
    });
    var guide_default = guide_vue_vue_type_script_setup_true_lang_default;
    var handbag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Handbag",
      __name: "handbag",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M887.01 264.99c-6-5.99-13.67-8.99-23.01-8.99H704c-1.34-54.68-20.01-100.01-56-136s-81.32-54.66-136-56c-54.68 1.34-100.01 20.01-136 56s-54.66 81.32-56 136H160c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.67-8.99 23.01v640c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V288c0-9.35-2.99-17.02-8.99-23.01M421.5 165.5c24.32-24.34 54.49-36.84 90.5-37.5 35.99.68 66.16 13.18 90.5 37.5s36.84 54.49 37.5 90.5H384c.68-35.99 13.18-66.16 37.5-90.5M832 896H192V320h128v128h64V320h256v128h64V320h128z"
          })
        ]));
      }
    });
    var handbag_default = handbag_vue_vue_type_script_setup_true_lang_default;
    var headset_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Headset",
      __name: "headset",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M896 529.152V512a384 384 0 1 0-768 0v17.152A128 128 0 0 1 320 640v128a128 128 0 1 1-256 0V512a448 448 0 1 1 896 0v256a128 128 0 1 1-256 0V640a128 128 0 0 1 192-110.848M896 640a64 64 0 0 0-128 0v128a64 64 0 0 0 128 0zm-768 0v128a64 64 0 0 0 128 0V640a64 64 0 1 0-128 0"
          })
        ]));
      }
    });
    var headset_default = headset_vue_vue_type_script_setup_true_lang_default;
    var help_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "HelpFilled",
      __name: "help-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M926.784 480H701.312A192.512 192.512 0 0 0 544 322.688V97.216A416.064 416.064 0 0 1 926.784 480m0 64A416.064 416.064 0 0 1 544 926.784V701.312A192.512 192.512 0 0 0 701.312 544zM97.28 544h225.472A192.512 192.512 0 0 0 480 701.312v225.472A416.064 416.064 0 0 1 97.216 544zm0-64A416.064 416.064 0 0 1 480 97.216v225.472A192.512 192.512 0 0 0 322.688 480H97.216z"
          })
        ]));
      }
    });
    var help_filled_default = help_filled_vue_vue_type_script_setup_true_lang_default;
    var help_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Help",
      __name: "help",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m759.936 805.248-90.944-91.008A254.912 254.912 0 0 1 512 768a254.912 254.912 0 0 1-156.992-53.76l-90.944 91.008A382.464 382.464 0 0 0 512 896c94.528 0 181.12-34.176 247.936-90.752m45.312-45.312A382.464 382.464 0 0 0 896 512c0-94.528-34.176-181.12-90.752-247.936l-91.008 90.944C747.904 398.4 768 452.864 768 512c0 59.136-20.096 113.6-53.76 156.992l91.008 90.944zm-45.312-541.184A382.464 382.464 0 0 0 512 128c-94.528 0-181.12 34.176-247.936 90.752l90.944 91.008A254.912 254.912 0 0 1 512 256c59.136 0 113.6 20.096 156.992 53.76l90.944-91.008zm-541.184 45.312A382.464 382.464 0 0 0 128 512c0 94.528 34.176 181.12 90.752 247.936l91.008-90.944A254.912 254.912 0 0 1 256 512c0-59.136 20.096-113.6 53.76-156.992zm417.28 394.496a194.56 194.56 0 0 0 22.528-22.528C686.912 602.56 704 559.232 704 512a191.232 191.232 0 0 0-67.968-146.56A191.296 191.296 0 0 0 512 320a191.232 191.232 0 0 0-146.56 67.968C337.088 421.44 320 464.768 320 512a191.232 191.232 0 0 0 67.968 146.56C421.44 686.912 464.768 704 512 704c47.296 0 90.56-17.088 124.032-45.44zM512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          })
        ]));
      }
    });
    var help_default = help_vue_vue_type_script_setup_true_lang_default;
    var hide_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Hide",
      __name: "hide",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
          })
        ]));
      }
    });
    var hide_default = hide_vue_vue_type_script_setup_true_lang_default;
    var histogram_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Histogram",
      __name: "histogram",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M416 896V128h192v768zm-288 0V448h192v448zm576 0V320h192v576z"
          })
        ]));
      }
    });
    var histogram_default = histogram_vue_vue_type_script_setup_true_lang_default;
    var home_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "HomeFilled",
      __name: "home-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 128 128 447.936V896h255.936V640H640v256h255.936V447.936z"
          })
        ]));
      }
    });
    var home_filled_default = home_filled_vue_vue_type_script_setup_true_lang_default;
    var hot_water_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "HotWater",
      __name: "hot-water",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M273.067 477.867h477.866V409.6H273.067zm0 68.266v51.2A187.733 187.733 0 0 0 460.8 785.067h102.4a187.733 187.733 0 0 0 187.733-187.734v-51.2H273.067zm-34.134-204.8h546.134a34.133 34.133 0 0 1 34.133 34.134v221.866a256 256 0 0 1-256 256H460.8a256 256 0 0 1-256-256V375.467a34.133 34.133 0 0 1 34.133-34.134zM512 34.133a34.133 34.133 0 0 1 34.133 34.134v170.666a34.133 34.133 0 0 1-68.266 0V68.267A34.133 34.133 0 0 1 512 34.133zM375.467 102.4a34.133 34.133 0 0 1 34.133 34.133v102.4a34.133 34.133 0 0 1-68.267 0v-102.4a34.133 34.133 0 0 1 34.134-34.133m273.066 0a34.133 34.133 0 0 1 34.134 34.133v102.4a34.133 34.133 0 1 1-68.267 0v-102.4a34.133 34.133 0 0 1 34.133-34.133M170.667 921.668h682.666a34.133 34.133 0 1 1 0 68.267H170.667a34.133 34.133 0 1 1 0-68.267z"
          })
        ]));
      }
    });
    var hot_water_default = hot_water_vue_vue_type_script_setup_true_lang_default;
    var house_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "House",
      __name: "house",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 413.952V896h640V413.952L512 147.328zM139.52 374.4l352-293.312a32 32 0 0 1 40.96 0l352 293.312A32 32 0 0 1 896 398.976V928a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V398.976a32 32 0 0 1 11.52-24.576"
          })
        ]));
      }
    });
    var house_default = house_vue_vue_type_script_setup_true_lang_default;
    var ice_cream_round_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "IceCreamRound",
      __name: "ice-cream-round",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m308.352 489.344 226.304 226.304a32 32 0 0 0 45.248 0L783.552 512A192 192 0 1 0 512 240.448L308.352 444.16a32 32 0 0 0 0 45.248zm135.744 226.304L308.352 851.392a96 96 0 0 1-135.744-135.744l135.744-135.744-45.248-45.248a96 96 0 0 1 0-135.808L466.752 195.2A256 256 0 0 1 828.8 557.248L625.152 760.96a96 96 0 0 1-135.808 0l-45.248-45.248zM398.848 670.4 353.6 625.152 217.856 760.896a32 32 0 0 0 45.248 45.248zm248.96-384.64a32 32 0 0 1 0 45.248L466.624 512a32 32 0 1 1-45.184-45.248l180.992-181.056a32 32 0 0 1 45.248 0zm90.496 90.496a32 32 0 0 1 0 45.248L557.248 602.496A32 32 0 1 1 512 557.248l180.992-180.992a32 32 0 0 1 45.312 0z"
          })
        ]));
      }
    });
    var ice_cream_round_default = ice_cream_round_vue_vue_type_script_setup_true_lang_default;
    var ice_cream_square_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "IceCreamSquare",
      __name: "ice-cream-square",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M416 640h256a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32H352a32 32 0 0 0-32 32v448a32 32 0 0 0 32 32zm192 64v160a96 96 0 0 1-192 0V704h-64a96 96 0 0 1-96-96V160a96 96 0 0 1 96-96h320a96 96 0 0 1 96 96v448a96 96 0 0 1-96 96zm-64 0h-64v160a32 32 0 1 0 64 0z"
          })
        ]));
      }
    });
    var ice_cream_square_default = ice_cream_square_vue_vue_type_script_setup_true_lang_default;
    var ice_cream_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "IceCream",
      __name: "ice-cream",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128.64 448a208 208 0 0 1 193.536-191.552 224 224 0 0 1 445.248 15.488A208.128 208.128 0 0 1 894.784 448H896L548.8 983.68a32 32 0 0 1-53.248.704L128 448zm64.256 0h286.208a144 144 0 0 0-286.208 0zm351.36 0h286.272a144 144 0 0 0-286.272 0zm-294.848 64 271.808 396.608L778.24 512H249.408zM511.68 352.64a207.872 207.872 0 0 1 189.184-96.192 160 160 0 0 0-314.752 5.632c52.608 12.992 97.28 46.08 125.568 90.56"
          })
        ]));
      }
    });
    var ice_cream_default = ice_cream_vue_vue_type_script_setup_true_lang_default;
    var ice_drink_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "IceDrink",
      __name: "ice-drink",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 448v128h239.68l16.064-128zm-64 0H256.256l16.064 128H448zm64-255.36V384h247.744A256.128 256.128 0 0 0 512 192.64m-64 8.064A256.448 256.448 0 0 0 264.256 384H448zm64-72.064A320.128 320.128 0 0 1 825.472 384H896a32 32 0 1 1 0 64h-64v1.92l-56.96 454.016A64 64 0 0 1 711.552 960H312.448a64 64 0 0 1-63.488-56.064L192 449.92V448h-64a32 32 0 0 1 0-64h70.528A320.384 320.384 0 0 1 448 135.04V96a96 96 0 0 1 96-96h128a32 32 0 1 1 0 64H544a32 32 0 0 0-32 32zM743.68 640H280.32l32.128 256h399.104z"
          })
        ]));
      }
    });
    var ice_drink_default = ice_drink_vue_vue_type_script_setup_true_lang_default;
    var ice_tea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "IceTea",
      __name: "ice-tea",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M197.696 259.648a320.128 320.128 0 0 1 628.608 0A96 96 0 0 1 896 352v64a96 96 0 0 1-71.616 92.864l-49.408 395.072A64 64 0 0 1 711.488 960H312.512a64 64 0 0 1-63.488-56.064l-49.408-395.072A96 96 0 0 1 128 416v-64a96 96 0 0 1 69.696-92.352M264.064 256h495.872a256.128 256.128 0 0 0-495.872 0m495.424 256H264.512l48 384h398.976zM224 448h576a32 32 0 0 0 32-32v-64a32 32 0 0 0-32-32H224a32 32 0 0 0-32 32v64a32 32 0 0 0 32 32m160 192h64v64h-64zm192 64h64v64h-64zm-128 64h64v64h-64zm64-192h64v64h-64z"
          })
        ]));
      }
    });
    var ice_tea_default = ice_tea_vue_vue_type_script_setup_true_lang_default;
    var info_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "InfoFilled",
      __name: "info-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"
          })
        ]));
      }
    });
    var info_filled_default = info_filled_vue_vue_type_script_setup_true_lang_default;
    var iphone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Iphone",
      __name: "iphone",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 768v96.064a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V768zm0-64h576V160a64 64 0 0 0-64-64H288a64 64 0 0 0-64 64zm32 288a96 96 0 0 1-96-96V128a96 96 0 0 1 96-96h512a96 96 0 0 1 96 96v768a96 96 0 0 1-96 96zm304-144a48 48 0 1 1-96 0 48 48 0 0 1 96 0"
          })
        ]));
      }
    });
    var iphone_default = iphone_vue_vue_type_script_setup_true_lang_default;
    var key_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Key",
      __name: "key",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 456.064V96a32 32 0 0 1 32-32.064L672 64a32 32 0 0 1 0 64H512v128h160a32 32 0 0 1 0 64H512v128a256 256 0 1 1-64 8.064M512 896a192 192 0 1 0 0-384 192 192 0 0 0 0 384"
          })
        ]));
      }
    });
    var key_default = key_vue_vue_type_script_setup_true_lang_default;
    var knife_fork_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "KnifeFork",
      __name: "knife-fork",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 410.56V96a32 32 0 0 1 64 0v314.56A96 96 0 0 0 384 320V96a32 32 0 0 1 64 0v224a160 160 0 0 1-128 156.8V928a32 32 0 1 1-64 0V476.8A160 160 0 0 1 128 320V96a32 32 0 0 1 64 0v224a96 96 0 0 0 64 90.56m384-250.24V544h126.72c-3.328-78.72-12.928-147.968-28.608-207.744-14.336-54.528-46.848-113.344-98.112-175.872zM640 608v320a32 32 0 1 1-64 0V64h64c85.312 89.472 138.688 174.848 160 256 21.312 81.152 32 177.152 32 288z"
          })
        ]));
      }
    });
    var knife_fork_default = knife_fork_vue_vue_type_script_setup_true_lang_default;
    var lightning_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Lightning",
      __name: "lightning",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 671.36v64.128A239.808 239.808 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 736 734.016v-64.768a192 192 0 0 0 3.328-377.92l-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 91.968 70.464 167.36 160.256 175.232z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M416 736a32 32 0 0 1-27.776-47.872l128-224a32 32 0 1 1 55.552 31.744L471.168 672H608a32 32 0 0 1 27.776 47.872l-128 224a32 32 0 1 1-55.68-31.744L552.96 736z"
          })
        ]));
      }
    });
    var lightning_default = lightning_vue_vue_type_script_setup_true_lang_default;
    var link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Link",
      __name: "link",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M715.648 625.152 670.4 579.904l90.496-90.56c75.008-74.944 85.12-186.368 22.656-248.896-62.528-62.464-173.952-52.352-248.96 22.656L444.16 353.6l-45.248-45.248 90.496-90.496c100.032-99.968 251.968-110.08 339.456-22.656 87.488 87.488 77.312 239.424-22.656 339.456l-90.496 90.496zm-90.496 90.496-90.496 90.496C434.624 906.112 282.688 916.224 195.2 828.8c-87.488-87.488-77.312-239.424 22.656-339.456l90.496-90.496 45.248 45.248-90.496 90.56c-75.008 74.944-85.12 186.368-22.656 248.896 62.528 62.464 173.952 52.352 248.96-22.656l90.496-90.496zm0-362.048 45.248 45.248L398.848 670.4 353.6 625.152z"
          })
        ]));
      }
    });
    var link_default = link_vue_vue_type_script_setup_true_lang_default;
    var list_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "List",
      __name: "list",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 192h160v736H160V192h160v64h384zM288 512h448v-64H288zm0 256h448v-64H288zm96-576V96h256v96z"
          })
        ]));
      }
    });
    var list_default = list_vue_vue_type_script_setup_true_lang_default;
    var loading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Loading",
      __name: "loading",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
          })
        ]));
      }
    });
    var loading_default = loading_vue_vue_type_script_setup_true_lang_default;
    var location_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "LocationFilled",
      __name: "location-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 928c23.936 0 117.504-68.352 192.064-153.152C803.456 661.888 864 535.808 864 416c0-189.632-155.84-320-352-320S160 226.368 160 416c0 120.32 60.544 246.4 159.936 359.232C394.432 859.84 488 928 512 928m0-435.2a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 140.8a204.8 204.8 0 1 1 0-409.6 204.8 204.8 0 0 1 0 409.6"
          })
        ]));
      }
    });
    var location_filled_default = location_filled_vue_vue_type_script_setup_true_lang_default;
    var location_information_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "LocationInformation",
      __name: "location-information",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 896h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 512a96 96 0 1 0 0-192 96 96 0 0 0 0 192m0 64a160 160 0 1 1 0-320 160 160 0 0 1 0 320"
          })
        ]));
      }
    });
    var location_information_default = location_information_vue_vue_type_script_setup_true_lang_default;
    var location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Location",
      __name: "location",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 512a96 96 0 1 0 0-192 96 96 0 0 0 0 192m0 64a160 160 0 1 1 0-320 160 160 0 0 1 0 320"
          })
        ]));
      }
    });
    var location_default = location_vue_vue_type_script_setup_true_lang_default;
    var lock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Lock",
      __name: "lock",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m192-160v-64a192 192 0 1 0-384 0v64zM512 64a256 256 0 0 1 256 256v128H256V320A256 256 0 0 1 512 64"
          })
        ]));
      }
    });
    var lock_default = lock_vue_vue_type_script_setup_true_lang_default;
    var lollipop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Lollipop",
      __name: "lollipop",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M513.28 448a64 64 0 1 1 76.544 49.728A96 96 0 0 0 768 448h64a160 160 0 0 1-320 0zm-126.976-29.696a256 256 0 1 0 43.52-180.48A256 256 0 0 1 832 448h-64a192 192 0 0 0-381.696-29.696m105.664 249.472L285.696 874.048a96 96 0 0 1-135.68-135.744l206.208-206.272a320 320 0 1 1 135.744 135.744zm-54.464-36.032a321.92 321.92 0 0 1-45.248-45.248L195.2 783.552a32 32 0 1 0 45.248 45.248l197.056-197.12z"
          })
        ]));
      }
    });
    var lollipop_default = lollipop_vue_vue_type_script_setup_true_lang_default;
    var magic_stick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MagicStick",
      __name: "magic-stick",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64h64v192h-64zm0 576h64v192h-64zM160 480v-64h192v64zm576 0v-64h192v64zM249.856 199.04l45.248-45.184L430.848 289.6 385.6 334.848 249.856 199.104zM657.152 606.4l45.248-45.248 135.744 135.744-45.248 45.248zM114.048 923.2 68.8 877.952l316.8-316.8 45.248 45.248zM702.4 334.848 657.152 289.6l135.744-135.744 45.248 45.248z"
          })
        ]));
      }
    });
    var magic_stick_default = magic_stick_vue_vue_type_script_setup_true_lang_default;
    var magnet_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Magnet",
      __name: "magnet",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 320V192H704v320a192 192 0 1 1-384 0V192H192v128h128v64H192v128a320 320 0 0 0 640 0V384H704v-64zM640 512V128h256v384a384 384 0 1 1-768 0V128h256v384a128 128 0 1 0 256 0"
          })
        ]));
      }
    });
    var magnet_default = magnet_vue_vue_type_script_setup_true_lang_default;
    var male_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Male",
      __name: "male",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M399.5 849.5a225 225 0 1 0 0-450 225 225 0 0 0 0 450m0 56.25a281.25 281.25 0 1 1 0-562.5 281.25 281.25 0 0 1 0 562.5m253.125-787.5h225q28.125 0 28.125 28.125T877.625 174.5h-225q-28.125 0-28.125-28.125t28.125-28.125"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M877.625 118.25q28.125 0 28.125 28.125v225q0 28.125-28.125 28.125T849.5 371.375v-225q0-28.125 28.125-28.125"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M604.813 458.9 565.1 419.131l292.613-292.668 39.825 39.824z"
          })
        ]));
      }
    });
    var male_default = male_vue_vue_type_script_setup_true_lang_default;
    var management_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Management",
      __name: "management",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M576 128v288l96-96 96 96V128h128v768H320V128zm-448 0h128v768H128z"
          })
        ]));
      }
    });
    var management_default = management_vue_vue_type_script_setup_true_lang_default;
    var map_location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MapLocation",
      __name: "map-location",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256m345.6 192L960 960H672v-64H352v64H64l102.4-256zm-68.928 0H235.328l-76.8 192h706.944z"
          })
        ]));
      }
    });
    var map_location_default = map_location_vue_vue_type_script_setup_true_lang_default;
    var medal_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Medal",
      __name: "medal",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M576 128H448v200a286.72 286.72 0 0 1 64-8c19.52 0 40.832 2.688 64 8zm64 0v219.648c24.448 9.088 50.56 20.416 78.4 33.92L757.44 128zm-256 0H266.624l39.04 253.568c27.84-13.504 53.888-24.832 78.336-33.92V128zM229.312 64h565.376a32 32 0 0 1 31.616 36.864L768 480c-113.792-64-199.104-96-256-96-56.896 0-142.208 32-256 96l-58.304-379.136A32 32 0 0 1 229.312 64"
          })
        ]));
      }
    });
    var medal_default = medal_vue_vue_type_script_setup_true_lang_default;
    var memo_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Memo",
      __name: "memo",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 320h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M887.01 72.99C881.01 67 873.34 64 864 64H160c-9.35 0-17.02 3-23.01 8.99C131 78.99 128 86.66 128 96v832c0 9.35 2.99 17.02 8.99 23.01S150.66 960 160 960h704c9.35 0 17.02-2.99 23.01-8.99S896 937.34 896 928V96c0-9.35-3-17.02-8.99-23.01M192 896V128h96v768zm640 0H352V128h480z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 512h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32m0 192h192c21.33 0 32-10.67 32-32s-10.67-32-32-32H480c-21.33 0-32 10.67-32 32s10.67 32 32 32"
          })
        ]));
      }
    });
    var memo_default = memo_vue_vue_type_script_setup_true_lang_default;
    var menu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Menu",
      __name: "menu",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"
          })
        ]));
      }
    });
    var menu_default = menu_vue_vue_type_script_setup_true_lang_default;
    var message_box_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MessageBox",
      __name: "message-box",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 384h448v64H288zm96-128h256v64H384zM131.456 512H384v128h256V512h252.544L721.856 192H302.144zM896 576H704v128H320V576H128v256h768zM275.776 128h472.448a32 32 0 0 1 28.608 17.664l179.84 359.552A32 32 0 0 1 960 519.552V864a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V519.552a32 32 0 0 1 3.392-14.336l179.776-359.552A32 32 0 0 1 275.776 128z"
          })
        ]));
      }
    });
    var message_box_default = message_box_vue_vue_type_script_setup_true_lang_default;
    var message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Message",
      __name: "message",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056"
          })
        ]));
      }
    });
    var message_default = message_vue_vue_type_script_setup_true_lang_default;
    var mic_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Mic",
      __name: "mic",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 704h160a64 64 0 0 0 64-64v-32h-96a32 32 0 0 1 0-64h96v-96h-96a32 32 0 0 1 0-64h96v-96h-96a32 32 0 0 1 0-64h96v-32a64 64 0 0 0-64-64H384a64 64 0 0 0-64 64v32h96a32 32 0 0 1 0 64h-96v96h96a32 32 0 0 1 0 64h-96v96h96a32 32 0 0 1 0 64h-96v32a64 64 0 0 0 64 64zm64 64v128h192a32 32 0 1 1 0 64H288a32 32 0 1 1 0-64h192V768h-96a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64h256a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128z"
          })
        ]));
      }
    });
    var mic_default = mic_vue_vue_type_script_setup_true_lang_default;
    var microphone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Microphone",
      __name: "microphone",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 128a128 128 0 0 0-128 128v256a128 128 0 1 0 256 0V256a128 128 0 0 0-128-128m0-64a192 192 0 0 1 192 192v256a192 192 0 1 1-384 0V256A192 192 0 0 1 512 64m-32 832v-64a288 288 0 0 1-288-288v-32a32 32 0 0 1 64 0v32a224 224 0 0 0 224 224h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64z"
          })
        ]));
      }
    });
    var microphone_default = microphone_vue_vue_type_script_setup_true_lang_default;
    var milk_tea_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MilkTea",
      __name: "milk-tea",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M416 128V96a96 96 0 0 1 96-96h128a32 32 0 1 1 0 64H512a32 32 0 0 0-32 32v32h320a96 96 0 0 1 11.712 191.296l-39.68 581.056A64 64 0 0 1 708.224 960H315.776a64 64 0 0 1-63.872-59.648l-39.616-581.056A96 96 0 0 1 224 128zM276.48 320l39.296 576h392.448l4.8-70.784a224.064 224.064 0 0 1 30.016-439.808L747.52 320zM224 256h576a32 32 0 1 0 0-64H224a32 32 0 0 0 0 64m493.44 503.872 21.12-309.12a160 160 0 0 0-21.12 309.12"
          })
        ]));
      }
    });
    var milk_tea_default = milk_tea_vue_vue_type_script_setup_true_lang_default;
    var minus_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Minus",
      __name: "minus",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
          })
        ]));
      }
    });
    var minus_default = minus_vue_vue_type_script_setup_true_lang_default;
    var money_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Money",
      __name: "money",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 640v192h640V384H768v-64h150.976c14.272 0 19.456 1.472 24.64 4.288a29.056 29.056 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64v493.952c0 14.272-1.472 19.456-4.288 24.64a29.056 29.056 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H233.024c-14.272 0-19.456-1.472-24.64-4.288a29.056 29.056 0 0 1-12.16-12.096c-2.688-5.184-4.224-10.368-4.224-24.576V640z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 192H128v448h640zm64-22.976v493.952c0 14.272-1.472 19.456-4.288 24.64a29.056 29.056 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H105.024c-14.272 0-19.456-1.472-24.64-4.288a29.056 29.056 0 0 1-12.16-12.096C65.536 682.432 64 677.248 64 663.04V169.024c0-14.272 1.472-19.456 4.288-24.64a29.056 29.056 0 0 1 12.096-12.16C85.568 129.536 90.752 128 104.96 128h685.952c14.272 0 19.456 1.472 24.64 4.288a29.056 29.056 0 0 1 12.16 12.096c2.752 5.184 4.224 10.368 4.224 24.64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 576a160 160 0 1 1 0-320 160 160 0 0 1 0 320m0-64a96 96 0 1 0 0-192 96 96 0 0 0 0 192"
          })
        ]));
      }
    });
    var money_default = money_vue_vue_type_script_setup_true_lang_default;
    var monitor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Monitor",
      __name: "monitor",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 768v128h192a32 32 0 1 1 0 64H288a32 32 0 1 1 0-64h192V768H192A128 128 0 0 1 64 640V256a128 128 0 0 1 128-128h640a128 128 0 0 1 128 128v384a128 128 0 0 1-128 128zM192 192a64 64 0 0 0-64 64v384a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V256a64 64 0 0 0-64-64z"
          })
        ]));
      }
    });
    var monitor_default = monitor_vue_vue_type_script_setup_true_lang_default;
    var moon_night_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MoonNight",
      __name: "moon-night",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 512a448 448 0 0 1 215.872-383.296A384 384 0 0 0 213.76 640h188.8A448.256 448.256 0 0 1 384 512M171.136 704a448 448 0 0 1 636.992-575.296A384 384 0 0 0 499.328 704h-328.32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M32 640h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m128 128h384a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m160 127.68 224 .256a32 32 0 0 1 32 32V928a32 32 0 0 1-32 32l-224-.384a32 32 0 0 1-32-32v-.064a32 32 0 0 1 32-32z"
          })
        ]));
      }
    });
    var moon_night_default = moon_night_vue_vue_type_script_setup_true_lang_default;
    var moon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Moon",
      __name: "moon",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M240.448 240.448a384 384 0 1 0 559.424 525.696 448 448 0 0 1-542.016-542.08 390.592 390.592 0 0 0-17.408 16.384zm181.056 362.048a384 384 0 0 0 525.632 16.384A448 448 0 1 1 405.056 76.8a384 384 0 0 0 16.448 525.696"
          })
        ]));
      }
    });
    var moon_default = moon_vue_vue_type_script_setup_true_lang_default;
    var more_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MoreFilled",
      __name: "more-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"
          })
        ]));
      }
    });
    var more_filled_default = more_filled_vue_vue_type_script_setup_true_lang_default;
    var more_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "More",
      __name: "more",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"
          })
        ]));
      }
    });
    var more_default = more_vue_vue_type_script_setup_true_lang_default;
    var mostly_cloudy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MostlyCloudy",
      __name: "mostly-cloudy",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M737.216 357.952 704 349.824l-11.776-32a192.064 192.064 0 0 0-367.424 23.04l-8.96 39.04-39.04 8.96A192.064 192.064 0 0 0 320 768h368a207.808 207.808 0 0 0 207.808-208 208.32 208.32 0 0 0-158.592-202.048m15.168-62.208A272.32 272.32 0 0 1 959.744 560a271.808 271.808 0 0 1-271.552 272H320a256 256 0 0 1-57.536-505.536 256.128 256.128 0 0 1 489.92-30.72"
          })
        ]));
      }
    });
    var mostly_cloudy_default = mostly_cloudy_vue_vue_type_script_setup_true_lang_default;
    var mouse_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Mouse",
      __name: "mouse",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M438.144 256c-68.352 0-92.736 4.672-117.76 18.112-20.096 10.752-35.52 26.176-46.272 46.272C260.672 345.408 256 369.792 256 438.144v275.712c0 68.352 4.672 92.736 18.112 117.76 10.752 20.096 26.176 35.52 46.272 46.272C345.408 891.328 369.792 896 438.144 896h147.712c68.352 0 92.736-4.672 117.76-18.112 20.096-10.752 35.52-26.176 46.272-46.272C763.328 806.592 768 782.208 768 713.856V438.144c0-68.352-4.672-92.736-18.112-117.76a110.464 110.464 0 0 0-46.272-46.272C678.592 260.672 654.208 256 585.856 256zm0-64h147.712c85.568 0 116.608 8.96 147.904 25.6 31.36 16.768 55.872 41.344 72.576 72.64C823.104 321.536 832 352.576 832 438.08v275.84c0 85.504-8.96 116.544-25.6 147.84a174.464 174.464 0 0 1-72.64 72.576C702.464 951.104 671.424 960 585.92 960H438.08c-85.504 0-116.544-8.96-147.84-25.6a174.464 174.464 0 0 1-72.64-72.704c-16.768-31.296-25.664-62.336-25.664-147.84v-275.84c0-85.504 8.96-116.544 25.6-147.84a174.464 174.464 0 0 1 72.768-72.576c31.232-16.704 62.272-25.6 147.776-25.6z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 320q32 0 32 32v128q0 32-32 32t-32-32V352q0-32 32-32m32-96a32 32 0 0 1-64 0v-64a32 32 0 0 0-32-32h-96a32 32 0 0 1 0-64h96a96 96 0 0 1 96 96z"
          })
        ]));
      }
    });
    var mouse_default = mouse_vue_vue_type_script_setup_true_lang_default;
    var mug_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Mug",
      __name: "mug",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M736 800V160H160v640a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64m64-544h63.552a96 96 0 0 1 96 96v224a96 96 0 0 1-96 96H800v128a128 128 0 0 1-128 128H224A128 128 0 0 1 96 800V128a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 64v288h63.552a32 32 0 0 0 32-32V352a32 32 0 0 0-32-32z"
          })
        ]));
      }
    });
    var mug_default = mug_vue_vue_type_script_setup_true_lang_default;
    var mute_notification_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "MuteNotification",
      __name: "mute-notification",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m241.216 832 63.616-64H768V448c0-42.368-10.24-82.304-28.48-117.504l46.912-47.232C815.36 331.392 832 387.84 832 448v320h96a32 32 0 1 1 0 64zm-90.24 0H96a32 32 0 1 1 0-64h96V448a320.128 320.128 0 0 1 256-313.6V128a64 64 0 1 1 128 0v6.4a319.552 319.552 0 0 1 171.648 97.088l-45.184 45.44A256 256 0 0 0 256 448v278.336L151.04 832zM448 896h128a64 64 0 0 1-128 0"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056l-704 708.544z"
          })
        ]));
      }
    });
    var mute_notification_default = mute_notification_vue_vue_type_script_setup_true_lang_default;
    var mute_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Mute",
      __name: "mute",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m412.16 592.128-45.44 45.44A191.232 191.232 0 0 1 320 512V256a192 192 0 1 1 384 0v44.352l-64 64V256a128 128 0 1 0-256 0v256c0 30.336 10.56 58.24 28.16 80.128m51.968 38.592A128 128 0 0 0 640 512v-57.152l64-64V512a192 192 0 0 1-287.68 166.528zM314.88 779.968l46.144-46.08A222.976 222.976 0 0 0 480 768h64a224 224 0 0 0 224-224v-32a32 32 0 1 1 64 0v32a288 288 0 0 1-288 288v64h64a32 32 0 1 1 0 64H416a32 32 0 1 1 0-64h64v-64c-61.44 0-118.4-19.2-165.12-52.032M266.752 737.6A286.976 286.976 0 0 1 192 544v-32a32 32 0 0 1 64 0v32c0 56.832 21.184 108.8 56.064 148.288z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M150.72 859.072a32 32 0 0 1-45.44-45.056l704-708.544a32 32 0 0 1 45.44 45.056l-704 708.544z"
          })
        ]));
      }
    });
    var mute_default = mute_vue_vue_type_script_setup_true_lang_default;
    var no_smoking_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "NoSmoking",
      __name: "no-smoking",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M440.256 576H256v128h56.256l-64 64H224a32 32 0 0 1-32-32V544a32 32 0 0 1 32-32h280.256zm143.488 128H704V583.744L775.744 512H928a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32H519.744zM768 576v128h128V576zm-29.696-207.552 45.248 45.248-497.856 497.856-45.248-45.248zM256 64h64v320h-64zM128 192h64v192h-64zM64 512h64v256H64z"
          })
        ]));
      }
    });
    var no_smoking_default = no_smoking_vue_vue_type_script_setup_true_lang_default;
    var notebook_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Notebook",
      __name: "notebook",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M672 128h64v768h-64zM96 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32m0 192h128q32 0 32 32t-32 32H96q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var notebook_default = notebook_vue_vue_type_script_setup_true_lang_default;
    var notification_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Notification",
      __name: "notification",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 128v64H256a64 64 0 0 0-64 64v512a64 64 0 0 0 64 64h512a64 64 0 0 0 64-64V512h64v256a128 128 0 0 1-128 128H256a128 128 0 0 1-128-128V256a128 128 0 0 1 128-128z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 384a128 128 0 1 0 0-256 128 128 0 0 0 0 256m0 64a192 192 0 1 1 0-384 192 192 0 0 1 0 384"
          })
        ]));
      }
    });
    var notification_default = notification_vue_vue_type_script_setup_true_lang_default;
    var odometer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Odometer",
      __name: "odometer",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 512a320 320 0 1 1 640 0 32 32 0 1 1-64 0 256 256 0 1 0-512 0 32 32 0 0 1-64 0"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M570.432 627.84A96 96 0 1 1 509.568 608l60.992-187.776A32 32 0 1 1 631.424 440l-60.992 187.776zM502.08 734.464a32 32 0 1 0 19.84-60.928 32 32 0 0 0-19.84 60.928"
          })
        ]));
      }
    });
    var odometer_default = odometer_vue_vue_type_script_setup_true_lang_default;
    var office_building_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "OfficeBuilding",
      __name: "office-building",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 128v704h384V128zm-32-64h448a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 256h256v64H256zm0 192h256v64H256zm0 192h256v64H256zm384-128h128v64H640zm0 128h128v64H640zM64 832h896v64H64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 384v448h192V384zm-32-64h256a32 32 0 0 1 32 32v512a32 32 0 0 1-32 32H608a32 32 0 0 1-32-32V352a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var office_building_default = office_building_vue_vue_type_script_setup_true_lang_default;
    var open_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Open",
      __name: "open",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M329.956 257.138a254.862 254.862 0 0 0 0 509.724h364.088a254.862 254.862 0 0 0 0-509.724zm0-72.818h364.088a327.68 327.68 0 1 1 0 655.36H329.956a327.68 327.68 0 1 1 0-655.36z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M694.044 621.227a109.227 109.227 0 1 0 0-218.454 109.227 109.227 0 0 0 0 218.454m0 72.817a182.044 182.044 0 1 1 0-364.088 182.044 182.044 0 0 1 0 364.088"
          })
        ]));
      }
    });
    var open_default = open_vue_vue_type_script_setup_true_lang_default;
    var operation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Operation",
      __name: "operation",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64z"
          })
        ]));
      }
    });
    var operation_default = operation_vue_vue_type_script_setup_true_lang_default;
    var opportunity_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Opportunity",
      __name: "opportunity",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 960v-64h192.064v64zm448-544a350.656 350.656 0 0 1-128.32 271.424C665.344 719.04 640 763.776 640 813.504V832H320v-14.336c0-48-19.392-95.36-57.216-124.992a351.552 351.552 0 0 1-128.448-344.256c25.344-136.448 133.888-248.128 269.76-276.48A352.384 352.384 0 0 1 832 416m-544 32c0-132.288 75.904-224 192-224v-64c-154.432 0-256 122.752-256 288z"
          })
        ]));
      }
    });
    var opportunity_default = opportunity_vue_vue_type_script_setup_true_lang_default;
    var orange_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Orange",
      __name: "orange",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 894.72a382.336 382.336 0 0 0 215.936-89.472L577.024 622.272c-10.24 6.016-21.248 10.688-33.024 13.696v258.688zm261.248-134.784A382.336 382.336 0 0 0 894.656 544H635.968c-3.008 11.776-7.68 22.848-13.696 33.024l182.976 182.912zM894.656 480a382.336 382.336 0 0 0-89.408-215.936L622.272 446.976c6.016 10.24 10.688 21.248 13.696 33.024h258.688zm-134.72-261.248A382.336 382.336 0 0 0 544 129.344v258.688c11.776 3.008 22.848 7.68 33.024 13.696zM480 129.344a382.336 382.336 0 0 0-215.936 89.408l182.912 182.976c10.24-6.016 21.248-10.688 33.024-13.696zm-261.248 134.72A382.336 382.336 0 0 0 129.344 480h258.688c3.008-11.776 7.68-22.848 13.696-33.024zM129.344 544a382.336 382.336 0 0 0 89.408 215.936l182.976-182.912A127.232 127.232 0 0 1 388.032 544zm134.72 261.248A382.336 382.336 0 0 0 480 894.656V635.968a127.232 127.232 0 0 1-33.024-13.696zM512 960a448 448 0 1 1 0-896 448 448 0 0 1 0 896m0-384a64 64 0 1 0 0-128 64 64 0 0 0 0 128"
          })
        ]));
      }
    });
    var orange_default = orange_vue_vue_type_script_setup_true_lang_default;
    var paperclip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Paperclip",
      __name: "paperclip",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M602.496 240.448A192 192 0 1 1 874.048 512l-316.8 316.8A256 256 0 0 1 195.2 466.752L602.496 59.456l45.248 45.248L240.448 512A192 192 0 0 0 512 783.552l316.8-316.8a128 128 0 1 0-181.056-181.056L353.6 579.904a32 32 0 1 0 45.248 45.248l294.144-294.144 45.312 45.248L444.096 670.4a96 96 0 1 1-135.744-135.744l294.144-294.208z"
          })
        ]));
      }
    });
    var paperclip_default = paperclip_vue_vue_type_script_setup_true_lang_default;
    var partly_cloudy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PartlyCloudy",
      __name: "partly-cloudy",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M598.4 895.872H328.192a256 256 0 0 1-34.496-510.528A352 352 0 1 1 598.4 895.872m-271.36-64h272.256a288 288 0 1 0-248.512-417.664L335.04 445.44l-34.816 3.584a192 192 0 0 0 26.88 382.848z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M139.84 501.888a256 256 0 1 1 417.856-277.12c-17.728 2.176-38.208 8.448-61.504 18.816A192 192 0 1 0 189.12 460.48a6003.84 6003.84 0 0 0-49.28 41.408z"
          })
        ]));
      }
    });
    var partly_cloudy_default = partly_cloudy_vue_vue_type_script_setup_true_lang_default;
    var pear_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Pear",
      __name: "pear",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M542.336 258.816a443.255 443.255 0 0 0-9.024 25.088 32 32 0 1 1-60.8-20.032l1.088-3.328a162.688 162.688 0 0 0-122.048 131.392l-17.088 102.72-20.736 15.36C256.192 552.704 224 610.88 224 672c0 120.576 126.4 224 288 224s288-103.424 288-224c0-61.12-32.192-119.296-89.728-161.92l-20.736-15.424-17.088-102.72a162.688 162.688 0 0 0-130.112-133.12zm-40.128-66.56c7.936-15.552 16.576-30.08 25.92-43.776 23.296-33.92 49.408-59.776 78.528-77.12a32 32 0 1 1 32.704 55.04c-20.544 12.224-40.064 31.552-58.432 58.304a316.608 316.608 0 0 0-9.792 15.104 226.688 226.688 0 0 1 164.48 181.568l12.8 77.248C819.456 511.36 864 587.392 864 672c0 159.04-157.568 288-352 288S160 831.04 160 672c0-84.608 44.608-160.64 115.584-213.376l12.8-77.248a226.624 226.624 0 0 1 213.76-189.184z"
          })
        ]));
      }
    });
    var pear_default = pear_vue_vue_type_script_setup_true_lang_default;
    var phone_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PhoneFilled",
      __name: "phone-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M199.232 125.568 90.624 379.008a32 32 0 0 0 6.784 35.2l512.384 512.384a32 32 0 0 0 35.2 6.784l253.44-108.608a32 32 0 0 0 10.048-52.032L769.6 633.92a32 32 0 0 0-36.928-5.952l-130.176 65.088-271.488-271.552 65.024-130.176a32 32 0 0 0-5.952-36.928L251.2 115.52a32 32 0 0 0-51.968 10.048z"
          })
        ]));
      }
    });
    var phone_filled_default = phone_filled_vue_vue_type_script_setup_true_lang_default;
    var phone_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Phone",
      __name: "phone",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M79.36 432.256 591.744 944.64a32 32 0 0 0 35.2 6.784l253.44-108.544a32 32 0 0 0 9.984-52.032l-153.856-153.92a32 32 0 0 0-36.928-6.016l-69.888 34.944L358.08 394.24l35.008-69.888a32 32 0 0 0-5.952-36.928L233.152 133.568a32 32 0 0 0-52.032 10.048L72.512 397.056a32 32 0 0 0 6.784 35.2zm60.48-29.952 81.536-190.08L325.568 316.48l-24.64 49.216-20.608 41.216 32.576 32.64 271.552 271.552 32.64 32.64 41.216-20.672 49.28-24.576 104.192 104.128-190.08 81.472L139.84 402.304zM512 320v-64a256 256 0 0 1 256 256h-64a192 192 0 0 0-192-192m0-192V64a448 448 0 0 1 448 448h-64a384 384 0 0 0-384-384"
          })
        ]));
      }
    });
    var phone_default = phone_vue_vue_type_script_setup_true_lang_default;
    var picture_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PictureFilled",
      __name: "picture-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"
          })
        ]));
      }
    });
    var picture_filled_default = picture_filled_vue_vue_type_script_setup_true_lang_default;
    var picture_rounded_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PictureRounded",
      __name: "picture-rounded",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 128a384 384 0 1 0 0 768 384 384 0 0 0 0-768m0-64a448 448 0 1 1 0 896 448 448 0 0 1 0-896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 288q64 0 64 64t-64 64q-64 0-64-64t64-64M214.656 790.656l-45.312-45.312 185.664-185.6a96 96 0 0 1 123.712-10.24l138.24 98.688a32 32 0 0 0 39.872-2.176L906.688 422.4l42.624 47.744L699.52 693.696a96 96 0 0 1-119.808 6.592l-138.24-98.752a32 32 0 0 0-41.152 3.456l-185.664 185.6z"
          })
        ]));
      }
    });
    var picture_rounded_default = picture_rounded_vue_vue_type_script_setup_true_lang_default;
    var picture_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Picture",
      __name: "picture",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 288q64 0 64 64t-64 64q-64 0-64-64t64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z"
          })
        ]));
      }
    });
    var picture_default = picture_vue_vue_type_script_setup_true_lang_default;
    var pie_chart_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PieChart",
      __name: "pie-chart",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 68.48v64.832A384.128 384.128 0 0 0 512 896a384.128 384.128 0 0 0 378.688-320h64.768A448.128 448.128 0 0 1 64 512 448.128 448.128 0 0 1 448 68.48z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M576 97.28V448h350.72A384.064 384.064 0 0 0 576 97.28zM512 64V33.152A448 448 0 0 1 990.848 512H512z"
          })
        ]));
      }
    });
    var pie_chart_default = pie_chart_vue_vue_type_script_setup_true_lang_default;
    var place_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Place",
      __name: "place",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 512a32 32 0 0 1 32 32v256a32 32 0 1 1-64 0V544a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 649.088v64.96C269.76 732.352 192 771.904 192 800c0 37.696 139.904 96 320 96s320-58.304 320-96c0-28.16-77.76-67.648-192-85.952v-64.96C789.12 671.04 896 730.368 896 800c0 88.32-171.904 160-384 160s-384-71.68-384-160c0-69.696 106.88-128.96 256-150.912"
          })
        ]));
      }
    });
    var place_default = place_vue_vue_type_script_setup_true_lang_default;
    var platform_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Platform",
      __name: "platform",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 832v-64h128v64h192v64H256v-64zM128 704V128h768v576z"
          })
        ]));
      }
    });
    var platform_default = platform_vue_vue_type_script_setup_true_lang_default;
    var plus_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Plus",
      __name: "plus",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
          })
        ]));
      }
    });
    var plus_default = plus_vue_vue_type_script_setup_true_lang_default;
    var pointer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Pointer",
      __name: "pointer",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M511.552 128c-35.584 0-64.384 28.8-64.384 64.448v516.48L274.048 570.88a94.272 94.272 0 0 0-112.896-3.456 44.416 44.416 0 0 0-8.96 62.208L332.8 870.4A64 64 0 0 0 384 896h512V575.232a64 64 0 0 0-45.632-61.312l-205.952-61.76A96 96 0 0 1 576 360.192V192.448C576 156.8 547.2 128 511.552 128M359.04 556.8l24.128 19.2V192.448a128.448 128.448 0 1 1 256.832 0v167.744a32 32 0 0 0 22.784 30.656l206.016 61.76A128 128 0 0 1 960 575.232V896a64 64 0 0 1-64 64H384a128 128 0 0 1-102.4-51.2L101.056 668.032A108.416 108.416 0 0 1 128 512.512a158.272 158.272 0 0 1 185.984 8.32z"
          })
        ]));
      }
    });
    var pointer_default = pointer_vue_vue_type_script_setup_true_lang_default;
    var position_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Position",
      __name: "position",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m249.6 417.088 319.744 43.072 39.168 310.272L845.12 178.88 249.6 417.088zm-129.024 47.168a32 32 0 0 1-7.68-61.44l777.792-311.04a32 32 0 0 1 41.6 41.6l-310.336 775.68a32 32 0 0 1-61.44-7.808L512 516.992l-391.424-52.736z"
          })
        ]));
      }
    });
    var position_default = position_vue_vue_type_script_setup_true_lang_default;
    var postcard_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Postcard",
      __name: "postcard",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 224a32 32 0 0 0-32 32v512a32 32 0 0 0 32 32h704a32 32 0 0 0 32-32V256a32 32 0 0 0-32-32zm0-64h704a96 96 0 0 1 96 96v512a96 96 0 0 1-96 96H160a96 96 0 0 1-96-96V256a96 96 0 0 1 96-96"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 320a64 64 0 1 1 0 128 64 64 0 0 1 0-128M288 448h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32m0 128h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var postcard_default = postcard_vue_vue_type_script_setup_true_lang_default;
    var pouring_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Pouring",
      __name: "pouring",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m739.328 291.328-35.2-6.592-12.8-33.408a192.064 192.064 0 0 0-365.952 23.232l-9.92 40.896-41.472 7.04a176.32 176.32 0 0 0-146.24 173.568c0 97.28 78.72 175.936 175.808 175.936h400a192 192 0 0 0 35.776-380.672zM959.552 480a256 256 0 0 1-256 256h-400A239.808 239.808 0 0 1 63.744 496.192a240.32 240.32 0 0 1 199.488-236.8 256.128 256.128 0 0 1 487.872-30.976A256.064 256.064 0 0 1 959.552 480M224 800a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32m192 0a32 32 0 0 1 32 32v96a32 32 0 1 1-64 0v-96a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var pouring_default = pouring_vue_vue_type_script_setup_true_lang_default;
    var present_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Present",
      __name: "present",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 896V640H192v-64h288V320H192v576zm64 0h288V320H544v256h288v64H544zM128 256h768v672a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M96 256h832q32 0 32 32t-32 32H96q-32 0-32-32t32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M416 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M608 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          })
        ]));
      }
    });
    var present_default = present_vue_vue_type_script_setup_true_lang_default;
    var price_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "PriceTag",
      __name: "price-tag",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 318.336V896h576V318.336L552.512 115.84a64 64 0 0 0-81.024 0zM593.024 66.304l259.2 212.096A32 32 0 0 1 864 303.168V928a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V303.168a32 32 0 0 1 11.712-24.768l259.2-212.096a128 128 0 0 1 162.112 0z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          })
        ]));
      }
    });
    var price_tag_default = price_tag_vue_vue_type_script_setup_true_lang_default;
    var printer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Printer",
      __name: "printer",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 768H105.024c-14.272 0-19.456-1.472-24.64-4.288a29.056 29.056 0 0 1-12.16-12.096C65.536 746.432 64 741.248 64 727.04V379.072c0-42.816 4.48-58.304 12.8-73.984 8.384-15.616 20.672-27.904 36.288-36.288 15.68-8.32 31.168-12.8 73.984-12.8H256V64h512v192h68.928c42.816 0 58.304 4.48 73.984 12.8 15.616 8.384 27.904 20.672 36.288 36.288 8.32 15.68 12.8 31.168 12.8 73.984v347.904c0 14.272-1.472 19.456-4.288 24.64a29.056 29.056 0 0 1-12.096 12.16c-5.184 2.752-10.368 4.224-24.64 4.224H768v192H256zm64-192v320h384V576zm-64 128V512h512v192h128V379.072c0-29.376-1.408-36.48-5.248-43.776a23.296 23.296 0 0 0-10.048-10.048c-7.232-3.84-14.4-5.248-43.776-5.248H187.072c-29.376 0-36.48 1.408-43.776 5.248a23.296 23.296 0 0 0-10.048 10.048c-3.84 7.232-5.248 14.4-5.248 43.776V704zm64-448h384V128H320zm-64 128h64v64h-64zm128 0h64v64h-64z"
          })
        ]));
      }
    });
    var printer_default = printer_vue_vue_type_script_setup_true_lang_default;
    var promotion_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Promotion",
      __name: "promotion",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m64 448 832-320-128 704-446.08-243.328L832 192 242.816 545.472zm256 512V657.024L512 768z"
          })
        ]));
      }
    });
    var promotion_default = promotion_vue_vue_type_script_setup_true_lang_default;
    var quartz_watch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "QuartzWatch",
      __name: "quartz-watch",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M422.02 602.01v-.03c-6.68-5.99-14.35-8.83-23.01-8.51-8.67.32-16.17 3.66-22.5 10.02-6.33 6.36-9.5 13.7-9.5 22.02s3 15.82 8.99 22.5c8.68 8.68 19.02 11.35 31.01 8s19.49-10.85 22.5-22.5c3.01-11.65.51-22.15-7.49-31.49zM384 512c0-9.35-3-17.02-8.99-23.01-6-5.99-13.66-8.99-23.01-8.99-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.66 8.99 23.01 8.99 9.35 0 17.02-3 23.01-8.99 5.99-6 8.99-13.67 8.99-23.01m6.53-82.49c11.65 3.01 22.15.51 31.49-7.49h.04c5.99-6.68 8.83-14.34 8.51-23.01-.32-8.67-3.66-16.16-10.02-22.5-6.36-6.33-13.7-9.5-22.02-9.5s-15.82 3-22.5 8.99c-8.68 8.69-11.35 19.02-8 31.01 3.35 11.99 10.85 19.49 22.5 22.5zm242.94 0c11.67-3.03 19.01-10.37 22.02-22.02 3.01-11.65.51-22.15-7.49-31.49h.01c-6.68-5.99-14.18-8.99-22.5-8.99s-15.66 3.16-22.02 9.5c-6.36 6.34-9.7 13.84-10.02 22.5-.32 8.66 2.52 16.33 8.51 23.01 9.32 8.02 19.82 10.52 31.49 7.49M512 640c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.67 8.99 23.01 8.99 9.35 0 17.02-3 23.01-8.99 5.99-6 8.99-13.66 8.99-23.01s-3-17.02-8.99-23.01c-6-5.99-13.66-8.99-23.01-8.99m183.01-151.01c-6-5.99-13.66-8.99-23.01-8.99s-17.02 3-23.01 8.99c-5.99 6-8.99 13.66-8.99 23.01s3 17.02 8.99 23.01c6 5.99 13.66 8.99 23.01 8.99s17.02-3 23.01-8.99c5.99-6 8.99-13.67 8.99-23.01 0-9.35-3-17.02-8.99-23.01"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 512c-2-90.67-33.17-166.17-93.5-226.5-20.43-20.42-42.6-37.49-66.5-51.23V64H352v170.26c-23.9 13.74-46.07 30.81-66.5 51.24-60.33 60.33-91.49 135.83-93.5 226.5 2 90.67 33.17 166.17 93.5 226.5 20.43 20.43 42.6 37.5 66.5 51.24V960h320V789.74c23.9-13.74 46.07-30.81 66.5-51.24 60.33-60.34 91.49-135.83 93.5-226.5M416 128h192v78.69c-29.85-9.03-61.85-13.93-96-14.69-34.15.75-66.15 5.65-96 14.68zm192 768H416v-78.68c29.85 9.03 61.85 13.93 96 14.68 34.15-.75 66.15-5.65 96-14.68zm-96-128c-72.66-2.01-132.99-27.01-180.99-75.01S258.01 584.66 256 512c2.01-72.66 27.01-132.99 75.01-180.99S439.34 258.01 512 256c72.66 2.01 132.99 27.01 180.99 75.01S765.99 439.34 768 512c-2.01 72.66-27.01 132.99-75.01 180.99S584.66 765.99 512 768"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 320c-9.35 0-17.02 3-23.01 8.99-5.99 6-8.99 13.66-8.99 23.01 0 9.35 3 17.02 8.99 23.01 6 5.99 13.67 8.99 23.01 8.99 9.35 0 17.02-3 23.01-8.99 5.99-6 8.99-13.66 8.99-23.01 0-9.35-3-17.02-8.99-23.01-6-5.99-13.66-8.99-23.01-8.99m112.99 273.5c-8.66-.32-16.33 2.52-23.01 8.51-7.98 9.32-10.48 19.82-7.49 31.49s10.49 19.17 22.5 22.5 22.35.66 31.01-8v.04c5.99-6.68 8.99-14.18 8.99-22.5s-3.16-15.66-9.5-22.02-13.84-9.7-22.5-10.02"
          })
        ]));
      }
    });
    var quartz_watch_default = quartz_watch_vue_vue_type_script_setup_true_lang_default;
    var question_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "QuestionFilled",
      __name: "question-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592 0-42.944-14.08-76.736-42.24-101.376-28.16-25.344-65.472-37.312-111.232-37.312zm-12.672 406.208a54.272 54.272 0 0 0-38.72 14.784 49.408 49.408 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.848 54.848 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.968 51.968 0 0 0-15.488-38.016 55.936 55.936 0 0 0-39.424-14.784z"
          })
        ]));
      }
    });
    var question_filled_default = question_filled_vue_vue_type_script_setup_true_lang_default;
    var rank_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Rank",
      __name: "rank",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m186.496 544 41.408 41.344a32 32 0 1 1-45.248 45.312l-96-96a32 32 0 0 1 0-45.312l96-96a32 32 0 1 1 45.248 45.312L186.496 480h290.816V186.432l-41.472 41.472a32 32 0 1 1-45.248-45.184l96-96.128a32 32 0 0 1 45.312 0l96 96.064a32 32 0 0 1-45.248 45.184l-41.344-41.28V480H832l-41.344-41.344a32 32 0 0 1 45.248-45.312l96 96a32 32 0 0 1 0 45.312l-96 96a32 32 0 0 1-45.248-45.312L832 544H541.312v293.44l41.344-41.28a32 32 0 1 1 45.248 45.248l-96 96a32 32 0 0 1-45.312 0l-96-96a32 32 0 1 1 45.312-45.248l41.408 41.408V544H186.496z"
          })
        ]));
      }
    });
    var rank_default = rank_vue_vue_type_script_setup_true_lang_default;
    var reading_lamp_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ReadingLamp",
      __name: "reading-lamp",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 896h320q32 0 32 32t-32 32H352q-32 0-32-32t32-32m-44.672-768-99.52 448h608.384l-99.52-448zm-25.6-64h460.608a32 32 0 0 1 31.232 25.088l113.792 512A32 32 0 0 1 856.128 640H167.872a32 32 0 0 1-31.232-38.912l113.792-512A32 32 0 0 1 281.664 64z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M672 576q32 0 32 32v128q0 32-32 32t-32-32V608q0-32 32-32m-192-.064h64V960h-64z"
          })
        ]));
      }
    });
    var reading_lamp_default = reading_lamp_vue_vue_type_script_setup_true_lang_default;
    var reading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Reading",
      __name: "reading",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m512 863.36 384-54.848v-638.72L525.568 222.72a96 96 0 0 1-27.136 0L128 169.792v638.72zM137.024 106.432l370.432 52.928a32 32 0 0 0 9.088 0l370.432-52.928A64 64 0 0 1 960 169.792v638.72a64 64 0 0 1-54.976 63.36l-388.48 55.488a32 32 0 0 1-9.088 0l-388.48-55.488A64 64 0 0 1 64 808.512v-638.72a64 64 0 0 1 73.024-63.36z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 192h64v704h-64z"
          })
        ]));
      }
    });
    var reading_default = reading_vue_vue_type_script_setup_true_lang_default;
    var refresh_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "RefreshLeft",
      __name: "refresh-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
          })
        ]));
      }
    });
    var refresh_left_default = refresh_left_vue_vue_type_script_setup_true_lang_default;
    var refresh_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "RefreshRight",
      __name: "refresh-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"
          })
        ]));
      }
    });
    var refresh_right_default = refresh_right_vue_vue_type_script_setup_true_lang_default;
    var refresh_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Refresh",
      __name: "refresh",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
          })
        ]));
      }
    });
    var refresh_default = refresh_vue_vue_type_script_setup_true_lang_default;
    var refrigerator_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Refrigerator",
      __name: "refrigerator",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 448h512V160a32 32 0 0 0-32-32H288a32 32 0 0 0-32 32zm0 64v352a32 32 0 0 0 32 32h448a32 32 0 0 0 32-32V512zm32-448h448a96 96 0 0 1 96 96v704a96 96 0 0 1-96 96H288a96 96 0 0 1-96-96V160a96 96 0 0 1 96-96m32 224h64v96h-64zm0 288h64v96h-64z"
          })
        ]));
      }
    });
    var refrigerator_default = refrigerator_vue_vue_type_script_setup_true_lang_default;
    var remove_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "RemoveFilled",
      __name: "remove-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896M288 512a38.4 38.4 0 0 0 38.4 38.4h371.2a38.4 38.4 0 0 0 0-76.8H326.4A38.4 38.4 0 0 0 288 512"
          })
        ]));
      }
    });
    var remove_filled_default = remove_filled_vue_vue_type_script_setup_true_lang_default;
    var remove_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Remove",
      __name: "remove",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 480h320a32 32 0 1 1 0 64H352a32 32 0 0 1 0-64"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          })
        ]));
      }
    });
    var remove_default = remove_vue_vue_type_script_setup_true_lang_default;
    var right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Right",
      __name: "right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M754.752 480H160a32 32 0 1 0 0 64h594.752L521.344 777.344a32 32 0 0 0 45.312 45.312l288-288a32 32 0 0 0 0-45.312l-288-288a32 32 0 1 0-45.312 45.312z"
          })
        ]));
      }
    });
    var right_default = right_vue_vue_type_script_setup_true_lang_default;
    var scale_to_original_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ScaleToOriginal",
      __name: "scale-to-original",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zm-361.412 0a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118M512 361.412a30.118 30.118 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.118 30.118 0 0 0 512 361.412M512 512a30.118 30.118 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.118 30.118 0 0 0 512 512"
          })
        ]));
      }
    });
    var scale_to_original_default = scale_to_original_vue_vue_type_script_setup_true_lang_default;
    var school_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "School",
      __name: "school",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 128v704h576V128zm-32-64h640a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M64 832h896v64H64zm256-640h128v96H320z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 832h256v-64a128 128 0 1 0-256 0zm128-256a192 192 0 0 1 192 192v128H320V768a192 192 0 0 1 192-192M320 384h128v96H320zm256-192h128v96H576zm0 192h128v96H576z"
          })
        ]));
      }
    });
    var school_default = school_vue_vue_type_script_setup_true_lang_default;
    var scissor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Scissor",
      __name: "scissor",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m512.064 578.368-106.88 152.768a160 160 0 1 1-23.36-78.208L472.96 522.56 196.864 128.256a32 32 0 1 1 52.48-36.736l393.024 561.344a160 160 0 1 1-23.36 78.208l-106.88-152.704zm54.4-189.248 208.384-297.6a32 32 0 0 1 52.48 36.736l-221.76 316.672-39.04-55.808zm-376.32 425.856a96 96 0 1 0 110.144-157.248 96 96 0 0 0-110.08 157.248zm643.84 0a96 96 0 1 0-110.08-157.248 96 96 0 0 0 110.08 157.248"
          })
        ]));
      }
    });
    var scissor_default = scissor_vue_vue_type_script_setup_true_lang_default;
    var search_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Search",
      __name: "search",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
          })
        ]));
      }
    });
    var search_default = search_vue_vue_type_script_setup_true_lang_default;
    var select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Select",
      __name: "select",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M77.248 415.04a64 64 0 0 1 90.496 0l226.304 226.304L846.528 188.8a64 64 0 1 1 90.56 90.496l-543.04 543.04-316.8-316.8a64 64 0 0 1 0-90.496z"
          })
        ]));
      }
    });
    var select_default = select_vue_vue_type_script_setup_true_lang_default;
    var sell_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sell",
      __name: "sell",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 288h131.072a32 32 0 0 1 31.808 28.8L886.4 512h-64.384l-16-160H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0v-96H217.92l-51.2 512H512v64H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4zm-64 0v-22.336C640 189.248 582.272 128 512 128c-70.272 0-128 61.248-128 137.664v22.4h256zm201.408 483.84L768 698.496V928a32 32 0 1 1-64 0V698.496l-73.344 73.344a32 32 0 1 1-45.248-45.248l128-128a32 32 0 0 1 45.248 0l128 128a32 32 0 1 1-45.248 45.248z"
          })
        ]));
      }
    });
    var sell_default = sell_vue_vue_type_script_setup_true_lang_default;
    var semi_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SemiSelect",
      __name: "semi-select",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 448h768q64 0 64 64t-64 64H128q-64 0-64-64t64-64"
          })
        ]));
      }
    });
    var semi_select_default = semi_select_vue_vue_type_script_setup_true_lang_default;
    var service_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Service",
      __name: "service",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M864 409.6a192 192 0 0 1-37.888 349.44A256.064 256.064 0 0 1 576 960h-96a32 32 0 1 1 0-64h96a192.064 192.064 0 0 0 181.12-128H736a32 32 0 0 1-32-32V416a32 32 0 0 1 32-32h32c10.368 0 20.544.832 30.528 2.432a288 288 0 0 0-573.056 0A193.235 193.235 0 0 1 256 384h32a32 32 0 0 1 32 32v320a32 32 0 0 1-32 32h-32a192 192 0 0 1-96-358.4 352 352 0 0 1 704 0M256 448a128 128 0 1 0 0 256zm640 128a128 128 0 0 0-128-128v256a128 128 0 0 0 128-128"
          })
        ]));
      }
    });
    var service_default = service_vue_vue_type_script_setup_true_lang_default;
    var set_up_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SetUp",
      __name: "set-up",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 160a64 64 0 0 0-64 64v576a64 64 0 0 0 64 64h576a64 64 0 0 0 64-64V224a64 64 0 0 0-64-64zm0-64h576a128 128 0 0 1 128 128v576a128 128 0 0 1-128 128H224A128 128 0 0 1 96 800V224A128 128 0 0 1 224 96"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 416a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 320h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32m160 416a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 640h256q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var set_up_default = set_up_vue_vue_type_script_setup_true_lang_default;
    var setting_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Setting",
      __name: "setting",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357.12 357.12 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a351.616 351.616 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357.12 357.12 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294.113 294.113 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293.12 293.12 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294.113 294.113 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288.282 288.282 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293.12 293.12 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a287.616 287.616 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
          })
        ]));
      }
    });
    var setting_default = setting_vue_vue_type_script_setup_true_lang_default;
    var share_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Share",
      __name: "share",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m679.872 348.8-301.76 188.608a127.808 127.808 0 0 1 5.12 52.16l279.936 104.96a128 128 0 1 1-22.464 59.904l-279.872-104.96a128 128 0 1 1-16.64-166.272l301.696-188.608a128 128 0 1 1 33.92 54.272z"
          })
        ]));
      }
    });
    var share_default = share_vue_vue_type_script_setup_true_lang_default;
    var ship_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Ship",
      __name: "ship",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 386.88V448h405.568a32 32 0 0 1 30.72 40.768l-76.48 267.968A192 192 0 0 1 687.168 896H336.832a192 192 0 0 1-184.64-139.264L75.648 488.768A32 32 0 0 1 106.368 448H448V117.888a32 32 0 0 1 47.36-28.096l13.888 7.616L512 96v2.88l231.68 126.4a32 32 0 0 1-2.048 57.216zm0-70.272 144.768-65.792L512 171.84zM512 512H148.864l18.24 64H856.96l18.24-64zM185.408 640l28.352 99.2A128 128 0 0 0 336.832 832h350.336a128 128 0 0 0 123.072-92.8l28.352-99.2H185.408"
          })
        ]));
      }
    });
    var ship_default = ship_vue_vue_type_script_setup_true_lang_default;
    var shop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Shop",
      __name: "shop",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 704h64v192H256V704h64v64h384zm188.544-152.192C894.528 559.616 896 567.616 896 576a96 96 0 1 1-192 0 96 96 0 1 1-192 0 96 96 0 1 1-192 0 96 96 0 1 1-192 0c0-8.384 1.408-16.384 3.392-24.192L192 128h640z"
          })
        ]));
      }
    });
    var shop_default = shop_vue_vue_type_script_setup_true_lang_default;
    var shopping_bag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ShoppingBag",
      __name: "shopping-bag",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 320v96a32 32 0 0 1-32 32h-32V320H384v128h-32a32 32 0 0 1-32-32v-96H192v576h640V320zm-384-64a192 192 0 1 1 384 0h160a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32zm64 0h256a128 128 0 1 0-256 0"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 704h640v64H192z"
          })
        ]));
      }
    });
    var shopping_bag_default = shopping_bag_vue_vue_type_script_setup_true_lang_default;
    var shopping_cart_full_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ShoppingCartFull",
      __name: "shopping-cart-full",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M432 928a48 48 0 1 1 0-96 48 48 0 0 1 0 96m320 0a48 48 0 1 1 0-96 48 48 0 0 1 0 96M96 128a32 32 0 0 1 0-64h160a32 32 0 0 1 31.36 25.728L320.64 256H928a32 32 0 0 1 31.296 38.72l-96 448A32 32 0 0 1 832 768H384a32 32 0 0 1-31.36-25.728L229.76 128zm314.24 576h395.904l82.304-384H333.44l76.8 384z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M699.648 256 608 145.984 516.352 256h183.296zm-140.8-151.04a64 64 0 0 1 98.304 0L836.352 320H379.648l179.2-215.04"
          })
        ]));
      }
    });
    var shopping_cart_full_default = shopping_cart_full_vue_vue_type_script_setup_true_lang_default;
    var shopping_cart_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ShoppingCart",
      __name: "shopping-cart",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M432 928a48 48 0 1 1 0-96 48 48 0 0 1 0 96m320 0a48 48 0 1 1 0-96 48 48 0 0 1 0 96M96 128a32 32 0 0 1 0-64h160a32 32 0 0 1 31.36 25.728L320.64 256H928a32 32 0 0 1 31.296 38.72l-96 448A32 32 0 0 1 832 768H384a32 32 0 0 1-31.36-25.728L229.76 128zm314.24 576h395.904l82.304-384H333.44l76.8 384z"
          })
        ]));
      }
    });
    var shopping_cart_default = shopping_cart_vue_vue_type_script_setup_true_lang_default;
    var shopping_trolley_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ShoppingTrolley",
      __name: "shopping-trolley",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M368 833c-13.3 0-24.5 4.5-33.5 13.5S321 866.7 321 880s4.5 24.5 13.5 33.5 20.2 13.8 33.5 14.5c13.3-.7 24.5-5.5 33.5-14.5S415 893.3 415 880s-4.5-24.5-13.5-33.5S381.3 833 368 833m439-193c7.4 0 13.8-2.2 19.5-6.5S836 623.3 838 616l112-448c2-10-.2-19.2-6.5-27.5S929 128 919 128H96c-9.3 0-17 3-23 9s-9 13.7-9 23 3 17 9 23 13.7 9 23 9h96v576h672c9.3 0 17-3 23-9s9-13.7 9-23-3-17-9-23-13.7-9-23-9H256v-64zM256 192h622l-96 384H256zm432 641c-13.3 0-24.5 4.5-33.5 13.5S641 866.7 641 880s4.5 24.5 13.5 33.5 20.2 13.8 33.5 14.5c13.3-.7 24.5-5.5 33.5-14.5S735 893.3 735 880s-4.5-24.5-13.5-33.5S701.3 833 688 833"
          })
        ]));
      }
    });
    var shopping_trolley_default = shopping_trolley_vue_vue_type_script_setup_true_lang_default;
    var smoking_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Smoking",
      __name: "smoking",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 576v128h640V576zm-32-64h704a32 32 0 0 1 32 32v192a32 32 0 0 1-32 32H224a32 32 0 0 1-32-32V544a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 576h64v128h-64zM256 64h64v320h-64zM128 192h64v192h-64zM64 512h64v256H64z"
          })
        ]));
      }
    });
    var smoking_default = smoking_vue_vue_type_script_setup_true_lang_default;
    var soccer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Soccer",
      __name: "soccer",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M418.496 871.04 152.256 604.8c-16.512 94.016-2.368 178.624 42.944 224 44.928 44.928 129.344 58.752 223.296 42.24m72.32-18.176a573.056 573.056 0 0 0 224.832-137.216 573.12 573.12 0 0 0 137.216-224.832L533.888 171.84a578.56 578.56 0 0 0-227.52 138.496A567.68 567.68 0 0 0 170.432 532.48l320.384 320.384zM871.04 418.496c16.512-93.952 2.688-178.368-42.24-223.296-44.544-44.544-128.704-58.048-222.592-41.536zM149.952 874.048c-112.96-112.96-88.832-408.96 111.168-608.96C461.056 65.152 760.96 36.928 874.048 149.952c113.024 113.024 86.784 411.008-113.152 610.944-199.936 199.936-497.92 226.112-610.944 113.152m452.544-497.792 22.656-22.656a32 32 0 0 1 45.248 45.248l-22.656 22.656 45.248 45.248A32 32 0 1 1 647.744 512l-45.248-45.248L557.248 512l45.248 45.248a32 32 0 1 1-45.248 45.248L512 557.248l-45.248 45.248L512 647.744a32 32 0 1 1-45.248 45.248l-45.248-45.248-22.656 22.656a32 32 0 1 1-45.248-45.248l22.656-22.656-45.248-45.248A32 32 0 1 1 376.256 512l45.248 45.248L466.752 512l-45.248-45.248a32 32 0 1 1 45.248-45.248L512 466.752l45.248-45.248L512 376.256a32 32 0 0 1 45.248-45.248l45.248 45.248z"
          })
        ]));
      }
    });
    var soccer_default = soccer_vue_vue_type_script_setup_true_lang_default;
    var sold_out_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SoldOut",
      __name: "sold-out",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 288h131.072a32 32 0 0 1 31.808 28.8L886.4 512h-64.384l-16-160H704v96a32 32 0 1 1-64 0v-96H384v96a32 32 0 0 1-64 0v-96H217.92l-51.2 512H512v64H131.328a32 32 0 0 1-31.808-35.2l57.6-576a32 32 0 0 1 31.808-28.8H320v-22.336C320 154.688 405.504 64 512 64s192 90.688 192 201.664v22.4zm-64 0v-22.336C640 189.248 582.272 128 512 128c-70.272 0-128 61.248-128 137.664v22.4h256zm201.408 476.16a32 32 0 1 1 45.248 45.184l-128 128a32 32 0 0 1-45.248 0l-128-128a32 32 0 1 1 45.248-45.248L704 837.504V608a32 32 0 1 1 64 0v229.504l73.408-73.408z"
          })
        ]));
      }
    });
    var sold_out_default = sold_out_vue_vue_type_script_setup_true_lang_default;
    var sort_down_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SortDown",
      __name: "sort-down",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M576 96v709.568L333.312 562.816A32 32 0 1 0 288 608l297.408 297.344A32 32 0 0 0 640 882.688V96a32 32 0 0 0-64 0"
          })
        ]));
      }
    });
    var sort_down_default = sort_down_vue_vue_type_script_setup_true_lang_default;
    var sort_up_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SortUp",
      __name: "sort-up",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 141.248V928a32 32 0 1 0 64 0V218.56l242.688 242.688A32 32 0 1 0 736 416L438.592 118.656A32 32 0 0 0 384 141.248"
          })
        ]));
      }
    });
    var sort_up_default = sort_up_vue_vue_type_script_setup_true_lang_default;
    var sort_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sort",
      __name: "sort",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"
          })
        ]));
      }
    });
    var sort_default = sort_vue_vue_type_script_setup_true_lang_default;
    var stamp_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Stamp",
      __name: "stamp",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M624 475.968V640h144a128 128 0 0 1 128 128H128a128 128 0 0 1 128-128h144V475.968a192 192 0 1 1 224 0M128 896v-64h768v64z"
          })
        ]));
      }
    });
    var stamp_default = stamp_vue_vue_type_script_setup_true_lang_default;
    var star_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "StarFilled",
      __name: "star-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M283.84 867.84 512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"
          })
        ]));
      }
    });
    var star_filled_default = star_filled_vue_vue_type_script_setup_true_lang_default;
    var star_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Star",
      __name: "star",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"
          })
        ]));
      }
    });
    var star_default = star_vue_vue_type_script_setup_true_lang_default;
    var stopwatch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Stopwatch",
      __name: "stopwatch",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M672 234.88c-39.168 174.464-80 298.624-122.688 372.48-64 110.848-202.624 30.848-138.624-80C453.376 453.44 540.48 355.968 672 234.816z"
          })
        ]));
      }
    });
    var stopwatch_default = stopwatch_vue_vue_type_script_setup_true_lang_default;
    var success_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SuccessFilled",
      __name: "success-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
          })
        ]));
      }
    });
    var success_filled_default = success_filled_vue_vue_type_script_setup_true_lang_default;
    var sugar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sugar",
      __name: "sugar",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m801.728 349.184 4.48 4.48a128 128 0 0 1 0 180.992L534.656 806.144a128 128 0 0 1-181.056 0l-4.48-4.48-19.392 109.696a64 64 0 0 1-108.288 34.176L78.464 802.56a64 64 0 0 1 34.176-108.288l109.76-19.328-4.544-4.544a128 128 0 0 1 0-181.056l271.488-271.488a128 128 0 0 1 181.056 0l4.48 4.48 19.392-109.504a64 64 0 0 1 108.352-34.048l142.592 143.04a64 64 0 0 1-34.24 108.16l-109.248 19.2zm-548.8 198.72h447.168v2.24l60.8-60.8a63.808 63.808 0 0 0 18.752-44.416h-426.88l-89.664 89.728a64.064 64.064 0 0 0-10.24 13.248zm0 64c2.752 4.736 6.144 9.152 10.176 13.248l135.744 135.744a64 64 0 0 0 90.496 0L638.4 611.904zm490.048-230.976L625.152 263.104a64 64 0 0 0-90.496 0L416.768 380.928zM123.712 757.312l142.976 142.976 24.32-137.6a25.6 25.6 0 0 0-29.696-29.632l-137.6 24.256zm633.6-633.344-24.32 137.472a25.6 25.6 0 0 0 29.632 29.632l137.28-24.064-142.656-143.04z"
          })
        ]));
      }
    });
    var sugar_default = sugar_vue_vue_type_script_setup_true_lang_default;
    var suitcase_line_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SuitcaseLine",
      __name: "suitcase-line",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M922.5 229.5c-24.32-24.34-54.49-36.84-90.5-37.5H704v-64c-.68-17.98-7.02-32.98-19.01-44.99S658.01 64.66 640 64H384c-17.98.68-32.98 7.02-44.99 19.01S320.66 110 320 128v64H192c-35.99.68-66.16 13.18-90.5 37.5C77.16 253.82 64.66 283.99 64 320v448c.68 35.99 13.18 66.16 37.5 90.5s54.49 36.84 90.5 37.5h640c35.99-.68 66.16-13.18 90.5-37.5s36.84-54.49 37.5-90.5V320c-.68-35.99-13.18-66.16-37.5-90.5M384 128h256v64H384zM256 832h-64c-17.98-.68-32.98-7.02-44.99-19.01S128.66 786.01 128 768V448h128zm448 0H320V448h384zm192-64c-.68 17.98-7.02 32.98-19.01 44.99S850.01 831.34 832 832h-64V448h128zm0-384H128v-64c.69-17.98 7.02-32.98 19.01-44.99S173.99 256.66 192 256h640c17.98.69 32.98 7.02 44.99 19.01S895.34 301.99 896 320z"
          })
        ]));
      }
    });
    var suitcase_line_default = suitcase_line_vue_vue_type_script_setup_true_lang_default;
    var suitcase_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Suitcase",
      __name: "suitcase",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 384h768v-64a64 64 0 0 0-64-64H192a64 64 0 0 0-64 64zm0 64v320a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V448zm64-256h640a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H192A128 128 0 0 1 64 768V320a128 128 0 0 1 128-128"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M384 128v64h256v-64zm0-64h256a64 64 0 0 1 64 64v64a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-64a64 64 0 0 1 64-64"
          })
        ]));
      }
    });
    var suitcase_default = suitcase_vue_vue_type_script_setup_true_lang_default;
    var sunny_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sunny",
      __name: "sunny",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 704a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m0-704a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 768a32 32 0 0 1 32 32v64a32 32 0 1 1-64 0v-64a32 32 0 0 1 32-32M195.2 195.2a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 1 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm543.104 543.104a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 0-45.248M64 512a32 32 0 0 1 32-32h64a32 32 0 0 1 0 64H96a32 32 0 0 1-32-32m768 0a32 32 0 0 1 32-32h64a32 32 0 1 1 0 64h-64a32 32 0 0 1-32-32M195.2 828.8a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248L240.448 828.8a32 32 0 0 1-45.248 0zm543.104-543.104a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248l-45.248 45.248a32 32 0 0 1-45.248 0"
          })
        ]));
      }
    });
    var sunny_default = sunny_vue_vue_type_script_setup_true_lang_default;
    var sunrise_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sunrise",
      __name: "sunrise",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M32 768h960a32 32 0 1 1 0 64H32a32 32 0 1 1 0-64m129.408-96a352 352 0 0 1 701.184 0h-64.32a288 288 0 0 0-572.544 0h-64.32zM512 128a32 32 0 0 1 32 32v96a32 32 0 0 1-64 0v-96a32 32 0 0 1 32-32m407.296 168.704a32 32 0 0 1 0 45.248l-67.84 67.84a32 32 0 1 1-45.248-45.248l67.84-67.84a32 32 0 0 1 45.248 0zm-814.592 0a32 32 0 0 1 45.248 0l67.84 67.84a32 32 0 1 1-45.248 45.248l-67.84-67.84a32 32 0 0 1 0-45.248"
          })
        ]));
      }
    });
    var sunrise_default = sunrise_vue_vue_type_script_setup_true_lang_default;
    var sunset_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Sunset",
      __name: "sunset",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M82.56 640a448 448 0 1 1 858.88 0h-67.2a384 384 0 1 0-724.288 0zM32 704h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m256 128h448q32 0 32 32t-32 32H288q-32 0-32-32t32-32"
          })
        ]));
      }
    });
    var sunset_default = sunset_vue_vue_type_script_setup_true_lang_default;
    var switch_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SwitchButton",
      __name: "switch-button",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M352 159.872V230.4a352 352 0 1 0 320 0v-70.528A416.128 416.128 0 0 1 512 960a416 416 0 0 1-160-800.128z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64q32 0 32 32v320q0 32-32 32t-32-32V96q0-32 32-32"
          })
        ]));
      }
    });
    var switch_button_default = switch_button_vue_vue_type_script_setup_true_lang_default;
    var switch_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "SwitchFilled",
      __name: "switch-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M247.47 358.4v.04c.07 19.17 7.72 37.53 21.27 51.09s31.92 21.2 51.09 21.27c39.86 0 72.41-32.6 72.41-72.4s-32.6-72.36-72.41-72.36-72.36 32.55-72.36 72.36z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M492.38 128H324.7c-52.16 0-102.19 20.73-139.08 57.61a196.655 196.655 0 0 0-57.61 139.08V698.7c-.01 25.84 5.08 51.42 14.96 75.29s24.36 45.56 42.63 63.83 39.95 32.76 63.82 42.65a196.67 196.67 0 0 0 75.28 14.98h167.68c3.03 0 5.46-2.43 5.46-5.42V133.42c.6-2.99-1.83-5.42-5.46-5.42zm-56.11 705.88H324.7c-17.76.13-35.36-3.33-51.75-10.18s-31.22-16.94-43.61-29.67c-25.3-25.35-39.81-59.1-39.81-95.32V324.69c-.13-17.75 3.33-35.35 10.17-51.74a131.695 131.695 0 0 1 29.64-43.62c25.39-25.3 59.14-39.81 95.36-39.81h111.57zm402.12-647.67a196.655 196.655 0 0 0-139.08-57.61H580.48c-3.03 0-4.82 2.43-4.82 4.82v757.16c-.6 2.99 1.79 5.42 5.42 5.42h118.23a196.69 196.69 0 0 0 139.08-57.61A196.655 196.655 0 0 0 896 699.31V325.29a196.69 196.69 0 0 0-57.61-139.08zm-111.3 441.92c-42.83 0-77.82-34.99-77.82-77.82s34.98-77.82 77.82-77.82c42.83 0 77.82 34.99 77.82 77.82s-34.99 77.82-77.82 77.82z"
          })
        ]));
      }
    });
    var switch_filled_default = switch_filled_vue_vue_type_script_setup_true_lang_default;
    var switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Switch",
      __name: "switch",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M118.656 438.656a32 32 0 0 1 0-45.248L416 96l4.48-3.776A32 32 0 0 1 461.248 96l3.712 4.48a32.064 32.064 0 0 1-3.712 40.832L218.56 384H928a32 32 0 1 1 0 64H141.248a32 32 0 0 1-22.592-9.344zM64 608a32 32 0 0 1 32-32h786.752a32 32 0 0 1 22.656 54.592L608 928l-4.48 3.776a32.064 32.064 0 0 1-40.832-49.024L805.632 640H96a32 32 0 0 1-32-32"
          })
        ]));
      }
    });
    var switch_default = switch_vue_vue_type_script_setup_true_lang_default;
    var takeaway_box_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TakeawayBox",
      __name: "takeaway-box",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M832 384H192v448h640zM96 320h832V128H96zm800 64v480a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V384H64a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32h896a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zM416 512h192a32 32 0 0 1 0 64H416a32 32 0 0 1 0-64"
          })
        ]));
      }
    });
    var takeaway_box_default = takeaway_box_vue_vue_type_script_setup_true_lang_default;
    var ticket_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Ticket",
      __name: "ticket",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 832H64V640a128 128 0 1 0 0-256V192h576v160h64V192h256v192a128 128 0 1 0 0 256v192H704V672h-64zm0-416v192h64V416z"
          })
        ]));
      }
    });
    var ticket_default = ticket_vue_vue_type_script_setup_true_lang_default;
    var tickets_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Tickets",
      __name: "tickets",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M192 128v768h640V128zm-32-64h704a32 32 0 0 1 32 32v832a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h192v64H320zm0 384h384v64H320z"
          })
        ]));
      }
    });
    var tickets_default = tickets_vue_vue_type_script_setup_true_lang_default;
    var timer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Timer",
      __name: "timer",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 896a320 320 0 1 0 0-640 320 320 0 0 0 0 640m0 64a384 384 0 1 1 0-768 384 384 0 0 1 0 768"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 320a32 32 0 0 1 32 32l-.512 224a32 32 0 1 1-64 0L480 352a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M448 576a64 64 0 1 0 128 0 64 64 0 1 0-128 0m96-448v128h-64V128h-96a32 32 0 0 1 0-64h256a32 32 0 1 1 0 64z"
          })
        ]));
      }
    });
    var timer_default = timer_vue_vue_type_script_setup_true_lang_default;
    var toilet_paper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ToiletPaper",
      __name: "toilet-paper",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M595.2 128H320a192 192 0 0 0-192 192v576h384V352c0-90.496 32.448-171.2 83.2-224M736 64c123.712 0 224 128.96 224 288S859.712 640 736 640H576v320H64V320A256 256 0 0 1 320 64zM576 352v224h160c84.352 0 160-97.28 160-224s-75.648-224-160-224-160 97.28-160 224"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M736 448c-35.328 0-64-43.008-64-96s28.672-96 64-96 64 43.008 64 96-28.672 96-64 96"
          })
        ]));
      }
    });
    var toilet_paper_default = toilet_paper_vue_vue_type_script_setup_true_lang_default;
    var tools_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Tools",
      __name: "tools",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M764.416 254.72a351.68 351.68 0 0 1 86.336 149.184H960v192.064H850.752a351.68 351.68 0 0 1-86.336 149.312l54.72 94.72-166.272 96-54.592-94.72a352.64 352.64 0 0 1-172.48 0L371.136 936l-166.272-96 54.72-94.72a351.68 351.68 0 0 1-86.336-149.312H64v-192h109.248a351.68 351.68 0 0 1 86.336-149.312L204.8 160l166.208-96h.192l54.656 94.592a352.64 352.64 0 0 1 172.48 0L652.8 64h.128L819.2 160l-54.72 94.72zM704 499.968a192 192 0 1 0-384 0 192 192 0 0 0 384 0"
          })
        ]));
      }
    });
    var tools_default = tools_vue_vue_type_script_setup_true_lang_default;
    var top_left_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TopLeft",
      __name: "top-left",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M256 256h416a32 32 0 1 0 0-64H224a32 32 0 0 0-32 32v448a32 32 0 0 0 64 0z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M246.656 201.344a32 32 0 0 0-45.312 45.312l544 544a32 32 0 0 0 45.312-45.312l-544-544z"
          })
        ]));
      }
    });
    var top_left_default = top_left_vue_vue_type_script_setup_true_lang_default;
    var top_right_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TopRight",
      __name: "top-right",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M768 256H353.6a32 32 0 1 1 0-64H800a32 32 0 0 1 32 32v448a32 32 0 0 1-64 0z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M777.344 201.344a32 32 0 0 1 45.312 45.312l-544 544a32 32 0 0 1-45.312-45.312l544-544z"
          })
        ]));
      }
    });
    var top_right_default = top_right_vue_vue_type_script_setup_true_lang_default;
    var top_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Top",
      __name: "top",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M572.235 205.282v600.365a30.118 30.118 0 1 1-60.235 0V205.282L292.382 438.633a28.913 28.913 0 0 1-42.646 0 33.43 33.43 0 0 1 0-45.236l271.058-288.045a28.913 28.913 0 0 1 42.647 0L834.5 393.397a33.43 33.43 0 0 1 0 45.176 28.913 28.913 0 0 1-42.647 0l-219.618-233.23z"
          })
        ]));
      }
    });
    var top_default = top_vue_vue_type_script_setup_true_lang_default;
    var trend_charts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TrendCharts",
      __name: "trend-charts",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 896V128h768v768zm291.712-327.296 128 102.4 180.16-201.792-47.744-42.624-139.84 156.608-128-102.4-180.16 201.792 47.744 42.624 139.84-156.608zM816 352a48 48 0 1 0-96 0 48 48 0 0 0 96 0"
          })
        ]));
      }
    });
    var trend_charts_default = trend_charts_vue_vue_type_script_setup_true_lang_default;
    var trophy_base_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TrophyBase",
      __name: "trophy-base",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M918.4 201.6c-6.4-6.4-12.8-9.6-22.4-9.6H768V96c0-9.6-3.2-16-9.6-22.4C752 67.2 745.6 64 736 64H288c-9.6 0-16 3.2-22.4 9.6C259.2 80 256 86.4 256 96v96H128c-9.6 0-16 3.2-22.4 9.6-6.4 6.4-9.6 16-9.6 22.4 3.2 108.8 25.6 185.6 64 224 34.4 34.4 77.56 55.65 127.65 61.99 10.91 20.44 24.78 39.25 41.95 56.41 40.86 40.86 91 65.47 150.4 71.9V768h-96c-9.6 0-16 3.2-22.4 9.6-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4c6.4 6.4 12.8 9.6 22.4 9.6h256c9.6 0 16-3.2 22.4-9.6 6.4-6.4 9.6-12.8 9.6-22.4s-3.2-16-9.6-22.4c-6.4-6.4-12.8-9.6-22.4-9.6h-96V637.26c59.4-7.71 109.54-30.01 150.4-70.86 17.2-17.2 31.51-36.06 42.81-56.55 48.93-6.51 90.02-27.7 126.79-61.85 38.4-38.4 60.8-112 64-224 0-6.4-3.2-16-9.6-22.4zM256 438.4c-19.2-6.4-35.2-19.2-51.2-35.2-22.4-22.4-35.2-70.4-41.6-147.2H256zm390.4 80C608 553.6 566.4 576 512 576s-99.2-19.2-134.4-57.6C342.4 480 320 438.4 320 384V128h384v256c0 54.4-19.2 99.2-57.6 134.4m172.8-115.2c-16 16-32 25.6-51.2 35.2V256h92.8c-6.4 76.8-19.2 124.8-41.6 147.2zM768 896H256c-9.6 0-16 3.2-22.4 9.6-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4c6.4 6.4 12.8 9.6 22.4 9.6h512c9.6 0 16-3.2 22.4-9.6 6.4-6.4 9.6-12.8 9.6-22.4s-3.2-16-9.6-22.4c-6.4-6.4-12.8-9.6-22.4-9.6"
          })
        ]));
      }
    });
    var trophy_base_default = trophy_base_vue_vue_type_script_setup_true_lang_default;
    var trophy_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Trophy",
      __name: "trophy",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 896V702.08A256.256 256.256 0 0 1 264.064 512h-32.64a96 96 0 0 1-91.968-68.416L93.632 290.88a76.8 76.8 0 0 1 73.6-98.88H256V96a32 32 0 0 1 32-32h448a32 32 0 0 1 32 32v96h88.768a76.8 76.8 0 0 1 73.6 98.88L884.48 443.52A96 96 0 0 1 792.576 512h-32.64A256.256 256.256 0 0 1 544 702.08V896h128a32 32 0 1 1 0 64H352a32 32 0 1 1 0-64zm224-448V128H320v320a192 192 0 1 0 384 0m64 0h24.576a32 32 0 0 0 30.656-22.784l45.824-152.768A12.8 12.8 0 0 0 856.768 256H768zm-512 0V256h-88.768a12.8 12.8 0 0 0-12.288 16.448l45.824 152.768A32 32 0 0 0 231.424 448z"
          })
        ]));
      }
    });
    var trophy_default = trophy_vue_vue_type_script_setup_true_lang_default;
    var turn_off_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "TurnOff",
      __name: "turn-off",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M329.956 257.138a254.862 254.862 0 0 0 0 509.724h364.088a254.862 254.862 0 0 0 0-509.724zm0-72.818h364.088a327.68 327.68 0 1 1 0 655.36H329.956a327.68 327.68 0 1 1 0-655.36z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M329.956 621.227a109.227 109.227 0 1 0 0-218.454 109.227 109.227 0 0 0 0 218.454m0 72.817a182.044 182.044 0 1 1 0-364.088 182.044 182.044 0 0 1 0 364.088"
          })
        ]));
      }
    });
    var turn_off_default = turn_off_vue_vue_type_script_setup_true_lang_default;
    var umbrella_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Umbrella",
      __name: "umbrella",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M320 768a32 32 0 1 1 64 0 64 64 0 0 0 128 0V512H64a448 448 0 1 1 896 0H576v256a128 128 0 1 1-256 0m570.688-320a384.128 384.128 0 0 0-757.376 0z"
          })
        ]));
      }
    });
    var umbrella_default = umbrella_vue_vue_type_script_setup_true_lang_default;
    var unlock_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Unlock",
      __name: "unlock",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M224 448a32 32 0 0 0-32 32v384a32 32 0 0 0 32 32h576a32 32 0 0 0 32-32V480a32 32 0 0 0-32-32zm0-64h576a96 96 0 0 1 96 96v384a96 96 0 0 1-96 96H224a96 96 0 0 1-96-96V480a96 96 0 0 1 96-96"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 544a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V576a32 32 0 0 1 32-32m178.304-295.296A192.064 192.064 0 0 0 320 320v64h352l96 38.4V448H256V320a256 256 0 0 1 493.76-95.104z"
          })
        ]));
      }
    });
    var unlock_default = unlock_vue_vue_type_script_setup_true_lang_default;
    var upload_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "UploadFilled",
      __name: "upload-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M544 864V672h128L512 480 352 672h128v192H320v-1.6c-5.376.32-10.496 1.6-16 1.6A240 240 0 0 1 64 624c0-123.136 93.12-223.488 212.608-237.248A239.808 239.808 0 0 1 512 192a239.872 239.872 0 0 1 235.456 194.752c119.488 13.76 212.48 114.112 212.48 237.248a240 240 0 0 1-240 240c-5.376 0-10.56-1.28-16-1.6v1.6z"
          })
        ]));
      }
    });
    var upload_filled_default = upload_filled_vue_vue_type_script_setup_true_lang_default;
    var upload_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Upload",
      __name: "upload",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"
          })
        ]));
      }
    });
    var upload_default = upload_vue_vue_type_script_setup_true_lang_default;
    var user_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "UserFilled",
      __name: "user-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M288 320a224 224 0 1 0 448 0 224 224 0 1 0-448 0m544 608H160a32 32 0 0 1-32-32v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 0 1-32 32z"
          })
        ]));
      }
    });
    var user_filled_default = user_filled_vue_vue_type_script_setup_true_lang_default;
    var user_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "User",
      __name: "user",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0"
          })
        ]));
      }
    });
    var user_default = user_vue_vue_type_script_setup_true_lang_default;
    var van_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Van",
      __name: "van",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128.896 736H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32v96h164.544a32 32 0 0 1 31.616 27.136l54.144 352A32 32 0 0 1 922.688 736h-91.52a144 144 0 1 1-286.272 0H415.104a144 144 0 1 1-286.272 0zm23.36-64a143.872 143.872 0 0 1 239.488 0H568.32c17.088-25.6 42.24-45.376 71.744-55.808V256H128v416zm655.488 0h77.632l-19.648-128H704v64.896A144 144 0 0 1 807.744 672m48.128-192-14.72-96H704v96h151.872M688 832a80 80 0 1 0 0-160 80 80 0 0 0 0 160m-416 0a80 80 0 1 0 0-160 80 80 0 0 0 0 160"
          })
        ]));
      }
    });
    var van_default = van_vue_vue_type_script_setup_true_lang_default;
    var video_camera_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "VideoCameraFilled",
      __name: "video-camera-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m768 576 192-64v320l-192-64v96a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V480a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zM192 768v64h384v-64zm192-480a160 160 0 0 1 320 0 160 160 0 0 1-320 0m64 0a96 96 0 1 0 192.064-.064A96 96 0 0 0 448 288m-320 32a128 128 0 1 1 256.064.064A128 128 0 0 1 128 320m64 0a64 64 0 1 0 128 0 64 64 0 0 0-128 0"
          })
        ]));
      }
    });
    var video_camera_filled_default = video_camera_filled_vue_vue_type_script_setup_true_lang_default;
    var video_camera_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "VideoCamera",
      __name: "video-camera",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"
          })
        ]));
      }
    });
    var video_camera_default = video_camera_vue_vue_type_script_setup_true_lang_default;
    var video_pause_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "VideoPause",
      __name: "video-pause",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-96-544q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32m192 0q32 0 32 32v256q0 32-32 32t-32-32V384q0-32 32-32"
          })
        ]));
      }
    });
    var video_pause_default = video_pause_vue_vue_type_script_setup_true_lang_default;
    var video_play_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "VideoPlay",
      __name: "video-play",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m-48-247.616L668.608 512 464 375.616zm10.624-342.656 249.472 166.336a48 48 0 0 1 0 79.872L474.624 718.272A48 48 0 0 1 400 678.336V345.6a48 48 0 0 1 74.624-39.936z"
          })
        ]));
      }
    });
    var video_play_default = video_play_vue_vue_type_script_setup_true_lang_default;
    var view_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "View",
      __name: "view",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
          })
        ]));
      }
    });
    var view_default = view_vue_vue_type_script_setup_true_lang_default;
    var wallet_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "WalletFilled",
      __name: "wallet-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M688 512a112 112 0 1 0 0 224h208v160H128V352h768v160zm32 160h-32a48 48 0 0 1 0-96h32a48 48 0 0 1 0 96m-80-544 128 160H384z"
          })
        ]));
      }
    });
    var wallet_filled_default = wallet_filled_vue_vue_type_script_setup_true_lang_default;
    var wallet_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Wallet",
      __name: "wallet",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M640 288h-64V128H128v704h384v32a32 32 0 0 0 32 32H96a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32z"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M128 320v512h768V320zm-32-64h832a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M704 640a64 64 0 1 1 0-128 64 64 0 0 1 0 128"
          })
        ]));
      }
    });
    var wallet_default = wallet_vue_vue_type_script_setup_true_lang_default;
    var warn_triangle_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "WarnTriangleFilled",
      __name: "warn-triangle-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          "xml:space": "preserve",
          style: { "enable-background": "new 0 0 1024 1024" },
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M928.99 755.83 574.6 203.25c-12.89-20.16-36.76-32.58-62.6-32.58s-49.71 12.43-62.6 32.58L95.01 755.83c-12.91 20.12-12.9 44.91.01 65.03 12.92 20.12 36.78 32.51 62.59 32.49h708.78c25.82.01 49.68-12.37 62.59-32.49 12.91-20.12 12.92-44.91.01-65.03M554.67 768h-85.33v-85.33h85.33zm0-426.67v298.66h-85.33V341.32z"
          })
        ]));
      }
    });
    var warn_triangle_filled_default = warn_triangle_filled_vue_vue_type_script_setup_true_lang_default;
    var warning_filled_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "WarningFilled",
      __name: "warning-filled",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
          })
        ]));
      }
    });
    var warning_filled_default = warning_filled_vue_vue_type_script_setup_true_lang_default;
    var warning_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Warning",
      __name: "warning",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
          })
        ]));
      }
    });
    var warning_default = warning_vue_vue_type_script_setup_true_lang_default;
    var watch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Watch",
      __name: "watch",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M512 768a256 256 0 1 0 0-512 256 256 0 0 0 0 512m0 64a320 320 0 1 1 0-640 320 320 0 0 1 0 640"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 352a32 32 0 0 1 32 32v160a32 32 0 0 1-64 0V384a32 32 0 0 1 32-32"
          }),
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M480 512h128q32 0 32 32t-32 32H480q-32 0-32-32t32-32m128-256V128H416v128h-64V64h320v192zM416 768v128h192V768h64v192H352V768z"
          })
        ]));
      }
    });
    var watch_default = watch_vue_vue_type_script_setup_true_lang_default;
    var watermelon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "Watermelon",
      __name: "watermelon",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m683.072 600.32-43.648 162.816-61.824-16.512 53.248-198.528L576 493.248l-158.4 158.4-45.248-45.248 158.4-158.4-55.616-55.616-198.528 53.248-16.512-61.824 162.816-43.648L282.752 200A384 384 0 0 0 824 741.248zm231.552 141.056a448 448 0 1 1-632-632l632 632"
          })
        ]));
      }
    });
    var watermelon_default = watermelon_vue_vue_type_script_setup_true_lang_default;
    var wind_power_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "WindPower",
      __name: "wind-power",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "M160 64q32 0 32 32v832q0 32-32 32t-32-32V96q0-32 32-32m416 354.624 128-11.584V168.96l-128-11.52v261.12zm-64 5.824V151.552L320 134.08V160h-64V64l616.704 56.064A96 96 0 0 1 960 215.68v144.64a96 96 0 0 1-87.296 95.616L256 512V224h64v217.92zm256-23.232 98.88-8.96A32 32 0 0 0 896 360.32V215.68a32 32 0 0 0-29.12-31.872l-98.88-8.96z"
          })
        ]));
      }
    });
    var wind_power_default = wind_power_vue_vue_type_script_setup_true_lang_default;
    var zoom_in_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ZoomIn",
      __name: "zoom-in",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
          })
        ]));
      }
    });
    var zoom_in_default = zoom_in_vue_vue_type_script_setup_true_lang_default;
    var zoom_out_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
      name: "ZoomOut",
      __name: "zoom-out",
      setup(__props) {
        return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
          xmlns: "http://www.w3.org/2000/svg",
          viewBox: "0 0 1024 1024"
        }, [
          createBaseVNode("path", {
            fill: "currentColor",
            d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
          })
        ]));
      }
    });
    var zoom_out_default = zoom_out_vue_vue_type_script_setup_true_lang_default;
    const ElementPlusIconsVue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      AddLocation: add_location_default,
      Aim: aim_default,
      AlarmClock: alarm_clock_default,
      Apple: apple_default,
      ArrowDown: arrow_down_default,
      ArrowDownBold: arrow_down_bold_default,
      ArrowLeft: arrow_left_default,
      ArrowLeftBold: arrow_left_bold_default,
      ArrowRight: arrow_right_default,
      ArrowRightBold: arrow_right_bold_default,
      ArrowUp: arrow_up_default,
      ArrowUpBold: arrow_up_bold_default,
      Avatar: avatar_default,
      Back: back_default,
      Baseball: baseball_default,
      Basketball: basketball_default,
      Bell: bell_default,
      BellFilled: bell_filled_default,
      Bicycle: bicycle_default,
      Bottom: bottom_default,
      BottomLeft: bottom_left_default,
      BottomRight: bottom_right_default,
      Bowl: bowl_default,
      Box: box_default,
      Briefcase: briefcase_default,
      Brush: brush_default,
      BrushFilled: brush_filled_default,
      Burger: burger_default,
      Calendar: calendar_default,
      Camera: camera_default,
      CameraFilled: camera_filled_default,
      CaretBottom: caret_bottom_default,
      CaretLeft: caret_left_default,
      CaretRight: caret_right_default,
      CaretTop: caret_top_default,
      Cellphone: cellphone_default,
      ChatDotRound: chat_dot_round_default,
      ChatDotSquare: chat_dot_square_default,
      ChatLineRound: chat_line_round_default,
      ChatLineSquare: chat_line_square_default,
      ChatRound: chat_round_default,
      ChatSquare: chat_square_default,
      Check: check_default,
      Checked: checked_default,
      Cherry: cherry_default,
      Chicken: chicken_default,
      ChromeFilled: chrome_filled_default,
      CircleCheck: circle_check_default,
      CircleCheckFilled: circle_check_filled_default,
      CircleClose: circle_close_default,
      CircleCloseFilled: circle_close_filled_default,
      CirclePlus: circle_plus_default,
      CirclePlusFilled: circle_plus_filled_default,
      Clock: clock_default,
      Close: close_default,
      CloseBold: close_bold_default,
      Cloudy: cloudy_default,
      Coffee: coffee_default,
      CoffeeCup: coffee_cup_default,
      Coin: coin_default,
      ColdDrink: cold_drink_default,
      Collection: collection_default,
      CollectionTag: collection_tag_default,
      Comment: comment_default,
      Compass: compass_default,
      Connection: connection_default,
      Coordinate: coordinate_default,
      CopyDocument: copy_document_default,
      Cpu: cpu_default,
      CreditCard: credit_card_default,
      Crop: crop_default,
      DArrowLeft: d_arrow_left_default,
      DArrowRight: d_arrow_right_default,
      DCaret: d_caret_default,
      DataAnalysis: data_analysis_default,
      DataBoard: data_board_default,
      DataLine: data_line_default,
      Delete: delete_default,
      DeleteFilled: delete_filled_default,
      DeleteLocation: delete_location_default,
      Dessert: dessert_default,
      Discount: discount_default,
      Dish: dish_default,
      DishDot: dish_dot_default,
      Document: document_default,
      DocumentAdd: document_add_default,
      DocumentChecked: document_checked_default,
      DocumentCopy: document_copy_default,
      DocumentDelete: document_delete_default,
      DocumentRemove: document_remove_default,
      Download: download_default,
      Drizzling: drizzling_default,
      Edit: edit_default,
      EditPen: edit_pen_default,
      Eleme: eleme_default,
      ElemeFilled: eleme_filled_default,
      ElementPlus: element_plus_default,
      Expand: expand_default,
      Failed: failed_default,
      Female: female_default,
      Files: files_default,
      Film: film_default,
      Filter: filter_default,
      Finished: finished_default,
      FirstAidKit: first_aid_kit_default,
      Flag: flag_default,
      Fold: fold_default,
      Folder: folder_default,
      FolderAdd: folder_add_default,
      FolderChecked: folder_checked_default,
      FolderDelete: folder_delete_default,
      FolderOpened: folder_opened_default,
      FolderRemove: folder_remove_default,
      Food: food_default,
      Football: football_default,
      ForkSpoon: fork_spoon_default,
      Fries: fries_default,
      FullScreen: full_screen_default,
      Goblet: goblet_default,
      GobletFull: goblet_full_default,
      GobletSquare: goblet_square_default,
      GobletSquareFull: goblet_square_full_default,
      GoldMedal: gold_medal_default,
      Goods: goods_default,
      GoodsFilled: goods_filled_default,
      Grape: grape_default,
      Grid: grid_default,
      Guide: guide_default,
      Handbag: handbag_default,
      Headset: headset_default,
      Help: help_default,
      HelpFilled: help_filled_default,
      Hide: hide_default,
      Histogram: histogram_default,
      HomeFilled: home_filled_default,
      HotWater: hot_water_default,
      House: house_default,
      IceCream: ice_cream_default,
      IceCreamRound: ice_cream_round_default,
      IceCreamSquare: ice_cream_square_default,
      IceDrink: ice_drink_default,
      IceTea: ice_tea_default,
      InfoFilled: info_filled_default,
      Iphone: iphone_default,
      Key: key_default,
      KnifeFork: knife_fork_default,
      Lightning: lightning_default,
      Link: link_default,
      List: list_default,
      Loading: loading_default,
      Location: location_default,
      LocationFilled: location_filled_default,
      LocationInformation: location_information_default,
      Lock: lock_default,
      Lollipop: lollipop_default,
      MagicStick: magic_stick_default,
      Magnet: magnet_default,
      Male: male_default,
      Management: management_default,
      MapLocation: map_location_default,
      Medal: medal_default,
      Memo: memo_default,
      Menu: menu_default,
      Message: message_default,
      MessageBox: message_box_default,
      Mic: mic_default,
      Microphone: microphone_default,
      MilkTea: milk_tea_default,
      Minus: minus_default,
      Money: money_default,
      Monitor: monitor_default,
      Moon: moon_default,
      MoonNight: moon_night_default,
      More: more_default,
      MoreFilled: more_filled_default,
      MostlyCloudy: mostly_cloudy_default,
      Mouse: mouse_default,
      Mug: mug_default,
      Mute: mute_default,
      MuteNotification: mute_notification_default,
      NoSmoking: no_smoking_default,
      Notebook: notebook_default,
      Notification: notification_default,
      Odometer: odometer_default,
      OfficeBuilding: office_building_default,
      Open: open_default,
      Operation: operation_default,
      Opportunity: opportunity_default,
      Orange: orange_default,
      Paperclip: paperclip_default,
      PartlyCloudy: partly_cloudy_default,
      Pear: pear_default,
      Phone: phone_default,
      PhoneFilled: phone_filled_default,
      Picture: picture_default,
      PictureFilled: picture_filled_default,
      PictureRounded: picture_rounded_default,
      PieChart: pie_chart_default,
      Place: place_default,
      Platform: platform_default,
      Plus: plus_default,
      Pointer: pointer_default,
      Position: position_default,
      Postcard: postcard_default,
      Pouring: pouring_default,
      Present: present_default,
      PriceTag: price_tag_default,
      Printer: printer_default,
      Promotion: promotion_default,
      QuartzWatch: quartz_watch_default,
      QuestionFilled: question_filled_default,
      Rank: rank_default,
      Reading: reading_default,
      ReadingLamp: reading_lamp_default,
      Refresh: refresh_default,
      RefreshLeft: refresh_left_default,
      RefreshRight: refresh_right_default,
      Refrigerator: refrigerator_default,
      Remove: remove_default,
      RemoveFilled: remove_filled_default,
      Right: right_default,
      ScaleToOriginal: scale_to_original_default,
      School: school_default,
      Scissor: scissor_default,
      Search: search_default,
      Select: select_default,
      Sell: sell_default,
      SemiSelect: semi_select_default,
      Service: service_default,
      SetUp: set_up_default,
      Setting: setting_default,
      Share: share_default,
      Ship: ship_default,
      Shop: shop_default,
      ShoppingBag: shopping_bag_default,
      ShoppingCart: shopping_cart_default,
      ShoppingCartFull: shopping_cart_full_default,
      ShoppingTrolley: shopping_trolley_default,
      Smoking: smoking_default,
      Soccer: soccer_default,
      SoldOut: sold_out_default,
      Sort: sort_default,
      SortDown: sort_down_default,
      SortUp: sort_up_default,
      Stamp: stamp_default,
      Star: star_default,
      StarFilled: star_filled_default,
      Stopwatch: stopwatch_default,
      SuccessFilled: success_filled_default,
      Sugar: sugar_default,
      Suitcase: suitcase_default,
      SuitcaseLine: suitcase_line_default,
      Sunny: sunny_default,
      Sunrise: sunrise_default,
      Sunset: sunset_default,
      Switch: switch_default,
      SwitchButton: switch_button_default,
      SwitchFilled: switch_filled_default,
      TakeawayBox: takeaway_box_default,
      Ticket: ticket_default,
      Tickets: tickets_default,
      Timer: timer_default,
      ToiletPaper: toilet_paper_default,
      Tools: tools_default,
      Top: top_default,
      TopLeft: top_left_default,
      TopRight: top_right_default,
      TrendCharts: trend_charts_default,
      Trophy: trophy_default,
      TrophyBase: trophy_base_default,
      TurnOff: turn_off_default,
      Umbrella: umbrella_default,
      Unlock: unlock_default,
      Upload: upload_default,
      UploadFilled: upload_filled_default,
      User: user_default,
      UserFilled: user_filled_default,
      Van: van_default,
      VideoCamera: video_camera_default,
      VideoCameraFilled: video_camera_filled_default,
      VideoPause: video_pause_default,
      VideoPlay: video_play_default,
      View: view_default,
      Wallet: wallet_default,
      WalletFilled: wallet_filled_default,
      WarnTriangleFilled: warn_triangle_filled_default,
      Warning: warning_default,
      WarningFilled: warning_filled_default,
      Watch: watch_default,
      Watermelon: watermelon_default,
      WindPower: wind_power_default,
      ZoomIn: zoom_in_default,
      ZoomOut: zoom_out_default
    }, Symbol.toStringTag, { value: "Module" }));
    const iconPropType = definePropType([
      String,
      Object,
      Function
    ]);
    const CloseComponents = {
      Close: close_default
    };
    const TypeComponents = {
      Close: close_default,
      SuccessFilled: success_filled_default,
      InfoFilled: info_filled_default,
      WarningFilled: warning_filled_default,
      CircleCloseFilled: circle_close_filled_default
    };
    const TypeComponentsMap = {
      success: success_filled_default,
      warning: warning_filled_default,
      error: circle_close_filled_default,
      info: info_filled_default
    };
    const ValidateComponentsMap = {
      validating: loading_default,
      success: circle_check_default,
      error: circle_close_default
    };
    const alertEffects = ["light", "dark"];
    const alertProps = buildProps({
      title: {
        type: String,
        default: ""
      },
      description: {
        type: String,
        default: ""
      },
      type: {
        type: String,
        values: keysOf(TypeComponentsMap),
        default: "info"
      },
      closable: {
        type: Boolean,
        default: true
      },
      closeText: {
        type: String,
        default: ""
      },
      showIcon: Boolean,
      center: Boolean,
      effect: {
        type: String,
        values: alertEffects,
        default: "light"
      }
    });
    const alertEmits = {
      close: (evt) => evt instanceof MouseEvent
    };
    const __default__$1S = /* @__PURE__ */ defineComponent({
      name: "ElAlert"
    });
    const _sfc_main$2D = /* @__PURE__ */ defineComponent({
      ...__default__$1S,
      props: alertProps,
      emits: alertEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { Close } = TypeComponents;
        const slots = useSlots();
        const ns = useNamespace("alert");
        const visible = ref(true);
        const iconComponent = computed(() => TypeComponentsMap[props2.type]);
        const hasDesc = computed(() => !!(props2.description || slots.default));
        const close2 = (evt) => {
          visible.value = false;
          emit2("close", evt);
        };
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, {
            name: unref(ns).b("fade"),
            persisted: ""
          }, {
            default: withCtx(() => [
              withDirectives(createBaseVNode("div", {
                class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.type), unref(ns).is("center", _ctx.center), unref(ns).is(_ctx.effect)]),
                role: "alert"
              }, [
                _ctx.showIcon && (_ctx.$slots.icon || unref(iconComponent)) ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 0,
                  class: normalizeClass([unref(ns).e("icon"), { [unref(ns).is("big")]: unref(hasDesc) }])
                }, {
                  default: withCtx(() => [
                    renderSlot(_ctx.$slots, "icon", {}, () => [
                      (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
                    ])
                  ]),
                  _: 3
                }, 8, ["class"])) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("content"))
                }, [
                  _ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    class: normalizeClass([unref(ns).e("title"), { "with-description": unref(hasDesc) }])
                  }, [
                    renderSlot(_ctx.$slots, "title", {}, () => [
                      createTextVNode(toDisplayString(_ctx.title), 1)
                    ])
                  ], 2)) : createCommentVNode("v-if", true),
                  unref(hasDesc) ? (openBlock(), createElementBlock("p", {
                    key: 1,
                    class: normalizeClass(unref(ns).e("description"))
                  }, [
                    renderSlot(_ctx.$slots, "default", {}, () => [
                      createTextVNode(toDisplayString(_ctx.description), 1)
                    ])
                  ], 2)) : createCommentVNode("v-if", true),
                  _ctx.closable ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
                    _ctx.closeText ? (openBlock(), createElementBlock("div", {
                      key: 0,
                      class: normalizeClass([unref(ns).e("close-btn"), unref(ns).is("customed")]),
                      onClick: close2
                    }, toDisplayString(_ctx.closeText), 3)) : (openBlock(), createBlock(unref(ElIcon), {
                      key: 1,
                      class: normalizeClass(unref(ns).e("close-btn")),
                      onClick: close2
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(Close))
                      ]),
                      _: 1
                    }, 8, ["class"]))
                  ], 64)) : createCommentVNode("v-if", true)
                ], 2)
              ], 2), [
                [vShow, visible.value]
              ])
            ]),
            _: 3
          }, 8, ["name"]);
        };
      }
    });
    var Alert = /* @__PURE__ */ _export_sfc(_sfc_main$2D, [["__file", "alert.vue"]]);
    const ElAlert = withInstall(Alert);
    const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
    let hiddenTextarea = void 0;
    const HIDDEN_STYLE = {
      height: "0",
      visibility: "hidden",
      overflow: isFirefox() ? "" : "hidden",
      position: "absolute",
      "z-index": "-1000",
      top: "0",
      right: "0"
    };
    const CONTEXT_STYLE = [
      "letter-spacing",
      "line-height",
      "padding-top",
      "padding-bottom",
      "font-family",
      "font-weight",
      "font-size",
      "text-rendering",
      "text-transform",
      "width",
      "text-indent",
      "padding-left",
      "padding-right",
      "border-width",
      "box-sizing"
    ];
    function calculateNodeStyling(targetElement) {
      const style = window.getComputedStyle(targetElement);
      const boxSizing = style.getPropertyValue("box-sizing");
      const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
      const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
      const contextStyle = CONTEXT_STYLE.map((name) => [
        name,
        style.getPropertyValue(name)
      ]);
      return { contextStyle, paddingSize, borderSize, boxSizing };
    }
    function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
      var _a2;
      if (!hiddenTextarea) {
        hiddenTextarea = document.createElement("textarea");
        document.body.appendChild(hiddenTextarea);
      }
      const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
      contextStyle.forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value));
      Object.entries(HIDDEN_STYLE).forEach(([key, value]) => hiddenTextarea == null ? void 0 : hiddenTextarea.style.setProperty(key, value, "important"));
      hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
      let height = hiddenTextarea.scrollHeight;
      const result = {};
      if (boxSizing === "border-box") {
        height = height + borderSize;
      } else if (boxSizing === "content-box") {
        height = height - paddingSize;
      }
      hiddenTextarea.value = "";
      const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
      if (isNumber$2(minRows)) {
        let minHeight = singleRowHeight * minRows;
        if (boxSizing === "border-box") {
          minHeight = minHeight + paddingSize + borderSize;
        }
        height = Math.max(minHeight, height);
        result.minHeight = `${minHeight}px`;
      }
      if (isNumber$2(maxRows)) {
        let maxHeight = singleRowHeight * maxRows;
        if (boxSizing === "border-box") {
          maxHeight = maxHeight + paddingSize + borderSize;
        }
        height = Math.min(maxHeight, height);
      }
      result.height = `${height}px`;
      (_a2 = hiddenTextarea.parentNode) == null ? void 0 : _a2.removeChild(hiddenTextarea);
      hiddenTextarea = void 0;
      return result;
    }
    const mutable = (val) => val;
    const ariaProps = buildProps({
      ariaLabel: String,
      ariaOrientation: {
        type: String,
        values: ["horizontal", "vertical", "undefined"]
      },
      ariaControls: String
    });
    const useAriaProps = (arias) => {
      return pick(ariaProps, arias);
    };
    const inputProps = buildProps({
      id: {
        type: String,
        default: void 0
      },
      size: useSizeProp,
      disabled: Boolean,
      modelValue: {
        type: definePropType([
          String,
          Number,
          Object
        ]),
        default: ""
      },
      maxlength: {
        type: [String, Number]
      },
      minlength: {
        type: [String, Number]
      },
      type: {
        type: String,
        default: "text"
      },
      resize: {
        type: String,
        values: ["none", "both", "horizontal", "vertical"]
      },
      autosize: {
        type: definePropType([Boolean, Object]),
        default: false
      },
      autocomplete: {
        type: String,
        default: "off"
      },
      formatter: {
        type: Function
      },
      parser: {
        type: Function
      },
      placeholder: {
        type: String
      },
      form: {
        type: String
      },
      readonly: Boolean,
      clearable: Boolean,
      showPassword: Boolean,
      showWordLimit: Boolean,
      suffixIcon: {
        type: iconPropType
      },
      prefixIcon: {
        type: iconPropType
      },
      containerRole: {
        type: String,
        default: void 0
      },
      tabindex: {
        type: [String, Number],
        default: 0
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      inputStyle: {
        type: definePropType([Object, Array, String]),
        default: () => mutable({})
      },
      autofocus: Boolean,
      rows: {
        type: Number,
        default: 2
      },
      ...useAriaProps(["ariaLabel"])
    });
    const inputEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isString$3(value),
      input: (value) => isString$3(value),
      change: (value) => isString$3(value),
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent,
      clear: () => true,
      mouseleave: (evt) => evt instanceof MouseEvent,
      mouseenter: (evt) => evt instanceof MouseEvent,
      keydown: (evt) => evt instanceof Event,
      compositionstart: (evt) => evt instanceof CompositionEvent,
      compositionupdate: (evt) => evt instanceof CompositionEvent,
      compositionend: (evt) => evt instanceof CompositionEvent
    };
    const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
    const LISTENER_PREFIX = /^on[A-Z]/;
    const useAttrs = (params = {}) => {
      const { excludeListeners = false, excludeKeys } = params;
      const allExcludeKeys = computed(() => {
        return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
      });
      const instance = getCurrentInstance();
      if (!instance) {
        return computed(() => ({}));
      }
      return computed(() => {
        var _a2;
        return fromPairs(Object.entries((_a2 = instance.proxy) == null ? void 0 : _a2.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
      });
    };
    const formContextKey = Symbol("formContextKey");
    const formItemContextKey = Symbol("formItemContextKey");
    const defaultIdInjection = {
      prefix: Math.floor(Math.random() * 1e4),
      current: 0
    };
    const ID_INJECTION_KEY = Symbol("elIdInjection");
    const useIdInjection = () => {
      return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
    };
    const useId = (deterministicId) => {
      const idInjection = useIdInjection();
      const namespace = useGetDerivedNamespace();
      const idRef = computedEager(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
      return idRef;
    };
    const useFormItem = () => {
      const form = inject(formContextKey, void 0);
      const formItem = inject(formItemContextKey, void 0);
      return {
        form,
        formItem
      };
    };
    const useFormItemInputId = (props2, {
      formItemContext,
      disableIdGeneration,
      disableIdManagement
    }) => {
      if (!disableIdGeneration) {
        disableIdGeneration = ref(false);
      }
      if (!disableIdManagement) {
        disableIdManagement = ref(false);
      }
      const inputId = ref();
      let idUnwatch = void 0;
      const isLabeledByFormItem = computed(() => {
        var _a2;
        return !!(!(props2.label || props2.ariaLabel) && formItemContext && formItemContext.inputIds && ((_a2 = formItemContext.inputIds) == null ? void 0 : _a2.length) <= 1);
      });
      onMounted(() => {
        idUnwatch = watch([toRef(props2, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
          const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
          if (newId !== inputId.value) {
            if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
              inputId.value && formItemContext.removeInputId(inputId.value);
              if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
                formItemContext.addInputId(newId);
              }
            }
            inputId.value = newId;
          }
        }, { immediate: true });
      });
      onUnmounted(() => {
        idUnwatch && idUnwatch();
        if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
          inputId.value && formItemContext.removeInputId(inputId.value);
        }
      });
      return {
        isLabeledByFormItem,
        inputId
      };
    };
    const useProp = (name) => {
      const vm = getCurrentInstance();
      return computed(() => {
        var _a2, _b2;
        return (_b2 = (_a2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a2.$props) == null ? void 0 : _b2[name];
      });
    };
    const useFormSize = (fallback, ignore = {}) => {
      const emptyRef = ref(void 0);
      const size = ignore.prop ? emptyRef : useProp("size");
      const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
      const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
      const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
      return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "");
    };
    const useFormDisabled = (fallback) => {
      const disabled = useProp("disabled");
      const form = inject(formContextKey, void 0);
      return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
    };
    function useFocusController(target, {
      beforeFocus,
      afterFocus,
      beforeBlur,
      afterBlur
    } = {}) {
      const instance = getCurrentInstance();
      const { emit: emit2 } = instance;
      const wrapperRef = shallowRef();
      const disabled = useProp("disabled");
      const isFocused = ref(false);
      const handleFocus = (event) => {
        const cancelFocus = isFunction$4(beforeFocus) ? beforeFocus(event) : false;
        if (cancelFocus || isFocused.value)
          return;
        isFocused.value = true;
        emit2("focus", event);
        afterFocus == null ? void 0 : afterFocus();
      };
      const handleBlur = (event) => {
        var _a2;
        const cancelBlur = isFunction$4(beforeBlur) ? beforeBlur(event) : false;
        if (cancelBlur || event.relatedTarget && ((_a2 = wrapperRef.value) == null ? void 0 : _a2.contains(event.relatedTarget)))
          return;
        isFocused.value = false;
        emit2("blur", event);
        afterBlur == null ? void 0 : afterBlur();
      };
      const handleClick = () => {
        var _a2, _b2;
        if (((_a2 = wrapperRef.value) == null ? void 0 : _a2.contains(document.activeElement)) && wrapperRef.value !== document.activeElement || disabled.value)
          return;
        (_b2 = target.value) == null ? void 0 : _b2.focus();
      };
      watch([wrapperRef, disabled], ([el, disabled2]) => {
        if (!el)
          return;
        if (disabled2) {
          el.removeAttribute("tabindex");
        } else {
          el.setAttribute("tabindex", "-1");
        }
      });
      useEventListener(wrapperRef, "focus", handleFocus, true);
      useEventListener(wrapperRef, "blur", handleBlur, true);
      useEventListener(wrapperRef, "click", handleClick, true);
      return {
        isFocused,
        wrapperRef,
        handleFocus,
        handleBlur
      };
    }
    const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
    function useComposition({
      afterComposition,
      emit: emit2
    }) {
      const isComposing = ref(false);
      const handleCompositionStart = (event) => {
        emit2 == null ? void 0 : emit2("compositionstart", event);
        isComposing.value = true;
      };
      const handleCompositionUpdate = (event) => {
        var _a2;
        emit2 == null ? void 0 : emit2("compositionupdate", event);
        const text = (_a2 = event.target) == null ? void 0 : _a2.value;
        const lastCharacter = text[text.length - 1] || "";
        isComposing.value = !isKorean(lastCharacter);
      };
      const handleCompositionEnd = (event) => {
        emit2 == null ? void 0 : emit2("compositionend", event);
        if (isComposing.value) {
          isComposing.value = false;
          nextTick(() => afterComposition(event));
        }
      };
      const handleComposition = (event) => {
        event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
      };
      return {
        isComposing,
        handleComposition,
        handleCompositionStart,
        handleCompositionUpdate,
        handleCompositionEnd
      };
    }
    function useCursor(input) {
      let selectionInfo;
      function recordCursor() {
        if (input.value == void 0)
          return;
        const { selectionStart, selectionEnd, value } = input.value;
        if (selectionStart == null || selectionEnd == null)
          return;
        const beforeTxt = value.slice(0, Math.max(0, selectionStart));
        const afterTxt = value.slice(Math.max(0, selectionEnd));
        selectionInfo = {
          selectionStart,
          selectionEnd,
          value,
          beforeTxt,
          afterTxt
        };
      }
      function setCursor() {
        if (input.value == void 0 || selectionInfo == void 0)
          return;
        const { value } = input.value;
        const { beforeTxt, afterTxt, selectionStart } = selectionInfo;
        if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
          return;
        let startPos = value.length;
        if (value.endsWith(afterTxt)) {
          startPos = value.length - afterTxt.length;
        } else if (value.startsWith(beforeTxt)) {
          startPos = beforeTxt.length;
        } else {
          const beforeLastChar = beforeTxt[selectionStart - 1];
          const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
          if (newIndex !== -1) {
            startPos = newIndex + 1;
          }
        }
        input.value.setSelectionRange(startPos, startPos);
      }
      return [recordCursor, setCursor];
    }
    const COMPONENT_NAME$o = "ElInput";
    const __default__$1R = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$o,
      inheritAttrs: false
    });
    const _sfc_main$2C = /* @__PURE__ */ defineComponent({
      ...__default__$1R,
      props: inputProps,
      emits: inputEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const rawAttrs = useAttrs$1();
        const attrs = useAttrs();
        const slots = useSlots();
        const containerKls = computed(() => [
          props2.type === "textarea" ? nsTextarea.b() : nsInput.b(),
          nsInput.m(inputSize.value),
          nsInput.is("disabled", inputDisabled.value),
          nsInput.is("exceed", inputExceed.value),
          {
            [nsInput.b("group")]: slots.prepend || slots.append,
            [nsInput.m("prefix")]: slots.prefix || props2.prefixIcon,
            [nsInput.m("suffix")]: slots.suffix || props2.suffixIcon || props2.clearable || props2.showPassword,
            [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value,
            [nsInput.b("hidden")]: props2.type === "hidden"
          },
          rawAttrs.class
        ]);
        const wrapperKls = computed(() => [
          nsInput.e("wrapper"),
          nsInput.is("focus", isFocused.value)
        ]);
        const { form: elForm, formItem: elFormItem } = useFormItem();
        const { inputId } = useFormItemInputId(props2, {
          formItemContext: elFormItem
        });
        const inputSize = useFormSize();
        const inputDisabled = useFormDisabled();
        const nsInput = useNamespace("input");
        const nsTextarea = useNamespace("textarea");
        const input = shallowRef();
        const textarea = shallowRef();
        const hovering = ref(false);
        const passwordVisible = ref(false);
        const countStyle = ref();
        const textareaCalcStyle = shallowRef(props2.inputStyle);
        const _ref = computed(() => input.value || textarea.value);
        const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(_ref, {
          beforeFocus() {
            return inputDisabled.value;
          },
          afterBlur() {
            var _a2;
            if (props2.validateEvent) {
              (_a2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a2.call(elFormItem, "blur").catch((err) => debugWarn());
            }
          }
        });
        const needStatusIcon = computed(() => {
          var _a2;
          return (_a2 = elForm == null ? void 0 : elForm.statusIcon) != null ? _a2 : false;
        });
        const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
        const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
        const passwordIcon = computed(() => passwordVisible.value ? view_default : hide_default);
        const containerStyle = computed(() => [
          rawAttrs.style
        ]);
        const textareaStyle = computed(() => [
          props2.inputStyle,
          textareaCalcStyle.value,
          { resize: props2.resize }
        ]);
        const nativeInputValue = computed(() => isNil(props2.modelValue) ? "" : String(props2.modelValue));
        const showClear = computed(() => props2.clearable && !inputDisabled.value && !props2.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value));
        const showPwdVisible = computed(() => props2.showPassword && !inputDisabled.value && !!nativeInputValue.value && (!!nativeInputValue.value || isFocused.value));
        const isWordLimitVisible = computed(() => props2.showWordLimit && !!props2.maxlength && (props2.type === "text" || props2.type === "textarea") && !inputDisabled.value && !props2.readonly && !props2.showPassword);
        const textLength = computed(() => nativeInputValue.value.length);
        const inputExceed = computed(() => !!isWordLimitVisible.value && textLength.value > Number(props2.maxlength));
        const suffixVisible = computed(() => !!slots.suffix || !!props2.suffixIcon || showClear.value || props2.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
        const [recordCursor, setCursor] = useCursor(input);
        useResizeObserver(textarea, (entries) => {
          onceInitSizeTextarea();
          if (!isWordLimitVisible.value || props2.resize !== "both")
            return;
          const entry = entries[0];
          const { width } = entry.contentRect;
          countStyle.value = {
            right: `calc(100% - ${width + 15 + 6}px)`
          };
        });
        const resizeTextarea = () => {
          const { type, autosize } = props2;
          if (!isClient || type !== "textarea" || !textarea.value)
            return;
          if (autosize) {
            const minRows = isObject$7(autosize) ? autosize.minRows : void 0;
            const maxRows = isObject$7(autosize) ? autosize.maxRows : void 0;
            const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
            textareaCalcStyle.value = {
              overflowY: "hidden",
              ...textareaStyle2
            };
            nextTick(() => {
              textarea.value.offsetHeight;
              textareaCalcStyle.value = textareaStyle2;
            });
          } else {
            textareaCalcStyle.value = {
              minHeight: calcTextareaHeight(textarea.value).minHeight
            };
          }
        };
        const createOnceInitResize = (resizeTextarea2) => {
          let isInit = false;
          return () => {
            var _a2;
            if (isInit || !props2.autosize)
              return;
            const isElHidden = ((_a2 = textarea.value) == null ? void 0 : _a2.offsetParent) === null;
            if (!isElHidden) {
              resizeTextarea2();
              isInit = true;
            }
          };
        };
        const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
        const setNativeInputValue = () => {
          const input2 = _ref.value;
          const formatterValue = props2.formatter ? props2.formatter(nativeInputValue.value) : nativeInputValue.value;
          if (!input2 || input2.value === formatterValue)
            return;
          input2.value = formatterValue;
        };
        const handleInput = async (event) => {
          recordCursor();
          let { value } = event.target;
          if (props2.formatter && props2.parser) {
            value = props2.parser(value);
          }
          if (isComposing.value)
            return;
          if (value === nativeInputValue.value) {
            setNativeInputValue();
            return;
          }
          emit2(UPDATE_MODEL_EVENT, value);
          emit2(INPUT_EVENT, value);
          await nextTick();
          setNativeInputValue();
          setCursor();
        };
        const handleChange = (event) => {
          let { value } = event.target;
          if (props2.formatter && props2.parser) {
            value = props2.parser(value);
          }
          emit2(CHANGE_EVENT, value);
        };
        const {
          isComposing,
          handleCompositionStart,
          handleCompositionUpdate,
          handleCompositionEnd
        } = useComposition({ emit: emit2, afterComposition: handleInput });
        const handlePasswordVisible = () => {
          recordCursor();
          passwordVisible.value = !passwordVisible.value;
          setTimeout(setCursor);
        };
        const focus = () => {
          var _a2;
          return (_a2 = _ref.value) == null ? void 0 : _a2.focus();
        };
        const blur = () => {
          var _a2;
          return (_a2 = _ref.value) == null ? void 0 : _a2.blur();
        };
        const handleMouseLeave = (evt) => {
          hovering.value = false;
          emit2("mouseleave", evt);
        };
        const handleMouseEnter = (evt) => {
          hovering.value = true;
          emit2("mouseenter", evt);
        };
        const handleKeydown = (evt) => {
          emit2("keydown", evt);
        };
        const select = () => {
          var _a2;
          (_a2 = _ref.value) == null ? void 0 : _a2.select();
        };
        const clear2 = () => {
          emit2(UPDATE_MODEL_EVENT, "");
          emit2(CHANGE_EVENT, "");
          emit2("clear");
          emit2(INPUT_EVENT, "");
        };
        watch(() => props2.modelValue, () => {
          var _a2;
          nextTick(() => resizeTextarea());
          if (props2.validateEvent) {
            (_a2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a2.call(elFormItem, "change").catch((err) => debugWarn());
          }
        });
        watch(nativeInputValue, () => setNativeInputValue());
        watch(() => props2.type, async () => {
          await nextTick();
          setNativeInputValue();
          resizeTextarea();
        });
        onMounted(() => {
          if (!props2.formatter && props2.parser) ;
          setNativeInputValue();
          nextTick(resizeTextarea);
        });
        expose({
          input,
          textarea,
          ref: _ref,
          textareaStyle,
          autosize: toRef(props2, "autosize"),
          isComposing,
          focus,
          blur,
          select,
          clear: clear2,
          resizeTextarea
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(containerKls),
              {
                [unref(nsInput).bm("group", "append")]: _ctx.$slots.append,
                [unref(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend
              }
            ]),
            style: normalizeStyle$1(unref(containerStyle)),
            onMouseenter: handleMouseEnter,
            onMouseleave: handleMouseLeave
          }, [
            createCommentVNode(" input "),
            _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
              createCommentVNode(" prepend slot "),
              _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(nsInput).be("group", "prepend"))
              }, [
                renderSlot(_ctx.$slots, "prepend")
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                ref_key: "wrapperRef",
                ref: wrapperRef,
                class: normalizeClass(unref(wrapperKls))
              }, [
                createCommentVNode(" prefix slot "),
                _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
                  key: 0,
                  class: normalizeClass(unref(nsInput).e("prefix"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(nsInput).e("prefix-inner"))
                  }, [
                    renderSlot(_ctx.$slots, "prefix"),
                    _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
                      key: 0,
                      class: normalizeClass(unref(nsInput).e("icon"))
                    }, {
                      default: withCtx(() => [
                        (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
                      ]),
                      _: 1
                    }, 8, ["class"])) : createCommentVNode("v-if", true)
                  ], 2)
                ], 2)) : createCommentVNode("v-if", true),
                createBaseVNode("input", mergeProps({
                  id: unref(inputId),
                  ref_key: "input",
                  ref: input,
                  class: unref(nsInput).e("inner")
                }, unref(attrs), {
                  minlength: _ctx.minlength,
                  maxlength: _ctx.maxlength,
                  type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
                  disabled: unref(inputDisabled),
                  readonly: _ctx.readonly,
                  autocomplete: _ctx.autocomplete,
                  tabindex: _ctx.tabindex,
                  "aria-label": _ctx.ariaLabel,
                  placeholder: _ctx.placeholder,
                  style: _ctx.inputStyle,
                  form: _ctx.form,
                  autofocus: _ctx.autofocus,
                  role: _ctx.containerRole,
                  onCompositionstart: unref(handleCompositionStart),
                  onCompositionupdate: unref(handleCompositionUpdate),
                  onCompositionend: unref(handleCompositionEnd),
                  onInput: handleInput,
                  onChange: handleChange,
                  onKeydown: handleKeydown
                }), null, 16, ["id", "minlength", "maxlength", "type", "disabled", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form", "autofocus", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
                createCommentVNode(" suffix slot "),
                unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
                  key: 1,
                  class: normalizeClass(unref(nsInput).e("suffix"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(nsInput).e("suffix-inner"))
                  }, [
                    !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                      renderSlot(_ctx.$slots, "suffix"),
                      _ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
                        key: 0,
                        class: normalizeClass(unref(nsInput).e("icon"))
                      }, {
                        default: withCtx(() => [
                          (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
                        ]),
                        _: 1
                      }, 8, ["class"])) : createCommentVNode("v-if", true)
                    ], 64)) : createCommentVNode("v-if", true),
                    unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
                      key: 1,
                      class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
                      onMousedown: withModifiers(unref(NOOP), ["prevent"]),
                      onClick: clear2
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(circle_close_default))
                      ]),
                      _: 1
                    }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
                    unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
                      key: 2,
                      class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
                      onClick: handlePasswordVisible
                    }, {
                      default: withCtx(() => [
                        (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
                      ]),
                      _: 1
                    }, 8, ["class"])) : createCommentVNode("v-if", true),
                    unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
                      key: 3,
                      class: normalizeClass(unref(nsInput).e("count"))
                    }, [
                      createBaseVNode("span", {
                        class: normalizeClass(unref(nsInput).e("count-inner"))
                      }, toDisplayString(unref(textLength)) + " / " + toDisplayString(_ctx.maxlength), 3)
                    ], 2)) : createCommentVNode("v-if", true),
                    unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
                      key: 4,
                      class: normalizeClass([
                        unref(nsInput).e("icon"),
                        unref(nsInput).e("validateIcon"),
                        unref(nsInput).is("loading", unref(validateState) === "validating")
                      ])
                    }, {
                      default: withCtx(() => [
                        (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
                      ]),
                      _: 1
                    }, 8, ["class"])) : createCommentVNode("v-if", true)
                  ], 2)
                ], 2)) : createCommentVNode("v-if", true)
              ], 2),
              createCommentVNode(" append slot "),
              _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass(unref(nsInput).be("group", "append"))
              }, [
                renderSlot(_ctx.$slots, "append")
              ], 2)) : createCommentVNode("v-if", true)
            ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
              createCommentVNode(" textarea "),
              createBaseVNode("textarea", mergeProps({
                id: unref(inputId),
                ref_key: "textarea",
                ref: textarea,
                class: [unref(nsTextarea).e("inner"), unref(nsInput).is("focus", unref(isFocused))]
              }, unref(attrs), {
                minlength: _ctx.minlength,
                maxlength: _ctx.maxlength,
                tabindex: _ctx.tabindex,
                disabled: unref(inputDisabled),
                readonly: _ctx.readonly,
                autocomplete: _ctx.autocomplete,
                style: unref(textareaStyle),
                "aria-label": _ctx.ariaLabel,
                placeholder: _ctx.placeholder,
                form: _ctx.form,
                autofocus: _ctx.autofocus,
                rows: _ctx.rows,
                role: _ctx.containerRole,
                onCompositionstart: unref(handleCompositionStart),
                onCompositionupdate: unref(handleCompositionUpdate),
                onCompositionend: unref(handleCompositionEnd),
                onInput: handleInput,
                onFocus: unref(handleFocus),
                onBlur: unref(handleBlur),
                onChange: handleChange,
                onKeydown: handleKeydown
              }), null, 16, ["id", "minlength", "maxlength", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form", "autofocus", "rows", "role", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onFocus", "onBlur"]),
              unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
                key: 0,
                style: normalizeStyle$1(countStyle.value),
                class: normalizeClass(unref(nsInput).e("count"))
              }, toDisplayString(unref(textLength)) + " / " + toDisplayString(_ctx.maxlength), 7)) : createCommentVNode("v-if", true)
            ], 64))
          ], 38);
        };
      }
    });
    var Input = /* @__PURE__ */ _export_sfc(_sfc_main$2C, [["__file", "input.vue"]]);
    const ElInput = withInstall(Input);
    const GAP = 4;
    const BAR_MAP = {
      vertical: {
        offset: "offsetHeight",
        scroll: "scrollTop",
        scrollSize: "scrollHeight",
        size: "height",
        key: "vertical",
        axis: "Y",
        client: "clientY",
        direction: "top"
      },
      horizontal: {
        offset: "offsetWidth",
        scroll: "scrollLeft",
        scrollSize: "scrollWidth",
        size: "width",
        key: "horizontal",
        axis: "X",
        client: "clientX",
        direction: "left"
      }
    };
    const renderThumbStyle$1 = ({
      move,
      size,
      bar
    }) => ({
      [bar.size]: size,
      transform: `translate${bar.axis}(${move}%)`
    });
    const scrollbarContextKey = Symbol("scrollbarContextKey");
    const thumbProps = buildProps({
      vertical: Boolean,
      size: String,
      move: Number,
      ratio: {
        type: Number,
        required: true
      },
      always: Boolean
    });
    const COMPONENT_NAME$n = "Thumb";
    const _sfc_main$2B = /* @__PURE__ */ defineComponent({
      __name: "thumb",
      props: thumbProps,
      setup(__props) {
        const props2 = __props;
        const scrollbar = inject(scrollbarContextKey);
        const ns = useNamespace("scrollbar");
        if (!scrollbar)
          throwError$1(COMPONENT_NAME$n, "can not inject scrollbar context");
        const instance = ref();
        const thumb = ref();
        const thumbState = ref({});
        const visible = ref(false);
        let cursorDown = false;
        let cursorLeave = false;
        let originalOnSelectStart = isClient ? document.onselectstart : null;
        const bar = computed(() => BAR_MAP[props2.vertical ? "vertical" : "horizontal"]);
        const thumbStyle = computed(() => renderThumbStyle$1({
          size: props2.size,
          move: props2.move,
          bar: bar.value
        }));
        const offsetRatio = computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props2.ratio / thumb.value[bar.value.offset]);
        const clickThumbHandler = (e2) => {
          var _a2;
          e2.stopPropagation();
          if (e2.ctrlKey || [1, 2].includes(e2.button))
            return;
          (_a2 = window.getSelection()) == null ? void 0 : _a2.removeAllRanges();
          startDrag(e2);
          const el = e2.currentTarget;
          if (!el)
            return;
          thumbState.value[bar.value.axis] = el[bar.value.offset] - (e2[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
        };
        const clickTrackHandler = (e2) => {
          if (!thumb.value || !instance.value || !scrollbar.wrapElement)
            return;
          const offset2 = Math.abs(e2.target.getBoundingClientRect()[bar.value.direction] - e2[bar.value.client]);
          const thumbHalf = thumb.value[bar.value.offset] / 2;
          const thumbPositionPercentage = (offset2 - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
          scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
        };
        const startDrag = (e2) => {
          e2.stopImmediatePropagation();
          cursorDown = true;
          document.addEventListener("mousemove", mouseMoveDocumentHandler);
          document.addEventListener("mouseup", mouseUpDocumentHandler);
          originalOnSelectStart = document.onselectstart;
          document.onselectstart = () => false;
        };
        const mouseMoveDocumentHandler = (e2) => {
          if (!instance.value || !thumb.value)
            return;
          if (cursorDown === false)
            return;
          const prevPage = thumbState.value[bar.value.axis];
          if (!prevPage)
            return;
          const offset2 = (instance.value.getBoundingClientRect()[bar.value.direction] - e2[bar.value.client]) * -1;
          const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
          const thumbPositionPercentage = (offset2 - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
          scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
        };
        const mouseUpDocumentHandler = () => {
          cursorDown = false;
          thumbState.value[bar.value.axis] = 0;
          document.removeEventListener("mousemove", mouseMoveDocumentHandler);
          document.removeEventListener("mouseup", mouseUpDocumentHandler);
          restoreOnselectstart();
          if (cursorLeave)
            visible.value = false;
        };
        const mouseMoveScrollbarHandler = () => {
          cursorLeave = false;
          visible.value = !!props2.size;
        };
        const mouseLeaveScrollbarHandler = () => {
          cursorLeave = true;
          visible.value = cursorDown;
        };
        onBeforeUnmount(() => {
          restoreOnselectstart();
          document.removeEventListener("mouseup", mouseUpDocumentHandler);
        });
        const restoreOnselectstart = () => {
          if (document.onselectstart !== originalOnSelectStart)
            document.onselectstart = originalOnSelectStart;
        };
        useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
        useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, {
            name: unref(ns).b("fade"),
            persisted: ""
          }, {
            default: withCtx(() => [
              withDirectives(createBaseVNode("div", {
                ref_key: "instance",
                ref: instance,
                class: normalizeClass([unref(ns).e("bar"), unref(ns).is(unref(bar).key)]),
                onMousedown: clickTrackHandler,
                onClick: withModifiers(() => {
                }, ["stop"])
              }, [
                createBaseVNode("div", {
                  ref_key: "thumb",
                  ref: thumb,
                  class: normalizeClass(unref(ns).e("thumb")),
                  style: normalizeStyle$1(unref(thumbStyle)),
                  onMousedown: clickThumbHandler
                }, null, 38)
              ], 42, ["onClick"]), [
                [vShow, _ctx.always || visible.value]
              ])
            ]),
            _: 1
          }, 8, ["name"]);
        };
      }
    });
    var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__file", "thumb.vue"]]);
    const barProps = buildProps({
      always: {
        type: Boolean,
        default: true
      },
      minSize: {
        type: Number,
        required: true
      }
    });
    const _sfc_main$2A = /* @__PURE__ */ defineComponent({
      __name: "bar",
      props: barProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const scrollbar = inject(scrollbarContextKey);
        const moveX = ref(0);
        const moveY = ref(0);
        const sizeWidth = ref("");
        const sizeHeight = ref("");
        const ratioY = ref(1);
        const ratioX = ref(1);
        const handleScroll2 = (wrap) => {
          if (wrap) {
            const offsetHeight = wrap.offsetHeight - GAP;
            const offsetWidth = wrap.offsetWidth - GAP;
            moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
            moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
          }
        };
        const update = () => {
          const wrap = scrollbar == null ? void 0 : scrollbar.wrapElement;
          if (!wrap)
            return;
          const offsetHeight = wrap.offsetHeight - GAP;
          const offsetWidth = wrap.offsetWidth - GAP;
          const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
          const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
          const height = Math.max(originalHeight, props2.minSize);
          const width = Math.max(originalWidth, props2.minSize);
          ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
          ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
          sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
          sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
        };
        expose({
          handleScroll: handleScroll2,
          update
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock(Fragment, null, [
            createVNode$1(Thumb, {
              move: moveX.value,
              ratio: ratioX.value,
              size: sizeWidth.value,
              always: _ctx.always
            }, null, 8, ["move", "ratio", "size", "always"]),
            createVNode$1(Thumb, {
              move: moveY.value,
              ratio: ratioY.value,
              size: sizeHeight.value,
              vertical: "",
              always: _ctx.always
            }, null, 8, ["move", "ratio", "size", "always"])
          ], 64);
        };
      }
    });
    var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$2A, [["__file", "bar.vue"]]);
    const scrollbarProps = buildProps({
      height: {
        type: [String, Number],
        default: ""
      },
      maxHeight: {
        type: [String, Number],
        default: ""
      },
      native: {
        type: Boolean,
        default: false
      },
      wrapStyle: {
        type: definePropType([String, Object, Array]),
        default: ""
      },
      wrapClass: {
        type: [String, Array],
        default: ""
      },
      viewClass: {
        type: [String, Array],
        default: ""
      },
      viewStyle: {
        type: [String, Array, Object],
        default: ""
      },
      noresize: Boolean,
      tag: {
        type: String,
        default: "div"
      },
      always: Boolean,
      minSize: {
        type: Number,
        default: 20
      },
      tabindex: {
        type: [String, Number],
        default: void 0
      },
      id: String,
      role: String,
      ...useAriaProps(["ariaLabel", "ariaOrientation"])
    });
    const scrollbarEmits = {
      scroll: ({
        scrollTop,
        scrollLeft
      }) => [scrollTop, scrollLeft].every(isNumber$2)
    };
    const COMPONENT_NAME$m = "ElScrollbar";
    const __default__$1Q = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$m
    });
    const _sfc_main$2z = /* @__PURE__ */ defineComponent({
      ...__default__$1Q,
      props: scrollbarProps,
      emits: scrollbarEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("scrollbar");
        let stopResizeObserver = void 0;
        let stopResizeListener = void 0;
        let wrapScrollTop = 0;
        let wrapScrollLeft = 0;
        const scrollbarRef = ref();
        const wrapRef = ref();
        const resizeRef = ref();
        const barRef = ref();
        const wrapStyle = computed(() => {
          const style = {};
          if (props2.height)
            style.height = addUnit(props2.height);
          if (props2.maxHeight)
            style.maxHeight = addUnit(props2.maxHeight);
          return [props2.wrapStyle, style];
        });
        const wrapKls = computed(() => {
          return [
            props2.wrapClass,
            ns.e("wrap"),
            { [ns.em("wrap", "hidden-default")]: !props2.native }
          ];
        });
        const resizeKls = computed(() => {
          return [ns.e("view"), props2.viewClass];
        });
        const handleScroll2 = () => {
          var _a2;
          if (wrapRef.value) {
            (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
            wrapScrollTop = wrapRef.value.scrollTop;
            wrapScrollLeft = wrapRef.value.scrollLeft;
            emit2("scroll", {
              scrollTop: wrapRef.value.scrollTop,
              scrollLeft: wrapRef.value.scrollLeft
            });
          }
        };
        function scrollTo(arg1, arg2) {
          if (isObject$7(arg1)) {
            wrapRef.value.scrollTo(arg1);
          } else if (isNumber$2(arg1) && isNumber$2(arg2)) {
            wrapRef.value.scrollTo(arg1, arg2);
          }
        }
        const setScrollTop = (value) => {
          if (!isNumber$2(value)) {
            return;
          }
          wrapRef.value.scrollTop = value;
        };
        const setScrollLeft = (value) => {
          if (!isNumber$2(value)) {
            return;
          }
          wrapRef.value.scrollLeft = value;
        };
        const update = () => {
          var _a2;
          (_a2 = barRef.value) == null ? void 0 : _a2.update();
        };
        watch(() => props2.noresize, (noresize) => {
          if (noresize) {
            stopResizeObserver == null ? void 0 : stopResizeObserver();
            stopResizeListener == null ? void 0 : stopResizeListener();
          } else {
            ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
            stopResizeListener = useEventListener("resize", update);
          }
        }, { immediate: true });
        watch(() => [props2.maxHeight, props2.height], () => {
          if (!props2.native)
            nextTick(() => {
              var _a2;
              update();
              if (wrapRef.value) {
                (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
              }
            });
        });
        provide(scrollbarContextKey, reactive({
          scrollbarElement: scrollbarRef,
          wrapElement: wrapRef
        }));
        onActivated(() => {
          if (wrapRef.value) {
            wrapRef.value.scrollTop = wrapScrollTop;
            wrapRef.value.scrollLeft = wrapScrollLeft;
          }
        });
        onMounted(() => {
          if (!props2.native)
            nextTick(() => {
              update();
            });
        });
        onUpdated(() => update());
        expose({
          wrapRef,
          update,
          scrollTo,
          setScrollTop,
          setScrollLeft,
          handleScroll: handleScroll2
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "scrollbarRef",
            ref: scrollbarRef,
            class: normalizeClass(unref(ns).b())
          }, [
            createBaseVNode("div", {
              ref_key: "wrapRef",
              ref: wrapRef,
              class: normalizeClass(unref(wrapKls)),
              style: normalizeStyle$1(unref(wrapStyle)),
              tabindex: _ctx.tabindex,
              onScroll: handleScroll2
            }, [
              (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
                id: _ctx.id,
                ref_key: "resizeRef",
                ref: resizeRef,
                class: normalizeClass(unref(resizeKls)),
                style: normalizeStyle$1(_ctx.viewStyle),
                role: _ctx.role,
                "aria-label": _ctx.ariaLabel,
                "aria-orientation": _ctx.ariaOrientation
              }, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "default")
                ]),
                _: 3
              }, 8, ["id", "class", "style", "role", "aria-label", "aria-orientation"]))
            ], 46, ["tabindex"]),
            !_ctx.native ? (openBlock(), createBlock(Bar, {
              key: 0,
              ref_key: "barRef",
              ref: barRef,
              always: _ctx.always,
              "min-size": _ctx.minSize
            }, null, 8, ["always", "min-size"])) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main$2z, [["__file", "scrollbar.vue"]]);
    const ElScrollbar = withInstall(Scrollbar);
    const POPPER_INJECTION_KEY = Symbol("popper");
    const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
    const roleTypes = [
      "dialog",
      "grid",
      "group",
      "listbox",
      "menu",
      "navigation",
      "tooltip",
      "tree"
    ];
    const popperProps = buildProps({
      role: {
        type: String,
        values: roleTypes,
        default: "tooltip"
      }
    });
    const __default__$1P = /* @__PURE__ */ defineComponent({
      name: "ElPopper",
      inheritAttrs: false
    });
    const _sfc_main$2y = /* @__PURE__ */ defineComponent({
      ...__default__$1P,
      props: popperProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const triggerRef = ref();
        const popperInstanceRef = ref();
        const contentRef = ref();
        const referenceRef = ref();
        const role = computed(() => props2.role);
        const popperProvides = {
          triggerRef,
          popperInstanceRef,
          contentRef,
          referenceRef,
          role
        };
        expose(popperProvides);
        provide(POPPER_INJECTION_KEY, popperProvides);
        return (_ctx, _cache) => {
          return renderSlot(_ctx.$slots, "default");
        };
      }
    });
    var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$2y, [["__file", "popper.vue"]]);
    const __default__$1O = /* @__PURE__ */ defineComponent({
      name: "ElPopperArrow",
      inheritAttrs: false
    });
    const _sfc_main$2x = /* @__PURE__ */ defineComponent({
      ...__default__$1O,
      setup(__props, { expose }) {
        const ns = useNamespace("popper");
        const { arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
        onBeforeUnmount(() => {
          arrowRef.value = void 0;
        });
        expose({
          arrowRef
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            ref_key: "arrowRef",
            ref: arrowRef,
            class: normalizeClass(unref(ns).e("arrow")),
            style: normalizeStyle$1(unref(arrowStyle)),
            "data-popper-arrow": ""
          }, null, 6);
        };
      }
    });
    var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__file", "arrow.vue"]]);
    const popperTriggerProps = buildProps({
      virtualRef: {
        type: definePropType(Object)
      },
      virtualTriggering: Boolean,
      onMouseenter: {
        type: definePropType(Function)
      },
      onMouseleave: {
        type: definePropType(Function)
      },
      onClick: {
        type: definePropType(Function)
      },
      onKeydown: {
        type: definePropType(Function)
      },
      onFocus: {
        type: definePropType(Function)
      },
      onBlur: {
        type: definePropType(Function)
      },
      onContextmenu: {
        type: definePropType(Function)
      },
      id: String,
      open: Boolean
    });
    const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
    const useForwardRef = (forwardRef) => {
      const setForwardRef = (el) => {
        forwardRef.value = el;
      };
      provide(FORWARD_REF_INJECTION_KEY, {
        setForwardRef
      });
    };
    const useForwardRefDirective = (setForwardRef) => {
      return {
        mounted(el) {
          setForwardRef(el);
        },
        updated(el) {
          setForwardRef(el);
        },
        unmounted() {
          setForwardRef(null);
        }
      };
    };
    const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
    const isVisible = (element) => {
      const computed2 = getComputedStyle(element);
      return computed2.position === "fixed" ? false : element.offsetParent !== null;
    };
    const obtainAllFocusableElements$1 = (element) => {
      return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
    };
    const isFocusable = (element) => {
      if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
        return true;
      }
      if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") {
        return false;
      }
      switch (element.nodeName) {
        case "A": {
          return !!element.href && element.rel !== "ignore";
        }
        case "INPUT": {
          return !(element.type === "hidden" || element.type === "file");
        }
        case "BUTTON":
        case "SELECT":
        case "TEXTAREA": {
          return true;
        }
        default: {
          return false;
        }
      }
    };
    const triggerEvent = function(elm, name, ...opts) {
      let eventName;
      if (name.includes("mouse") || name.includes("click")) {
        eventName = "MouseEvents";
      } else if (name.includes("key")) {
        eventName = "KeyboardEvent";
      } else {
        eventName = "HTMLEvents";
      }
      const evt = document.createEvent(eventName);
      evt.initEvent(name, ...opts);
      elm.dispatchEvent(evt);
      return elm;
    };
    const isLeaf = (el) => !el.getAttribute("aria-owns");
    const getSibling = (el, distance2, elClass) => {
      const { parentNode: parentNode2 } = el;
      if (!parentNode2)
        return null;
      const siblings = parentNode2.querySelectorAll(elClass);
      const index = Array.prototype.indexOf.call(siblings, el);
      return siblings[index + distance2] || null;
    };
    const focusNode = (el) => {
      if (!el)
        return;
      el.focus();
      !isLeaf(el) && el.click();
    };
    const NAME = "ElOnlyChild";
    const OnlyChild = /* @__PURE__ */ defineComponent({
      name: NAME,
      setup(_2, {
        slots,
        attrs
      }) {
        var _a2;
        const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
        const forwardRefDirective = useForwardRefDirective((_a2 = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a2 : NOOP);
        return () => {
          var _a22;
          const defaultSlot = (_a22 = slots.default) == null ? void 0 : _a22.call(slots, attrs);
          if (!defaultSlot)
            return null;
          if (defaultSlot.length > 1) {
            return null;
          }
          const firstLegitNode = findFirstLegitChild(defaultSlot);
          if (!firstLegitNode) {
            return null;
          }
          return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
        };
      }
    });
    function findFirstLegitChild(node) {
      if (!node)
        return null;
      const children = node;
      for (const child of children) {
        if (isObject$7(child)) {
          switch (child.type) {
            case Comment:
              continue;
            case Text$1:
            case "svg":
              return wrapTextContent(child);
            case Fragment:
              return findFirstLegitChild(child.children);
            default:
              return child;
          }
        }
        return wrapTextContent(child);
      }
      return null;
    }
    function wrapTextContent(s2) {
      const ns = useNamespace("only-child");
      return createVNode$1("span", {
        "class": ns.e("content")
      }, [s2]);
    }
    const __default__$1N = /* @__PURE__ */ defineComponent({
      name: "ElPopperTrigger",
      inheritAttrs: false
    });
    const _sfc_main$2w = /* @__PURE__ */ defineComponent({
      ...__default__$1N,
      props: popperTriggerProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const { role, triggerRef } = inject(POPPER_INJECTION_KEY, void 0);
        useForwardRef(triggerRef);
        const ariaControls = computed(() => {
          return ariaHaspopup.value ? props2.id : void 0;
        });
        const ariaDescribedby = computed(() => {
          if (role && role.value === "tooltip") {
            return props2.open && props2.id ? props2.id : void 0;
          }
          return void 0;
        });
        const ariaHaspopup = computed(() => {
          if (role && role.value !== "tooltip") {
            return role.value;
          }
          return void 0;
        });
        const ariaExpanded = computed(() => {
          return ariaHaspopup.value ? `${props2.open}` : void 0;
        });
        let virtualTriggerAriaStopWatch = void 0;
        const TRIGGER_ELE_EVENTS = [
          "onMouseenter",
          "onMouseleave",
          "onClick",
          "onKeydown",
          "onFocus",
          "onBlur",
          "onContextmenu"
        ];
        onMounted(() => {
          watch(() => props2.virtualRef, (virtualEl) => {
            if (virtualEl) {
              triggerRef.value = unrefElement(virtualEl);
            }
          }, {
            immediate: true
          });
          watch(triggerRef, (el, prevEl) => {
            virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
            virtualTriggerAriaStopWatch = void 0;
            if (isElement$1(el)) {
              TRIGGER_ELE_EVENTS.forEach((eventName) => {
                var _a2;
                const handler = props2[eventName];
                if (handler) {
                  el.addEventListener(eventName.slice(2).toLowerCase(), handler);
                  (_a2 = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a2.call(prevEl, eventName.slice(2).toLowerCase(), handler);
                }
              });
              if (isFocusable(el)) {
                virtualTriggerAriaStopWatch = watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
                  [
                    "aria-controls",
                    "aria-describedby",
                    "aria-haspopup",
                    "aria-expanded"
                  ].forEach((key, idx) => {
                    isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
                  });
                }, { immediate: true });
              }
            }
            if (isElement$1(prevEl) && isFocusable(prevEl)) {
              [
                "aria-controls",
                "aria-describedby",
                "aria-haspopup",
                "aria-expanded"
              ].forEach((key) => prevEl.removeAttribute(key));
            }
          }, {
            immediate: true
          });
        });
        onBeforeUnmount(() => {
          virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
          virtualTriggerAriaStopWatch = void 0;
          if (triggerRef.value && isElement$1(triggerRef.value)) {
            const el = triggerRef.value;
            TRIGGER_ELE_EVENTS.forEach((eventName) => {
              const handler = props2[eventName];
              if (handler) {
                el.removeEventListener(eventName.slice(2).toLowerCase(), handler);
              }
            });
            triggerRef.value = void 0;
          }
        });
        expose({
          triggerRef
        });
        return (_ctx, _cache) => {
          return !_ctx.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
            "aria-controls": unref(ariaControls),
            "aria-describedby": unref(ariaDescribedby),
            "aria-expanded": unref(ariaExpanded),
            "aria-haspopup": unref(ariaHaspopup)
          }), {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
        };
      }
    });
    var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$2w, [["__file", "trigger.vue"]]);
    const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
    const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
    const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
    const FOCUS_AFTER_TRAPPED_OPTS = {
      cancelable: true,
      bubbles: false
    };
    const FOCUSOUT_PREVENTED_OPTS = {
      cancelable: true,
      bubbles: false
    };
    const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
    const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
    const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
    const focusReason = ref();
    const lastUserFocusTimestamp = ref(0);
    const lastAutomatedFocusTimestamp = ref(0);
    let focusReasonUserCount = 0;
    const obtainAllFocusableElements = (element) => {
      const nodes = [];
      const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
        acceptNode: (node) => {
          const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
          if (node.disabled || node.hidden || isHiddenInput)
            return NodeFilter.FILTER_SKIP;
          return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
        }
      });
      while (walker.nextNode())
        nodes.push(walker.currentNode);
      return nodes;
    };
    const getVisibleElement = (elements, container) => {
      for (const element of elements) {
        if (!isHidden(element, container))
          return element;
      }
    };
    const isHidden = (element, container) => {
      if (getComputedStyle(element).visibility === "hidden")
        return true;
      while (element) {
        if (container && element === container)
          return false;
        if (getComputedStyle(element).display === "none")
          return true;
        element = element.parentElement;
      }
      return false;
    };
    const getEdges = (container) => {
      const focusable = obtainAllFocusableElements(container);
      const first = getVisibleElement(focusable, container);
      const last2 = getVisibleElement(focusable.reverse(), container);
      return [first, last2];
    };
    const isSelectable = (element) => {
      return element instanceof HTMLInputElement && "select" in element;
    };
    const tryFocus = (element, shouldSelect) => {
      if (element && element.focus) {
        const prevFocusedElement = document.activeElement;
        let cleanup = false;
        if (isElement$1(element) && !isFocusable(element) && !element.getAttribute("tabindex")) {
          element.setAttribute("tabindex", "-1");
          cleanup = true;
        }
        element.focus({ preventScroll: true });
        lastAutomatedFocusTimestamp.value = window.performance.now();
        if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
          element.select();
        }
        if (isElement$1(element) && cleanup) {
          element.removeAttribute("tabindex");
        }
      }
    };
    function removeFromStack(list, item) {
      const copy2 = [...list];
      const idx = list.indexOf(item);
      if (idx !== -1) {
        copy2.splice(idx, 1);
      }
      return copy2;
    }
    const createFocusableStack = () => {
      let stack2 = [];
      const push2 = (layer) => {
        const currentLayer = stack2[0];
        if (currentLayer && layer !== currentLayer) {
          currentLayer.pause();
        }
        stack2 = removeFromStack(stack2, layer);
        stack2.unshift(layer);
      };
      const remove2 = (layer) => {
        var _a2, _b2;
        stack2 = removeFromStack(stack2, layer);
        (_b2 = (_a2 = stack2[0]) == null ? void 0 : _a2.resume) == null ? void 0 : _b2.call(_a2);
      };
      return {
        push: push2,
        remove: remove2
      };
    };
    const focusFirstDescendant = (elements, shouldSelect = false) => {
      const prevFocusedElement = document.activeElement;
      for (const element of elements) {
        tryFocus(element, shouldSelect);
        if (document.activeElement !== prevFocusedElement)
          return;
      }
    };
    const focusableStack = createFocusableStack();
    const isFocusCausedByUserEvent = () => {
      return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
    };
    const notifyFocusReasonPointer = () => {
      focusReason.value = "pointer";
      lastUserFocusTimestamp.value = window.performance.now();
    };
    const notifyFocusReasonKeydown = () => {
      focusReason.value = "keyboard";
      lastUserFocusTimestamp.value = window.performance.now();
    };
    const useFocusReason = () => {
      onMounted(() => {
        if (focusReasonUserCount === 0) {
          document.addEventListener("mousedown", notifyFocusReasonPointer);
          document.addEventListener("touchstart", notifyFocusReasonPointer);
          document.addEventListener("keydown", notifyFocusReasonKeydown);
        }
        focusReasonUserCount++;
      });
      onBeforeUnmount(() => {
        focusReasonUserCount--;
        if (focusReasonUserCount <= 0) {
          document.removeEventListener("mousedown", notifyFocusReasonPointer);
          document.removeEventListener("touchstart", notifyFocusReasonPointer);
          document.removeEventListener("keydown", notifyFocusReasonKeydown);
        }
      });
      return {
        focusReason,
        lastUserFocusTimestamp,
        lastAutomatedFocusTimestamp
      };
    };
    const createFocusOutPreventedEvent = (detail) => {
      return new CustomEvent(FOCUSOUT_PREVENTED, {
        ...FOCUSOUT_PREVENTED_OPTS,
        detail
      });
    };
    const EVENT_CODE = {
      tab: "Tab",
      enter: "Enter",
      space: "Space",
      left: "ArrowLeft",
      up: "ArrowUp",
      right: "ArrowRight",
      down: "ArrowDown",
      esc: "Escape",
      delete: "Delete",
      backspace: "Backspace",
      numpadEnter: "NumpadEnter",
      pageUp: "PageUp",
      pageDown: "PageDown",
      home: "Home",
      end: "End"
    };
    let registeredEscapeHandlers = [];
    const cachedHandler = (event) => {
      if (event.code === EVENT_CODE.esc) {
        registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
      }
    };
    const useEscapeKeydown = (handler) => {
      onMounted(() => {
        if (registeredEscapeHandlers.length === 0) {
          document.addEventListener("keydown", cachedHandler);
        }
        if (isClient)
          registeredEscapeHandlers.push(handler);
      });
      onBeforeUnmount(() => {
        registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
        if (registeredEscapeHandlers.length === 0) {
          if (isClient)
            document.removeEventListener("keydown", cachedHandler);
        }
      });
    };
    const _sfc_main$2v = /* @__PURE__ */ defineComponent({
      name: "ElFocusTrap",
      inheritAttrs: false,
      props: {
        loop: Boolean,
        trapped: Boolean,
        focusTrapEl: Object,
        focusStartEl: {
          type: [Object, String],
          default: "first"
        }
      },
      emits: [
        ON_TRAP_FOCUS_EVT,
        ON_RELEASE_FOCUS_EVT,
        "focusin",
        "focusout",
        "focusout-prevented",
        "release-requested"
      ],
      setup(props2, { emit: emit2 }) {
        const forwardRef = ref();
        let lastFocusBeforeTrapped;
        let lastFocusAfterTrapped;
        const { focusReason: focusReason2 } = useFocusReason();
        useEscapeKeydown((event) => {
          if (props2.trapped && !focusLayer.paused) {
            emit2("release-requested", event);
          }
        });
        const focusLayer = {
          paused: false,
          pause() {
            this.paused = true;
          },
          resume() {
            this.paused = false;
          }
        };
        const onKeydown = (e2) => {
          if (!props2.loop && !props2.trapped)
            return;
          if (focusLayer.paused)
            return;
          const { code, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e2;
          const { loop } = props2;
          const isTabbing = code === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
          const currentFocusingEl = document.activeElement;
          if (isTabbing && currentFocusingEl) {
            const container = currentTarget;
            const [first, last2] = getEdges(container);
            const isTabbable = first && last2;
            if (!isTabbable) {
              if (currentFocusingEl === container) {
                const focusoutPreventedEvent = createFocusOutPreventedEvent({
                  focusReason: focusReason2.value
                });
                emit2("focusout-prevented", focusoutPreventedEvent);
                if (!focusoutPreventedEvent.defaultPrevented) {
                  e2.preventDefault();
                }
              }
            } else {
              if (!shiftKey && currentFocusingEl === last2) {
                const focusoutPreventedEvent = createFocusOutPreventedEvent({
                  focusReason: focusReason2.value
                });
                emit2("focusout-prevented", focusoutPreventedEvent);
                if (!focusoutPreventedEvent.defaultPrevented) {
                  e2.preventDefault();
                  if (loop)
                    tryFocus(first, true);
                }
              } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
                const focusoutPreventedEvent = createFocusOutPreventedEvent({
                  focusReason: focusReason2.value
                });
                emit2("focusout-prevented", focusoutPreventedEvent);
                if (!focusoutPreventedEvent.defaultPrevented) {
                  e2.preventDefault();
                  if (loop)
                    tryFocus(last2, true);
                }
              }
            }
          }
        };
        provide(FOCUS_TRAP_INJECTION_KEY, {
          focusTrapRef: forwardRef,
          onKeydown
        });
        watch(() => props2.focusTrapEl, (focusTrapEl) => {
          if (focusTrapEl) {
            forwardRef.value = focusTrapEl;
          }
        }, { immediate: true });
        watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
          if (forwardRef2) {
            forwardRef2.addEventListener("keydown", onKeydown);
            forwardRef2.addEventListener("focusin", onFocusIn);
            forwardRef2.addEventListener("focusout", onFocusOut);
          }
          if (oldForwardRef) {
            oldForwardRef.removeEventListener("keydown", onKeydown);
            oldForwardRef.removeEventListener("focusin", onFocusIn);
            oldForwardRef.removeEventListener("focusout", onFocusOut);
          }
        });
        const trapOnFocus = (e2) => {
          emit2(ON_TRAP_FOCUS_EVT, e2);
        };
        const releaseOnFocus = (e2) => emit2(ON_RELEASE_FOCUS_EVT, e2);
        const onFocusIn = (e2) => {
          const trapContainer = unref(forwardRef);
          if (!trapContainer)
            return;
          const target = e2.target;
          const relatedTarget = e2.relatedTarget;
          const isFocusedInTrap = target && trapContainer.contains(target);
          if (!props2.trapped) {
            const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
            if (!isPrevFocusedInTrap) {
              lastFocusBeforeTrapped = relatedTarget;
            }
          }
          if (isFocusedInTrap)
            emit2("focusin", e2);
          if (focusLayer.paused)
            return;
          if (props2.trapped) {
            if (isFocusedInTrap) {
              lastFocusAfterTrapped = target;
            } else {
              tryFocus(lastFocusAfterTrapped, true);
            }
          }
        };
        const onFocusOut = (e2) => {
          const trapContainer = unref(forwardRef);
          if (focusLayer.paused || !trapContainer)
            return;
          if (props2.trapped) {
            const relatedTarget = e2.relatedTarget;
            if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
              setTimeout(() => {
                if (!focusLayer.paused && props2.trapped) {
                  const focusoutPreventedEvent = createFocusOutPreventedEvent({
                    focusReason: focusReason2.value
                  });
                  emit2("focusout-prevented", focusoutPreventedEvent);
                  if (!focusoutPreventedEvent.defaultPrevented) {
                    tryFocus(lastFocusAfterTrapped, true);
                  }
                }
              }, 0);
            }
          } else {
            const target = e2.target;
            const isFocusedInTrap = target && trapContainer.contains(target);
            if (!isFocusedInTrap)
              emit2("focusout", e2);
          }
        };
        async function startTrap() {
          await nextTick();
          const trapContainer = unref(forwardRef);
          if (trapContainer) {
            focusableStack.push(focusLayer);
            const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
            lastFocusBeforeTrapped = prevFocusedElement;
            const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
            if (!isPrevFocusContained) {
              const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
              trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
              trapContainer.dispatchEvent(focusEvent);
              if (!focusEvent.defaultPrevented) {
                nextTick(() => {
                  let focusStartEl = props2.focusStartEl;
                  if (!isString$3(focusStartEl)) {
                    tryFocus(focusStartEl);
                    if (document.activeElement !== focusStartEl) {
                      focusStartEl = "first";
                    }
                  }
                  if (focusStartEl === "first") {
                    focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
                  }
                  if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
                    tryFocus(trapContainer);
                  }
                });
              }
            }
          }
        }
        function stopTrap() {
          const trapContainer = unref(forwardRef);
          if (trapContainer) {
            trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
            const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
              ...FOCUS_AFTER_TRAPPED_OPTS,
              detail: {
                focusReason: focusReason2.value
              }
            });
            trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
            trapContainer.dispatchEvent(releasedEvent);
            if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
              tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
            }
            trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
            focusableStack.remove(focusLayer);
          }
        }
        onMounted(() => {
          if (props2.trapped) {
            startTrap();
          }
          watch(() => props2.trapped, (trapped) => {
            if (trapped) {
              startTrap();
            } else {
              stopTrap();
            }
          });
        });
        onBeforeUnmount(() => {
          if (props2.trapped) {
            stopTrap();
          }
          if (forwardRef.value) {
            forwardRef.value.removeEventListener("keydown", onKeydown);
            forwardRef.value.removeEventListener("focusin", onFocusIn);
            forwardRef.value.removeEventListener("focusout", onFocusOut);
            forwardRef.value = void 0;
          }
        });
        return {
          onKeydown
        };
      }
    });
    function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
      return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
    }
    var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$2v, [["render", _sfc_render$x], ["__file", "focus-trap.vue"]]);
    var E$2 = "top", R = "bottom", W = "right", P$1 = "left", me = "auto", G = [E$2, R, W, P$1], U$2 = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t, e2) {
      return t.concat([e2 + "-" + U$2, e2 + "-" + J]);
    }, []), Ee = [].concat(G, [me]).reduce(function(t, e2) {
      return t.concat([e2, e2 + "-" + U$2, e2 + "-" + J]);
    }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt$1 = "afterWrite", ot = [Ge, Je, Ke, Qe, Ze, et, tt, nt, rt$1];
    function C(t) {
      return t ? (t.nodeName || "").toLowerCase() : null;
    }
    function H(t) {
      if (t == null) return window;
      if (t.toString() !== "[object Window]") {
        var e2 = t.ownerDocument;
        return e2 && e2.defaultView || window;
      }
      return t;
    }
    function Q(t) {
      var e2 = H(t).Element;
      return t instanceof e2 || t instanceof Element;
    }
    function B(t) {
      var e2 = H(t).HTMLElement;
      return t instanceof e2 || t instanceof HTMLElement;
    }
    function Pe(t) {
      if (typeof ShadowRoot == "undefined") return false;
      var e2 = H(t).ShadowRoot;
      return t instanceof e2 || t instanceof ShadowRoot;
    }
    function Mt(t) {
      var e2 = t.state;
      Object.keys(e2.elements).forEach(function(n) {
        var r = e2.styles[n] || {}, o2 = e2.attributes[n] || {}, i2 = e2.elements[n];
        !B(i2) || !C(i2) || (Object.assign(i2.style, r), Object.keys(o2).forEach(function(a2) {
          var s2 = o2[a2];
          s2 === false ? i2.removeAttribute(a2) : i2.setAttribute(a2, s2 === true ? "" : s2);
        }));
      });
    }
    function Rt(t) {
      var e2 = t.state, n = { popper: { position: e2.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
      return Object.assign(e2.elements.popper.style, n.popper), e2.styles = n, e2.elements.arrow && Object.assign(e2.elements.arrow.style, n.arrow), function() {
        Object.keys(e2.elements).forEach(function(r) {
          var o2 = e2.elements[r], i2 = e2.attributes[r] || {}, a2 = Object.keys(e2.styles.hasOwnProperty(r) ? e2.styles[r] : n[r]), s2 = a2.reduce(function(f2, c2) {
            return f2[c2] = "", f2;
          }, {});
          !B(o2) || !C(o2) || (Object.assign(o2.style, s2), Object.keys(i2).forEach(function(f2) {
            o2.removeAttribute(f2);
          }));
        });
      };
    }
    var Ae = { name: "applyStyles", enabled: true, phase: "write", fn: Mt, effect: Rt, requires: ["computeStyles"] };
    function q(t) {
      return t.split("-")[0];
    }
    var X$1 = Math.max, ve = Math.min, Z$1 = Math.round;
    function ee(t, e2) {
      e2 === void 0 && (e2 = false);
      var n = t.getBoundingClientRect(), r = 1, o2 = 1;
      if (B(t) && e2) {
        var i2 = t.offsetHeight, a2 = t.offsetWidth;
        a2 > 0 && (r = Z$1(n.width) / a2 || 1), i2 > 0 && (o2 = Z$1(n.height) / i2 || 1);
      }
      return { width: n.width / r, height: n.height / o2, top: n.top / o2, right: n.right / r, bottom: n.bottom / o2, left: n.left / r, x: n.left / r, y: n.top / o2 };
    }
    function ke(t) {
      var e2 = ee(t), n = t.offsetWidth, r = t.offsetHeight;
      return Math.abs(e2.width - n) <= 1 && (n = e2.width), Math.abs(e2.height - r) <= 1 && (r = e2.height), { x: t.offsetLeft, y: t.offsetTop, width: n, height: r };
    }
    function it(t, e2) {
      var n = e2.getRootNode && e2.getRootNode();
      if (t.contains(e2)) return true;
      if (n && Pe(n)) {
        var r = e2;
        do {
          if (r && t.isSameNode(r)) return true;
          r = r.parentNode || r.host;
        } while (r);
      }
      return false;
    }
    function N$1(t) {
      return H(t).getComputedStyle(t);
    }
    function Wt(t) {
      return ["table", "td", "th"].indexOf(C(t)) >= 0;
    }
    function I$1(t) {
      return ((Q(t) ? t.ownerDocument : t.document) || window.document).documentElement;
    }
    function ge(t) {
      return C(t) === "html" ? t : t.assignedSlot || t.parentNode || (Pe(t) ? t.host : null) || I$1(t);
    }
    function at(t) {
      return !B(t) || N$1(t).position === "fixed" ? null : t.offsetParent;
    }
    function Bt(t) {
      var e2 = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
      if (n && B(t)) {
        var r = N$1(t);
        if (r.position === "fixed") return null;
      }
      var o2 = ge(t);
      for (Pe(o2) && (o2 = o2.host); B(o2) && ["html", "body"].indexOf(C(o2)) < 0; ) {
        var i2 = N$1(o2);
        if (i2.transform !== "none" || i2.perspective !== "none" || i2.contain === "paint" || ["transform", "perspective"].indexOf(i2.willChange) !== -1 || e2 && i2.willChange === "filter" || e2 && i2.filter && i2.filter !== "none") return o2;
        o2 = o2.parentNode;
      }
      return null;
    }
    function se(t) {
      for (var e2 = H(t), n = at(t); n && Wt(n) && N$1(n).position === "static"; ) n = at(n);
      return n && (C(n) === "html" || C(n) === "body" && N$1(n).position === "static") ? e2 : n || Bt(t) || e2;
    }
    function Le(t) {
      return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
    }
    function fe(t, e2, n) {
      return X$1(t, ve(e2, n));
    }
    function St(t, e2, n) {
      var r = fe(t, e2, n);
      return r > n ? n : r;
    }
    function st() {
      return { top: 0, right: 0, bottom: 0, left: 0 };
    }
    function ft(t) {
      return Object.assign({}, st(), t);
    }
    function ct(t, e2) {
      return e2.reduce(function(n, r) {
        return n[r] = t, n;
      }, {});
    }
    var Tt = function(t, e2) {
      return t = typeof t == "function" ? t(Object.assign({}, e2.rects, { placement: e2.placement })) : t, ft(typeof t != "number" ? t : ct(t, G));
    };
    function Ht(t) {
      var e2, n = t.state, r = t.name, o2 = t.options, i2 = n.elements.arrow, a2 = n.modifiersData.popperOffsets, s2 = q(n.placement), f2 = Le(s2), c2 = [P$1, W].indexOf(s2) >= 0, u2 = c2 ? "height" : "width";
      if (!(!i2 || !a2)) {
        var m2 = Tt(o2.padding, n), v4 = ke(i2), l2 = f2 === "y" ? E$2 : P$1, h2 = f2 === "y" ? R : W, p2 = n.rects.reference[u2] + n.rects.reference[f2] - a2[f2] - n.rects.popper[u2], g = a2[f2] - n.rects.reference[f2], x2 = se(i2), y = x2 ? f2 === "y" ? x2.clientHeight || 0 : x2.clientWidth || 0 : 0, $2 = p2 / 2 - g / 2, d2 = m2[l2], b2 = y - v4[u2] - m2[h2], w2 = y / 2 - v4[u2] / 2 + $2, O2 = fe(d2, w2, b2), j = f2;
        n.modifiersData[r] = (e2 = {}, e2[j] = O2, e2.centerOffset = O2 - w2, e2);
      }
    }
    function Ct(t) {
      var e2 = t.state, n = t.options, r = n.element, o2 = r === void 0 ? "[data-popper-arrow]" : r;
      o2 != null && (typeof o2 == "string" && (o2 = e2.elements.popper.querySelector(o2), !o2) || !it(e2.elements.popper, o2) || (e2.elements.arrow = o2));
    }
    var pt = { name: "arrow", enabled: true, phase: "main", fn: Ht, effect: Ct, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
    function te(t) {
      return t.split("-")[1];
    }
    var qt = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
    function Vt(t) {
      var e2 = t.x, n = t.y, r = window, o2 = r.devicePixelRatio || 1;
      return { x: Z$1(e2 * o2) / o2 || 0, y: Z$1(n * o2) / o2 || 0 };
    }
    function ut(t) {
      var e2, n = t.popper, r = t.popperRect, o2 = t.placement, i2 = t.variation, a2 = t.offsets, s2 = t.position, f2 = t.gpuAcceleration, c2 = t.adaptive, u2 = t.roundOffsets, m2 = t.isFixed, v4 = a2.x, l2 = v4 === void 0 ? 0 : v4, h2 = a2.y, p2 = h2 === void 0 ? 0 : h2, g = typeof u2 == "function" ? u2({ x: l2, y: p2 }) : { x: l2, y: p2 };
      l2 = g.x, p2 = g.y;
      var x2 = a2.hasOwnProperty("x"), y = a2.hasOwnProperty("y"), $2 = P$1, d2 = E$2, b2 = window;
      if (c2) {
        var w2 = se(n), O2 = "clientHeight", j = "clientWidth";
        if (w2 === H(n) && (w2 = I$1(n), N$1(w2).position !== "static" && s2 === "absolute" && (O2 = "scrollHeight", j = "scrollWidth")), w2 = w2, o2 === E$2 || (o2 === P$1 || o2 === W) && i2 === J) {
          d2 = R;
          var A2 = m2 && w2 === b2 && b2.visualViewport ? b2.visualViewport.height : w2[O2];
          p2 -= A2 - r.height, p2 *= f2 ? 1 : -1;
        }
        if (o2 === P$1 || (o2 === E$2 || o2 === R) && i2 === J) {
          $2 = W;
          var k2 = m2 && w2 === b2 && b2.visualViewport ? b2.visualViewport.width : w2[j];
          l2 -= k2 - r.width, l2 *= f2 ? 1 : -1;
        }
      }
      var D2 = Object.assign({ position: s2 }, c2 && qt), S2 = u2 === true ? Vt({ x: l2, y: p2 }) : { x: l2, y: p2 };
      if (l2 = S2.x, p2 = S2.y, f2) {
        var L2;
        return Object.assign({}, D2, (L2 = {}, L2[d2] = y ? "0" : "", L2[$2] = x2 ? "0" : "", L2.transform = (b2.devicePixelRatio || 1) <= 1 ? "translate(" + l2 + "px, " + p2 + "px)" : "translate3d(" + l2 + "px, " + p2 + "px, 0)", L2));
      }
      return Object.assign({}, D2, (e2 = {}, e2[d2] = y ? p2 + "px" : "", e2[$2] = x2 ? l2 + "px" : "", e2.transform = "", e2));
    }
    function Nt(t) {
      var e2 = t.state, n = t.options, r = n.gpuAcceleration, o2 = r === void 0 ? true : r, i2 = n.adaptive, a2 = i2 === void 0 ? true : i2, s2 = n.roundOffsets, f2 = s2 === void 0 ? true : s2, c2 = { placement: q(e2.placement), variation: te(e2.placement), popper: e2.elements.popper, popperRect: e2.rects.popper, gpuAcceleration: o2, isFixed: e2.options.strategy === "fixed" };
      e2.modifiersData.popperOffsets != null && (e2.styles.popper = Object.assign({}, e2.styles.popper, ut(Object.assign({}, c2, { offsets: e2.modifiersData.popperOffsets, position: e2.options.strategy, adaptive: a2, roundOffsets: f2 })))), e2.modifiersData.arrow != null && (e2.styles.arrow = Object.assign({}, e2.styles.arrow, ut(Object.assign({}, c2, { offsets: e2.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: f2 })))), e2.attributes.popper = Object.assign({}, e2.attributes.popper, { "data-popper-placement": e2.placement });
    }
    var Me = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: Nt, data: {} }, ye = { passive: true };
    function It(t) {
      var e2 = t.state, n = t.instance, r = t.options, o2 = r.scroll, i2 = o2 === void 0 ? true : o2, a2 = r.resize, s2 = a2 === void 0 ? true : a2, f2 = H(e2.elements.popper), c2 = [].concat(e2.scrollParents.reference, e2.scrollParents.popper);
      return i2 && c2.forEach(function(u2) {
        u2.addEventListener("scroll", n.update, ye);
      }), s2 && f2.addEventListener("resize", n.update, ye), function() {
        i2 && c2.forEach(function(u2) {
          u2.removeEventListener("scroll", n.update, ye);
        }), s2 && f2.removeEventListener("resize", n.update, ye);
      };
    }
    var Re = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
    }, effect: It, data: {} }, _t = { left: "right", right: "left", bottom: "top", top: "bottom" };
    function be(t) {
      return t.replace(/left|right|bottom|top/g, function(e2) {
        return _t[e2];
      });
    }
    var zt = { start: "end", end: "start" };
    function lt$1(t) {
      return t.replace(/start|end/g, function(e2) {
        return zt[e2];
      });
    }
    function We(t) {
      var e2 = H(t), n = e2.pageXOffset, r = e2.pageYOffset;
      return { scrollLeft: n, scrollTop: r };
    }
    function Be(t) {
      return ee(I$1(t)).left + We(t).scrollLeft;
    }
    function Ft(t) {
      var e2 = H(t), n = I$1(t), r = e2.visualViewport, o2 = n.clientWidth, i2 = n.clientHeight, a2 = 0, s2 = 0;
      return r && (o2 = r.width, i2 = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a2 = r.offsetLeft, s2 = r.offsetTop)), { width: o2, height: i2, x: a2 + Be(t), y: s2 };
    }
    function Ut(t) {
      var e2, n = I$1(t), r = We(t), o2 = (e2 = t.ownerDocument) == null ? void 0 : e2.body, i2 = X$1(n.scrollWidth, n.clientWidth, o2 ? o2.scrollWidth : 0, o2 ? o2.clientWidth : 0), a2 = X$1(n.scrollHeight, n.clientHeight, o2 ? o2.scrollHeight : 0, o2 ? o2.clientHeight : 0), s2 = -r.scrollLeft + Be(t), f2 = -r.scrollTop;
      return N$1(o2 || n).direction === "rtl" && (s2 += X$1(n.clientWidth, o2 ? o2.clientWidth : 0) - i2), { width: i2, height: a2, x: s2, y: f2 };
    }
    function Se(t) {
      var e2 = N$1(t), n = e2.overflow, r = e2.overflowX, o2 = e2.overflowY;
      return /auto|scroll|overlay|hidden/.test(n + o2 + r);
    }
    function dt(t) {
      return ["html", "body", "#document"].indexOf(C(t)) >= 0 ? t.ownerDocument.body : B(t) && Se(t) ? t : dt(ge(t));
    }
    function ce(t, e2) {
      var n;
      e2 === void 0 && (e2 = []);
      var r = dt(t), o2 = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i2 = H(r), a2 = o2 ? [i2].concat(i2.visualViewport || [], Se(r) ? r : []) : r, s2 = e2.concat(a2);
      return o2 ? s2 : s2.concat(ce(ge(a2)));
    }
    function Te(t) {
      return Object.assign({}, t, { left: t.x, top: t.y, right: t.x + t.width, bottom: t.y + t.height });
    }
    function Xt(t) {
      var e2 = ee(t);
      return e2.top = e2.top + t.clientTop, e2.left = e2.left + t.clientLeft, e2.bottom = e2.top + t.clientHeight, e2.right = e2.left + t.clientWidth, e2.width = t.clientWidth, e2.height = t.clientHeight, e2.x = e2.left, e2.y = e2.top, e2;
    }
    function ht(t, e2) {
      return e2 === je ? Te(Ft(t)) : Q(e2) ? Xt(e2) : Te(Ut(I$1(t)));
    }
    function Yt(t) {
      var e2 = ce(ge(t)), n = ["absolute", "fixed"].indexOf(N$1(t).position) >= 0, r = n && B(t) ? se(t) : t;
      return Q(r) ? e2.filter(function(o2) {
        return Q(o2) && it(o2, r) && C(o2) !== "body";
      }) : [];
    }
    function Gt(t, e2, n) {
      var r = e2 === "clippingParents" ? Yt(t) : [].concat(e2), o2 = [].concat(r, [n]), i2 = o2[0], a2 = o2.reduce(function(s2, f2) {
        var c2 = ht(t, f2);
        return s2.top = X$1(c2.top, s2.top), s2.right = ve(c2.right, s2.right), s2.bottom = ve(c2.bottom, s2.bottom), s2.left = X$1(c2.left, s2.left), s2;
      }, ht(t, i2));
      return a2.width = a2.right - a2.left, a2.height = a2.bottom - a2.top, a2.x = a2.left, a2.y = a2.top, a2;
    }
    function mt(t) {
      var e2 = t.reference, n = t.element, r = t.placement, o2 = r ? q(r) : null, i2 = r ? te(r) : null, a2 = e2.x + e2.width / 2 - n.width / 2, s2 = e2.y + e2.height / 2 - n.height / 2, f2;
      switch (o2) {
        case E$2:
          f2 = { x: a2, y: e2.y - n.height };
          break;
        case R:
          f2 = { x: a2, y: e2.y + e2.height };
          break;
        case W:
          f2 = { x: e2.x + e2.width, y: s2 };
          break;
        case P$1:
          f2 = { x: e2.x - n.width, y: s2 };
          break;
        default:
          f2 = { x: e2.x, y: e2.y };
      }
      var c2 = o2 ? Le(o2) : null;
      if (c2 != null) {
        var u2 = c2 === "y" ? "height" : "width";
        switch (i2) {
          case U$2:
            f2[c2] = f2[c2] - (e2[u2] / 2 - n[u2] / 2);
            break;
          case J:
            f2[c2] = f2[c2] + (e2[u2] / 2 - n[u2] / 2);
            break;
        }
      }
      return f2;
    }
    function ne(t, e2) {
      e2 === void 0 && (e2 = {});
      var n = e2, r = n.placement, o2 = r === void 0 ? t.placement : r, i2 = n.boundary, a2 = i2 === void 0 ? Xe : i2, s2 = n.rootBoundary, f2 = s2 === void 0 ? je : s2, c2 = n.elementContext, u2 = c2 === void 0 ? K : c2, m2 = n.altBoundary, v4 = m2 === void 0 ? false : m2, l2 = n.padding, h2 = l2 === void 0 ? 0 : l2, p2 = ft(typeof h2 != "number" ? h2 : ct(h2, G)), g = u2 === K ? Ye : K, x2 = t.rects.popper, y = t.elements[v4 ? g : u2], $2 = Gt(Q(y) ? y : y.contextElement || I$1(t.elements.popper), a2, f2), d2 = ee(t.elements.reference), b2 = mt({ reference: d2, element: x2, placement: o2 }), w2 = Te(Object.assign({}, x2, b2)), O2 = u2 === K ? w2 : d2, j = { top: $2.top - O2.top + p2.top, bottom: O2.bottom - $2.bottom + p2.bottom, left: $2.left - O2.left + p2.left, right: O2.right - $2.right + p2.right }, A2 = t.modifiersData.offset;
      if (u2 === K && A2) {
        var k2 = A2[o2];
        Object.keys(j).forEach(function(D2) {
          var S2 = [W, R].indexOf(D2) >= 0 ? 1 : -1, L2 = [E$2, R].indexOf(D2) >= 0 ? "y" : "x";
          j[D2] += k2[L2] * S2;
        });
      }
      return j;
    }
    function Jt(t, e2) {
      e2 === void 0 && (e2 = {});
      var n = e2, r = n.placement, o2 = n.boundary, i2 = n.rootBoundary, a2 = n.padding, s2 = n.flipVariations, f2 = n.allowedAutoPlacements, c2 = f2 === void 0 ? Ee : f2, u2 = te(r), m2 = u2 ? s2 ? De : De.filter(function(h2) {
        return te(h2) === u2;
      }) : G, v4 = m2.filter(function(h2) {
        return c2.indexOf(h2) >= 0;
      });
      v4.length === 0 && (v4 = m2);
      var l2 = v4.reduce(function(h2, p2) {
        return h2[p2] = ne(t, { placement: p2, boundary: o2, rootBoundary: i2, padding: a2 })[q(p2)], h2;
      }, {});
      return Object.keys(l2).sort(function(h2, p2) {
        return l2[h2] - l2[p2];
      });
    }
    function Kt(t) {
      if (q(t) === me) return [];
      var e2 = be(t);
      return [lt$1(t), e2, lt$1(e2)];
    }
    function Qt(t) {
      var e2 = t.state, n = t.options, r = t.name;
      if (!e2.modifiersData[r]._skip) {
        for (var o2 = n.mainAxis, i2 = o2 === void 0 ? true : o2, a2 = n.altAxis, s2 = a2 === void 0 ? true : a2, f2 = n.fallbackPlacements, c2 = n.padding, u2 = n.boundary, m2 = n.rootBoundary, v4 = n.altBoundary, l2 = n.flipVariations, h2 = l2 === void 0 ? true : l2, p2 = n.allowedAutoPlacements, g = e2.options.placement, x2 = q(g), y = x2 === g, $2 = f2 || (y || !h2 ? [be(g)] : Kt(g)), d2 = [g].concat($2).reduce(function(z2, V2) {
          return z2.concat(q(V2) === me ? Jt(e2, { placement: V2, boundary: u2, rootBoundary: m2, padding: c2, flipVariations: h2, allowedAutoPlacements: p2 }) : V2);
        }, []), b2 = e2.rects.reference, w2 = e2.rects.popper, O2 = /* @__PURE__ */ new Map(), j = true, A2 = d2[0], k2 = 0; k2 < d2.length; k2++) {
          var D2 = d2[k2], S2 = q(D2), L2 = te(D2) === U$2, re = [E$2, R].indexOf(S2) >= 0, oe = re ? "width" : "height", M2 = ne(e2, { placement: D2, boundary: u2, rootBoundary: m2, altBoundary: v4, padding: c2 }), T2 = re ? L2 ? W : P$1 : L2 ? R : E$2;
          b2[oe] > w2[oe] && (T2 = be(T2));
          var pe = be(T2), _2 = [];
          if (i2 && _2.push(M2[S2] <= 0), s2 && _2.push(M2[T2] <= 0, M2[pe] <= 0), _2.every(function(z2) {
            return z2;
          })) {
            A2 = D2, j = false;
            break;
          }
          O2.set(D2, _2);
        }
        if (j) for (var ue = h2 ? 3 : 1, xe = function(z2) {
          var V2 = d2.find(function(de) {
            var ae = O2.get(de);
            if (ae) return ae.slice(0, z2).every(function(Y2) {
              return Y2;
            });
          });
          if (V2) return A2 = V2, "break";
        }, ie = ue; ie > 0; ie--) {
          var le = xe(ie);
          if (le === "break") break;
        }
        e2.placement !== A2 && (e2.modifiersData[r]._skip = true, e2.placement = A2, e2.reset = true);
      }
    }
    var vt = { name: "flip", enabled: true, phase: "main", fn: Qt, requiresIfExists: ["offset"], data: { _skip: false } };
    function gt(t, e2, n) {
      return n === void 0 && (n = { x: 0, y: 0 }), { top: t.top - e2.height - n.y, right: t.right - e2.width + n.x, bottom: t.bottom - e2.height + n.y, left: t.left - e2.width - n.x };
    }
    function yt(t) {
      return [E$2, W, R, P$1].some(function(e2) {
        return t[e2] >= 0;
      });
    }
    function Zt(t) {
      var e2 = t.state, n = t.name, r = e2.rects.reference, o2 = e2.rects.popper, i2 = e2.modifiersData.preventOverflow, a2 = ne(e2, { elementContext: "reference" }), s2 = ne(e2, { altBoundary: true }), f2 = gt(a2, r), c2 = gt(s2, o2, i2), u2 = yt(f2), m2 = yt(c2);
      e2.modifiersData[n] = { referenceClippingOffsets: f2, popperEscapeOffsets: c2, isReferenceHidden: u2, hasPopperEscaped: m2 }, e2.attributes.popper = Object.assign({}, e2.attributes.popper, { "data-popper-reference-hidden": u2, "data-popper-escaped": m2 });
    }
    var bt = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Zt };
    function en(t, e2, n) {
      var r = q(t), o2 = [P$1, E$2].indexOf(r) >= 0 ? -1 : 1, i2 = typeof n == "function" ? n(Object.assign({}, e2, { placement: t })) : n, a2 = i2[0], s2 = i2[1];
      return a2 = a2 || 0, s2 = (s2 || 0) * o2, [P$1, W].indexOf(r) >= 0 ? { x: s2, y: a2 } : { x: a2, y: s2 };
    }
    function tn(t) {
      var e2 = t.state, n = t.options, r = t.name, o2 = n.offset, i2 = o2 === void 0 ? [0, 0] : o2, a2 = Ee.reduce(function(u2, m2) {
        return u2[m2] = en(m2, e2.rects, i2), u2;
      }, {}), s2 = a2[e2.placement], f2 = s2.x, c2 = s2.y;
      e2.modifiersData.popperOffsets != null && (e2.modifiersData.popperOffsets.x += f2, e2.modifiersData.popperOffsets.y += c2), e2.modifiersData[r] = a2;
    }
    var wt = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: tn };
    function nn(t) {
      var e2 = t.state, n = t.name;
      e2.modifiersData[n] = mt({ reference: e2.rects.reference, element: e2.rects.popper, placement: e2.placement });
    }
    var He = { name: "popperOffsets", enabled: true, phase: "read", fn: nn, data: {} };
    function rn(t) {
      return t === "x" ? "y" : "x";
    }
    function on(t) {
      var e2 = t.state, n = t.options, r = t.name, o2 = n.mainAxis, i2 = o2 === void 0 ? true : o2, a2 = n.altAxis, s2 = a2 === void 0 ? false : a2, f2 = n.boundary, c2 = n.rootBoundary, u2 = n.altBoundary, m2 = n.padding, v4 = n.tether, l2 = v4 === void 0 ? true : v4, h2 = n.tetherOffset, p2 = h2 === void 0 ? 0 : h2, g = ne(e2, { boundary: f2, rootBoundary: c2, padding: m2, altBoundary: u2 }), x2 = q(e2.placement), y = te(e2.placement), $2 = !y, d2 = Le(x2), b2 = rn(d2), w2 = e2.modifiersData.popperOffsets, O2 = e2.rects.reference, j = e2.rects.popper, A2 = typeof p2 == "function" ? p2(Object.assign({}, e2.rects, { placement: e2.placement })) : p2, k2 = typeof A2 == "number" ? { mainAxis: A2, altAxis: A2 } : Object.assign({ mainAxis: 0, altAxis: 0 }, A2), D2 = e2.modifiersData.offset ? e2.modifiersData.offset[e2.placement] : null, S2 = { x: 0, y: 0 };
      if (w2) {
        if (i2) {
          var L2, re = d2 === "y" ? E$2 : P$1, oe = d2 === "y" ? R : W, M2 = d2 === "y" ? "height" : "width", T2 = w2[d2], pe = T2 + g[re], _2 = T2 - g[oe], ue = l2 ? -j[M2] / 2 : 0, xe = y === U$2 ? O2[M2] : j[M2], ie = y === U$2 ? -j[M2] : -O2[M2], le = e2.elements.arrow, z2 = l2 && le ? ke(le) : { width: 0, height: 0 }, V2 = e2.modifiersData["arrow#persistent"] ? e2.modifiersData["arrow#persistent"].padding : st(), de = V2[re], ae = V2[oe], Y2 = fe(0, O2[M2], z2[M2]), jt = $2 ? O2[M2] / 2 - ue - Y2 - de - k2.mainAxis : xe - Y2 - de - k2.mainAxis, Dt = $2 ? -O2[M2] / 2 + ue + Y2 + ae + k2.mainAxis : ie + Y2 + ae + k2.mainAxis, Oe = e2.elements.arrow && se(e2.elements.arrow), Et = Oe ? d2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L2 = D2 == null ? void 0 : D2[d2]) != null ? L2 : 0, Pt = T2 + jt - Ce - Et, At = T2 + Dt - Ce, qe = fe(l2 ? ve(pe, Pt) : pe, T2, l2 ? X$1(_2, At) : _2);
          w2[d2] = qe, S2[d2] = qe - T2;
        }
        if (s2) {
          var Ve, kt = d2 === "x" ? E$2 : P$1, Lt = d2 === "x" ? R : W, F2 = w2[b2], he = b2 === "y" ? "height" : "width", Ne = F2 + g[kt], Ie = F2 - g[Lt], $e = [E$2, P$1].indexOf(x2) !== -1, _e = (Ve = D2 == null ? void 0 : D2[b2]) != null ? Ve : 0, ze = $e ? Ne : F2 - O2[he] - j[he] - _e + k2.altAxis, Fe = $e ? F2 + O2[he] + j[he] - _e - k2.altAxis : Ie, Ue = l2 && $e ? St(ze, F2, Fe) : fe(l2 ? ze : Ne, F2, l2 ? Fe : Ie);
          w2[b2] = Ue, S2[b2] = Ue - F2;
        }
        e2.modifiersData[r] = S2;
      }
    }
    var xt = { name: "preventOverflow", enabled: true, phase: "main", fn: on, requiresIfExists: ["offset"] };
    function an(t) {
      return { scrollLeft: t.scrollLeft, scrollTop: t.scrollTop };
    }
    function sn(t) {
      return t === H(t) || !B(t) ? We(t) : an(t);
    }
    function fn(t) {
      var e2 = t.getBoundingClientRect(), n = Z$1(e2.width) / t.offsetWidth || 1, r = Z$1(e2.height) / t.offsetHeight || 1;
      return n !== 1 || r !== 1;
    }
    function cn(t, e2, n) {
      n === void 0 && (n = false);
      var r = B(e2), o2 = B(e2) && fn(e2), i2 = I$1(e2), a2 = ee(t, o2), s2 = { scrollLeft: 0, scrollTop: 0 }, f2 = { x: 0, y: 0 };
      return (r || !r && !n) && ((C(e2) !== "body" || Se(i2)) && (s2 = sn(e2)), B(e2) ? (f2 = ee(e2, true), f2.x += e2.clientLeft, f2.y += e2.clientTop) : i2 && (f2.x = Be(i2))), { x: a2.left + s2.scrollLeft - f2.x, y: a2.top + s2.scrollTop - f2.y, width: a2.width, height: a2.height };
    }
    function pn(t) {
      var e2 = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
      t.forEach(function(i2) {
        e2.set(i2.name, i2);
      });
      function o2(i2) {
        n.add(i2.name);
        var a2 = [].concat(i2.requires || [], i2.requiresIfExists || []);
        a2.forEach(function(s2) {
          if (!n.has(s2)) {
            var f2 = e2.get(s2);
            f2 && o2(f2);
          }
        }), r.push(i2);
      }
      return t.forEach(function(i2) {
        n.has(i2.name) || o2(i2);
      }), r;
    }
    function un(t) {
      var e2 = pn(t);
      return ot.reduce(function(n, r) {
        return n.concat(e2.filter(function(o2) {
          return o2.phase === r;
        }));
      }, []);
    }
    function ln(t) {
      var e2;
      return function() {
        return e2 || (e2 = new Promise(function(n) {
          Promise.resolve().then(function() {
            e2 = void 0, n(t());
          });
        })), e2;
      };
    }
    function dn(t) {
      var e2 = t.reduce(function(n, r) {
        var o2 = n[r.name];
        return n[r.name] = o2 ? Object.assign({}, o2, r, { options: Object.assign({}, o2.options, r.options), data: Object.assign({}, o2.data, r.data) }) : r, n;
      }, {});
      return Object.keys(e2).map(function(n) {
        return e2[n];
      });
    }
    var Ot = { placement: "bottom", modifiers: [], strategy: "absolute" };
    function $t() {
      for (var t = arguments.length, e2 = new Array(t), n = 0; n < t; n++) e2[n] = arguments[n];
      return !e2.some(function(r) {
        return !(r && typeof r.getBoundingClientRect == "function");
      });
    }
    function we(t) {
      t === void 0 && (t = {});
      var e2 = t, n = e2.defaultModifiers, r = n === void 0 ? [] : n, o2 = e2.defaultOptions, i2 = o2 === void 0 ? Ot : o2;
      return function(a2, s2, f2) {
        f2 === void 0 && (f2 = i2);
        var c2 = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ot, i2), modifiersData: {}, elements: { reference: a2, popper: s2 }, attributes: {}, styles: {} }, u2 = [], m2 = false, v4 = { state: c2, setOptions: function(p2) {
          var g = typeof p2 == "function" ? p2(c2.options) : p2;
          h2(), c2.options = Object.assign({}, i2, c2.options, g), c2.scrollParents = { reference: Q(a2) ? ce(a2) : a2.contextElement ? ce(a2.contextElement) : [], popper: ce(s2) };
          var x2 = un(dn([].concat(r, c2.options.modifiers)));
          return c2.orderedModifiers = x2.filter(function(y) {
            return y.enabled;
          }), l2(), v4.update();
        }, forceUpdate: function() {
          if (!m2) {
            var p2 = c2.elements, g = p2.reference, x2 = p2.popper;
            if ($t(g, x2)) {
              c2.rects = { reference: cn(g, se(x2), c2.options.strategy === "fixed"), popper: ke(x2) }, c2.reset = false, c2.placement = c2.options.placement, c2.orderedModifiers.forEach(function(j) {
                return c2.modifiersData[j.name] = Object.assign({}, j.data);
              });
              for (var y = 0; y < c2.orderedModifiers.length; y++) {
                if (c2.reset === true) {
                  c2.reset = false, y = -1;
                  continue;
                }
                var $2 = c2.orderedModifiers[y], d2 = $2.fn, b2 = $2.options, w2 = b2 === void 0 ? {} : b2, O2 = $2.name;
                typeof d2 == "function" && (c2 = d2({ state: c2, options: w2, name: O2, instance: v4 }) || c2);
              }
            }
          }
        }, update: ln(function() {
          return new Promise(function(p2) {
            v4.forceUpdate(), p2(c2);
          });
        }), destroy: function() {
          h2(), m2 = true;
        } };
        if (!$t(a2, s2)) return v4;
        v4.setOptions(f2).then(function(p2) {
          !m2 && f2.onFirstUpdate && f2.onFirstUpdate(p2);
        });
        function l2() {
          c2.orderedModifiers.forEach(function(p2) {
            var g = p2.name, x2 = p2.options, y = x2 === void 0 ? {} : x2, $2 = p2.effect;
            if (typeof $2 == "function") {
              var d2 = $2({ state: c2, name: g, instance: v4, options: y }), b2 = function() {
              };
              u2.push(d2 || b2);
            }
          });
        }
        function h2() {
          u2.forEach(function(p2) {
            return p2();
          }), u2 = [];
        }
        return v4;
      };
    }
    we();
    var mn = [Re, He, Me, Ae];
    we({ defaultModifiers: mn });
    var gn = [Re, He, Me, Ae, wt, vt, xt, pt, bt], yn = we({ defaultModifiers: gn });
    const popperArrowProps = buildProps({
      arrowOffset: {
        type: Number,
        default: 5
      }
    });
    const POSITIONING_STRATEGIES = ["fixed", "absolute"];
    const popperCoreConfigProps = buildProps({
      boundariesPadding: {
        type: Number,
        default: 0
      },
      fallbackPlacements: {
        type: definePropType(Array),
        default: void 0
      },
      gpuAcceleration: {
        type: Boolean,
        default: true
      },
      offset: {
        type: Number,
        default: 12
      },
      placement: {
        type: String,
        values: Ee,
        default: "bottom"
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      },
      strategy: {
        type: String,
        values: POSITIONING_STRATEGIES,
        default: "absolute"
      }
    });
    const popperContentProps = buildProps({
      ...popperCoreConfigProps,
      ...popperArrowProps,
      id: String,
      style: {
        type: definePropType([String, Array, Object])
      },
      className: {
        type: definePropType([String, Array, Object])
      },
      effect: {
        type: definePropType(String),
        default: "dark"
      },
      visible: Boolean,
      enterable: {
        type: Boolean,
        default: true
      },
      pure: Boolean,
      focusOnShow: {
        type: Boolean,
        default: false
      },
      trapping: {
        type: Boolean,
        default: false
      },
      popperClass: {
        type: definePropType([String, Array, Object])
      },
      popperStyle: {
        type: definePropType([String, Array, Object])
      },
      referenceEl: {
        type: definePropType(Object)
      },
      triggerTargetEl: {
        type: definePropType(Object)
      },
      stopPopperMouseEvent: {
        type: Boolean,
        default: true
      },
      virtualTriggering: Boolean,
      zIndex: Number,
      ...useAriaProps(["ariaLabel"])
    });
    const popperContentEmits = {
      mouseenter: (evt) => evt instanceof MouseEvent,
      mouseleave: (evt) => evt instanceof MouseEvent,
      focus: () => true,
      blur: () => true,
      close: () => true
    };
    const usePopperContentFocusTrap = (props2, emit2) => {
      const trapped = ref(false);
      const focusStartRef = ref();
      const onFocusAfterTrapped = () => {
        emit2("focus");
      };
      const onFocusAfterReleased = (event) => {
        var _a2;
        if (((_a2 = event.detail) == null ? void 0 : _a2.focusReason) !== "pointer") {
          focusStartRef.value = "first";
          emit2("blur");
        }
      };
      const onFocusInTrap = (event) => {
        if (props2.visible && !trapped.value) {
          if (event.target) {
            focusStartRef.value = event.target;
          }
          trapped.value = true;
        }
      };
      const onFocusoutPrevented = (event) => {
        if (!props2.trapping) {
          if (event.detail.focusReason === "pointer") {
            event.preventDefault();
          }
          trapped.value = false;
        }
      };
      const onReleaseRequested = () => {
        trapped.value = false;
        emit2("close");
      };
      return {
        focusStartRef,
        trapped,
        onFocusAfterReleased,
        onFocusAfterTrapped,
        onFocusInTrap,
        onFocusoutPrevented,
        onReleaseRequested
      };
    };
    const buildPopperOptions = (props2, modifiers = []) => {
      const { placement, strategy, popperOptions } = props2;
      const options = {
        placement,
        strategy,
        ...popperOptions,
        modifiers: [...genModifiers(props2), ...modifiers]
      };
      deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers);
      return options;
    };
    const unwrapMeasurableEl = ($el) => {
      if (!isClient)
        return;
      return unrefElement($el);
    };
    function genModifiers(options) {
      const { offset: offset2, gpuAcceleration, fallbackPlacements } = options;
      return [
        {
          name: "offset",
          options: {
            offset: [0, offset2 != null ? offset2 : 12]
          }
        },
        {
          name: "preventOverflow",
          options: {
            padding: {
              top: 2,
              bottom: 2,
              left: 5,
              right: 5
            }
          }
        },
        {
          name: "flip",
          options: {
            padding: 5,
            fallbackPlacements
          }
        },
        {
          name: "computeStyles",
          options: {
            gpuAcceleration
          }
        }
      ];
    }
    function deriveExtraModifiers(options, modifiers) {
      if (modifiers) {
        options.modifiers = [...options.modifiers, ...modifiers != null ? modifiers : []];
      }
    }
    const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
      const stateUpdater = {
        name: "updateState",
        enabled: true,
        phase: "write",
        fn: ({ state }) => {
          const derivedState = deriveState(state);
          Object.assign(states.value, derivedState);
        },
        requires: ["computeStyles"]
      };
      const options = computed(() => {
        const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
        return {
          onFirstUpdate,
          placement: placement || "bottom",
          strategy: strategy || "absolute",
          modifiers: [
            ...modifiers || [],
            stateUpdater,
            { name: "applyStyles", enabled: false }
          ]
        };
      });
      const instanceRef = shallowRef();
      const states = ref({
        styles: {
          popper: {
            position: unref(options).strategy,
            left: "0",
            top: "0"
          },
          arrow: {
            position: "absolute"
          }
        },
        attributes: {}
      });
      const destroy = () => {
        if (!instanceRef.value)
          return;
        instanceRef.value.destroy();
        instanceRef.value = void 0;
      };
      watch(options, (newOptions) => {
        const instance = unref(instanceRef);
        if (instance) {
          instance.setOptions(newOptions);
        }
      }, {
        deep: true
      });
      watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
        destroy();
        if (!referenceElement || !popperElement)
          return;
        instanceRef.value = yn(referenceElement, popperElement, unref(options));
      });
      onBeforeUnmount(() => {
        destroy();
      });
      return {
        state: computed(() => {
          var _a2;
          return { ...((_a2 = unref(instanceRef)) == null ? void 0 : _a2.state) || {} };
        }),
        styles: computed(() => unref(states).styles),
        attributes: computed(() => unref(states).attributes),
        update: () => {
          var _a2;
          return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.update();
        },
        forceUpdate: () => {
          var _a2;
          return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.forceUpdate();
        },
        instanceRef: computed(() => unref(instanceRef))
      };
    };
    function deriveState(state) {
      const elements = Object.keys(state.elements);
      const styles = fromPairs(elements.map((element) => [element, state.styles[element] || {}]));
      const attributes2 = fromPairs(elements.map((element) => [element, state.attributes[element]]));
      return {
        styles,
        attributes: attributes2
      };
    }
    const DEFAULT_ARROW_OFFSET = 0;
    const usePopperContent = (props2) => {
      const { popperInstanceRef, contentRef, triggerRef, role } = inject(POPPER_INJECTION_KEY, void 0);
      const arrowRef = ref();
      const arrowOffset = computed(() => props2.arrowOffset);
      const eventListenerModifier = computed(() => {
        return {
          name: "eventListeners",
          enabled: !!props2.visible
        };
      });
      const arrowModifier = computed(() => {
        var _a2;
        const arrowEl = unref(arrowRef);
        const offset2 = (_a2 = unref(arrowOffset)) != null ? _a2 : DEFAULT_ARROW_OFFSET;
        return {
          name: "arrow",
          enabled: !isUndefined$2(arrowEl),
          options: {
            element: arrowEl,
            padding: offset2
          }
        };
      });
      const options = computed(() => {
        return {
          onFirstUpdate: () => {
            update();
          },
          ...buildPopperOptions(props2, [
            unref(arrowModifier),
            unref(eventListenerModifier)
          ])
        };
      });
      const computedReference = computed(() => unwrapMeasurableEl(props2.referenceEl) || unref(triggerRef));
      const { attributes: attributes2, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options);
      watch(instanceRef, (instance) => popperInstanceRef.value = instance, {
        flush: "sync"
      });
      onMounted(() => {
        watch(() => {
          var _a2;
          return (_a2 = unref(computedReference)) == null ? void 0 : _a2.getBoundingClientRect();
        }, () => {
          update();
        });
      });
      return {
        attributes: attributes2,
        arrowRef,
        contentRef,
        instanceRef,
        state,
        styles,
        role,
        forceUpdate,
        update
      };
    };
    const usePopperContentDOM = (props2, {
      attributes: attributes2,
      styles,
      role
    }) => {
      const { nextZIndex } = useZIndex();
      const ns = useNamespace("popper");
      const contentAttrs = computed(() => unref(attributes2).popper);
      const contentZIndex = ref(isNumber$2(props2.zIndex) ? props2.zIndex : nextZIndex());
      const contentClass = computed(() => [
        ns.b(),
        ns.is("pure", props2.pure),
        ns.is(props2.effect),
        props2.popperClass
      ]);
      const contentStyle = computed(() => {
        return [
          { zIndex: unref(contentZIndex) },
          unref(styles).popper,
          props2.popperStyle || {}
        ];
      });
      const ariaModal = computed(() => role.value === "dialog" ? "false" : void 0);
      const arrowStyle = computed(() => unref(styles).arrow || {});
      const updateZIndex = () => {
        contentZIndex.value = isNumber$2(props2.zIndex) ? props2.zIndex : nextZIndex();
      };
      return {
        ariaModal,
        arrowStyle,
        contentAttrs,
        contentClass,
        contentStyle,
        contentZIndex,
        updateZIndex
      };
    };
    const __default__$1M = /* @__PURE__ */ defineComponent({
      name: "ElPopperContent"
    });
    const _sfc_main$2u = /* @__PURE__ */ defineComponent({
      ...__default__$1M,
      props: popperContentProps,
      emits: popperContentEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const {
          focusStartRef,
          trapped,
          onFocusAfterReleased,
          onFocusAfterTrapped,
          onFocusInTrap,
          onFocusoutPrevented,
          onReleaseRequested
        } = usePopperContentFocusTrap(props2, emit2);
        const { attributes: attributes2, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props2);
        const {
          ariaModal,
          arrowStyle,
          contentAttrs,
          contentClass,
          contentStyle,
          updateZIndex
        } = usePopperContentDOM(props2, {
          styles,
          attributes: attributes2,
          role
        });
        const formItemContext = inject(formItemContextKey, void 0);
        provide(POPPER_CONTENT_INJECTION_KEY, {
          arrowStyle,
          arrowRef
        });
        if (formItemContext) {
          provide(formItemContextKey, {
            ...formItemContext,
            addInputId: NOOP,
            removeInputId: NOOP
          });
        }
        let triggerTargetAriaStopWatch = void 0;
        const updatePopper = (shouldUpdateZIndex = true) => {
          update();
          shouldUpdateZIndex && updateZIndex();
        };
        const togglePopperAlive = () => {
          updatePopper(false);
          if (props2.visible && props2.focusOnShow) {
            trapped.value = true;
          } else if (props2.visible === false) {
            trapped.value = false;
          }
        };
        onMounted(() => {
          watch(() => props2.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
            triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
            triggerTargetAriaStopWatch = void 0;
            const el = unref(triggerTargetEl || contentRef.value);
            const prevEl = unref(prevTriggerTargetEl || contentRef.value);
            if (isElement$1(el)) {
              triggerTargetAriaStopWatch = watch([role, () => props2.ariaLabel, ariaModal, () => props2.id], (watches) => {
                ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
                  isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
                });
              }, { immediate: true });
            }
            if (prevEl !== el && isElement$1(prevEl)) {
              ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
                prevEl.removeAttribute(key);
              });
            }
          }, { immediate: true });
          watch(() => props2.visible, togglePopperAlive, { immediate: true });
        });
        onBeforeUnmount(() => {
          triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
          triggerTargetAriaStopWatch = void 0;
        });
        expose({
          popperContentRef: contentRef,
          popperInstanceRef: instanceRef,
          updatePopper,
          contentStyle
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", mergeProps({
            ref_key: "contentRef",
            ref: contentRef
          }, unref(contentAttrs), {
            style: unref(contentStyle),
            class: unref(contentClass),
            tabindex: "-1",
            onMouseenter: (e2) => _ctx.$emit("mouseenter", e2),
            onMouseleave: (e2) => _ctx.$emit("mouseleave", e2)
          }), [
            createVNode$1(unref(ElFocusTrap), {
              trapped: unref(trapped),
              "trap-on-focus-in": true,
              "focus-trap-el": unref(contentRef),
              "focus-start-el": unref(focusStartRef),
              onFocusAfterTrapped: unref(onFocusAfterTrapped),
              onFocusAfterReleased: unref(onFocusAfterReleased),
              onFocusin: unref(onFocusInTrap),
              onFocusoutPrevented: unref(onFocusoutPrevented),
              onReleaseRequested: unref(onReleaseRequested)
            }, {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "default")
              ]),
              _: 3
            }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
          ], 16, ["onMouseenter", "onMouseleave"]);
        };
      }
    });
    var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$2u, [["__file", "content.vue"]]);
    const ElPopper = withInstall(Popper);
    const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
    function useTimeout() {
      let timeoutHandle;
      const registerTimeout = (fn2, delay) => {
        cancelTimeout();
        timeoutHandle = window.setTimeout(fn2, delay);
      };
      const cancelTimeout = () => window.clearTimeout(timeoutHandle);
      tryOnScopeDispose(() => cancelTimeout());
      return {
        registerTimeout,
        cancelTimeout
      };
    }
    const useDelayedToggleProps = buildProps({
      showAfter: {
        type: Number,
        default: 0
      },
      hideAfter: {
        type: Number,
        default: 200
      },
      autoClose: {
        type: Number,
        default: 0
      }
    });
    const useDelayedToggle = ({
      showAfter,
      hideAfter,
      autoClose,
      open: open2,
      close: close2
    }) => {
      const { registerTimeout } = useTimeout();
      const {
        registerTimeout: registerTimeoutForAutoClose,
        cancelTimeout: cancelTimeoutForAutoClose
      } = useTimeout();
      const onOpen = (event) => {
        registerTimeout(() => {
          open2(event);
          const _autoClose = unref(autoClose);
          if (isNumber$2(_autoClose) && _autoClose > 0) {
            registerTimeoutForAutoClose(() => {
              close2(event);
            }, _autoClose);
          }
        }, unref(showAfter));
      };
      const onClose = (event) => {
        cancelTimeoutForAutoClose();
        registerTimeout(() => {
          close2(event);
        }, unref(hideAfter));
      };
      return {
        onOpen,
        onClose
      };
    };
    const teleportProps = buildProps({
      to: {
        type: definePropType([String, Object]),
        required: true
      },
      disabled: Boolean
    });
    const useTooltipContentProps = buildProps({
      ...useDelayedToggleProps,
      ...popperContentProps,
      appendTo: {
        type: teleportProps.to.type
      },
      content: {
        type: String,
        default: ""
      },
      rawContent: Boolean,
      persistent: Boolean,
      visible: {
        type: definePropType(Boolean),
        default: null
      },
      transition: String,
      teleported: {
        type: Boolean,
        default: true
      },
      disabled: Boolean,
      ...useAriaProps(["ariaLabel"])
    });
    const useTooltipTriggerProps = buildProps({
      ...popperTriggerProps,
      disabled: Boolean,
      trigger: {
        type: definePropType([String, Array]),
        default: "hover"
      },
      triggerKeys: {
        type: definePropType(Array),
        default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
      }
    });
    const _prop = buildProp({
      type: definePropType(Boolean),
      default: null
    });
    const _event = buildProp({
      type: definePropType(Function)
    });
    const createModelToggleComposable = (name) => {
      const updateEventKey = `update:${name}`;
      const updateEventKeyRaw2 = `onUpdate:${name}`;
      const useModelToggleEmits2 = [updateEventKey];
      const useModelToggleProps2 = {
        [name]: _prop,
        [updateEventKeyRaw2]: _event
      };
      const useModelToggle2 = ({
        indicator,
        toggleReason,
        shouldHideWhenRouteChanges,
        shouldProceed,
        onShow,
        onHide
      }) => {
        const instance = getCurrentInstance();
        const { emit: emit2 } = instance;
        const props2 = instance.props;
        const hasUpdateHandler = computed(() => isFunction$4(props2[updateEventKeyRaw2]));
        const isModelBindingAbsent = computed(() => props2[name] === null);
        const doShow = (event) => {
          if (indicator.value === true) {
            return;
          }
          indicator.value = true;
          if (toggleReason) {
            toggleReason.value = event;
          }
          if (isFunction$4(onShow)) {
            onShow(event);
          }
        };
        const doHide = (event) => {
          if (indicator.value === false) {
            return;
          }
          indicator.value = false;
          if (toggleReason) {
            toggleReason.value = event;
          }
          if (isFunction$4(onHide)) {
            onHide(event);
          }
        };
        const show = (event) => {
          if (props2.disabled === true || isFunction$4(shouldProceed) && !shouldProceed())
            return;
          const shouldEmit = hasUpdateHandler.value && isClient;
          if (shouldEmit) {
            emit2(updateEventKey, true);
          }
          if (isModelBindingAbsent.value || !shouldEmit) {
            doShow(event);
          }
        };
        const hide = (event) => {
          if (props2.disabled === true || !isClient)
            return;
          const shouldEmit = hasUpdateHandler.value && isClient;
          if (shouldEmit) {
            emit2(updateEventKey, false);
          }
          if (isModelBindingAbsent.value || !shouldEmit) {
            doHide(event);
          }
        };
        const onChange = (val) => {
          if (!isBoolean$1(val))
            return;
          if (props2.disabled && val) {
            if (hasUpdateHandler.value) {
              emit2(updateEventKey, false);
            }
          } else if (indicator.value !== val) {
            if (val) {
              doShow();
            } else {
              doHide();
            }
          }
        };
        const toggle = () => {
          if (indicator.value) {
            hide();
          } else {
            show();
          }
        };
        watch(() => props2[name], onChange);
        if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
          watch(() => ({
            ...instance.proxy.$route
          }), () => {
            if (shouldHideWhenRouteChanges.value && indicator.value) {
              hide();
            }
          });
        }
        onMounted(() => {
          onChange(props2[name]);
        });
        return {
          hide,
          show,
          toggle,
          hasUpdateHandler
        };
      };
      return {
        useModelToggle: useModelToggle2,
        useModelToggleProps: useModelToggleProps2,
        useModelToggleEmits: useModelToggleEmits2
      };
    };
    const {
      useModelToggleProps: useTooltipModelToggleProps,
      useModelToggleEmits: useTooltipModelToggleEmits,
      useModelToggle: useTooltipModelToggle
    } = createModelToggleComposable("visible");
    const useTooltipProps = buildProps({
      ...popperProps,
      ...useTooltipModelToggleProps,
      ...useTooltipContentProps,
      ...useTooltipTriggerProps,
      ...popperArrowProps,
      showArrow: {
        type: Boolean,
        default: true
      }
    });
    const tooltipEmits = [
      ...useTooltipModelToggleEmits,
      "before-show",
      "before-hide",
      "show",
      "hide",
      "open",
      "close"
    ];
    const isTriggerType = (trigger2, type) => {
      if (isArray$5(trigger2)) {
        return trigger2.includes(type);
      }
      return trigger2 === type;
    };
    const whenTrigger = (trigger2, type, handler) => {
      return (e2) => {
        isTriggerType(unref(trigger2), type) && handler(e2);
      };
    };
    const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
      const handleEvent = (event) => {
        const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
        if (checkForDefaultPrevented === false || !shouldPrevent) {
          return oursHandler == null ? void 0 : oursHandler(event);
        }
      };
      return handleEvent;
    };
    const whenMouse = (handler) => {
      return (e2) => e2.pointerType === "mouse" ? handler(e2) : void 0;
    };
    const __default__$1L = /* @__PURE__ */ defineComponent({
      name: "ElTooltipTrigger"
    });
    const _sfc_main$2t = /* @__PURE__ */ defineComponent({
      ...__default__$1L,
      props: useTooltipTriggerProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const ns = useNamespace("tooltip");
        const { controlled, id, open: open2, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
        const triggerRef = ref(null);
        const stopWhenControlledOrDisabled = () => {
          if (unref(controlled) || props2.disabled) {
            return true;
          }
        };
        const trigger2 = toRef(props2, "trigger");
        const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onOpen));
        const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onClose));
        const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "click", (e2) => {
          if (e2.button === 0) {
            onToggle(e2);
          }
        }));
        const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onOpen));
        const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onClose));
        const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "contextmenu", (e2) => {
          e2.preventDefault();
          onToggle(e2);
        }));
        const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e2) => {
          const { code } = e2;
          if (props2.triggerKeys.includes(code)) {
            e2.preventDefault();
            onToggle(e2);
          }
        });
        expose({
          triggerRef
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElPopperTrigger), {
            id: unref(id),
            "virtual-ref": _ctx.virtualRef,
            open: unref(open2),
            "virtual-triggering": _ctx.virtualTriggering,
            class: normalizeClass(unref(ns).e("trigger")),
            onBlur: unref(onBlur),
            onClick: unref(onClick),
            onContextmenu: unref(onContextMenu),
            onFocus: unref(onFocus),
            onMouseenter: unref(onMouseenter),
            onMouseleave: unref(onMouseleave),
            onKeydown: unref(onKeydown)
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
        };
      }
    });
    var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$2t, [["__file", "trigger.vue"]]);
    const _sfc_main$2s = /* @__PURE__ */ defineComponent({
      __name: "teleport",
      props: teleportProps,
      setup(__props) {
        return (_ctx, _cache) => {
          return _ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport$1, {
            key: 1,
            to: _ctx.to
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 8, ["to"]));
        };
      }
    });
    var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$2s, [["__file", "teleport.vue"]]);
    const ElTeleport = withInstall(Teleport);
    const usePopperContainerId = () => {
      const namespace = useGetDerivedNamespace();
      const idInjection = useIdInjection();
      const id = computed(() => {
        return `${namespace.value}-popper-container-${idInjection.prefix}`;
      });
      const selector2 = computed(() => `#${id.value}`);
      return {
        id,
        selector: selector2
      };
    };
    const createContainer$1 = (id) => {
      const container = document.createElement("div");
      container.id = id;
      document.body.appendChild(container);
      return container;
    };
    const usePopperContainer = () => {
      const { id, selector: selector2 } = usePopperContainerId();
      onBeforeMount(() => {
        if (!isClient)
          return;
        if (!document.body.querySelector(selector2.value)) {
          createContainer$1(id.value);
        }
      });
      return {
        id,
        selector: selector2
      };
    };
    const __default__$1K = /* @__PURE__ */ defineComponent({
      name: "ElTooltipContent",
      inheritAttrs: false
    });
    const _sfc_main$2r = /* @__PURE__ */ defineComponent({
      ...__default__$1K,
      props: useTooltipContentProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const { selector: selector2 } = usePopperContainerId();
        const ns = useNamespace("tooltip");
        const contentRef = ref();
        const popperContentRef = computedEager(() => {
          var _a2;
          return (_a2 = contentRef.value) == null ? void 0 : _a2.popperContentRef;
        });
        let stopHandle;
        const {
          controlled,
          id,
          open: open2,
          trigger: trigger2,
          onClose,
          onOpen,
          onShow,
          onHide,
          onBeforeShow,
          onBeforeHide
        } = inject(TOOLTIP_INJECTION_KEY, void 0);
        const transitionClass = computed(() => {
          return props2.transition || `${ns.namespace.value}-fade-in-linear`;
        });
        const persistentRef = computed(() => {
          return props2.persistent;
        });
        onBeforeUnmount(() => {
          stopHandle == null ? void 0 : stopHandle();
        });
        const shouldRender = computed(() => {
          return unref(persistentRef) ? true : unref(open2);
        });
        const shouldShow = computed(() => {
          return props2.disabled ? false : unref(open2);
        });
        const appendTo = computed(() => {
          return props2.appendTo || selector2.value;
        });
        const contentStyle = computed(() => {
          var _a2;
          return (_a2 = props2.style) != null ? _a2 : {};
        });
        const ariaHidden = ref(true);
        const onTransitionLeave = () => {
          onHide();
          isFocusInsideContent() && tryFocus(document.body);
          ariaHidden.value = true;
        };
        const stopWhenControlled = () => {
          if (unref(controlled))
            return true;
        };
        const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
          if (props2.enterable && unref(trigger2) === "hover") {
            onOpen();
          }
        });
        const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
          if (unref(trigger2) === "hover") {
            onClose();
          }
        });
        const onBeforeEnter = () => {
          var _a2, _b2;
          (_b2 = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
          onBeforeShow == null ? void 0 : onBeforeShow();
        };
        const onBeforeLeave = () => {
          onBeforeHide == null ? void 0 : onBeforeHide();
        };
        const onAfterShow = () => {
          onShow();
        };
        const onBlur = () => {
          if (!props2.virtualTriggering) {
            onClose();
          }
        };
        const isFocusInsideContent = (event) => {
          var _a2;
          const popperContent = (_a2 = contentRef.value) == null ? void 0 : _a2.popperContentRef;
          const activeElement = (event == null ? void 0 : event.relatedTarget) || document.activeElement;
          return popperContent == null ? void 0 : popperContent.contains(activeElement);
        };
        watch(() => unref(open2), (val) => {
          if (!val) {
            stopHandle == null ? void 0 : stopHandle();
          } else {
            ariaHidden.value = false;
            stopHandle = onClickOutside(popperContentRef, () => {
              if (unref(controlled))
                return;
              const $trigger = unref(trigger2);
              if ($trigger !== "hover") {
                onClose();
              }
            });
          }
        }, {
          flush: "post"
        });
        watch(() => props2.content, () => {
          var _a2, _b2;
          (_b2 = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
        });
        expose({
          contentRef,
          isFocusInsideContent
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTeleport), {
            disabled: !_ctx.teleported,
            to: unref(appendTo)
          }, {
            default: withCtx(() => [
              createVNode$1(Transition, {
                name: unref(transitionClass),
                onAfterLeave: onTransitionLeave,
                onBeforeEnter,
                onAfterEnter: onAfterShow,
                onBeforeLeave
              }, {
                default: withCtx(() => [
                  unref(shouldRender) ? withDirectives((openBlock(), createBlock(unref(ElPopperContent), mergeProps({
                    key: 0,
                    id: unref(id),
                    ref_key: "contentRef",
                    ref: contentRef
                  }, _ctx.$attrs, {
                    "aria-label": _ctx.ariaLabel,
                    "aria-hidden": ariaHidden.value,
                    "boundaries-padding": _ctx.boundariesPadding,
                    "fallback-placements": _ctx.fallbackPlacements,
                    "gpu-acceleration": _ctx.gpuAcceleration,
                    offset: _ctx.offset,
                    placement: _ctx.placement,
                    "popper-options": _ctx.popperOptions,
                    "arrow-offset": _ctx.arrowOffset,
                    strategy: _ctx.strategy,
                    effect: _ctx.effect,
                    enterable: _ctx.enterable,
                    pure: _ctx.pure,
                    "popper-class": _ctx.popperClass,
                    "popper-style": [_ctx.popperStyle, unref(contentStyle)],
                    "reference-el": _ctx.referenceEl,
                    "trigger-target-el": _ctx.triggerTargetEl,
                    visible: unref(shouldShow),
                    "z-index": _ctx.zIndex,
                    onMouseenter: unref(onContentEnter),
                    onMouseleave: unref(onContentLeave),
                    onBlur,
                    onClose: unref(onClose)
                  }), {
                    default: withCtx(() => [
                      renderSlot(_ctx.$slots, "default")
                    ]),
                    _: 3
                  }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "arrow-offset", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
                    [vShow, unref(shouldShow)]
                  ]) : createCommentVNode("v-if", true)
                ]),
                _: 3
              }, 8, ["name"])
            ]),
            _: 3
          }, 8, ["disabled", "to"]);
        };
      }
    });
    var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$2r, [["__file", "content.vue"]]);
    const __default__$1J = /* @__PURE__ */ defineComponent({
      name: "ElTooltip"
    });
    const _sfc_main$2q = /* @__PURE__ */ defineComponent({
      ...__default__$1J,
      props: useTooltipProps,
      emits: tooltipEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        usePopperContainer();
        const ns = useNamespace("tooltip");
        const id = useId();
        const popperRef = ref();
        const contentRef = ref();
        const updatePopper = () => {
          var _a2;
          const popperComponent = unref(popperRef);
          if (popperComponent) {
            (_a2 = popperComponent.popperInstanceRef) == null ? void 0 : _a2.update();
          }
        };
        const open2 = ref(false);
        const toggleReason = ref();
        const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
          indicator: open2,
          toggleReason
        });
        const { onOpen, onClose } = useDelayedToggle({
          showAfter: toRef(props2, "showAfter"),
          hideAfter: toRef(props2, "hideAfter"),
          autoClose: toRef(props2, "autoClose"),
          open: show,
          close: hide
        });
        const controlled = computed(() => isBoolean$1(props2.visible) && !hasUpdateHandler.value);
        const kls = computed(() => {
          return [ns.b(), props2.popperClass];
        });
        provide(TOOLTIP_INJECTION_KEY, {
          controlled,
          id,
          open: readonly(open2),
          trigger: toRef(props2, "trigger"),
          onOpen: (event) => {
            onOpen(event);
          },
          onClose: (event) => {
            onClose(event);
          },
          onToggle: (event) => {
            if (unref(open2)) {
              onClose(event);
            } else {
              onOpen(event);
            }
          },
          onShow: () => {
            emit2("show", toggleReason.value);
          },
          onHide: () => {
            emit2("hide", toggleReason.value);
          },
          onBeforeShow: () => {
            emit2("before-show", toggleReason.value);
          },
          onBeforeHide: () => {
            emit2("before-hide", toggleReason.value);
          },
          updatePopper
        });
        watch(() => props2.disabled, (disabled) => {
          if (disabled && open2.value) {
            open2.value = false;
          }
        });
        const isFocusInsideContent = (event) => {
          var _a2;
          return (_a2 = contentRef.value) == null ? void 0 : _a2.isFocusInsideContent(event);
        };
        onDeactivated(() => open2.value && hide());
        expose({
          popperRef,
          contentRef,
          isFocusInsideContent,
          updatePopper,
          onOpen,
          onClose,
          hide
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElPopper), {
            ref_key: "popperRef",
            ref: popperRef,
            role: _ctx.role
          }, {
            default: withCtx(() => [
              createVNode$1(ElTooltipTrigger, {
                disabled: _ctx.disabled,
                trigger: _ctx.trigger,
                "trigger-keys": _ctx.triggerKeys,
                "virtual-ref": _ctx.virtualRef,
                "virtual-triggering": _ctx.virtualTriggering
              }, {
                default: withCtx(() => [
                  _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
                ]),
                _: 3
              }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
              createVNode$1(ElTooltipContent, {
                ref_key: "contentRef",
                ref: contentRef,
                "aria-label": _ctx.ariaLabel,
                "boundaries-padding": _ctx.boundariesPadding,
                content: _ctx.content,
                disabled: _ctx.disabled,
                effect: _ctx.effect,
                enterable: _ctx.enterable,
                "fallback-placements": _ctx.fallbackPlacements,
                "hide-after": _ctx.hideAfter,
                "gpu-acceleration": _ctx.gpuAcceleration,
                offset: _ctx.offset,
                persistent: _ctx.persistent,
                "popper-class": unref(kls),
                "popper-style": _ctx.popperStyle,
                placement: _ctx.placement,
                "popper-options": _ctx.popperOptions,
                "arrow-offset": _ctx.arrowOffset,
                pure: _ctx.pure,
                "raw-content": _ctx.rawContent,
                "reference-el": _ctx.referenceEl,
                "trigger-target-el": _ctx.triggerTargetEl,
                "show-after": _ctx.showAfter,
                strategy: _ctx.strategy,
                teleported: _ctx.teleported,
                transition: _ctx.transition,
                "virtual-triggering": _ctx.virtualTriggering,
                "z-index": _ctx.zIndex,
                "append-to": _ctx.appendTo
              }, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "content", {}, () => [
                    _ctx.rawContent ? (openBlock(), createElementBlock("span", {
                      key: 0,
                      innerHTML: _ctx.content
                    }, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.content), 1))
                  ]),
                  _ctx.showArrow ? (openBlock(), createBlock(unref(ElPopperArrow), { key: 0 })) : createCommentVNode("v-if", true)
                ]),
                _: 3
              }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "arrow-offset", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
            ]),
            _: 3
          }, 8, ["role"]);
        };
      }
    });
    var Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$2q, [["__file", "tooltip.vue"]]);
    const ElTooltip = withInstall(Tooltip);
    const autocompleteProps = buildProps({
      valueKey: {
        type: String,
        default: "value"
      },
      modelValue: {
        type: [String, Number],
        default: ""
      },
      debounce: {
        type: Number,
        default: 300
      },
      placement: {
        type: definePropType(String),
        values: [
          "top",
          "top-start",
          "top-end",
          "bottom",
          "bottom-start",
          "bottom-end"
        ],
        default: "bottom-start"
      },
      fetchSuggestions: {
        type: definePropType([Function, Array]),
        default: NOOP
      },
      popperClass: {
        type: String,
        default: ""
      },
      triggerOnFocus: {
        type: Boolean,
        default: true
      },
      selectWhenUnmatched: {
        type: Boolean,
        default: false
      },
      hideLoading: {
        type: Boolean,
        default: false
      },
      teleported: useTooltipContentProps.teleported,
      appendTo: useTooltipContentProps.appendTo,
      highlightFirstItem: {
        type: Boolean,
        default: false
      },
      fitInputWidth: {
        type: Boolean,
        default: false
      },
      clearable: {
        type: Boolean,
        default: false
      },
      disabled: {
        type: Boolean,
        default: false
      },
      name: String,
      ...useAriaProps(["ariaLabel"])
    });
    const autocompleteEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isString$3(value),
      [INPUT_EVENT]: (value) => isString$3(value),
      [CHANGE_EVENT]: (value) => isString$3(value),
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent,
      clear: () => true,
      select: (item) => isObject$7(item)
    };
    const COMPONENT_NAME$l = "ElAutocomplete";
    const __default__$1I = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$l,
      inheritAttrs: false
    });
    const _sfc_main$2p = /* @__PURE__ */ defineComponent({
      ...__default__$1I,
      props: autocompleteProps,
      emits: autocompleteEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const attrs = useAttrs();
        const rawAttrs = useAttrs$1();
        const disabled = useFormDisabled();
        const ns = useNamespace("autocomplete");
        const inputRef = ref();
        const regionRef = ref();
        const popperRef = ref();
        const listboxRef = ref();
        let readonly2 = false;
        let ignoreFocusEvent = false;
        const suggestions = ref([]);
        const highlightedIndex = ref(-1);
        const dropdownWidth = ref("");
        const activated = ref(false);
        const suggestionDisabled = ref(false);
        const loading = ref(false);
        const listboxId = useId();
        const styles = computed(() => rawAttrs.style);
        const suggestionVisible = computed(() => {
          const isValidData = suggestions.value.length > 0;
          return (isValidData || loading.value) && activated.value;
        });
        const suggestionLoading = computed(() => !props2.hideLoading && loading.value);
        const refInput = computed(() => {
          if (inputRef.value) {
            return Array.from(inputRef.value.$el.querySelectorAll("input"));
          }
          return [];
        });
        const onSuggestionShow = () => {
          if (suggestionVisible.value) {
            dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
          }
        };
        const onHide = () => {
          highlightedIndex.value = -1;
        };
        const getData = async (queryString) => {
          if (suggestionDisabled.value)
            return;
          const cb = (suggestionList) => {
            loading.value = false;
            if (suggestionDisabled.value)
              return;
            if (isArray$5(suggestionList)) {
              suggestions.value = suggestionList;
              highlightedIndex.value = props2.highlightFirstItem ? 0 : -1;
            } else {
              throwError$1(COMPONENT_NAME$l, "autocomplete suggestions must be an array");
            }
          };
          loading.value = true;
          if (isArray$5(props2.fetchSuggestions)) {
            cb(props2.fetchSuggestions);
          } else {
            const result = await props2.fetchSuggestions(queryString, cb);
            if (isArray$5(result))
              cb(result);
          }
        };
        const debouncedGetData = debounce(getData, props2.debounce);
        const handleInput = (value) => {
          const valuePresented = !!value;
          emit2(INPUT_EVENT, value);
          emit2(UPDATE_MODEL_EVENT, value);
          suggestionDisabled.value = false;
          activated.value || (activated.value = valuePresented);
          if (!props2.triggerOnFocus && !value) {
            suggestionDisabled.value = true;
            suggestions.value = [];
            return;
          }
          debouncedGetData(value);
        };
        const handleMouseDown = (event) => {
          var _a2;
          if (disabled.value)
            return;
          if (((_a2 = event.target) == null ? void 0 : _a2.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
            activated.value = true;
          }
        };
        const handleChange = (value) => {
          emit2(CHANGE_EVENT, value);
        };
        const handleFocus = (evt) => {
          var _a2;
          if (!ignoreFocusEvent) {
            activated.value = true;
            emit2("focus", evt);
            const queryString = (_a2 = props2.modelValue) != null ? _a2 : "";
            if (props2.triggerOnFocus && !readonly2) {
              debouncedGetData(String(queryString));
            }
          } else {
            ignoreFocusEvent = false;
          }
        };
        const handleBlur = (evt) => {
          setTimeout(() => {
            var _a2;
            if ((_a2 = popperRef.value) == null ? void 0 : _a2.isFocusInsideContent()) {
              ignoreFocusEvent = true;
              return;
            }
            activated.value && close2();
            emit2("blur", evt);
          });
        };
        const handleClear = () => {
          activated.value = false;
          emit2(UPDATE_MODEL_EVENT, "");
          emit2("clear");
        };
        const handleKeyEnter = async () => {
          if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) {
            handleSelect(suggestions.value[highlightedIndex.value]);
          } else if (props2.selectWhenUnmatched) {
            emit2("select", { value: props2.modelValue });
            suggestions.value = [];
            highlightedIndex.value = -1;
          }
        };
        const handleKeyEscape = (evt) => {
          if (suggestionVisible.value) {
            evt.preventDefault();
            evt.stopPropagation();
            close2();
          }
        };
        const close2 = () => {
          activated.value = false;
        };
        const focus = () => {
          var _a2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
        };
        const blur = () => {
          var _a2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
        };
        const handleSelect = async (item) => {
          emit2(INPUT_EVENT, item[props2.valueKey]);
          emit2(UPDATE_MODEL_EVENT, item[props2.valueKey]);
          emit2("select", item);
          suggestions.value = [];
          highlightedIndex.value = -1;
        };
        const highlight = (index) => {
          if (!suggestionVisible.value || loading.value)
            return;
          if (index < 0) {
            highlightedIndex.value = -1;
            return;
          }
          if (index >= suggestions.value.length) {
            index = suggestions.value.length - 1;
          }
          const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`);
          const suggestionList = suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`);
          const highlightItem = suggestionList[index];
          const scrollTop = suggestion.scrollTop;
          const { offsetTop, scrollHeight } = highlightItem;
          if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) {
            suggestion.scrollTop += scrollHeight;
          }
          if (offsetTop < scrollTop) {
            suggestion.scrollTop -= scrollHeight;
          }
          highlightedIndex.value = index;
          inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
        };
        const stopHandle = onClickOutside(listboxRef, () => {
          var _a2;
          if ((_a2 = popperRef.value) == null ? void 0 : _a2.isFocusInsideContent())
            return;
          suggestionVisible.value && close2();
        });
        onBeforeUnmount(() => {
          stopHandle == null ? void 0 : stopHandle();
        });
        onMounted(() => {
          inputRef.value.ref.setAttribute("role", "textbox");
          inputRef.value.ref.setAttribute("aria-autocomplete", "list");
          inputRef.value.ref.setAttribute("aria-controls", "id");
          inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
          readonly2 = inputRef.value.ref.hasAttribute("readonly");
        });
        expose({
          highlightedIndex,
          activated,
          loading,
          inputRef,
          popperRef,
          suggestions,
          handleSelect,
          handleKeyEnter,
          focus,
          blur,
          close: close2,
          highlight,
          getData
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), {
            ref_key: "popperRef",
            ref: popperRef,
            visible: unref(suggestionVisible),
            placement: _ctx.placement,
            "fallback-placements": ["bottom-start", "top-start"],
            "popper-class": [unref(ns).e("popper"), _ctx.popperClass],
            teleported: _ctx.teleported,
            "append-to": _ctx.appendTo,
            "gpu-acceleration": false,
            pure: "",
            "manual-mode": "",
            effect: "light",
            trigger: "click",
            transition: `${unref(ns).namespace.value}-zoom-in-top`,
            persistent: "",
            role: "listbox",
            onBeforeShow: onSuggestionShow,
            onHide
          }, {
            content: withCtx(() => [
              createBaseVNode("div", {
                ref_key: "regionRef",
                ref: regionRef,
                class: normalizeClass([unref(ns).b("suggestion"), unref(ns).is("loading", unref(suggestionLoading))]),
                style: normalizeStyle$1({
                  [_ctx.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
                  outline: "none"
                }),
                role: "region"
              }, [
                createVNode$1(unref(ElScrollbar), {
                  id: unref(listboxId),
                  tag: "ul",
                  "wrap-class": unref(ns).be("suggestion", "wrap"),
                  "view-class": unref(ns).be("suggestion", "list"),
                  role: "listbox"
                }, {
                  default: withCtx(() => [
                    unref(suggestionLoading) ? (openBlock(), createElementBlock("li", { key: 0 }, [
                      renderSlot(_ctx.$slots, "loading", {}, () => [
                        createVNode$1(unref(ElIcon), {
                          class: normalizeClass(unref(ns).is("loading"))
                        }, {
                          default: withCtx(() => [
                            createVNode$1(unref(loading_default))
                          ]),
                          _: 1
                        }, 8, ["class"])
                      ])
                    ])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(suggestions.value, (item, index) => {
                      return openBlock(), createElementBlock("li", {
                        id: `${unref(listboxId)}-item-${index}`,
                        key: index,
                        class: normalizeClass({ highlighted: highlightedIndex.value === index }),
                        role: "option",
                        "aria-selected": highlightedIndex.value === index,
                        onClick: ($event) => handleSelect(item)
                      }, [
                        renderSlot(_ctx.$slots, "default", { item }, () => [
                          createTextVNode(toDisplayString(item[_ctx.valueKey]), 1)
                        ])
                      ], 10, ["id", "aria-selected", "onClick"]);
                    }), 128))
                  ]),
                  _: 3
                }, 8, ["id", "wrap-class", "view-class"])
              ], 6)
            ]),
            default: withCtx(() => [
              createBaseVNode("div", {
                ref_key: "listboxRef",
                ref: listboxRef,
                class: normalizeClass([unref(ns).b(), _ctx.$attrs.class]),
                style: normalizeStyle$1(unref(styles)),
                role: "combobox",
                "aria-haspopup": "listbox",
                "aria-expanded": unref(suggestionVisible),
                "aria-owns": unref(listboxId)
              }, [
                createVNode$1(unref(ElInput), mergeProps({
                  ref_key: "inputRef",
                  ref: inputRef
                }, unref(attrs), {
                  clearable: _ctx.clearable,
                  disabled: unref(disabled),
                  name: _ctx.name,
                  "model-value": _ctx.modelValue,
                  "aria-label": _ctx.ariaLabel,
                  onInput: handleInput,
                  onChange: handleChange,
                  onFocus: handleFocus,
                  onBlur: handleBlur,
                  onClear: handleClear,
                  onKeydown: [
                    withKeys(withModifiers(($event) => highlight(highlightedIndex.value - 1), ["prevent"]), ["up"]),
                    withKeys(withModifiers(($event) => highlight(highlightedIndex.value + 1), ["prevent"]), ["down"]),
                    withKeys(handleKeyEnter, ["enter"]),
                    withKeys(close2, ["tab"]),
                    withKeys(handleKeyEscape, ["esc"])
                  ],
                  onMousedown: handleMouseDown
                }), createSlots({
                  _: 2
                }, [
                  _ctx.$slots.prepend ? {
                    name: "prepend",
                    fn: withCtx(() => [
                      renderSlot(_ctx.$slots, "prepend")
                    ])
                  } : void 0,
                  _ctx.$slots.append ? {
                    name: "append",
                    fn: withCtx(() => [
                      renderSlot(_ctx.$slots, "append")
                    ])
                  } : void 0,
                  _ctx.$slots.prefix ? {
                    name: "prefix",
                    fn: withCtx(() => [
                      renderSlot(_ctx.$slots, "prefix")
                    ])
                  } : void 0,
                  _ctx.$slots.suffix ? {
                    name: "suffix",
                    fn: withCtx(() => [
                      renderSlot(_ctx.$slots, "suffix")
                    ])
                  } : void 0
                ]), 1040, ["clearable", "disabled", "name", "model-value", "aria-label", "onKeydown"])
              ], 14, ["aria-expanded", "aria-owns"])
            ]),
            _: 3
          }, 8, ["visible", "placement", "popper-class", "teleported", "append-to", "transition"]);
        };
      }
    });
    var Autocomplete = /* @__PURE__ */ _export_sfc(_sfc_main$2p, [["__file", "autocomplete.vue"]]);
    const ElAutocomplete = withInstall(Autocomplete);
    const avatarProps = buildProps({
      size: {
        type: [Number, String],
        values: componentSizes,
        default: "",
        validator: (val) => isNumber$2(val)
      },
      shape: {
        type: String,
        values: ["circle", "square"],
        default: "circle"
      },
      icon: {
        type: iconPropType
      },
      src: {
        type: String,
        default: ""
      },
      alt: String,
      srcSet: String,
      fit: {
        type: definePropType(String),
        default: "cover"
      }
    });
    const avatarEmits = {
      error: (evt) => evt instanceof Event
    };
    const __default__$1H = /* @__PURE__ */ defineComponent({
      name: "ElAvatar"
    });
    const _sfc_main$2o = /* @__PURE__ */ defineComponent({
      ...__default__$1H,
      props: avatarProps,
      emits: avatarEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("avatar");
        const hasLoadError = ref(false);
        const avatarClass = computed(() => {
          const { size, icon, shape } = props2;
          const classList = [ns.b()];
          if (isString$3(size))
            classList.push(ns.m(size));
          if (icon)
            classList.push(ns.m("icon"));
          if (shape)
            classList.push(ns.m(shape));
          return classList;
        });
        const sizeStyle = computed(() => {
          const { size } = props2;
          return isNumber$2(size) ? ns.cssVarBlock({
            size: addUnit(size) || ""
          }) : void 0;
        });
        const fitStyle = computed(() => ({
          objectFit: props2.fit
        }));
        watch(() => props2.src, () => hasLoadError.value = false);
        function handleError2(e2) {
          hasLoadError.value = true;
          emit2("error", e2);
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(avatarClass)),
            style: normalizeStyle$1(unref(sizeStyle))
          }, [
            (_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (openBlock(), createElementBlock("img", {
              key: 0,
              src: _ctx.src,
              alt: _ctx.alt,
              srcset: _ctx.srcSet,
              style: normalizeStyle$1(unref(fitStyle)),
              onError: handleError2
            }, null, 44, ["src", "alt", "srcset"])) : _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
              ]),
              _: 1
            })) : renderSlot(_ctx.$slots, "default", { key: 2 })
          ], 6);
        };
      }
    });
    var Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$2o, [["__file", "avatar.vue"]]);
    const ElAvatar = withInstall(Avatar);
    const backtopProps = {
      visibilityHeight: {
        type: Number,
        default: 200
      },
      target: {
        type: String,
        default: ""
      },
      right: {
        type: Number,
        default: 40
      },
      bottom: {
        type: Number,
        default: 40
      }
    };
    const backtopEmits = {
      click: (evt) => evt instanceof MouseEvent
    };
    const useBackTop = (props2, emit2, componentName2) => {
      const el = shallowRef();
      const container = shallowRef();
      const visible = ref(false);
      const handleScroll2 = () => {
        if (el.value)
          visible.value = el.value.scrollTop >= props2.visibilityHeight;
      };
      const handleClick = (event) => {
        var _a2;
        (_a2 = el.value) == null ? void 0 : _a2.scrollTo({ top: 0, behavior: "smooth" });
        emit2("click", event);
      };
      const handleScrollThrottled = useThrottleFn(handleScroll2, 300, true);
      useEventListener(container, "scroll", handleScrollThrottled);
      onMounted(() => {
        var _a2;
        container.value = document;
        el.value = document.documentElement;
        if (props2.target) {
          el.value = (_a2 = document.querySelector(props2.target)) != null ? _a2 : void 0;
          if (!el.value) {
            throwError$1(componentName2, `target does not exist: ${props2.target}`);
          }
          container.value = el.value;
        }
        handleScroll2();
      });
      return {
        visible,
        handleClick
      };
    };
    const COMPONENT_NAME$k = "ElBacktop";
    const __default__$1G = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$k
    });
    const _sfc_main$2n = /* @__PURE__ */ defineComponent({
      ...__default__$1G,
      props: backtopProps,
      emits: backtopEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("backtop");
        const { handleClick, visible } = useBackTop(props2, emit2, COMPONENT_NAME$k);
        const backTopStyle = computed(() => ({
          right: `${props2.right}px`,
          bottom: `${props2.bottom}px`
        }));
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, {
            name: `${unref(ns).namespace.value}-fade-in`
          }, {
            default: withCtx(() => [
              unref(visible) ? (openBlock(), createElementBlock("div", {
                key: 0,
                style: normalizeStyle$1(unref(backTopStyle)),
                class: normalizeClass(unref(ns).b()),
                onClick: withModifiers(unref(handleClick), ["stop"])
              }, [
                renderSlot(_ctx.$slots, "default", {}, () => [
                  createVNode$1(unref(ElIcon), {
                    class: normalizeClass(unref(ns).e("icon"))
                  }, {
                    default: withCtx(() => [
                      createVNode$1(unref(caret_top_default))
                    ]),
                    _: 1
                  }, 8, ["class"])
                ])
              ], 14, ["onClick"])) : createCommentVNode("v-if", true)
            ]),
            _: 3
          }, 8, ["name"]);
        };
      }
    });
    var Backtop = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["__file", "backtop.vue"]]);
    const ElBacktop = withInstall(Backtop);
    const badgeProps = buildProps({
      value: {
        type: [String, Number],
        default: ""
      },
      max: {
        type: Number,
        default: 99
      },
      isDot: Boolean,
      hidden: Boolean,
      type: {
        type: String,
        values: ["primary", "success", "warning", "info", "danger"],
        default: "danger"
      },
      showZero: {
        type: Boolean,
        default: true
      },
      color: String,
      badgeStyle: {
        type: definePropType([String, Object, Array])
      },
      offset: {
        type: definePropType(Array),
        default: [0, 0]
      },
      badgeClass: {
        type: String
      }
    });
    const __default__$1F = /* @__PURE__ */ defineComponent({
      name: "ElBadge"
    });
    const _sfc_main$2m = /* @__PURE__ */ defineComponent({
      ...__default__$1F,
      props: badgeProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const ns = useNamespace("badge");
        const content2 = computed(() => {
          if (props2.isDot)
            return "";
          if (isNumber$2(props2.value) && isNumber$2(props2.max)) {
            return props2.max < props2.value ? `${props2.max}+` : `${props2.value}`;
          }
          return `${props2.value}`;
        });
        const style = computed(() => {
          var _a2, _b2, _c2, _d, _e;
          return [
            {
              backgroundColor: props2.color,
              marginRight: addUnit(-((_b2 = (_a2 = props2.offset) == null ? void 0 : _a2[0]) != null ? _b2 : 0)),
              marginTop: addUnit((_d = (_c2 = props2.offset) == null ? void 0 : _c2[1]) != null ? _d : 0)
            },
            (_e = props2.badgeStyle) != null ? _e : {}
          ];
        });
        expose({
          content: content2
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            renderSlot(_ctx.$slots, "default"),
            createVNode$1(Transition, {
              name: `${unref(ns).namespace.value}-zoom-in-center`,
              persisted: ""
            }, {
              default: withCtx(() => [
                withDirectives(createBaseVNode("sup", {
                  class: normalizeClass([
                    unref(ns).e("content"),
                    unref(ns).em("content", _ctx.type),
                    unref(ns).is("fixed", !!_ctx.$slots.default),
                    unref(ns).is("dot", _ctx.isDot),
                    unref(ns).is("hide-zero", !_ctx.showZero && props2.value === 0),
                    _ctx.badgeClass
                  ]),
                  style: normalizeStyle$1(unref(style))
                }, [
                  renderSlot(_ctx.$slots, "content", { value: unref(content2) }, () => [
                    createTextVNode(toDisplayString(unref(content2)), 1)
                  ])
                ], 6), [
                  [vShow, !_ctx.hidden && (unref(content2) || _ctx.isDot || _ctx.$slots.content)]
                ])
              ]),
              _: 3
            }, 8, ["name"])
          ], 2);
        };
      }
    });
    var Badge = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__file", "badge.vue"]]);
    const ElBadge = withInstall(Badge);
    const breadcrumbKey = Symbol("breadcrumbKey");
    const breadcrumbProps = buildProps({
      separator: {
        type: String,
        default: "/"
      },
      separatorIcon: {
        type: iconPropType
      }
    });
    const __default__$1E = /* @__PURE__ */ defineComponent({
      name: "ElBreadcrumb"
    });
    const _sfc_main$2l = /* @__PURE__ */ defineComponent({
      ...__default__$1E,
      props: breadcrumbProps,
      setup(__props) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("breadcrumb");
        const breadcrumb = ref();
        provide(breadcrumbKey, props2);
        onMounted(() => {
          const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
          if (items.length) {
            items[items.length - 1].setAttribute("aria-current", "page");
          }
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "breadcrumb",
            ref: breadcrumb,
            class: normalizeClass(unref(ns).b()),
            "aria-label": unref(t)("el.breadcrumb.label"),
            role: "navigation"
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 10, ["aria-label"]);
        };
      }
    });
    var Breadcrumb$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__file", "breadcrumb.vue"]]);
    const breadcrumbItemProps = buildProps({
      to: {
        type: definePropType([String, Object]),
        default: ""
      },
      replace: Boolean
    });
    const __default__$1D = /* @__PURE__ */ defineComponent({
      name: "ElBreadcrumbItem"
    });
    const _sfc_main$2k = /* @__PURE__ */ defineComponent({
      ...__default__$1D,
      props: breadcrumbItemProps,
      setup(__props) {
        const props2 = __props;
        const instance = getCurrentInstance();
        const breadcrumbContext = inject(breadcrumbKey, void 0);
        const ns = useNamespace("breadcrumb");
        const router2 = instance.appContext.config.globalProperties.$router;
        const link = ref();
        const onClick = () => {
          if (!props2.to || !router2)
            return;
          props2.replace ? router2.replace(props2.to) : router2.push(props2.to);
        };
        return (_ctx, _cache) => {
          var _a2, _b2;
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(ns).e("item"))
          }, [
            createBaseVNode("span", {
              ref_key: "link",
              ref: link,
              class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!_ctx.to)]),
              role: "link",
              onClick
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2),
            ((_a2 = unref(breadcrumbContext)) == null ? void 0 : _a2.separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), {
              key: 0,
              class: normalizeClass(unref(ns).e("separator"))
            }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(unref(breadcrumbContext).separatorIcon)))
              ]),
              _: 1
            }, 8, ["class"])) : (openBlock(), createElementBlock("span", {
              key: 1,
              class: normalizeClass(unref(ns).e("separator")),
              role: "presentation"
            }, toDisplayString((_b2 = unref(breadcrumbContext)) == null ? void 0 : _b2.separator), 3))
          ], 2);
        };
      }
    });
    var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__file", "breadcrumb-item.vue"]]);
    const ElBreadcrumb = withInstall(Breadcrumb$1, {
      BreadcrumbItem
    });
    const ElBreadcrumbItem = withNoopInstall(BreadcrumbItem);
    const buttonGroupContextKey = Symbol("buttonGroupContextKey");
    const useDeprecated = ({ from, replacement, scope, version: version2, ref: ref2, type = "API" }, condition) => {
      watch(() => unref(condition), (val) => {
      }, {
        immediate: true
      });
    };
    const useButton = (props2, emit2) => {
      useDeprecated({
        from: "type.text",
        replacement: "link",
        version: "3.0.0",
        scope: "props",
        ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
      }, computed(() => props2.type === "text"));
      const buttonGroupContext = inject(buttonGroupContextKey, void 0);
      const globalConfig2 = useGlobalConfig("button");
      const { form } = useFormItem();
      const _size = useFormSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
      const _disabled = useFormDisabled();
      const _ref = ref();
      const slots = useSlots();
      const _type = computed(() => props2.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
      const autoInsertSpace = computed(() => {
        var _a2, _b2, _c2;
        return (_c2 = (_b2 = props2.autoInsertSpace) != null ? _b2 : (_a2 = globalConfig2.value) == null ? void 0 : _a2.autoInsertSpace) != null ? _c2 : false;
      });
      const _props = computed(() => {
        if (props2.tag === "button") {
          return {
            ariaDisabled: _disabled.value || props2.loading,
            disabled: _disabled.value || props2.loading,
            autofocus: props2.autofocus,
            type: props2.nativeType
          };
        }
        return {};
      });
      const shouldAddSpace = computed(() => {
        var _a2;
        const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
        if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
          const slot = defaultSlot[0];
          if ((slot == null ? void 0 : slot.type) === Text$1) {
            const text = slot.children;
            return new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(text.trim());
          }
        }
        return false;
      });
      const handleClick = (evt) => {
        if (_disabled.value || props2.loading) {
          evt.stopPropagation();
          return;
        }
        if (props2.nativeType === "reset") {
          form == null ? void 0 : form.resetFields();
        }
        emit2("click", evt);
      };
      return {
        _disabled,
        _size,
        _type,
        _ref,
        _props,
        shouldAddSpace,
        handleClick
      };
    };
    const buttonTypes = [
      "default",
      "primary",
      "success",
      "warning",
      "info",
      "danger",
      "text",
      ""
    ];
    const buttonNativeTypes = ["button", "submit", "reset"];
    const buttonProps = buildProps({
      size: useSizeProp,
      disabled: Boolean,
      type: {
        type: String,
        values: buttonTypes,
        default: ""
      },
      icon: {
        type: iconPropType
      },
      nativeType: {
        type: String,
        values: buttonNativeTypes,
        default: "button"
      },
      loading: Boolean,
      loadingIcon: {
        type: iconPropType,
        default: () => loading_default
      },
      plain: Boolean,
      text: Boolean,
      link: Boolean,
      bg: Boolean,
      autofocus: Boolean,
      round: Boolean,
      circle: Boolean,
      color: String,
      dark: Boolean,
      autoInsertSpace: {
        type: Boolean,
        default: void 0
      },
      tag: {
        type: definePropType([String, Object]),
        default: "button"
      }
    });
    const buttonEmits = {
      click: (evt) => evt instanceof MouseEvent
    };
    function bound01$1(n, max3) {
      if (isOnePointZero$1(n)) {
        n = "100%";
      }
      var isPercent = isPercentage$1(n);
      n = max3 === 360 ? n : Math.min(max3, Math.max(0, parseFloat(n)));
      if (isPercent) {
        n = parseInt(String(n * max3), 10) / 100;
      }
      if (Math.abs(n - max3) < 1e-6) {
        return 1;
      }
      if (max3 === 360) {
        n = (n < 0 ? n % max3 + max3 : n % max3) / parseFloat(String(max3));
      } else {
        n = n % max3 / parseFloat(String(max3));
      }
      return n;
    }
    function clamp01(val) {
      return Math.min(1, Math.max(0, val));
    }
    function isOnePointZero$1(n) {
      return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
    }
    function isPercentage$1(n) {
      return typeof n === "string" && n.indexOf("%") !== -1;
    }
    function boundAlpha(a2) {
      a2 = parseFloat(a2);
      if (isNaN(a2) || a2 < 0 || a2 > 1) {
        a2 = 1;
      }
      return a2;
    }
    function convertToPercentage(n) {
      if (n <= 1) {
        return "".concat(Number(n) * 100, "%");
      }
      return n;
    }
    function pad2(c2) {
      return c2.length === 1 ? "0" + c2 : String(c2);
    }
    function rgbToRgb(r, g, b2) {
      return {
        r: bound01$1(r, 255) * 255,
        g: bound01$1(g, 255) * 255,
        b: bound01$1(b2, 255) * 255
      };
    }
    function rgbToHsl(r, g, b2) {
      r = bound01$1(r, 255);
      g = bound01$1(g, 255);
      b2 = bound01$1(b2, 255);
      var max3 = Math.max(r, g, b2);
      var min3 = Math.min(r, g, b2);
      var h2 = 0;
      var s2 = 0;
      var l2 = (max3 + min3) / 2;
      if (max3 === min3) {
        s2 = 0;
        h2 = 0;
      } else {
        var d2 = max3 - min3;
        s2 = l2 > 0.5 ? d2 / (2 - max3 - min3) : d2 / (max3 + min3);
        switch (max3) {
          case r:
            h2 = (g - b2) / d2 + (g < b2 ? 6 : 0);
            break;
          case g:
            h2 = (b2 - r) / d2 + 2;
            break;
          case b2:
            h2 = (r - g) / d2 + 4;
            break;
        }
        h2 /= 6;
      }
      return { h: h2, s: s2, l: l2 };
    }
    function hue2rgb$1(p2, q2, t) {
      if (t < 0) {
        t += 1;
      }
      if (t > 1) {
        t -= 1;
      }
      if (t < 1 / 6) {
        return p2 + (q2 - p2) * (6 * t);
      }
      if (t < 1 / 2) {
        return q2;
      }
      if (t < 2 / 3) {
        return p2 + (q2 - p2) * (2 / 3 - t) * 6;
      }
      return p2;
    }
    function hslToRgb(h2, s2, l2) {
      var r;
      var g;
      var b2;
      h2 = bound01$1(h2, 360);
      s2 = bound01$1(s2, 100);
      l2 = bound01$1(l2, 100);
      if (s2 === 0) {
        g = l2;
        b2 = l2;
        r = l2;
      } else {
        var q2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
        var p2 = 2 * l2 - q2;
        r = hue2rgb$1(p2, q2, h2 + 1 / 3);
        g = hue2rgb$1(p2, q2, h2);
        b2 = hue2rgb$1(p2, q2, h2 - 1 / 3);
      }
      return { r: r * 255, g: g * 255, b: b2 * 255 };
    }
    function rgbToHsv(r, g, b2) {
      r = bound01$1(r, 255);
      g = bound01$1(g, 255);
      b2 = bound01$1(b2, 255);
      var max3 = Math.max(r, g, b2);
      var min3 = Math.min(r, g, b2);
      var h2 = 0;
      var v4 = max3;
      var d2 = max3 - min3;
      var s2 = max3 === 0 ? 0 : d2 / max3;
      if (max3 === min3) {
        h2 = 0;
      } else {
        switch (max3) {
          case r:
            h2 = (g - b2) / d2 + (g < b2 ? 6 : 0);
            break;
          case g:
            h2 = (b2 - r) / d2 + 2;
            break;
          case b2:
            h2 = (r - g) / d2 + 4;
            break;
        }
        h2 /= 6;
      }
      return { h: h2, s: s2, v: v4 };
    }
    function hsvToRgb(h2, s2, v4) {
      h2 = bound01$1(h2, 360) * 6;
      s2 = bound01$1(s2, 100);
      v4 = bound01$1(v4, 100);
      var i2 = Math.floor(h2);
      var f2 = h2 - i2;
      var p2 = v4 * (1 - s2);
      var q2 = v4 * (1 - f2 * s2);
      var t = v4 * (1 - (1 - f2) * s2);
      var mod = i2 % 6;
      var r = [v4, q2, p2, p2, t, v4][mod];
      var g = [t, v4, v4, q2, p2, p2][mod];
      var b2 = [p2, p2, t, v4, v4, q2][mod];
      return { r: r * 255, g: g * 255, b: b2 * 255 };
    }
    function rgbToHex(r, g, b2, allow3Char) {
      var hex = [
        pad2(Math.round(r).toString(16)),
        pad2(Math.round(g).toString(16)),
        pad2(Math.round(b2).toString(16))
      ];
      if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
        return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
      }
      return hex.join("");
    }
    function rgbaToHex(r, g, b2, a2, allow4Char) {
      var hex = [
        pad2(Math.round(r).toString(16)),
        pad2(Math.round(g).toString(16)),
        pad2(Math.round(b2).toString(16)),
        pad2(convertDecimalToHex(a2))
      ];
      if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
        return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
      }
      return hex.join("");
    }
    function convertDecimalToHex(d2) {
      return Math.round(parseFloat(d2) * 255).toString(16);
    }
    function convertHexToDecimal(h2) {
      return parseIntFromHex(h2) / 255;
    }
    function parseIntFromHex(val) {
      return parseInt(val, 16);
    }
    function numberInputToObject(color2) {
      return {
        r: color2 >> 16,
        g: (color2 & 65280) >> 8,
        b: color2 & 255
      };
    }
    var names = {
      aliceblue: "#f0f8ff",
      antiquewhite: "#faebd7",
      aqua: "#00ffff",
      aquamarine: "#7fffd4",
      azure: "#f0ffff",
      beige: "#f5f5dc",
      bisque: "#ffe4c4",
      black: "#000000",
      blanchedalmond: "#ffebcd",
      blue: "#0000ff",
      blueviolet: "#8a2be2",
      brown: "#a52a2a",
      burlywood: "#deb887",
      cadetblue: "#5f9ea0",
      chartreuse: "#7fff00",
      chocolate: "#d2691e",
      coral: "#ff7f50",
      cornflowerblue: "#6495ed",
      cornsilk: "#fff8dc",
      crimson: "#dc143c",
      cyan: "#00ffff",
      darkblue: "#00008b",
      darkcyan: "#008b8b",
      darkgoldenrod: "#b8860b",
      darkgray: "#a9a9a9",
      darkgreen: "#006400",
      darkgrey: "#a9a9a9",
      darkkhaki: "#bdb76b",
      darkmagenta: "#8b008b",
      darkolivegreen: "#556b2f",
      darkorange: "#ff8c00",
      darkorchid: "#9932cc",
      darkred: "#8b0000",
      darksalmon: "#e9967a",
      darkseagreen: "#8fbc8f",
      darkslateblue: "#483d8b",
      darkslategray: "#2f4f4f",
      darkslategrey: "#2f4f4f",
      darkturquoise: "#00ced1",
      darkviolet: "#9400d3",
      deeppink: "#ff1493",
      deepskyblue: "#00bfff",
      dimgray: "#696969",
      dimgrey: "#696969",
      dodgerblue: "#1e90ff",
      firebrick: "#b22222",
      floralwhite: "#fffaf0",
      forestgreen: "#228b22",
      fuchsia: "#ff00ff",
      gainsboro: "#dcdcdc",
      ghostwhite: "#f8f8ff",
      goldenrod: "#daa520",
      gold: "#ffd700",
      gray: "#808080",
      green: "#008000",
      greenyellow: "#adff2f",
      grey: "#808080",
      honeydew: "#f0fff0",
      hotpink: "#ff69b4",
      indianred: "#cd5c5c",
      indigo: "#4b0082",
      ivory: "#fffff0",
      khaki: "#f0e68c",
      lavenderblush: "#fff0f5",
      lavender: "#e6e6fa",
      lawngreen: "#7cfc00",
      lemonchiffon: "#fffacd",
      lightblue: "#add8e6",
      lightcoral: "#f08080",
      lightcyan: "#e0ffff",
      lightgoldenrodyellow: "#fafad2",
      lightgray: "#d3d3d3",
      lightgreen: "#90ee90",
      lightgrey: "#d3d3d3",
      lightpink: "#ffb6c1",
      lightsalmon: "#ffa07a",
      lightseagreen: "#20b2aa",
      lightskyblue: "#87cefa",
      lightslategray: "#778899",
      lightslategrey: "#778899",
      lightsteelblue: "#b0c4de",
      lightyellow: "#ffffe0",
      lime: "#00ff00",
      limegreen: "#32cd32",
      linen: "#faf0e6",
      magenta: "#ff00ff",
      maroon: "#800000",
      mediumaquamarine: "#66cdaa",
      mediumblue: "#0000cd",
      mediumorchid: "#ba55d3",
      mediumpurple: "#9370db",
      mediumseagreen: "#3cb371",
      mediumslateblue: "#7b68ee",
      mediumspringgreen: "#00fa9a",
      mediumturquoise: "#48d1cc",
      mediumvioletred: "#c71585",
      midnightblue: "#191970",
      mintcream: "#f5fffa",
      mistyrose: "#ffe4e1",
      moccasin: "#ffe4b5",
      navajowhite: "#ffdead",
      navy: "#000080",
      oldlace: "#fdf5e6",
      olive: "#808000",
      olivedrab: "#6b8e23",
      orange: "#ffa500",
      orangered: "#ff4500",
      orchid: "#da70d6",
      palegoldenrod: "#eee8aa",
      palegreen: "#98fb98",
      paleturquoise: "#afeeee",
      palevioletred: "#db7093",
      papayawhip: "#ffefd5",
      peachpuff: "#ffdab9",
      peru: "#cd853f",
      pink: "#ffc0cb",
      plum: "#dda0dd",
      powderblue: "#b0e0e6",
      purple: "#800080",
      rebeccapurple: "#663399",
      red: "#ff0000",
      rosybrown: "#bc8f8f",
      royalblue: "#4169e1",
      saddlebrown: "#8b4513",
      salmon: "#fa8072",
      sandybrown: "#f4a460",
      seagreen: "#2e8b57",
      seashell: "#fff5ee",
      sienna: "#a0522d",
      silver: "#c0c0c0",
      skyblue: "#87ceeb",
      slateblue: "#6a5acd",
      slategray: "#708090",
      slategrey: "#708090",
      snow: "#fffafa",
      springgreen: "#00ff7f",
      steelblue: "#4682b4",
      tan: "#d2b48c",
      teal: "#008080",
      thistle: "#d8bfd8",
      tomato: "#ff6347",
      turquoise: "#40e0d0",
      violet: "#ee82ee",
      wheat: "#f5deb3",
      white: "#ffffff",
      whitesmoke: "#f5f5f5",
      yellow: "#ffff00",
      yellowgreen: "#9acd32"
    };
    function inputToRGB(color2) {
      var rgb2 = { r: 0, g: 0, b: 0 };
      var a2 = 1;
      var s2 = null;
      var v4 = null;
      var l2 = null;
      var ok = false;
      var format2 = false;
      if (typeof color2 === "string") {
        color2 = stringInputToObject(color2);
      }
      if (typeof color2 === "object") {
        if (isValidCSSUnit(color2.r) && isValidCSSUnit(color2.g) && isValidCSSUnit(color2.b)) {
          rgb2 = rgbToRgb(color2.r, color2.g, color2.b);
          ok = true;
          format2 = String(color2.r).substr(-1) === "%" ? "prgb" : "rgb";
        } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.v)) {
          s2 = convertToPercentage(color2.s);
          v4 = convertToPercentage(color2.v);
          rgb2 = hsvToRgb(color2.h, s2, v4);
          ok = true;
          format2 = "hsv";
        } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.l)) {
          s2 = convertToPercentage(color2.s);
          l2 = convertToPercentage(color2.l);
          rgb2 = hslToRgb(color2.h, s2, l2);
          ok = true;
          format2 = "hsl";
        }
        if (Object.prototype.hasOwnProperty.call(color2, "a")) {
          a2 = color2.a;
        }
      }
      a2 = boundAlpha(a2);
      return {
        ok,
        format: color2.format || format2,
        r: Math.min(255, Math.max(rgb2.r, 0)),
        g: Math.min(255, Math.max(rgb2.g, 0)),
        b: Math.min(255, Math.max(rgb2.b, 0)),
        a: a2
      };
    }
    var CSS_INTEGER = "[-\\+]?\\d+%?";
    var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
    var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
    var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
    var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
    var matchers = {
      CSS_UNIT: new RegExp(CSS_UNIT),
      rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
      rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
      hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
      hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
      hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
      hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
      hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
      hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
      hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
      hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
    };
    function stringInputToObject(color2) {
      color2 = color2.trim().toLowerCase();
      if (color2.length === 0) {
        return false;
      }
      var named = false;
      if (names[color2]) {
        color2 = names[color2];
        named = true;
      } else if (color2 === "transparent") {
        return { r: 0, g: 0, b: 0, a: 0, format: "name" };
      }
      var match = matchers.rgb.exec(color2);
      if (match) {
        return { r: match[1], g: match[2], b: match[3] };
      }
      match = matchers.rgba.exec(color2);
      if (match) {
        return { r: match[1], g: match[2], b: match[3], a: match[4] };
      }
      match = matchers.hsl.exec(color2);
      if (match) {
        return { h: match[1], s: match[2], l: match[3] };
      }
      match = matchers.hsla.exec(color2);
      if (match) {
        return { h: match[1], s: match[2], l: match[3], a: match[4] };
      }
      match = matchers.hsv.exec(color2);
      if (match) {
        return { h: match[1], s: match[2], v: match[3] };
      }
      match = matchers.hsva.exec(color2);
      if (match) {
        return { h: match[1], s: match[2], v: match[3], a: match[4] };
      }
      match = matchers.hex8.exec(color2);
      if (match) {
        return {
          r: parseIntFromHex(match[1]),
          g: parseIntFromHex(match[2]),
          b: parseIntFromHex(match[3]),
          a: convertHexToDecimal(match[4]),
          format: named ? "name" : "hex8"
        };
      }
      match = matchers.hex6.exec(color2);
      if (match) {
        return {
          r: parseIntFromHex(match[1]),
          g: parseIntFromHex(match[2]),
          b: parseIntFromHex(match[3]),
          format: named ? "name" : "hex"
        };
      }
      match = matchers.hex4.exec(color2);
      if (match) {
        return {
          r: parseIntFromHex(match[1] + match[1]),
          g: parseIntFromHex(match[2] + match[2]),
          b: parseIntFromHex(match[3] + match[3]),
          a: convertHexToDecimal(match[4] + match[4]),
          format: named ? "name" : "hex8"
        };
      }
      match = matchers.hex3.exec(color2);
      if (match) {
        return {
          r: parseIntFromHex(match[1] + match[1]),
          g: parseIntFromHex(match[2] + match[2]),
          b: parseIntFromHex(match[3] + match[3]),
          format: named ? "name" : "hex"
        };
      }
      return false;
    }
    function isValidCSSUnit(color2) {
      return Boolean(matchers.CSS_UNIT.exec(String(color2)));
    }
    var TinyColor = (
      /** @class */
      function() {
        function TinyColor2(color2, opts) {
          if (color2 === void 0) {
            color2 = "";
          }
          if (opts === void 0) {
            opts = {};
          }
          var _a2;
          if (color2 instanceof TinyColor2) {
            return color2;
          }
          if (typeof color2 === "number") {
            color2 = numberInputToObject(color2);
          }
          this.originalInput = color2;
          var rgb2 = inputToRGB(color2);
          this.originalInput = color2;
          this.r = rgb2.r;
          this.g = rgb2.g;
          this.b = rgb2.b;
          this.a = rgb2.a;
          this.roundA = Math.round(100 * this.a) / 100;
          this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb2.format;
          this.gradientType = opts.gradientType;
          if (this.r < 1) {
            this.r = Math.round(this.r);
          }
          if (this.g < 1) {
            this.g = Math.round(this.g);
          }
          if (this.b < 1) {
            this.b = Math.round(this.b);
          }
          this.isValid = rgb2.ok;
        }
        TinyColor2.prototype.isDark = function() {
          return this.getBrightness() < 128;
        };
        TinyColor2.prototype.isLight = function() {
          return !this.isDark();
        };
        TinyColor2.prototype.getBrightness = function() {
          var rgb2 = this.toRgb();
          return (rgb2.r * 299 + rgb2.g * 587 + rgb2.b * 114) / 1e3;
        };
        TinyColor2.prototype.getLuminance = function() {
          var rgb2 = this.toRgb();
          var R2;
          var G2;
          var B3;
          var RsRGB = rgb2.r / 255;
          var GsRGB = rgb2.g / 255;
          var BsRGB = rgb2.b / 255;
          if (RsRGB <= 0.03928) {
            R2 = RsRGB / 12.92;
          } else {
            R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
          }
          if (GsRGB <= 0.03928) {
            G2 = GsRGB / 12.92;
          } else {
            G2 = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
          }
          if (BsRGB <= 0.03928) {
            B3 = BsRGB / 12.92;
          } else {
            B3 = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
          }
          return 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B3;
        };
        TinyColor2.prototype.getAlpha = function() {
          return this.a;
        };
        TinyColor2.prototype.setAlpha = function(alpha) {
          this.a = boundAlpha(alpha);
          this.roundA = Math.round(100 * this.a) / 100;
          return this;
        };
        TinyColor2.prototype.isMonochrome = function() {
          var s2 = this.toHsl().s;
          return s2 === 0;
        };
        TinyColor2.prototype.toHsv = function() {
          var hsv = rgbToHsv(this.r, this.g, this.b);
          return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
        };
        TinyColor2.prototype.toHsvString = function() {
          var hsv = rgbToHsv(this.r, this.g, this.b);
          var h2 = Math.round(hsv.h * 360);
          var s2 = Math.round(hsv.s * 100);
          var v4 = Math.round(hsv.v * 100);
          return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s2, "%, ").concat(v4, "%)") : "hsva(".concat(h2, ", ").concat(s2, "%, ").concat(v4, "%, ").concat(this.roundA, ")");
        };
        TinyColor2.prototype.toHsl = function() {
          var hsl2 = rgbToHsl(this.r, this.g, this.b);
          return { h: hsl2.h * 360, s: hsl2.s, l: hsl2.l, a: this.a };
        };
        TinyColor2.prototype.toHslString = function() {
          var hsl2 = rgbToHsl(this.r, this.g, this.b);
          var h2 = Math.round(hsl2.h * 360);
          var s2 = Math.round(hsl2.s * 100);
          var l2 = Math.round(hsl2.l * 100);
          return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%)") : "hsla(".concat(h2, ", ").concat(s2, "%, ").concat(l2, "%, ").concat(this.roundA, ")");
        };
        TinyColor2.prototype.toHex = function(allow3Char) {
          if (allow3Char === void 0) {
            allow3Char = false;
          }
          return rgbToHex(this.r, this.g, this.b, allow3Char);
        };
        TinyColor2.prototype.toHexString = function(allow3Char) {
          if (allow3Char === void 0) {
            allow3Char = false;
          }
          return "#" + this.toHex(allow3Char);
        };
        TinyColor2.prototype.toHex8 = function(allow4Char) {
          if (allow4Char === void 0) {
            allow4Char = false;
          }
          return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
        };
        TinyColor2.prototype.toHex8String = function(allow4Char) {
          if (allow4Char === void 0) {
            allow4Char = false;
          }
          return "#" + this.toHex8(allow4Char);
        };
        TinyColor2.prototype.toHexShortString = function(allowShortChar) {
          if (allowShortChar === void 0) {
            allowShortChar = false;
          }
          return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
        };
        TinyColor2.prototype.toRgb = function() {
          return {
            r: Math.round(this.r),
            g: Math.round(this.g),
            b: Math.round(this.b),
            a: this.a
          };
        };
        TinyColor2.prototype.toRgbString = function() {
          var r = Math.round(this.r);
          var g = Math.round(this.g);
          var b2 = Math.round(this.b);
          return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b2, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b2, ", ").concat(this.roundA, ")");
        };
        TinyColor2.prototype.toPercentageRgb = function() {
          var fmt = function(x2) {
            return "".concat(Math.round(bound01$1(x2, 255) * 100), "%");
          };
          return {
            r: fmt(this.r),
            g: fmt(this.g),
            b: fmt(this.b),
            a: this.a
          };
        };
        TinyColor2.prototype.toPercentageRgbString = function() {
          var rnd2 = function(x2) {
            return Math.round(bound01$1(x2, 255) * 100);
          };
          return this.a === 1 ? "rgb(".concat(rnd2(this.r), "%, ").concat(rnd2(this.g), "%, ").concat(rnd2(this.b), "%)") : "rgba(".concat(rnd2(this.r), "%, ").concat(rnd2(this.g), "%, ").concat(rnd2(this.b), "%, ").concat(this.roundA, ")");
        };
        TinyColor2.prototype.toName = function() {
          if (this.a === 0) {
            return "transparent";
          }
          if (this.a < 1) {
            return false;
          }
          var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
          for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
            var _b2 = _a2[_i], key = _b2[0], value = _b2[1];
            if (hex === value) {
              return key;
            }
          }
          return false;
        };
        TinyColor2.prototype.toString = function(format2) {
          var formatSet = Boolean(format2);
          format2 = format2 !== null && format2 !== void 0 ? format2 : this.format;
          var formattedString = false;
          var hasAlpha = this.a < 1 && this.a >= 0;
          var needsAlphaFormat = !formatSet && hasAlpha && (format2.startsWith("hex") || format2 === "name");
          if (needsAlphaFormat) {
            if (format2 === "name" && this.a === 0) {
              return this.toName();
            }
            return this.toRgbString();
          }
          if (format2 === "rgb") {
            formattedString = this.toRgbString();
          }
          if (format2 === "prgb") {
            formattedString = this.toPercentageRgbString();
          }
          if (format2 === "hex" || format2 === "hex6") {
            formattedString = this.toHexString();
          }
          if (format2 === "hex3") {
            formattedString = this.toHexString(true);
          }
          if (format2 === "hex4") {
            formattedString = this.toHex8String(true);
          }
          if (format2 === "hex8") {
            formattedString = this.toHex8String();
          }
          if (format2 === "name") {
            formattedString = this.toName();
          }
          if (format2 === "hsl") {
            formattedString = this.toHslString();
          }
          if (format2 === "hsv") {
            formattedString = this.toHsvString();
          }
          return formattedString || this.toHexString();
        };
        TinyColor2.prototype.toNumber = function() {
          return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
        };
        TinyColor2.prototype.clone = function() {
          return new TinyColor2(this.toString());
        };
        TinyColor2.prototype.lighten = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          var hsl2 = this.toHsl();
          hsl2.l += amount / 100;
          hsl2.l = clamp01(hsl2.l);
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.brighten = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          var rgb2 = this.toRgb();
          rgb2.r = Math.max(0, Math.min(255, rgb2.r - Math.round(255 * -(amount / 100))));
          rgb2.g = Math.max(0, Math.min(255, rgb2.g - Math.round(255 * -(amount / 100))));
          rgb2.b = Math.max(0, Math.min(255, rgb2.b - Math.round(255 * -(amount / 100))));
          return new TinyColor2(rgb2);
        };
        TinyColor2.prototype.darken = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          var hsl2 = this.toHsl();
          hsl2.l -= amount / 100;
          hsl2.l = clamp01(hsl2.l);
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.tint = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          return this.mix("white", amount);
        };
        TinyColor2.prototype.shade = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          return this.mix("black", amount);
        };
        TinyColor2.prototype.desaturate = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          var hsl2 = this.toHsl();
          hsl2.s -= amount / 100;
          hsl2.s = clamp01(hsl2.s);
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.saturate = function(amount) {
          if (amount === void 0) {
            amount = 10;
          }
          var hsl2 = this.toHsl();
          hsl2.s += amount / 100;
          hsl2.s = clamp01(hsl2.s);
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.greyscale = function() {
          return this.desaturate(100);
        };
        TinyColor2.prototype.spin = function(amount) {
          var hsl2 = this.toHsl();
          var hue = (hsl2.h + amount) % 360;
          hsl2.h = hue < 0 ? 360 + hue : hue;
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.mix = function(color2, amount) {
          if (amount === void 0) {
            amount = 50;
          }
          var rgb1 = this.toRgb();
          var rgb2 = new TinyColor2(color2).toRgb();
          var p2 = amount / 100;
          var rgba = {
            r: (rgb2.r - rgb1.r) * p2 + rgb1.r,
            g: (rgb2.g - rgb1.g) * p2 + rgb1.g,
            b: (rgb2.b - rgb1.b) * p2 + rgb1.b,
            a: (rgb2.a - rgb1.a) * p2 + rgb1.a
          };
          return new TinyColor2(rgba);
        };
        TinyColor2.prototype.analogous = function(results, slices) {
          if (results === void 0) {
            results = 6;
          }
          if (slices === void 0) {
            slices = 30;
          }
          var hsl2 = this.toHsl();
          var part = 360 / slices;
          var ret = [this];
          for (hsl2.h = (hsl2.h - (part * results >> 1) + 720) % 360; --results; ) {
            hsl2.h = (hsl2.h + part) % 360;
            ret.push(new TinyColor2(hsl2));
          }
          return ret;
        };
        TinyColor2.prototype.complement = function() {
          var hsl2 = this.toHsl();
          hsl2.h = (hsl2.h + 180) % 360;
          return new TinyColor2(hsl2);
        };
        TinyColor2.prototype.monochromatic = function(results) {
          if (results === void 0) {
            results = 6;
          }
          var hsv = this.toHsv();
          var h2 = hsv.h;
          var s2 = hsv.s;
          var v4 = hsv.v;
          var res = [];
          var modification = 1 / results;
          while (results--) {
            res.push(new TinyColor2({ h: h2, s: s2, v: v4 }));
            v4 = (v4 + modification) % 1;
          }
          return res;
        };
        TinyColor2.prototype.splitcomplement = function() {
          var hsl2 = this.toHsl();
          var h2 = hsl2.h;
          return [
            this,
            new TinyColor2({ h: (h2 + 72) % 360, s: hsl2.s, l: hsl2.l }),
            new TinyColor2({ h: (h2 + 216) % 360, s: hsl2.s, l: hsl2.l })
          ];
        };
        TinyColor2.prototype.onBackground = function(background) {
          var fg = this.toRgb();
          var bg = new TinyColor2(background).toRgb();
          var alpha = fg.a + bg.a * (1 - fg.a);
          return new TinyColor2({
            r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
            g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
            b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
            a: alpha
          });
        };
        TinyColor2.prototype.triad = function() {
          return this.polyad(3);
        };
        TinyColor2.prototype.tetrad = function() {
          return this.polyad(4);
        };
        TinyColor2.prototype.polyad = function(n) {
          var hsl2 = this.toHsl();
          var h2 = hsl2.h;
          var result = [this];
          var increment = 360 / n;
          for (var i2 = 1; i2 < n; i2++) {
            result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl2.s, l: hsl2.l }));
          }
          return result;
        };
        TinyColor2.prototype.equals = function(color2) {
          return this.toRgbString() === new TinyColor2(color2).toRgbString();
        };
        return TinyColor2;
      }()
    );
    function darken(color2, amount = 20) {
      return color2.mix("#141414", amount).toString();
    }
    function useButtonCustomStyle(props2) {
      const _disabled = useFormDisabled();
      const ns = useNamespace("button");
      return computed(() => {
        let styles = {};
        let buttonColor = props2.color;
        if (buttonColor) {
          const match = buttonColor.match(/var\((.*?)\)/);
          if (match) {
            buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
          }
          const color2 = new TinyColor(buttonColor);
          const activeBgColor = props2.dark ? color2.tint(20).toString() : darken(color2, 20);
          if (props2.plain) {
            styles = ns.cssVarBlock({
              "bg-color": props2.dark ? darken(color2, 90) : color2.tint(90).toString(),
              "text-color": buttonColor,
              "border-color": props2.dark ? darken(color2, 50) : color2.tint(50).toString(),
              "hover-text-color": `var(${ns.cssVarName("color-white")})`,
              "hover-bg-color": buttonColor,
              "hover-border-color": buttonColor,
              "active-bg-color": activeBgColor,
              "active-text-color": `var(${ns.cssVarName("color-white")})`,
              "active-border-color": activeBgColor
            });
            if (_disabled.value) {
              styles[ns.cssVarBlockName("disabled-bg-color")] = props2.dark ? darken(color2, 90) : color2.tint(90).toString();
              styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? darken(color2, 50) : color2.tint(50).toString();
              styles[ns.cssVarBlockName("disabled-border-color")] = props2.dark ? darken(color2, 80) : color2.tint(80).toString();
            }
          } else {
            const hoverBgColor = props2.dark ? darken(color2, 30) : color2.tint(30).toString();
            const textColor = color2.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
            styles = ns.cssVarBlock({
              "bg-color": buttonColor,
              "text-color": textColor,
              "border-color": buttonColor,
              "hover-bg-color": hoverBgColor,
              "hover-text-color": textColor,
              "hover-border-color": hoverBgColor,
              "active-bg-color": activeBgColor,
              "active-border-color": activeBgColor
            });
            if (_disabled.value) {
              const disabledButtonColor = props2.dark ? darken(color2, 50) : color2.tint(50).toString();
              styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
              styles[ns.cssVarBlockName("disabled-text-color")] = props2.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
              styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
            }
          }
        }
        return styles;
      });
    }
    const __default__$1C = /* @__PURE__ */ defineComponent({
      name: "ElButton"
    });
    const _sfc_main$2j = /* @__PURE__ */ defineComponent({
      ...__default__$1C,
      props: buttonProps,
      emits: buttonEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const buttonStyle = useButtonCustomStyle(props2);
        const ns = useNamespace("button");
        const { _ref, _size, _type, _disabled, _props, shouldAddSpace, handleClick } = useButton(props2, emit2);
        const buttonKls = computed(() => [
          ns.b(),
          ns.m(_type.value),
          ns.m(_size.value),
          ns.is("disabled", _disabled.value),
          ns.is("loading", props2.loading),
          ns.is("plain", props2.plain),
          ns.is("round", props2.round),
          ns.is("circle", props2.circle),
          ns.is("text", props2.text),
          ns.is("link", props2.link),
          ns.is("has-bg", props2.bg)
        ]);
        expose({
          ref: _ref,
          size: _size,
          type: _type,
          disabled: _disabled,
          shouldAddSpace
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
            ref_key: "_ref",
            ref: _ref
          }, unref(_props), {
            class: unref(buttonKls),
            style: unref(buttonStyle),
            onClick: unref(handleClick)
          }), {
            default: withCtx(() => [
              _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
                  key: 1,
                  class: normalizeClass(unref(ns).is("loading"))
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
                  ]),
                  _: 1
                }, 8, ["class"]))
              ], 64)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
                default: withCtx(() => [
                  _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
                ]),
                _: 3
              })) : createCommentVNode("v-if", true),
              _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
                key: 2,
                class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
              }, [
                renderSlot(_ctx.$slots, "default")
              ], 2)) : createCommentVNode("v-if", true)
            ]),
            _: 3
          }, 16, ["class", "style", "onClick"]);
        };
      }
    });
    var Button = /* @__PURE__ */ _export_sfc(_sfc_main$2j, [["__file", "button.vue"]]);
    const buttonGroupProps = {
      size: buttonProps.size,
      type: buttonProps.type
    };
    const __default__$1B = /* @__PURE__ */ defineComponent({
      name: "ElButtonGroup"
    });
    const _sfc_main$2i = /* @__PURE__ */ defineComponent({
      ...__default__$1B,
      props: buttonGroupProps,
      setup(__props) {
        const props2 = __props;
        provide(buttonGroupContextKey, reactive({
          size: toRef(props2, "size"),
          type: toRef(props2, "type")
        }));
        const ns = useNamespace("button");
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b("group"))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$2i, [["__file", "button-group.vue"]]);
    const ElButton = withInstall(Button, {
      ButtonGroup
    });
    const ElButtonGroup$1 = withNoopInstall(ButtonGroup);
    var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
    function getDefaultExportFromCjs(x2) {
      return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
    }
    var dayjs_min$1 = { exports: {} };
    var dayjs_min = dayjs_min$1.exports;
    var hasRequiredDayjs_min;
    function requireDayjs_min() {
      if (hasRequiredDayjs_min) return dayjs_min$1.exports;
      hasRequiredDayjs_min = 1;
      (function(module2, exports2) {
        !function(t, e2) {
          module2.exports = e2();
        }(dayjs_min, function() {
          var t = 1e3, e2 = 6e4, n = 36e5, r = "millisecond", i2 = "second", s2 = "minute", u2 = "hour", a2 = "day", o2 = "week", c2 = "month", f2 = "quarter", h2 = "year", d2 = "date", l2 = "Invalid Date", $2 = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M2 = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
            var e3 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
            return "[" + t2 + (e3[(n2 - 20) % 10] || e3[n2] || e3[0]) + "]";
          } }, m2 = function(t2, e3, n2) {
            var r2 = String(t2);
            return !r2 || r2.length >= e3 ? t2 : "" + Array(e3 + 1 - r2.length).join(n2) + t2;
          }, v4 = { s: m2, z: function(t2) {
            var e3 = -t2.utcOffset(), n2 = Math.abs(e3), r2 = Math.floor(n2 / 60), i3 = n2 % 60;
            return (e3 <= 0 ? "+" : "-") + m2(r2, 2, "0") + ":" + m2(i3, 2, "0");
          }, m: function t2(e3, n2) {
            if (e3.date() < n2.date()) return -t2(n2, e3);
            var r2 = 12 * (n2.year() - e3.year()) + (n2.month() - e3.month()), i3 = e3.clone().add(r2, c2), s3 = n2 - i3 < 0, u3 = e3.clone().add(r2 + (s3 ? -1 : 1), c2);
            return +(-(r2 + (n2 - i3) / (s3 ? i3 - u3 : u3 - i3)) || 0);
          }, a: function(t2) {
            return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
          }, p: function(t2) {
            return { M: c2, y: h2, w: o2, d: a2, D: d2, h: u2, m: s2, s: i2, ms: r, Q: f2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
          }, u: function(t2) {
            return void 0 === t2;
          } }, g = "en", D2 = {};
          D2[g] = M2;
          var p2 = "$isDayjsObject", S2 = function(t2) {
            return t2 instanceof _2 || !(!t2 || !t2[p2]);
          }, w2 = function t2(e3, n2, r2) {
            var i3;
            if (!e3) return g;
            if ("string" == typeof e3) {
              var s3 = e3.toLowerCase();
              D2[s3] && (i3 = s3), n2 && (D2[s3] = n2, i3 = s3);
              var u3 = e3.split("-");
              if (!i3 && u3.length > 1) return t2(u3[0]);
            } else {
              var a3 = e3.name;
              D2[a3] = e3, i3 = a3;
            }
            return !r2 && i3 && (g = i3), i3 || !r2 && g;
          }, O2 = function(t2, e3) {
            if (S2(t2)) return t2.clone();
            var n2 = "object" == typeof e3 ? e3 : {};
            return n2.date = t2, n2.args = arguments, new _2(n2);
          }, b2 = v4;
          b2.l = w2, b2.i = S2, b2.w = function(t2, e3) {
            return O2(t2, { locale: e3.$L, utc: e3.$u, x: e3.$x, $offset: e3.$offset });
          };
          var _2 = function() {
            function M3(t2) {
              this.$L = w2(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p2] = true;
            }
            var m3 = M3.prototype;
            return m3.parse = function(t2) {
              this.$d = function(t3) {
                var e3 = t3.date, n2 = t3.utc;
                if (null === e3) return /* @__PURE__ */ new Date(NaN);
                if (b2.u(e3)) return /* @__PURE__ */ new Date();
                if (e3 instanceof Date) return new Date(e3);
                if ("string" == typeof e3 && !/Z$/i.test(e3)) {
                  var r2 = e3.match($2);
                  if (r2) {
                    var i3 = r2[2] - 1 || 0, s3 = (r2[7] || "0").substring(0, 3);
                    return n2 ? new Date(Date.UTC(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s3)) : new Date(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s3);
                  }
                }
                return new Date(e3);
              }(t2), this.init();
            }, m3.init = function() {
              var t2 = this.$d;
              this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
            }, m3.$utils = function() {
              return b2;
            }, m3.isValid = function() {
              return !(this.$d.toString() === l2);
            }, m3.isSame = function(t2, e3) {
              var n2 = O2(t2);
              return this.startOf(e3) <= n2 && n2 <= this.endOf(e3);
            }, m3.isAfter = function(t2, e3) {
              return O2(t2) < this.startOf(e3);
            }, m3.isBefore = function(t2, e3) {
              return this.endOf(e3) < O2(t2);
            }, m3.$g = function(t2, e3, n2) {
              return b2.u(t2) ? this[e3] : this.set(n2, t2);
            }, m3.unix = function() {
              return Math.floor(this.valueOf() / 1e3);
            }, m3.valueOf = function() {
              return this.$d.getTime();
            }, m3.startOf = function(t2, e3) {
              var n2 = this, r2 = !!b2.u(e3) || e3, f3 = b2.p(t2), l3 = function(t3, e4) {
                var i3 = b2.w(n2.$u ? Date.UTC(n2.$y, e4, t3) : new Date(n2.$y, e4, t3), n2);
                return r2 ? i3 : i3.endOf(a2);
              }, $3 = function(t3, e4) {
                return b2.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e4)), n2);
              }, y2 = this.$W, M4 = this.$M, m4 = this.$D, v5 = "set" + (this.$u ? "UTC" : "");
              switch (f3) {
                case h2:
                  return r2 ? l3(1, 0) : l3(31, 11);
                case c2:
                  return r2 ? l3(1, M4) : l3(0, M4 + 1);
                case o2:
                  var g2 = this.$locale().weekStart || 0, D3 = (y2 < g2 ? y2 + 7 : y2) - g2;
                  return l3(r2 ? m4 - D3 : m4 + (6 - D3), M4);
                case a2:
                case d2:
                  return $3(v5 + "Hours", 0);
                case u2:
                  return $3(v5 + "Minutes", 1);
                case s2:
                  return $3(v5 + "Seconds", 2);
                case i2:
                  return $3(v5 + "Milliseconds", 3);
                default:
                  return this.clone();
              }
            }, m3.endOf = function(t2) {
              return this.startOf(t2, false);
            }, m3.$set = function(t2, e3) {
              var n2, o3 = b2.p(t2), f3 = "set" + (this.$u ? "UTC" : ""), l3 = (n2 = {}, n2[a2] = f3 + "Date", n2[d2] = f3 + "Date", n2[c2] = f3 + "Month", n2[h2] = f3 + "FullYear", n2[u2] = f3 + "Hours", n2[s2] = f3 + "Minutes", n2[i2] = f3 + "Seconds", n2[r] = f3 + "Milliseconds", n2)[o3], $3 = o3 === a2 ? this.$D + (e3 - this.$W) : e3;
              if (o3 === c2 || o3 === h2) {
                var y2 = this.clone().set(d2, 1);
                y2.$d[l3]($3), y2.init(), this.$d = y2.set(d2, Math.min(this.$D, y2.daysInMonth())).$d;
              } else l3 && this.$d[l3]($3);
              return this.init(), this;
            }, m3.set = function(t2, e3) {
              return this.clone().$set(t2, e3);
            }, m3.get = function(t2) {
              return this[b2.p(t2)]();
            }, m3.add = function(r2, f3) {
              var d3, l3 = this;
              r2 = Number(r2);
              var $3 = b2.p(f3), y2 = function(t2) {
                var e3 = O2(l3);
                return b2.w(e3.date(e3.date() + Math.round(t2 * r2)), l3);
              };
              if ($3 === c2) return this.set(c2, this.$M + r2);
              if ($3 === h2) return this.set(h2, this.$y + r2);
              if ($3 === a2) return y2(1);
              if ($3 === o2) return y2(7);
              var M4 = (d3 = {}, d3[s2] = e2, d3[u2] = n, d3[i2] = t, d3)[$3] || 1, m4 = this.$d.getTime() + r2 * M4;
              return b2.w(m4, this);
            }, m3.subtract = function(t2, e3) {
              return this.add(-1 * t2, e3);
            }, m3.format = function(t2) {
              var e3 = this, n2 = this.$locale();
              if (!this.isValid()) return n2.invalidDate || l2;
              var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b2.z(this), s3 = this.$H, u3 = this.$m, a3 = this.$M, o3 = n2.weekdays, c3 = n2.months, f3 = n2.meridiem, h3 = function(t3, n3, i4, s4) {
                return t3 && (t3[n3] || t3(e3, r2)) || i4[n3].slice(0, s4);
              }, d3 = function(t3) {
                return b2.s(s3 % 12 || 12, t3, "0");
              }, $3 = f3 || function(t3, e4, n3) {
                var r3 = t3 < 12 ? "AM" : "PM";
                return n3 ? r3.toLowerCase() : r3;
              };
              return r2.replace(y, function(t3, r3) {
                return r3 || function(t4) {
                  switch (t4) {
                    case "YY":
                      return String(e3.$y).slice(-2);
                    case "YYYY":
                      return b2.s(e3.$y, 4, "0");
                    case "M":
                      return a3 + 1;
                    case "MM":
                      return b2.s(a3 + 1, 2, "0");
                    case "MMM":
                      return h3(n2.monthsShort, a3, c3, 3);
                    case "MMMM":
                      return h3(c3, a3);
                    case "D":
                      return e3.$D;
                    case "DD":
                      return b2.s(e3.$D, 2, "0");
                    case "d":
                      return String(e3.$W);
                    case "dd":
                      return h3(n2.weekdaysMin, e3.$W, o3, 2);
                    case "ddd":
                      return h3(n2.weekdaysShort, e3.$W, o3, 3);
                    case "dddd":
                      return o3[e3.$W];
                    case "H":
                      return String(s3);
                    case "HH":
                      return b2.s(s3, 2, "0");
                    case "h":
                      return d3(1);
                    case "hh":
                      return d3(2);
                    case "a":
                      return $3(s3, u3, true);
                    case "A":
                      return $3(s3, u3, false);
                    case "m":
                      return String(u3);
                    case "mm":
                      return b2.s(u3, 2, "0");
                    case "s":
                      return String(e3.$s);
                    case "ss":
                      return b2.s(e3.$s, 2, "0");
                    case "SSS":
                      return b2.s(e3.$ms, 3, "0");
                    case "Z":
                      return i3;
                  }
                  return null;
                }(t3) || i3.replace(":", "");
              });
            }, m3.utcOffset = function() {
              return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
            }, m3.diff = function(r2, d3, l3) {
              var $3, y2 = this, M4 = b2.p(d3), m4 = O2(r2), v5 = (m4.utcOffset() - this.utcOffset()) * e2, g2 = this - m4, D3 = function() {
                return b2.m(y2, m4);
              };
              switch (M4) {
                case h2:
                  $3 = D3() / 12;
                  break;
                case c2:
                  $3 = D3();
                  break;
                case f2:
                  $3 = D3() / 3;
                  break;
                case o2:
                  $3 = (g2 - v5) / 6048e5;
                  break;
                case a2:
                  $3 = (g2 - v5) / 864e5;
                  break;
                case u2:
                  $3 = g2 / n;
                  break;
                case s2:
                  $3 = g2 / e2;
                  break;
                case i2:
                  $3 = g2 / t;
                  break;
                default:
                  $3 = g2;
              }
              return l3 ? $3 : b2.a($3);
            }, m3.daysInMonth = function() {
              return this.endOf(c2).$D;
            }, m3.$locale = function() {
              return D2[this.$L];
            }, m3.locale = function(t2, e3) {
              if (!t2) return this.$L;
              var n2 = this.clone(), r2 = w2(t2, e3, true);
              return r2 && (n2.$L = r2), n2;
            }, m3.clone = function() {
              return b2.w(this.$d, this);
            }, m3.toDate = function() {
              return new Date(this.valueOf());
            }, m3.toJSON = function() {
              return this.isValid() ? this.toISOString() : null;
            }, m3.toISOString = function() {
              return this.$d.toISOString();
            }, m3.toString = function() {
              return this.$d.toUTCString();
            }, M3;
          }(), k2 = _2.prototype;
          return O2.prototype = k2, [["$ms", r], ["$s", i2], ["$m", s2], ["$H", u2], ["$W", a2], ["$M", c2], ["$y", h2], ["$D", d2]].forEach(function(t2) {
            k2[t2[1]] = function(e3) {
              return this.$g(e3, t2[0], t2[1]);
            };
          }), O2.extend = function(t2, e3) {
            return t2.$i || (t2(e3, _2, O2), t2.$i = true), O2;
          }, O2.locale = w2, O2.isDayjs = S2, O2.unix = function(t2) {
            return O2(1e3 * t2);
          }, O2.en = D2[g], O2.Ls = D2, O2.p = {}, O2;
        });
      })(dayjs_min$1);
      return dayjs_min$1.exports;
    }
    var dayjs_minExports = requireDayjs_min();
    const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
    const buildTimeList = (value, bound) => {
      return [
        value > 0 ? value - 1 : void 0,
        value,
        value < bound ? value + 1 : void 0
      ];
    };
    const rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
    const extractDateFormat = (format2) => {
      return format2.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
    };
    const extractTimeFormat = (format2) => {
      return format2.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim();
    };
    const dateEquals = function(a2, b2) {
      const aIsDate = isDate$1(a2);
      const bIsDate = isDate$1(b2);
      if (aIsDate && bIsDate) {
        return a2.getTime() === b2.getTime();
      }
      if (!aIsDate && !bIsDate) {
        return a2 === b2;
      }
      return false;
    };
    const valueEquals = function(a2, b2) {
      const aIsArray = isArray$5(a2);
      const bIsArray = isArray$5(b2);
      if (aIsArray && bIsArray) {
        if (a2.length !== b2.length) {
          return false;
        }
        return a2.every((item, index) => dateEquals(item, b2[index]));
      }
      if (!aIsArray && !bIsArray) {
        return dateEquals(a2, b2);
      }
      return false;
    };
    const parseDate$2 = function(date, format2, lang) {
      const day = isEmpty(format2) || format2 === "x" ? dayjs(date).locale(lang) : dayjs(date, format2).locale(lang);
      return day.isValid() ? day : void 0;
    };
    const formatter = function(date, format2, lang) {
      if (isEmpty(format2))
        return date;
      if (format2 === "x")
        return +date;
      return dayjs(date).locale(lang).format(format2);
    };
    const makeList = (total2, method) => {
      var _a2;
      const arr = [];
      const disabledArr = method == null ? void 0 : method();
      for (let i2 = 0; i2 < total2; i2++) {
        arr.push((_a2 = disabledArr == null ? void 0 : disabledArr.includes(i2)) != null ? _a2 : false);
      }
      return arr;
    };
    const dayOrDaysToDate = (dayOrDays) => {
      return isArray$5(dayOrDays) ? dayOrDays.map((d2) => d2.toDate()) : dayOrDays.toDate();
    };
    const getPrevMonthLastDays = (date, count2) => {
      const lastDay = date.subtract(1, "month").endOf("month").date();
      return rangeArr(count2).map((_2, index) => lastDay - (count2 - index - 1));
    };
    const getMonthDays = (date) => {
      const days2 = date.daysInMonth();
      return rangeArr(days2).map((_2, index) => index + 1);
    };
    const toNestedArr = (days2) => rangeArr(days2.length / 7).map((index) => {
      const start2 = index * 7;
      return days2.slice(start2, start2 + 7);
    });
    const dateTableProps = buildProps({
      selectedDay: {
        type: definePropType(Object)
      },
      range: {
        type: definePropType(Array)
      },
      date: {
        type: definePropType(Object),
        required: true
      },
      hideHeader: {
        type: Boolean
      }
    });
    const dateTableEmits = {
      pick: (value) => isObject$7(value)
    };
    var localeData$2 = { exports: {} };
    var localeData$1 = localeData$2.exports;
    var hasRequiredLocaleData;
    function requireLocaleData() {
      if (hasRequiredLocaleData) return localeData$2.exports;
      hasRequiredLocaleData = 1;
      (function(module2, exports2) {
        !function(n, e2) {
          module2.exports = e2();
        }(localeData$1, function() {
          return function(n, e2, t) {
            var r = e2.prototype, o2 = function(n2) {
              return n2 && (n2.indexOf ? n2 : n2.s);
            }, u2 = function(n2, e3, t2, r2, u3) {
              var i3 = n2.name ? n2 : n2.$locale(), a3 = o2(i3[e3]), s3 = o2(i3[t2]), f2 = a3 || s3.map(function(n3) {
                return n3.slice(0, r2);
              });
              if (!u3) return f2;
              var d2 = i3.weekStart;
              return f2.map(function(n3, e4) {
                return f2[(e4 + (d2 || 0)) % 7];
              });
            }, i2 = function() {
              return t.Ls[t.locale()];
            }, a2 = function(n2, e3) {
              return n2.formats[e3] || function(n3) {
                return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n4, e4, t2) {
                  return e4 || t2.slice(1);
                });
              }(n2.formats[e3.toUpperCase()]);
            }, s2 = function() {
              var n2 = this;
              return { months: function(e3) {
                return e3 ? e3.format("MMMM") : u2(n2, "months");
              }, monthsShort: function(e3) {
                return e3 ? e3.format("MMM") : u2(n2, "monthsShort", "months", 3);
              }, firstDayOfWeek: function() {
                return n2.$locale().weekStart || 0;
              }, weekdays: function(e3) {
                return e3 ? e3.format("dddd") : u2(n2, "weekdays");
              }, weekdaysMin: function(e3) {
                return e3 ? e3.format("dd") : u2(n2, "weekdaysMin", "weekdays", 2);
              }, weekdaysShort: function(e3) {
                return e3 ? e3.format("ddd") : u2(n2, "weekdaysShort", "weekdays", 3);
              }, longDateFormat: function(e3) {
                return a2(n2.$locale(), e3);
              }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
            };
            r.localeData = function() {
              return s2.bind(this)();
            }, t.localeData = function() {
              var n2 = i2();
              return { firstDayOfWeek: function() {
                return n2.weekStart || 0;
              }, weekdays: function() {
                return t.weekdays();
              }, weekdaysShort: function() {
                return t.weekdaysShort();
              }, weekdaysMin: function() {
                return t.weekdaysMin();
              }, months: function() {
                return t.months();
              }, monthsShort: function() {
                return t.monthsShort();
              }, longDateFormat: function(e3) {
                return a2(n2, e3);
              }, meridiem: n2.meridiem, ordinal: n2.ordinal };
            }, t.months = function() {
              return u2(i2(), "months");
            }, t.monthsShort = function() {
              return u2(i2(), "monthsShort", "months", 3);
            }, t.weekdays = function(n2) {
              return u2(i2(), "weekdays", null, null, n2);
            }, t.weekdaysShort = function(n2) {
              return u2(i2(), "weekdaysShort", "weekdays", 3, n2);
            }, t.weekdaysMin = function(n2) {
              return u2(i2(), "weekdaysMin", "weekdays", 2, n2);
            };
          };
        });
      })(localeData$2);
      return localeData$2.exports;
    }
    var localeDataExports = requireLocaleData();
    const localeData = /* @__PURE__ */ getDefaultExportFromCjs(localeDataExports);
    const datePickTypes = [
      "year",
      "years",
      "month",
      "months",
      "date",
      "dates",
      "week",
      "datetime",
      "datetimerange",
      "daterange",
      "monthrange",
      "yearrange"
    ];
    const WEEK_DAYS = [
      "sun",
      "mon",
      "tue",
      "wed",
      "thu",
      "fri",
      "sat"
    ];
    const useDateTable = (props2, emit2) => {
      dayjs.extend(localeData);
      const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
      const { t, lang } = useLocale();
      const now2 = dayjs().locale(lang.value);
      const isInRange = computed(() => !!props2.range && !!props2.range.length);
      const rows = computed(() => {
        let days2 = [];
        if (isInRange.value) {
          const [start2, end2] = props2.range;
          const currentMonthRange = rangeArr(end2.date() - start2.date() + 1).map((index) => ({
            text: start2.date() + index,
            type: "current"
          }));
          let remaining = currentMonthRange.length % 7;
          remaining = remaining === 0 ? 0 : 7 - remaining;
          const nextMonthRange = rangeArr(remaining).map((_2, index) => ({
            text: index + 1,
            type: "next"
          }));
          days2 = currentMonthRange.concat(nextMonthRange);
        } else {
          const firstDay = props2.date.startOf("month").day();
          const prevMonthDays = getPrevMonthLastDays(props2.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
            text: day,
            type: "prev"
          }));
          const currentMonthDays = getMonthDays(props2.date).map((day) => ({
            text: day,
            type: "current"
          }));
          days2 = [...prevMonthDays, ...currentMonthDays];
          const remaining = 7 - (days2.length % 7 || 7);
          const nextMonthDays = rangeArr(remaining).map((_2, index) => ({
            text: index + 1,
            type: "next"
          }));
          days2 = days2.concat(nextMonthDays);
        }
        return toNestedArr(days2);
      });
      const weekDays = computed(() => {
        const start2 = firstDayOfWeek;
        if (start2 === 0) {
          return WEEK_DAYS.map((_2) => t(`el.datepicker.weeks.${_2}`));
        } else {
          return WEEK_DAYS.slice(start2).concat(WEEK_DAYS.slice(0, start2)).map((_2) => t(`el.datepicker.weeks.${_2}`));
        }
      });
      const getFormattedDate = (day, type) => {
        switch (type) {
          case "prev":
            return props2.date.startOf("month").subtract(1, "month").date(day);
          case "next":
            return props2.date.startOf("month").add(1, "month").date(day);
          case "current":
            return props2.date.date(day);
        }
      };
      const handlePickDay = ({ text, type }) => {
        const date = getFormattedDate(text, type);
        emit2("pick", date);
      };
      const getSlotData = ({ text, type }) => {
        const day = getFormattedDate(text, type);
        return {
          isSelected: day.isSame(props2.selectedDay),
          type: `${type}-month`,
          day: day.format("YYYY-MM-DD"),
          date: day.toDate()
        };
      };
      return {
        now: now2,
        isInRange,
        rows,
        weekDays,
        getFormattedDate,
        handlePickDay,
        getSlotData
      };
    };
    const __default__$1A = /* @__PURE__ */ defineComponent({
      name: "DateTable"
    });
    const _sfc_main$2h = /* @__PURE__ */ defineComponent({
      ...__default__$1A,
      props: dateTableProps,
      emits: dateTableEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const {
          isInRange,
          now: now2,
          rows,
          weekDays,
          getFormattedDate,
          handlePickDay,
          getSlotData
        } = useDateTable(props2, emit2);
        const nsTable = useNamespace("calendar-table");
        const nsDay = useNamespace("calendar-day");
        const getCellClass = ({ text, type }) => {
          const classes = [type];
          if (type === "current") {
            const date = getFormattedDate(text, type);
            if (date.isSame(props2.selectedDay, "day")) {
              classes.push(nsDay.is("selected"));
            }
            if (date.isSame(now2, "day")) {
              classes.push(nsDay.is("today"));
            }
          }
          return classes;
        };
        expose({
          getFormattedDate
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("table", {
            class: normalizeClass([unref(nsTable).b(), unref(nsTable).is("range", unref(isInRange))]),
            cellspacing: "0",
            cellpadding: "0"
          }, [
            !_ctx.hideHeader ? (openBlock(), createElementBlock("thead", { key: 0 }, [
              createBaseVNode("tr", null, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(weekDays), (day) => {
                  return openBlock(), createElementBlock("th", {
                    key: day,
                    scope: "col"
                  }, toDisplayString(day), 1);
                }), 128))
              ])
            ])) : createCommentVNode("v-if", true),
            createBaseVNode("tbody", null, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, index) => {
                return openBlock(), createElementBlock("tr", {
                  key: index,
                  class: normalizeClass({
                    [unref(nsTable).e("row")]: true,
                    [unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
                  })
                }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key) => {
                    return openBlock(), createElementBlock("td", {
                      key,
                      class: normalizeClass(getCellClass(cell)),
                      onClick: ($event) => unref(handlePickDay)(cell)
                    }, [
                      createBaseVNode("div", {
                        class: normalizeClass(unref(nsDay).b())
                      }, [
                        renderSlot(_ctx.$slots, "date-cell", {
                          data: unref(getSlotData)(cell)
                        }, () => [
                          createBaseVNode("span", null, toDisplayString(cell.text), 1)
                        ])
                      ], 2)
                    ], 10, ["onClick"]);
                  }), 128))
                ], 2);
              }), 128))
            ])
          ], 2);
        };
      }
    });
    var DateTable$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__file", "date-table.vue"]]);
    const adjacentMonth = (start2, end2) => {
      const firstMonthLastDay = start2.endOf("month");
      const lastMonthFirstDay = end2.startOf("month");
      const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
      const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
      return [
        [start2, firstMonthLastDay],
        [lastMonthStartDay.startOf("week"), end2]
      ];
    };
    const threeConsecutiveMonth = (start2, end2) => {
      const firstMonthLastDay = start2.endOf("month");
      const secondMonthFirstDay = start2.add(1, "month").startOf("month");
      const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
      const secondMonthLastDay = secondMonthStartDay.endOf("month");
      const lastMonthFirstDay = end2.startOf("month");
      const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
      return [
        [start2, firstMonthLastDay],
        [secondMonthStartDay.startOf("week"), secondMonthLastDay],
        [lastMonthStartDay.startOf("week"), end2]
      ];
    };
    const useCalendar = (props2, emit2, componentName2) => {
      const { lang } = useLocale();
      const selectedDay = ref();
      const now2 = dayjs().locale(lang.value);
      const realSelectedDay = computed({
        get() {
          if (!props2.modelValue)
            return selectedDay.value;
          return date.value;
        },
        set(val) {
          if (!val)
            return;
          selectedDay.value = val;
          const result = val.toDate();
          emit2(INPUT_EVENT, result);
          emit2(UPDATE_MODEL_EVENT, result);
        }
      });
      const validatedRange = computed(() => {
        if (!props2.range || !isArray$5(props2.range) || props2.range.length !== 2 || props2.range.some((item) => !isDate$1(item)))
          return [];
        const rangeArrDayjs = props2.range.map((_2) => dayjs(_2).locale(lang.value));
        const [startDayjs, endDayjs] = rangeArrDayjs;
        if (startDayjs.isAfter(endDayjs)) {
          return [];
        }
        if (startDayjs.isSame(endDayjs, "month")) {
          return calculateValidatedDateRange(startDayjs, endDayjs);
        } else {
          if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
            return [];
          }
          return calculateValidatedDateRange(startDayjs, endDayjs);
        }
      });
      const date = computed(() => {
        if (!props2.modelValue) {
          return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now2);
        } else {
          return dayjs(props2.modelValue).locale(lang.value);
        }
      });
      const prevMonthDayjs = computed(() => date.value.subtract(1, "month").date(1));
      const nextMonthDayjs = computed(() => date.value.add(1, "month").date(1));
      const prevYearDayjs = computed(() => date.value.subtract(1, "year").date(1));
      const nextYearDayjs = computed(() => date.value.add(1, "year").date(1));
      const calculateValidatedDateRange = (startDayjs, endDayjs) => {
        const firstDay = startDayjs.startOf("week");
        const lastDay = endDayjs.endOf("week");
        const firstMonth = firstDay.get("month");
        const lastMonth = lastDay.get("month");
        if (firstMonth === lastMonth) {
          return [[firstDay, lastDay]];
        } else if ((firstMonth + 1) % 12 === lastMonth) {
          return adjacentMonth(firstDay, lastDay);
        } else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
          return threeConsecutiveMonth(firstDay, lastDay);
        } else {
          return [];
        }
      };
      const pickDay = (day) => {
        realSelectedDay.value = day;
      };
      const selectDate = (type) => {
        const dateMap = {
          "prev-month": prevMonthDayjs.value,
          "next-month": nextMonthDayjs.value,
          "prev-year": prevYearDayjs.value,
          "next-year": nextYearDayjs.value,
          today: now2
        };
        const day = dateMap[type];
        if (!day.isSame(date.value, "day")) {
          pickDay(day);
        }
      };
      return {
        calculateValidatedDateRange,
        date,
        realSelectedDay,
        pickDay,
        selectDate,
        validatedRange
      };
    };
    const isValidRange$1 = (range2) => isArray$5(range2) && range2.length === 2 && range2.every((item) => isDate$1(item));
    const calendarProps = buildProps({
      modelValue: {
        type: Date
      },
      range: {
        type: definePropType(Array),
        validator: isValidRange$1
      }
    });
    const calendarEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isDate$1(value),
      [INPUT_EVENT]: (value) => isDate$1(value)
    };
    const COMPONENT_NAME$j = "ElCalendar";
    const __default__$1z = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$j
    });
    const _sfc_main$2g = /* @__PURE__ */ defineComponent({
      ...__default__$1z,
      props: calendarProps,
      emits: calendarEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("calendar");
        const {
          calculateValidatedDateRange,
          date,
          pickDay,
          realSelectedDay,
          selectDate,
          validatedRange
        } = useCalendar(props2, emit2);
        const { t } = useLocale();
        const i18nDate = computed(() => {
          const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
          return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
        });
        expose({
          selectedDay: realSelectedDay,
          pickDay,
          selectDate,
          calculateValidatedDateRange
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("header"))
            }, [
              renderSlot(_ctx.$slots, "header", { date: unref(i18nDate) }, () => [
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("title"))
                }, toDisplayString(unref(i18nDate)), 3),
                unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(unref(ns).e("button-group"))
                }, [
                  createVNode$1(unref(ElButtonGroup$1), null, {
                    default: withCtx(() => [
                      createVNode$1(unref(ElButton), {
                        size: "small",
                        onClick: ($event) => unref(selectDate)("prev-month")
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(unref(t)("el.datepicker.prevMonth")), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick"]),
                      createVNode$1(unref(ElButton), {
                        size: "small",
                        onClick: ($event) => unref(selectDate)("today")
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(unref(t)("el.datepicker.today")), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick"]),
                      createVNode$1(unref(ElButton), {
                        size: "small",
                        onClick: ($event) => unref(selectDate)("next-month")
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString(unref(t)("el.datepicker.nextMonth")), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick"])
                    ]),
                    _: 1
                  })
                ], 2)) : createCommentVNode("v-if", true)
              ])
            ], 2),
            unref(validatedRange).length === 0 ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("body"))
            }, [
              createVNode$1(DateTable$1, {
                date: unref(date),
                "selected-day": unref(realSelectedDay),
                onPick: unref(pickDay)
              }, createSlots({
                _: 2
              }, [
                _ctx.$slots["date-cell"] ? {
                  name: "date-cell",
                  fn: withCtx((data) => [
                    renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))
                  ])
                } : void 0
              ]), 1032, ["date", "selected-day", "onPick"])
            ], 2)) : (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("body"))
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(validatedRange), (range_, index) => {
                return openBlock(), createBlock(DateTable$1, {
                  key: index,
                  date: range_[0],
                  "selected-day": unref(realSelectedDay),
                  range: range_,
                  "hide-header": index !== 0,
                  onPick: unref(pickDay)
                }, createSlots({
                  _: 2
                }, [
                  _ctx.$slots["date-cell"] ? {
                    name: "date-cell",
                    fn: withCtx((data) => [
                      renderSlot(_ctx.$slots, "date-cell", normalizeProps(guardReactiveProps(data)))
                    ])
                  } : void 0
                ]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
              }), 128))
            ], 2))
          ], 2);
        };
      }
    });
    var Calendar$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["__file", "calendar.vue"]]);
    const ElCalendar = withInstall(Calendar$1);
    const cardProps = buildProps({
      header: {
        type: String,
        default: ""
      },
      footer: {
        type: String,
        default: ""
      },
      bodyStyle: {
        type: definePropType([String, Object, Array]),
        default: ""
      },
      headerClass: String,
      bodyClass: String,
      footerClass: String,
      shadow: {
        type: String,
        values: ["always", "hover", "never"],
        default: "always"
      }
    });
    const __default__$1y = /* @__PURE__ */ defineComponent({
      name: "ElCard"
    });
    const _sfc_main$2f = /* @__PURE__ */ defineComponent({
      ...__default__$1y,
      props: cardProps,
      setup(__props) {
        const ns = useNamespace("card");
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b(), unref(ns).is(`${_ctx.shadow}-shadow`)])
          }, [
            _ctx.$slots.header || _ctx.header ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass([unref(ns).e("header"), _ctx.headerClass])
            }, [
              renderSlot(_ctx.$slots, "header", {}, () => [
                createTextVNode(toDisplayString(_ctx.header), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass([unref(ns).e("body"), _ctx.bodyClass]),
              style: normalizeStyle$1(_ctx.bodyStyle)
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 6),
            _ctx.$slots.footer || _ctx.footer ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass([unref(ns).e("footer"), _ctx.footerClass])
            }, [
              renderSlot(_ctx.$slots, "footer", {}, () => [
                createTextVNode(toDisplayString(_ctx.footer), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var Card = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__file", "card.vue"]]);
    const ElCard = withInstall(Card);
    const carouselProps = buildProps({
      initialIndex: {
        type: Number,
        default: 0
      },
      height: {
        type: String,
        default: ""
      },
      trigger: {
        type: String,
        values: ["hover", "click"],
        default: "hover"
      },
      autoplay: {
        type: Boolean,
        default: true
      },
      interval: {
        type: Number,
        default: 3e3
      },
      indicatorPosition: {
        type: String,
        values: ["", "none", "outside"],
        default: ""
      },
      arrow: {
        type: String,
        values: ["always", "hover", "never"],
        default: "hover"
      },
      type: {
        type: String,
        values: ["", "card"],
        default: ""
      },
      cardScale: {
        type: Number,
        default: 0.83
      },
      loop: {
        type: Boolean,
        default: true
      },
      direction: {
        type: String,
        values: ["horizontal", "vertical"],
        default: "horizontal"
      },
      pauseOnHover: {
        type: Boolean,
        default: true
      },
      motionBlur: Boolean
    });
    const carouselEmits = {
      change: (current, prev) => [current, prev].every(isNumber$2)
    };
    const carouselContextKey = Symbol("carouselContextKey");
    const CAROUSEL_ITEM_NAME = "ElCarouselItem";
    var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
      PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
      PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
      PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
      PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
      PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
      PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
      PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
      PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
      PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
      PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
      PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
      PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
      PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
      return PatchFlags2;
    })(PatchFlags || {});
    function isFragment(node) {
      return isVNode(node) && node.type === Fragment;
    }
    function isComment(node) {
      return isVNode(node) && node.type === Comment;
    }
    function isValidElementNode(node) {
      return isVNode(node) && !isFragment(node) && !isComment(node);
    }
    const getNormalizedProps = (node) => {
      if (!isVNode(node)) {
        return {};
      }
      const raw = node.props || {};
      const type = (isVNode(node.type) ? node.type.props : void 0) || {};
      const props2 = {};
      Object.keys(type).forEach((key) => {
        if (hasOwn$1(type[key], "default")) {
          props2[key] = type[key].default;
        }
      });
      Object.keys(raw).forEach((key) => {
        props2[camelize(key)] = raw[key];
      });
      return props2;
    };
    const ensureOnlyChild = (children) => {
      if (!isArray$5(children) || children.length > 1) {
        throw new Error("expect to receive a single Vue element child");
      }
      return children[0];
    };
    const flattedChildren = (children) => {
      const vNodes = isArray$5(children) ? children : [children];
      const result = [];
      vNodes.forEach((child) => {
        var _a2;
        if (isArray$5(child)) {
          result.push(...flattedChildren(child));
        } else if (isVNode(child) && ((_a2 = child.component) == null ? void 0 : _a2.subTree)) {
          result.push(child, ...flattedChildren(child.component.subTree));
        } else if (isVNode(child) && isArray$5(child.children)) {
          result.push(...flattedChildren(child.children));
        } else if (isVNode(child) && child.shapeFlag === 2) {
          result.push(...flattedChildren(child.type()));
        } else {
          result.push(child);
        }
      });
      return result;
    };
    const getOrderedChildren = (vm, childComponentName, children) => {
      const nodes = flattedChildren(vm.subTree).filter((n) => {
        var _a2;
        return isVNode(n) && ((_a2 = n.type) == null ? void 0 : _a2.name) === childComponentName && !!n.component;
      });
      const uids = nodes.map((n) => n.component.uid);
      return uids.map((uid2) => children[uid2]).filter((p2) => !!p2);
    };
    const useOrderedChildren = (vm, childComponentName) => {
      const children = {};
      const orderedChildren = shallowRef([]);
      const addChild2 = (child) => {
        children[child.uid] = child;
        orderedChildren.value = getOrderedChildren(vm, childComponentName, children);
      };
      const removeChild2 = (uid2) => {
        delete children[uid2];
        orderedChildren.value = orderedChildren.value.filter((children2) => children2.uid !== uid2);
      };
      return {
        children: orderedChildren,
        addChild: addChild2,
        removeChild: removeChild2
      };
    };
    const THROTTLE_TIME = 300;
    const useCarousel = (props2, emit2, componentName2) => {
      const {
        children: items,
        addChild: addItem,
        removeChild: removeItem
      } = useOrderedChildren(getCurrentInstance(), CAROUSEL_ITEM_NAME);
      const slots = useSlots();
      const activeIndex = ref(-1);
      const timer = ref(null);
      const hover = ref(false);
      const root2 = ref();
      const containerHeight = ref(0);
      const isItemsTwoLength = ref(true);
      const isFirstCall = ref(true);
      const isTransitioning = ref(false);
      const arrowDisplay = computed(() => props2.arrow !== "never" && !unref(isVertical));
      const hasLabel = computed(() => {
        return items.value.some((item) => item.props.label.toString().length > 0);
      });
      const isCardType = computed(() => props2.type === "card");
      const isVertical = computed(() => props2.direction === "vertical");
      const containerStyle = computed(() => {
        if (props2.height !== "auto") {
          return {
            height: props2.height
          };
        }
        return {
          height: `${containerHeight.value}px`,
          overflow: "hidden"
        };
      });
      const throttledArrowClick = throttle$2((index) => {
        setActiveItem(index);
      }, THROTTLE_TIME, { trailing: true });
      const throttledIndicatorHover = throttle$2((index) => {
        handleIndicatorHover(index);
      }, THROTTLE_TIME);
      const isTwoLengthShow = (index) => {
        if (!isItemsTwoLength.value)
          return true;
        return activeIndex.value <= 1 ? index <= 1 : index > 1;
      };
      function pauseTimer() {
        if (timer.value) {
          clearInterval(timer.value);
          timer.value = null;
        }
      }
      function startTimer() {
        if (props2.interval <= 0 || !props2.autoplay || timer.value)
          return;
        timer.value = setInterval(() => playSlides(), props2.interval);
      }
      const playSlides = () => {
        if (!isFirstCall.value) {
          isTransitioning.value = true;
        }
        isFirstCall.value = false;
        if (activeIndex.value < items.value.length - 1) {
          activeIndex.value = activeIndex.value + 1;
        } else if (props2.loop) {
          activeIndex.value = 0;
        } else {
          isTransitioning.value = false;
        }
      };
      function setActiveItem(index) {
        if (!isFirstCall.value) {
          isTransitioning.value = true;
        }
        isFirstCall.value = false;
        if (isString$3(index)) {
          const filteredItems = items.value.filter((item) => item.props.name === index);
          if (filteredItems.length > 0) {
            index = items.value.indexOf(filteredItems[0]);
          }
        }
        index = Number(index);
        if (Number.isNaN(index) || index !== Math.floor(index)) {
          return;
        }
        const itemCount = items.value.length;
        const oldIndex = activeIndex.value;
        if (index < 0) {
          activeIndex.value = props2.loop ? itemCount - 1 : 0;
        } else if (index >= itemCount) {
          activeIndex.value = props2.loop ? 0 : itemCount - 1;
        } else {
          activeIndex.value = index;
        }
        if (oldIndex === activeIndex.value) {
          resetItemPosition(oldIndex);
        }
        resetTimer();
      }
      function resetItemPosition(oldIndex) {
        items.value.forEach((item, index) => {
          item.translateItem(index, activeIndex.value, oldIndex);
        });
      }
      function itemInStage(item, index) {
        var _a2, _b2, _c2, _d;
        const _items = unref(items);
        const itemCount = _items.length;
        if (itemCount === 0 || !item.states.inStage)
          return false;
        const nextItemIndex = index + 1;
        const prevItemIndex = index - 1;
        const lastItemIndex = itemCount - 1;
        const isLastItemActive = _items[lastItemIndex].states.active;
        const isFirstItemActive = _items[0].states.active;
        const isNextItemActive = (_b2 = (_a2 = _items[nextItemIndex]) == null ? void 0 : _a2.states) == null ? void 0 : _b2.active;
        const isPrevItemActive = (_d = (_c2 = _items[prevItemIndex]) == null ? void 0 : _c2.states) == null ? void 0 : _d.active;
        if (index === lastItemIndex && isFirstItemActive || isNextItemActive) {
          return "left";
        } else if (index === 0 && isLastItemActive || isPrevItemActive) {
          return "right";
        }
        return false;
      }
      function handleMouseEnter() {
        hover.value = true;
        if (props2.pauseOnHover) {
          pauseTimer();
        }
      }
      function handleMouseLeave() {
        hover.value = false;
        startTimer();
      }
      function handleTransitionEnd() {
        isTransitioning.value = false;
      }
      function handleButtonEnter(arrow2) {
        if (unref(isVertical))
          return;
        items.value.forEach((item, index) => {
          if (arrow2 === itemInStage(item, index)) {
            item.states.hover = true;
          }
        });
      }
      function handleButtonLeave() {
        if (unref(isVertical))
          return;
        items.value.forEach((item) => {
          item.states.hover = false;
        });
      }
      function handleIndicatorClick(index) {
        if (index !== activeIndex.value) {
          if (!isFirstCall.value) {
            isTransitioning.value = true;
          }
        }
        activeIndex.value = index;
      }
      function handleIndicatorHover(index) {
        if (props2.trigger === "hover" && index !== activeIndex.value) {
          activeIndex.value = index;
          if (!isFirstCall.value) {
            isTransitioning.value = true;
          }
        }
      }
      function prev() {
        setActiveItem(activeIndex.value - 1);
      }
      function next() {
        setActiveItem(activeIndex.value + 1);
      }
      function resetTimer() {
        pauseTimer();
        if (!props2.pauseOnHover)
          startTimer();
      }
      function setContainerHeight(height) {
        if (props2.height !== "auto")
          return;
        containerHeight.value = height;
      }
      function PlaceholderItem() {
        var _a2;
        const defaultSlots = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
        if (!defaultSlots)
          return null;
        const flatSlots = flattedChildren(defaultSlots);
        const normalizeSlots = flatSlots.filter((slot) => {
          return isVNode(slot) && slot.type.name === CAROUSEL_ITEM_NAME;
        });
        if ((normalizeSlots == null ? void 0 : normalizeSlots.length) === 2 && props2.loop && !isCardType.value) {
          isItemsTwoLength.value = true;
          return normalizeSlots;
        }
        isItemsTwoLength.value = false;
        return null;
      }
      watch(() => activeIndex.value, (current, prev2) => {
        resetItemPosition(prev2);
        if (isItemsTwoLength.value) {
          current = current % 2;
          prev2 = prev2 % 2;
        }
        if (prev2 > -1) {
          emit2(CHANGE_EVENT, current, prev2);
        }
      });
      watch(() => props2.autoplay, (autoplay) => {
        autoplay ? startTimer() : pauseTimer();
      });
      watch(() => props2.loop, () => {
        setActiveItem(activeIndex.value);
      });
      watch(() => props2.interval, () => {
        resetTimer();
      });
      const resizeObserver = shallowRef();
      onMounted(() => {
        watch(() => items.value, () => {
          if (items.value.length > 0)
            setActiveItem(props2.initialIndex);
        }, {
          immediate: true
        });
        resizeObserver.value = useResizeObserver(root2.value, () => {
          resetItemPosition();
        });
        startTimer();
      });
      onBeforeUnmount(() => {
        pauseTimer();
        if (root2.value && resizeObserver.value)
          resizeObserver.value.stop();
      });
      provide(carouselContextKey, {
        root: root2,
        isCardType,
        isVertical,
        items,
        loop: props2.loop,
        cardScale: props2.cardScale,
        addItem,
        removeItem,
        setActiveItem,
        setContainerHeight
      });
      return {
        root: root2,
        activeIndex,
        arrowDisplay,
        hasLabel,
        hover,
        isCardType,
        isTransitioning,
        items,
        isVertical,
        containerStyle,
        isItemsTwoLength,
        handleButtonEnter,
        handleTransitionEnd,
        handleButtonLeave,
        handleIndicatorClick,
        handleMouseEnter,
        handleMouseLeave,
        setActiveItem,
        prev,
        next,
        PlaceholderItem,
        isTwoLengthShow,
        throttledArrowClick,
        throttledIndicatorHover
      };
    };
    const COMPONENT_NAME$i = "ElCarousel";
    const __default__$1x = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$i
    });
    const _sfc_main$2e = /* @__PURE__ */ defineComponent({
      ...__default__$1x,
      props: carouselProps,
      emits: carouselEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const {
          root: root2,
          activeIndex,
          arrowDisplay,
          hasLabel,
          hover,
          isCardType,
          items,
          isVertical,
          containerStyle,
          handleButtonEnter,
          handleButtonLeave,
          isTransitioning,
          handleIndicatorClick,
          handleMouseEnter,
          handleMouseLeave,
          handleTransitionEnd,
          setActiveItem,
          prev,
          next,
          PlaceholderItem,
          isTwoLengthShow,
          throttledArrowClick,
          throttledIndicatorHover
        } = useCarousel(props2, emit2);
        const ns = useNamespace("carousel");
        const { t } = useLocale();
        const carouselClasses = computed(() => {
          const classes = [ns.b(), ns.m(props2.direction)];
          if (unref(isCardType)) {
            classes.push(ns.m("card"));
          }
          return classes;
        });
        const carouselContainer = computed(() => {
          const classes = [ns.e("container")];
          if (props2.motionBlur && unref(isTransitioning) && items.value.length > 1) {
            classes.push(unref(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`);
          }
          return classes;
        });
        const indicatorsClasses = computed(() => {
          const classes = [ns.e("indicators"), ns.em("indicators", props2.direction)];
          if (unref(hasLabel)) {
            classes.push(ns.em("indicators", "labels"));
          }
          if (props2.indicatorPosition === "outside") {
            classes.push(ns.em("indicators", "outside"));
          }
          if (unref(isVertical)) {
            classes.push(ns.em("indicators", "right"));
          }
          return classes;
        });
        expose({
          activeIndex,
          setActiveItem,
          prev,
          next
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "root",
            ref: root2,
            class: normalizeClass(unref(carouselClasses)),
            onMouseenter: withModifiers(unref(handleMouseEnter), ["stop"]),
            onMouseleave: withModifiers(unref(handleMouseLeave), ["stop"])
          }, [
            unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
              key: 0,
              name: "carousel-arrow-left",
              persisted: ""
            }, {
              default: withCtx(() => [
                withDirectives(createBaseVNode("button", {
                  type: "button",
                  class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "left")]),
                  "aria-label": unref(t)("el.carousel.leftArrow"),
                  onMouseenter: ($event) => unref(handleButtonEnter)("left"),
                  onMouseleave: unref(handleButtonLeave),
                  onClick: withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) - 1), ["stop"])
                }, [
                  createVNode$1(unref(ElIcon), null, {
                    default: withCtx(() => [
                      createVNode$1(unref(arrow_left_default))
                    ]),
                    _: 1
                  })
                ], 42, ["aria-label", "onMouseenter", "onMouseleave", "onClick"]), [
                  [
                    vShow,
                    (_ctx.arrow === "always" || unref(hover)) && (props2.loop || unref(activeIndex) > 0)
                  ]
                ])
              ]),
              _: 1
            })) : createCommentVNode("v-if", true),
            unref(arrowDisplay) ? (openBlock(), createBlock(Transition, {
              key: 1,
              name: "carousel-arrow-right",
              persisted: ""
            }, {
              default: withCtx(() => [
                withDirectives(createBaseVNode("button", {
                  type: "button",
                  class: normalizeClass([unref(ns).e("arrow"), unref(ns).em("arrow", "right")]),
                  "aria-label": unref(t)("el.carousel.rightArrow"),
                  onMouseenter: ($event) => unref(handleButtonEnter)("right"),
                  onMouseleave: unref(handleButtonLeave),
                  onClick: withModifiers(($event) => unref(throttledArrowClick)(unref(activeIndex) + 1), ["stop"])
                }, [
                  createVNode$1(unref(ElIcon), null, {
                    default: withCtx(() => [
                      createVNode$1(unref(arrow_right_default))
                    ]),
                    _: 1
                  })
                ], 42, ["aria-label", "onMouseenter", "onMouseleave", "onClick"]), [
                  [
                    vShow,
                    (_ctx.arrow === "always" || unref(hover)) && (props2.loop || unref(activeIndex) < unref(items).length - 1)
                  ]
                ])
              ]),
              _: 1
            })) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(carouselContainer)),
              style: normalizeStyle$1(unref(containerStyle)),
              onTransitionend: unref(handleTransitionEnd)
            }, [
              createVNode$1(unref(PlaceholderItem)),
              renderSlot(_ctx.$slots, "default")
            ], 46, ["onTransitionend"]),
            _ctx.indicatorPosition !== "none" ? (openBlock(), createElementBlock("ul", {
              key: 2,
              class: normalizeClass(unref(indicatorsClasses))
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item, index) => {
                return withDirectives((openBlock(), createElementBlock("li", {
                  key: index,
                  class: normalizeClass([
                    unref(ns).e("indicator"),
                    unref(ns).em("indicator", _ctx.direction),
                    unref(ns).is("active", index === unref(activeIndex))
                  ]),
                  onMouseenter: ($event) => unref(throttledIndicatorHover)(index),
                  onClick: withModifiers(($event) => unref(handleIndicatorClick)(index), ["stop"])
                }, [
                  createBaseVNode("button", {
                    class: normalizeClass(unref(ns).e("button")),
                    "aria-label": unref(t)("el.carousel.indicator", { index: index + 1 })
                  }, [
                    unref(hasLabel) ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(item.props.label), 1)) : createCommentVNode("v-if", true)
                  ], 10, ["aria-label"])
                ], 42, ["onMouseenter", "onClick"])), [
                  [vShow, unref(isTwoLengthShow)(index)]
                ]);
              }), 128))
            ], 2)) : createCommentVNode("v-if", true),
            props2.motionBlur ? (openBlock(), createElementBlock("svg", {
              key: 3,
              xmlns: "http://www.w3.org/2000/svg",
              version: "1.1",
              style: { "display": "none" }
            }, [
              createBaseVNode("defs", null, [
                createBaseVNode("filter", { id: "elCarouselHorizontal" }, [
                  createBaseVNode("feGaussianBlur", {
                    in: "SourceGraphic",
                    stdDeviation: "12,0"
                  })
                ]),
                createBaseVNode("filter", { id: "elCarouselVertical" }, [
                  createBaseVNode("feGaussianBlur", {
                    in: "SourceGraphic",
                    stdDeviation: "0,10"
                  })
                ])
              ])
            ])) : createCommentVNode("v-if", true)
          ], 42, ["onMouseenter", "onMouseleave"]);
        };
      }
    });
    var Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["__file", "carousel.vue"]]);
    const carouselItemProps = buildProps({
      name: { type: String, default: "" },
      label: {
        type: [String, Number],
        default: ""
      }
    });
    const useCarouselItem = (props2) => {
      const carouselContext = inject(carouselContextKey);
      const instance = getCurrentInstance();
      const carouselItemRef = ref();
      const hover = ref(false);
      const translate2 = ref(0);
      const scale2 = ref(1);
      const active = ref(false);
      const ready = ref(false);
      const inStage = ref(false);
      const animating = ref(false);
      const { isCardType, isVertical, cardScale } = carouselContext;
      function processIndex(index, activeIndex, length) {
        const lastItemIndex = length - 1;
        const prevItemIndex = activeIndex - 1;
        const nextItemIndex = activeIndex + 1;
        const halfItemIndex = length / 2;
        if (activeIndex === 0 && index === lastItemIndex) {
          return -1;
        } else if (activeIndex === lastItemIndex && index === 0) {
          return length;
        } else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) {
          return length + 1;
        } else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) {
          return -2;
        }
        return index;
      }
      function calcCardTranslate(index, activeIndex) {
        var _a2, _b2;
        const parentWidth = unref(isVertical) ? ((_a2 = carouselContext.root.value) == null ? void 0 : _a2.offsetHeight) || 0 : ((_b2 = carouselContext.root.value) == null ? void 0 : _b2.offsetWidth) || 0;
        if (inStage.value) {
          return parentWidth * ((2 - cardScale) * (index - activeIndex) + 1) / 4;
        } else if (index < activeIndex) {
          return -(1 + cardScale) * parentWidth / 4;
        } else {
          return (3 + cardScale) * parentWidth / 4;
        }
      }
      function calcTranslate(index, activeIndex, isVertical2) {
        const rootEl = carouselContext.root.value;
        if (!rootEl)
          return 0;
        const distance2 = (isVertical2 ? rootEl.offsetHeight : rootEl.offsetWidth) || 0;
        return distance2 * (index - activeIndex);
      }
      const translateItem = (index, activeIndex, oldIndex) => {
        var _a2;
        const _isCardType = unref(isCardType);
        const carouselItemLength = (_a2 = carouselContext.items.value.length) != null ? _a2 : Number.NaN;
        const isActive = index === activeIndex;
        if (!_isCardType && !isUndefined$1(oldIndex)) {
          animating.value = isActive || index === oldIndex;
        }
        if (!isActive && carouselItemLength > 2 && carouselContext.loop) {
          index = processIndex(index, activeIndex, carouselItemLength);
        }
        const _isVertical = unref(isVertical);
        active.value = isActive;
        if (_isCardType) {
          inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1;
          translate2.value = calcCardTranslate(index, activeIndex);
          scale2.value = unref(active) ? 1 : cardScale;
        } else {
          translate2.value = calcTranslate(index, activeIndex, _isVertical);
        }
        ready.value = true;
        if (isActive && carouselItemRef.value) {
          carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight);
        }
      };
      function handleItemClick() {
        if (carouselContext && unref(isCardType)) {
          const index = carouselContext.items.value.findIndex(({ uid: uid2 }) => uid2 === instance.uid);
          carouselContext.setActiveItem(index);
        }
      }
      onMounted(() => {
        carouselContext.addItem({
          props: props2,
          states: reactive({
            hover,
            translate: translate2,
            scale: scale2,
            active,
            ready,
            inStage,
            animating
          }),
          uid: instance.uid,
          translateItem
        });
      });
      onUnmounted(() => {
        carouselContext.removeItem(instance.uid);
      });
      return {
        carouselItemRef,
        active,
        animating,
        hover,
        inStage,
        isVertical,
        translate: translate2,
        isCardType,
        scale: scale2,
        ready,
        handleItemClick
      };
    };
    const __default__$1w = /* @__PURE__ */ defineComponent({
      name: CAROUSEL_ITEM_NAME
    });
    const _sfc_main$2d = /* @__PURE__ */ defineComponent({
      ...__default__$1w,
      props: carouselItemProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("carousel");
        const {
          carouselItemRef,
          active,
          animating,
          hover,
          inStage,
          isVertical,
          translate: translate2,
          isCardType,
          scale: scale2,
          ready,
          handleItemClick
        } = useCarouselItem(props2);
        const itemKls = computed(() => [
          ns.e("item"),
          ns.is("active", active.value),
          ns.is("in-stage", inStage.value),
          ns.is("hover", hover.value),
          ns.is("animating", animating.value),
          {
            [ns.em("item", "card")]: isCardType.value,
            [ns.em("item", "card-vertical")]: isCardType.value && isVertical.value
          }
        ]);
        const itemStyle = computed(() => {
          const translateType = `translate${unref(isVertical) ? "Y" : "X"}`;
          const _translate = `${translateType}(${unref(translate2)}px)`;
          const _scale = `scale(${unref(scale2)})`;
          const transform2 = [_translate, _scale].join(" ");
          return {
            transform: transform2
          };
        });
        return (_ctx, _cache) => {
          return withDirectives((openBlock(), createElementBlock("div", {
            ref_key: "carouselItemRef",
            ref: carouselItemRef,
            class: normalizeClass(unref(itemKls)),
            style: normalizeStyle$1(unref(itemStyle)),
            onClick: unref(handleItemClick)
          }, [
            unref(isCardType) ? withDirectives((openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("mask"))
            }, null, 2)), [
              [vShow, !unref(active)]
            ]) : createCommentVNode("v-if", true),
            renderSlot(_ctx.$slots, "default")
          ], 14, ["onClick"])), [
            [vShow, unref(ready)]
          ]);
        };
      }
    });
    var CarouselItem = /* @__PURE__ */ _export_sfc(_sfc_main$2d, [["__file", "carousel-item.vue"]]);
    const ElCarousel = withInstall(Carousel, {
      CarouselItem
    });
    const ElCarouselItem = withNoopInstall(CarouselItem);
    const checkboxProps = {
      modelValue: {
        type: [Number, String, Boolean],
        default: void 0
      },
      label: {
        type: [String, Boolean, Number, Object],
        default: void 0
      },
      value: {
        type: [String, Boolean, Number, Object],
        default: void 0
      },
      indeterminate: Boolean,
      disabled: Boolean,
      checked: Boolean,
      name: {
        type: String,
        default: void 0
      },
      trueValue: {
        type: [String, Number],
        default: void 0
      },
      falseValue: {
        type: [String, Number],
        default: void 0
      },
      trueLabel: {
        type: [String, Number],
        default: void 0
      },
      falseLabel: {
        type: [String, Number],
        default: void 0
      },
      id: {
        type: String,
        default: void 0
      },
      border: Boolean,
      size: useSizeProp,
      tabindex: [String, Number],
      validateEvent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaControls"])
    };
    const checkboxEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val),
      change: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val)
    };
    const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
    const useCheckboxDisabled = ({
      model,
      isChecked
    }) => {
      const checkboxGroup = inject(checkboxGroupContextKey, void 0);
      const isLimitDisabled = computed(() => {
        var _a2, _b2;
        const max3 = (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a2.value;
        const min3 = (_b2 = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b2.value;
        return !isUndefined$1(max3) && model.value.length >= max3 && !isChecked.value || !isUndefined$1(min3) && model.value.length <= min3 && isChecked.value;
      });
      const isDisabled = useFormDisabled(computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.disabled.value) || isLimitDisabled.value));
      return {
        isDisabled,
        isLimitDisabled
      };
    };
    const useCheckboxEvent = (props2, {
      model,
      isLimitExceeded,
      hasOwnLabel,
      isDisabled,
      isLabeledByFormItem
    }) => {
      const checkboxGroup = inject(checkboxGroupContextKey, void 0);
      const { formItem } = useFormItem();
      const { emit: emit2 } = getCurrentInstance();
      function getLabeledValue(value) {
        var _a2, _b2, _c2, _d;
        return [true, props2.trueValue, props2.trueLabel].includes(value) ? (_b2 = (_a2 = props2.trueValue) != null ? _a2 : props2.trueLabel) != null ? _b2 : true : (_d = (_c2 = props2.falseValue) != null ? _c2 : props2.falseLabel) != null ? _d : false;
      }
      function emitChangeEvent(checked, e2) {
        emit2(CHANGE_EVENT, getLabeledValue(checked), e2);
      }
      function handleChange(e2) {
        if (isLimitExceeded.value)
          return;
        const target = e2.target;
        emit2(CHANGE_EVENT, getLabeledValue(target.checked), e2);
      }
      async function onClickRoot(e2) {
        if (isLimitExceeded.value)
          return;
        if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
          const eventTargets = e2.composedPath();
          const hasLabel = eventTargets.some((item) => item.tagName === "LABEL");
          if (!hasLabel) {
            model.value = getLabeledValue([false, props2.falseValue, props2.falseLabel].includes(model.value));
            await nextTick();
            emitChangeEvent(model.value, e2);
          }
        }
      }
      const validateEvent = computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props2.validateEvent);
      watch(() => props2.modelValue, () => {
        if (validateEvent.value) {
          formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
        }
      });
      return {
        handleChange,
        onClickRoot
      };
    };
    const useCheckboxModel = (props2) => {
      const selfModel = ref(false);
      const { emit: emit2 } = getCurrentInstance();
      const checkboxGroup = inject(checkboxGroupContextKey, void 0);
      const isGroup = computed(() => isUndefined$1(checkboxGroup) === false);
      const isLimitExceeded = ref(false);
      const model = computed({
        get() {
          var _a2, _b2;
          return isGroup.value ? (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a2.value : (_b2 = props2.modelValue) != null ? _b2 : selfModel.value;
        },
        set(val) {
          var _a2, _b2;
          if (isGroup.value && isArray$5(val)) {
            isLimitExceeded.value = ((_a2 = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a2.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value) && val.length > model.value.length;
            isLimitExceeded.value === false && ((_b2 = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b2.call(checkboxGroup, val));
          } else {
            emit2(UPDATE_MODEL_EVENT, val);
            selfModel.value = val;
          }
        }
      });
      return {
        model,
        isGroup,
        isLimitExceeded
      };
    };
    const useCheckboxStatus = (props2, slots, { model }) => {
      const checkboxGroup = inject(checkboxGroupContextKey, void 0);
      const isFocused = ref(false);
      const actualValue = computed(() => {
        if (!isPropAbsent(props2.value)) {
          return props2.value;
        }
        return props2.label;
      });
      const isChecked = computed(() => {
        const value = model.value;
        if (isBoolean$1(value)) {
          return value;
        } else if (isArray$5(value)) {
          if (isObject$7(actualValue.value)) {
            return value.map(toRaw).some((o2) => isEqual$1(o2, actualValue.value));
          } else {
            return value.map(toRaw).includes(actualValue.value);
          }
        } else if (value !== null && value !== void 0) {
          return value === props2.trueValue || value === props2.trueLabel;
        } else {
          return !!value;
        }
      });
      const checkboxButtonSize = useFormSize(computed(() => {
        var _a2;
        return (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a2.value;
      }), {
        prop: true
      });
      const checkboxSize = useFormSize(computed(() => {
        var _a2;
        return (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a2.value;
      }));
      const hasOwnLabel = computed(() => {
        return !!slots.default || !isPropAbsent(actualValue.value);
      });
      return {
        checkboxButtonSize,
        isChecked,
        isFocused,
        checkboxSize,
        hasOwnLabel,
        actualValue
      };
    };
    const useCheckbox = (props2, slots) => {
      const { formItem: elFormItem } = useFormItem();
      const { model, isGroup, isLimitExceeded } = useCheckboxModel(props2);
      const {
        isFocused,
        isChecked,
        checkboxButtonSize,
        checkboxSize,
        hasOwnLabel,
        actualValue
      } = useCheckboxStatus(props2, slots, { model });
      const { isDisabled } = useCheckboxDisabled({ model, isChecked });
      const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
        formItemContext: elFormItem,
        disableIdGeneration: hasOwnLabel,
        disableIdManagement: isGroup
      });
      const { handleChange, onClickRoot } = useCheckboxEvent(props2, {
        model,
        isLimitExceeded,
        hasOwnLabel,
        isDisabled,
        isLabeledByFormItem
      });
      const setStoreValue = () => {
        function addToStore() {
          var _a2, _b2;
          if (isArray$5(model.value) && !model.value.includes(actualValue.value)) {
            model.value.push(actualValue.value);
          } else {
            model.value = (_b2 = (_a2 = props2.trueValue) != null ? _a2 : props2.trueLabel) != null ? _b2 : true;
          }
        }
        props2.checked && addToStore();
      };
      setStoreValue();
      useDeprecated({
        from: "label act as value",
        replacement: "value",
        version: "3.0.0",
        scope: "el-checkbox",
        ref: "https://element-plus.org/en-US/component/checkbox.html"
      }, computed(() => isGroup.value && isPropAbsent(props2.value)));
      useDeprecated({
        from: "true-label",
        replacement: "true-value",
        version: "3.0.0",
        scope: "el-checkbox",
        ref: "https://element-plus.org/en-US/component/checkbox.html"
      }, computed(() => !!props2.trueLabel));
      useDeprecated({
        from: "false-label",
        replacement: "false-value",
        version: "3.0.0",
        scope: "el-checkbox",
        ref: "https://element-plus.org/en-US/component/checkbox.html"
      }, computed(() => !!props2.falseLabel));
      return {
        inputId,
        isLabeledByFormItem,
        isChecked,
        isDisabled,
        isFocused,
        checkboxButtonSize,
        checkboxSize,
        hasOwnLabel,
        model,
        actualValue,
        handleChange,
        onClickRoot
      };
    };
    const __default__$1v = /* @__PURE__ */ defineComponent({
      name: "ElCheckbox"
    });
    const _sfc_main$2c = /* @__PURE__ */ defineComponent({
      ...__default__$1v,
      props: checkboxProps,
      emits: checkboxEmits,
      setup(__props) {
        const props2 = __props;
        const slots = useSlots();
        const {
          inputId,
          isLabeledByFormItem,
          isChecked,
          isDisabled,
          isFocused,
          checkboxSize,
          hasOwnLabel,
          model,
          actualValue,
          handleChange,
          onClickRoot
        } = useCheckbox(props2, slots);
        const ns = useNamespace("checkbox");
        const compKls = computed(() => {
          return [
            ns.b(),
            ns.m(checkboxSize.value),
            ns.is("disabled", isDisabled.value),
            ns.is("bordered", props2.border),
            ns.is("checked", isChecked.value)
          ];
        });
        const spanKls = computed(() => {
          return [
            ns.e("input"),
            ns.is("disabled", isDisabled.value),
            ns.is("checked", isChecked.value),
            ns.is("indeterminate", props2.indeterminate),
            ns.is("focus", isFocused.value)
          ];
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
            class: normalizeClass(unref(compKls)),
            "aria-controls": _ctx.indeterminate ? _ctx.ariaControls : null,
            onClick: unref(onClickRoot)
          }, {
            default: withCtx(() => {
              var _a2, _b2, _c2, _d;
              return [
                createBaseVNode("span", {
                  class: normalizeClass(unref(spanKls))
                }, [
                  _ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
                    key: 0,
                    id: unref(inputId),
                    "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
                    class: normalizeClass(unref(ns).e("original")),
                    type: "checkbox",
                    indeterminate: _ctx.indeterminate,
                    name: _ctx.name,
                    tabindex: _ctx.tabindex,
                    disabled: unref(isDisabled),
                    "true-value": (_b2 = (_a2 = _ctx.trueValue) != null ? _a2 : _ctx.trueLabel) != null ? _b2 : true,
                    "false-value": (_d = (_c2 = _ctx.falseValue) != null ? _c2 : _ctx.falseLabel) != null ? _d : false,
                    onChange: unref(handleChange),
                    onFocus: ($event) => isFocused.value = true,
                    onBlur: ($event) => isFocused.value = false,
                    onClick: withModifiers(() => {
                    }, ["stop"])
                  }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
                    [vModelCheckbox, unref(model)]
                  ]) : withDirectives((openBlock(), createElementBlock("input", {
                    key: 1,
                    id: unref(inputId),
                    "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
                    class: normalizeClass(unref(ns).e("original")),
                    type: "checkbox",
                    indeterminate: _ctx.indeterminate,
                    disabled: unref(isDisabled),
                    value: unref(actualValue),
                    name: _ctx.name,
                    tabindex: _ctx.tabindex,
                    onChange: unref(handleChange),
                    onFocus: ($event) => isFocused.value = true,
                    onBlur: ($event) => isFocused.value = false,
                    onClick: withModifiers(() => {
                    }, ["stop"])
                  }, null, 42, ["id", "onUpdate:modelValue", "indeterminate", "disabled", "value", "name", "tabindex", "onChange", "onFocus", "onBlur", "onClick"])), [
                    [vModelCheckbox, unref(model)]
                  ]),
                  createBaseVNode("span", {
                    class: normalizeClass(unref(ns).e("inner"))
                  }, null, 2)
                ], 2),
                unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
                  key: 0,
                  class: normalizeClass(unref(ns).e("label"))
                }, [
                  renderSlot(_ctx.$slots, "default"),
                  !_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                    createTextVNode(toDisplayString(_ctx.label), 1)
                  ], 64)) : createCommentVNode("v-if", true)
                ], 2)) : createCommentVNode("v-if", true)
              ];
            }),
            _: 3
          }, 8, ["class", "aria-controls", "onClick"]);
        };
      }
    });
    var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["__file", "checkbox.vue"]]);
    const __default__$1u = /* @__PURE__ */ defineComponent({
      name: "ElCheckboxButton"
    });
    const _sfc_main$2b = /* @__PURE__ */ defineComponent({
      ...__default__$1u,
      props: checkboxProps,
      emits: checkboxEmits,
      setup(__props) {
        const props2 = __props;
        const slots = useSlots();
        const {
          isFocused,
          isChecked,
          isDisabled,
          checkboxButtonSize,
          model,
          actualValue,
          handleChange
        } = useCheckbox(props2, slots);
        const checkboxGroup = inject(checkboxGroupContextKey, void 0);
        const ns = useNamespace("checkbox");
        const activeStyle = computed(() => {
          var _a2, _b2, _c2, _d;
          const fillValue = (_b2 = (_a2 = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a2.value) != null ? _b2 : "";
          return {
            backgroundColor: fillValue,
            borderColor: fillValue,
            color: (_d = (_c2 = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _c2.value) != null ? _d : "",
            boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
          };
        });
        const labelKls = computed(() => {
          return [
            ns.b("button"),
            ns.bm("button", checkboxButtonSize.value),
            ns.is("disabled", isDisabled.value),
            ns.is("checked", isChecked.value),
            ns.is("focus", isFocused.value)
          ];
        });
        return (_ctx, _cache) => {
          var _a2, _b2, _c2, _d;
          return openBlock(), createElementBlock("label", {
            class: normalizeClass(unref(labelKls))
          }, [
            _ctx.trueValue || _ctx.falseValue || _ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
              key: 0,
              "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
              class: normalizeClass(unref(ns).be("button", "original")),
              type: "checkbox",
              name: _ctx.name,
              tabindex: _ctx.tabindex,
              disabled: unref(isDisabled),
              "true-value": (_b2 = (_a2 = _ctx.trueValue) != null ? _a2 : _ctx.trueLabel) != null ? _b2 : true,
              "false-value": (_d = (_c2 = _ctx.falseValue) != null ? _c2 : _ctx.falseLabel) != null ? _d : false,
              onChange: unref(handleChange),
              onFocus: ($event) => isFocused.value = true,
              onBlur: ($event) => isFocused.value = false,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "true-value", "false-value", "onChange", "onFocus", "onBlur", "onClick"])), [
              [vModelCheckbox, unref(model)]
            ]) : withDirectives((openBlock(), createElementBlock("input", {
              key: 1,
              "onUpdate:modelValue": ($event) => isRef(model) ? model.value = $event : null,
              class: normalizeClass(unref(ns).be("button", "original")),
              type: "checkbox",
              name: _ctx.name,
              tabindex: _ctx.tabindex,
              disabled: unref(isDisabled),
              value: unref(actualValue),
              onChange: unref(handleChange),
              onFocus: ($event) => isFocused.value = true,
              onBlur: ($event) => isFocused.value = false,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["onUpdate:modelValue", "name", "tabindex", "disabled", "value", "onChange", "onFocus", "onBlur", "onClick"])), [
              [vModelCheckbox, unref(model)]
            ]),
            _ctx.$slots.default || _ctx.label ? (openBlock(), createElementBlock("span", {
              key: 2,
              class: normalizeClass(unref(ns).be("button", "inner")),
              style: normalizeStyle$1(unref(isChecked) ? unref(activeStyle) : void 0)
            }, [
              renderSlot(_ctx.$slots, "default", {}, () => [
                createTextVNode(toDisplayString(_ctx.label), 1)
              ])
            ], 6)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var CheckboxButton = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["__file", "checkbox-button.vue"]]);
    const checkboxGroupProps = buildProps({
      modelValue: {
        type: definePropType(Array),
        default: () => []
      },
      disabled: Boolean,
      min: Number,
      max: Number,
      size: useSizeProp,
      fill: String,
      textColor: String,
      tag: {
        type: String,
        default: "div"
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaLabel"])
    });
    const checkboxGroupEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isArray$5(val),
      change: (val) => isArray$5(val)
    };
    const __default__$1t = /* @__PURE__ */ defineComponent({
      name: "ElCheckboxGroup"
    });
    const _sfc_main$2a = /* @__PURE__ */ defineComponent({
      ...__default__$1t,
      props: checkboxGroupProps,
      emits: checkboxGroupEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("checkbox");
        const { formItem } = useFormItem();
        const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext: formItem
        });
        const changeEvent = async (value) => {
          emit2(UPDATE_MODEL_EVENT, value);
          await nextTick();
          emit2(CHANGE_EVENT, value);
        };
        const modelValue = computed({
          get() {
            return props2.modelValue;
          },
          set(val) {
            changeEvent(val);
          }
        });
        provide(checkboxGroupContextKey, {
          ...pick(toRefs(props2), [
            "size",
            "min",
            "max",
            "disabled",
            "validateEvent",
            "fill",
            "textColor"
          ]),
          modelValue,
          changeEvent
        });
        watch(() => props2.modelValue, () => {
          if (props2.validateEvent) {
            formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
          }
        });
        return (_ctx, _cache) => {
          var _a2;
          return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
            id: unref(groupId),
            class: normalizeClass(unref(ns).b("group")),
            role: "group",
            "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "checkbox-group" : void 0,
            "aria-labelledby": unref(isLabeledByFormItem) ? (_a2 = unref(formItem)) == null ? void 0 : _a2.labelId : void 0
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
        };
      }
    });
    var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$2a, [["__file", "checkbox-group.vue"]]);
    const ElCheckbox = withInstall(Checkbox, {
      CheckboxButton,
      CheckboxGroup
    });
    const ElCheckboxButton = withNoopInstall(CheckboxButton);
    const ElCheckboxGroup$1 = withNoopInstall(CheckboxGroup);
    const radioPropsBase = buildProps({
      modelValue: {
        type: [String, Number, Boolean],
        default: void 0
      },
      size: useSizeProp,
      disabled: Boolean,
      label: {
        type: [String, Number, Boolean],
        default: void 0
      },
      value: {
        type: [String, Number, Boolean],
        default: void 0
      },
      name: {
        type: String,
        default: void 0
      }
    });
    const radioProps = buildProps({
      ...radioPropsBase,
      border: Boolean
    });
    const radioEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val),
      [CHANGE_EVENT]: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val)
    };
    const radioGroupKey = Symbol("radioGroupKey");
    const useRadio = (props2, emit2) => {
      const radioRef = ref();
      const radioGroup = inject(radioGroupKey, void 0);
      const isGroup = computed(() => !!radioGroup);
      const actualValue = computed(() => {
        if (!isPropAbsent(props2.value)) {
          return props2.value;
        }
        return props2.label;
      });
      const modelValue = computed({
        get() {
          return isGroup.value ? radioGroup.modelValue : props2.modelValue;
        },
        set(val) {
          if (isGroup.value) {
            radioGroup.changeEvent(val);
          } else {
            emit2 && emit2(UPDATE_MODEL_EVENT, val);
          }
          radioRef.value.checked = props2.modelValue === actualValue.value;
        }
      });
      const size = useFormSize(computed(() => radioGroup == null ? void 0 : radioGroup.size));
      const disabled = useFormDisabled(computed(() => radioGroup == null ? void 0 : radioGroup.disabled));
      const focus = ref(false);
      const tabIndex = computed(() => {
        return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0;
      });
      useDeprecated({
        from: "label act as value",
        replacement: "value",
        version: "3.0.0",
        scope: "el-radio",
        ref: "https://element-plus.org/en-US/component/radio.html"
      }, computed(() => isGroup.value && isPropAbsent(props2.value)));
      return {
        radioRef,
        isGroup,
        radioGroup,
        focus,
        size,
        disabled,
        tabIndex,
        modelValue,
        actualValue
      };
    };
    const __default__$1s = /* @__PURE__ */ defineComponent({
      name: "ElRadio"
    });
    const _sfc_main$29 = /* @__PURE__ */ defineComponent({
      ...__default__$1s,
      props: radioProps,
      emits: radioEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("radio");
        const { radioRef, radioGroup, focus, size, disabled, modelValue, actualValue } = useRadio(props2, emit2);
        function handleChange() {
          nextTick(() => emit2(CHANGE_EVENT, modelValue.value));
        }
        return (_ctx, _cache) => {
          var _a2;
          return openBlock(), createElementBlock("label", {
            class: normalizeClass([
              unref(ns).b(),
              unref(ns).is("disabled", unref(disabled)),
              unref(ns).is("focus", unref(focus)),
              unref(ns).is("bordered", _ctx.border),
              unref(ns).is("checked", unref(modelValue) === unref(actualValue)),
              unref(ns).m(unref(size))
            ])
          }, [
            createBaseVNode("span", {
              class: normalizeClass([
                unref(ns).e("input"),
                unref(ns).is("disabled", unref(disabled)),
                unref(ns).is("checked", unref(modelValue) === unref(actualValue))
              ])
            }, [
              withDirectives(createBaseVNode("input", {
                ref_key: "radioRef",
                ref: radioRef,
                "onUpdate:modelValue": ($event) => isRef(modelValue) ? modelValue.value = $event : null,
                class: normalizeClass(unref(ns).e("original")),
                value: unref(actualValue),
                name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
                disabled: unref(disabled),
                checked: unref(modelValue) === unref(actualValue),
                type: "radio",
                onFocus: ($event) => focus.value = true,
                onBlur: ($event) => focus.value = false,
                onChange: handleChange,
                onClick: withModifiers(() => {
                }, ["stop"])
              }, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "checked", "onFocus", "onBlur", "onClick"]), [
                [vModelRadio, unref(modelValue)]
              ]),
              createBaseVNode("span", {
                class: normalizeClass(unref(ns).e("inner"))
              }, null, 2)
            ], 2),
            createBaseVNode("span", {
              class: normalizeClass(unref(ns).e("label")),
              onKeydown: withModifiers(() => {
              }, ["stop"])
            }, [
              renderSlot(_ctx.$slots, "default", {}, () => [
                createTextVNode(toDisplayString(_ctx.label), 1)
              ])
            ], 42, ["onKeydown"])
          ], 2);
        };
      }
    });
    var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$29, [["__file", "radio.vue"]]);
    const radioButtonProps = buildProps({
      ...radioPropsBase
    });
    const __default__$1r = /* @__PURE__ */ defineComponent({
      name: "ElRadioButton"
    });
    const _sfc_main$28 = /* @__PURE__ */ defineComponent({
      ...__default__$1r,
      props: radioButtonProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("radio");
        const { radioRef, focus, size, disabled, modelValue, radioGroup, actualValue } = useRadio(props2);
        const activeStyle = computed(() => {
          return {
            backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
            borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
            boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
            color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
          };
        });
        return (_ctx, _cache) => {
          var _a2;
          return openBlock(), createElementBlock("label", {
            class: normalizeClass([
              unref(ns).b("button"),
              unref(ns).is("active", unref(modelValue) === unref(actualValue)),
              unref(ns).is("disabled", unref(disabled)),
              unref(ns).is("focus", unref(focus)),
              unref(ns).bm("button", unref(size))
            ])
          }, [
            withDirectives(createBaseVNode("input", {
              ref_key: "radioRef",
              ref: radioRef,
              "onUpdate:modelValue": ($event) => isRef(modelValue) ? modelValue.value = $event : null,
              class: normalizeClass(unref(ns).be("button", "original-radio")),
              value: unref(actualValue),
              type: "radio",
              name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
              disabled: unref(disabled),
              onFocus: ($event) => focus.value = true,
              onBlur: ($event) => focus.value = false,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["onUpdate:modelValue", "value", "name", "disabled", "onFocus", "onBlur", "onClick"]), [
              [vModelRadio, unref(modelValue)]
            ]),
            createBaseVNode("span", {
              class: normalizeClass(unref(ns).be("button", "inner")),
              style: normalizeStyle$1(unref(modelValue) === unref(actualValue) ? unref(activeStyle) : {}),
              onKeydown: withModifiers(() => {
              }, ["stop"])
            }, [
              renderSlot(_ctx.$slots, "default", {}, () => [
                createTextVNode(toDisplayString(_ctx.label), 1)
              ])
            ], 46, ["onKeydown"])
          ], 2);
        };
      }
    });
    var RadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$28, [["__file", "radio-button.vue"]]);
    const radioGroupProps = buildProps({
      id: {
        type: String,
        default: void 0
      },
      size: useSizeProp,
      disabled: Boolean,
      modelValue: {
        type: [String, Number, Boolean],
        default: void 0
      },
      fill: {
        type: String,
        default: ""
      },
      textColor: {
        type: String,
        default: ""
      },
      name: {
        type: String,
        default: void 0
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaLabel"])
    });
    const radioGroupEmits = radioEmits;
    const __default__$1q = /* @__PURE__ */ defineComponent({
      name: "ElRadioGroup"
    });
    const _sfc_main$27 = /* @__PURE__ */ defineComponent({
      ...__default__$1q,
      props: radioGroupProps,
      emits: radioGroupEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("radio");
        const radioId = useId();
        const radioGroupRef = ref();
        const { formItem } = useFormItem();
        const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext: formItem
        });
        const changeEvent = (value) => {
          emit2(UPDATE_MODEL_EVENT, value);
          nextTick(() => emit2(CHANGE_EVENT, value));
        };
        onMounted(() => {
          const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
          const firstLabel = radios[0];
          if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
            firstLabel.tabIndex = 0;
          }
        });
        const name = computed(() => {
          return props2.name || radioId.value;
        });
        provide(radioGroupKey, reactive({
          ...toRefs(props2),
          changeEvent,
          name
        }));
        watch(() => props2.modelValue, () => {
          if (props2.validateEvent) {
            formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
          }
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            id: unref(groupId),
            ref_key: "radioGroupRef",
            ref: radioGroupRef,
            class: normalizeClass(unref(ns).b("group")),
            role: "radiogroup",
            "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "radio-group" : void 0,
            "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 10, ["id", "aria-label", "aria-labelledby"]);
        };
      }
    });
    var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$27, [["__file", "radio-group.vue"]]);
    const ElRadio = withInstall(Radio, {
      RadioButton,
      RadioGroup
    });
    const ElRadioGroup = withNoopInstall(RadioGroup);
    const ElRadioButton = withNoopInstall(RadioButton);
    var NodeContent$1 = /* @__PURE__ */ defineComponent({
      name: "NodeContent",
      setup() {
        const ns = useNamespace("cascader-node");
        return {
          ns
        };
      },
      render() {
        const { ns } = this;
        const { node, panel } = this.$parent;
        const { data, label } = node;
        const { renderLabelFn } = panel;
        return h$1("span", { class: ns.e("label") }, renderLabelFn ? renderLabelFn({ node, data }) : label);
      }
    });
    const CASCADER_PANEL_INJECTION_KEY = Symbol();
    const _sfc_main$26 = /* @__PURE__ */ defineComponent({
      name: "ElCascaderNode",
      components: {
        ElCheckbox,
        ElRadio,
        NodeContent: NodeContent$1,
        ElIcon,
        Check: check_default,
        Loading: loading_default,
        ArrowRight: arrow_right_default
      },
      props: {
        node: {
          type: Object,
          required: true
        },
        menuId: String
      },
      emits: ["expand"],
      setup(props2, { emit: emit2 }) {
        const panel = inject(CASCADER_PANEL_INJECTION_KEY);
        const ns = useNamespace("cascader-node");
        const isHoverMenu = computed(() => panel.isHoverMenu);
        const multiple = computed(() => panel.config.multiple);
        const checkStrictly = computed(() => panel.config.checkStrictly);
        const checkedNodeId = computed(() => {
          var _a2;
          return (_a2 = panel.checkedNodes[0]) == null ? void 0 : _a2.uid;
        });
        const isDisabled = computed(() => props2.node.isDisabled);
        const isLeaf2 = computed(() => props2.node.isLeaf);
        const expandable = computed(() => checkStrictly.value && !isLeaf2.value || !isDisabled.value);
        const inExpandingPath = computed(() => isInPath(panel.expandingNode));
        const inCheckedPath = computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
        const isInPath = (node) => {
          var _a2;
          const { level, uid: uid2 } = props2.node;
          return ((_a2 = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a2.uid) === uid2;
        };
        const doExpand = () => {
          if (inExpandingPath.value)
            return;
          panel.expandNode(props2.node);
        };
        const doCheck = (checked) => {
          const { node } = props2;
          if (checked === node.checked)
            return;
          panel.handleCheckChange(node, checked);
        };
        const doLoad = () => {
          panel.lazyLoad(props2.node, () => {
            if (!isLeaf2.value)
              doExpand();
          });
        };
        const handleHoverExpand = (e2) => {
          if (!isHoverMenu.value)
            return;
          handleExpand();
          !isLeaf2.value && emit2("expand", e2);
        };
        const handleExpand = () => {
          const { node } = props2;
          if (!expandable.value || node.loading)
            return;
          node.loaded ? doExpand() : doLoad();
        };
        const handleClick = () => {
          if (isHoverMenu.value && !isLeaf2.value)
            return;
          if (isLeaf2.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
            handleCheck(true);
          } else {
            handleExpand();
          }
        };
        const handleSelectCheck = (checked) => {
          if (checkStrictly.value) {
            doCheck(checked);
            if (props2.node.loaded) {
              doExpand();
            }
          } else {
            handleCheck(checked);
          }
        };
        const handleCheck = (checked) => {
          if (!props2.node.loaded) {
            doLoad();
          } else {
            doCheck(checked);
            !checkStrictly.value && doExpand();
          }
        };
        return {
          panel,
          isHoverMenu,
          multiple,
          checkStrictly,
          checkedNodeId,
          isDisabled,
          isLeaf: isLeaf2,
          expandable,
          inExpandingPath,
          inCheckedPath,
          ns,
          handleHoverExpand,
          handleExpand,
          handleClick,
          handleCheck,
          handleSelectCheck
        };
      }
    });
    function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_el_radio = resolveComponent("el-radio");
      const _component_check = resolveComponent("check");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_node_content = resolveComponent("node-content");
      const _component_loading = resolveComponent("loading");
      const _component_arrow_right = resolveComponent("arrow-right");
      return openBlock(), createElementBlock("li", {
        id: `${_ctx.menuId}-${_ctx.node.uid}`,
        role: "menuitem",
        "aria-haspopup": !_ctx.isLeaf,
        "aria-owns": _ctx.isLeaf ? void 0 : _ctx.menuId,
        "aria-expanded": _ctx.inExpandingPath,
        tabindex: _ctx.expandable ? -1 : void 0,
        class: normalizeClass([
          _ctx.ns.b(),
          _ctx.ns.is("selectable", _ctx.checkStrictly),
          _ctx.ns.is("active", _ctx.node.checked),
          _ctx.ns.is("disabled", !_ctx.expandable),
          _ctx.inExpandingPath && "in-active-path",
          _ctx.inCheckedPath && "in-checked-path"
        ]),
        onMouseenter: _ctx.handleHoverExpand,
        onFocus: _ctx.handleHoverExpand,
        onClick: _ctx.handleClick
      }, [
        createCommentVNode(" prefix "),
        _ctx.multiple ? (openBlock(), createBlock(_component_el_checkbox, {
          key: 0,
          "model-value": _ctx.node.checked,
          indeterminate: _ctx.node.indeterminate,
          disabled: _ctx.isDisabled,
          onClick: withModifiers(() => {
          }, ["stop"]),
          "onUpdate:modelValue": _ctx.handleSelectCheck
        }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onUpdate:modelValue"])) : _ctx.checkStrictly ? (openBlock(), createBlock(_component_el_radio, {
          key: 1,
          "model-value": _ctx.checkedNodeId,
          label: _ctx.node.uid,
          disabled: _ctx.isDisabled,
          "onUpdate:modelValue": _ctx.handleSelectCheck,
          onClick: withModifiers(() => {
          }, ["stop"])
        }, {
          default: withCtx(() => [
            createCommentVNode("\n        Add an empty element to avoid render label,\n        do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n      "),
            createBaseVNode("span")
          ]),
          _: 1
        }, 8, ["model-value", "label", "disabled", "onUpdate:modelValue", "onClick"])) : _ctx.isLeaf && _ctx.node.checked ? (openBlock(), createBlock(_component_el_icon, {
          key: 2,
          class: normalizeClass(_ctx.ns.e("prefix"))
        }, {
          default: withCtx(() => [
            createVNode$1(_component_check)
          ]),
          _: 1
        }, 8, ["class"])) : createCommentVNode("v-if", true),
        createCommentVNode(" content "),
        createVNode$1(_component_node_content),
        createCommentVNode(" postfix "),
        !_ctx.isLeaf ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
          _ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, {
            key: 0,
            class: normalizeClass([_ctx.ns.is("loading"), _ctx.ns.e("postfix")])
          }, {
            default: withCtx(() => [
              createVNode$1(_component_loading)
            ]),
            _: 1
          }, 8, ["class"])) : (openBlock(), createBlock(_component_el_icon, {
            key: 1,
            class: normalizeClass(["arrow-right", _ctx.ns.e("postfix")])
          }, {
            default: withCtx(() => [
              createVNode$1(_component_arrow_right)
            ]),
            _: 1
          }, 8, ["class"]))
        ], 64)) : createCommentVNode("v-if", true)
      ], 42, ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex", "onMouseenter", "onFocus", "onClick"]);
    }
    var ElCascaderNode = /* @__PURE__ */ _export_sfc(_sfc_main$26, [["render", _sfc_render$w], ["__file", "node.vue"]]);
    const _sfc_main$25 = /* @__PURE__ */ defineComponent({
      name: "ElCascaderMenu",
      components: {
        Loading: loading_default,
        ElIcon,
        ElScrollbar,
        ElCascaderNode
      },
      props: {
        nodes: {
          type: Array,
          required: true
        },
        index: {
          type: Number,
          required: true
        }
      },
      setup(props2) {
        const instance = getCurrentInstance();
        const ns = useNamespace("cascader-menu");
        const { t } = useLocale();
        const id = useId();
        let activeNode = null;
        let hoverTimer = null;
        const panel = inject(CASCADER_PANEL_INJECTION_KEY);
        const hoverZone = ref(null);
        const isEmpty2 = computed(() => !props2.nodes.length);
        const isLoading = computed(() => !panel.initialLoaded);
        const menuId = computed(() => `${id.value}-${props2.index}`);
        const handleExpand = (e2) => {
          activeNode = e2.target;
        };
        const handleMouseMove = (e2) => {
          if (!panel.isHoverMenu || !activeNode || !hoverZone.value)
            return;
          if (activeNode.contains(e2.target)) {
            clearHoverTimer();
            const el = instance.vnode.el;
            const { left } = el.getBoundingClientRect();
            const { offsetWidth, offsetHeight } = el;
            const startX = e2.clientX - left;
            const top = activeNode.offsetTop;
            const bottom = top + activeNode.offsetHeight;
            hoverZone.value.innerHTML = `
          <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${top} L${offsetWidth} 0 V${top} Z" />
          <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${bottom} L${offsetWidth} ${offsetHeight} V${bottom} Z" />
        `;
          } else if (!hoverTimer) {
            hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
          }
        };
        const clearHoverTimer = () => {
          if (!hoverTimer)
            return;
          clearTimeout(hoverTimer);
          hoverTimer = null;
        };
        const clearHoverZone = () => {
          if (!hoverZone.value)
            return;
          hoverZone.value.innerHTML = "";
          clearHoverTimer();
        };
        return {
          ns,
          panel,
          hoverZone,
          isEmpty: isEmpty2,
          isLoading,
          menuId,
          t,
          handleExpand,
          handleMouseMove,
          clearHoverZone
        };
      }
    });
    function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_cascader_node = resolveComponent("el-cascader-node");
      const _component_loading = resolveComponent("loading");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      return openBlock(), createBlock(_component_el_scrollbar, {
        key: _ctx.menuId,
        tag: "ul",
        role: "menu",
        class: normalizeClass(_ctx.ns.b()),
        "wrap-class": _ctx.ns.e("wrap"),
        "view-class": [_ctx.ns.e("list"), _ctx.ns.is("empty", _ctx.isEmpty)],
        onMousemove: _ctx.handleMouseMove,
        onMouseleave: _ctx.clearHoverZone
      }, {
        default: withCtx(() => {
          var _a2;
          return [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.nodes, (node) => {
              return openBlock(), createBlock(_component_el_cascader_node, {
                key: node.uid,
                node,
                "menu-id": _ctx.menuId,
                onExpand: _ctx.handleExpand
              }, null, 8, ["node", "menu-id", "onExpand"]);
            }), 128)),
            _ctx.isLoading ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(_ctx.ns.e("empty-text"))
            }, [
              createVNode$1(_component_el_icon, {
                size: "14",
                class: normalizeClass(_ctx.ns.is("loading"))
              }, {
                default: withCtx(() => [
                  createVNode$1(_component_loading)
                ]),
                _: 1
              }, 8, ["class"]),
              createTextVNode(" " + toDisplayString(_ctx.t("el.cascader.loading")), 1)
            ], 2)) : _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(_ctx.ns.e("empty-text"))
            }, [
              renderSlot(_ctx.$slots, "empty", {}, () => [
                createTextVNode(toDisplayString(_ctx.t("el.cascader.noData")), 1)
              ])
            ], 2)) : ((_a2 = _ctx.panel) == null ? void 0 : _a2.isHoverMenu) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
              createCommentVNode(" eslint-disable-next-line vue/html-self-closing "),
              (openBlock(), createElementBlock("svg", {
                ref: "hoverZone",
                class: normalizeClass(_ctx.ns.e("hover-zone"))
              }, null, 2))
            ], 2112)) : createCommentVNode("v-if", true)
          ];
        }),
        _: 3
      }, 8, ["class", "wrap-class", "view-class", "onMousemove", "onMouseleave"]);
    }
    var ElCascaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$25, [["render", _sfc_render$v], ["__file", "menu.vue"]]);
    const escapeStringRegexp = (string2 = "") => string2.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
    const capitalize$1 = (str) => capitalize$2(str);
    let uid = 0;
    const calculatePathNodes = (node) => {
      const nodes = [node];
      let { parent: parent2 } = node;
      while (parent2) {
        nodes.unshift(parent2);
        parent2 = parent2.parent;
      }
      return nodes;
    };
    let Node$2 = class Node2 {
      constructor(data, config, parent2, root2 = false) {
        this.data = data;
        this.config = config;
        this.parent = parent2;
        this.root = root2;
        this.uid = uid++;
        this.checked = false;
        this.indeterminate = false;
        this.loading = false;
        const { value: valueKey, label: labelKey, children: childrenKey } = config;
        const childrenData = data[childrenKey];
        const pathNodes = calculatePathNodes(this);
        this.level = root2 ? 0 : parent2 ? parent2.level + 1 : 1;
        this.value = data[valueKey];
        this.label = data[labelKey];
        this.pathNodes = pathNodes;
        this.pathValues = pathNodes.map((node) => node.value);
        this.pathLabels = pathNodes.map((node) => node.label);
        this.childrenData = childrenData;
        this.children = (childrenData || []).map((child) => new Node2(child, config, this));
        this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
      }
      get isDisabled() {
        const { data, parent: parent2, config } = this;
        const { disabled, checkStrictly } = config;
        const isDisabled = isFunction$4(disabled) ? disabled(data, this) : !!data[disabled];
        return isDisabled || !checkStrictly && (parent2 == null ? void 0 : parent2.isDisabled);
      }
      get isLeaf() {
        const { data, config, childrenData, loaded } = this;
        const { lazy, leaf } = config;
        const isLeaf2 = isFunction$4(leaf) ? leaf(data, this) : data[leaf];
        return isUndefined$1(isLeaf2) ? lazy && !loaded ? false : !(isArray$5(childrenData) && childrenData.length) : !!isLeaf2;
      }
      get valueByOption() {
        return this.config.emitPath ? this.pathValues : this.value;
      }
      appendChild(childData) {
        const { childrenData, children } = this;
        const node = new Node2(childData, this.config, this);
        if (isArray$5(childrenData)) {
          childrenData.push(childData);
        } else {
          this.childrenData = [childData];
        }
        children.push(node);
        return node;
      }
      calcText(allLevels, separator) {
        const text = allLevels ? this.pathLabels.join(separator) : this.label;
        this.text = text;
        return text;
      }
      broadcast(event, ...args) {
        const handlerName = `onParent${capitalize$1(event)}`;
        this.children.forEach((child) => {
          if (child) {
            child.broadcast(event, ...args);
            child[handlerName] && child[handlerName](...args);
          }
        });
      }
      emit(event, ...args) {
        const { parent: parent2 } = this;
        const handlerName = `onChild${capitalize$1(event)}`;
        if (parent2) {
          parent2[handlerName] && parent2[handlerName](...args);
          parent2.emit(event, ...args);
        }
      }
      onParentCheck(checked) {
        if (!this.isDisabled) {
          this.setCheckState(checked);
        }
      }
      onChildCheck() {
        const { children } = this;
        const validChildren = children.filter((child) => !child.isDisabled);
        const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
        this.setCheckState(checked);
      }
      setCheckState(checked) {
        const totalNum = this.children.length;
        const checkedNum = this.children.reduce((c2, p2) => {
          const num = p2.checked ? 1 : p2.indeterminate ? 0.5 : 0;
          return c2 + num;
        }, 0);
        this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
        this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
      }
      doCheck(checked) {
        if (this.checked === checked)
          return;
        const { checkStrictly, multiple } = this.config;
        if (checkStrictly || !multiple) {
          this.checked = checked;
        } else {
          this.broadcast("check", checked);
          this.setCheckState(checked);
          this.emit("check");
        }
      }
    };
    const flatNodes = (nodes, leafOnly) => {
      return nodes.reduce((res, node) => {
        if (node.isLeaf) {
          res.push(node);
        } else {
          !leafOnly && res.push(node);
          res = res.concat(flatNodes(node.children, leafOnly));
        }
        return res;
      }, []);
    };
    let Store$1 = class Store {
      constructor(data, config) {
        this.config = config;
        const nodes = (data || []).map((nodeData) => new Node$2(nodeData, this.config));
        this.nodes = nodes;
        this.allNodes = flatNodes(nodes, false);
        this.leafNodes = flatNodes(nodes, true);
      }
      getNodes() {
        return this.nodes;
      }
      getFlattedNodes(leafOnly) {
        return leafOnly ? this.leafNodes : this.allNodes;
      }
      appendNode(nodeData, parentNode2) {
        const node = parentNode2 ? parentNode2.appendChild(nodeData) : new Node$2(nodeData, this.config);
        if (!parentNode2)
          this.nodes.push(node);
        this.appendAllNodesAndLeafNodes(node);
      }
      appendNodes(nodeDataList, parentNode2) {
        nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode2));
      }
      appendAllNodesAndLeafNodes(node) {
        this.allNodes.push(node);
        node.isLeaf && this.leafNodes.push(node);
        if (node.children) {
          node.children.forEach((subNode) => {
            this.appendAllNodesAndLeafNodes(subNode);
          });
        }
      }
      getNodeByValue(value, leafOnly = false) {
        if (!value && value !== 0)
          return null;
        const node = this.getFlattedNodes(leafOnly).find((node2) => isEqual$1(node2.value, value) || isEqual$1(node2.pathValues, value));
        return node || null;
      }
      getSameNode(node) {
        if (!node)
          return null;
        const node_ = this.getFlattedNodes(false).find(({ value, level }) => isEqual$1(node.value, value) && node.level === level);
        return node_ || null;
      }
    };
    const CommonProps = buildProps({
      modelValue: {
        type: definePropType([Number, String, Array])
      },
      options: {
        type: definePropType(Array),
        default: () => []
      },
      props: {
        type: definePropType(Object),
        default: () => ({})
      }
    });
    const DefaultProps = {
      expandTrigger: "click",
      multiple: false,
      checkStrictly: false,
      emitPath: true,
      lazy: false,
      lazyLoad: NOOP,
      value: "value",
      label: "label",
      children: "children",
      leaf: "leaf",
      disabled: "disabled",
      hoverThreshold: 500
    };
    const useCascaderConfig = (props2) => {
      return computed(() => ({
        ...DefaultProps,
        ...props2.props
      }));
    };
    const getMenuIndex = (el) => {
      if (!el)
        return 0;
      const pieces = el.id.split("-");
      return Number(pieces[pieces.length - 2]);
    };
    const checkNode = (el) => {
      if (!el)
        return;
      const input = el.querySelector("input");
      if (input) {
        input.click();
      } else if (isLeaf(el)) {
        el.click();
      }
    };
    const sortByOriginalOrder = (oldNodes, newNodes) => {
      const newNodesCopy = newNodes.slice(0);
      const newIds = newNodesCopy.map((node) => node.uid);
      const res = oldNodes.reduce((acc, item) => {
        const index = newIds.indexOf(item.uid);
        if (index > -1) {
          acc.push(item);
          newNodesCopy.splice(index, 1);
          newIds.splice(index, 1);
        }
        return acc;
      }, []);
      res.push(...newNodesCopy);
      return res;
    };
    const unique = (arr) => [...new Set(arr)];
    const castArray = (arr) => {
      if (!arr && arr !== 0)
        return [];
      return isArray$5(arr) ? arr : [arr];
    };
    const _sfc_main$24 = /* @__PURE__ */ defineComponent({
      name: "ElCascaderPanel",
      components: {
        ElCascaderMenu
      },
      props: {
        ...CommonProps,
        border: {
          type: Boolean,
          default: true
        },
        renderLabel: Function
      },
      emits: [UPDATE_MODEL_EVENT, CHANGE_EVENT, "close", "expand-change"],
      setup(props2, { emit: emit2, slots }) {
        let manualChecked = false;
        const ns = useNamespace("cascader");
        const config = useCascaderConfig(props2);
        let store2 = null;
        const initialLoaded = ref(true);
        const menuList = ref([]);
        const checkedValue = ref(null);
        const menus = ref([]);
        const expandingNode = ref(null);
        const checkedNodes = ref([]);
        const isHoverMenu = computed(() => config.value.expandTrigger === "hover");
        const renderLabelFn = computed(() => props2.renderLabel || slots.default);
        const initStore = () => {
          const { options } = props2;
          const cfg = config.value;
          manualChecked = false;
          store2 = new Store$1(options, cfg);
          menus.value = [store2.getNodes()];
          if (cfg.lazy && isEmpty(props2.options)) {
            initialLoaded.value = false;
            lazyLoad(void 0, (list) => {
              if (list) {
                store2 = new Store$1(list, cfg);
                menus.value = [store2.getNodes()];
              }
              initialLoaded.value = true;
              syncCheckedValue(false, true);
            });
          } else {
            syncCheckedValue(false, true);
          }
        };
        const lazyLoad = (node, cb) => {
          const cfg = config.value;
          node = node || new Node$2({}, cfg, void 0, true);
          node.loading = true;
          const resolve2 = (dataList) => {
            const _node = node;
            const parent2 = _node.root ? null : _node;
            dataList && (store2 == null ? void 0 : store2.appendNodes(dataList, parent2));
            _node.loading = false;
            _node.loaded = true;
            _node.childrenData = _node.childrenData || [];
            cb && cb(dataList);
          };
          cfg.lazyLoad(node, resolve2);
        };
        const expandNode = (node, silent) => {
          var _a2;
          const { level } = node;
          const newMenus = menus.value.slice(0, level);
          let newExpandingNode;
          if (node.isLeaf) {
            newExpandingNode = node.pathNodes[level - 2];
          } else {
            newExpandingNode = node;
            newMenus.push(node.children);
          }
          if (((_a2 = expandingNode.value) == null ? void 0 : _a2.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) {
            expandingNode.value = node;
            menus.value = newMenus;
            !silent && emit2("expand-change", (node == null ? void 0 : node.pathValues) || []);
          }
        };
        const handleCheckChange = (node, checked, emitClose = true) => {
          const { checkStrictly, multiple } = config.value;
          const oldNode = checkedNodes.value[0];
          manualChecked = true;
          !multiple && (oldNode == null ? void 0 : oldNode.doCheck(false));
          node.doCheck(checked);
          calculateCheckedValue();
          emitClose && !multiple && !checkStrictly && emit2("close");
          !emitClose && !multiple && !checkStrictly && expandParentNode(node);
        };
        const expandParentNode = (node) => {
          if (!node)
            return;
          node = node.parent;
          expandParentNode(node);
          node && expandNode(node);
        };
        const getFlattedNodes = (leafOnly) => {
          return store2 == null ? void 0 : store2.getFlattedNodes(leafOnly);
        };
        const getCheckedNodes = (leafOnly) => {
          var _a2;
          return (_a2 = getFlattedNodes(leafOnly)) == null ? void 0 : _a2.filter((node) => node.checked !== false);
        };
        const clearCheckedNodes = () => {
          checkedNodes.value.forEach((node) => node.doCheck(false));
          calculateCheckedValue();
          menus.value = menus.value.slice(0, 1);
          expandingNode.value = null;
          emit2("expand-change", []);
        };
        const calculateCheckedValue = () => {
          var _a2;
          const { checkStrictly, multiple } = config.value;
          const oldNodes = checkedNodes.value;
          const newNodes = getCheckedNodes(!checkStrictly);
          const nodes = sortByOriginalOrder(oldNodes, newNodes);
          const values = nodes.map((node) => node.valueByOption);
          checkedNodes.value = nodes;
          checkedValue.value = multiple ? values : (_a2 = values[0]) != null ? _a2 : null;
        };
        const syncCheckedValue = (loaded = false, forced = false) => {
          const { modelValue } = props2;
          const { lazy, multiple, checkStrictly } = config.value;
          const leafOnly = !checkStrictly;
          if (!initialLoaded.value || manualChecked || !forced && isEqual$1(modelValue, checkedValue.value))
            return;
          if (lazy && !loaded) {
            const values = unique(flattenDeep(castArray(modelValue)));
            const nodes = values.map((val) => store2 == null ? void 0 : store2.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
            if (nodes.length) {
              nodes.forEach((node) => {
                lazyLoad(node, () => syncCheckedValue(false, forced));
              });
            } else {
              syncCheckedValue(true, forced);
            }
          } else {
            const values = multiple ? castArray(modelValue) : [modelValue];
            const nodes = unique(values.map((val) => store2 == null ? void 0 : store2.getNodeByValue(val, leafOnly)));
            syncMenuState(nodes, forced);
            checkedValue.value = cloneDeep(modelValue);
          }
        };
        const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
          const { checkStrictly } = config.value;
          const oldNodes = checkedNodes.value;
          const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf));
          const oldExpandingNode = store2 == null ? void 0 : store2.getSameNode(expandingNode.value);
          const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
          if (newExpandingNode) {
            newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
          } else {
            expandingNode.value = null;
          }
          oldNodes.forEach((node) => node.doCheck(false));
          reactive(newNodes).forEach((node) => node.doCheck(true));
          checkedNodes.value = newNodes;
          nextTick(scrollToExpandingNode);
        };
        const scrollToExpandingNode = () => {
          if (!isClient)
            return;
          menuList.value.forEach((menu) => {
            const menuElement = menu == null ? void 0 : menu.$el;
            if (menuElement) {
              const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
              const activeNode = menuElement.querySelector(`.${ns.b("node")}.${ns.is("active")}`) || menuElement.querySelector(`.${ns.b("node")}.in-active-path`);
              scrollIntoView(container, activeNode);
            }
          });
        };
        const handleKeyDown = (e2) => {
          const target = e2.target;
          const { code } = e2;
          switch (code) {
            case EVENT_CODE.up:
            case EVENT_CODE.down: {
              e2.preventDefault();
              const distance2 = code === EVENT_CODE.up ? -1 : 1;
              focusNode(getSibling(target, distance2, `.${ns.b("node")}[tabindex="-1"]`));
              break;
            }
            case EVENT_CODE.left: {
              e2.preventDefault();
              const preMenu = menuList.value[getMenuIndex(target) - 1];
              const expandedNode = preMenu == null ? void 0 : preMenu.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
              focusNode(expandedNode);
              break;
            }
            case EVENT_CODE.right: {
              e2.preventDefault();
              const nextMenu = menuList.value[getMenuIndex(target) + 1];
              const firstNode = nextMenu == null ? void 0 : nextMenu.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
              focusNode(firstNode);
              break;
            }
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
              checkNode(target);
              break;
          }
        };
        provide(CASCADER_PANEL_INJECTION_KEY, reactive({
          config,
          expandingNode,
          checkedNodes,
          isHoverMenu,
          initialLoaded,
          renderLabelFn,
          lazyLoad,
          expandNode,
          handleCheckChange
        }));
        watch([config, () => props2.options], initStore, {
          deep: true,
          immediate: true
        });
        watch(() => props2.modelValue, () => {
          manualChecked = false;
          syncCheckedValue();
        }, {
          deep: true
        });
        watch(() => checkedValue.value, (val) => {
          if (!isEqual$1(val, props2.modelValue)) {
            emit2(UPDATE_MODEL_EVENT, val);
            emit2(CHANGE_EVENT, val);
          }
        });
        onBeforeUpdate(() => menuList.value = []);
        onMounted(() => !isEmpty(props2.modelValue) && syncCheckedValue());
        return {
          ns,
          menuList,
          menus,
          checkedNodes,
          handleKeyDown,
          handleCheckChange,
          getFlattedNodes,
          getCheckedNodes,
          clearCheckedNodes,
          calculateCheckedValue,
          scrollToExpandingNode
        };
      }
    });
    function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_cascader_menu = resolveComponent("el-cascader-menu");
      return openBlock(), createElementBlock("div", {
        class: normalizeClass([_ctx.ns.b("panel"), _ctx.ns.is("bordered", _ctx.border)]),
        onKeydown: _ctx.handleKeyDown
      }, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menus, (menu, index) => {
          return openBlock(), createBlock(_component_el_cascader_menu, {
            key: index,
            ref_for: true,
            ref: (item) => _ctx.menuList[index] = item,
            index,
            nodes: [...menu]
          }, {
            empty: withCtx(() => [
              renderSlot(_ctx.$slots, "empty")
            ]),
            _: 2
          }, 1032, ["index", "nodes"]);
        }), 128))
      ], 42, ["onKeydown"]);
    }
    var CascaderPanel = /* @__PURE__ */ _export_sfc(_sfc_main$24, [["render", _sfc_render$u], ["__file", "index.vue"]]);
    const ElCascaderPanel = withInstall(CascaderPanel);
    const tagProps = buildProps({
      type: {
        type: String,
        values: ["primary", "success", "info", "warning", "danger"],
        default: "primary"
      },
      closable: Boolean,
      disableTransitions: Boolean,
      hit: Boolean,
      color: String,
      size: {
        type: String,
        values: componentSizes
      },
      effect: {
        type: String,
        values: ["dark", "light", "plain"],
        default: "light"
      },
      round: Boolean
    });
    const tagEmits = {
      close: (evt) => evt instanceof MouseEvent,
      click: (evt) => evt instanceof MouseEvent
    };
    const __default__$1p = /* @__PURE__ */ defineComponent({
      name: "ElTag"
    });
    const _sfc_main$23 = /* @__PURE__ */ defineComponent({
      ...__default__$1p,
      props: tagProps,
      emits: tagEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const tagSize = useFormSize();
        const ns = useNamespace("tag");
        const containerKls = computed(() => {
          const { type, hit, effect, closable, round: round2 } = props2;
          return [
            ns.b(),
            ns.is("closable", closable),
            ns.m(type || "primary"),
            ns.m(tagSize.value),
            ns.m(effect),
            ns.is("hit", hit),
            ns.is("round", round2)
          ];
        });
        const handleClose = (event) => {
          emit2("close", event);
        };
        const handleClick = (event) => {
          emit2("click", event);
        };
        const handleVNodeMounted = (vnode) => {
          var _a2, _b2, _c2;
          if ((_c2 = (_b2 = (_a2 = vnode == null ? void 0 : vnode.component) == null ? void 0 : _a2.subTree) == null ? void 0 : _b2.component) == null ? void 0 : _c2.bum) {
            vnode.component.subTree.component.bum = null;
          }
        };
        return (_ctx, _cache) => {
          return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
            key: 0,
            class: normalizeClass(unref(containerKls)),
            style: normalizeStyle$1({ backgroundColor: _ctx.color }),
            onClick: handleClick
          }, [
            createBaseVNode("span", {
              class: normalizeClass(unref(ns).e("content"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2),
            _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
              key: 0,
              class: normalizeClass(unref(ns).e("close")),
              onClick: withModifiers(handleClose, ["stop"])
            }, {
              default: withCtx(() => [
                createVNode$1(unref(close_default))
              ]),
              _: 1
            }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
          ], 6)) : (openBlock(), createBlock(Transition, {
            key: 1,
            name: `${unref(ns).namespace.value}-zoom-in-center`,
            appear: "",
            onVnodeMounted: handleVNodeMounted
          }, {
            default: withCtx(() => [
              createBaseVNode("span", {
                class: normalizeClass(unref(containerKls)),
                style: normalizeStyle$1({ backgroundColor: _ctx.color }),
                onClick: handleClick
              }, [
                createBaseVNode("span", {
                  class: normalizeClass(unref(ns).e("content"))
                }, [
                  renderSlot(_ctx.$slots, "default")
                ], 2),
                _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 0,
                  class: normalizeClass(unref(ns).e("close")),
                  onClick: withModifiers(handleClose, ["stop"])
                }, {
                  default: withCtx(() => [
                    createVNode$1(unref(close_default))
                  ]),
                  _: 1
                }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
              ], 6)
            ]),
            _: 3
          }, 8, ["name"]));
        };
      }
    });
    var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$23, [["__file", "tag.vue"]]);
    const ElTag = withInstall(Tag);
    const cascaderProps = buildProps({
      ...CommonProps,
      size: useSizeProp,
      placeholder: String,
      disabled: Boolean,
      clearable: Boolean,
      filterable: Boolean,
      filterMethod: {
        type: definePropType(Function),
        default: (node, keyword) => node.text.includes(keyword)
      },
      separator: {
        type: String,
        default: " / "
      },
      showAllLevels: {
        type: Boolean,
        default: true
      },
      collapseTags: Boolean,
      maxCollapseTags: {
        type: Number,
        default: 1
      },
      collapseTagsTooltip: {
        type: Boolean,
        default: false
      },
      debounce: {
        type: Number,
        default: 300
      },
      beforeFilter: {
        type: definePropType(Function),
        default: () => true
      },
      placement: {
        type: definePropType(String),
        values: Ee,
        default: "bottom-start"
      },
      fallbackPlacements: {
        type: definePropType(Array),
        default: ["bottom-start", "bottom", "top-start", "top", "right", "left"]
      },
      popperClass: {
        type: String,
        default: ""
      },
      teleported: useTooltipContentProps.teleported,
      tagType: { ...tagProps.type, default: "info" },
      tagEffect: { ...tagProps.effect, default: "light" },
      validateEvent: {
        type: Boolean,
        default: true
      },
      persistent: {
        type: Boolean,
        default: true
      },
      ...useEmptyValuesProps
    });
    const cascaderEmits = {
      [UPDATE_MODEL_EVENT]: (_2) => true,
      [CHANGE_EVENT]: (_2) => true,
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent,
      clear: () => true,
      visibleChange: (val) => isBoolean$1(val),
      expandChange: (val) => !!val,
      removeTag: (val) => !!val
    };
    const nodeList = /* @__PURE__ */ new Map();
    if (isClient) {
      let startClick;
      document.addEventListener("mousedown", (e2) => startClick = e2);
      document.addEventListener("mouseup", (e2) => {
        if (startClick) {
          for (const handlers2 of nodeList.values()) {
            for (const { documentHandler } of handlers2) {
              documentHandler(e2, startClick);
            }
          }
          startClick = void 0;
        }
      });
    }
    function createDocumentHandler(el, binding) {
      let excludes = [];
      if (isArray$5(binding.arg)) {
        excludes = binding.arg;
      } else if (isElement$1(binding.arg)) {
        excludes.push(binding.arg);
      }
      return function(mouseup, mousedown) {
        const popperRef = binding.instance.popperRef;
        const mouseUpTarget = mouseup.target;
        const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
        const isBound = !binding || !binding.instance;
        const isTargetExists = !mouseUpTarget || !mouseDownTarget;
        const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
        const isSelf = el === mouseUpTarget;
        const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
        const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
        if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
          return;
        }
        binding.value(mouseup, mousedown);
      };
    }
    const ClickOutside = {
      beforeMount(el, binding) {
        if (!nodeList.has(el)) {
          nodeList.set(el, []);
        }
        nodeList.get(el).push({
          documentHandler: createDocumentHandler(el, binding),
          bindingFn: binding.value
        });
      },
      updated(el, binding) {
        if (!nodeList.has(el)) {
          nodeList.set(el, []);
        }
        const handlers2 = nodeList.get(el);
        const oldHandlerIndex = handlers2.findIndex((item) => item.bindingFn === binding.oldValue);
        const newHandler = {
          documentHandler: createDocumentHandler(el, binding),
          bindingFn: binding.value
        };
        if (oldHandlerIndex >= 0) {
          handlers2.splice(oldHandlerIndex, 1, newHandler);
        } else {
          handlers2.push(newHandler);
        }
      },
      unmounted(el) {
        nodeList.delete(el);
      }
    };
    const COMPONENT_NAME$h = "ElCascader";
    const __default__$1o = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$h
    });
    const _sfc_main$22 = /* @__PURE__ */ defineComponent({
      ...__default__$1o,
      props: cascaderProps,
      emits: cascaderEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const popperOptions = {
          modifiers: [
            {
              name: "arrowPosition",
              enabled: true,
              phase: "main",
              fn: ({ state }) => {
                const { modifiersData, placement } = state;
                if (["right", "left", "bottom", "top"].includes(placement))
                  return;
                modifiersData.arrow.x = 35;
              },
              requires: ["arrow"]
            }
          ]
        };
        const attrs = useAttrs$1();
        let inputInitialHeight = 0;
        let pressDeleteCount = 0;
        const nsCascader = useNamespace("cascader");
        const nsInput = useNamespace("input");
        const { t } = useLocale();
        const { form, formItem } = useFormItem();
        const { valueOnClear } = useEmptyValues(props2);
        const { isComposing, handleComposition } = useComposition({
          afterComposition(event) {
            var _a2;
            const text = (_a2 = event.target) == null ? void 0 : _a2.value;
            handleInput(text);
          }
        });
        const tooltipRef = ref(null);
        const input = ref(null);
        const tagWrapper = ref(null);
        const cascaderPanelRef = ref(null);
        const suggestionPanel = ref(null);
        const popperVisible = ref(false);
        const inputHover = ref(false);
        const filtering = ref(false);
        const filterFocus = ref(false);
        const inputValue = ref("");
        const searchInputValue = ref("");
        const presentTags = ref([]);
        const allPresentTags = ref([]);
        const suggestions = ref([]);
        const cascaderStyle = computed(() => {
          return attrs.style;
        });
        const isDisabled = computed(() => props2.disabled || (form == null ? void 0 : form.disabled));
        const inputPlaceholder = computed(() => props2.placeholder || t("el.cascader.placeholder"));
        const currentPlaceholder = computed(() => searchInputValue.value || presentTags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value);
        const realSize = useFormSize();
        const tagSize = computed(() => realSize.value === "small" ? "small" : "default");
        const multiple = computed(() => !!props2.props.multiple);
        const readonly2 = computed(() => !props2.filterable || multiple.value);
        const searchKeyword = computed(() => multiple.value ? searchInputValue.value : inputValue.value);
        const checkedNodes = computed(() => {
          var _a2;
          return ((_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.checkedNodes) || [];
        });
        const clearBtnVisible = computed(() => {
          if (!props2.clearable || isDisabled.value || filtering.value || !inputHover.value)
            return false;
          return !!checkedNodes.value.length;
        });
        const presentText = computed(() => {
          const { showAllLevels, separator } = props2;
          const nodes = checkedNodes.value;
          return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
        });
        const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
        const checkedValue = computed({
          get() {
            return cloneDeep(props2.modelValue);
          },
          set(val) {
            const value = val != null ? val : valueOnClear.value;
            emit2(UPDATE_MODEL_EVENT, value);
            emit2(CHANGE_EVENT, value);
            if (props2.validateEvent) {
              formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
            }
          }
        });
        const cascaderKls = computed(() => {
          return [
            nsCascader.b(),
            nsCascader.m(realSize.value),
            nsCascader.is("disabled", isDisabled.value),
            attrs.class
          ];
        });
        const cascaderIconKls = computed(() => {
          return [
            nsInput.e("icon"),
            "icon-arrow-down",
            nsCascader.is("reverse", popperVisible.value)
          ];
        });
        const inputClass = computed(() => {
          return nsCascader.is("focus", popperVisible.value || filterFocus.value);
        });
        const contentRef = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef;
        });
        const togglePopperVisible = (visible) => {
          var _a2, _b2, _c2;
          if (isDisabled.value)
            return;
          visible = visible != null ? visible : !popperVisible.value;
          if (visible !== popperVisible.value) {
            popperVisible.value = visible;
            (_b2 = (_a2 = input.value) == null ? void 0 : _a2.input) == null ? void 0 : _b2.setAttribute("aria-expanded", `${visible}`);
            if (visible) {
              updatePopperPosition();
              nextTick((_c2 = cascaderPanelRef.value) == null ? void 0 : _c2.scrollToExpandingNode);
            } else if (props2.filterable) {
              syncPresentTextValue();
            }
            emit2("visibleChange", visible);
          }
        };
        const updatePopperPosition = () => {
          nextTick(() => {
            var _a2;
            (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper();
          });
        };
        const hideSuggestionPanel = () => {
          filtering.value = false;
        };
        const genTag2 = (node) => {
          const { showAllLevels, separator } = props2;
          return {
            node,
            key: node.uid,
            text: node.calcText(showAllLevels, separator),
            hitState: false,
            closable: !isDisabled.value && !node.isDisabled,
            isCollapseTag: false
          };
        };
        const deleteTag = (tag) => {
          var _a2;
          const node = tag.node;
          node.doCheck(false);
          (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.calculateCheckedValue();
          emit2("removeTag", node.valueByOption);
        };
        const calculatePresentTags = () => {
          if (!multiple.value)
            return;
          const nodes = checkedNodes.value;
          const tags = [];
          const allTags = [];
          nodes.forEach((node) => allTags.push(genTag2(node)));
          allPresentTags.value = allTags;
          if (nodes.length) {
            nodes.slice(0, props2.maxCollapseTags).forEach((node) => tags.push(genTag2(node)));
            const rest = nodes.slice(props2.maxCollapseTags);
            const restCount = rest.length;
            if (restCount) {
              if (props2.collapseTags) {
                tags.push({
                  key: -1,
                  text: `+ ${restCount}`,
                  closable: false,
                  isCollapseTag: true
                });
              } else {
                rest.forEach((node) => tags.push(genTag2(node)));
              }
            }
          }
          presentTags.value = tags;
        };
        const calculateSuggestions = () => {
          var _a2, _b2;
          const { filterMethod, showAllLevels, separator } = props2;
          const res = (_b2 = (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.getFlattedNodes(!props2.props.checkStrictly)) == null ? void 0 : _b2.filter((node) => {
            if (node.isDisabled)
              return false;
            node.calcText(showAllLevels, separator);
            return filterMethod(node, searchKeyword.value);
          });
          if (multiple.value) {
            presentTags.value.forEach((tag) => {
              tag.hitState = false;
            });
            allPresentTags.value.forEach((tag) => {
              tag.hitState = false;
            });
          }
          filtering.value = true;
          suggestions.value = res;
          updatePopperPosition();
        };
        const focusFirstNode = () => {
          var _a2;
          let firstNode;
          if (filtering.value && suggestionPanel.value) {
            firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
          } else {
            firstNode = (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
          }
          if (firstNode) {
            firstNode.focus();
            !filtering.value && firstNode.click();
          }
        };
        const updateStyle2 = () => {
          var _a2, _b2;
          const inputInner = (_a2 = input.value) == null ? void 0 : _a2.input;
          const tagWrapperEl = tagWrapper.value;
          const suggestionPanelEl = (_b2 = suggestionPanel.value) == null ? void 0 : _b2.$el;
          if (!isClient || !inputInner)
            return;
          if (suggestionPanelEl) {
            const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
            suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
          }
          if (tagWrapperEl) {
            const { offsetHeight } = tagWrapperEl;
            const height = presentTags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`;
            inputInner.style.height = height;
            updatePopperPosition();
          }
        };
        const getCheckedNodes = (leafOnly) => {
          var _a2;
          return (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.getCheckedNodes(leafOnly);
        };
        const handleExpandChange = (value) => {
          updatePopperPosition();
          emit2("expandChange", value);
        };
        const handleKeyDown = (e2) => {
          if (isComposing.value)
            return;
          switch (e2.code) {
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
              togglePopperVisible();
              break;
            case EVENT_CODE.down:
              togglePopperVisible(true);
              nextTick(focusFirstNode);
              e2.preventDefault();
              break;
            case EVENT_CODE.esc:
              if (popperVisible.value === true) {
                e2.preventDefault();
                e2.stopPropagation();
                togglePopperVisible(false);
              }
              break;
            case EVENT_CODE.tab:
              togglePopperVisible(false);
              break;
          }
        };
        const handleClear = () => {
          var _a2;
          (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.clearCheckedNodes();
          if (!popperVisible.value && props2.filterable) {
            syncPresentTextValue();
          }
          togglePopperVisible(false);
          emit2("clear");
        };
        const syncPresentTextValue = () => {
          const { value } = presentText;
          inputValue.value = value;
          searchInputValue.value = value;
        };
        const handleSuggestionClick = (node) => {
          var _a2, _b2;
          const { checked } = node;
          if (multiple.value) {
            (_a2 = cascaderPanelRef.value) == null ? void 0 : _a2.handleCheckChange(node, !checked, false);
          } else {
            !checked && ((_b2 = cascaderPanelRef.value) == null ? void 0 : _b2.handleCheckChange(node, true, false));
            togglePopperVisible(false);
          }
        };
        const handleSuggestionKeyDown = (e2) => {
          const target = e2.target;
          const { code } = e2;
          switch (code) {
            case EVENT_CODE.up:
            case EVENT_CODE.down: {
              e2.preventDefault();
              const distance2 = code === EVENT_CODE.up ? -1 : 1;
              focusNode(getSibling(target, distance2, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
              break;
            }
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
              target.click();
              break;
          }
        };
        const handleDelete = () => {
          const tags = presentTags.value;
          const lastTag = tags[tags.length - 1];
          pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
          if (!lastTag || !pressDeleteCount || props2.collapseTags && tags.length > 1)
            return;
          if (lastTag.hitState) {
            deleteTag(lastTag);
          } else {
            lastTag.hitState = true;
          }
        };
        const handleFocus = (e2) => {
          const el = e2.target;
          const name = nsCascader.e("search-input");
          if (el.className === name) {
            filterFocus.value = true;
          }
          emit2("focus", e2);
        };
        const handleBlur = (e2) => {
          filterFocus.value = false;
          emit2("blur", e2);
        };
        const handleFilter = debounce(() => {
          const { value } = searchKeyword;
          if (!value)
            return;
          const passed = props2.beforeFilter(value);
          if (isPromise$1(passed)) {
            passed.then(calculateSuggestions).catch(() => {
            });
          } else if (passed !== false) {
            calculateSuggestions();
          } else {
            hideSuggestionPanel();
          }
        }, props2.debounce);
        const handleInput = (val, e2) => {
          !popperVisible.value && togglePopperVisible(true);
          if (e2 == null ? void 0 : e2.isComposing)
            return;
          val ? handleFilter() : hideSuggestionPanel();
        };
        const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
        watch(filtering, updatePopperPosition);
        watch([checkedNodes, isDisabled, () => props2.collapseTags], calculatePresentTags);
        watch(presentTags, () => {
          nextTick(() => updateStyle2());
        });
        watch(realSize, async () => {
          await nextTick();
          const inputInner = input.value.input;
          inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
          updateStyle2();
        });
        watch(presentText, syncPresentTextValue, { immediate: true });
        onMounted(() => {
          const inputInner = input.value.input;
          const inputInnerHeight = getInputInnerHeight(inputInner);
          inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
          useResizeObserver(inputInner, updateStyle2);
        });
        expose({
          getCheckedNodes,
          cascaderPanelRef,
          togglePopperVisible,
          contentRef,
          presentText
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), {
            ref_key: "tooltipRef",
            ref: tooltipRef,
            visible: popperVisible.value,
            teleported: _ctx.teleported,
            "popper-class": [unref(nsCascader).e("dropdown"), _ctx.popperClass],
            "popper-options": popperOptions,
            "fallback-placements": _ctx.fallbackPlacements,
            "stop-popper-mouse-event": false,
            "gpu-acceleration": false,
            placement: _ctx.placement,
            transition: `${unref(nsCascader).namespace.value}-zoom-in-top`,
            effect: "light",
            pure: "",
            persistent: _ctx.persistent,
            onHide: hideSuggestionPanel
          }, {
            default: withCtx(() => [
              withDirectives((openBlock(), createElementBlock("div", {
                class: normalizeClass(unref(cascaderKls)),
                style: normalizeStyle$1(unref(cascaderStyle)),
                onClick: () => togglePopperVisible(unref(readonly2) ? void 0 : true),
                onKeydown: handleKeyDown,
                onMouseenter: ($event) => inputHover.value = true,
                onMouseleave: ($event) => inputHover.value = false
              }, [
                createVNode$1(unref(ElInput), {
                  ref_key: "input",
                  ref: input,
                  modelValue: inputValue.value,
                  "onUpdate:modelValue": ($event) => inputValue.value = $event,
                  placeholder: unref(currentPlaceholder),
                  readonly: unref(readonly2),
                  disabled: unref(isDisabled),
                  "validate-event": false,
                  size: unref(realSize),
                  class: normalizeClass(unref(inputClass)),
                  tabindex: unref(multiple) && _ctx.filterable && !unref(isDisabled) ? -1 : void 0,
                  onCompositionstart: unref(handleComposition),
                  onCompositionupdate: unref(handleComposition),
                  onCompositionend: unref(handleComposition),
                  onFocus: handleFocus,
                  onBlur: handleBlur,
                  onInput: handleInput
                }, createSlots({
                  suffix: withCtx(() => [
                    unref(clearBtnVisible) ? (openBlock(), createBlock(unref(ElIcon), {
                      key: "clear",
                      class: normalizeClass([unref(nsInput).e("icon"), "icon-circle-close"]),
                      onClick: withModifiers(handleClear, ["stop"])
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(circle_close_default))
                      ]),
                      _: 1
                    }, 8, ["class", "onClick"])) : (openBlock(), createBlock(unref(ElIcon), {
                      key: "arrow-down",
                      class: normalizeClass(unref(cascaderIconKls)),
                      onClick: withModifiers(($event) => togglePopperVisible(), ["stop"])
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(arrow_down_default))
                      ]),
                      _: 1
                    }, 8, ["class", "onClick"]))
                  ]),
                  _: 2
                }, [
                  _ctx.$slots.prefix ? {
                    name: "prefix",
                    fn: withCtx(() => [
                      renderSlot(_ctx.$slots, "prefix")
                    ])
                  } : void 0
                ]), 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "readonly", "disabled", "size", "class", "tabindex", "onCompositionstart", "onCompositionupdate", "onCompositionend"]),
                unref(multiple) ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  ref_key: "tagWrapper",
                  ref: tagWrapper,
                  class: normalizeClass([
                    unref(nsCascader).e("tags"),
                    unref(nsCascader).is("validate", Boolean(unref(validateState)))
                  ])
                }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(presentTags.value, (tag) => {
                    return openBlock(), createBlock(unref(ElTag), {
                      key: tag.key,
                      type: _ctx.tagType,
                      size: unref(tagSize),
                      effect: _ctx.tagEffect,
                      hit: tag.hitState,
                      closable: tag.closable,
                      "disable-transitions": "",
                      onClose: ($event) => deleteTag(tag)
                    }, {
                      default: withCtx(() => [
                        tag.isCollapseTag === false ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(tag.text), 1)) : (openBlock(), createBlock(unref(ElTooltip), {
                          key: 1,
                          disabled: popperVisible.value || !_ctx.collapseTagsTooltip,
                          "fallback-placements": ["bottom", "top", "right", "left"],
                          placement: "bottom",
                          effect: "light"
                        }, {
                          default: withCtx(() => [
                            createBaseVNode("span", null, toDisplayString(tag.text), 1)
                          ]),
                          content: withCtx(() => [
                            createBaseVNode("div", {
                              class: normalizeClass(unref(nsCascader).e("collapse-tags"))
                            }, [
                              (openBlock(true), createElementBlock(Fragment, null, renderList(allPresentTags.value.slice(_ctx.maxCollapseTags), (tag2, idx) => {
                                return openBlock(), createElementBlock("div", {
                                  key: idx,
                                  class: normalizeClass(unref(nsCascader).e("collapse-tag"))
                                }, [
                                  (openBlock(), createBlock(unref(ElTag), {
                                    key: tag2.key,
                                    class: "in-tooltip",
                                    type: _ctx.tagType,
                                    size: unref(tagSize),
                                    effect: _ctx.tagEffect,
                                    hit: tag2.hitState,
                                    closable: tag2.closable,
                                    "disable-transitions": "",
                                    onClose: ($event) => deleteTag(tag2)
                                  }, {
                                    default: withCtx(() => [
                                      createBaseVNode("span", null, toDisplayString(tag2.text), 1)
                                    ]),
                                    _: 2
                                  }, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]))
                                ], 2);
                              }), 128))
                            ], 2)
                          ]),
                          _: 2
                        }, 1032, ["disabled"]))
                      ]),
                      _: 2
                    }, 1032, ["type", "size", "effect", "hit", "closable", "onClose"]);
                  }), 128)),
                  _ctx.filterable && !unref(isDisabled) ? withDirectives((openBlock(), createElementBlock("input", {
                    key: 0,
                    "onUpdate:modelValue": ($event) => searchInputValue.value = $event,
                    type: "text",
                    class: normalizeClass(unref(nsCascader).e("search-input")),
                    placeholder: unref(presentText) ? "" : unref(inputPlaceholder),
                    onInput: (e2) => handleInput(searchInputValue.value, e2),
                    onClick: withModifiers(($event) => togglePopperVisible(true), ["stop"]),
                    onKeydown: withKeys(handleDelete, ["delete"]),
                    onCompositionstart: unref(handleComposition),
                    onCompositionupdate: unref(handleComposition),
                    onCompositionend: unref(handleComposition),
                    onFocus: handleFocus,
                    onBlur: handleBlur
                  }, null, 42, ["onUpdate:modelValue", "placeholder", "onInput", "onClick", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend"])), [
                    [vModelText, searchInputValue.value]
                  ]) : createCommentVNode("v-if", true)
                ], 2)) : createCommentVNode("v-if", true)
              ], 46, ["onClick", "onMouseenter", "onMouseleave"])), [
                [unref(ClickOutside), () => togglePopperVisible(false), unref(contentRef)]
              ])
            ]),
            content: withCtx(() => [
              withDirectives(createVNode$1(unref(ElCascaderPanel), {
                ref_key: "cascaderPanelRef",
                ref: cascaderPanelRef,
                modelValue: unref(checkedValue),
                "onUpdate:modelValue": ($event) => isRef(checkedValue) ? checkedValue.value = $event : null,
                options: _ctx.options,
                props: props2.props,
                border: false,
                "render-label": _ctx.$slots.default,
                onExpandChange: handleExpandChange,
                onClose: ($event) => _ctx.$nextTick(() => togglePopperVisible(false))
              }, {
                empty: withCtx(() => [
                  renderSlot(_ctx.$slots, "empty")
                ]),
                _: 3
              }, 8, ["modelValue", "onUpdate:modelValue", "options", "props", "render-label", "onClose"]), [
                [vShow, !filtering.value]
              ]),
              _ctx.filterable ? withDirectives((openBlock(), createBlock(unref(ElScrollbar), {
                key: 0,
                ref_key: "suggestionPanel",
                ref: suggestionPanel,
                tag: "ul",
                class: normalizeClass(unref(nsCascader).e("suggestion-panel")),
                "view-class": unref(nsCascader).e("suggestion-list"),
                onKeydown: handleSuggestionKeyDown
              }, {
                default: withCtx(() => [
                  suggestions.value.length ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(suggestions.value, (item) => {
                    return openBlock(), createElementBlock("li", {
                      key: item.uid,
                      class: normalizeClass([
                        unref(nsCascader).e("suggestion-item"),
                        unref(nsCascader).is("checked", item.checked)
                      ]),
                      tabindex: -1,
                      onClick: ($event) => handleSuggestionClick(item)
                    }, [
                      renderSlot(_ctx.$slots, "suggestion-item", { item }, () => [
                        createBaseVNode("span", null, toDisplayString(item.text), 1),
                        item.checked ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                          default: withCtx(() => [
                            createVNode$1(unref(check_default))
                          ]),
                          _: 1
                        })) : createCommentVNode("v-if", true)
                      ])
                    ], 10, ["onClick"]);
                  }), 128)) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
                    createBaseVNode("li", {
                      class: normalizeClass(unref(nsCascader).e("empty-text"))
                    }, toDisplayString(unref(t)("el.cascader.noMatch")), 3)
                  ])
                ]),
                _: 3
              }, 8, ["class", "view-class"])), [
                [vShow, filtering.value]
              ]) : createCommentVNode("v-if", true)
            ]),
            _: 3
          }, 8, ["visible", "teleported", "popper-class", "fallback-placements", "placement", "transition", "persistent"]);
        };
      }
    });
    var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__file", "cascader.vue"]]);
    const ElCascader = withInstall(Cascader);
    const checkTagProps = buildProps({
      checked: Boolean,
      disabled: Boolean,
      type: {
        type: String,
        values: ["primary", "success", "info", "warning", "danger"],
        default: "primary"
      }
    });
    const checkTagEmits = {
      "update:checked": (value) => isBoolean$1(value),
      [CHANGE_EVENT]: (value) => isBoolean$1(value)
    };
    const __default__$1n = /* @__PURE__ */ defineComponent({
      name: "ElCheckTag"
    });
    const _sfc_main$21 = /* @__PURE__ */ defineComponent({
      ...__default__$1n,
      props: checkTagProps,
      emits: checkTagEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("check-tag");
        const isDisabled = computed(() => props2.disabled);
        const containerKls = computed(() => [
          ns.b(),
          ns.is("checked", props2.checked),
          ns.is("disabled", isDisabled.value),
          ns.m(props2.type || "primary")
        ]);
        const handleChange = () => {
          if (isDisabled.value)
            return;
          const checked = !props2.checked;
          emit2(CHANGE_EVENT, checked);
          emit2("update:checked", checked);
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(containerKls)),
            onClick: handleChange
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var CheckTag = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__file", "check-tag.vue"]]);
    const ElCheckTag = withInstall(CheckTag);
    const colProps = buildProps({
      tag: {
        type: String,
        default: "div"
      },
      span: {
        type: Number,
        default: 24
      },
      offset: {
        type: Number,
        default: 0
      },
      pull: {
        type: Number,
        default: 0
      },
      push: {
        type: Number,
        default: 0
      },
      xs: {
        type: definePropType([Number, Object]),
        default: () => mutable({})
      },
      sm: {
        type: definePropType([Number, Object]),
        default: () => mutable({})
      },
      md: {
        type: definePropType([Number, Object]),
        default: () => mutable({})
      },
      lg: {
        type: definePropType([Number, Object]),
        default: () => mutable({})
      },
      xl: {
        type: definePropType([Number, Object]),
        default: () => mutable({})
      }
    });
    const rowContextKey = Symbol("rowContextKey");
    const __default__$1m = /* @__PURE__ */ defineComponent({
      name: "ElCol"
    });
    const _sfc_main$20 = /* @__PURE__ */ defineComponent({
      ...__default__$1m,
      props: colProps,
      setup(__props) {
        const props2 = __props;
        const { gutter } = inject(rowContextKey, { gutter: computed(() => 0) });
        const ns = useNamespace("col");
        const style = computed(() => {
          const styles = {};
          if (gutter.value) {
            styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
          }
          return styles;
        });
        const colKls = computed(() => {
          const classes = [];
          const pos = ["span", "offset", "pull", "push"];
          pos.forEach((prop) => {
            const size = props2[prop];
            if (isNumber$2(size)) {
              if (prop === "span")
                classes.push(ns.b(`${props2[prop]}`));
              else if (size > 0)
                classes.push(ns.b(`${prop}-${props2[prop]}`));
            }
          });
          const sizes = ["xs", "sm", "md", "lg", "xl"];
          sizes.forEach((size) => {
            if (isNumber$2(props2[size])) {
              classes.push(ns.b(`${size}-${props2[size]}`));
            } else if (isObject$7(props2[size])) {
              Object.entries(props2[size]).forEach(([prop, sizeProp]) => {
                classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
              });
            }
          });
          if (gutter.value) {
            classes.push(ns.is("guttered"));
          }
          return [ns.b(), classes];
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
            class: normalizeClass(unref(colKls)),
            style: normalizeStyle$1(unref(style))
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 8, ["class", "style"]);
        };
      }
    });
    var Col = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["__file", "col.vue"]]);
    const ElCol = withInstall(Col);
    const emitChangeFn = (value) => isNumber$2(value) || isString$3(value) || isArray$5(value);
    const collapseProps = buildProps({
      accordion: Boolean,
      modelValue: {
        type: definePropType([Array, String, Number]),
        default: () => void 0
      },
      expandIconPosition: {
        type: definePropType([String]),
        default: "right"
      }
    });
    const collapseEmits = {
      [UPDATE_MODEL_EVENT]: emitChangeFn,
      [CHANGE_EVENT]: emitChangeFn
    };
    const collapseContextKey = Symbol("collapseContextKey");
    const useCollapse = (props2, emit2) => {
      const activeNames = ref([]);
      const computedActiveNames = computed(() => {
        var _a2;
        const activeKeys = (_a2 = props2.modelValue) != null ? _a2 : activeNames.value;
        return castArray$1(activeKeys);
      });
      const setActiveNames = (_activeNames) => {
        activeNames.value = _activeNames;
        const value = props2.accordion ? activeNames.value[0] : activeNames.value;
        emit2(UPDATE_MODEL_EVENT, value);
        emit2(CHANGE_EVENT, value);
      };
      const handleItemClick = (name) => {
        if (props2.accordion) {
          setActiveNames([computedActiveNames.value[0] === name ? "" : name]);
        } else {
          const _activeNames = [...computedActiveNames.value];
          const index = _activeNames.indexOf(name);
          if (index > -1) {
            _activeNames.splice(index, 1);
          } else {
            _activeNames.push(name);
          }
          setActiveNames(_activeNames);
        }
      };
      provide(collapseContextKey, {
        activeNames: computedActiveNames,
        handleItemClick
      });
      return {
        activeNames: computedActiveNames,
        setActiveNames
      };
    };
    const useCollapseDOM = (props2) => {
      const ns = useNamespace("collapse");
      const rootKls = computed(() => [
        ns.b(),
        ns.b(`icon-position-${props2.expandIconPosition}`)
      ]);
      return {
        rootKls
      };
    };
    const __default__$1l = /* @__PURE__ */ defineComponent({
      name: "ElCollapse"
    });
    const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
      ...__default__$1l,
      props: collapseProps,
      emits: collapseEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { activeNames, setActiveNames } = useCollapse(props2, emit2);
        const { rootKls } = useCollapseDOM(props2);
        expose({
          activeNames,
          setActiveNames
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(rootKls))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__file", "collapse.vue"]]);
    const __default__$1k = /* @__PURE__ */ defineComponent({
      name: "ElCollapseTransition"
    });
    const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
      ...__default__$1k,
      setup(__props) {
        const ns = useNamespace("collapse-transition");
        const reset = (el) => {
          el.style.maxHeight = "";
          el.style.overflow = el.dataset.oldOverflow;
          el.style.paddingTop = el.dataset.oldPaddingTop;
          el.style.paddingBottom = el.dataset.oldPaddingBottom;
        };
        const on2 = {
          beforeEnter(el) {
            if (!el.dataset)
              el.dataset = {};
            el.dataset.oldPaddingTop = el.style.paddingTop;
            el.dataset.oldPaddingBottom = el.style.paddingBottom;
            if (el.style.height)
              el.dataset.elExistsHeight = el.style.height;
            el.style.maxHeight = 0;
            el.style.paddingTop = 0;
            el.style.paddingBottom = 0;
          },
          enter(el) {
            requestAnimationFrame(() => {
              el.dataset.oldOverflow = el.style.overflow;
              if (el.dataset.elExistsHeight) {
                el.style.maxHeight = el.dataset.elExistsHeight;
              } else if (el.scrollHeight !== 0) {
                el.style.maxHeight = `${el.scrollHeight}px`;
              } else {
                el.style.maxHeight = 0;
              }
              el.style.paddingTop = el.dataset.oldPaddingTop;
              el.style.paddingBottom = el.dataset.oldPaddingBottom;
              el.style.overflow = "hidden";
            });
          },
          afterEnter(el) {
            el.style.maxHeight = "";
            el.style.overflow = el.dataset.oldOverflow;
          },
          enterCancelled(el) {
            reset(el);
          },
          beforeLeave(el) {
            if (!el.dataset)
              el.dataset = {};
            el.dataset.oldPaddingTop = el.style.paddingTop;
            el.dataset.oldPaddingBottom = el.style.paddingBottom;
            el.dataset.oldOverflow = el.style.overflow;
            el.style.maxHeight = `${el.scrollHeight}px`;
            el.style.overflow = "hidden";
          },
          leave(el) {
            if (el.scrollHeight !== 0) {
              el.style.maxHeight = 0;
              el.style.paddingTop = 0;
              el.style.paddingBottom = 0;
            }
          },
          afterLeave(el) {
            reset(el);
          },
          leaveCancelled(el) {
            reset(el);
          }
        };
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, mergeProps({
            name: unref(ns).b()
          }, toHandlers(on2)), {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 16, ["name"]);
        };
      }
    });
    var CollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$1_, [["__file", "collapse-transition.vue"]]);
    const ElCollapseTransition = withInstall(CollapseTransition);
    const collapseItemProps = buildProps({
      title: {
        type: String,
        default: ""
      },
      name: {
        type: definePropType([String, Number]),
        default: void 0
      },
      icon: {
        type: iconPropType,
        default: arrow_right_default
      },
      disabled: Boolean
    });
    const useCollapseItem = (props2) => {
      const collapse = inject(collapseContextKey);
      const { namespace } = useNamespace("collapse");
      const focusing = ref(false);
      const isClick = ref(false);
      const idInjection = useIdInjection();
      const id = computed(() => idInjection.current++);
      const name = computed(() => {
        var _a2;
        return (_a2 = props2.name) != null ? _a2 : `${namespace.value}-id-${idInjection.prefix}-${unref(id)}`;
      });
      const isActive = computed(() => collapse == null ? void 0 : collapse.activeNames.value.includes(unref(name)));
      const handleFocus = () => {
        setTimeout(() => {
          if (!isClick.value) {
            focusing.value = true;
          } else {
            isClick.value = false;
          }
        }, 50);
      };
      const handleHeaderClick = () => {
        if (props2.disabled)
          return;
        collapse == null ? void 0 : collapse.handleItemClick(unref(name));
        focusing.value = false;
        isClick.value = true;
      };
      const handleEnterClick = () => {
        collapse == null ? void 0 : collapse.handleItemClick(unref(name));
      };
      return {
        focusing,
        id,
        isActive,
        handleFocus,
        handleHeaderClick,
        handleEnterClick
      };
    };
    const useCollapseItemDOM = (props2, { focusing, isActive, id }) => {
      const ns = useNamespace("collapse");
      const rootKls = computed(() => [
        ns.b("item"),
        ns.is("active", unref(isActive)),
        ns.is("disabled", props2.disabled)
      ]);
      const headKls = computed(() => [
        ns.be("item", "header"),
        ns.is("active", unref(isActive)),
        { focusing: unref(focusing) && !props2.disabled }
      ]);
      const arrowKls = computed(() => [
        ns.be("item", "arrow"),
        ns.is("active", unref(isActive))
      ]);
      const itemTitleKls = computed(() => [ns.be("item", "title")]);
      const itemWrapperKls = computed(() => ns.be("item", "wrap"));
      const itemContentKls = computed(() => ns.be("item", "content"));
      const scopedContentId = computed(() => ns.b(`content-${unref(id)}`));
      const scopedHeadId = computed(() => ns.b(`head-${unref(id)}`));
      return {
        itemTitleKls,
        arrowKls,
        headKls,
        rootKls,
        itemWrapperKls,
        itemContentKls,
        scopedContentId,
        scopedHeadId
      };
    };
    const __default__$1j = /* @__PURE__ */ defineComponent({
      name: "ElCollapseItem"
    });
    const _sfc_main$1Z = /* @__PURE__ */ defineComponent({
      ...__default__$1j,
      props: collapseItemProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const {
          focusing,
          id,
          isActive,
          handleFocus,
          handleHeaderClick,
          handleEnterClick
        } = useCollapseItem(props2);
        const {
          arrowKls,
          headKls,
          rootKls,
          itemTitleKls,
          itemWrapperKls,
          itemContentKls,
          scopedContentId,
          scopedHeadId
        } = useCollapseItemDOM(props2, { focusing, isActive, id });
        expose({
          isActive
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(rootKls))
          }, [
            createBaseVNode("button", {
              id: unref(scopedHeadId),
              class: normalizeClass(unref(headKls)),
              "aria-expanded": unref(isActive),
              "aria-controls": unref(scopedContentId),
              "aria-describedby": unref(scopedContentId),
              tabindex: _ctx.disabled ? -1 : 0,
              type: "button",
              onClick: unref(handleHeaderClick),
              onKeydown: withKeys(withModifiers(unref(handleEnterClick), ["stop", "prevent"]), ["space", "enter"]),
              onFocus: unref(handleFocus),
              onBlur: ($event) => focusing.value = false
            }, [
              createBaseVNode("span", {
                class: normalizeClass(unref(itemTitleKls))
              }, [
                renderSlot(_ctx.$slots, "title", { isActive: unref(isActive) }, () => [
                  createTextVNode(toDisplayString(_ctx.title), 1)
                ])
              ], 2),
              renderSlot(_ctx.$slots, "icon", { isActive: unref(isActive) }, () => [
                createVNode$1(unref(ElIcon), {
                  class: normalizeClass(unref(arrowKls))
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
                  ]),
                  _: 1
                }, 8, ["class"])
              ])
            ], 42, ["id", "aria-expanded", "aria-controls", "aria-describedby", "tabindex", "onClick", "onKeydown", "onFocus", "onBlur"]),
            createVNode$1(unref(ElCollapseTransition), null, {
              default: withCtx(() => [
                withDirectives(createBaseVNode("div", {
                  id: unref(scopedContentId),
                  role: "region",
                  class: normalizeClass(unref(itemWrapperKls)),
                  "aria-hidden": !unref(isActive),
                  "aria-labelledby": unref(scopedHeadId)
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(itemContentKls))
                  }, [
                    renderSlot(_ctx.$slots, "default")
                  ], 2)
                ], 10, ["id", "aria-hidden", "aria-labelledby"]), [
                  [vShow, unref(isActive)]
                ])
              ]),
              _: 3
            })
          ], 2);
        };
      }
    });
    var CollapseItem = /* @__PURE__ */ _export_sfc(_sfc_main$1Z, [["__file", "collapse-item.vue"]]);
    const ElCollapse = withInstall(Collapse, {
      CollapseItem
    });
    const ElCollapseItem = withNoopInstall(CollapseItem);
    const alphaSliderProps = buildProps({
      color: {
        type: definePropType(Object),
        required: true
      },
      vertical: {
        type: Boolean,
        default: false
      }
    });
    let isDragging = false;
    function draggable(element, options) {
      if (!isClient)
        return;
      const moveFn = function(event) {
        var _a2;
        (_a2 = options.drag) == null ? void 0 : _a2.call(options, event);
      };
      const upFn = function(event) {
        var _a2;
        document.removeEventListener("mousemove", moveFn);
        document.removeEventListener("mouseup", upFn);
        document.removeEventListener("touchmove", moveFn);
        document.removeEventListener("touchend", upFn);
        document.onselectstart = null;
        document.ondragstart = null;
        isDragging = false;
        (_a2 = options.end) == null ? void 0 : _a2.call(options, event);
      };
      const downFn = function(event) {
        var _a2;
        if (isDragging)
          return;
        event.preventDefault();
        document.onselectstart = () => false;
        document.ondragstart = () => false;
        document.addEventListener("mousemove", moveFn);
        document.addEventListener("mouseup", upFn);
        document.addEventListener("touchmove", moveFn);
        document.addEventListener("touchend", upFn);
        isDragging = true;
        (_a2 = options.start) == null ? void 0 : _a2.call(options, event);
      };
      element.addEventListener("mousedown", downFn);
      element.addEventListener("touchstart", downFn, { passive: false });
    }
    const isInContainer = (el, container) => {
      if (!isClient || !el || !container)
        return false;
      const elRect = el.getBoundingClientRect();
      let containerRect;
      if (container instanceof Element) {
        containerRect = container.getBoundingClientRect();
      } else {
        containerRect = {
          top: 0,
          right: window.innerWidth,
          bottom: window.innerHeight,
          left: 0
        };
      }
      return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
    };
    const getOffsetTop = (el) => {
      let offset2 = 0;
      let parent2 = el;
      while (parent2) {
        offset2 += parent2.offsetTop;
        parent2 = parent2.offsetParent;
      }
      return offset2;
    };
    const getOffsetTopDistance = (el, containerEl) => {
      return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
    };
    const getClientXY = (event) => {
      let clientX;
      let clientY;
      if (event.type === "touchend") {
        clientY = event.changedTouches[0].clientY;
        clientX = event.changedTouches[0].clientX;
      } else if (event.type.startsWith("touch")) {
        clientY = event.touches[0].clientY;
        clientX = event.touches[0].clientX;
      } else {
        clientY = event.clientY;
        clientX = event.clientX;
      }
      return {
        clientX,
        clientY
      };
    };
    const useAlphaSlider = (props2) => {
      const instance = getCurrentInstance();
      const { t } = useLocale();
      const thumb = shallowRef();
      const bar = shallowRef();
      const alpha = computed(() => props2.color.get("alpha"));
      const alphaLabel = computed(() => t("el.colorpicker.alphaLabel"));
      function handleClick(event) {
        var _a2;
        const target = event.target;
        if (target !== thumb.value) {
          handleDrag(event);
        }
        (_a2 = thumb.value) == null ? void 0 : _a2.focus();
      }
      function handleDrag(event) {
        if (!bar.value || !thumb.value)
          return;
        const el = instance.vnode.el;
        const rect = el.getBoundingClientRect();
        const { clientX, clientY } = getClientXY(event);
        if (!props2.vertical) {
          let left = clientX - rect.left;
          left = Math.max(thumb.value.offsetWidth / 2, left);
          left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
          props2.color.set("alpha", Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100));
        } else {
          let top = clientY - rect.top;
          top = Math.max(thumb.value.offsetHeight / 2, top);
          top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
          props2.color.set("alpha", Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 100));
        }
      }
      function handleKeydown(event) {
        const { code, shiftKey } = event;
        const step = shiftKey ? 10 : 1;
        switch (code) {
          case EVENT_CODE.left:
          case EVENT_CODE.down:
            event.preventDefault();
            event.stopPropagation();
            incrementPosition(-step);
            break;
          case EVENT_CODE.right:
          case EVENT_CODE.up:
            event.preventDefault();
            event.stopPropagation();
            incrementPosition(step);
            break;
        }
      }
      function incrementPosition(step) {
        let next = alpha.value + step;
        next = next < 0 ? 0 : next > 100 ? 100 : next;
        props2.color.set("alpha", next);
      }
      return {
        thumb,
        bar,
        alpha,
        alphaLabel,
        handleDrag,
        handleClick,
        handleKeydown
      };
    };
    const useAlphaSliderDOM = (props2, {
      bar,
      thumb,
      handleDrag
    }) => {
      const instance = getCurrentInstance();
      const ns = useNamespace("color-alpha-slider");
      const thumbLeft = ref(0);
      const thumbTop = ref(0);
      const background = ref();
      function getThumbLeft() {
        if (!thumb.value)
          return 0;
        if (props2.vertical)
          return 0;
        const el = instance.vnode.el;
        const alpha = props2.color.get("alpha");
        if (!el)
          return 0;
        return Math.round(alpha * (el.offsetWidth - thumb.value.offsetWidth / 2) / 100);
      }
      function getThumbTop() {
        if (!thumb.value)
          return 0;
        const el = instance.vnode.el;
        if (!props2.vertical)
          return 0;
        const alpha = props2.color.get("alpha");
        if (!el)
          return 0;
        return Math.round(alpha * (el.offsetHeight - thumb.value.offsetHeight / 2) / 100);
      }
      function getBackground() {
        if (props2.color && props2.color.value) {
          const { r, g, b: b2 } = props2.color.toRgb();
          return `linear-gradient(to right, rgba(${r}, ${g}, ${b2}, 0) 0%, rgba(${r}, ${g}, ${b2}, 1) 100%)`;
        }
        return "";
      }
      function update() {
        thumbLeft.value = getThumbLeft();
        thumbTop.value = getThumbTop();
        background.value = getBackground();
      }
      onMounted(() => {
        if (!bar.value || !thumb.value)
          return;
        const dragConfig = {
          drag: (event) => {
            handleDrag(event);
          },
          end: (event) => {
            handleDrag(event);
          }
        };
        draggable(bar.value, dragConfig);
        draggable(thumb.value, dragConfig);
        update();
      });
      watch(() => props2.color.get("alpha"), () => update());
      watch(() => props2.color.value, () => update());
      const rootKls = computed(() => [ns.b(), ns.is("vertical", props2.vertical)]);
      const barKls = computed(() => ns.e("bar"));
      const thumbKls = computed(() => ns.e("thumb"));
      const barStyle = computed(() => ({ background: background.value }));
      const thumbStyle = computed(() => ({
        left: addUnit(thumbLeft.value),
        top: addUnit(thumbTop.value)
      }));
      return { rootKls, barKls, barStyle, thumbKls, thumbStyle, update };
    };
    const COMPONENT_NAME$g = "ElColorAlphaSlider";
    const __default__$1i = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$g
    });
    const _sfc_main$1Y = /* @__PURE__ */ defineComponent({
      ...__default__$1i,
      props: alphaSliderProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const {
          alpha,
          alphaLabel,
          bar,
          thumb,
          handleDrag,
          handleClick,
          handleKeydown
        } = useAlphaSlider(props2);
        const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useAlphaSliderDOM(props2, {
          bar,
          thumb,
          handleDrag
        });
        expose({
          update,
          bar,
          thumb
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(rootKls))
          }, [
            createBaseVNode("div", {
              ref_key: "bar",
              ref: bar,
              class: normalizeClass(unref(barKls)),
              style: normalizeStyle$1(unref(barStyle)),
              onClick: unref(handleClick)
            }, null, 14, ["onClick"]),
            createBaseVNode("div", {
              ref_key: "thumb",
              ref: thumb,
              class: normalizeClass(unref(thumbKls)),
              style: normalizeStyle$1(unref(thumbStyle)),
              "aria-label": unref(alphaLabel),
              "aria-valuenow": unref(alpha),
              "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
              "aria-valuemin": "0",
              "aria-valuemax": "100",
              role: "slider",
              tabindex: "0",
              onKeydown: unref(handleKeydown)
            }, null, 46, ["aria-label", "aria-valuenow", "aria-orientation", "onKeydown"])
          ], 2);
        };
      }
    });
    var AlphaSlider = /* @__PURE__ */ _export_sfc(_sfc_main$1Y, [["__file", "alpha-slider.vue"]]);
    const _sfc_main$1X = /* @__PURE__ */ defineComponent({
      name: "ElColorHueSlider",
      props: {
        color: {
          type: Object,
          required: true
        },
        vertical: Boolean
      },
      setup(props2) {
        const ns = useNamespace("color-hue-slider");
        const instance = getCurrentInstance();
        const thumb = ref();
        const bar = ref();
        const thumbLeft = ref(0);
        const thumbTop = ref(0);
        const hueValue = computed(() => {
          return props2.color.get("hue");
        });
        watch(() => hueValue.value, () => {
          update();
        });
        function handleClick(event) {
          const target = event.target;
          if (target !== thumb.value) {
            handleDrag(event);
          }
        }
        function handleDrag(event) {
          if (!bar.value || !thumb.value)
            return;
          const el = instance.vnode.el;
          const rect = el.getBoundingClientRect();
          const { clientX, clientY } = getClientXY(event);
          let hue;
          if (!props2.vertical) {
            let left = clientX - rect.left;
            left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
            left = Math.max(thumb.value.offsetWidth / 2, left);
            hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
          } else {
            let top = clientY - rect.top;
            top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
            top = Math.max(thumb.value.offsetHeight / 2, top);
            hue = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 360);
          }
          props2.color.set("hue", hue);
        }
        function getThumbLeft() {
          if (!thumb.value)
            return 0;
          const el = instance.vnode.el;
          if (props2.vertical)
            return 0;
          const hue = props2.color.get("hue");
          if (!el)
            return 0;
          return Math.round(hue * (el.offsetWidth - thumb.value.offsetWidth / 2) / 360);
        }
        function getThumbTop() {
          if (!thumb.value)
            return 0;
          const el = instance.vnode.el;
          if (!props2.vertical)
            return 0;
          const hue = props2.color.get("hue");
          if (!el)
            return 0;
          return Math.round(hue * (el.offsetHeight - thumb.value.offsetHeight / 2) / 360);
        }
        function update() {
          thumbLeft.value = getThumbLeft();
          thumbTop.value = getThumbTop();
        }
        onMounted(() => {
          if (!bar.value || !thumb.value)
            return;
          const dragConfig = {
            drag: (event) => {
              handleDrag(event);
            },
            end: (event) => {
              handleDrag(event);
            }
          };
          draggable(bar.value, dragConfig);
          draggable(thumb.value, dragConfig);
          update();
        });
        return {
          bar,
          thumb,
          thumbLeft,
          thumbTop,
          hueValue,
          handleClick,
          update,
          ns
        };
      }
    });
    function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
      }, [
        createBaseVNode("div", {
          ref: "bar",
          class: normalizeClass(_ctx.ns.e("bar")),
          onClick: _ctx.handleClick
        }, null, 10, ["onClick"]),
        createBaseVNode("div", {
          ref: "thumb",
          class: normalizeClass(_ctx.ns.e("thumb")),
          style: normalizeStyle$1({
            left: _ctx.thumbLeft + "px",
            top: _ctx.thumbTop + "px"
          })
        }, null, 6)
      ], 2);
    }
    var HueSlider = /* @__PURE__ */ _export_sfc(_sfc_main$1X, [["render", _sfc_render$t], ["__file", "hue-slider.vue"]]);
    const colorPickerProps = buildProps({
      modelValue: String,
      id: String,
      showAlpha: Boolean,
      colorFormat: String,
      disabled: Boolean,
      size: useSizeProp,
      popperClass: {
        type: String,
        default: ""
      },
      tabindex: {
        type: [String, Number],
        default: 0
      },
      teleported: useTooltipContentProps.teleported,
      predefine: {
        type: definePropType(Array)
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaLabel"])
    });
    const colorPickerEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isString$3(val) || isNil(val),
      [CHANGE_EVENT]: (val) => isString$3(val) || isNil(val),
      activeChange: (val) => isString$3(val) || isNil(val),
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent
    };
    const colorPickerContextKey = Symbol("colorPickerContextKey");
    const hsv2hsl = function(hue, sat, val) {
      return [
        hue,
        sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0,
        hue / 2
      ];
    };
    const isOnePointZero = function(n) {
      return isString$3(n) && n.includes(".") && Number.parseFloat(n) === 1;
    };
    const isPercentage = function(n) {
      return isString$3(n) && n.includes("%");
    };
    const bound01 = function(value, max3) {
      if (isOnePointZero(value))
        value = "100%";
      const processPercent = isPercentage(value);
      value = Math.min(max3, Math.max(0, Number.parseFloat(`${value}`)));
      if (processPercent) {
        value = Number.parseInt(`${value * max3}`, 10) / 100;
      }
      if (Math.abs(value - max3) < 1e-6) {
        return 1;
      }
      return value % max3 / Number.parseFloat(max3);
    };
    const INT_HEX_MAP = {
      10: "A",
      11: "B",
      12: "C",
      13: "D",
      14: "E",
      15: "F"
    };
    const hexOne = (value) => {
      value = Math.min(Math.round(value), 255);
      const high = Math.floor(value / 16);
      const low = value % 16;
      return `${INT_HEX_MAP[high] || high}${INT_HEX_MAP[low] || low}`;
    };
    const toHex = function({ r, g, b: b2 }) {
      if (Number.isNaN(+r) || Number.isNaN(+g) || Number.isNaN(+b2))
        return "";
      return `#${hexOne(r)}${hexOne(g)}${hexOne(b2)}`;
    };
    const HEX_INT_MAP = {
      A: 10,
      B: 11,
      C: 12,
      D: 13,
      E: 14,
      F: 15
    };
    const parseHexChannel = function(hex) {
      if (hex.length === 2) {
        return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
      }
      return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
    };
    const hsl2hsv = function(hue, sat, light) {
      sat = sat / 100;
      light = light / 100;
      let smin = sat;
      const lmin = Math.max(light, 0.01);
      light *= 2;
      sat *= light <= 1 ? light : 2 - light;
      smin *= lmin <= 1 ? lmin : 2 - lmin;
      const v4 = (light + sat) / 2;
      const sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
      return {
        h: hue,
        s: sv * 100,
        v: v4 * 100
      };
    };
    const rgb2hsv = (r, g, b2) => {
      r = bound01(r, 255);
      g = bound01(g, 255);
      b2 = bound01(b2, 255);
      const max3 = Math.max(r, g, b2);
      const min3 = Math.min(r, g, b2);
      let h2;
      const v4 = max3;
      const d2 = max3 - min3;
      const s2 = max3 === 0 ? 0 : d2 / max3;
      if (max3 === min3) {
        h2 = 0;
      } else {
        switch (max3) {
          case r: {
            h2 = (g - b2) / d2 + (g < b2 ? 6 : 0);
            break;
          }
          case g: {
            h2 = (b2 - r) / d2 + 2;
            break;
          }
          case b2: {
            h2 = (r - g) / d2 + 4;
            break;
          }
        }
        h2 /= 6;
      }
      return { h: h2 * 360, s: s2 * 100, v: v4 * 100 };
    };
    const hsv2rgb = function(h2, s2, v4) {
      h2 = bound01(h2, 360) * 6;
      s2 = bound01(s2, 100);
      v4 = bound01(v4, 100);
      const i2 = Math.floor(h2);
      const f2 = h2 - i2;
      const p2 = v4 * (1 - s2);
      const q2 = v4 * (1 - f2 * s2);
      const t = v4 * (1 - (1 - f2) * s2);
      const mod = i2 % 6;
      const r = [v4, q2, p2, p2, t, v4][mod];
      const g = [t, v4, v4, q2, p2, p2][mod];
      const b2 = [p2, p2, t, v4, v4, q2][mod];
      return {
        r: Math.round(r * 255),
        g: Math.round(g * 255),
        b: Math.round(b2 * 255)
      };
    };
    class Color {
      constructor(options = {}) {
        this._hue = 0;
        this._saturation = 100;
        this._value = 100;
        this._alpha = 100;
        this.enableAlpha = false;
        this.format = "hex";
        this.value = "";
        for (const option in options) {
          if (hasOwn$1(options, option)) {
            this[option] = options[option];
          }
        }
        if (options.value) {
          this.fromString(options.value);
        } else {
          this.doOnChange();
        }
      }
      set(prop, value) {
        if (arguments.length === 1 && typeof prop === "object") {
          for (const p2 in prop) {
            if (hasOwn$1(prop, p2)) {
              this.set(p2, prop[p2]);
            }
          }
          return;
        }
        this[`_${prop}`] = value;
        this.doOnChange();
      }
      get(prop) {
        if (prop === "alpha") {
          return Math.floor(this[`_${prop}`]);
        }
        return this[`_${prop}`];
      }
      toRgb() {
        return hsv2rgb(this._hue, this._saturation, this._value);
      }
      fromString(value) {
        if (!value) {
          this._hue = 0;
          this._saturation = 100;
          this._value = 100;
          this.doOnChange();
          return;
        }
        const fromHSV = (h2, s2, v4) => {
          this._hue = Math.max(0, Math.min(360, h2));
          this._saturation = Math.max(0, Math.min(100, s2));
          this._value = Math.max(0, Math.min(100, v4));
          this.doOnChange();
        };
        if (value.includes("hsl")) {
          const parts = value.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
          if (parts.length === 4) {
            this._alpha = Number.parseFloat(parts[3]) * 100;
          } else if (parts.length === 3) {
            this._alpha = 100;
          }
          if (parts.length >= 3) {
            const { h: h2, s: s2, v: v4 } = hsl2hsv(parts[0], parts[1], parts[2]);
            fromHSV(h2, s2, v4);
          }
        } else if (value.includes("hsv")) {
          const parts = value.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
          if (parts.length === 4) {
            this._alpha = Number.parseFloat(parts[3]) * 100;
          } else if (parts.length === 3) {
            this._alpha = 100;
          }
          if (parts.length >= 3) {
            fromHSV(parts[0], parts[1], parts[2]);
          }
        } else if (value.includes("rgb")) {
          const parts = value.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
          if (parts.length === 4) {
            this._alpha = Number.parseFloat(parts[3]) * 100;
          } else if (parts.length === 3) {
            this._alpha = 100;
          }
          if (parts.length >= 3) {
            const { h: h2, s: s2, v: v4 } = rgb2hsv(parts[0], parts[1], parts[2]);
            fromHSV(h2, s2, v4);
          }
        } else if (value.includes("#")) {
          const hex = value.replace("#", "").trim();
          if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex))
            return;
          let r, g, b2;
          if (hex.length === 3) {
            r = parseHexChannel(hex[0] + hex[0]);
            g = parseHexChannel(hex[1] + hex[1]);
            b2 = parseHexChannel(hex[2] + hex[2]);
          } else if (hex.length === 6 || hex.length === 8) {
            r = parseHexChannel(hex.slice(0, 2));
            g = parseHexChannel(hex.slice(2, 4));
            b2 = parseHexChannel(hex.slice(4, 6));
          }
          if (hex.length === 8) {
            this._alpha = parseHexChannel(hex.slice(6)) / 255 * 100;
          } else if (hex.length === 3 || hex.length === 6) {
            this._alpha = 100;
          }
          const { h: h2, s: s2, v: v4 } = rgb2hsv(r, g, b2);
          fromHSV(h2, s2, v4);
        }
      }
      compare(color2) {
        return Math.abs(color2._hue - this._hue) < 2 && Math.abs(color2._saturation - this._saturation) < 1 && Math.abs(color2._value - this._value) < 1 && Math.abs(color2._alpha - this._alpha) < 1;
      }
      doOnChange() {
        const { _hue, _saturation, _value, _alpha, format: format2 } = this;
        if (this.enableAlpha) {
          switch (format2) {
            case "hsl": {
              const hsl2 = hsv2hsl(_hue, _saturation / 100, _value / 100);
              this.value = `hsla(${_hue}, ${Math.round(hsl2[1] * 100)}%, ${Math.round(hsl2[2] * 100)}%, ${this.get("alpha") / 100})`;
              break;
            }
            case "hsv": {
              this.value = `hsva(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%, ${this.get("alpha") / 100})`;
              break;
            }
            case "hex": {
              this.value = `${toHex(hsv2rgb(_hue, _saturation, _value))}${hexOne(_alpha * 255 / 100)}`;
              break;
            }
            default: {
              const { r, g, b: b2 } = hsv2rgb(_hue, _saturation, _value);
              this.value = `rgba(${r}, ${g}, ${b2}, ${this.get("alpha") / 100})`;
            }
          }
        } else {
          switch (format2) {
            case "hsl": {
              const hsl2 = hsv2hsl(_hue, _saturation / 100, _value / 100);
              this.value = `hsl(${_hue}, ${Math.round(hsl2[1] * 100)}%, ${Math.round(hsl2[2] * 100)}%)`;
              break;
            }
            case "hsv": {
              this.value = `hsv(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%)`;
              break;
            }
            case "rgb": {
              const { r, g, b: b2 } = hsv2rgb(_hue, _saturation, _value);
              this.value = `rgb(${r}, ${g}, ${b2})`;
              break;
            }
            default: {
              this.value = toHex(hsv2rgb(_hue, _saturation, _value));
            }
          }
        }
      }
    }
    const _sfc_main$1W = /* @__PURE__ */ defineComponent({
      props: {
        colors: {
          type: Array,
          required: true
        },
        color: {
          type: Object,
          required: true
        },
        enableAlpha: {
          type: Boolean,
          required: true
        }
      },
      setup(props2) {
        const ns = useNamespace("color-predefine");
        const { currentColor } = inject(colorPickerContextKey);
        const rgbaColors = ref(parseColors(props2.colors, props2.color));
        watch(() => currentColor.value, (val) => {
          const color2 = new Color();
          color2.fromString(val);
          rgbaColors.value.forEach((item) => {
            item.selected = color2.compare(item);
          });
        });
        watchEffect(() => {
          rgbaColors.value = parseColors(props2.colors, props2.color);
        });
        function handleSelect(index) {
          props2.color.fromString(props2.colors[index]);
        }
        function parseColors(colors, color2) {
          return colors.map((value) => {
            const c2 = new Color();
            c2.enableAlpha = props2.enableAlpha;
            c2.format = "rgba";
            c2.fromString(value);
            c2.selected = c2.value === color2.value;
            return c2;
          });
        }
        return {
          rgbaColors,
          handleSelect,
          ns
        };
      }
    });
    function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(_ctx.ns.b())
      }, [
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.e("colors"))
        }, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rgbaColors, (item, index) => {
            return openBlock(), createElementBlock("div", {
              key: _ctx.colors[index],
              class: normalizeClass([
                _ctx.ns.e("color-selector"),
                _ctx.ns.is("alpha", item._alpha < 100),
                { selected: item.selected }
              ]),
              onClick: ($event) => _ctx.handleSelect(index)
            }, [
              createBaseVNode("div", {
                style: normalizeStyle$1({ backgroundColor: item.value })
              }, null, 4)
            ], 10, ["onClick"]);
          }), 128))
        ], 2)
      ], 2);
    }
    var Predefine = /* @__PURE__ */ _export_sfc(_sfc_main$1W, [["render", _sfc_render$s], ["__file", "predefine.vue"]]);
    const _sfc_main$1V = /* @__PURE__ */ defineComponent({
      name: "ElSlPanel",
      props: {
        color: {
          type: Object,
          required: true
        }
      },
      setup(props2) {
        const ns = useNamespace("color-svpanel");
        const instance = getCurrentInstance();
        const cursorTop = ref(0);
        const cursorLeft = ref(0);
        const background = ref("hsl(0, 100%, 50%)");
        const colorValue = computed(() => {
          const hue = props2.color.get("hue");
          const value = props2.color.get("value");
          return { hue, value };
        });
        function update() {
          const saturation = props2.color.get("saturation");
          const value = props2.color.get("value");
          const el = instance.vnode.el;
          const { clientWidth: width, clientHeight: height } = el;
          cursorLeft.value = saturation * width / 100;
          cursorTop.value = (100 - value) * height / 100;
          background.value = `hsl(${props2.color.get("hue")}, 100%, 50%)`;
        }
        function handleDrag(event) {
          const el = instance.vnode.el;
          const rect = el.getBoundingClientRect();
          const { clientX, clientY } = getClientXY(event);
          let left = clientX - rect.left;
          let top = clientY - rect.top;
          left = Math.max(0, left);
          left = Math.min(left, rect.width);
          top = Math.max(0, top);
          top = Math.min(top, rect.height);
          cursorLeft.value = left;
          cursorTop.value = top;
          props2.color.set({
            saturation: left / rect.width * 100,
            value: 100 - top / rect.height * 100
          });
        }
        watch(() => colorValue.value, () => {
          update();
        });
        onMounted(() => {
          draggable(instance.vnode.el, {
            drag: (event) => {
              handleDrag(event);
            },
            end: (event) => {
              handleDrag(event);
            }
          });
          update();
        });
        return {
          cursorTop,
          cursorLeft,
          background,
          colorValue,
          handleDrag,
          update,
          ns
        };
      }
    });
    function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(_ctx.ns.b()),
        style: normalizeStyle$1({
          backgroundColor: _ctx.background
        })
      }, [
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.e("white"))
        }, null, 2),
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.e("black"))
        }, null, 2),
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.e("cursor")),
          style: normalizeStyle$1({
            top: _ctx.cursorTop + "px",
            left: _ctx.cursorLeft + "px"
          })
        }, [
          createBaseVNode("div")
        ], 6)
      ], 6);
    }
    var SvPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1V, [["render", _sfc_render$r], ["__file", "sv-panel.vue"]]);
    const __default__$1h = /* @__PURE__ */ defineComponent({
      name: "ElColorPicker"
    });
    const _sfc_main$1U = /* @__PURE__ */ defineComponent({
      ...__default__$1h,
      props: colorPickerProps,
      emits: colorPickerEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("color");
        const { formItem } = useFormItem();
        const colorSize = useFormSize();
        const colorDisabled = useFormDisabled();
        const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext: formItem
        });
        const hue = ref();
        const sv = ref();
        const alpha = ref();
        const popper = ref();
        const triggerRef = ref();
        const inputRef = ref();
        const { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef, {
          beforeFocus() {
            return colorDisabled.value;
          },
          beforeBlur(event) {
            var _a2;
            return (_a2 = popper.value) == null ? void 0 : _a2.isFocusInsideContent(event);
          },
          afterBlur() {
            setShowPicker(false);
            resetColor();
          }
        });
        let shouldActiveChange = true;
        const color2 = reactive(new Color({
          enableAlpha: props2.showAlpha,
          format: props2.colorFormat || "",
          value: props2.modelValue
        }));
        const showPicker = ref(false);
        const showPanelColor = ref(false);
        const customInput = ref("");
        const displayedColor = computed(() => {
          if (!props2.modelValue && !showPanelColor.value) {
            return "transparent";
          }
          return displayedRgb(color2, props2.showAlpha);
        });
        const currentColor = computed(() => {
          return !props2.modelValue && !showPanelColor.value ? "" : color2.value;
        });
        const buttonAriaLabel = computed(() => {
          return !isLabeledByFormItem.value ? props2.ariaLabel || t("el.colorpicker.defaultLabel") : void 0;
        });
        const buttonAriaLabelledby = computed(() => {
          return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
        });
        const btnKls = computed(() => {
          return [
            ns.b("picker"),
            ns.is("disabled", colorDisabled.value),
            ns.bm("picker", colorSize.value),
            ns.is("focused", isFocused.value)
          ];
        });
        function displayedRgb(color22, showAlpha) {
          if (!(color22 instanceof Color)) {
            throw new TypeError("color should be instance of _color Class");
          }
          const { r, g, b: b2 } = color22.toRgb();
          return showAlpha ? `rgba(${r}, ${g}, ${b2}, ${color22.get("alpha") / 100})` : `rgb(${r}, ${g}, ${b2})`;
        }
        function setShowPicker(value) {
          showPicker.value = value;
        }
        const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true });
        function show() {
          if (colorDisabled.value)
            return;
          setShowPicker(true);
        }
        function hide() {
          debounceSetShowPicker(false);
          resetColor();
        }
        function resetColor() {
          nextTick(() => {
            if (props2.modelValue) {
              color2.fromString(props2.modelValue);
            } else {
              color2.value = "";
              nextTick(() => {
                showPanelColor.value = false;
              });
            }
          });
        }
        function handleTrigger() {
          if (colorDisabled.value)
            return;
          if (showPicker.value) {
            resetColor();
          }
          debounceSetShowPicker(!showPicker.value);
        }
        function handleConfirm() {
          color2.fromString(customInput.value);
        }
        function confirmValue() {
          const value = color2.value;
          emit2(UPDATE_MODEL_EVENT, value);
          emit2(CHANGE_EVENT, value);
          if (props2.validateEvent) {
            formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
          }
          debounceSetShowPicker(false);
          nextTick(() => {
            const newColor = new Color({
              enableAlpha: props2.showAlpha,
              format: props2.colorFormat || "",
              value: props2.modelValue
            });
            if (!color2.compare(newColor)) {
              resetColor();
            }
          });
        }
        function clear2() {
          debounceSetShowPicker(false);
          emit2(UPDATE_MODEL_EVENT, null);
          emit2(CHANGE_EVENT, null);
          if (props2.modelValue !== null && props2.validateEvent) {
            formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
          }
          resetColor();
        }
        function handleClickOutside() {
          if (!showPicker.value)
            return;
          hide();
          isFocused.value && focus();
        }
        function handleEsc(event) {
          event.preventDefault();
          event.stopPropagation();
          setShowPicker(false);
          resetColor();
        }
        function handleKeyDown(event) {
          switch (event.code) {
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
            case EVENT_CODE.space:
              event.preventDefault();
              event.stopPropagation();
              show();
              inputRef.value.focus();
              break;
            case EVENT_CODE.esc:
              handleEsc(event);
              break;
          }
        }
        function focus() {
          triggerRef.value.focus();
        }
        function blur() {
          triggerRef.value.blur();
        }
        onMounted(() => {
          if (props2.modelValue) {
            customInput.value = currentColor.value;
          }
        });
        watch(() => props2.modelValue, (newVal) => {
          if (!newVal) {
            showPanelColor.value = false;
          } else if (newVal && newVal !== color2.value) {
            shouldActiveChange = false;
            color2.fromString(newVal);
          }
        });
        watch(() => [props2.colorFormat, props2.showAlpha], () => {
          color2.enableAlpha = props2.showAlpha;
          color2.format = props2.colorFormat || color2.format;
          color2.doOnChange();
          emit2(UPDATE_MODEL_EVENT, color2.value);
        });
        watch(() => currentColor.value, (val) => {
          customInput.value = val;
          shouldActiveChange && emit2("activeChange", val);
          shouldActiveChange = true;
        });
        watch(() => color2.value, () => {
          if (!props2.modelValue && !showPanelColor.value) {
            showPanelColor.value = true;
          }
        });
        watch(() => showPicker.value, () => {
          nextTick(() => {
            var _a2, _b2, _c2;
            (_a2 = hue.value) == null ? void 0 : _a2.update();
            (_b2 = sv.value) == null ? void 0 : _b2.update();
            (_c2 = alpha.value) == null ? void 0 : _c2.update();
          });
        });
        provide(colorPickerContextKey, {
          currentColor
        });
        expose({
          color: color2,
          show,
          hide,
          focus,
          blur
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), {
            ref_key: "popper",
            ref: popper,
            visible: showPicker.value,
            "show-arrow": false,
            "fallback-placements": ["bottom", "top", "right", "left"],
            offset: 0,
            "gpu-acceleration": false,
            "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
            "stop-popper-mouse-event": false,
            effect: "light",
            trigger: "click",
            teleported: _ctx.teleported,
            transition: `${unref(ns).namespace.value}-zoom-in-top`,
            persistent: "",
            onHide: ($event) => setShowPicker(false)
          }, {
            content: withCtx(() => [
              withDirectives((openBlock(), createElementBlock("div", {
                onKeydown: withKeys(handleEsc, ["esc"])
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
                }, [
                  createVNode$1(HueSlider, {
                    ref_key: "hue",
                    ref: hue,
                    class: "hue-slider",
                    color: unref(color2),
                    vertical: ""
                  }, null, 8, ["color"]),
                  createVNode$1(SvPanel, {
                    ref_key: "sv",
                    ref: sv,
                    color: unref(color2)
                  }, null, 8, ["color"])
                ], 2),
                _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
                  key: 0,
                  ref_key: "alpha",
                  ref: alpha,
                  color: unref(color2)
                }, null, 8, ["color"])) : createCommentVNode("v-if", true),
                _ctx.predefine ? (openBlock(), createBlock(Predefine, {
                  key: 1,
                  ref: "predefine",
                  "enable-alpha": _ctx.showAlpha,
                  color: unref(color2),
                  colors: _ctx.predefine
                }, null, 8, ["enable-alpha", "color", "colors"])) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).be("dropdown", "btns"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(ns).be("dropdown", "value"))
                  }, [
                    createVNode$1(unref(ElInput), {
                      ref_key: "inputRef",
                      ref: inputRef,
                      modelValue: customInput.value,
                      "onUpdate:modelValue": ($event) => customInput.value = $event,
                      "validate-event": false,
                      size: "small",
                      onKeyup: withKeys(handleConfirm, ["enter"]),
                      onBlur: handleConfirm
                    }, null, 8, ["modelValue", "onUpdate:modelValue", "onKeyup"])
                  ], 2),
                  createVNode$1(unref(ElButton), {
                    class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
                    text: "",
                    size: "small",
                    onClick: clear2
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(unref(t)("el.colorpicker.clear")), 1)
                    ]),
                    _: 1
                  }, 8, ["class"]),
                  createVNode$1(unref(ElButton), {
                    plain: "",
                    size: "small",
                    class: normalizeClass(unref(ns).be("dropdown", "btn")),
                    onClick: confirmValue
                  }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(unref(t)("el.colorpicker.confirm")), 1)
                    ]),
                    _: 1
                  }, 8, ["class"])
                ], 2)
              ], 40, ["onKeydown"])), [
                [unref(ClickOutside), handleClickOutside, triggerRef.value]
              ])
            ]),
            default: withCtx(() => [
              createBaseVNode("div", mergeProps({
                id: unref(buttonId),
                ref_key: "triggerRef",
                ref: triggerRef
              }, _ctx.$attrs, {
                class: unref(btnKls),
                role: "button",
                "aria-label": unref(buttonAriaLabel),
                "aria-labelledby": unref(buttonAriaLabelledby),
                "aria-description": unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
                "aria-disabled": unref(colorDisabled),
                tabindex: unref(colorDisabled) ? void 0 : _ctx.tabindex,
                onKeydown: handleKeyDown,
                onFocus: unref(handleFocus),
                onBlur: unref(handleBlur)
              }), [
                unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(unref(ns).be("picker", "mask"))
                }, null, 2)) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).be("picker", "trigger")),
                  onClick: handleTrigger
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
                  }, [
                    createBaseVNode("span", {
                      class: normalizeClass(unref(ns).be("picker", "color-inner")),
                      style: normalizeStyle$1({
                        backgroundColor: unref(displayedColor)
                      })
                    }, [
                      withDirectives(createVNode$1(unref(ElIcon), {
                        class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
                      }, {
                        default: withCtx(() => [
                          createVNode$1(unref(arrow_down_default))
                        ]),
                        _: 1
                      }, 8, ["class"]), [
                        [vShow, _ctx.modelValue || showPanelColor.value]
                      ]),
                      withDirectives(createVNode$1(unref(ElIcon), {
                        class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
                      }, {
                        default: withCtx(() => [
                          createVNode$1(unref(close_default))
                        ]),
                        _: 1
                      }, 8, ["class"]), [
                        [vShow, !_ctx.modelValue && !showPanelColor.value]
                      ])
                    ], 6)
                  ], 2)
                ], 2)
              ], 16, ["id", "aria-label", "aria-labelledby", "aria-description", "aria-disabled", "tabindex", "onFocus", "onBlur"])
            ]),
            _: 1
          }, 8, ["visible", "popper-class", "teleported", "transition", "onHide"]);
        };
      }
    });
    var ColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1U, [["__file", "color-picker.vue"]]);
    const ElColorPicker = withInstall(ColorPicker);
    const configProviderProps = buildProps({
      a11y: {
        type: Boolean,
        default: true
      },
      locale: {
        type: definePropType(Object)
      },
      size: useSizeProp,
      button: {
        type: definePropType(Object)
      },
      experimentalFeatures: {
        type: definePropType(Object)
      },
      keyboardNavigation: {
        type: Boolean,
        default: true
      },
      message: {
        type: definePropType(Object)
      },
      zIndex: Number,
      namespace: {
        type: String,
        default: "el"
      },
      ...useEmptyValuesProps
    });
    const messageConfig = {};
    const ConfigProvider = /* @__PURE__ */ defineComponent({
      name: "ElConfigProvider",
      props: configProviderProps,
      setup(props2, { slots }) {
        watch(() => props2.message, (val) => {
          Object.assign(messageConfig, val != null ? val : {});
        }, { immediate: true, deep: true });
        const config = provideGlobalConfig(props2);
        return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
      }
    });
    const ElConfigProvider = withInstall(ConfigProvider);
    const __default__$1g = /* @__PURE__ */ defineComponent({
      name: "ElContainer"
    });
    const _sfc_main$1T = /* @__PURE__ */ defineComponent({
      ...__default__$1g,
      props: {
        direction: {
          type: String
        }
      },
      setup(__props) {
        const props2 = __props;
        const slots = useSlots();
        const ns = useNamespace("container");
        const isVertical = computed(() => {
          if (props2.direction === "vertical") {
            return true;
          } else if (props2.direction === "horizontal") {
            return false;
          }
          if (slots && slots.default) {
            const vNodes = slots.default();
            return vNodes.some((vNode) => {
              const tag = vNode.type.name;
              return tag === "ElHeader" || tag === "ElFooter";
            });
          } else {
            return false;
          }
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("section", {
            class: normalizeClass([unref(ns).b(), unref(ns).is("vertical", unref(isVertical))])
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var Container = /* @__PURE__ */ _export_sfc(_sfc_main$1T, [["__file", "container.vue"]]);
    const __default__$1f = /* @__PURE__ */ defineComponent({
      name: "ElAside"
    });
    const _sfc_main$1S = /* @__PURE__ */ defineComponent({
      ...__default__$1f,
      props: {
        width: {
          type: String,
          default: null
        }
      },
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("aside");
        const style = computed(() => props2.width ? ns.cssVarBlock({ width: props2.width }) : {});
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("aside", {
            class: normalizeClass(unref(ns).b()),
            style: normalizeStyle$1(unref(style))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 6);
        };
      }
    });
    var Aside = /* @__PURE__ */ _export_sfc(_sfc_main$1S, [["__file", "aside.vue"]]);
    const __default__$1e = /* @__PURE__ */ defineComponent({
      name: "ElFooter"
    });
    const _sfc_main$1R = /* @__PURE__ */ defineComponent({
      ...__default__$1e,
      props: {
        height: {
          type: String,
          default: null
        }
      },
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("footer");
        const style = computed(() => props2.height ? ns.cssVarBlock({ height: props2.height }) : {});
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("footer", {
            class: normalizeClass(unref(ns).b()),
            style: normalizeStyle$1(unref(style))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 6);
        };
      }
    });
    var Footer$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["__file", "footer.vue"]]);
    const __default__$1d = /* @__PURE__ */ defineComponent({
      name: "ElHeader"
    });
    const _sfc_main$1Q = /* @__PURE__ */ defineComponent({
      ...__default__$1d,
      props: {
        height: {
          type: String,
          default: null
        }
      },
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("header");
        const style = computed(() => {
          return props2.height ? ns.cssVarBlock({
            height: props2.height
          }) : {};
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("header", {
            class: normalizeClass(unref(ns).b()),
            style: normalizeStyle$1(unref(style))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 6);
        };
      }
    });
    var Header$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["__file", "header.vue"]]);
    const __default__$1c = /* @__PURE__ */ defineComponent({
      name: "ElMain"
    });
    const _sfc_main$1P = /* @__PURE__ */ defineComponent({
      ...__default__$1c,
      setup(__props) {
        const ns = useNamespace("main");
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("main", {
            class: normalizeClass(unref(ns).b())
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var Main = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["__file", "main.vue"]]);
    const ElContainer = withInstall(Container, {
      Aside,
      Footer: Footer$2,
      Header: Header$2,
      Main
    });
    const ElAside = withNoopInstall(Aside);
    const ElFooter = withNoopInstall(Footer$2);
    const ElHeader = withNoopInstall(Header$2);
    const ElMain = withNoopInstall(Main);
    var customParseFormat$2 = { exports: {} };
    var customParseFormat$1 = customParseFormat$2.exports;
    var hasRequiredCustomParseFormat;
    function requireCustomParseFormat() {
      if (hasRequiredCustomParseFormat) return customParseFormat$2.exports;
      hasRequiredCustomParseFormat = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(customParseFormat$1, function() {
          var e2 = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i2 = /\d\d?/, o2 = /\d*[^-_:/,()\s\d]+/, s2 = {}, a2 = function(e3) {
            return (e3 = +e3) + (e3 > 68 ? 1900 : 2e3);
          };
          var f2 = function(e3) {
            return function(t2) {
              this[e3] = +t2;
            };
          }, h2 = [/[+-]\d\d:?(\d\d)?|Z/, function(e3) {
            (this.zone || (this.zone = {})).offset = function(e4) {
              if (!e4) return 0;
              if ("Z" === e4) return 0;
              var t2 = e4.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
              return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
            }(e3);
          }], u2 = function(e3) {
            var t2 = s2[e3];
            return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
          }, d2 = function(e3, t2) {
            var n2, r2 = s2.meridiem;
            if (r2) {
              for (var i3 = 1; i3 <= 24; i3 += 1) if (e3.indexOf(r2(i3, 0, t2)) > -1) {
                n2 = i3 > 12;
                break;
              }
            } else n2 = e3 === (t2 ? "pm" : "PM");
            return n2;
          }, c2 = { A: [o2, function(e3) {
            this.afternoon = d2(e3, false);
          }], a: [o2, function(e3) {
            this.afternoon = d2(e3, true);
          }], Q: [n, function(e3) {
            this.month = 3 * (e3 - 1) + 1;
          }], S: [n, function(e3) {
            this.milliseconds = 100 * +e3;
          }], SS: [r, function(e3) {
            this.milliseconds = 10 * +e3;
          }], SSS: [/\d{3}/, function(e3) {
            this.milliseconds = +e3;
          }], s: [i2, f2("seconds")], ss: [i2, f2("seconds")], m: [i2, f2("minutes")], mm: [i2, f2("minutes")], H: [i2, f2("hours")], h: [i2, f2("hours")], HH: [i2, f2("hours")], hh: [i2, f2("hours")], D: [i2, f2("day")], DD: [r, f2("day")], Do: [o2, function(e3) {
            var t2 = s2.ordinal, n2 = e3.match(/\d+/);
            if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e3 && (this.day = r2);
          }], w: [i2, f2("week")], ww: [r, f2("week")], M: [i2, f2("month")], MM: [r, f2("month")], MMM: [o2, function(e3) {
            var t2 = u2("months"), n2 = (u2("monthsShort") || t2.map(function(e4) {
              return e4.slice(0, 3);
            })).indexOf(e3) + 1;
            if (n2 < 1) throw new Error();
            this.month = n2 % 12 || n2;
          }], MMMM: [o2, function(e3) {
            var t2 = u2("months").indexOf(e3) + 1;
            if (t2 < 1) throw new Error();
            this.month = t2 % 12 || t2;
          }], Y: [/[+-]?\d+/, f2("year")], YY: [r, function(e3) {
            this.year = a2(e3);
          }], YYYY: [/\d{4}/, f2("year")], Z: h2, ZZ: h2 };
          function l2(n2) {
            var r2, i3;
            r2 = n2, i3 = s2 && s2.formats;
            for (var o3 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t2, n3, r3) {
              var o4 = r3 && r3.toUpperCase();
              return n3 || i3[r3] || e2[r3] || i3[o4].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e3, t3, n4) {
                return t3 || n4.slice(1);
              });
            })).match(t), a3 = o3.length, f3 = 0; f3 < a3; f3 += 1) {
              var h3 = o3[f3], u3 = c2[h3], d3 = u3 && u3[0], l3 = u3 && u3[1];
              o3[f3] = l3 ? { regex: d3, parser: l3 } : h3.replace(/^\[|\]$/g, "");
            }
            return function(e3) {
              for (var t2 = {}, n3 = 0, r3 = 0; n3 < a3; n3 += 1) {
                var i4 = o3[n3];
                if ("string" == typeof i4) r3 += i4.length;
                else {
                  var s3 = i4.regex, f4 = i4.parser, h4 = e3.slice(r3), u4 = s3.exec(h4)[0];
                  f4.call(t2, u4), e3 = e3.replace(u4, "");
                }
              }
              return function(e4) {
                var t3 = e4.afternoon;
                if (void 0 !== t3) {
                  var n4 = e4.hours;
                  t3 ? n4 < 12 && (e4.hours += 12) : 12 === n4 && (e4.hours = 0), delete e4.afternoon;
                }
              }(t2), t2;
            };
          }
          return function(e3, t2, n2) {
            n2.p.customParseFormat = true, e3 && e3.parseTwoDigitYear && (a2 = e3.parseTwoDigitYear);
            var r2 = t2.prototype, i3 = r2.parse;
            r2.parse = function(e4) {
              var t3 = e4.date, r3 = e4.utc, o3 = e4.args;
              this.$u = r3;
              var a3 = o3[1];
              if ("string" == typeof a3) {
                var f3 = true === o3[2], h3 = true === o3[3], u3 = f3 || h3, d3 = o3[2];
                h3 && (d3 = o3[2]), s2 = this.$locale(), !f3 && d3 && (s2 = n2.Ls[d3]), this.$d = function(e5, t4, n3, r4) {
                  try {
                    if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e5);
                    var i4 = l2(t4)(e5), o4 = i4.year, s3 = i4.month, a4 = i4.day, f4 = i4.hours, h4 = i4.minutes, u4 = i4.seconds, d4 = i4.milliseconds, c4 = i4.zone, m3 = i4.week, M3 = /* @__PURE__ */ new Date(), Y2 = a4 || (o4 || s3 ? 1 : M3.getDate()), p2 = o4 || M3.getFullYear(), v4 = 0;
                    o4 && !s3 || (v4 = s3 > 0 ? s3 - 1 : M3.getMonth());
                    var D2, w2 = f4 || 0, g = h4 || 0, y = u4 || 0, L2 = d4 || 0;
                    return c4 ? new Date(Date.UTC(p2, v4, Y2, w2, g, y, L2 + 60 * c4.offset * 1e3)) : n3 ? new Date(Date.UTC(p2, v4, Y2, w2, g, y, L2)) : (D2 = new Date(p2, v4, Y2, w2, g, y, L2), m3 && (D2 = r4(D2).week(m3).toDate()), D2);
                  } catch (e6) {
                    return /* @__PURE__ */ new Date("");
                  }
                }(t3, a3, r3, n2), this.init(), d3 && true !== d3 && (this.$L = this.locale(d3).$L), u3 && t3 != this.format(a3) && (this.$d = /* @__PURE__ */ new Date("")), s2 = {};
              } else if (a3 instanceof Array) for (var c3 = a3.length, m2 = 1; m2 <= c3; m2 += 1) {
                o3[1] = a3[m2 - 1];
                var M2 = n2.apply(this, o3);
                if (M2.isValid()) {
                  this.$d = M2.$d, this.$L = M2.$L, this.init();
                  break;
                }
                m2 === c3 && (this.$d = /* @__PURE__ */ new Date(""));
              }
              else i3.call(this, e4);
            };
          };
        });
      })(customParseFormat$2);
      return customParseFormat$2.exports;
    }
    var customParseFormatExports = requireCustomParseFormat();
    const customParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
    var advancedFormat$2 = { exports: {} };
    var advancedFormat$1 = advancedFormat$2.exports;
    var hasRequiredAdvancedFormat;
    function requireAdvancedFormat() {
      if (hasRequiredAdvancedFormat) return advancedFormat$2.exports;
      hasRequiredAdvancedFormat = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(advancedFormat$1, function() {
          return function(e2, t) {
            var r = t.prototype, n = r.format;
            r.format = function(e3) {
              var t2 = this, r2 = this.$locale();
              if (!this.isValid()) return n.bind(this)(e3);
              var s2 = this.$utils(), a2 = (e3 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e4) {
                switch (e4) {
                  case "Q":
                    return Math.ceil((t2.$M + 1) / 3);
                  case "Do":
                    return r2.ordinal(t2.$D);
                  case "gggg":
                    return t2.weekYear();
                  case "GGGG":
                    return t2.isoWeekYear();
                  case "wo":
                    return r2.ordinal(t2.week(), "W");
                  case "w":
                  case "ww":
                    return s2.s(t2.week(), "w" === e4 ? 1 : 2, "0");
                  case "W":
                  case "WW":
                    return s2.s(t2.isoWeek(), "W" === e4 ? 1 : 2, "0");
                  case "k":
                  case "kk":
                    return s2.s(String(0 === t2.$H ? 24 : t2.$H), "k" === e4 ? 1 : 2, "0");
                  case "X":
                    return Math.floor(t2.$d.getTime() / 1e3);
                  case "x":
                    return t2.$d.getTime();
                  case "z":
                    return "[" + t2.offsetName() + "]";
                  case "zzz":
                    return "[" + t2.offsetName("long") + "]";
                  default:
                    return e4;
                }
              });
              return n.bind(this)(a2);
            };
          };
        });
      })(advancedFormat$2);
      return advancedFormat$2.exports;
    }
    var advancedFormatExports = requireAdvancedFormat();
    const advancedFormat = /* @__PURE__ */ getDefaultExportFromCjs(advancedFormatExports);
    var weekOfYear$2 = { exports: {} };
    var weekOfYear$1 = weekOfYear$2.exports;
    var hasRequiredWeekOfYear;
    function requireWeekOfYear() {
      if (hasRequiredWeekOfYear) return weekOfYear$2.exports;
      hasRequiredWeekOfYear = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(weekOfYear$1, function() {
          var e2 = "week", t = "year";
          return function(i2, n, r) {
            var f2 = n.prototype;
            f2.week = function(i3) {
              if (void 0 === i3 && (i3 = null), null !== i3) return this.add(7 * (i3 - this.week()), "day");
              var n2 = this.$locale().yearStart || 1;
              if (11 === this.month() && this.date() > 25) {
                var f3 = r(this).startOf(t).add(1, t).date(n2), s2 = r(this).endOf(e2);
                if (f3.isBefore(s2)) return 1;
              }
              var a2 = r(this).startOf(t).date(n2).startOf(e2).subtract(1, "millisecond"), o2 = this.diff(a2, e2, true);
              return o2 < 0 ? r(this).startOf("week").week() : Math.ceil(o2);
            }, f2.weeks = function(e3) {
              return void 0 === e3 && (e3 = null), this.week(e3);
            };
          };
        });
      })(weekOfYear$2);
      return weekOfYear$2.exports;
    }
    var weekOfYearExports = requireWeekOfYear();
    const weekOfYear = /* @__PURE__ */ getDefaultExportFromCjs(weekOfYearExports);
    var weekYear$2 = { exports: {} };
    var weekYear$1 = weekYear$2.exports;
    var hasRequiredWeekYear;
    function requireWeekYear() {
      if (hasRequiredWeekYear) return weekYear$2.exports;
      hasRequiredWeekYear = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(weekYear$1, function() {
          return function(e2, t) {
            t.prototype.weekYear = function() {
              var e3 = this.month(), t2 = this.week(), n = this.year();
              return 1 === t2 && 11 === e3 ? n + 1 : 0 === e3 && t2 >= 52 ? n - 1 : n;
            };
          };
        });
      })(weekYear$2);
      return weekYear$2.exports;
    }
    var weekYearExports = requireWeekYear();
    const weekYear = /* @__PURE__ */ getDefaultExportFromCjs(weekYearExports);
    var dayOfYear$2 = { exports: {} };
    var dayOfYear$1 = dayOfYear$2.exports;
    var hasRequiredDayOfYear;
    function requireDayOfYear() {
      if (hasRequiredDayOfYear) return dayOfYear$2.exports;
      hasRequiredDayOfYear = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(dayOfYear$1, function() {
          return function(e2, t, n) {
            t.prototype.dayOfYear = function(e3) {
              var t2 = Math.round((n(this).startOf("day") - n(this).startOf("year")) / 864e5) + 1;
              return null == e3 ? t2 : this.add(e3 - t2, "day");
            };
          };
        });
      })(dayOfYear$2);
      return dayOfYear$2.exports;
    }
    var dayOfYearExports = requireDayOfYear();
    const dayOfYear = /* @__PURE__ */ getDefaultExportFromCjs(dayOfYearExports);
    var isSameOrAfter$2 = { exports: {} };
    var isSameOrAfter$1 = isSameOrAfter$2.exports;
    var hasRequiredIsSameOrAfter;
    function requireIsSameOrAfter() {
      if (hasRequiredIsSameOrAfter) return isSameOrAfter$2.exports;
      hasRequiredIsSameOrAfter = 1;
      (function(module2, exports2) {
        !function(e2, t) {
          module2.exports = t();
        }(isSameOrAfter$1, function() {
          return function(e2, t) {
            t.prototype.isSameOrAfter = function(e3, t2) {
              return this.isSame(e3, t2) || this.isAfter(e3, t2);
            };
          };
        });
      })(isSameOrAfter$2);
      return isSameOrAfter$2.exports;
    }
    var isSameOrAfterExports = requireIsSameOrAfter();
    const isSameOrAfter = /* @__PURE__ */ getDefaultExportFromCjs(isSameOrAfterExports);
    var isSameOrBefore$2 = { exports: {} };
    var isSameOrBefore$1 = isSameOrBefore$2.exports;
    var hasRequiredIsSameOrBefore;
    function requireIsSameOrBefore() {
      if (hasRequiredIsSameOrBefore) return isSameOrBefore$2.exports;
      hasRequiredIsSameOrBefore = 1;
      (function(module2, exports2) {
        !function(e2, i2) {
          module2.exports = i2();
        }(isSameOrBefore$1, function() {
          return function(e2, i2) {
            i2.prototype.isSameOrBefore = function(e3, i3) {
              return this.isSame(e3, i3) || this.isBefore(e3, i3);
            };
          };
        });
      })(isSameOrBefore$2);
      return isSameOrBefore$2.exports;
    }
    var isSameOrBeforeExports = requireIsSameOrBefore();
    const isSameOrBefore = /* @__PURE__ */ getDefaultExportFromCjs(isSameOrBeforeExports);
    const timeUnits$2 = ["hours", "minutes", "seconds"];
    const DEFAULT_FORMATS_TIME = "HH:mm:ss";
    const DEFAULT_FORMATS_DATE = "YYYY-MM-DD";
    const DEFAULT_FORMATS_DATEPICKER = {
      date: DEFAULT_FORMATS_DATE,
      dates: DEFAULT_FORMATS_DATE,
      week: "gggg[w]ww",
      year: "YYYY",
      years: "YYYY",
      month: "YYYY-MM",
      months: "YYYY-MM",
      datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`,
      monthrange: "YYYY-MM",
      yearrange: "YYYY",
      daterange: DEFAULT_FORMATS_DATE,
      datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`
    };
    const disabledTimeListsProps = buildProps({
      disabledHours: {
        type: definePropType(Function)
      },
      disabledMinutes: {
        type: definePropType(Function)
      },
      disabledSeconds: {
        type: definePropType(Function)
      }
    });
    const timePanelSharedProps = buildProps({
      visible: Boolean,
      actualVisible: {
        type: Boolean,
        default: void 0
      },
      format: {
        type: String,
        default: ""
      }
    });
    const timePickerDefaultProps = buildProps({
      id: {
        type: definePropType([Array, String])
      },
      name: {
        type: definePropType([Array, String])
      },
      popperClass: {
        type: String,
        default: ""
      },
      format: String,
      valueFormat: String,
      dateFormat: String,
      timeFormat: String,
      type: {
        type: String,
        default: ""
      },
      clearable: {
        type: Boolean,
        default: true
      },
      clearIcon: {
        type: definePropType([String, Object]),
        default: circle_close_default
      },
      editable: {
        type: Boolean,
        default: true
      },
      prefixIcon: {
        type: definePropType([String, Object]),
        default: ""
      },
      size: useSizeProp,
      readonly: Boolean,
      disabled: Boolean,
      placeholder: {
        type: String,
        default: ""
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      },
      modelValue: {
        type: definePropType([Date, Array, String, Number]),
        default: ""
      },
      rangeSeparator: {
        type: String,
        default: "-"
      },
      startPlaceholder: String,
      endPlaceholder: String,
      defaultValue: {
        type: definePropType([Date, Array])
      },
      defaultTime: {
        type: definePropType([Date, Array])
      },
      isRange: Boolean,
      ...disabledTimeListsProps,
      disabledDate: {
        type: Function
      },
      cellClassName: {
        type: Function
      },
      shortcuts: {
        type: Array,
        default: () => []
      },
      arrowControl: Boolean,
      tabindex: {
        type: definePropType([String, Number]),
        default: 0
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      unlinkPanels: Boolean,
      placement: {
        type: definePropType(String),
        values: Ee,
        default: "bottom"
      },
      fallbackPlacements: {
        type: definePropType(Array),
        default: ["bottom", "top", "right", "left"]
      },
      ...useEmptyValuesProps,
      ...useAriaProps(["ariaLabel"]),
      showNow: {
        type: Boolean,
        default: true
      }
    });
    const timePickerRangeTriggerProps = buildProps({
      id: {
        type: definePropType(Array)
      },
      name: {
        type: definePropType(Array)
      },
      modelValue: {
        type: definePropType([Array, String])
      },
      startPlaceholder: String,
      endPlaceholder: String,
      disabled: Boolean
    });
    const __default__$1b = /* @__PURE__ */ defineComponent({
      name: "PickerRangeTrigger",
      inheritAttrs: false
    });
    const _sfc_main$1O = /* @__PURE__ */ defineComponent({
      ...__default__$1b,
      props: timePickerRangeTriggerProps,
      emits: [
        "mouseenter",
        "mouseleave",
        "click",
        "touchstart",
        "focus",
        "blur",
        "startInput",
        "endInput",
        "startChange",
        "endChange"
      ],
      setup(__props, { expose, emit: emit2 }) {
        const attrs = useAttrs();
        const nsDate = useNamespace("date");
        const nsRange = useNamespace("range");
        const inputRef = ref();
        const endInputRef = ref();
        const { wrapperRef, isFocused } = useFocusController(inputRef);
        const handleClick = (evt) => {
          emit2("click", evt);
        };
        const handleMouseEnter = (evt) => {
          emit2("mouseenter", evt);
        };
        const handleMouseLeave = (evt) => {
          emit2("mouseleave", evt);
        };
        const handleTouchStart = (evt) => {
          emit2("mouseenter", evt);
        };
        const handleStartInput = (evt) => {
          emit2("startInput", evt);
        };
        const handleEndInput = (evt) => {
          emit2("endInput", evt);
        };
        const handleStartChange = (evt) => {
          emit2("startChange", evt);
        };
        const handleEndChange = (evt) => {
          emit2("endChange", evt);
        };
        const focus = () => {
          var _a2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
        };
        const blur = () => {
          var _a2, _b2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
          (_b2 = endInputRef.value) == null ? void 0 : _b2.blur();
        };
        expose({
          focus,
          blur
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "wrapperRef",
            ref: wrapperRef,
            class: normalizeClass([unref(nsDate).is("active", unref(isFocused)), _ctx.$attrs.class]),
            style: normalizeStyle$1(_ctx.$attrs.style),
            onClick: handleClick,
            onMouseenter: handleMouseEnter,
            onMouseleave: handleMouseLeave,
            onTouchstartPassive: handleTouchStart
          }, [
            renderSlot(_ctx.$slots, "prefix"),
            createBaseVNode("input", mergeProps(unref(attrs), {
              id: _ctx.id && _ctx.id[0],
              ref_key: "inputRef",
              ref: inputRef,
              name: _ctx.name && _ctx.name[0],
              placeholder: _ctx.startPlaceholder,
              value: _ctx.modelValue && _ctx.modelValue[0],
              class: unref(nsRange).b("input"),
              disabled: _ctx.disabled,
              onInput: handleStartInput,
              onChange: handleStartChange
            }), null, 16, ["id", "name", "placeholder", "value", "disabled"]),
            renderSlot(_ctx.$slots, "range-separator"),
            createBaseVNode("input", mergeProps(unref(attrs), {
              id: _ctx.id && _ctx.id[1],
              ref_key: "endInputRef",
              ref: endInputRef,
              name: _ctx.name && _ctx.name[1],
              placeholder: _ctx.endPlaceholder,
              value: _ctx.modelValue && _ctx.modelValue[1],
              class: unref(nsRange).b("input"),
              disabled: _ctx.disabled,
              onInput: handleEndInput,
              onChange: handleEndChange
            }), null, 16, ["id", "name", "placeholder", "value", "disabled"]),
            renderSlot(_ctx.$slots, "suffix")
          ], 38);
        };
      }
    });
    var PickerRangeTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["__file", "picker-range-trigger.vue"]]);
    const __default__$1a = /* @__PURE__ */ defineComponent({
      name: "Picker"
    });
    const _sfc_main$1N = /* @__PURE__ */ defineComponent({
      ...__default__$1a,
      props: timePickerDefaultProps,
      emits: [
        UPDATE_MODEL_EVENT,
        CHANGE_EVENT,
        "focus",
        "blur",
        "clear",
        "calendar-change",
        "panel-change",
        "visible-change",
        "keydown"
      ],
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const attrs = useAttrs$1();
        const { lang } = useLocale();
        const nsDate = useNamespace("date");
        const nsInput = useNamespace("input");
        const nsRange = useNamespace("range");
        const { form, formItem } = useFormItem();
        const elPopperOptions = inject("ElPopperOptions", {});
        const { valueOnClear } = useEmptyValues(props2, null);
        const refPopper = ref();
        const inputRef = ref();
        const pickerVisible = ref(false);
        const pickerActualVisible = ref(false);
        const valueOnOpen = ref(null);
        let hasJustTabExitedInput = false;
        const { isFocused, handleFocus, handleBlur } = useFocusController(inputRef, {
          beforeFocus() {
            return props2.readonly || pickerDisabled.value;
          },
          afterFocus() {
            pickerVisible.value = true;
          },
          beforeBlur(event) {
            var _a2;
            return !hasJustTabExitedInput && ((_a2 = refPopper.value) == null ? void 0 : _a2.isFocusInsideContent(event));
          },
          afterBlur() {
            handleChange();
            pickerVisible.value = false;
            hasJustTabExitedInput = false;
            props2.validateEvent && (formItem == null ? void 0 : formItem.validate("blur").catch((err) => debugWarn()));
          }
        });
        const rangeInputKls = computed(() => [
          nsDate.b("editor"),
          nsDate.bm("editor", props2.type),
          nsInput.e("wrapper"),
          nsDate.is("disabled", pickerDisabled.value),
          nsDate.is("active", pickerVisible.value),
          nsRange.b("editor"),
          pickerSize ? nsRange.bm("editor", pickerSize.value) : "",
          attrs.class
        ]);
        const clearIconKls = computed(() => [
          nsInput.e("icon"),
          nsRange.e("close-icon"),
          !showClose.value ? nsRange.e("close-icon--hidden") : ""
        ]);
        watch(pickerVisible, (val) => {
          if (!val) {
            userInput.value = null;
            nextTick(() => {
              emitChange(props2.modelValue);
            });
          } else {
            nextTick(() => {
              if (val) {
                valueOnOpen.value = props2.modelValue;
              }
            });
          }
        });
        const emitChange = (val, isClear) => {
          if (isClear || !valueEquals(val, valueOnOpen.value)) {
            emit2(CHANGE_EVENT, val);
            isClear && (valueOnOpen.value = val);
            props2.validateEvent && (formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn()));
          }
        };
        const emitInput = (input) => {
          if (!valueEquals(props2.modelValue, input)) {
            let formatted;
            if (isArray$5(input)) {
              formatted = input.map((item) => formatter(item, props2.valueFormat, lang.value));
            } else if (input) {
              formatted = formatter(input, props2.valueFormat, lang.value);
            }
            emit2(UPDATE_MODEL_EVENT, input ? formatted : input, lang.value);
          }
        };
        const emitKeydown = (e2) => {
          emit2("keydown", e2);
        };
        const refInput = computed(() => {
          if (inputRef.value) {
            return Array.from(inputRef.value.$el.querySelectorAll("input"));
          }
          return [];
        });
        const setSelectionRange = (start2, end2, pos) => {
          const _inputs = refInput.value;
          if (!_inputs.length)
            return;
          if (!pos || pos === "min") {
            _inputs[0].setSelectionRange(start2, end2);
            _inputs[0].focus();
          } else if (pos === "max") {
            _inputs[1].setSelectionRange(start2, end2);
            _inputs[1].focus();
          }
        };
        const onPick = (date = "", visible = false) => {
          pickerVisible.value = visible;
          let result;
          if (isArray$5(date)) {
            result = date.map((_2) => _2.toDate());
          } else {
            result = date ? date.toDate() : date;
          }
          userInput.value = null;
          emitInput(result);
        };
        const onBeforeShow = () => {
          pickerActualVisible.value = true;
        };
        const onShow = () => {
          emit2("visible-change", true);
        };
        const onHide = () => {
          pickerActualVisible.value = false;
          pickerVisible.value = false;
          emit2("visible-change", false);
        };
        const handleOpen = () => {
          pickerVisible.value = true;
        };
        const handleClose = () => {
          pickerVisible.value = false;
        };
        const pickerDisabled = computed(() => {
          return props2.disabled || (form == null ? void 0 : form.disabled);
        });
        const parsedValue = computed(() => {
          let dayOrDays;
          if (valueIsEmpty.value) {
            if (pickerOptions.value.getDefaultValue) {
              dayOrDays = pickerOptions.value.getDefaultValue();
            }
          } else {
            if (isArray$5(props2.modelValue)) {
              dayOrDays = props2.modelValue.map((d2) => parseDate$2(d2, props2.valueFormat, lang.value));
            } else {
              dayOrDays = parseDate$2(props2.modelValue, props2.valueFormat, lang.value);
            }
          }
          if (pickerOptions.value.getRangeAvailableTime) {
            const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays);
            if (!isEqual$1(availableResult, dayOrDays)) {
              dayOrDays = availableResult;
              if (!valueIsEmpty.value) {
                emitInput(dayOrDaysToDate(dayOrDays));
              }
            }
          }
          if (isArray$5(dayOrDays) && dayOrDays.some((day) => !day)) {
            dayOrDays = [];
          }
          return dayOrDays;
        });
        const displayValue = computed(() => {
          if (!pickerOptions.value.panelReady)
            return "";
          const formattedValue = formatDayjsToString(parsedValue.value);
          if (isArray$5(userInput.value)) {
            return [
              userInput.value[0] || formattedValue && formattedValue[0] || "",
              userInput.value[1] || formattedValue && formattedValue[1] || ""
            ];
          } else if (userInput.value !== null) {
            return userInput.value;
          }
          if (!isTimePicker.value && valueIsEmpty.value)
            return "";
          if (!pickerVisible.value && valueIsEmpty.value)
            return "";
          if (formattedValue) {
            return isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value ? formattedValue.join(", ") : formattedValue;
          }
          return "";
        });
        const isTimeLikePicker = computed(() => props2.type.includes("time"));
        const isTimePicker = computed(() => props2.type.startsWith("time"));
        const isDatesPicker = computed(() => props2.type === "dates");
        const isMonthsPicker = computed(() => props2.type === "months");
        const isYearsPicker = computed(() => props2.type === "years");
        const triggerIcon = computed(() => props2.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default));
        const showClose = ref(false);
        const onClearIconClick = (event) => {
          if (props2.readonly || pickerDisabled.value)
            return;
          if (showClose.value) {
            event.stopPropagation();
            if (pickerOptions.value.handleClear) {
              pickerOptions.value.handleClear();
            } else {
              emitInput(valueOnClear.value);
            }
            emitChange(valueOnClear.value, true);
            showClose.value = false;
            onHide();
          }
          emit2("clear");
        };
        const valueIsEmpty = computed(() => {
          const { modelValue } = props2;
          return !modelValue || isArray$5(modelValue) && !modelValue.filter(Boolean).length;
        });
        const onMouseDownInput = async (event) => {
          var _a2;
          if (props2.readonly || pickerDisabled.value)
            return;
          if (((_a2 = event.target) == null ? void 0 : _a2.tagName) !== "INPUT" || isFocused.value) {
            pickerVisible.value = true;
          }
        };
        const onMouseEnter = () => {
          if (props2.readonly || pickerDisabled.value)
            return;
          if (!valueIsEmpty.value && props2.clearable) {
            showClose.value = true;
          }
        };
        const onMouseLeave = () => {
          showClose.value = false;
        };
        const onTouchStartInput = (event) => {
          var _a2;
          if (props2.readonly || pickerDisabled.value)
            return;
          if (((_a2 = event.touches[0].target) == null ? void 0 : _a2.tagName) !== "INPUT" || isFocused.value) {
            pickerVisible.value = true;
          }
        };
        const isRangeInput = computed(() => {
          return props2.type.includes("range");
        });
        const pickerSize = useFormSize();
        const popperEl = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = unref(refPopper)) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef;
        });
        const stophandle = onClickOutside(inputRef, (e2) => {
          const unrefedPopperEl = unref(popperEl);
          const inputEl = unrefElement(inputRef);
          if (unrefedPopperEl && (e2.target === unrefedPopperEl || e2.composedPath().includes(unrefedPopperEl)) || e2.target === inputEl || inputEl && e2.composedPath().includes(inputEl))
            return;
          pickerVisible.value = false;
        });
        onBeforeUnmount(() => {
          stophandle == null ? void 0 : stophandle();
        });
        const userInput = ref(null);
        const handleChange = () => {
          if (userInput.value) {
            const value = parseUserInputToDayjs(displayValue.value);
            if (value) {
              if (isValidValue2(value)) {
                emitInput(dayOrDaysToDate(value));
                userInput.value = null;
              }
            }
          }
          if (userInput.value === "") {
            emitInput(valueOnClear.value);
            emitChange(valueOnClear.value, true);
            userInput.value = null;
          }
        };
        const parseUserInputToDayjs = (value) => {
          if (!value)
            return null;
          return pickerOptions.value.parseUserInput(value);
        };
        const formatDayjsToString = (value) => {
          if (!value)
            return null;
          return pickerOptions.value.formatToString(value);
        };
        const isValidValue2 = (value) => {
          return pickerOptions.value.isValidValue(value);
        };
        const handleKeydownInput = async (event) => {
          if (props2.readonly || pickerDisabled.value)
            return;
          const { code } = event;
          emitKeydown(event);
          if (code === EVENT_CODE.esc) {
            if (pickerVisible.value === true) {
              pickerVisible.value = false;
              event.preventDefault();
              event.stopPropagation();
            }
            return;
          }
          if (code === EVENT_CODE.down) {
            if (pickerOptions.value.handleFocusPicker) {
              event.preventDefault();
              event.stopPropagation();
            }
            if (pickerVisible.value === false) {
              pickerVisible.value = true;
              await nextTick();
            }
            if (pickerOptions.value.handleFocusPicker) {
              pickerOptions.value.handleFocusPicker();
              return;
            }
          }
          if (code === EVENT_CODE.tab) {
            hasJustTabExitedInput = true;
            return;
          }
          if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) {
            if (userInput.value === null || userInput.value === "" || isValidValue2(parseUserInputToDayjs(displayValue.value))) {
              handleChange();
              pickerVisible.value = false;
            }
            event.stopPropagation();
            return;
          }
          if (userInput.value) {
            event.stopPropagation();
            return;
          }
          if (pickerOptions.value.handleKeydownInput) {
            pickerOptions.value.handleKeydownInput(event);
          }
        };
        const onUserInput = (e2) => {
          userInput.value = e2;
          if (!pickerVisible.value) {
            pickerVisible.value = true;
          }
        };
        const handleStartInput = (event) => {
          const target = event.target;
          if (userInput.value) {
            userInput.value = [target.value, userInput.value[1]];
          } else {
            userInput.value = [target.value, null];
          }
        };
        const handleEndInput = (event) => {
          const target = event.target;
          if (userInput.value) {
            userInput.value = [userInput.value[0], target.value];
          } else {
            userInput.value = [null, target.value];
          }
        };
        const handleStartChange = () => {
          var _a2;
          const values = userInput.value;
          const value = parseUserInputToDayjs(values && values[0]);
          const parsedVal = unref(parsedValue);
          if (value && value.isValid()) {
            userInput.value = [
              formatDayjsToString(value),
              ((_a2 = displayValue.value) == null ? void 0 : _a2[1]) || null
            ];
            const newValue = [value, parsedVal && (parsedVal[1] || null)];
            if (isValidValue2(newValue)) {
              emitInput(dayOrDaysToDate(newValue));
              userInput.value = null;
            }
          }
        };
        const handleEndChange = () => {
          var _a2;
          const values = unref(userInput);
          const value = parseUserInputToDayjs(values && values[1]);
          const parsedVal = unref(parsedValue);
          if (value && value.isValid()) {
            userInput.value = [
              ((_a2 = unref(displayValue)) == null ? void 0 : _a2[0]) || null,
              formatDayjsToString(value)
            ];
            const newValue = [parsedVal && parsedVal[0], value];
            if (isValidValue2(newValue)) {
              emitInput(dayOrDaysToDate(newValue));
              userInput.value = null;
            }
          }
        };
        const pickerOptions = ref({});
        const onSetPickerOption = (e2) => {
          pickerOptions.value[e2[0]] = e2[1];
          pickerOptions.value.panelReady = true;
        };
        const onCalendarChange = (e2) => {
          emit2("calendar-change", e2);
        };
        const onPanelChange = (value, mode, view) => {
          emit2("panel-change", value, mode, view);
        };
        const focus = () => {
          var _a2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
        };
        const blur = () => {
          var _a2;
          (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
        };
        provide("EP_PICKER_BASE", {
          props: props2
        });
        expose({
          focus,
          blur,
          handleOpen,
          handleClose,
          onPick
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), mergeProps({
            ref_key: "refPopper",
            ref: refPopper,
            visible: pickerVisible.value,
            effect: "light",
            pure: "",
            trigger: "click"
          }, _ctx.$attrs, {
            role: "dialog",
            teleported: "",
            transition: `${unref(nsDate).namespace.value}-zoom-in-top`,
            "popper-class": [`${unref(nsDate).namespace.value}-picker__popper`, _ctx.popperClass],
            "popper-options": unref(elPopperOptions),
            "fallback-placements": _ctx.fallbackPlacements,
            "gpu-acceleration": false,
            placement: _ctx.placement,
            "stop-popper-mouse-event": false,
            "hide-after": 0,
            persistent: "",
            onBeforeShow,
            onShow,
            onHide
          }), {
            default: withCtx(() => [
              !unref(isRangeInput) ? (openBlock(), createBlock(unref(ElInput), {
                key: 0,
                id: _ctx.id,
                ref_key: "inputRef",
                ref: inputRef,
                "container-role": "combobox",
                "model-value": unref(displayValue),
                name: _ctx.name,
                size: unref(pickerSize),
                disabled: unref(pickerDisabled),
                placeholder: _ctx.placeholder,
                class: normalizeClass([unref(nsDate).b("editor"), unref(nsDate).bm("editor", _ctx.type), _ctx.$attrs.class]),
                style: normalizeStyle$1(_ctx.$attrs.style),
                readonly: !_ctx.editable || _ctx.readonly || unref(isDatesPicker) || unref(isMonthsPicker) || unref(isYearsPicker) || _ctx.type === "week",
                "aria-label": _ctx.ariaLabel,
                tabindex: _ctx.tabindex,
                "validate-event": false,
                onInput: onUserInput,
                onFocus: unref(handleFocus),
                onBlur: unref(handleBlur),
                onKeydown: handleKeydownInput,
                onChange: handleChange,
                onMousedown: onMouseDownInput,
                onMouseenter: onMouseEnter,
                onMouseleave: onMouseLeave,
                onTouchstartPassive: onTouchStartInput,
                onClick: withModifiers(() => {
                }, ["stop"])
              }, {
                prefix: withCtx(() => [
                  unref(triggerIcon) ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(unref(nsInput).e("icon")),
                    onMousedown: withModifiers(onMouseDownInput, ["prevent"]),
                    onTouchstartPassive: onTouchStartInput
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(unref(triggerIcon))))
                    ]),
                    _: 1
                  }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
                ]),
                suffix: withCtx(() => [
                  showClose.value && _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(`${unref(nsInput).e("icon")} clear-icon`),
                    onMousedown: withModifiers(unref(NOOP), ["prevent"]),
                    onClick: onClearIconClick
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
                    ]),
                    _: 1
                  }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
                ]),
                _: 1
              }, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "aria-label", "tabindex", "onFocus", "onBlur", "onClick"])) : (openBlock(), createBlock(PickerRangeTrigger, {
                key: 1,
                id: _ctx.id,
                ref_key: "inputRef",
                ref: inputRef,
                "model-value": unref(displayValue),
                name: _ctx.name,
                disabled: unref(pickerDisabled),
                readonly: !_ctx.editable || _ctx.readonly,
                "start-placeholder": _ctx.startPlaceholder,
                "end-placeholder": _ctx.endPlaceholder,
                class: normalizeClass(unref(rangeInputKls)),
                style: normalizeStyle$1(_ctx.$attrs.style),
                "aria-label": _ctx.ariaLabel,
                tabindex: _ctx.tabindex,
                autocomplete: "off",
                role: "combobox",
                onClick: onMouseDownInput,
                onFocus: unref(handleFocus),
                onBlur: unref(handleBlur),
                onStartInput: handleStartInput,
                onStartChange: handleStartChange,
                onEndInput: handleEndInput,
                onEndChange: handleEndChange,
                onMousedown: onMouseDownInput,
                onMouseenter: onMouseEnter,
                onMouseleave: onMouseLeave,
                onTouchstartPassive: onTouchStartInput,
                onKeydown: handleKeydownInput
              }, {
                prefix: withCtx(() => [
                  unref(triggerIcon) ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass([unref(nsInput).e("icon"), unref(nsRange).e("icon")])
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(unref(triggerIcon))))
                    ]),
                    _: 1
                  }, 8, ["class"])) : createCommentVNode("v-if", true)
                ]),
                "range-separator": withCtx(() => [
                  renderSlot(_ctx.$slots, "range-separator", {}, () => [
                    createBaseVNode("span", {
                      class: normalizeClass(unref(nsRange).b("separator"))
                    }, toDisplayString(_ctx.rangeSeparator), 3)
                  ])
                ]),
                suffix: withCtx(() => [
                  _ctx.clearIcon ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(unref(clearIconKls)),
                    onMousedown: withModifiers(unref(NOOP), ["prevent"]),
                    onClick: onClearIconClick
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
                    ]),
                    _: 1
                  }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true)
                ]),
                _: 3
              }, 8, ["id", "model-value", "name", "disabled", "readonly", "start-placeholder", "end-placeholder", "class", "style", "aria-label", "tabindex", "onFocus", "onBlur"]))
            ]),
            content: withCtx(() => [
              renderSlot(_ctx.$slots, "default", {
                visible: pickerVisible.value,
                actualVisible: pickerActualVisible.value,
                parsedValue: unref(parsedValue),
                format: _ctx.format,
                dateFormat: _ctx.dateFormat,
                timeFormat: _ctx.timeFormat,
                unlinkPanels: _ctx.unlinkPanels,
                type: _ctx.type,
                defaultValue: _ctx.defaultValue,
                showNow: _ctx.showNow,
                onPick,
                onSelectRange: setSelectionRange,
                onSetPickerOption,
                onCalendarChange,
                onPanelChange,
                onMousedown: withModifiers(() => {
                }, ["stop"])
              })
            ]),
            _: 3
          }, 16, ["visible", "transition", "popper-class", "popper-options", "fallback-placements", "placement"]);
        };
      }
    });
    var CommonPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["__file", "picker.vue"]]);
    const panelTimePickerProps = buildProps({
      ...timePanelSharedProps,
      datetimeRole: String,
      parsedValue: {
        type: definePropType(Object)
      }
    });
    const useTimePanel = ({
      getAvailableHours,
      getAvailableMinutes,
      getAvailableSeconds
    }) => {
      const getAvailableTime = (date, role, first, compareDate) => {
        const availableTimeGetters = {
          hour: getAvailableHours,
          minute: getAvailableMinutes,
          second: getAvailableSeconds
        };
        let result = date;
        ["hour", "minute", "second"].forEach((type) => {
          if (availableTimeGetters[type]) {
            let availableTimeSlots;
            const method = availableTimeGetters[type];
            switch (type) {
              case "minute": {
                availableTimeSlots = method(result.hour(), role, compareDate);
                break;
              }
              case "second": {
                availableTimeSlots = method(result.hour(), result.minute(), role, compareDate);
                break;
              }
              default: {
                availableTimeSlots = method(role, compareDate);
                break;
              }
            }
            if ((availableTimeSlots == null ? void 0 : availableTimeSlots.length) && !availableTimeSlots.includes(result[type]())) {
              const pos = first ? 0 : availableTimeSlots.length - 1;
              result = result[type](availableTimeSlots[pos]);
            }
          }
        });
        return result;
      };
      const timePickerOptions = {};
      const onSetOption = ([key, val]) => {
        timePickerOptions[key] = val;
      };
      return {
        timePickerOptions,
        getAvailableTime,
        onSetOption
      };
    };
    const makeAvailableArr = (disabledList) => {
      const trueOrNumber = (isDisabled, index) => isDisabled || index;
      const getNumber = (predicate) => predicate !== true;
      return disabledList.map(trueOrNumber).filter(getNumber);
    };
    const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
      const getHoursList = (role, compare2) => {
        return makeList(24, disabledHours && (() => disabledHours == null ? void 0 : disabledHours(role, compare2)));
      };
      const getMinutesList = (hour, role, compare2) => {
        return makeList(60, disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare2)));
      };
      const getSecondsList = (hour, minute, role, compare2) => {
        return makeList(60, disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare2)));
      };
      return {
        getHoursList,
        getMinutesList,
        getSecondsList
      };
    };
    const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
      const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds);
      const getAvailableHours = (role, compare2) => {
        return makeAvailableArr(getHoursList(role, compare2));
      };
      const getAvailableMinutes = (hour, role, compare2) => {
        return makeAvailableArr(getMinutesList(hour, role, compare2));
      };
      const getAvailableSeconds = (hour, minute, role, compare2) => {
        return makeAvailableArr(getSecondsList(hour, minute, role, compare2));
      };
      return {
        getAvailableHours,
        getAvailableMinutes,
        getAvailableSeconds
      };
    };
    const useOldValue = (props2) => {
      const oldValue = ref(props2.parsedValue);
      watch(() => props2.visible, (val) => {
        if (!val) {
          oldValue.value = props2.parsedValue;
        }
      });
      return oldValue;
    };
    const basicTimeSpinnerProps = buildProps({
      role: {
        type: String,
        required: true
      },
      spinnerDate: {
        type: definePropType(Object),
        required: true
      },
      showSeconds: {
        type: Boolean,
        default: true
      },
      arrowControl: Boolean,
      amPmMode: {
        type: definePropType(String),
        default: ""
      },
      ...disabledTimeListsProps
    });
    const REPEAT_INTERVAL = 100;
    const REPEAT_DELAY = 600;
    const vRepeatClick = {
      beforeMount(el, binding) {
        const value = binding.value;
        const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$4(value) ? {} : value;
        let intervalId;
        let delayId;
        const handler = () => isFunction$4(value) ? value() : value.handler();
        const clear2 = () => {
          if (delayId) {
            clearTimeout(delayId);
            delayId = void 0;
          }
          if (intervalId) {
            clearInterval(intervalId);
            intervalId = void 0;
          }
        };
        el.addEventListener("mousedown", (evt) => {
          if (evt.button !== 0)
            return;
          clear2();
          handler();
          document.addEventListener("mouseup", () => clear2(), {
            once: true
          });
          delayId = setTimeout(() => {
            intervalId = setInterval(() => {
              handler();
            }, interval);
          }, delay);
        });
      }
    };
    const _sfc_main$1M = /* @__PURE__ */ defineComponent({
      __name: "basic-time-spinner",
      props: basicTimeSpinnerProps,
      emits: [CHANGE_EVENT, "select-range", "set-option"],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const pickerBase = inject("EP_PICKER_BASE");
        const { isRange, format: format2 } = pickerBase.props;
        const ns = useNamespace("time");
        const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props2.disabledHours, props2.disabledMinutes, props2.disabledSeconds);
        let isScrolling = false;
        const currentScrollbar = ref();
        const listHoursRef = ref();
        const listMinutesRef = ref();
        const listSecondsRef = ref();
        const listRefsMap = {
          hours: listHoursRef,
          minutes: listMinutesRef,
          seconds: listSecondsRef
        };
        const spinnerItems = computed(() => {
          return props2.showSeconds ? timeUnits$2 : timeUnits$2.slice(0, 2);
        });
        const timePartials = computed(() => {
          const { spinnerDate } = props2;
          const hours = spinnerDate.hour();
          const minutes = spinnerDate.minute();
          const seconds = spinnerDate.second();
          return { hours, minutes, seconds };
        });
        const timeList = computed(() => {
          const { hours, minutes } = unref(timePartials);
          const { role, spinnerDate } = props2;
          const compare2 = !isRange ? spinnerDate : void 0;
          return {
            hours: getHoursList(role, compare2),
            minutes: getMinutesList(hours, role, compare2),
            seconds: getSecondsList(hours, minutes, role, compare2)
          };
        });
        const arrowControlTimeList = computed(() => {
          const { hours, minutes, seconds } = unref(timePartials);
          return {
            hours: buildTimeList(hours, 23),
            minutes: buildTimeList(minutes, 59),
            seconds: buildTimeList(seconds, 59)
          };
        });
        const debouncedResetScroll = debounce((type) => {
          isScrolling = false;
          adjustCurrentSpinner(type);
        }, 200);
        const getAmPmFlag = (hour) => {
          const shouldShowAmPm = !!props2.amPmMode;
          if (!shouldShowAmPm)
            return "";
          const isCapital = props2.amPmMode === "A";
          let content2 = hour < 12 ? " am" : " pm";
          if (isCapital)
            content2 = content2.toUpperCase();
          return content2;
        };
        const emitSelectRange = (type) => {
          let range2 = [0, 0];
          if (!format2 || format2 === DEFAULT_FORMATS_TIME) {
            switch (type) {
              case "hours":
                range2 = [0, 2];
                break;
              case "minutes":
                range2 = [3, 5];
                break;
              case "seconds":
                range2 = [6, 8];
                break;
            }
          }
          const [left, right] = range2;
          emit2("select-range", left, right);
          currentScrollbar.value = type;
        };
        const adjustCurrentSpinner = (type) => {
          adjustSpinner(type, unref(timePartials)[type]);
        };
        const adjustSpinners = () => {
          adjustCurrentSpinner("hours");
          adjustCurrentSpinner("minutes");
          adjustCurrentSpinner("seconds");
        };
        const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
        const adjustSpinner = (type, value) => {
          if (props2.arrowControl)
            return;
          const scrollbar = unref(listRefsMap[type]);
          if (scrollbar && scrollbar.$el) {
            getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type));
          }
        };
        const typeItemHeight = (type) => {
          const scrollbar = unref(listRefsMap[type]);
          const listItem = scrollbar == null ? void 0 : scrollbar.$el.querySelector("li");
          if (listItem) {
            return Number.parseFloat(getStyle$1(listItem, "height")) || 0;
          }
          return 0;
        };
        const onIncrement = () => {
          scrollDown(1);
        };
        const onDecrement = () => {
          scrollDown(-1);
        };
        const scrollDown = (step) => {
          if (!currentScrollbar.value) {
            emitSelectRange("hours");
          }
          const label = currentScrollbar.value;
          const now2 = unref(timePartials)[label];
          const total2 = currentScrollbar.value === "hours" ? 24 : 60;
          const next = findNextUnDisabled(label, now2, step, total2);
          modifyDateField(label, next);
          adjustSpinner(label, next);
          nextTick(() => emitSelectRange(label));
        };
        const findNextUnDisabled = (type, now2, step, total2) => {
          let next = (now2 + step + total2) % total2;
          const list = unref(timeList)[type];
          while (list[next] && next !== now2) {
            next = (next + step + total2) % total2;
          }
          return next;
        };
        const modifyDateField = (type, value) => {
          const list = unref(timeList)[type];
          const isDisabled = list[value];
          if (isDisabled)
            return;
          const { hours, minutes, seconds } = unref(timePartials);
          let changeTo;
          switch (type) {
            case "hours":
              changeTo = props2.spinnerDate.hour(value).minute(minutes).second(seconds);
              break;
            case "minutes":
              changeTo = props2.spinnerDate.hour(hours).minute(value).second(seconds);
              break;
            case "seconds":
              changeTo = props2.spinnerDate.hour(hours).minute(minutes).second(value);
              break;
          }
          emit2(CHANGE_EVENT, changeTo);
        };
        const handleClick = (type, { value, disabled }) => {
          if (!disabled) {
            modifyDateField(type, value);
            emitSelectRange(type);
            adjustSpinner(type, value);
          }
        };
        const handleScroll2 = (type) => {
          const scrollbar = unref(listRefsMap[type]);
          if (!scrollbar)
            return;
          isScrolling = true;
          debouncedResetScroll(type);
          const value = Math.min(Math.round((getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59);
          modifyDateField(type, value);
        };
        const scrollBarHeight = (type) => {
          return unref(listRefsMap[type]).$el.offsetHeight;
        };
        const bindScrollEvent = () => {
          const bindFunction = (type) => {
            const scrollbar = unref(listRefsMap[type]);
            if (scrollbar && scrollbar.$el) {
              getScrollbarElement(scrollbar.$el).onscroll = () => {
                handleScroll2(type);
              };
            }
          };
          bindFunction("hours");
          bindFunction("minutes");
          bindFunction("seconds");
        };
        onMounted(() => {
          nextTick(() => {
            !props2.arrowControl && bindScrollEvent();
            adjustSpinners();
            if (props2.role === "start")
              emitSelectRange("hours");
          });
        });
        const setRef2 = (scrollbar, type) => {
          listRefsMap[type].value = scrollbar != null ? scrollbar : void 0;
        };
        emit2("set-option", [`${props2.role}_scrollDown`, scrollDown]);
        emit2("set-option", [`${props2.role}_emitSelectRange`, emitSelectRange]);
        watch(() => props2.spinnerDate, () => {
          if (isScrolling)
            return;
          adjustSpinners();
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }])
          }, [
            !_ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(spinnerItems), (item) => {
              return openBlock(), createBlock(unref(ElScrollbar), {
                key: item,
                ref_for: true,
                ref: (scrollbar) => setRef2(scrollbar, item),
                class: normalizeClass(unref(ns).be("spinner", "wrapper")),
                "wrap-style": "max-height: inherit;",
                "view-class": unref(ns).be("spinner", "list"),
                noresize: "",
                tag: "ul",
                onMouseenter: ($event) => emitSelectRange(item),
                onMousemove: ($event) => adjustCurrentSpinner(item)
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(timeList)[item], (disabled, key) => {
                    return openBlock(), createElementBlock("li", {
                      key,
                      class: normalizeClass([
                        unref(ns).be("spinner", "item"),
                        unref(ns).is("active", key === unref(timePartials)[item]),
                        unref(ns).is("disabled", disabled)
                      ]),
                      onClick: ($event) => handleClick(item, { value: key, disabled })
                    }, [
                      item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                        createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + toDisplayString(getAmPmFlag(key)), 1)
                      ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                        createTextVNode(toDisplayString(("0" + key).slice(-2)), 1)
                      ], 64))
                    ], 10, ["onClick"]);
                  }), 128))
                ]),
                _: 2
              }, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]);
            }), 128)) : createCommentVNode("v-if", true),
            _ctx.arrowControl ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(spinnerItems), (item) => {
              return openBlock(), createElementBlock("div", {
                key: item,
                class: normalizeClass([unref(ns).be("spinner", "wrapper"), unref(ns).is("arrow")]),
                onMouseenter: ($event) => emitSelectRange(item)
              }, [
                withDirectives((openBlock(), createBlock(unref(ElIcon), {
                  class: normalizeClass(["arrow-up", unref(ns).be("spinner", "arrow")])
                }, {
                  default: withCtx(() => [
                    createVNode$1(unref(arrow_up_default))
                  ]),
                  _: 1
                }, 8, ["class"])), [
                  [unref(vRepeatClick), onDecrement]
                ]),
                withDirectives((openBlock(), createBlock(unref(ElIcon), {
                  class: normalizeClass(["arrow-down", unref(ns).be("spinner", "arrow")])
                }, {
                  default: withCtx(() => [
                    createVNode$1(unref(arrow_down_default))
                  ]),
                  _: 1
                }, 8, ["class"])), [
                  [unref(vRepeatClick), onIncrement]
                ]),
                createBaseVNode("ul", {
                  class: normalizeClass(unref(ns).be("spinner", "list"))
                }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(arrowControlTimeList)[item], (time2, key) => {
                    return openBlock(), createElementBlock("li", {
                      key,
                      class: normalizeClass([
                        unref(ns).be("spinner", "item"),
                        unref(ns).is("active", time2 === unref(timePartials)[item]),
                        unref(ns).is("disabled", unref(timeList)[item][time2])
                      ])
                    }, [
                      unref(isNumber$2)(time2) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                        item === "hours" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                          createTextVNode(toDisplayString(("0" + (_ctx.amPmMode ? time2 % 12 || 12 : time2)).slice(-2)) + toDisplayString(getAmPmFlag(time2)), 1)
                        ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                          createTextVNode(toDisplayString(("0" + time2).slice(-2)), 1)
                        ], 64))
                      ], 64)) : createCommentVNode("v-if", true)
                    ], 2);
                  }), 128))
                ], 2)
              ], 42, ["onMouseenter"]);
            }), 128)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var TimeSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["__file", "basic-time-spinner.vue"]]);
    const _sfc_main$1L = /* @__PURE__ */ defineComponent({
      __name: "panel-time-pick",
      props: panelTimePickerProps,
      emits: ["pick", "select-range", "set-picker-option"],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const pickerBase = inject("EP_PICKER_BASE");
        const {
          arrowControl,
          disabledHours,
          disabledMinutes,
          disabledSeconds,
          defaultValue
        } = pickerBase.props;
        const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds);
        const ns = useNamespace("time");
        const { t, lang } = useLocale();
        const selectionRange = ref([0, 2]);
        const oldValue = useOldValue(props2);
        const transitionName = computed(() => {
          return isUndefined$1(props2.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : "";
        });
        const showSeconds = computed(() => {
          return props2.format.includes("ss");
        });
        const amPmMode = computed(() => {
          if (props2.format.includes("A"))
            return "A";
          if (props2.format.includes("a"))
            return "a";
          return "";
        });
        const isValidValue2 = (_date) => {
          const parsedDate = dayjs(_date).locale(lang.value);
          const result = getRangeAvailableTime(parsedDate);
          return parsedDate.isSame(result);
        };
        const handleCancel = () => {
          emit2("pick", oldValue.value, false);
        };
        const handleConfirm = (visible = false, first = false) => {
          if (first)
            return;
          emit2("pick", props2.parsedValue, visible);
        };
        const handleChange = (_date) => {
          if (!props2.visible) {
            return;
          }
          const result = getRangeAvailableTime(_date).millisecond(0);
          emit2("pick", result, true);
        };
        const setSelectionRange = (start2, end2) => {
          emit2("select-range", start2, end2);
          selectionRange.value = [start2, end2];
        };
        const changeSelectionRange = (step) => {
          const list = [0, 3].concat(showSeconds.value ? [6] : []);
          const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
          const index = list.indexOf(selectionRange.value[0]);
          const next = (index + step + list.length) % list.length;
          timePickerOptions["start_emitSelectRange"](mapping[next]);
        };
        const handleKeydown = (event) => {
          const code = event.code;
          const { left, right, up, down } = EVENT_CODE;
          if ([left, right].includes(code)) {
            const step = code === left ? -1 : 1;
            changeSelectionRange(step);
            event.preventDefault();
            return;
          }
          if ([up, down].includes(code)) {
            const step = code === up ? -1 : 1;
            timePickerOptions["start_scrollDown"](step);
            event.preventDefault();
            return;
          }
        };
        const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({
          getAvailableHours,
          getAvailableMinutes,
          getAvailableSeconds
        });
        const getRangeAvailableTime = (date) => {
          return getAvailableTime(date, props2.datetimeRole || "", true);
        };
        const parseUserInput = (value) => {
          if (!value)
            return null;
          return dayjs(value, props2.format).locale(lang.value);
        };
        const formatToString = (value) => {
          if (!value)
            return null;
          return value.format(props2.format);
        };
        const getDefaultValue2 = () => {
          return dayjs(defaultValue).locale(lang.value);
        };
        emit2("set-picker-option", ["isValidValue", isValidValue2]);
        emit2("set-picker-option", ["formatToString", formatToString]);
        emit2("set-picker-option", ["parseUserInput", parseUserInput]);
        emit2("set-picker-option", ["handleKeydownInput", handleKeydown]);
        emit2("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
        emit2("set-picker-option", ["getDefaultValue", getDefaultValue2]);
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, { name: unref(transitionName) }, {
            default: withCtx(() => [
              _ctx.actualVisible || _ctx.visible ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).b("panel"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass([unref(ns).be("panel", "content"), { "has-seconds": unref(showSeconds) }])
                }, [
                  createVNode$1(TimeSpinner, {
                    ref: "spinner",
                    role: _ctx.datetimeRole || "start",
                    "arrow-control": unref(arrowControl),
                    "show-seconds": unref(showSeconds),
                    "am-pm-mode": unref(amPmMode),
                    "spinner-date": _ctx.parsedValue,
                    "disabled-hours": unref(disabledHours),
                    "disabled-minutes": unref(disabledMinutes),
                    "disabled-seconds": unref(disabledSeconds),
                    onChange: handleChange,
                    onSetOption: unref(onSetOption),
                    onSelectRange: setSelectionRange
                  }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
                ], 2),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).be("panel", "footer"))
                }, [
                  createBaseVNode("button", {
                    type: "button",
                    class: normalizeClass([unref(ns).be("panel", "btn"), "cancel"]),
                    onClick: handleCancel
                  }, toDisplayString(unref(t)("el.datepicker.cancel")), 3),
                  createBaseVNode("button", {
                    type: "button",
                    class: normalizeClass([unref(ns).be("panel", "btn"), "confirm"]),
                    onClick: ($event) => handleConfirm()
                  }, toDisplayString(unref(t)("el.datepicker.confirm")), 11, ["onClick"])
                ], 2)
              ], 2)) : createCommentVNode("v-if", true)
            ]),
            _: 1
          }, 8, ["name"]);
        };
      }
    });
    var TimePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["__file", "panel-time-pick.vue"]]);
    const panelTimeRangeProps = buildProps({
      ...timePanelSharedProps,
      parsedValue: {
        type: definePropType(Array)
      }
    });
    const _sfc_main$1K = /* @__PURE__ */ defineComponent({
      __name: "panel-time-range",
      props: panelTimeRangeProps,
      emits: ["pick", "select-range", "set-picker-option"],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const makeSelectRange = (start2, end2) => {
          const result = [];
          for (let i2 = start2; i2 <= end2; i2++) {
            result.push(i2);
          }
          return result;
        };
        const { t, lang } = useLocale();
        const nsTime = useNamespace("time");
        const nsPicker = useNamespace("picker");
        const pickerBase = inject("EP_PICKER_BASE");
        const {
          arrowControl,
          disabledHours,
          disabledMinutes,
          disabledSeconds,
          defaultValue
        } = pickerBase.props;
        const startContainerKls = computed(() => [
          nsTime.be("range-picker", "body"),
          nsTime.be("panel", "content"),
          nsTime.is("arrow", arrowControl),
          showSeconds.value ? "has-seconds" : ""
        ]);
        const endContainerKls = computed(() => [
          nsTime.be("range-picker", "body"),
          nsTime.be("panel", "content"),
          nsTime.is("arrow", arrowControl),
          showSeconds.value ? "has-seconds" : ""
        ]);
        const startTime = computed(() => props2.parsedValue[0]);
        const endTime = computed(() => props2.parsedValue[1]);
        const oldValue = useOldValue(props2);
        const handleCancel = () => {
          emit2("pick", oldValue.value, false);
        };
        const showSeconds = computed(() => {
          return props2.format.includes("ss");
        });
        const amPmMode = computed(() => {
          if (props2.format.includes("A"))
            return "A";
          if (props2.format.includes("a"))
            return "a";
          return "";
        });
        const handleConfirm = (visible = false) => {
          emit2("pick", [startTime.value, endTime.value], visible);
        };
        const handleMinChange = (date) => {
          handleChange(date.millisecond(0), endTime.value);
        };
        const handleMaxChange = (date) => {
          handleChange(startTime.value, date.millisecond(0));
        };
        const isValidValue2 = (_date) => {
          const parsedDate = _date.map((_2) => dayjs(_2).locale(lang.value));
          const result = getRangeAvailableTime(parsedDate);
          return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]);
        };
        const handleChange = (start2, end2) => {
          if (!props2.visible) {
            return;
          }
          emit2("pick", [start2, end2], true);
        };
        const btnConfirmDisabled = computed(() => {
          return startTime.value > endTime.value;
        });
        const selectionRange = ref([0, 2]);
        const setMinSelectionRange = (start2, end2) => {
          emit2("select-range", start2, end2, "min");
          selectionRange.value = [start2, end2];
        };
        const offset2 = computed(() => showSeconds.value ? 11 : 8);
        const setMaxSelectionRange = (start2, end2) => {
          emit2("select-range", start2, end2, "max");
          const _offset = unref(offset2);
          selectionRange.value = [start2 + _offset, end2 + _offset];
        };
        const changeSelectionRange = (step) => {
          const list = showSeconds.value ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
          const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
          const index = list.indexOf(selectionRange.value[0]);
          const next = (index + step + list.length) % list.length;
          const half = list.length / 2;
          if (next < half) {
            timePickerOptions["start_emitSelectRange"](mapping[next]);
          } else {
            timePickerOptions["end_emitSelectRange"](mapping[next - half]);
          }
        };
        const handleKeydown = (event) => {
          const code = event.code;
          const { left, right, up, down } = EVENT_CODE;
          if ([left, right].includes(code)) {
            const step = code === left ? -1 : 1;
            changeSelectionRange(step);
            event.preventDefault();
            return;
          }
          if ([up, down].includes(code)) {
            const step = code === up ? -1 : 1;
            const role = selectionRange.value[0] < offset2.value ? "start" : "end";
            timePickerOptions[`${role}_scrollDown`](step);
            event.preventDefault();
            return;
          }
        };
        const disabledHours_ = (role, compare2) => {
          const defaultDisable = disabledHours ? disabledHours(role) : [];
          const isStart = role === "start";
          const compareDate = compare2 || (isStart ? endTime.value : startTime.value);
          const compareHour = compareDate.hour();
          const nextDisable = isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1);
          return union(defaultDisable, nextDisable);
        };
        const disabledMinutes_ = (hour, role, compare2) => {
          const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : [];
          const isStart = role === "start";
          const compareDate = compare2 || (isStart ? endTime.value : startTime.value);
          const compareHour = compareDate.hour();
          if (hour !== compareHour) {
            return defaultDisable;
          }
          const compareMinute = compareDate.minute();
          const nextDisable = isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1);
          return union(defaultDisable, nextDisable);
        };
        const disabledSeconds_ = (hour, minute, role, compare2) => {
          const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : [];
          const isStart = role === "start";
          const compareDate = compare2 || (isStart ? endTime.value : startTime.value);
          const compareHour = compareDate.hour();
          const compareMinute = compareDate.minute();
          if (hour !== compareHour || minute !== compareMinute) {
            return defaultDisable;
          }
          const compareSecond = compareDate.second();
          const nextDisable = isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1);
          return union(defaultDisable, nextDisable);
        };
        const getRangeAvailableTime = ([start2, end2]) => {
          return [
            getAvailableTime(start2, "start", true, end2),
            getAvailableTime(end2, "end", false, start2)
          ];
        };
        const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours_, disabledMinutes_, disabledSeconds_);
        const {
          timePickerOptions,
          getAvailableTime,
          onSetOption
        } = useTimePanel({
          getAvailableHours,
          getAvailableMinutes,
          getAvailableSeconds
        });
        const parseUserInput = (days2) => {
          if (!days2)
            return null;
          if (isArray$5(days2)) {
            return days2.map((d2) => dayjs(d2, props2.format).locale(lang.value));
          }
          return dayjs(days2, props2.format).locale(lang.value);
        };
        const formatToString = (days2) => {
          if (!days2)
            return null;
          if (isArray$5(days2)) {
            return days2.map((d2) => d2.format(props2.format));
          }
          return days2.format(props2.format);
        };
        const getDefaultValue2 = () => {
          if (isArray$5(defaultValue)) {
            return defaultValue.map((d2) => dayjs(d2).locale(lang.value));
          }
          const defaultDay = dayjs(defaultValue).locale(lang.value);
          return [defaultDay, defaultDay.add(60, "m")];
        };
        emit2("set-picker-option", ["formatToString", formatToString]);
        emit2("set-picker-option", ["parseUserInput", parseUserInput]);
        emit2("set-picker-option", ["isValidValue", isValidValue2]);
        emit2("set-picker-option", ["handleKeydownInput", handleKeydown]);
        emit2("set-picker-option", ["getDefaultValue", getDefaultValue2]);
        emit2("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
        return (_ctx, _cache) => {
          return _ctx.actualVisible ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: normalizeClass([unref(nsTime).b("range-picker"), unref(nsPicker).b("panel")])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(nsTime).be("range-picker", "content"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(nsTime).be("range-picker", "cell"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(nsTime).be("range-picker", "header"))
                }, toDisplayString(unref(t)("el.datepicker.startTime")), 3),
                createBaseVNode("div", {
                  class: normalizeClass(unref(startContainerKls))
                }, [
                  createVNode$1(TimeSpinner, {
                    ref: "minSpinner",
                    role: "start",
                    "show-seconds": unref(showSeconds),
                    "am-pm-mode": unref(amPmMode),
                    "arrow-control": unref(arrowControl),
                    "spinner-date": unref(startTime),
                    "disabled-hours": disabledHours_,
                    "disabled-minutes": disabledMinutes_,
                    "disabled-seconds": disabledSeconds_,
                    onChange: handleMinChange,
                    onSetOption: unref(onSetOption),
                    onSelectRange: setMinSelectionRange
                  }, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
                ], 2)
              ], 2),
              createBaseVNode("div", {
                class: normalizeClass(unref(nsTime).be("range-picker", "cell"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(nsTime).be("range-picker", "header"))
                }, toDisplayString(unref(t)("el.datepicker.endTime")), 3),
                createBaseVNode("div", {
                  class: normalizeClass(unref(endContainerKls))
                }, [
                  createVNode$1(TimeSpinner, {
                    ref: "maxSpinner",
                    role: "end",
                    "show-seconds": unref(showSeconds),
                    "am-pm-mode": unref(amPmMode),
                    "arrow-control": unref(arrowControl),
                    "spinner-date": unref(endTime),
                    "disabled-hours": disabledHours_,
                    "disabled-minutes": disabledMinutes_,
                    "disabled-seconds": disabledSeconds_,
                    onChange: handleMaxChange,
                    onSetOption: unref(onSetOption),
                    onSelectRange: setMaxSelectionRange
                  }, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
                ], 2)
              ], 2)
            ], 2),
            createBaseVNode("div", {
              class: normalizeClass(unref(nsTime).be("panel", "footer"))
            }, [
              createBaseVNode("button", {
                type: "button",
                class: normalizeClass([unref(nsTime).be("panel", "btn"), "cancel"]),
                onClick: ($event) => handleCancel()
              }, toDisplayString(unref(t)("el.datepicker.cancel")), 11, ["onClick"]),
              createBaseVNode("button", {
                type: "button",
                class: normalizeClass([unref(nsTime).be("panel", "btn"), "confirm"]),
                disabled: unref(btnConfirmDisabled),
                onClick: ($event) => handleConfirm()
              }, toDisplayString(unref(t)("el.datepicker.confirm")), 11, ["disabled", "onClick"])
            ], 2)
          ], 2)) : createCommentVNode("v-if", true);
        };
      }
    });
    var TimeRangePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["__file", "panel-time-range.vue"]]);
    dayjs.extend(customParseFormat);
    var TimePicker = /* @__PURE__ */ defineComponent({
      name: "ElTimePicker",
      install: null,
      props: {
        ...timePickerDefaultProps,
        isRange: {
          type: Boolean,
          default: false
        }
      },
      emits: [UPDATE_MODEL_EVENT],
      setup(props2, ctx) {
        const commonPicker = ref();
        const [type, Panel] = props2.isRange ? ["timerange", TimeRangePanel] : ["time", TimePickPanel];
        const modelUpdater = (value) => ctx.emit(UPDATE_MODEL_EVENT, value);
        provide("ElPopperOptions", props2.popperOptions);
        ctx.expose({
          focus: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.focus();
          },
          blur: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.blur();
          },
          handleOpen: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.handleOpen();
          },
          handleClose: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.handleClose();
          }
        });
        return () => {
          var _a2;
          const format2 = (_a2 = props2.format) != null ? _a2 : DEFAULT_FORMATS_TIME;
          return createVNode$1(CommonPicker, mergeProps(props2, {
            "ref": commonPicker,
            "type": type,
            "format": format2,
            "onUpdate:modelValue": modelUpdater
          }), {
            default: (props22) => createVNode$1(Panel, props22, null)
          });
        };
      }
    });
    const ElTimePicker = withInstall(TimePicker);
    const ROOT_PICKER_INJECTION_KEY = Symbol();
    const datePickerProps = buildProps({
      ...timePickerDefaultProps,
      type: {
        type: definePropType(String),
        default: "date"
      }
    });
    const selectionModes = [
      "date",
      "dates",
      "year",
      "years",
      "month",
      "months",
      "week",
      "range"
    ];
    const datePickerSharedProps = buildProps({
      disabledDate: {
        type: definePropType(Function)
      },
      date: {
        type: definePropType(Object),
        required: true
      },
      minDate: {
        type: definePropType(Object)
      },
      maxDate: {
        type: definePropType(Object)
      },
      parsedValue: {
        type: definePropType([Object, Array])
      },
      rangeState: {
        type: definePropType(Object),
        default: () => ({
          endDate: null,
          selecting: false
        })
      }
    });
    const panelSharedProps = buildProps({
      type: {
        type: definePropType(String),
        required: true,
        values: datePickTypes
      },
      dateFormat: String,
      timeFormat: String,
      showNow: {
        type: Boolean,
        default: true
      }
    });
    const panelRangeSharedProps = buildProps({
      unlinkPanels: Boolean,
      parsedValue: {
        type: definePropType(Array)
      }
    });
    const selectionModeWithDefault = (mode) => {
      return {
        type: String,
        values: selectionModes,
        default: mode
      };
    };
    const panelDatePickProps = buildProps({
      ...panelSharedProps,
      parsedValue: {
        type: definePropType([Object, Array])
      },
      visible: {
        type: Boolean
      },
      format: {
        type: String,
        default: ""
      }
    });
    const isValidRange = (range2) => {
      if (!isArray$5(range2))
        return false;
      const [left, right] = range2;
      return dayjs.isDayjs(left) && dayjs.isDayjs(right) && dayjs(left).isValid() && dayjs(right).isValid() && left.isSameOrBefore(right);
    };
    const getDefaultValue = (defaultValue, { lang, unit: unit2, unlinkPanels }) => {
      let start2;
      if (isArray$5(defaultValue)) {
        let [left, right] = defaultValue.map((d2) => dayjs(d2).locale(lang));
        if (!unlinkPanels) {
          right = left.add(1, unit2);
        }
        return [left, right];
      } else if (defaultValue) {
        start2 = dayjs(defaultValue);
      } else {
        start2 = dayjs();
      }
      start2 = start2.locale(lang);
      return [start2, start2.add(1, unit2)];
    };
    const buildPickerTable = (dimension, rows, {
      columnIndexOffset,
      startDate,
      nextEndDate,
      now: now2,
      unit: unit2,
      relativeDateGetter,
      setCellMetadata,
      setRowMetadata
    }) => {
      for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {
        const row = rows[rowIndex];
        for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {
          let cell = row[columnIndex + columnIndexOffset];
          if (!cell) {
            cell = {
              row: rowIndex,
              column: columnIndex,
              type: "normal",
              inRange: false,
              start: false,
              end: false
            };
          }
          const index = rowIndex * dimension.column + columnIndex;
          const nextStartDate = relativeDateGetter(index);
          cell.dayjs = nextStartDate;
          cell.date = nextStartDate.toDate();
          cell.timestamp = nextStartDate.valueOf();
          cell.type = "normal";
          cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit2) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit2)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit2) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit2));
          if (startDate == null ? void 0 : startDate.isSameOrAfter(nextEndDate)) {
            cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit2);
            cell.end = startDate && nextStartDate.isSame(startDate, unit2);
          } else {
            cell.start = !!startDate && nextStartDate.isSame(startDate, unit2);
            cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit2);
          }
          const isToday = nextStartDate.isSame(now2, unit2);
          if (isToday) {
            cell.type = "today";
          }
          setCellMetadata == null ? void 0 : setCellMetadata(cell, { rowIndex, columnIndex });
          row[columnIndex + columnIndexOffset] = cell;
        }
        setRowMetadata == null ? void 0 : setRowMetadata(row);
      }
    };
    const datesInMonth = (year, month, lang) => {
      const firstDay = dayjs().locale(lang).startOf("month").month(month).year(year);
      const numOfDays = firstDay.daysInMonth();
      return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
    };
    const getValidDateOfMonth = (year, month, lang, disabledDate) => {
      const _value = dayjs().year(year).month(month).startOf("month");
      const _date = datesInMonth(year, month, lang).find((date) => {
        return !(disabledDate == null ? void 0 : disabledDate(date));
      });
      if (_date) {
        return dayjs(_date).locale(lang);
      }
      return _value.locale(lang);
    };
    const getValidDateOfYear = (value, lang, disabledDate) => {
      const year = value.year();
      if (!(disabledDate == null ? void 0 : disabledDate(value.toDate()))) {
        return value.locale(lang);
      }
      const month = value.month();
      if (!datesInMonth(year, month, lang).every(disabledDate)) {
        return getValidDateOfMonth(year, month, lang, disabledDate);
      }
      for (let i2 = 0; i2 < 12; i2++) {
        if (!datesInMonth(year, i2, lang).every(disabledDate)) {
          return getValidDateOfMonth(year, i2, lang, disabledDate);
        }
      }
      return value;
    };
    const correctlyParseUserInput = (value, format2, lang, defaultFormat) => {
      if (isArray$5(value)) {
        return value.map((v4) => correctlyParseUserInput(v4, format2, lang, defaultFormat));
      }
      if (isString$3(value)) {
        const dayjsValue = defaultFormat.value ? dayjs(value) : dayjs(value, format2);
        if (!dayjsValue.isValid()) {
          return dayjsValue;
        }
      }
      return dayjs(value, format2).locale(lang);
    };
    const basicDateTableProps = buildProps({
      ...datePickerSharedProps,
      cellClassName: {
        type: definePropType(Function)
      },
      showWeekNumber: Boolean,
      selectionMode: selectionModeWithDefault("date")
    });
    const basicDateTableEmits = ["changerange", "pick", "select"];
    const isNormalDay = (type = "") => {
      return ["normal", "today"].includes(type);
    };
    const useBasicDateTable = (props2, emit2) => {
      const { lang } = useLocale();
      const tbodyRef = ref();
      const currentCellRef = ref();
      const lastRow = ref();
      const lastColumn = ref();
      const tableRows = ref([[], [], [], [], [], []]);
      let focusWithClick = false;
      const firstDayOfWeek = props2.date.$locale().weekStart || 7;
      const WEEKS_CONSTANT = props2.date.locale("en").localeData().weekdaysShort().map((_2) => _2.toLowerCase());
      const offsetDay = computed(() => {
        return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek;
      });
      const startDate = computed(() => {
        const startDayOfMonth = props2.date.startOf("month");
        return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
      });
      const WEEKS = computed(() => {
        return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7);
      });
      const hasCurrent = computed(() => {
        return flatten(unref(rows)).some((row) => {
          return row.isCurrent;
        });
      });
      const days2 = computed(() => {
        const startOfMonth = props2.date.startOf("month");
        const startOfMonthDay = startOfMonth.day() || 7;
        const dateCountOfMonth = startOfMonth.daysInMonth();
        const dateCountOfLastMonth = startOfMonth.subtract(1, "month").daysInMonth();
        return {
          startOfMonthDay,
          dateCountOfMonth,
          dateCountOfLastMonth
        };
      });
      const selectedDate = computed(() => {
        return props2.selectionMode === "dates" ? castArray(props2.parsedValue) : [];
      });
      const setDateText = (cell, { count: count2, rowIndex, columnIndex }) => {
        const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = unref(days2);
        const offset2 = unref(offsetDay);
        if (rowIndex >= 0 && rowIndex <= 1) {
          const numberOfDaysFromPreviousMonth = startOfMonthDay + offset2 < 0 ? 7 + startOfMonthDay + offset2 : startOfMonthDay + offset2;
          if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) {
            cell.text = count2;
            return true;
          } else {
            cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7;
            cell.type = "prev-month";
          }
        } else {
          if (count2 <= dateCountOfMonth) {
            cell.text = count2;
          } else {
            cell.text = count2 - dateCountOfMonth;
            cell.type = "next-month";
          }
          return true;
        }
        return false;
      };
      const setCellMetadata = (cell, { columnIndex, rowIndex }, count2) => {
        const { disabledDate, cellClassName } = props2;
        const _selectedDate = unref(selectedDate);
        const shouldIncrement = setDateText(cell, { count: count2, rowIndex, columnIndex });
        const cellDate = cell.dayjs.toDate();
        cell.selected = _selectedDate.find((d2) => d2.isSame(cell.dayjs, "day"));
        cell.isSelected = !!cell.selected;
        cell.isCurrent = isCurrent(cell);
        cell.disabled = disabledDate == null ? void 0 : disabledDate(cellDate);
        cell.customClass = cellClassName == null ? void 0 : cellClassName(cellDate);
        return shouldIncrement;
      };
      const setRowMetadata = (row) => {
        if (props2.selectionMode === "week") {
          const [start2, end2] = props2.showWeekNumber ? [1, 7] : [0, 6];
          const isActive = isWeekActive(row[start2 + 1]);
          row[start2].inRange = isActive;
          row[start2].start = isActive;
          row[end2].inRange = isActive;
          row[end2].end = isActive;
        }
      };
      const rows = computed(() => {
        const { minDate, maxDate, rangeState, showWeekNumber } = props2;
        const offset2 = unref(offsetDay);
        const rows_ = unref(tableRows);
        const dateUnit = "day";
        let count2 = 1;
        if (showWeekNumber) {
          for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
            if (!rows_[rowIndex][0]) {
              rows_[rowIndex][0] = {
                type: "week",
                text: unref(startDate).add(rowIndex * 7 + 1, dateUnit).week()
              };
            }
          }
        }
        buildPickerTable({ row: 6, column: 7 }, rows_, {
          startDate: minDate,
          columnIndexOffset: showWeekNumber ? 1 : 0,
          nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null,
          now: dayjs().locale(unref(lang)).startOf(dateUnit),
          unit: dateUnit,
          relativeDateGetter: (idx) => unref(startDate).add(idx - offset2, dateUnit),
          setCellMetadata: (...args) => {
            if (setCellMetadata(...args, count2)) {
              count2 += 1;
            }
          },
          setRowMetadata
        });
        return rows_;
      });
      watch(() => props2.date, async () => {
        var _a2;
        if ((_a2 = unref(tbodyRef)) == null ? void 0 : _a2.contains(document.activeElement)) {
          await nextTick();
          await focus();
        }
      });
      const focus = async () => {
        var _a2;
        return (_a2 = unref(currentCellRef)) == null ? void 0 : _a2.focus();
      };
      const isCurrent = (cell) => {
        return props2.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props2.parsedValue);
      };
      const cellMatchesDate = (cell, date) => {
        if (!date)
          return false;
        return dayjs(date).locale(unref(lang)).isSame(props2.date.date(Number(cell.text)), "day");
      };
      const getDateOfCell = (row, column) => {
        const offsetFromStart = row * 7 + (column - (props2.showWeekNumber ? 1 : 0)) - unref(offsetDay);
        return unref(startDate).add(offsetFromStart, "day");
      };
      const handleMouseMove = (event) => {
        var _a2;
        if (!props2.rangeState.selecting)
          return;
        let target = event.target;
        if (target.tagName === "SPAN") {
          target = (_a2 = target.parentNode) == null ? void 0 : _a2.parentNode;
        }
        if (target.tagName === "DIV") {
          target = target.parentNode;
        }
        if (target.tagName !== "TD")
          return;
        const row = target.parentNode.rowIndex - 1;
        const column = target.cellIndex;
        if (unref(rows)[row][column].disabled)
          return;
        if (row !== unref(lastRow) || column !== unref(lastColumn)) {
          lastRow.value = row;
          lastColumn.value = column;
          emit2("changerange", {
            selecting: true,
            endDate: getDateOfCell(row, column)
          });
        }
      };
      const isSelectedCell = (cell) => {
        return !unref(hasCurrent) && (cell == null ? void 0 : cell.text) === 1 && cell.type === "normal" || cell.isCurrent;
      };
      const handleFocus = (event) => {
        if (focusWithClick || unref(hasCurrent) || props2.selectionMode !== "date")
          return;
        handlePickDate(event, true);
      };
      const handleMouseDown = (event) => {
        const target = event.target.closest("td");
        if (!target)
          return;
        focusWithClick = true;
      };
      const handleMouseUp = (event) => {
        const target = event.target.closest("td");
        if (!target)
          return;
        focusWithClick = false;
      };
      const handleRangePick = (newDate) => {
        if (!props2.rangeState.selecting || !props2.minDate) {
          emit2("pick", { minDate: newDate, maxDate: null });
          emit2("select", true);
        } else {
          if (newDate >= props2.minDate) {
            emit2("pick", { minDate: props2.minDate, maxDate: newDate });
          } else {
            emit2("pick", { minDate: newDate, maxDate: props2.minDate });
          }
          emit2("select", false);
        }
      };
      const handleWeekPick = (newDate) => {
        const weekNumber = newDate.week();
        const value = `${newDate.year()}w${weekNumber}`;
        emit2("pick", {
          year: newDate.year(),
          week: weekNumber,
          value,
          date: newDate.startOf("week")
        });
      };
      const handleDatesPick = (newDate, selected) => {
        const newValue = selected ? castArray(props2.parsedValue).filter((d2) => (d2 == null ? void 0 : d2.valueOf()) !== newDate.valueOf()) : castArray(props2.parsedValue).concat([newDate]);
        emit2("pick", newValue);
      };
      const handlePickDate = (event, isKeyboardMovement = false) => {
        const target = event.target.closest("td");
        if (!target)
          return;
        const row = target.parentNode.rowIndex - 1;
        const column = target.cellIndex;
        const cell = unref(rows)[row][column];
        if (cell.disabled || cell.type === "week")
          return;
        const newDate = getDateOfCell(row, column);
        switch (props2.selectionMode) {
          case "range": {
            handleRangePick(newDate);
            break;
          }
          case "date": {
            emit2("pick", newDate, isKeyboardMovement);
            break;
          }
          case "week": {
            handleWeekPick(newDate);
            break;
          }
          case "dates": {
            handleDatesPick(newDate, !!cell.selected);
            break;
          }
        }
      };
      const isWeekActive = (cell) => {
        if (props2.selectionMode !== "week")
          return false;
        let newDate = props2.date.startOf("day");
        if (cell.type === "prev-month") {
          newDate = newDate.subtract(1, "month");
        }
        if (cell.type === "next-month") {
          newDate = newDate.add(1, "month");
        }
        newDate = newDate.date(Number.parseInt(cell.text, 10));
        if (props2.parsedValue && !isArray$5(props2.parsedValue)) {
          const dayOffset = (props2.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
          const weekDate = props2.parsedValue.subtract(dayOffset, "day");
          return weekDate.isSame(newDate, "day");
        }
        return false;
      };
      return {
        WEEKS,
        rows,
        tbodyRef,
        currentCellRef,
        focus,
        isCurrent,
        isWeekActive,
        isSelectedCell,
        handlePickDate,
        handleMouseUp,
        handleMouseDown,
        handleMouseMove,
        handleFocus
      };
    };
    const useBasicDateTableDOM = (props2, {
      isCurrent,
      isWeekActive
    }) => {
      const ns = useNamespace("date-table");
      const { t } = useLocale();
      const tableKls = computed(() => [
        ns.b(),
        { "is-week-mode": props2.selectionMode === "week" }
      ]);
      const tableLabel = computed(() => t("el.datepicker.dateTablePrompt"));
      const weekLabel = computed(() => t("el.datepicker.week"));
      const getCellClasses = (cell) => {
        const classes = [];
        if (isNormalDay(cell.type) && !cell.disabled) {
          classes.push("available");
          if (cell.type === "today") {
            classes.push("today");
          }
        } else {
          classes.push(cell.type);
        }
        if (isCurrent(cell)) {
          classes.push("current");
        }
        if (cell.inRange && (isNormalDay(cell.type) || props2.selectionMode === "week")) {
          classes.push("in-range");
          if (cell.start) {
            classes.push("start-date");
          }
          if (cell.end) {
            classes.push("end-date");
          }
        }
        if (cell.disabled) {
          classes.push("disabled");
        }
        if (cell.selected) {
          classes.push("selected");
        }
        if (cell.customClass) {
          classes.push(cell.customClass);
        }
        return classes.join(" ");
      };
      const getRowKls = (cell) => [
        ns.e("row"),
        { current: isWeekActive(cell) }
      ];
      return {
        tableKls,
        tableLabel,
        weekLabel,
        getCellClasses,
        getRowKls,
        t
      };
    };
    const basicCellProps = buildProps({
      cell: {
        type: definePropType(Object)
      }
    });
    var ElDatePickerCell = /* @__PURE__ */ defineComponent({
      name: "ElDatePickerCell",
      props: basicCellProps,
      setup(props2) {
        const ns = useNamespace("date-table-cell");
        const {
          slots
        } = inject(ROOT_PICKER_INJECTION_KEY);
        return () => {
          const {
            cell
          } = props2;
          return renderSlot(slots, "default", {
            ...cell
          }, () => {
            var _a2;
            return [createVNode$1("div", {
              "class": ns.b()
            }, [createVNode$1("span", {
              "class": ns.e("text")
            }, [(_a2 = cell == null ? void 0 : cell.renderText) != null ? _a2 : cell == null ? void 0 : cell.text])])];
          });
        };
      }
    });
    const _sfc_main$1J = /* @__PURE__ */ defineComponent({
      __name: "basic-date-table",
      props: basicDateTableProps,
      emits: basicDateTableEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const {
          WEEKS,
          rows,
          tbodyRef,
          currentCellRef,
          focus,
          isCurrent,
          isWeekActive,
          isSelectedCell,
          handlePickDate,
          handleMouseUp,
          handleMouseDown,
          handleMouseMove,
          handleFocus
        } = useBasicDateTable(props2, emit2);
        const { tableLabel, tableKls, weekLabel, getCellClasses, getRowKls, t } = useBasicDateTableDOM(props2, {
          isCurrent,
          isWeekActive
        });
        let isUnmounting = false;
        onBeforeUnmount(() => {
          isUnmounting = true;
        });
        expose({
          focus
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("table", {
            "aria-label": unref(tableLabel),
            class: normalizeClass(unref(tableKls)),
            cellspacing: "0",
            cellpadding: "0",
            role: "grid",
            onClick: unref(handlePickDate),
            onMousemove: unref(handleMouseMove),
            onMousedown: withModifiers(unref(handleMouseDown), ["prevent"]),
            onMouseup: unref(handleMouseUp)
          }, [
            createBaseVNode("tbody", {
              ref_key: "tbodyRef",
              ref: tbodyRef
            }, [
              createBaseVNode("tr", null, [
                _ctx.showWeekNumber ? (openBlock(), createElementBlock("th", {
                  key: 0,
                  scope: "col"
                }, toDisplayString(unref(weekLabel)), 1)) : createCommentVNode("v-if", true),
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEKS), (week, key) => {
                  return openBlock(), createElementBlock("th", {
                    key,
                    "aria-label": unref(t)("el.datepicker.weeksFull." + week),
                    scope: "col"
                  }, toDisplayString(unref(t)("el.datepicker.weeks." + week)), 9, ["aria-label"]);
                }), 128))
              ]),
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey2) => {
                return openBlock(), createElementBlock("tr", {
                  key: rowKey2,
                  class: normalizeClass(unref(getRowKls)(row[1]))
                }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, columnKey) => {
                    return openBlock(), createElementBlock("td", {
                      key: `${rowKey2}.${columnKey}`,
                      ref_for: true,
                      ref: (el) => !unref(isUnmounting) && unref(isSelectedCell)(cell) && (currentCellRef.value = el),
                      class: normalizeClass(unref(getCellClasses)(cell)),
                      "aria-current": cell.isCurrent ? "date" : void 0,
                      "aria-selected": cell.isCurrent,
                      tabindex: unref(isSelectedCell)(cell) ? 0 : -1,
                      onFocus: unref(handleFocus)
                    }, [
                      createVNode$1(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
                    ], 42, ["aria-current", "aria-selected", "tabindex", "onFocus"]);
                  }), 128))
                ], 2);
              }), 128))
            ], 512)
          ], 42, ["aria-label", "onClick", "onMousemove", "onMousedown", "onMouseup"]);
        };
      }
    });
    var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["__file", "basic-date-table.vue"]]);
    const basicMonthTableProps = buildProps({
      ...datePickerSharedProps,
      selectionMode: selectionModeWithDefault("month")
    });
    const _sfc_main$1I = /* @__PURE__ */ defineComponent({
      __name: "basic-month-table",
      props: basicMonthTableProps,
      emits: ["changerange", "pick", "select"],
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("month-table");
        const { t, lang } = useLocale();
        const tbodyRef = ref();
        const currentCellRef = ref();
        const months2 = ref(props2.date.locale("en").localeData().monthsShort().map((_2) => _2.toLowerCase()));
        const tableRows = ref([
          [],
          [],
          []
        ]);
        const lastRow = ref();
        const lastColumn = ref();
        const rows = computed(() => {
          var _a2, _b2;
          const rows2 = tableRows.value;
          const now2 = dayjs().locale(lang.value).startOf("month");
          for (let i2 = 0; i2 < 3; i2++) {
            const row = rows2[i2];
            for (let j = 0; j < 4; j++) {
              const cell = row[j] || (row[j] = {
                row: i2,
                column: j,
                type: "normal",
                inRange: false,
                start: false,
                end: false,
                text: -1,
                disabled: false
              });
              cell.type = "normal";
              const index = i2 * 4 + j;
              const calTime = props2.date.startOf("year").month(index);
              const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null;
              cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "month") && calEndDate && calTime.isSameOrBefore(calEndDate, "month")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "month") && calEndDate && calTime.isSameOrAfter(calEndDate, "month"));
              if ((_a2 = props2.minDate) == null ? void 0 : _a2.isSameOrAfter(calEndDate)) {
                cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month"));
                cell.end = props2.minDate && calTime.isSame(props2.minDate, "month");
              } else {
                cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "month"));
                cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month"));
              }
              const isToday = now2.isSame(calTime);
              if (isToday) {
                cell.type = "today";
              }
              cell.text = index;
              cell.disabled = ((_b2 = props2.disabledDate) == null ? void 0 : _b2.call(props2, calTime.toDate())) || false;
            }
          }
          return rows2;
        });
        const focus = () => {
          var _a2;
          (_a2 = currentCellRef.value) == null ? void 0 : _a2.focus();
        };
        const getCellStyle = (cell) => {
          const style = {};
          const year = props2.date.year();
          const today = /* @__PURE__ */ new Date();
          const month = cell.text;
          style.disabled = props2.disabledDate ? datesInMonth(year, month, lang.value).every(props2.disabledDate) : false;
          style.current = castArray(props2.parsedValue).findIndex((date) => dayjs.isDayjs(date) && date.year() === year && date.month() === month) >= 0;
          style.today = today.getFullYear() === year && today.getMonth() === month;
          if (cell.inRange) {
            style["in-range"] = true;
            if (cell.start) {
              style["start-date"] = true;
            }
            if (cell.end) {
              style["end-date"] = true;
            }
          }
          return style;
        };
        const isSelectedCell = (cell) => {
          const year = props2.date.year();
          const month = cell.text;
          return castArray(props2.date).findIndex((date) => date.year() === year && date.month() === month) >= 0;
        };
        const handleMouseMove = (event) => {
          var _a2;
          if (!props2.rangeState.selecting)
            return;
          let target = event.target;
          if (target.tagName === "SPAN") {
            target = (_a2 = target.parentNode) == null ? void 0 : _a2.parentNode;
          }
          if (target.tagName === "DIV") {
            target = target.parentNode;
          }
          if (target.tagName !== "TD")
            return;
          const row = target.parentNode.rowIndex;
          const column = target.cellIndex;
          if (rows.value[row][column].disabled)
            return;
          if (row !== lastRow.value || column !== lastColumn.value) {
            lastRow.value = row;
            lastColumn.value = column;
            emit2("changerange", {
              selecting: true,
              endDate: props2.date.startOf("year").month(row * 4 + column)
            });
          }
        };
        const handleMonthTableClick = (event) => {
          var _a2;
          const target = (_a2 = event.target) == null ? void 0 : _a2.closest("td");
          if ((target == null ? void 0 : target.tagName) !== "TD")
            return;
          if (hasClass(target, "disabled"))
            return;
          const column = target.cellIndex;
          const row = target.parentNode.rowIndex;
          const month = row * 4 + column;
          const newDate = props2.date.startOf("year").month(month);
          if (props2.selectionMode === "months") {
            if (event.type === "keydown") {
              emit2("pick", castArray(props2.parsedValue), false);
              return;
            }
            const newMonth = getValidDateOfMonth(props2.date.year(), month, lang.value, props2.disabledDate);
            const newValue = hasClass(target, "current") ? castArray(props2.parsedValue).filter((d2) => (d2 == null ? void 0 : d2.year()) !== newMonth.year() || (d2 == null ? void 0 : d2.month()) !== newMonth.month()) : castArray(props2.parsedValue).concat([dayjs(newMonth)]);
            emit2("pick", newValue);
          } else if (props2.selectionMode === "range") {
            if (!props2.rangeState.selecting) {
              emit2("pick", { minDate: newDate, maxDate: null });
              emit2("select", true);
            } else {
              if (props2.minDate && newDate >= props2.minDate) {
                emit2("pick", { minDate: props2.minDate, maxDate: newDate });
              } else {
                emit2("pick", { minDate: newDate, maxDate: props2.minDate });
              }
              emit2("select", false);
            }
          } else {
            emit2("pick", month);
          }
        };
        watch(() => props2.date, async () => {
          var _a2, _b2;
          if ((_a2 = tbodyRef.value) == null ? void 0 : _a2.contains(document.activeElement)) {
            await nextTick();
            (_b2 = currentCellRef.value) == null ? void 0 : _b2.focus();
          }
        });
        expose({
          focus
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("table", {
            role: "grid",
            "aria-label": unref(t)("el.datepicker.monthTablePrompt"),
            class: normalizeClass(unref(ns).b()),
            onClick: handleMonthTableClick,
            onMousemove: handleMouseMove
          }, [
            createBaseVNode("tbody", {
              ref_key: "tbodyRef",
              ref: tbodyRef
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, key) => {
                return openBlock(), createElementBlock("tr", { key }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, key_) => {
                    return openBlock(), createElementBlock("td", {
                      key: key_,
                      ref_for: true,
                      ref: (el) => isSelectedCell(cell) && (currentCellRef.value = el),
                      class: normalizeClass(getCellStyle(cell)),
                      "aria-selected": `${isSelectedCell(cell)}`,
                      "aria-label": unref(t)(`el.datepicker.month${+cell.text + 1}`),
                      tabindex: isSelectedCell(cell) ? 0 : -1,
                      onKeydown: [
                        withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]),
                        withKeys(withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])
                      ]
                    }, [
                      createVNode$1(unref(ElDatePickerCell), {
                        cell: {
                          ...cell,
                          renderText: unref(t)("el.datepicker.months." + months2.value[cell.text])
                        }
                      }, null, 8, ["cell"])
                    ], 42, ["aria-selected", "aria-label", "tabindex", "onKeydown"]);
                  }), 128))
                ]);
              }), 128))
            ], 512)
          ], 42, ["aria-label"]);
        };
      }
    });
    var MonthTable = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["__file", "basic-month-table.vue"]]);
    const basicYearTableProps = buildProps({
      ...datePickerSharedProps,
      selectionMode: selectionModeWithDefault("year")
    });
    const _sfc_main$1H = /* @__PURE__ */ defineComponent({
      __name: "basic-year-table",
      props: basicYearTableProps,
      emits: ["changerange", "pick", "select"],
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const datesInYear = (year, lang2) => {
          const firstDay = dayjs(String(year)).locale(lang2).startOf("year");
          const lastDay = firstDay.endOf("year");
          const numOfDays = lastDay.dayOfYear();
          return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
        };
        const ns = useNamespace("year-table");
        const { t, lang } = useLocale();
        const tbodyRef = ref();
        const currentCellRef = ref();
        const startYear = computed(() => {
          return Math.floor(props2.date.year() / 10) * 10;
        });
        const tableRows = ref([[], [], []]);
        const lastRow = ref();
        const lastColumn = ref();
        const rows = computed(() => {
          var _a2;
          const rows2 = tableRows.value;
          const now2 = dayjs().locale(lang.value).startOf("year");
          for (let i2 = 0; i2 < 3; i2++) {
            const row = rows2[i2];
            for (let j = 0; j < 4; j++) {
              if (i2 * 4 + j >= 10) {
                break;
              }
              let cell = row[j];
              if (!cell) {
                cell = {
                  row: i2,
                  column: j,
                  type: "normal",
                  inRange: false,
                  start: false,
                  end: false,
                  text: -1,
                  disabled: false
                };
              }
              cell.type = "normal";
              const index = i2 * 4 + j + startYear.value;
              const calTime = dayjs().year(index);
              const calEndDate = props2.rangeState.endDate || props2.maxDate || props2.rangeState.selecting && props2.minDate || null;
              cell.inRange = !!(props2.minDate && calTime.isSameOrAfter(props2.minDate, "year") && calEndDate && calTime.isSameOrBefore(calEndDate, "year")) || !!(props2.minDate && calTime.isSameOrBefore(props2.minDate, "year") && calEndDate && calTime.isSameOrAfter(calEndDate, "year"));
              if ((_a2 = props2.minDate) == null ? void 0 : _a2.isSameOrAfter(calEndDate)) {
                cell.start = !!(calEndDate && calTime.isSame(calEndDate, "year"));
                cell.end = !!(props2.minDate && calTime.isSame(props2.minDate, "year"));
              } else {
                cell.start = !!(props2.minDate && calTime.isSame(props2.minDate, "year"));
                cell.end = !!(calEndDate && calTime.isSame(calEndDate, "year"));
              }
              const isToday = now2.isSame(calTime);
              if (isToday) {
                cell.type = "today";
              }
              cell.text = index;
              const cellDate = calTime.toDate();
              cell.disabled = props2.disabledDate && props2.disabledDate(cellDate) || false;
              row[j] = cell;
            }
          }
          return rows2;
        });
        const focus = () => {
          var _a2;
          (_a2 = currentCellRef.value) == null ? void 0 : _a2.focus();
        };
        const getCellKls = (cell) => {
          const kls = {};
          const today = dayjs().locale(lang.value);
          const year = cell.text;
          kls.disabled = props2.disabledDate ? datesInYear(year, lang.value).every(props2.disabledDate) : false;
          kls.today = today.year() === year;
          kls.current = castArray(props2.parsedValue).findIndex((d2) => d2.year() === year) >= 0;
          if (cell.inRange) {
            kls["in-range"] = true;
            if (cell.start) {
              kls["start-date"] = true;
            }
            if (cell.end) {
              kls["end-date"] = true;
            }
          }
          return kls;
        };
        const isSelectedCell = (cell) => {
          const year = cell.text;
          return castArray(props2.date).findIndex((date) => date.year() === year) >= 0;
        };
        const handleYearTableClick = (event) => {
          var _a2;
          const target = (_a2 = event.target) == null ? void 0 : _a2.closest("td");
          if (!target || !target.textContent || hasClass(target, "disabled"))
            return;
          const column = target.cellIndex;
          const row = target.parentNode.rowIndex;
          const selectedYear = row * 4 + column + startYear.value;
          const newDate = dayjs().year(selectedYear);
          if (props2.selectionMode === "range") {
            if (!props2.rangeState.selecting) {
              emit2("pick", { minDate: newDate, maxDate: null });
              emit2("select", true);
            } else {
              if (props2.minDate && newDate >= props2.minDate) {
                emit2("pick", { minDate: props2.minDate, maxDate: newDate });
              } else {
                emit2("pick", { minDate: newDate, maxDate: props2.minDate });
              }
              emit2("select", false);
            }
          } else if (props2.selectionMode === "years") {
            if (event.type === "keydown") {
              emit2("pick", castArray(props2.parsedValue), false);
              return;
            }
            const vaildYear = getValidDateOfYear(newDate.startOf("year"), lang.value, props2.disabledDate);
            const newValue = hasClass(target, "current") ? castArray(props2.parsedValue).filter((d2) => (d2 == null ? void 0 : d2.year()) !== selectedYear) : castArray(props2.parsedValue).concat([vaildYear]);
            emit2("pick", newValue);
          } else {
            emit2("pick", selectedYear);
          }
        };
        const handleMouseMove = (event) => {
          var _a2;
          if (!props2.rangeState.selecting)
            return;
          const target = (_a2 = event.target) == null ? void 0 : _a2.closest("td");
          if (!target)
            return;
          const row = target.parentNode.rowIndex;
          const column = target.cellIndex;
          if (rows.value[row][column].disabled)
            return;
          if (row !== lastRow.value || column !== lastColumn.value) {
            lastRow.value = row;
            lastColumn.value = column;
            emit2("changerange", {
              selecting: true,
              endDate: dayjs().year(startYear.value).add(row * 4 + column, "year")
            });
          }
        };
        watch(() => props2.date, async () => {
          var _a2, _b2;
          if ((_a2 = tbodyRef.value) == null ? void 0 : _a2.contains(document.activeElement)) {
            await nextTick();
            (_b2 = currentCellRef.value) == null ? void 0 : _b2.focus();
          }
        });
        expose({
          focus
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("table", {
            role: "grid",
            "aria-label": unref(t)("el.datepicker.yearTablePrompt"),
            class: normalizeClass(unref(ns).b()),
            onClick: handleYearTableClick,
            onMousemove: handleMouseMove
          }, [
            createBaseVNode("tbody", {
              ref_key: "tbodyRef",
              ref: tbodyRef
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(rows), (row, rowKey2) => {
                return openBlock(), createElementBlock("tr", { key: rowKey2 }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, cellKey) => {
                    return openBlock(), createElementBlock("td", {
                      key: `${rowKey2}_${cellKey}`,
                      ref_for: true,
                      ref: (el) => isSelectedCell(cell) && (currentCellRef.value = el),
                      class: normalizeClass(["available", getCellKls(cell)]),
                      "aria-selected": isSelectedCell(cell),
                      "aria-label": String(cell.text),
                      tabindex: isSelectedCell(cell) ? 0 : -1,
                      onKeydown: [
                        withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]),
                        withKeys(withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])
                      ]
                    }, [
                      createVNode$1(unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
                    ], 42, ["aria-selected", "aria-label", "tabindex", "onKeydown"]);
                  }), 128))
                ]);
              }), 128))
            ], 512)
          ], 42, ["aria-label"]);
        };
      }
    });
    var YearTable = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["__file", "basic-year-table.vue"]]);
    const _sfc_main$1G = /* @__PURE__ */ defineComponent({
      __name: "panel-date-pick",
      props: panelDatePickProps,
      emits: ["pick", "set-picker-option", "panel-change"],
      setup(__props, { emit: contextEmit }) {
        const props2 = __props;
        const timeWithinRange = (_2, __, ___) => true;
        const ppNs = useNamespace("picker-panel");
        const dpNs = useNamespace("date-picker");
        const attrs = useAttrs$1();
        const slots = useSlots();
        const { t, lang } = useLocale();
        const pickerBase = inject("EP_PICKER_BASE");
        const isDefaultFormat = inject("ElIsDefaultFormat");
        const popper = inject(TOOLTIP_INJECTION_KEY);
        const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
        const defaultValue = toRef(pickerBase.props, "defaultValue");
        const currentViewRef = ref();
        const innerDate = ref(dayjs().locale(lang.value));
        const isChangeToNow = ref(false);
        let isShortcut = false;
        const defaultTimeD = computed(() => {
          return dayjs(defaultTime).locale(lang.value);
        });
        const month = computed(() => {
          return innerDate.value.month();
        });
        const year = computed(() => {
          return innerDate.value.year();
        });
        const selectableRange = ref([]);
        const userInputDate = ref(null);
        const userInputTime = ref(null);
        const checkDateWithinRange = (date) => {
          return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props2.format || "HH:mm:ss") : true;
        };
        const formatEmit = (emitDayjs) => {
          if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) {
            return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
          }
          if (showTime.value)
            return emitDayjs.millisecond(0);
          return emitDayjs.startOf("day");
        };
        const emit2 = (value, ...args) => {
          if (!value) {
            contextEmit("pick", value, ...args);
          } else if (isArray$5(value)) {
            const dates = value.map(formatEmit);
            contextEmit("pick", dates, ...args);
          } else {
            contextEmit("pick", formatEmit(value), ...args);
          }
          userInputDate.value = null;
          userInputTime.value = null;
          isChangeToNow.value = false;
          isShortcut = false;
        };
        const handleDatePick = async (value, keepOpen) => {
          if (selectionMode.value === "date") {
            value = value;
            let newDate = props2.parsedValue ? props2.parsedValue.year(value.year()).month(value.month()).date(value.date()) : value;
            if (!checkDateWithinRange(newDate)) {
              newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
            }
            innerDate.value = newDate;
            emit2(newDate, showTime.value || keepOpen);
            if (props2.type === "datetime") {
              await nextTick();
              handleFocusPicker();
            }
          } else if (selectionMode.value === "week") {
            emit2(value.date);
          } else if (selectionMode.value === "dates") {
            emit2(value, true);
          }
        };
        const moveByMonth = (forward) => {
          const action = forward ? "add" : "subtract";
          innerDate.value = innerDate.value[action](1, "month");
          handlePanelChange("month");
        };
        const moveByYear = (forward) => {
          const currentDate = innerDate.value;
          const action = forward ? "add" : "subtract";
          innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
          handlePanelChange("year");
        };
        const currentView = ref("date");
        const yearLabel = computed(() => {
          const yearTranslation = t("el.datepicker.year");
          if (currentView.value === "year") {
            const startYear = Math.floor(year.value / 10) * 10;
            if (yearTranslation) {
              return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
            }
            return `${startYear} - ${startYear + 9}`;
          }
          return `${year.value} ${yearTranslation}`;
        });
        const handleShortcutClick = (shortcut) => {
          const shortcutValue = isFunction$4(shortcut.value) ? shortcut.value() : shortcut.value;
          if (shortcutValue) {
            isShortcut = true;
            emit2(dayjs(shortcutValue).locale(lang.value));
            return;
          }
          if (shortcut.onClick) {
            shortcut.onClick({
              attrs,
              slots,
              emit: contextEmit
            });
          }
        };
        const selectionMode = computed(() => {
          const { type } = props2;
          if (["week", "month", "months", "year", "years", "dates"].includes(type))
            return type;
          return "date";
        });
        const isMultipleType = computed(() => {
          return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years";
        });
        const keyboardMode = computed(() => {
          return selectionMode.value === "date" ? currentView.value : selectionMode.value;
        });
        const hasShortcuts = computed(() => !!shortcuts.length);
        const handleMonthPick = async (month2, keepOpen) => {
          if (selectionMode.value === "month") {
            innerDate.value = getValidDateOfMonth(innerDate.value.year(), month2, lang.value, disabledDate);
            emit2(innerDate.value, false);
          } else if (selectionMode.value === "months") {
            emit2(month2, keepOpen != null ? keepOpen : true);
          } else {
            innerDate.value = getValidDateOfMonth(innerDate.value.year(), month2, lang.value, disabledDate);
            currentView.value = "date";
            if (["month", "year", "date", "week"].includes(selectionMode.value)) {
              emit2(innerDate.value, true);
              await nextTick();
              handleFocusPicker();
            }
          }
          handlePanelChange("month");
        };
        const handleYearPick = async (year2, keepOpen) => {
          if (selectionMode.value === "year") {
            const data = innerDate.value.startOf("year").year(year2);
            innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);
            emit2(innerDate.value, false);
          } else if (selectionMode.value === "years") {
            emit2(year2, keepOpen != null ? keepOpen : true);
          } else {
            const data = innerDate.value.year(year2);
            innerDate.value = getValidDateOfYear(data, lang.value, disabledDate);
            currentView.value = "month";
            if (["month", "year", "date", "week"].includes(selectionMode.value)) {
              emit2(innerDate.value, true);
              await nextTick();
              handleFocusPicker();
            }
          }
          handlePanelChange("year");
        };
        const showPicker = async (view) => {
          currentView.value = view;
          await nextTick();
          handleFocusPicker();
        };
        const showTime = computed(() => props2.type === "datetime" || props2.type === "datetimerange");
        const footerVisible = computed(() => {
          const showDateFooter = showTime.value || selectionMode.value === "dates";
          const showYearFooter = selectionMode.value === "years";
          const showMonthFooter = selectionMode.value === "months";
          const isDateView = currentView.value === "date";
          const isYearView = currentView.value === "year";
          const isMonthView = currentView.value === "month";
          return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
        });
        const disabledConfirm = computed(() => {
          if (!disabledDate)
            return false;
          if (!props2.parsedValue)
            return true;
          if (isArray$5(props2.parsedValue)) {
            return disabledDate(props2.parsedValue[0].toDate());
          }
          return disabledDate(props2.parsedValue.toDate());
        });
        const onConfirm = () => {
          if (isMultipleType.value) {
            emit2(props2.parsedValue);
          } else {
            let result = props2.parsedValue;
            if (!result) {
              const defaultTimeD2 = dayjs(defaultTime).locale(lang.value);
              const defaultValueD = getDefaultValue2();
              result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
            }
            innerDate.value = result;
            emit2(result);
          }
        };
        const disabledNow = computed(() => {
          if (!disabledDate)
            return false;
          return disabledDate(dayjs().locale(lang.value).toDate());
        });
        const changeToNow = () => {
          const now2 = dayjs().locale(lang.value);
          const nowDate = now2.toDate();
          isChangeToNow.value = true;
          if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
            innerDate.value = dayjs().locale(lang.value);
            emit2(innerDate.value);
          }
        };
        const timeFormat = computed(() => {
          return props2.timeFormat || extractTimeFormat(props2.format);
        });
        const dateFormat = computed(() => {
          return props2.dateFormat || extractDateFormat(props2.format);
        });
        const visibleTime = computed(() => {
          if (userInputTime.value)
            return userInputTime.value;
          if (!props2.parsedValue && !defaultValue.value)
            return;
          return (props2.parsedValue || innerDate.value).format(timeFormat.value);
        });
        const visibleDate = computed(() => {
          if (userInputDate.value)
            return userInputDate.value;
          if (!props2.parsedValue && !defaultValue.value)
            return;
          return (props2.parsedValue || innerDate.value).format(dateFormat.value);
        });
        const timePickerVisible = ref(false);
        const onTimePickerInputFocus = () => {
          timePickerVisible.value = true;
        };
        const handleTimePickClose = () => {
          timePickerVisible.value = false;
        };
        const getUnits = (date) => {
          return {
            hour: date.hour(),
            minute: date.minute(),
            second: date.second(),
            year: date.year(),
            month: date.month(),
            date: date.date()
          };
        };
        const handleTimePick = (value, visible, first) => {
          const { hour, minute, second } = getUnits(value);
          const newDate = props2.parsedValue ? props2.parsedValue.hour(hour).minute(minute).second(second) : value;
          innerDate.value = newDate;
          emit2(innerDate.value, true);
          if (!first) {
            timePickerVisible.value = visible;
          }
        };
        const handleVisibleTimeChange = (value) => {
          const newDate = dayjs(value, timeFormat.value).locale(lang.value);
          if (newDate.isValid() && checkDateWithinRange(newDate)) {
            const { year: year2, month: month2, date } = getUnits(innerDate.value);
            innerDate.value = newDate.year(year2).month(month2).date(date);
            userInputTime.value = null;
            timePickerVisible.value = false;
            emit2(innerDate.value, true);
          }
        };
        const handleVisibleDateChange = (value) => {
          const newDate = correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat);
          if (newDate.isValid()) {
            if (disabledDate && disabledDate(newDate.toDate())) {
              return;
            }
            const { hour, minute, second } = getUnits(innerDate.value);
            innerDate.value = newDate.hour(hour).minute(minute).second(second);
            userInputDate.value = null;
            emit2(innerDate.value, true);
          }
        };
        const isValidValue2 = (date) => {
          return dayjs.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
        };
        const formatToString = (value) => {
          return isArray$5(value) ? value.map((_2) => _2.format(props2.format)) : value.format(props2.format);
        };
        const parseUserInput = (value) => {
          return correctlyParseUserInput(value, props2.format, lang.value, isDefaultFormat);
        };
        const getDefaultValue2 = () => {
          const parseDate2 = dayjs(defaultValue.value).locale(lang.value);
          if (!defaultValue.value) {
            const defaultTimeDValue = defaultTimeD.value;
            return dayjs().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
          }
          return parseDate2;
        };
        const handleFocusPicker = () => {
          var _a2;
          if (["week", "month", "year", "date"].includes(selectionMode.value)) {
            (_a2 = currentViewRef.value) == null ? void 0 : _a2.focus();
          }
        };
        const _handleFocusPicker = () => {
          handleFocusPicker();
          if (selectionMode.value === "week") {
            handleKeyControl(EVENT_CODE.down);
          }
        };
        const handleKeydownTable = (event) => {
          const { code } = event;
          const validCode = [
            EVENT_CODE.up,
            EVENT_CODE.down,
            EVENT_CODE.left,
            EVENT_CODE.right,
            EVENT_CODE.home,
            EVENT_CODE.end,
            EVENT_CODE.pageUp,
            EVENT_CODE.pageDown
          ];
          if (validCode.includes(code)) {
            handleKeyControl(code);
            event.stopPropagation();
            event.preventDefault();
          }
          if ([EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.numpadEnter].includes(code) && userInputDate.value === null && userInputTime.value === null) {
            event.preventDefault();
            emit2(innerDate.value, false);
          }
        };
        const handleKeyControl = (code) => {
          var _a2;
          const { up, down, left, right, home, end: end2, pageUp, pageDown } = EVENT_CODE;
          const mapping = {
            year: {
              [up]: -4,
              [down]: 4,
              [left]: -1,
              [right]: 1,
              offset: (date, step) => date.setFullYear(date.getFullYear() + step)
            },
            month: {
              [up]: -4,
              [down]: 4,
              [left]: -1,
              [right]: 1,
              offset: (date, step) => date.setMonth(date.getMonth() + step)
            },
            week: {
              [up]: -1,
              [down]: 1,
              [left]: -1,
              [right]: 1,
              offset: (date, step) => date.setDate(date.getDate() + step * 7)
            },
            date: {
              [up]: -7,
              [down]: 7,
              [left]: -1,
              [right]: 1,
              [home]: (date) => -date.getDay(),
              [end2]: (date) => -date.getDay() + 6,
              [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
              [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
              offset: (date, step) => date.setDate(date.getDate() + step)
            }
          };
          const newDate = innerDate.value.toDate();
          while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
            const map2 = mapping[keyboardMode.value];
            if (!map2)
              return;
            map2.offset(newDate, isFunction$4(map2[code]) ? map2[code](newDate) : (_a2 = map2[code]) != null ? _a2 : 0);
            if (disabledDate && disabledDate(newDate)) {
              break;
            }
            const result = dayjs(newDate).locale(lang.value);
            innerDate.value = result;
            contextEmit("pick", result, true);
            break;
          }
        };
        const handlePanelChange = (mode) => {
          contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
        };
        watch(() => selectionMode.value, (val) => {
          if (["month", "year"].includes(val)) {
            currentView.value = val;
            return;
          } else if (val === "years") {
            currentView.value = "year";
            return;
          } else if (val === "months") {
            currentView.value = "month";
            return;
          }
          currentView.value = "date";
        }, { immediate: true });
        watch(() => currentView.value, () => {
          popper == null ? void 0 : popper.updatePopper();
        });
        watch(() => defaultValue.value, (val) => {
          if (val) {
            innerDate.value = getDefaultValue2();
          }
        }, { immediate: true });
        watch(() => props2.parsedValue, (val) => {
          if (val) {
            if (isMultipleType.value)
              return;
            if (isArray$5(val))
              return;
            innerDate.value = val;
          } else {
            innerDate.value = getDefaultValue2();
          }
        }, { immediate: true });
        contextEmit("set-picker-option", ["isValidValue", isValidValue2]);
        contextEmit("set-picker-option", ["formatToString", formatToString]);
        contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
        contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ppNs).b(),
              unref(dpNs).b(),
              {
                "has-sidebar": _ctx.$slots.sidebar || unref(hasShortcuts),
                "has-time": unref(showTime)
              }
            ])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ppNs).e("body-wrapper"))
            }, [
              renderSlot(_ctx.$slots, "sidebar", {
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }),
              unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
                  return openBlock(), createElementBlock("button", {
                    key,
                    type: "button",
                    class: normalizeClass(unref(ppNs).e("shortcut")),
                    onClick: ($event) => handleShortcutClick(shortcut)
                  }, toDisplayString(shortcut.text), 11, ["onClick"]);
                }), 128))
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ppNs).e("body"))
              }, [
                unref(showTime) ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(unref(dpNs).e("time-header"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(dpNs).e("editor-wrap"))
                  }, [
                    createVNode$1(unref(ElInput), {
                      placeholder: unref(t)("el.datepicker.selectDate"),
                      "model-value": unref(visibleDate),
                      size: "small",
                      "validate-event": false,
                      onInput: (val) => userInputDate.value = val,
                      onChange: handleVisibleDateChange
                    }, null, 8, ["placeholder", "model-value", "onInput"])
                  ], 2),
                  withDirectives((openBlock(), createElementBlock("span", {
                    class: normalizeClass(unref(dpNs).e("editor-wrap"))
                  }, [
                    createVNode$1(unref(ElInput), {
                      placeholder: unref(t)("el.datepicker.selectTime"),
                      "model-value": unref(visibleTime),
                      size: "small",
                      "validate-event": false,
                      onFocus: onTimePickerInputFocus,
                      onInput: (val) => userInputTime.value = val,
                      onChange: handleVisibleTimeChange
                    }, null, 8, ["placeholder", "model-value", "onInput"]),
                    createVNode$1(unref(TimePickPanel), {
                      visible: timePickerVisible.value,
                      format: unref(timeFormat),
                      "parsed-value": innerDate.value,
                      onPick: handleTimePick
                    }, null, 8, ["visible", "format", "parsed-value"])
                  ], 2)), [
                    [unref(ClickOutside), handleTimePickClose]
                  ])
                ], 2)) : createCommentVNode("v-if", true),
                withDirectives(createBaseVNode("div", {
                  class: normalizeClass([
                    unref(dpNs).e("header"),
                    (currentView.value === "year" || currentView.value === "month") && unref(dpNs).e("header--bordered")
                  ])
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(dpNs).e("prev-btn"))
                  }, [
                    createBaseVNode("button", {
                      type: "button",
                      "aria-label": unref(t)(`el.datepicker.prevYear`),
                      class: normalizeClass(["d-arrow-left", unref(ppNs).e("icon-btn")]),
                      onClick: ($event) => moveByYear(false)
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label", "onClick"]),
                    withDirectives(createBaseVNode("button", {
                      type: "button",
                      "aria-label": unref(t)(`el.datepicker.prevMonth`),
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
                      onClick: ($event) => moveByMonth(false)
                    }, [
                      renderSlot(_ctx.$slots, "prev-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label", "onClick"]), [
                      [vShow, currentView.value === "date"]
                    ])
                  ], 2),
                  createBaseVNode("span", {
                    role: "button",
                    class: normalizeClass(unref(dpNs).e("header-label")),
                    "aria-live": "polite",
                    tabindex: "0",
                    onKeydown: withKeys(($event) => showPicker("year"), ["enter"]),
                    onClick: ($event) => showPicker("year")
                  }, toDisplayString(unref(yearLabel)), 43, ["onKeydown", "onClick"]),
                  withDirectives(createBaseVNode("span", {
                    role: "button",
                    "aria-live": "polite",
                    tabindex: "0",
                    class: normalizeClass([
                      unref(dpNs).e("header-label"),
                      { active: currentView.value === "month" }
                    ]),
                    onKeydown: withKeys(($event) => showPicker("month"), ["enter"]),
                    onClick: ($event) => showPicker("month")
                  }, toDisplayString(unref(t)(`el.datepicker.month${unref(month) + 1}`)), 43, ["onKeydown", "onClick"]), [
                    [vShow, currentView.value === "date"]
                  ]),
                  createBaseVNode("span", {
                    class: normalizeClass(unref(dpNs).e("next-btn"))
                  }, [
                    withDirectives(createBaseVNode("button", {
                      type: "button",
                      "aria-label": unref(t)(`el.datepicker.nextMonth`),
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
                      onClick: ($event) => moveByMonth(true)
                    }, [
                      renderSlot(_ctx.$slots, "next-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label", "onClick"]), [
                      [vShow, currentView.value === "date"]
                    ]),
                    createBaseVNode("button", {
                      type: "button",
                      "aria-label": unref(t)(`el.datepicker.nextYear`),
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
                      onClick: ($event) => moveByYear(true)
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label", "onClick"])
                  ], 2)
                ], 2), [
                  [vShow, currentView.value !== "time"]
                ]),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ppNs).e("content")),
                  onKeydown: handleKeydownTable
                }, [
                  currentView.value === "date" ? (openBlock(), createBlock(DateTable, {
                    key: 0,
                    ref_key: "currentViewRef",
                    ref: currentViewRef,
                    "selection-mode": unref(selectionMode),
                    date: innerDate.value,
                    "parsed-value": _ctx.parsedValue,
                    "disabled-date": unref(disabledDate),
                    "cell-class-name": unref(cellClassName),
                    onPick: handleDatePick
                  }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "cell-class-name"])) : createCommentVNode("v-if", true),
                  currentView.value === "year" ? (openBlock(), createBlock(YearTable, {
                    key: 1,
                    ref_key: "currentViewRef",
                    ref: currentViewRef,
                    "selection-mode": unref(selectionMode),
                    date: innerDate.value,
                    "disabled-date": unref(disabledDate),
                    "parsed-value": _ctx.parsedValue,
                    onPick: handleYearPick
                  }, null, 8, ["selection-mode", "date", "disabled-date", "parsed-value"])) : createCommentVNode("v-if", true),
                  currentView.value === "month" ? (openBlock(), createBlock(MonthTable, {
                    key: 2,
                    ref_key: "currentViewRef",
                    ref: currentViewRef,
                    "selection-mode": unref(selectionMode),
                    date: innerDate.value,
                    "parsed-value": _ctx.parsedValue,
                    "disabled-date": unref(disabledDate),
                    onPick: handleMonthPick
                  }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date"])) : createCommentVNode("v-if", true)
                ], 34)
              ], 2)
            ], 2),
            withDirectives(createBaseVNode("div", {
              class: normalizeClass(unref(ppNs).e("footer"))
            }, [
              withDirectives(createVNode$1(unref(ElButton), {
                text: "",
                size: "small",
                class: normalizeClass(unref(ppNs).e("link-btn")),
                disabled: unref(disabledNow),
                onClick: changeToNow
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(unref(t)("el.datepicker.now")), 1)
                ]),
                _: 1
              }, 8, ["class", "disabled"]), [
                [vShow, !unref(isMultipleType) && _ctx.showNow]
              ]),
              createVNode$1(unref(ElButton), {
                plain: "",
                size: "small",
                class: normalizeClass(unref(ppNs).e("link-btn")),
                disabled: unref(disabledConfirm),
                onClick: onConfirm
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)
                ]),
                _: 1
              }, 8, ["class", "disabled"])
            ], 2), [
              [vShow, unref(footerVisible)]
            ])
          ], 2);
        };
      }
    });
    var DatePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__file", "panel-date-pick.vue"]]);
    const panelDateRangeProps = buildProps({
      ...panelSharedProps,
      ...panelRangeSharedProps,
      visible: Boolean
    });
    const useShortcut = (lang) => {
      const { emit: emit2 } = getCurrentInstance();
      const attrs = useAttrs$1();
      const slots = useSlots();
      const handleShortcutClick = (shortcut) => {
        const shortcutValues = isFunction$4(shortcut.value) ? shortcut.value() : shortcut.value;
        if (shortcutValues) {
          emit2("pick", [
            dayjs(shortcutValues[0]).locale(lang.value),
            dayjs(shortcutValues[1]).locale(lang.value)
          ]);
          return;
        }
        if (shortcut.onClick) {
          shortcut.onClick({
            attrs,
            slots,
            emit: emit2
          });
        }
      };
      return handleShortcutClick;
    };
    const useRangePicker = (props2, {
      defaultValue,
      defaultTime,
      leftDate,
      rightDate,
      unit: unit2,
      onParsedValueChanged
    }) => {
      const { emit: emit2 } = getCurrentInstance();
      const { pickerNs } = inject(ROOT_PICKER_INJECTION_KEY);
      const drpNs = useNamespace("date-range-picker");
      const { t, lang } = useLocale();
      const handleShortcutClick = useShortcut(lang);
      const minDate = ref();
      const maxDate = ref();
      const rangeState = ref({
        endDate: null,
        selecting: false
      });
      const handleChangeRange = (val) => {
        rangeState.value = val;
      };
      const handleRangeConfirm = (visible = false) => {
        const _minDate = unref(minDate);
        const _maxDate = unref(maxDate);
        if (isValidRange([_minDate, _maxDate])) {
          emit2("pick", [_minDate, _maxDate], visible);
        }
      };
      const onSelect = (selecting) => {
        rangeState.value.selecting = selecting;
        if (!selecting) {
          rangeState.value.endDate = null;
        }
      };
      const onReset = (parsedValue) => {
        if (isArray$5(parsedValue) && parsedValue.length === 2) {
          const [start2, end2] = parsedValue;
          minDate.value = start2;
          leftDate.value = start2;
          maxDate.value = end2;
          onParsedValueChanged(unref(minDate), unref(maxDate));
        } else {
          restoreDefault();
        }
      };
      const restoreDefault = () => {
        let [start2, end2] = getDefaultValue(unref(defaultValue), {
          lang: unref(lang),
          unit: unit2,
          unlinkPanels: props2.unlinkPanels
        });
        const getShift = (day) => {
          return day.diff(day.startOf("d"), "ms");
        };
        const maybeTimes = unref(defaultTime);
        if (maybeTimes) {
          let leftShift = 0;
          let rightShift = 0;
          if (isArray$5(maybeTimes)) {
            const [timeStart, timeEnd] = maybeTimes.map(dayjs);
            leftShift = getShift(timeStart);
            rightShift = getShift(timeEnd);
          } else {
            const shift2 = getShift(dayjs(maybeTimes));
            leftShift = shift2;
            rightShift = shift2;
          }
          start2 = start2.startOf("d").add(leftShift, "ms");
          end2 = end2.startOf("d").add(rightShift, "ms");
        }
        minDate.value = void 0;
        maxDate.value = void 0;
        leftDate.value = start2;
        rightDate.value = end2;
      };
      watch(defaultValue, (val) => {
        if (val) {
          restoreDefault();
        }
      }, { immediate: true });
      watch(() => props2.parsedValue, onReset, { immediate: true });
      return {
        minDate,
        maxDate,
        rangeState,
        lang,
        ppNs: pickerNs,
        drpNs,
        handleChangeRange,
        handleRangeConfirm,
        handleShortcutClick,
        onSelect,
        onReset,
        t
      };
    };
    const unit$2 = "month";
    const _sfc_main$1F = /* @__PURE__ */ defineComponent({
      __name: "panel-date-range",
      props: panelDateRangeProps,
      emits: [
        "pick",
        "set-picker-option",
        "calendar-change",
        "panel-change"
      ],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const pickerBase = inject("EP_PICKER_BASE");
        const isDefaultFormat = inject("ElIsDefaultFormat");
        const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props;
        const format2 = toRef(pickerBase.props, "format");
        const shortcuts = toRef(pickerBase.props, "shortcuts");
        const defaultValue = toRef(pickerBase.props, "defaultValue");
        const { lang } = useLocale();
        const leftDate = ref(dayjs().locale(lang.value));
        const rightDate = ref(dayjs().locale(lang.value).add(1, unit$2));
        const {
          minDate,
          maxDate,
          rangeState,
          ppNs,
          drpNs,
          handleChangeRange,
          handleRangeConfirm,
          handleShortcutClick,
          onSelect,
          onReset,
          t
        } = useRangePicker(props2, {
          defaultValue,
          defaultTime,
          leftDate,
          rightDate,
          unit: unit$2,
          onParsedValueChanged
        });
        watch(() => props2.visible, (visible) => {
          if (!visible && rangeState.value.selecting) {
            onReset(props2.parsedValue);
            onSelect(false);
          }
        });
        const dateUserInput = ref({
          min: null,
          max: null
        });
        const timeUserInput = ref({
          min: null,
          max: null
        });
        const leftLabel = computed(() => {
          return `${leftDate.value.year()} ${t("el.datepicker.year")} ${t(`el.datepicker.month${leftDate.value.month() + 1}`)}`;
        });
        const rightLabel = computed(() => {
          return `${rightDate.value.year()} ${t("el.datepicker.year")} ${t(`el.datepicker.month${rightDate.value.month() + 1}`)}`;
        });
        const leftYear = computed(() => {
          return leftDate.value.year();
        });
        const leftMonth = computed(() => {
          return leftDate.value.month();
        });
        const rightYear = computed(() => {
          return rightDate.value.year();
        });
        const rightMonth = computed(() => {
          return rightDate.value.month();
        });
        const hasShortcuts = computed(() => !!shortcuts.value.length);
        const minVisibleDate = computed(() => {
          if (dateUserInput.value.min !== null)
            return dateUserInput.value.min;
          if (minDate.value)
            return minDate.value.format(dateFormat.value);
          return "";
        });
        const maxVisibleDate = computed(() => {
          if (dateUserInput.value.max !== null)
            return dateUserInput.value.max;
          if (maxDate.value || minDate.value)
            return (maxDate.value || minDate.value).format(dateFormat.value);
          return "";
        });
        const minVisibleTime = computed(() => {
          if (timeUserInput.value.min !== null)
            return timeUserInput.value.min;
          if (minDate.value)
            return minDate.value.format(timeFormat.value);
          return "";
        });
        const maxVisibleTime = computed(() => {
          if (timeUserInput.value.max !== null)
            return timeUserInput.value.max;
          if (maxDate.value || minDate.value)
            return (maxDate.value || minDate.value).format(timeFormat.value);
          return "";
        });
        const timeFormat = computed(() => {
          return props2.timeFormat || extractTimeFormat(format2.value);
        });
        const dateFormat = computed(() => {
          return props2.dateFormat || extractDateFormat(format2.value);
        });
        const isValidValue2 = (date) => {
          return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
        };
        const leftPrevYear = () => {
          leftDate.value = leftDate.value.subtract(1, "year");
          if (!props2.unlinkPanels) {
            rightDate.value = leftDate.value.add(1, "month");
          }
          handlePanelChange("year");
        };
        const leftPrevMonth = () => {
          leftDate.value = leftDate.value.subtract(1, "month");
          if (!props2.unlinkPanels) {
            rightDate.value = leftDate.value.add(1, "month");
          }
          handlePanelChange("month");
        };
        const rightNextYear = () => {
          if (!props2.unlinkPanels) {
            leftDate.value = leftDate.value.add(1, "year");
            rightDate.value = leftDate.value.add(1, "month");
          } else {
            rightDate.value = rightDate.value.add(1, "year");
          }
          handlePanelChange("year");
        };
        const rightNextMonth = () => {
          if (!props2.unlinkPanels) {
            leftDate.value = leftDate.value.add(1, "month");
            rightDate.value = leftDate.value.add(1, "month");
          } else {
            rightDate.value = rightDate.value.add(1, "month");
          }
          handlePanelChange("month");
        };
        const leftNextYear = () => {
          leftDate.value = leftDate.value.add(1, "year");
          handlePanelChange("year");
        };
        const leftNextMonth = () => {
          leftDate.value = leftDate.value.add(1, "month");
          handlePanelChange("month");
        };
        const rightPrevYear = () => {
          rightDate.value = rightDate.value.subtract(1, "year");
          handlePanelChange("year");
        };
        const rightPrevMonth = () => {
          rightDate.value = rightDate.value.subtract(1, "month");
          handlePanelChange("month");
        };
        const handlePanelChange = (mode) => {
          emit2("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode);
        };
        const enableMonthArrow = computed(() => {
          const nextMonth = (leftMonth.value + 1) % 12;
          const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0;
          return props2.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value);
        });
        const enableYearArrow = computed(() => {
          return props2.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12;
        });
        const btnDisabled = computed(() => {
          return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]));
        });
        const showTime = computed(() => props2.type === "datetime" || props2.type === "datetimerange");
        const formatEmit = (emitDayjs, index) => {
          if (!emitDayjs)
            return;
          if (defaultTime) {
            const defaultTimeD = dayjs(defaultTime[index] || defaultTime).locale(lang.value);
            return defaultTimeD.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
          }
          return emitDayjs;
        };
        const handleRangePick = (val, close2 = true) => {
          const min_ = val.minDate;
          const max_ = val.maxDate;
          const minDate_ = formatEmit(min_, 0);
          const maxDate_ = formatEmit(max_, 1);
          if (maxDate.value === maxDate_ && minDate.value === minDate_) {
            return;
          }
          emit2("calendar-change", [min_.toDate(), max_ && max_.toDate()]);
          maxDate.value = maxDate_;
          minDate.value = minDate_;
          if (!close2 || showTime.value)
            return;
          handleRangeConfirm();
        };
        const minTimePickerVisible = ref(false);
        const maxTimePickerVisible = ref(false);
        const handleMinTimeClose = () => {
          minTimePickerVisible.value = false;
        };
        const handleMaxTimeClose = () => {
          maxTimePickerVisible.value = false;
        };
        const handleDateInput = (value, type) => {
          dateUserInput.value[type] = value;
          const parsedValueD = dayjs(value, dateFormat.value).locale(lang.value);
          if (parsedValueD.isValid()) {
            if (disabledDate && disabledDate(parsedValueD.toDate())) {
              return;
            }
            if (type === "min") {
              leftDate.value = parsedValueD;
              minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
              if (!props2.unlinkPanels && (!maxDate.value || maxDate.value.isBefore(minDate.value))) {
                rightDate.value = parsedValueD.add(1, "month");
                maxDate.value = minDate.value.add(1, "month");
              }
            } else {
              rightDate.value = parsedValueD;
              maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
              if (!props2.unlinkPanels && (!minDate.value || minDate.value.isAfter(maxDate.value))) {
                leftDate.value = parsedValueD.subtract(1, "month");
                minDate.value = maxDate.value.subtract(1, "month");
              }
            }
          }
        };
        const handleDateChange = (_2, type) => {
          dateUserInput.value[type] = null;
        };
        const handleTimeInput = (value, type) => {
          timeUserInput.value[type] = value;
          const parsedValueD = dayjs(value, timeFormat.value).locale(lang.value);
          if (parsedValueD.isValid()) {
            if (type === "min") {
              minTimePickerVisible.value = true;
              minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
            } else {
              maxTimePickerVisible.value = true;
              maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
              rightDate.value = maxDate.value;
            }
          }
        };
        const handleTimeChange = (value, type) => {
          timeUserInput.value[type] = null;
          if (type === "min") {
            leftDate.value = minDate.value;
            minTimePickerVisible.value = false;
            if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
              maxDate.value = minDate.value;
            }
          } else {
            rightDate.value = maxDate.value;
            maxTimePickerVisible.value = false;
            if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
              minDate.value = maxDate.value;
            }
          }
        };
        const handleMinTimePick = (value, visible, first) => {
          if (timeUserInput.value.min)
            return;
          if (value) {
            leftDate.value = value;
            minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
          }
          if (!first) {
            minTimePickerVisible.value = visible;
          }
          if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
            maxDate.value = minDate.value;
            rightDate.value = value;
          }
        };
        const handleMaxTimePick = (value, visible, first) => {
          if (timeUserInput.value.max)
            return;
          if (value) {
            rightDate.value = value;
            maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
          }
          if (!first) {
            maxTimePickerVisible.value = visible;
          }
          if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
            minDate.value = maxDate.value;
          }
        };
        const handleClear = () => {
          leftDate.value = getDefaultValue(unref(defaultValue), {
            lang: unref(lang),
            unit: "month",
            unlinkPanels: props2.unlinkPanels
          })[0];
          rightDate.value = leftDate.value.add(1, "month");
          maxDate.value = void 0;
          minDate.value = void 0;
          emit2("pick", null);
        };
        const formatToString = (value) => {
          return isArray$5(value) ? value.map((_2) => _2.format(format2.value)) : value.format(format2.value);
        };
        const parseUserInput = (value) => {
          return correctlyParseUserInput(value, format2.value, lang.value, isDefaultFormat);
        };
        function onParsedValueChanged(minDate2, maxDate2) {
          if (props2.unlinkPanels && maxDate2) {
            const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
            const minDateMonth = (minDate2 == null ? void 0 : minDate2.month()) || 0;
            const maxDateYear = maxDate2.year();
            const maxDateMonth = maxDate2.month();
            rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate2.add(1, unit$2) : maxDate2;
          } else {
            rightDate.value = leftDate.value.add(1, unit$2);
            if (maxDate2) {
              rightDate.value = rightDate.value.hour(maxDate2.hour()).minute(maxDate2.minute()).second(maxDate2.second());
            }
          }
        }
        emit2("set-picker-option", ["isValidValue", isValidValue2]);
        emit2("set-picker-option", ["parseUserInput", parseUserInput]);
        emit2("set-picker-option", ["formatToString", formatToString]);
        emit2("set-picker-option", ["handleClear", handleClear]);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ppNs).b(),
              unref(drpNs).b(),
              {
                "has-sidebar": _ctx.$slots.sidebar || unref(hasShortcuts),
                "has-time": unref(showTime)
              }
            ])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ppNs).e("body-wrapper"))
            }, [
              renderSlot(_ctx.$slots, "sidebar", {
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }),
              unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
                  return openBlock(), createElementBlock("button", {
                    key,
                    type: "button",
                    class: normalizeClass(unref(ppNs).e("shortcut")),
                    onClick: ($event) => unref(handleShortcutClick)(shortcut)
                  }, toDisplayString(shortcut.text), 11, ["onClick"]);
                }), 128))
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ppNs).e("body"))
              }, [
                unref(showTime) ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(unref(drpNs).e("time-header"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(drpNs).e("editors-wrap"))
                  }, [
                    createBaseVNode("span", {
                      class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
                    }, [
                      createVNode$1(unref(ElInput), {
                        size: "small",
                        disabled: unref(rangeState).selecting,
                        placeholder: unref(t)("el.datepicker.startDate"),
                        class: normalizeClass(unref(drpNs).e("editor")),
                        "model-value": unref(minVisibleDate),
                        "validate-event": false,
                        onInput: (val) => handleDateInput(val, "min"),
                        onChange: (val) => handleDateChange(val, "min")
                      }, null, 8, ["disabled", "placeholder", "class", "model-value", "onInput", "onChange"])
                    ], 2),
                    withDirectives((openBlock(), createElementBlock("span", {
                      class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
                    }, [
                      createVNode$1(unref(ElInput), {
                        size: "small",
                        class: normalizeClass(unref(drpNs).e("editor")),
                        disabled: unref(rangeState).selecting,
                        placeholder: unref(t)("el.datepicker.startTime"),
                        "model-value": unref(minVisibleTime),
                        "validate-event": false,
                        onFocus: ($event) => minTimePickerVisible.value = true,
                        onInput: (val) => handleTimeInput(val, "min"),
                        onChange: (val) => handleTimeChange(val, "min")
                      }, null, 8, ["class", "disabled", "placeholder", "model-value", "onFocus", "onInput", "onChange"]),
                      createVNode$1(unref(TimePickPanel), {
                        visible: minTimePickerVisible.value,
                        format: unref(timeFormat),
                        "datetime-role": "start",
                        "parsed-value": leftDate.value,
                        onPick: handleMinTimePick
                      }, null, 8, ["visible", "format", "parsed-value"])
                    ], 2)), [
                      [unref(ClickOutside), handleMinTimeClose]
                    ])
                  ], 2),
                  createBaseVNode("span", null, [
                    createVNode$1(unref(ElIcon), null, {
                      default: withCtx(() => [
                        createVNode$1(unref(arrow_right_default))
                      ]),
                      _: 1
                    })
                  ]),
                  createBaseVNode("span", {
                    class: normalizeClass([unref(drpNs).e("editors-wrap"), "is-right"])
                  }, [
                    createBaseVNode("span", {
                      class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
                    }, [
                      createVNode$1(unref(ElInput), {
                        size: "small",
                        class: normalizeClass(unref(drpNs).e("editor")),
                        disabled: unref(rangeState).selecting,
                        placeholder: unref(t)("el.datepicker.endDate"),
                        "model-value": unref(maxVisibleDate),
                        readonly: !unref(minDate),
                        "validate-event": false,
                        onInput: (val) => handleDateInput(val, "max"),
                        onChange: (val) => handleDateChange(val, "max")
                      }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly", "onInput", "onChange"])
                    ], 2),
                    withDirectives((openBlock(), createElementBlock("span", {
                      class: normalizeClass(unref(drpNs).e("time-picker-wrap"))
                    }, [
                      createVNode$1(unref(ElInput), {
                        size: "small",
                        class: normalizeClass(unref(drpNs).e("editor")),
                        disabled: unref(rangeState).selecting,
                        placeholder: unref(t)("el.datepicker.endTime"),
                        "model-value": unref(maxVisibleTime),
                        readonly: !unref(minDate),
                        "validate-event": false,
                        onFocus: ($event) => unref(minDate) && (maxTimePickerVisible.value = true),
                        onInput: (val) => handleTimeInput(val, "max"),
                        onChange: (val) => handleTimeChange(val, "max")
                      }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly", "onFocus", "onInput", "onChange"]),
                      createVNode$1(unref(TimePickPanel), {
                        "datetime-role": "end",
                        visible: maxTimePickerVisible.value,
                        format: unref(timeFormat),
                        "parsed-value": rightDate.value,
                        onPick: handleMaxTimePick
                      }, null, 8, ["visible", "format", "parsed-value"])
                    ], 2)), [
                      [unref(ClickOutside), handleMaxTimeClose]
                    ])
                  ], 2)
                ], 2)) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
                      "aria-label": unref(t)(`el.datepicker.prevYear`),
                      onClick: leftPrevYear
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label"]),
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-left"]),
                      "aria-label": unref(t)(`el.datepicker.prevMonth`),
                      onClick: leftPrevMonth
                    }, [
                      renderSlot(_ctx.$slots, "prev-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label"]),
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass([[unref(ppNs).e("icon-btn"), { "is-disabled": !unref(enableYearArrow) }], "d-arrow-right"]),
                      "aria-label": unref(t)(`el.datepicker.nextYear`),
                      onClick: leftNextYear
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 1,
                      type: "button",
                      disabled: !unref(enableMonthArrow),
                      class: normalizeClass([[
                        unref(ppNs).e("icon-btn"),
                        { "is-disabled": !unref(enableMonthArrow) }
                      ], "arrow-right"]),
                      "aria-label": unref(t)(`el.datepicker.nextMonth`),
                      onClick: leftNextMonth
                    }, [
                      renderSlot(_ctx.$slots, "next-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
                    createBaseVNode("div", null, toDisplayString(unref(leftLabel)), 1)
                  ], 2),
                  createVNode$1(DateTable, {
                    "selection-mode": "range",
                    date: leftDate.value,
                    "min-date": unref(minDate),
                    "max-date": unref(maxDate),
                    "range-state": unref(rangeState),
                    "disabled-date": unref(disabledDate),
                    "cell-class-name": unref(cellClassName),
                    onChangerange: unref(handleChangeRange),
                    onPick: handleRangePick,
                    onSelect: unref(onSelect)
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "onSelect"])
                ], 2),
                createBaseVNode("div", {
                  class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass([[unref(ppNs).e("icon-btn"), { "is-disabled": !unref(enableYearArrow) }], "d-arrow-left"]),
                      "aria-label": unref(t)(`el.datepicker.prevYear`),
                      onClick: rightPrevYear
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 1,
                      type: "button",
                      disabled: !unref(enableMonthArrow),
                      class: normalizeClass([[
                        unref(ppNs).e("icon-btn"),
                        { "is-disabled": !unref(enableMonthArrow) }
                      ], "arrow-left"]),
                      "aria-label": unref(t)(`el.datepicker.prevMonth`),
                      onClick: rightPrevMonth
                    }, [
                      renderSlot(_ctx.$slots, "prev-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "aria-label"])) : createCommentVNode("v-if", true),
                    createBaseVNode("button", {
                      type: "button",
                      "aria-label": unref(t)(`el.datepicker.nextYear`),
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
                      onClick: rightNextYear
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label"]),
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "arrow-right"]),
                      "aria-label": unref(t)(`el.datepicker.nextMonth`),
                      onClick: rightNextMonth
                    }, [
                      renderSlot(_ctx.$slots, "next-month", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["aria-label"]),
                    createBaseVNode("div", null, toDisplayString(unref(rightLabel)), 1)
                  ], 2),
                  createVNode$1(DateTable, {
                    "selection-mode": "range",
                    date: rightDate.value,
                    "min-date": unref(minDate),
                    "max-date": unref(maxDate),
                    "range-state": unref(rangeState),
                    "disabled-date": unref(disabledDate),
                    "cell-class-name": unref(cellClassName),
                    onChangerange: unref(handleChangeRange),
                    onPick: handleRangePick,
                    onSelect: unref(onSelect)
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "onSelect"])
                ], 2)
              ], 2)
            ], 2),
            unref(showTime) ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ppNs).e("footer"))
            }, [
              unref(clearable) ? (openBlock(), createBlock(unref(ElButton), {
                key: 0,
                text: "",
                size: "small",
                class: normalizeClass(unref(ppNs).e("link-btn")),
                onClick: handleClear
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(unref(t)("el.datepicker.clear")), 1)
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true),
              createVNode$1(unref(ElButton), {
                plain: "",
                size: "small",
                class: normalizeClass(unref(ppNs).e("link-btn")),
                disabled: unref(btnDisabled),
                onClick: ($event) => unref(handleRangeConfirm)(false)
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(unref(t)("el.datepicker.confirm")), 1)
                ]),
                _: 1
              }, 8, ["class", "disabled", "onClick"])
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var DateRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["__file", "panel-date-range.vue"]]);
    const panelMonthRangeProps = buildProps({
      ...panelRangeSharedProps
    });
    const panelMonthRangeEmits = [
      "pick",
      "set-picker-option",
      "calendar-change"
    ];
    const useMonthRangeHeader = ({
      unlinkPanels,
      leftDate,
      rightDate
    }) => {
      const { t } = useLocale();
      const leftPrevYear = () => {
        leftDate.value = leftDate.value.subtract(1, "year");
        if (!unlinkPanels.value) {
          rightDate.value = rightDate.value.subtract(1, "year");
        }
      };
      const rightNextYear = () => {
        if (!unlinkPanels.value) {
          leftDate.value = leftDate.value.add(1, "year");
        }
        rightDate.value = rightDate.value.add(1, "year");
      };
      const leftNextYear = () => {
        leftDate.value = leftDate.value.add(1, "year");
      };
      const rightPrevYear = () => {
        rightDate.value = rightDate.value.subtract(1, "year");
      };
      const leftLabel = computed(() => {
        return `${leftDate.value.year()} ${t("el.datepicker.year")}`;
      });
      const rightLabel = computed(() => {
        return `${rightDate.value.year()} ${t("el.datepicker.year")}`;
      });
      const leftYear = computed(() => {
        return leftDate.value.year();
      });
      const rightYear = computed(() => {
        return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year();
      });
      return {
        leftPrevYear,
        rightNextYear,
        leftNextYear,
        rightPrevYear,
        leftLabel,
        rightLabel,
        leftYear,
        rightYear
      };
    };
    const unit$1 = "year";
    const __default__$19 = /* @__PURE__ */ defineComponent({
      name: "DatePickerMonthRange"
    });
    const _sfc_main$1E = /* @__PURE__ */ defineComponent({
      ...__default__$19,
      props: panelMonthRangeProps,
      emits: panelMonthRangeEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { lang } = useLocale();
        const pickerBase = inject("EP_PICKER_BASE");
        const isDefaultFormat = inject("ElIsDefaultFormat");
        const { shortcuts, disabledDate } = pickerBase.props;
        const format2 = toRef(pickerBase.props, "format");
        const defaultValue = toRef(pickerBase.props, "defaultValue");
        const leftDate = ref(dayjs().locale(lang.value));
        const rightDate = ref(dayjs().locale(lang.value).add(1, unit$1));
        const {
          minDate,
          maxDate,
          rangeState,
          ppNs,
          drpNs,
          handleChangeRange,
          handleRangeConfirm,
          handleShortcutClick,
          onSelect
        } = useRangePicker(props2, {
          defaultValue,
          leftDate,
          rightDate,
          unit: unit$1,
          onParsedValueChanged
        });
        const hasShortcuts = computed(() => !!shortcuts.length);
        const {
          leftPrevYear,
          rightNextYear,
          leftNextYear,
          rightPrevYear,
          leftLabel,
          rightLabel,
          leftYear,
          rightYear
        } = useMonthRangeHeader({
          unlinkPanels: toRef(props2, "unlinkPanels"),
          leftDate,
          rightDate
        });
        const enableYearArrow = computed(() => {
          return props2.unlinkPanels && rightYear.value > leftYear.value + 1;
        });
        const handleRangePick = (val, close2 = true) => {
          const minDate_ = val.minDate;
          const maxDate_ = val.maxDate;
          if (maxDate.value === maxDate_ && minDate.value === minDate_) {
            return;
          }
          emit2("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
          maxDate.value = maxDate_;
          minDate.value = minDate_;
          if (!close2)
            return;
          handleRangeConfirm();
        };
        const handleClear = () => {
          leftDate.value = getDefaultValue(unref(defaultValue), {
            lang: unref(lang),
            unit: "year",
            unlinkPanels: props2.unlinkPanels
          })[0];
          rightDate.value = leftDate.value.add(1, "year");
          emit2("pick", null);
        };
        const formatToString = (value) => {
          return isArray$5(value) ? value.map((_2) => _2.format(format2.value)) : value.format(format2.value);
        };
        const parseUserInput = (value) => {
          return correctlyParseUserInput(value, format2.value, lang.value, isDefaultFormat);
        };
        function onParsedValueChanged(minDate2, maxDate2) {
          if (props2.unlinkPanels && maxDate2) {
            const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
            const maxDateYear = maxDate2.year();
            rightDate.value = minDateYear === maxDateYear ? maxDate2.add(1, unit$1) : maxDate2;
          } else {
            rightDate.value = leftDate.value.add(1, unit$1);
          }
        }
        emit2("set-picker-option", ["isValidValue", isValidRange]);
        emit2("set-picker-option", ["formatToString", formatToString]);
        emit2("set-picker-option", ["parseUserInput", parseUserInput]);
        emit2("set-picker-option", ["handleClear", handleClear]);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ppNs).b(),
              unref(drpNs).b(),
              {
                "has-sidebar": Boolean(_ctx.$slots.sidebar) || unref(hasShortcuts)
              }
            ])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ppNs).e("body-wrapper"))
            }, [
              renderSlot(_ctx.$slots, "sidebar", {
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }),
              unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
                  return openBlock(), createElementBlock("button", {
                    key,
                    type: "button",
                    class: normalizeClass(unref(ppNs).e("shortcut")),
                    onClick: ($event) => unref(handleShortcutClick)(shortcut)
                  }, toDisplayString(shortcut.text), 11, ["onClick"]);
                }), 128))
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ppNs).e("body"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-left"])
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-left"]),
                      onClick: unref(leftPrevYear)
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["onClick"]),
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass([[
                        unref(ppNs).e("icon-btn"),
                        { [unref(ppNs).is("disabled")]: !unref(enableYearArrow) }
                      ], "d-arrow-right"]),
                      onClick: unref(leftNextYear)
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
                    createBaseVNode("div", null, toDisplayString(unref(leftLabel)), 1)
                  ], 2),
                  createVNode$1(MonthTable, {
                    "selection-mode": "range",
                    date: leftDate.value,
                    "min-date": unref(minDate),
                    "max-date": unref(maxDate),
                    "range-state": unref(rangeState),
                    "disabled-date": unref(disabledDate),
                    onChangerange: unref(handleChangeRange),
                    onPick: handleRangePick,
                    onSelect: unref(onSelect)
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "onChangerange", "onSelect"])
                ], 2),
                createBaseVNode("div", {
                  class: normalizeClass([[unref(ppNs).e("content"), unref(drpNs).e("content")], "is-right"])
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass([[unref(ppNs).e("icon-btn"), { "is-disabled": !unref(enableYearArrow) }], "d-arrow-left"]),
                      onClick: unref(rightPrevYear)
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass([unref(ppNs).e("icon-btn"), "d-arrow-right"]),
                      onClick: unref(rightNextYear)
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["onClick"]),
                    createBaseVNode("div", null, toDisplayString(unref(rightLabel)), 1)
                  ], 2),
                  createVNode$1(MonthTable, {
                    "selection-mode": "range",
                    date: rightDate.value,
                    "min-date": unref(minDate),
                    "max-date": unref(maxDate),
                    "range-state": unref(rangeState),
                    "disabled-date": unref(disabledDate),
                    onChangerange: unref(handleChangeRange),
                    onPick: handleRangePick,
                    onSelect: unref(onSelect)
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "onChangerange", "onSelect"])
                ], 2)
              ], 2)
            ], 2)
          ], 2);
        };
      }
    });
    var MonthRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["__file", "panel-month-range.vue"]]);
    const panelYearRangeProps = buildProps({
      ...panelRangeSharedProps
    });
    const panelYearRangeEmits = [
      "pick",
      "set-picker-option",
      "calendar-change"
    ];
    const useYearRangeHeader = ({
      unlinkPanels,
      leftDate,
      rightDate
    }) => {
      const leftPrevYear = () => {
        leftDate.value = leftDate.value.subtract(10, "year");
        if (!unlinkPanels.value) {
          rightDate.value = rightDate.value.subtract(10, "year");
        }
      };
      const rightNextYear = () => {
        if (!unlinkPanels.value) {
          leftDate.value = leftDate.value.add(10, "year");
        }
        rightDate.value = rightDate.value.add(10, "year");
      };
      const leftNextYear = () => {
        leftDate.value = leftDate.value.add(10, "year");
      };
      const rightPrevYear = () => {
        rightDate.value = rightDate.value.subtract(10, "year");
      };
      const leftLabel = computed(() => {
        const leftStartDate = Math.floor(leftDate.value.year() / 10) * 10;
        return `${leftStartDate}-${leftStartDate + 9}`;
      });
      const rightLabel = computed(() => {
        const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
        return `${rightStartDate}-${rightStartDate + 9}`;
      });
      const leftYear = computed(() => {
        const leftEndDate = Math.floor(leftDate.value.year() / 10) * 10 + 9;
        return leftEndDate;
      });
      const rightYear = computed(() => {
        const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
        return rightStartDate;
      });
      return {
        leftPrevYear,
        rightNextYear,
        leftNextYear,
        rightPrevYear,
        leftLabel,
        rightLabel,
        leftYear,
        rightYear
      };
    };
    const unit = "year";
    const __default__$18 = /* @__PURE__ */ defineComponent({
      name: "DatePickerYearRange"
    });
    const _sfc_main$1D = /* @__PURE__ */ defineComponent({
      ...__default__$18,
      props: panelYearRangeProps,
      emits: panelYearRangeEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { lang } = useLocale();
        const leftDate = ref(dayjs().locale(lang.value));
        const rightDate = ref(leftDate.value.add(10, "year"));
        const { pickerNs: ppNs } = inject(ROOT_PICKER_INJECTION_KEY);
        const drpNs = useNamespace("date-range-picker");
        const isDefaultFormat = inject("ElIsDefaultFormat");
        const hasShortcuts = computed(() => !!shortcuts.length);
        const panelKls = computed(() => [
          ppNs.b(),
          drpNs.b(),
          {
            "has-sidebar": Boolean(useSlots().sidebar) || hasShortcuts.value
          }
        ]);
        const leftPanelKls = computed(() => {
          return {
            content: [ppNs.e("content"), drpNs.e("content"), "is-left"],
            arrowLeftBtn: [ppNs.e("icon-btn"), "d-arrow-left"],
            arrowRightBtn: [
              ppNs.e("icon-btn"),
              { [ppNs.is("disabled")]: !enableYearArrow.value },
              "d-arrow-right"
            ]
          };
        });
        const rightPanelKls = computed(() => {
          return {
            content: [ppNs.e("content"), drpNs.e("content"), "is-right"],
            arrowLeftBtn: [
              ppNs.e("icon-btn"),
              { "is-disabled": !enableYearArrow.value },
              "d-arrow-left"
            ],
            arrowRightBtn: [ppNs.e("icon-btn"), "d-arrow-right"]
          };
        });
        const handleShortcutClick = useShortcut(lang);
        const {
          leftPrevYear,
          rightNextYear,
          leftNextYear,
          rightPrevYear,
          leftLabel,
          rightLabel,
          leftYear,
          rightYear
        } = useYearRangeHeader({
          unlinkPanels: toRef(props2, "unlinkPanels"),
          leftDate,
          rightDate
        });
        const enableYearArrow = computed(() => {
          return props2.unlinkPanels && rightYear.value > leftYear.value + 1;
        });
        const minDate = ref();
        const maxDate = ref();
        const rangeState = ref({
          endDate: null,
          selecting: false
        });
        const handleChangeRange = (val) => {
          rangeState.value = val;
        };
        const handleRangePick = (val, close2 = true) => {
          const minDate_ = val.minDate;
          const maxDate_ = val.maxDate;
          if (maxDate.value === maxDate_ && minDate.value === minDate_) {
            return;
          }
          emit2("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
          maxDate.value = maxDate_;
          minDate.value = minDate_;
          if (!close2)
            return;
          handleConfirm();
        };
        const handleConfirm = (visible = false) => {
          if (isValidRange([minDate.value, maxDate.value])) {
            emit2("pick", [minDate.value, maxDate.value], visible);
          }
        };
        const onSelect = (selecting) => {
          rangeState.value.selecting = selecting;
          if (!selecting) {
            rangeState.value.endDate = null;
          }
        };
        const pickerBase = inject("EP_PICKER_BASE");
        const { shortcuts, disabledDate } = pickerBase.props;
        const format2 = toRef(pickerBase.props, "format");
        const defaultValue = toRef(pickerBase.props, "defaultValue");
        const getDefaultValue2 = () => {
          let start2;
          if (isArray$5(defaultValue.value)) {
            const left = dayjs(defaultValue.value[0]);
            let right = dayjs(defaultValue.value[1]);
            if (!props2.unlinkPanels) {
              right = left.add(10, unit);
            }
            return [left, right];
          } else if (defaultValue.value) {
            start2 = dayjs(defaultValue.value);
          } else {
            start2 = dayjs();
          }
          start2 = start2.locale(lang.value);
          return [start2, start2.add(10, unit)];
        };
        watch(() => defaultValue.value, (val) => {
          if (val) {
            const defaultArr = getDefaultValue2();
            leftDate.value = defaultArr[0];
            rightDate.value = defaultArr[1];
          }
        }, { immediate: true });
        watch(() => props2.parsedValue, (newVal) => {
          if (newVal && newVal.length === 2) {
            minDate.value = newVal[0];
            maxDate.value = newVal[1];
            leftDate.value = minDate.value;
            if (props2.unlinkPanels && maxDate.value) {
              const minDateYear = minDate.value.year();
              const maxDateYear = maxDate.value.year();
              rightDate.value = minDateYear === maxDateYear ? maxDate.value.add(10, "year") : maxDate.value;
            } else {
              rightDate.value = leftDate.value.add(10, "year");
            }
          } else {
            const defaultArr = getDefaultValue2();
            minDate.value = void 0;
            maxDate.value = void 0;
            leftDate.value = defaultArr[0];
            rightDate.value = defaultArr[1];
          }
        }, { immediate: true });
        const parseUserInput = (value) => {
          return correctlyParseUserInput(value, format2.value, lang.value, isDefaultFormat);
        };
        const formatToString = (value) => {
          return isArray$5(value) ? value.map((day) => day.format(format2.value)) : value.format(format2.value);
        };
        const isValidValue2 = (date) => {
          return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
        };
        const handleClear = () => {
          const defaultArr = getDefaultValue2();
          leftDate.value = defaultArr[0];
          rightDate.value = defaultArr[1];
          maxDate.value = void 0;
          minDate.value = void 0;
          emit2("pick", null);
        };
        emit2("set-picker-option", ["isValidValue", isValidValue2]);
        emit2("set-picker-option", ["parseUserInput", parseUserInput]);
        emit2("set-picker-option", ["formatToString", formatToString]);
        emit2("set-picker-option", ["handleClear", handleClear]);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(panelKls))
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ppNs).e("body-wrapper"))
            }, [
              renderSlot(_ctx.$slots, "sidebar", {
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }),
              unref(hasShortcuts) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ppNs).e("sidebar"))
              }, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(shortcuts), (shortcut, key) => {
                  return openBlock(), createElementBlock("button", {
                    key,
                    type: "button",
                    class: normalizeClass(unref(ppNs).e("shortcut")),
                    onClick: ($event) => unref(handleShortcutClick)(shortcut)
                  }, toDisplayString(shortcut.text), 11, ["onClick"]);
                }), 128))
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ppNs).e("body"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(leftPanelKls).content)
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass(unref(leftPanelKls).arrowLeftBtn),
                      onClick: unref(leftPrevYear)
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["onClick"]),
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass(unref(leftPanelKls).arrowRightBtn),
                      onClick: unref(leftNextYear)
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
                    createBaseVNode("div", null, toDisplayString(unref(leftLabel)), 1)
                  ], 2),
                  createVNode$1(YearTable, {
                    "selection-mode": "range",
                    date: leftDate.value,
                    "min-date": minDate.value,
                    "max-date": maxDate.value,
                    "range-state": rangeState.value,
                    "disabled-date": unref(disabledDate),
                    onChangerange: handleChangeRange,
                    onPick: handleRangePick,
                    onSelect
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date"])
                ], 2),
                createBaseVNode("div", {
                  class: normalizeClass(unref(rightPanelKls).content)
                }, [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(drpNs).e("header"))
                  }, [
                    _ctx.unlinkPanels ? (openBlock(), createElementBlock("button", {
                      key: 0,
                      type: "button",
                      disabled: !unref(enableYearArrow),
                      class: normalizeClass(unref(rightPanelKls).arrowLeftBtn),
                      onClick: unref(rightPrevYear)
                    }, [
                      renderSlot(_ctx.$slots, "prev-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_left_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["disabled", "onClick"])) : createCommentVNode("v-if", true),
                    createBaseVNode("button", {
                      type: "button",
                      class: normalizeClass(unref(rightPanelKls).arrowRightBtn),
                      onClick: unref(rightNextYear)
                    }, [
                      renderSlot(_ctx.$slots, "next-year", {}, () => [
                        createVNode$1(unref(ElIcon), null, {
                          default: withCtx(() => [
                            createVNode$1(unref(d_arrow_right_default))
                          ]),
                          _: 1
                        })
                      ])
                    ], 10, ["onClick"]),
                    createBaseVNode("div", null, toDisplayString(unref(rightLabel)), 1)
                  ], 2),
                  createVNode$1(YearTable, {
                    "selection-mode": "range",
                    date: rightDate.value,
                    "min-date": minDate.value,
                    "max-date": maxDate.value,
                    "range-state": rangeState.value,
                    "disabled-date": unref(disabledDate),
                    onChangerange: handleChangeRange,
                    onPick: handleRangePick,
                    onSelect
                  }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date"])
                ], 2)
              ], 2)
            ], 2)
          ], 2);
        };
      }
    });
    var YearRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__file", "panel-year-range.vue"]]);
    const getPanel = function(type) {
      switch (type) {
        case "daterange":
        case "datetimerange": {
          return DateRangePickPanel;
        }
        case "monthrange": {
          return MonthRangePickPanel;
        }
        case "yearrange": {
          return YearRangePickPanel;
        }
        default: {
          return DatePickPanel;
        }
      }
    };
    dayjs.extend(localeData);
    dayjs.extend(advancedFormat);
    dayjs.extend(customParseFormat);
    dayjs.extend(weekOfYear);
    dayjs.extend(weekYear);
    dayjs.extend(dayOfYear);
    dayjs.extend(isSameOrAfter);
    dayjs.extend(isSameOrBefore);
    var DatePicker = /* @__PURE__ */ defineComponent({
      name: "ElDatePicker",
      install: null,
      props: datePickerProps,
      emits: [UPDATE_MODEL_EVENT],
      setup(props2, {
        expose,
        emit: emit2,
        slots
      }) {
        const ns = useNamespace("picker-panel");
        const isDefaultFormat = computed(() => {
          return !props2.format;
        });
        provide("ElIsDefaultFormat", isDefaultFormat);
        provide("ElPopperOptions", reactive(toRef(props2, "popperOptions")));
        provide(ROOT_PICKER_INJECTION_KEY, {
          slots,
          pickerNs: ns
        });
        const commonPicker = ref();
        const refProps = {
          focus: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.focus();
          },
          blur: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.blur();
          },
          handleOpen: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.handleOpen();
          },
          handleClose: () => {
            var _a2;
            (_a2 = commonPicker.value) == null ? void 0 : _a2.handleClose();
          }
        };
        expose(refProps);
        const onModelValueUpdated = (val) => {
          emit2(UPDATE_MODEL_EVENT, val);
        };
        return () => {
          var _a2;
          const format2 = (_a2 = props2.format) != null ? _a2 : DEFAULT_FORMATS_DATEPICKER[props2.type] || DEFAULT_FORMATS_DATE;
          const Component = getPanel(props2.type);
          return createVNode$1(CommonPicker, mergeProps(props2, {
            "format": format2,
            "type": props2.type,
            "ref": commonPicker,
            "onUpdate:modelValue": onModelValueUpdated
          }), {
            default: (scopedProps) => createVNode$1(Component, scopedProps, {
              "prev-month": slots["prev-month"],
              "next-month": slots["next-month"],
              "prev-year": slots["prev-year"],
              "next-year": slots["next-year"]
            }),
            "range-separator": slots["range-separator"]
          });
        };
      }
    });
    const ElDatePicker = withInstall(DatePicker);
    const descriptionsKey = Symbol("elDescriptions");
    var ElDescriptionsCell = /* @__PURE__ */ defineComponent({
      name: "ElDescriptionsCell",
      props: {
        cell: {
          type: Object
        },
        tag: {
          type: String,
          default: "td"
        },
        type: {
          type: String
        }
      },
      setup() {
        const descriptions = inject(descriptionsKey, {});
        return {
          descriptions
        };
      },
      render() {
        var _a2;
        const item = getNormalizedProps(this.cell);
        const directives = (((_a2 = this.cell) == null ? void 0 : _a2.dirs) || []).map((dire) => {
          const { dir: dir3, arg, modifiers, value } = dire;
          return [dir3, value, arg, modifiers];
        });
        const { border, direction: direction2 } = this.descriptions;
        const isVertical = direction2 === "vertical";
        const renderLabel = () => {
          var _a22, _b2, _c2;
          return ((_c2 = (_b2 = (_a22 = this.cell) == null ? void 0 : _a22.children) == null ? void 0 : _b2.label) == null ? void 0 : _c2.call(_b2)) || item.label;
        };
        const renderContent = () => {
          var _a22, _b2, _c2;
          return (_c2 = (_b2 = (_a22 = this.cell) == null ? void 0 : _a22.children) == null ? void 0 : _b2.default) == null ? void 0 : _c2.call(_b2);
        };
        const span = item.span;
        const rowspan = item.rowspan;
        const align = item.align ? `is-${item.align}` : "";
        const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
        const className = item.className;
        const labelClassName = item.labelClassName;
        const width = this.type === "label" ? item.labelWidth || this.descriptions.labelWidth || item.width : item.width;
        const style = {
          width: addUnit(width),
          minWidth: addUnit(item.minWidth)
        };
        const ns = useNamespace("descriptions");
        switch (this.type) {
          case "label":
            return withDirectives(h$1(this.tag, {
              style,
              class: [
                ns.e("cell"),
                ns.e("label"),
                ns.is("bordered-label", border),
                ns.is("vertical-label", isVertical),
                labelAlign,
                labelClassName
              ],
              colSpan: isVertical ? span : 1,
              rowspan: isVertical ? 1 : rowspan
            }, renderLabel()), directives);
          case "content":
            return withDirectives(h$1(this.tag, {
              style,
              class: [
                ns.e("cell"),
                ns.e("content"),
                ns.is("bordered-content", border),
                ns.is("vertical-content", isVertical),
                align,
                className
              ],
              colSpan: isVertical ? span : span * 2 - 1,
              rowspan: isVertical ? rowspan * 2 - 1 : rowspan
            }, renderContent()), directives);
          default: {
            const label = renderLabel();
            const labelStyle = {};
            const width2 = addUnit(item.labelWidth || this.descriptions.labelWidth);
            if (width2) {
              labelStyle.width = width2;
              labelStyle.display = "inline-block";
            }
            return withDirectives(h$1("td", {
              style,
              class: [ns.e("cell"), align],
              colSpan: span,
              rowspan
            }, [
              !isNil(label) ? h$1("span", {
                style: labelStyle,
                class: [ns.e("label"), labelClassName]
              }, label) : void 0,
              h$1("span", {
                class: [ns.e("content"), className]
              }, renderContent())
            ]), directives);
          }
        }
      }
    });
    const descriptionsRowProps = buildProps({
      row: {
        type: definePropType(Array),
        default: () => []
      }
    });
    const __default__$17 = /* @__PURE__ */ defineComponent({
      name: "ElDescriptionsRow"
    });
    const _sfc_main$1C = /* @__PURE__ */ defineComponent({
      ...__default__$17,
      props: descriptionsRowProps,
      setup(__props) {
        const descriptions = inject(descriptionsKey, {});
        return (_ctx, _cache) => {
          return unref(descriptions).direction === "vertical" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
            createBaseVNode("tr", null, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
                return openBlock(), createBlock(unref(ElDescriptionsCell), {
                  key: `tr1-${_index}`,
                  cell,
                  tag: "th",
                  type: "label"
                }, null, 8, ["cell"]);
              }), 128))
            ]),
            createBaseVNode("tr", null, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
                return openBlock(), createBlock(unref(ElDescriptionsCell), {
                  key: `tr2-${_index}`,
                  cell,
                  tag: "td",
                  type: "content"
                }, null, 8, ["cell"]);
              }), 128))
            ])
          ], 64)) : (openBlock(), createElementBlock("tr", { key: 1 }, [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.row, (cell, _index) => {
              return openBlock(), createElementBlock(Fragment, {
                key: `tr3-${_index}`
              }, [
                unref(descriptions).border ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                  createVNode$1(unref(ElDescriptionsCell), {
                    cell,
                    tag: "td",
                    type: "label"
                  }, null, 8, ["cell"]),
                  createVNode$1(unref(ElDescriptionsCell), {
                    cell,
                    tag: "td",
                    type: "content"
                  }, null, 8, ["cell"])
                ], 64)) : (openBlock(), createBlock(unref(ElDescriptionsCell), {
                  key: 1,
                  cell,
                  tag: "td",
                  type: "both"
                }, null, 8, ["cell"]))
              ], 64);
            }), 128))
          ]));
        };
      }
    });
    var ElDescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__file", "descriptions-row.vue"]]);
    const descriptionProps = buildProps({
      border: Boolean,
      column: {
        type: Number,
        default: 3
      },
      direction: {
        type: String,
        values: ["horizontal", "vertical"],
        default: "horizontal"
      },
      size: useSizeProp,
      title: {
        type: String,
        default: ""
      },
      extra: {
        type: String,
        default: ""
      },
      labelWidth: {
        type: [String, Number],
        default: ""
      }
    });
    const COMPONENT_NAME$f = "ElDescriptionsItem";
    const __default__$16 = /* @__PURE__ */ defineComponent({
      name: "ElDescriptions"
    });
    const _sfc_main$1B = /* @__PURE__ */ defineComponent({
      ...__default__$16,
      props: descriptionProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("descriptions");
        const descriptionsSize = useFormSize();
        const slots = useSlots();
        provide(descriptionsKey, props2);
        const descriptionKls = computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
        const filledNode = (node, span, count2, isLast = false) => {
          if (!node.props) {
            node.props = {};
          }
          if (span > count2) {
            node.props.span = count2;
          }
          if (isLast) {
            node.props.span = span;
          }
          return node;
        };
        const getRows = () => {
          if (!slots.default)
            return [];
          const children = flattedChildren(slots.default()).filter((node) => {
            var _a2;
            return ((_a2 = node == null ? void 0 : node.type) == null ? void 0 : _a2.name) === COMPONENT_NAME$f;
          });
          const rows = [];
          let temp = [];
          let count2 = props2.column;
          let totalSpan = 0;
          const rowspanTemp = [];
          children.forEach((node, index) => {
            var _a2, _b2, _c2;
            const span = ((_a2 = node.props) == null ? void 0 : _a2.span) || 1;
            const rowspan = ((_b2 = node.props) == null ? void 0 : _b2.rowspan) || 1;
            const rowNo = rows.length;
            rowspanTemp[rowNo] || (rowspanTemp[rowNo] = 0);
            if (rowspan > 1) {
              for (let i2 = 1; i2 < rowspan; i2++) {
                rowspanTemp[_c2 = rowNo + i2] || (rowspanTemp[_c2] = 0);
                rowspanTemp[rowNo + i2]++;
                totalSpan++;
              }
            }
            if (rowspanTemp[rowNo] > 0) {
              count2 -= rowspanTemp[rowNo];
              rowspanTemp[rowNo] = 0;
            }
            if (index < children.length - 1) {
              totalSpan += span > count2 ? count2 : span;
            }
            if (index === children.length - 1) {
              const lastSpan = props2.column - totalSpan % props2.column;
              temp.push(filledNode(node, lastSpan, count2, true));
              rows.push(temp);
              return;
            }
            if (span < count2) {
              count2 -= span;
              temp.push(node);
            } else {
              temp.push(filledNode(node, span, count2));
              rows.push(temp);
              count2 = props2.column;
              temp = [];
            }
          });
          return rows;
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(descriptionKls))
          }, [
            _ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("header"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("title"))
              }, [
                renderSlot(_ctx.$slots, "title", {}, () => [
                  createTextVNode(toDisplayString(_ctx.title), 1)
                ])
              ], 2),
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("extra"))
              }, [
                renderSlot(_ctx.$slots, "extra", {}, () => [
                  createTextVNode(toDisplayString(_ctx.extra), 1)
                ])
              ], 2)
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("body"))
            }, [
              createBaseVNode("table", {
                class: normalizeClass([unref(ns).e("table"), unref(ns).is("bordered", _ctx.border)])
              }, [
                createBaseVNode("tbody", null, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(getRows(), (row, _index) => {
                    return openBlock(), createBlock(ElDescriptionsRow, {
                      key: _index,
                      row
                    }, null, 8, ["row"]);
                  }), 128))
                ])
              ], 2)
            ], 2)
          ], 2);
        };
      }
    });
    var Descriptions = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["__file", "description.vue"]]);
    const descriptionItemProps = buildProps({
      label: {
        type: String,
        default: ""
      },
      span: {
        type: Number,
        default: 1
      },
      rowspan: {
        type: Number,
        default: 1
      },
      width: {
        type: [String, Number],
        default: ""
      },
      minWidth: {
        type: [String, Number],
        default: ""
      },
      labelWidth: {
        type: [String, Number],
        default: ""
      },
      align: {
        type: String,
        default: "left"
      },
      labelAlign: {
        type: String,
        default: ""
      },
      className: {
        type: String,
        default: ""
      },
      labelClassName: {
        type: String,
        default: ""
      }
    });
    const DescriptionItem = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$f,
      props: descriptionItemProps
    });
    const ElDescriptions = withInstall(Descriptions, {
      DescriptionsItem: DescriptionItem
    });
    const ElDescriptionsItem = withNoopInstall(DescriptionItem);
    const useSameTarget = (handleClick) => {
      if (!handleClick) {
        return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
      }
      let mousedownTarget = false;
      let mouseupTarget = false;
      const onClick = (e2) => {
        if (mousedownTarget && mouseupTarget) {
          handleClick(e2);
        }
        mousedownTarget = mouseupTarget = false;
      };
      const onMousedown = (e2) => {
        mousedownTarget = e2.target === e2.currentTarget;
      };
      const onMouseup = (e2) => {
        mouseupTarget = e2.target === e2.currentTarget;
      };
      return { onClick, onMousedown, onMouseup };
    };
    const overlayProps = buildProps({
      mask: {
        type: Boolean,
        default: true
      },
      customMaskEvent: Boolean,
      overlayClass: {
        type: definePropType([
          String,
          Array,
          Object
        ])
      },
      zIndex: {
        type: definePropType([String, Number])
      }
    });
    const overlayEmits = {
      click: (evt) => evt instanceof MouseEvent
    };
    const BLOCK = "overlay";
    var Overlay$2 = /* @__PURE__ */ defineComponent({
      name: "ElOverlay",
      props: overlayProps,
      emits: overlayEmits,
      setup(props2, { slots, emit: emit2 }) {
        const ns = useNamespace(BLOCK);
        const onMaskClick = (e2) => {
          emit2("click", e2);
        };
        const { onClick, onMousedown, onMouseup } = useSameTarget(props2.customMaskEvent ? void 0 : onMaskClick);
        return () => {
          return props2.mask ? createVNode$1("div", {
            class: [ns.b(), props2.overlayClass],
            style: {
              zIndex: props2.zIndex
            },
            onClick,
            onMousedown,
            onMouseup
          }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : h$1("div", {
            class: props2.overlayClass,
            style: {
              zIndex: props2.zIndex,
              position: "fixed",
              top: "0px",
              right: "0px",
              bottom: "0px",
              left: "0px"
            }
          }, [renderSlot(slots, "default")]);
        };
      }
    });
    const ElOverlay = Overlay$2;
    const dialogInjectionKey = Symbol("dialogInjectionKey");
    const dialogContentProps = buildProps({
      center: Boolean,
      alignCenter: Boolean,
      closeIcon: {
        type: iconPropType
      },
      draggable: Boolean,
      overflow: Boolean,
      fullscreen: Boolean,
      headerClass: String,
      bodyClass: String,
      footerClass: String,
      showClose: {
        type: Boolean,
        default: true
      },
      title: {
        type: String,
        default: ""
      },
      ariaLevel: {
        type: String,
        default: "2"
      }
    });
    const dialogContentEmits = {
      close: () => true
    };
    const useDraggable = (targetRef, dragRef, draggable2, overflow2) => {
      const transform2 = {
        offsetX: 0,
        offsetY: 0
      };
      const adjustPosition = (moveX, moveY) => {
        if (targetRef.value) {
          const { offsetX, offsetY } = transform2;
          const targetRect = targetRef.value.getBoundingClientRect();
          const targetLeft = targetRect.left;
          const targetTop = targetRect.top;
          const targetWidth = targetRect.width;
          const targetHeight = targetRect.height;
          const clientWidth = document.documentElement.clientWidth;
          const clientHeight = document.documentElement.clientHeight;
          const minLeft = -targetLeft + offsetX;
          const minTop = -targetTop + offsetY;
          const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
          const maxTop = clientHeight - targetTop - targetHeight + offsetY;
          if (!(overflow2 == null ? void 0 : overflow2.value)) {
            moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
            moveY = Math.min(Math.max(moveY, minTop), maxTop);
          }
          transform2.offsetX = moveX;
          transform2.offsetY = moveY;
          targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
        }
      };
      const onMousedown = (e2) => {
        const downX = e2.clientX;
        const downY = e2.clientY;
        const { offsetX, offsetY } = transform2;
        const onMousemove = (e22) => {
          const moveX = offsetX + e22.clientX - downX;
          const moveY = offsetY + e22.clientY - downY;
          adjustPosition(moveX, moveY);
        };
        const onMouseup = () => {
          document.removeEventListener("mousemove", onMousemove);
          document.removeEventListener("mouseup", onMouseup);
        };
        document.addEventListener("mousemove", onMousemove);
        document.addEventListener("mouseup", onMouseup);
      };
      const onDraggable = () => {
        if (dragRef.value && targetRef.value) {
          dragRef.value.addEventListener("mousedown", onMousedown);
          window.addEventListener("resize", updatePosition);
        }
      };
      const offDraggable = () => {
        if (dragRef.value && targetRef.value) {
          dragRef.value.removeEventListener("mousedown", onMousedown);
          window.removeEventListener("resize", updatePosition);
        }
      };
      const resetPosition = () => {
        transform2.offsetX = 0;
        transform2.offsetY = 0;
        if (targetRef.value) {
          targetRef.value.style.transform = "";
        }
      };
      const updatePosition = () => {
        const { offsetX, offsetY } = transform2;
        adjustPosition(offsetX, offsetY);
      };
      onMounted(() => {
        watchEffect(() => {
          if (draggable2.value) {
            onDraggable();
          } else {
            offDraggable();
          }
        });
      });
      onBeforeUnmount(() => {
        offDraggable();
      });
      return {
        resetPosition,
        updatePosition
      };
    };
    const composeRefs = (...refs) => {
      return (el) => {
        refs.forEach((ref2) => {
          if (isFunction$4(ref2)) {
            ref2(el);
          } else {
            ref2.value = el;
          }
        });
      };
    };
    const __default__$15 = /* @__PURE__ */ defineComponent({ name: "ElDialogContent" });
    const _sfc_main$1A = /* @__PURE__ */ defineComponent({
      ...__default__$15,
      props: dialogContentProps,
      emits: dialogContentEmits,
      setup(__props, { expose }) {
        const props2 = __props;
        const { t } = useLocale();
        const { Close } = CloseComponents;
        const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
        const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
        const dialogKls = computed(() => [
          ns.b(),
          ns.is("fullscreen", props2.fullscreen),
          ns.is("draggable", props2.draggable),
          ns.is("align-center", props2.alignCenter),
          { [ns.m("center")]: props2.center }
        ]);
        const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
        const draggable2 = computed(() => props2.draggable);
        const overflow2 = computed(() => props2.overflow);
        const { resetPosition, updatePosition } = useDraggable(dialogRef, headerRef, draggable2, overflow2);
        expose({
          resetPosition,
          updatePosition
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref: unref(composedDialogRef),
            class: normalizeClass(unref(dialogKls)),
            style: normalizeStyle$1(unref(style)),
            tabindex: "-1"
          }, [
            createBaseVNode("header", {
              ref_key: "headerRef",
              ref: headerRef,
              class: normalizeClass([unref(ns).e("header"), _ctx.headerClass, { "show-close": _ctx.showClose }])
            }, [
              renderSlot(_ctx.$slots, "header", {}, () => [
                createBaseVNode("span", {
                  role: "heading",
                  "aria-level": _ctx.ariaLevel,
                  class: normalizeClass(unref(ns).e("title"))
                }, toDisplayString(_ctx.title), 11, ["aria-level"])
              ]),
              _ctx.showClose ? (openBlock(), createElementBlock("button", {
                key: 0,
                "aria-label": unref(t)("el.dialog.close"),
                class: normalizeClass(unref(ns).e("headerbtn")),
                type: "button",
                onClick: ($event) => _ctx.$emit("close")
              }, [
                createVNode$1(unref(ElIcon), {
                  class: normalizeClass(unref(ns).e("close"))
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
                  ]),
                  _: 1
                }, 8, ["class"])
              ], 10, ["aria-label", "onClick"])) : createCommentVNode("v-if", true)
            ], 2),
            createBaseVNode("div", {
              id: unref(bodyId),
              class: normalizeClass([unref(ns).e("body"), _ctx.bodyClass])
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 10, ["id"]),
            _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
              key: 0,
              class: normalizeClass([unref(ns).e("footer"), _ctx.footerClass])
            }, [
              renderSlot(_ctx.$slots, "footer")
            ], 2)) : createCommentVNode("v-if", true)
          ], 6);
        };
      }
    });
    var ElDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["__file", "dialog-content.vue"]]);
    const dialogProps = buildProps({
      ...dialogContentProps,
      appendToBody: Boolean,
      appendTo: {
        type: teleportProps.to.type,
        default: "body"
      },
      beforeClose: {
        type: definePropType(Function)
      },
      destroyOnClose: Boolean,
      closeOnClickModal: {
        type: Boolean,
        default: true
      },
      closeOnPressEscape: {
        type: Boolean,
        default: true
      },
      lockScroll: {
        type: Boolean,
        default: true
      },
      modal: {
        type: Boolean,
        default: true
      },
      openDelay: {
        type: Number,
        default: 0
      },
      closeDelay: {
        type: Number,
        default: 0
      },
      top: {
        type: String
      },
      modelValue: Boolean,
      modalClass: String,
      headerClass: String,
      bodyClass: String,
      footerClass: String,
      width: {
        type: [String, Number]
      },
      zIndex: {
        type: Number
      },
      trapFocus: Boolean,
      headerAriaLevel: {
        type: String,
        default: "2"
      }
    });
    const dialogEmits = {
      open: () => true,
      opened: () => true,
      close: () => true,
      closed: () => true,
      [UPDATE_MODEL_EVENT]: (value) => isBoolean$1(value),
      openAutoFocus: () => true,
      closeAutoFocus: () => true
    };
    const useLockscreen = (trigger2, options = {}) => {
      if (!isRef(trigger2)) {
        throwError$1("[useLockscreen]", "You need to pass a ref param to this function");
      }
      const ns = options.ns || useNamespace("popup");
      const hiddenCls = computed(() => ns.bm("parent", "hidden"));
      if (!isClient || hasClass(document.body, hiddenCls.value)) {
        return;
      }
      let scrollBarWidth2 = 0;
      let withoutHiddenClass = false;
      let bodyWidth = "0";
      const cleanup = () => {
        setTimeout(() => {
          if (typeof document === "undefined")
            return;
          if (withoutHiddenClass && document) {
            document.body.style.width = bodyWidth;
            removeClass(document.body, hiddenCls.value);
          }
        }, 200);
      };
      watch(trigger2, (val) => {
        if (!val) {
          cleanup();
          return;
        }
        withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
        if (withoutHiddenClass) {
          bodyWidth = document.body.style.width;
          addClass(document.body, hiddenCls.value);
        }
        scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
        const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
        const bodyOverflowY = getStyle$1(document.body, "overflowY");
        if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
          document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
        }
      });
      onScopeDispose(() => cleanup());
    };
    const useDialog = (props2, targetRef) => {
      var _a2;
      const instance = getCurrentInstance();
      const emit2 = instance.emit;
      const { nextZIndex } = useZIndex();
      let lastPosition = "";
      const titleId = useId();
      const bodyId = useId();
      const visible = ref(false);
      const closed = ref(false);
      const rendered = ref(false);
      const zIndex2 = ref((_a2 = props2.zIndex) != null ? _a2 : nextZIndex());
      let openTimer = void 0;
      let closeTimer = void 0;
      const namespace = useGlobalConfig("namespace", defaultNamespace);
      const style = computed(() => {
        const style2 = {};
        const varPrefix = `--${namespace.value}-dialog`;
        if (!props2.fullscreen) {
          if (props2.top) {
            style2[`${varPrefix}-margin-top`] = props2.top;
          }
          if (props2.width) {
            style2[`${varPrefix}-width`] = addUnit(props2.width);
          }
        }
        return style2;
      });
      const overlayDialogStyle = computed(() => {
        if (props2.alignCenter) {
          return { display: "flex" };
        }
        return {};
      });
      function afterEnter() {
        emit2("opened");
      }
      function afterLeave() {
        emit2("closed");
        emit2(UPDATE_MODEL_EVENT, false);
        if (props2.destroyOnClose) {
          rendered.value = false;
        }
      }
      function beforeLeave() {
        emit2("close");
      }
      function open2() {
        closeTimer == null ? void 0 : closeTimer();
        openTimer == null ? void 0 : openTimer();
        if (props2.openDelay && props2.openDelay > 0) {
          ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props2.openDelay));
        } else {
          doOpen();
        }
      }
      function close2() {
        openTimer == null ? void 0 : openTimer();
        closeTimer == null ? void 0 : closeTimer();
        if (props2.closeDelay && props2.closeDelay > 0) {
          ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props2.closeDelay));
        } else {
          doClose();
        }
      }
      function handleClose() {
        function hide(shouldCancel) {
          if (shouldCancel)
            return;
          closed.value = true;
          visible.value = false;
        }
        if (props2.beforeClose) {
          props2.beforeClose(hide);
        } else {
          close2();
        }
      }
      function onModalClick() {
        if (props2.closeOnClickModal) {
          handleClose();
        }
      }
      function doOpen() {
        if (!isClient)
          return;
        visible.value = true;
      }
      function doClose() {
        visible.value = false;
      }
      function onOpenAutoFocus() {
        emit2("openAutoFocus");
      }
      function onCloseAutoFocus() {
        emit2("closeAutoFocus");
      }
      function onFocusoutPrevented(event) {
        var _a22;
        if (((_a22 = event.detail) == null ? void 0 : _a22.focusReason) === "pointer") {
          event.preventDefault();
        }
      }
      if (props2.lockScroll) {
        useLockscreen(visible);
      }
      function onCloseRequested() {
        if (props2.closeOnPressEscape) {
          handleClose();
        }
      }
      watch(() => props2.modelValue, (val) => {
        if (val) {
          closed.value = false;
          open2();
          rendered.value = true;
          zIndex2.value = isUndefined$2(props2.zIndex) ? nextZIndex() : zIndex2.value++;
          nextTick(() => {
            emit2("open");
            if (targetRef.value) {
              targetRef.value.parentElement.scrollTop = 0;
              targetRef.value.parentElement.scrollLeft = 0;
              targetRef.value.scrollTop = 0;
            }
          });
        } else {
          if (visible.value) {
            close2();
          }
        }
      });
      watch(() => props2.fullscreen, (val) => {
        if (!targetRef.value)
          return;
        if (val) {
          lastPosition = targetRef.value.style.transform;
          targetRef.value.style.transform = "";
        } else {
          targetRef.value.style.transform = lastPosition;
        }
      });
      onMounted(() => {
        if (props2.modelValue) {
          visible.value = true;
          rendered.value = true;
          open2();
        }
      });
      return {
        afterEnter,
        afterLeave,
        beforeLeave,
        handleClose,
        onModalClick,
        close: close2,
        doClose,
        onOpenAutoFocus,
        onCloseAutoFocus,
        onCloseRequested,
        onFocusoutPrevented,
        titleId,
        bodyId,
        closed,
        style,
        overlayDialogStyle,
        rendered,
        visible,
        zIndex: zIndex2
      };
    };
    const __default__$14 = /* @__PURE__ */ defineComponent({
      name: "ElDialog",
      inheritAttrs: false
    });
    const _sfc_main$1z = /* @__PURE__ */ defineComponent({
      ...__default__$14,
      props: dialogProps,
      emits: dialogEmits,
      setup(__props, { expose }) {
        const props2 = __props;
        const slots = useSlots();
        useDeprecated({
          scope: "el-dialog",
          from: "the title slot",
          replacement: "the header slot",
          version: "3.0.0",
          ref: "https://element-plus.org/en-US/component/dialog.html#slots"
        }, computed(() => !!slots.title));
        const ns = useNamespace("dialog");
        const dialogRef = ref();
        const headerRef = ref();
        const dialogContentRef = ref();
        const {
          visible,
          titleId,
          bodyId,
          style,
          overlayDialogStyle,
          rendered,
          zIndex: zIndex2,
          afterEnter,
          afterLeave,
          beforeLeave,
          handleClose,
          onModalClick,
          onOpenAutoFocus,
          onCloseAutoFocus,
          onCloseRequested,
          onFocusoutPrevented
        } = useDialog(props2, dialogRef);
        provide(dialogInjectionKey, {
          dialogRef,
          headerRef,
          bodyId,
          ns,
          rendered,
          style
        });
        const overlayEvent = useSameTarget(onModalClick);
        const draggable2 = computed(() => props2.draggable && !props2.fullscreen);
        const resetPosition = () => {
          var _a2;
          (_a2 = dialogContentRef.value) == null ? void 0 : _a2.resetPosition();
        };
        expose({
          visible,
          dialogContentRef,
          resetPosition,
          handleClose
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTeleport), {
            to: _ctx.appendTo,
            disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
          }, {
            default: withCtx(() => [
              createVNode$1(Transition, {
                name: "dialog-fade",
                onAfterEnter: unref(afterEnter),
                onAfterLeave: unref(afterLeave),
                onBeforeLeave: unref(beforeLeave),
                persisted: ""
              }, {
                default: withCtx(() => [
                  withDirectives(createVNode$1(unref(ElOverlay), {
                    "custom-mask-event": "",
                    mask: _ctx.modal,
                    "overlay-class": _ctx.modalClass,
                    "z-index": unref(zIndex2)
                  }, {
                    default: withCtx(() => [
                      createBaseVNode("div", {
                        role: "dialog",
                        "aria-modal": "true",
                        "aria-label": _ctx.title || void 0,
                        "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
                        "aria-describedby": unref(bodyId),
                        class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
                        style: normalizeStyle$1(unref(overlayDialogStyle)),
                        onClick: unref(overlayEvent).onClick,
                        onMousedown: unref(overlayEvent).onMousedown,
                        onMouseup: unref(overlayEvent).onMouseup
                      }, [
                        createVNode$1(unref(ElFocusTrap), {
                          loop: "",
                          trapped: unref(visible),
                          "focus-start-el": "container",
                          onFocusAfterTrapped: unref(onOpenAutoFocus),
                          onFocusAfterReleased: unref(onCloseAutoFocus),
                          onFocusoutPrevented: unref(onFocusoutPrevented),
                          onReleaseRequested: unref(onCloseRequested)
                        }, {
                          default: withCtx(() => [
                            unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
                              key: 0,
                              ref_key: "dialogContentRef",
                              ref: dialogContentRef
                            }, _ctx.$attrs, {
                              center: _ctx.center,
                              "align-center": _ctx.alignCenter,
                              "close-icon": _ctx.closeIcon,
                              draggable: unref(draggable2),
                              overflow: _ctx.overflow,
                              fullscreen: _ctx.fullscreen,
                              "header-class": _ctx.headerClass,
                              "body-class": _ctx.bodyClass,
                              "footer-class": _ctx.footerClass,
                              "show-close": _ctx.showClose,
                              title: _ctx.title,
                              "aria-level": _ctx.headerAriaLevel,
                              onClose: unref(handleClose)
                            }), createSlots({
                              header: withCtx(() => [
                                !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
                                  key: 0,
                                  close: unref(handleClose),
                                  titleId: unref(titleId),
                                  titleClass: unref(ns).e("title")
                                }) : renderSlot(_ctx.$slots, "title", { key: 1 })
                              ]),
                              default: withCtx(() => [
                                renderSlot(_ctx.$slots, "default")
                              ]),
                              _: 2
                            }, [
                              _ctx.$slots.footer ? {
                                name: "footer",
                                fn: withCtx(() => [
                                  renderSlot(_ctx.$slots, "footer")
                                ])
                              } : void 0
                            ]), 1040, ["center", "align-center", "close-icon", "draggable", "overflow", "fullscreen", "header-class", "body-class", "footer-class", "show-close", "title", "aria-level", "onClose"])) : createCommentVNode("v-if", true)
                          ]),
                          _: 3
                        }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
                      ], 46, ["aria-label", "aria-labelledby", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
                    ]),
                    _: 3
                  }, 8, ["mask", "overlay-class", "z-index"]), [
                    [vShow, unref(visible)]
                  ])
                ]),
                _: 3
              }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
            ]),
            _: 3
          }, 8, ["to", "disabled"]);
        };
      }
    });
    var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["__file", "dialog.vue"]]);
    const ElDialog = withInstall(Dialog);
    const dividerProps = buildProps({
      direction: {
        type: String,
        values: ["horizontal", "vertical"],
        default: "horizontal"
      },
      contentPosition: {
        type: String,
        values: ["left", "center", "right"],
        default: "center"
      },
      borderStyle: {
        type: definePropType(String),
        default: "solid"
      }
    });
    const __default__$13 = /* @__PURE__ */ defineComponent({
      name: "ElDivider"
    });
    const _sfc_main$1y = /* @__PURE__ */ defineComponent({
      ...__default__$13,
      props: dividerProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("divider");
        const dividerStyle = computed(() => {
          return ns.cssVar({
            "border-style": props2.borderStyle
          });
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.direction)]),
            style: normalizeStyle$1(unref(dividerStyle)),
            role: "separator"
          }, [
            _ctx.$slots.default && _ctx.direction !== "vertical" ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass([unref(ns).e("text"), unref(ns).is(_ctx.contentPosition)])
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)) : createCommentVNode("v-if", true)
          ], 6);
        };
      }
    });
    var Divider = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["__file", "divider.vue"]]);
    const ElDivider = withInstall(Divider);
    const drawerProps = buildProps({
      ...dialogProps,
      direction: {
        type: String,
        default: "rtl",
        values: ["ltr", "rtl", "ttb", "btt"]
      },
      size: {
        type: [String, Number],
        default: "30%"
      },
      withHeader: {
        type: Boolean,
        default: true
      },
      modalFade: {
        type: Boolean,
        default: true
      },
      headerAriaLevel: {
        type: String,
        default: "2"
      }
    });
    const drawerEmits = dialogEmits;
    const __default__$12 = /* @__PURE__ */ defineComponent({
      name: "ElDrawer",
      inheritAttrs: false
    });
    const _sfc_main$1x = /* @__PURE__ */ defineComponent({
      ...__default__$12,
      props: drawerProps,
      emits: drawerEmits,
      setup(__props, { expose }) {
        const props2 = __props;
        const slots = useSlots();
        useDeprecated({
          scope: "el-drawer",
          from: "the title slot",
          replacement: "the header slot",
          version: "3.0.0",
          ref: "https://element-plus.org/en-US/component/drawer.html#slots"
        }, computed(() => !!slots.title));
        const drawerRef = ref();
        const focusStartRef = ref();
        const ns = useNamespace("drawer");
        const { t } = useLocale();
        const {
          afterEnter,
          afterLeave,
          beforeLeave,
          visible,
          rendered,
          titleId,
          bodyId,
          zIndex: zIndex2,
          onModalClick,
          onOpenAutoFocus,
          onCloseAutoFocus,
          onFocusoutPrevented,
          onCloseRequested,
          handleClose
        } = useDialog(props2, drawerRef);
        const isHorizontal2 = computed(() => props2.direction === "rtl" || props2.direction === "ltr");
        const drawerSize = computed(() => addUnit(props2.size));
        expose({
          handleClose,
          afterEnter,
          afterLeave
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTeleport), {
            to: _ctx.appendTo,
            disabled: _ctx.appendTo !== "body" ? false : !_ctx.appendToBody
          }, {
            default: withCtx(() => [
              createVNode$1(Transition, {
                name: unref(ns).b("fade"),
                onAfterEnter: unref(afterEnter),
                onAfterLeave: unref(afterLeave),
                onBeforeLeave: unref(beforeLeave),
                persisted: ""
              }, {
                default: withCtx(() => [
                  withDirectives(createVNode$1(unref(ElOverlay), {
                    mask: _ctx.modal,
                    "overlay-class": _ctx.modalClass,
                    "z-index": unref(zIndex2),
                    onClick: unref(onModalClick)
                  }, {
                    default: withCtx(() => [
                      createVNode$1(unref(ElFocusTrap), {
                        loop: "",
                        trapped: unref(visible),
                        "focus-trap-el": drawerRef.value,
                        "focus-start-el": focusStartRef.value,
                        onFocusAfterTrapped: unref(onOpenAutoFocus),
                        onFocusAfterReleased: unref(onCloseAutoFocus),
                        onFocusoutPrevented: unref(onFocusoutPrevented),
                        onReleaseRequested: unref(onCloseRequested)
                      }, {
                        default: withCtx(() => [
                          createBaseVNode("div", mergeProps({
                            ref_key: "drawerRef",
                            ref: drawerRef,
                            "aria-modal": "true",
                            "aria-label": _ctx.title || void 0,
                            "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
                            "aria-describedby": unref(bodyId)
                          }, _ctx.$attrs, {
                            class: [unref(ns).b(), _ctx.direction, unref(visible) && "open"],
                            style: unref(isHorizontal2) ? "width: " + unref(drawerSize) : "height: " + unref(drawerSize),
                            role: "dialog",
                            onClick: withModifiers(() => {
                            }, ["stop"])
                          }), [
                            createBaseVNode("span", {
                              ref_key: "focusStartRef",
                              ref: focusStartRef,
                              class: normalizeClass(unref(ns).e("sr-focus")),
                              tabindex: "-1"
                            }, null, 2),
                            _ctx.withHeader ? (openBlock(), createElementBlock("header", {
                              key: 0,
                              class: normalizeClass([unref(ns).e("header"), _ctx.headerClass])
                            }, [
                              !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
                                key: 0,
                                close: unref(handleClose),
                                titleId: unref(titleId),
                                titleClass: unref(ns).e("title")
                              }, () => [
                                !_ctx.$slots.title ? (openBlock(), createElementBlock("span", {
                                  key: 0,
                                  id: unref(titleId),
                                  role: "heading",
                                  "aria-level": _ctx.headerAriaLevel,
                                  class: normalizeClass(unref(ns).e("title"))
                                }, toDisplayString(_ctx.title), 11, ["id", "aria-level"])) : createCommentVNode("v-if", true)
                              ]) : renderSlot(_ctx.$slots, "title", { key: 1 }, () => [
                                createCommentVNode(" DEPRECATED SLOT ")
                              ]),
                              _ctx.showClose ? (openBlock(), createElementBlock("button", {
                                key: 2,
                                "aria-label": unref(t)("el.drawer.close"),
                                class: normalizeClass(unref(ns).e("close-btn")),
                                type: "button",
                                onClick: unref(handleClose)
                              }, [
                                createVNode$1(unref(ElIcon), {
                                  class: normalizeClass(unref(ns).e("close"))
                                }, {
                                  default: withCtx(() => [
                                    createVNode$1(unref(close_default))
                                  ]),
                                  _: 1
                                }, 8, ["class"])
                              ], 10, ["aria-label", "onClick"])) : createCommentVNode("v-if", true)
                            ], 2)) : createCommentVNode("v-if", true),
                            unref(rendered) ? (openBlock(), createElementBlock("div", {
                              key: 1,
                              id: unref(bodyId),
                              class: normalizeClass([unref(ns).e("body"), _ctx.bodyClass])
                            }, [
                              renderSlot(_ctx.$slots, "default")
                            ], 10, ["id"])) : createCommentVNode("v-if", true),
                            _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
                              key: 2,
                              class: normalizeClass([unref(ns).e("footer"), _ctx.footerClass])
                            }, [
                              renderSlot(_ctx.$slots, "footer")
                            ], 2)) : createCommentVNode("v-if", true)
                          ], 16, ["aria-label", "aria-labelledby", "aria-describedby", "onClick"])
                        ]),
                        _: 3
                      }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
                    ]),
                    _: 3
                  }, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
                    [vShow, unref(visible)]
                  ])
                ]),
                _: 3
              }, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
            ]),
            _: 3
          }, 8, ["to", "disabled"]);
        };
      }
    });
    var Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["__file", "drawer.vue"]]);
    const ElDrawer = withInstall(Drawer);
    const _sfc_main$1w = /* @__PURE__ */ defineComponent({
      inheritAttrs: false
    });
    function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
      return renderSlot(_ctx.$slots, "default");
    }
    var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$q], ["__file", "collection.vue"]]);
    const _sfc_main$1v = /* @__PURE__ */ defineComponent({
      name: "ElCollectionItem",
      inheritAttrs: false
    });
    function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
      return renderSlot(_ctx.$slots, "default");
    }
    var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$p], ["__file", "collection-item.vue"]]);
    const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
    const createCollectionWithScope = (name) => {
      const COLLECTION_NAME = `El${name}Collection`;
      const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
      const COLLECTION_INJECTION_KEY2 = Symbol(COLLECTION_NAME);
      const COLLECTION_ITEM_INJECTION_KEY2 = Symbol(COLLECTION_ITEM_NAME);
      const ElCollection2 = {
        ...Collection,
        name: COLLECTION_NAME,
        setup() {
          const collectionRef = ref();
          const itemMap = /* @__PURE__ */ new Map();
          const getItems = () => {
            const collectionEl = unref(collectionRef);
            if (!collectionEl)
              return [];
            const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
            const items = [...itemMap.values()];
            return items.sort((a2, b2) => orderedNodes.indexOf(a2.ref) - orderedNodes.indexOf(b2.ref));
          };
          provide(COLLECTION_INJECTION_KEY2, {
            itemMap,
            getItems,
            collectionRef
          });
        }
      };
      const ElCollectionItem2 = {
        ...CollectionItem,
        name: COLLECTION_ITEM_NAME,
        setup(_2, { attrs }) {
          const collectionItemRef = ref();
          const collectionInjection = inject(COLLECTION_INJECTION_KEY2, void 0);
          provide(COLLECTION_ITEM_INJECTION_KEY2, {
            collectionItemRef
          });
          onMounted(() => {
            const collectionItemEl = unref(collectionItemRef);
            if (collectionItemEl) {
              collectionInjection.itemMap.set(collectionItemEl, {
                ref: collectionItemEl,
                ...attrs
              });
            }
          });
          onBeforeUnmount(() => {
            const collectionItemEl = unref(collectionItemRef);
            collectionInjection.itemMap.delete(collectionItemEl);
          });
        }
      };
      return {
        COLLECTION_INJECTION_KEY: COLLECTION_INJECTION_KEY2,
        COLLECTION_ITEM_INJECTION_KEY: COLLECTION_ITEM_INJECTION_KEY2,
        ElCollection: ElCollection2,
        ElCollectionItem: ElCollectionItem2
      };
    };
    const rovingFocusGroupProps = buildProps({
      style: { type: definePropType([String, Array, Object]) },
      currentTabId: {
        type: definePropType(String)
      },
      defaultCurrentTabId: String,
      loop: Boolean,
      dir: {
        type: String,
        values: ["ltr", "rtl"],
        default: "ltr"
      },
      orientation: {
        type: definePropType(String)
      },
      onBlur: Function,
      onFocus: Function,
      onMousedown: Function
    });
    const {
      ElCollection: ElCollection$1,
      ElCollectionItem: ElCollectionItem$1,
      COLLECTION_INJECTION_KEY: COLLECTION_INJECTION_KEY$1,
      COLLECTION_ITEM_INJECTION_KEY: COLLECTION_ITEM_INJECTION_KEY$1
    } = createCollectionWithScope("RovingFocusGroup");
    const ROVING_FOCUS_GROUP_INJECTION_KEY = Symbol("elRovingFocusGroup");
    const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = Symbol("elRovingFocusGroupItem");
    const MAP_KEY_TO_FOCUS_INTENT = {
      ArrowLeft: "prev",
      ArrowUp: "prev",
      ArrowRight: "next",
      ArrowDown: "next",
      PageUp: "first",
      Home: "first",
      PageDown: "last",
      End: "last"
    };
    const getDirectionAwareKey = (key, dir3) => {
      return key;
    };
    const getFocusIntent = (event, orientation, dir3) => {
      const key = getDirectionAwareKey(event.code);
      return MAP_KEY_TO_FOCUS_INTENT[key];
    };
    const reorderArray = (array, atIdx) => {
      return array.map((_2, idx) => array[(idx + atIdx) % array.length]);
    };
    const focusFirst = (elements) => {
      const { activeElement: prevActive } = document;
      for (const element of elements) {
        if (element === prevActive)
          return;
        element.focus();
        if (prevActive !== document.activeElement)
          return;
      }
    };
    const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
    const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
    const EVT_OPTS = { bubbles: false, cancelable: true };
    const _sfc_main$1u = /* @__PURE__ */ defineComponent({
      name: "ElRovingFocusGroupImpl",
      inheritAttrs: false,
      props: rovingFocusGroupProps,
      emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"],
      setup(props2, { emit: emit2 }) {
        var _a2;
        const currentTabbedId = ref((_a2 = props2.currentTabId || props2.defaultCurrentTabId) != null ? _a2 : null);
        const isBackingOut = ref(false);
        const isClickFocus = ref(false);
        const rovingFocusGroupRef = ref();
        const { getItems } = inject(COLLECTION_INJECTION_KEY$1, void 0);
        const rovingFocusGroupRootStyle = computed(() => {
          return [
            {
              outline: "none"
            },
            props2.style
          ];
        });
        const onItemFocus = (tabbedId) => {
          emit2(CURRENT_TAB_ID_CHANGE_EVT, tabbedId);
        };
        const onItemShiftTab = () => {
          isBackingOut.value = true;
        };
        const onMousedown = composeEventHandlers((e2) => {
          var _a22;
          (_a22 = props2.onMousedown) == null ? void 0 : _a22.call(props2, e2);
        }, () => {
          isClickFocus.value = true;
        });
        const onFocus = composeEventHandlers((e2) => {
          var _a22;
          (_a22 = props2.onFocus) == null ? void 0 : _a22.call(props2, e2);
        }, (e2) => {
          const isKeyboardFocus = !unref(isClickFocus);
          const { target, currentTarget } = e2;
          if (target === currentTarget && isKeyboardFocus && !unref(isBackingOut)) {
            const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS);
            currentTarget == null ? void 0 : currentTarget.dispatchEvent(entryFocusEvt);
            if (!entryFocusEvt.defaultPrevented) {
              const items = getItems().filter((item) => item.focusable);
              const activeItem = items.find((item) => item.active);
              const currentItem = items.find((item) => item.id === unref(currentTabbedId));
              const candidates = [activeItem, currentItem, ...items].filter(Boolean);
              const candidateNodes = candidates.map((item) => item.ref);
              focusFirst(candidateNodes);
            }
          }
          isClickFocus.value = false;
        });
        const onBlur = composeEventHandlers((e2) => {
          var _a22;
          (_a22 = props2.onBlur) == null ? void 0 : _a22.call(props2, e2);
        }, () => {
          isBackingOut.value = false;
        });
        const handleEntryFocus = (...args) => {
          emit2("entryFocus", ...args);
        };
        provide(ROVING_FOCUS_GROUP_INJECTION_KEY, {
          currentTabbedId: readonly(currentTabbedId),
          loop: toRef(props2, "loop"),
          tabIndex: computed(() => {
            return unref(isBackingOut) ? -1 : 0;
          }),
          rovingFocusGroupRef,
          rovingFocusGroupRootStyle,
          orientation: toRef(props2, "orientation"),
          dir: toRef(props2, "dir"),
          onItemFocus,
          onItemShiftTab,
          onBlur,
          onFocus,
          onMousedown
        });
        watch(() => props2.currentTabId, (val) => {
          currentTabbedId.value = val != null ? val : null;
        });
        useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
      }
    });
    function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
      return renderSlot(_ctx.$slots, "default");
    }
    var ElRovingFocusGroupImpl = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$o], ["__file", "roving-focus-group-impl.vue"]]);
    const _sfc_main$1t = /* @__PURE__ */ defineComponent({
      name: "ElRovingFocusGroup",
      components: {
        ElFocusGroupCollection: ElCollection$1,
        ElRovingFocusGroupImpl
      }
    });
    function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_roving_focus_group_impl = resolveComponent("el-roving-focus-group-impl");
      const _component_el_focus_group_collection = resolveComponent("el-focus-group-collection");
      return openBlock(), createBlock(_component_el_focus_group_collection, null, {
        default: withCtx(() => [
          createVNode$1(_component_el_roving_focus_group_impl, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 16)
        ]),
        _: 3
      });
    }
    var ElRovingFocusGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$n], ["__file", "roving-focus-group.vue"]]);
    const dropdownProps = buildProps({
      trigger: useTooltipTriggerProps.trigger,
      triggerKeys: {
        type: definePropType(Array),
        default: () => [
          EVENT_CODE.enter,
          EVENT_CODE.numpadEnter,
          EVENT_CODE.space,
          EVENT_CODE.down
        ]
      },
      effect: {
        ...useTooltipContentProps.effect,
        default: "light"
      },
      type: {
        type: definePropType(String)
      },
      placement: {
        type: definePropType(String),
        default: "bottom"
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      },
      id: String,
      size: {
        type: String,
        default: ""
      },
      splitButton: Boolean,
      hideOnClick: {
        type: Boolean,
        default: true
      },
      loop: {
        type: Boolean,
        default: true
      },
      showTimeout: {
        type: Number,
        default: 150
      },
      hideTimeout: {
        type: Number,
        default: 150
      },
      tabindex: {
        type: definePropType([Number, String]),
        default: 0
      },
      maxHeight: {
        type: definePropType([Number, String]),
        default: ""
      },
      popperClass: {
        type: String,
        default: ""
      },
      disabled: Boolean,
      role: {
        type: String,
        values: roleTypes,
        default: "menu"
      },
      buttonProps: {
        type: definePropType(Object)
      },
      teleported: useTooltipContentProps.teleported,
      persistent: {
        type: Boolean,
        default: true
      }
    });
    const dropdownItemProps = buildProps({
      command: {
        type: [Object, String, Number],
        default: () => ({})
      },
      disabled: Boolean,
      divided: Boolean,
      textValue: String,
      icon: {
        type: iconPropType
      }
    });
    const dropdownMenuProps = buildProps({
      onKeydown: { type: definePropType(Function) }
    });
    const FIRST_KEYS = [
      EVENT_CODE.down,
      EVENT_CODE.pageDown,
      EVENT_CODE.home
    ];
    const LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
    const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
    const {
      ElCollection,
      ElCollectionItem,
      COLLECTION_INJECTION_KEY,
      COLLECTION_ITEM_INJECTION_KEY
    } = createCollectionWithScope("Dropdown");
    const DROPDOWN_INJECTION_KEY = Symbol("elDropdown");
    const { ButtonGroup: ElButtonGroup } = ElButton;
    const _sfc_main$1s = /* @__PURE__ */ defineComponent({
      name: "ElDropdown",
      components: {
        ElButton,
        ElButtonGroup,
        ElScrollbar,
        ElDropdownCollection: ElCollection,
        ElTooltip,
        ElRovingFocusGroup,
        ElOnlyChild: OnlyChild,
        ElIcon,
        ArrowDown: arrow_down_default
      },
      props: dropdownProps,
      emits: ["visible-change", "click", "command"],
      setup(props2, { emit: emit2 }) {
        const _instance = getCurrentInstance();
        const ns = useNamespace("dropdown");
        const { t } = useLocale();
        const triggeringElementRef = ref();
        const referenceElementRef = ref();
        const popperRef = ref();
        const contentRef = ref();
        const scrollbar = ref(null);
        const currentTabId = ref(null);
        const isUsingKeyboard = ref(false);
        const wrapStyle = computed(() => ({
          maxHeight: addUnit(props2.maxHeight)
        }));
        const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)]);
        const trigger2 = computed(() => castArray$1(props2.trigger));
        const defaultTriggerId = useId().value;
        const triggerId = computed(() => props2.id || defaultTriggerId);
        watch([triggeringElementRef, trigger2], ([triggeringElement, trigger22], [prevTriggeringElement]) => {
          var _a2, _b2, _c2;
          if ((_a2 = prevTriggeringElement == null ? void 0 : prevTriggeringElement.$el) == null ? void 0 : _a2.removeEventListener) {
            prevTriggeringElement.$el.removeEventListener("pointerenter", onAutofocusTriggerEnter);
          }
          if ((_b2 = triggeringElement == null ? void 0 : triggeringElement.$el) == null ? void 0 : _b2.removeEventListener) {
            triggeringElement.$el.removeEventListener("pointerenter", onAutofocusTriggerEnter);
          }
          if (((_c2 = triggeringElement == null ? void 0 : triggeringElement.$el) == null ? void 0 : _c2.addEventListener) && trigger22.includes("hover")) {
            triggeringElement.$el.addEventListener("pointerenter", onAutofocusTriggerEnter);
          }
        }, { immediate: true });
        onBeforeUnmount(() => {
          var _a2, _b2;
          if ((_b2 = (_a2 = triggeringElementRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b2.removeEventListener) {
            triggeringElementRef.value.$el.removeEventListener("pointerenter", onAutofocusTriggerEnter);
          }
        });
        function handleClick() {
          handleClose();
        }
        function handleClose() {
          var _a2;
          (_a2 = popperRef.value) == null ? void 0 : _a2.onClose();
        }
        function handleOpen() {
          var _a2;
          (_a2 = popperRef.value) == null ? void 0 : _a2.onOpen();
        }
        const dropdownSize = useFormSize();
        function commandHandler(...args) {
          emit2("command", ...args);
        }
        function onAutofocusTriggerEnter() {
          var _a2, _b2;
          (_b2 = (_a2 = triggeringElementRef.value) == null ? void 0 : _a2.$el) == null ? void 0 : _b2.focus();
        }
        function onItemEnter() {
        }
        function onItemLeave() {
          const contentEl = unref(contentRef);
          trigger2.value.includes("hover") && (contentEl == null ? void 0 : contentEl.focus());
          currentTabId.value = null;
        }
        function handleCurrentTabIdChange(id) {
          currentTabId.value = id;
        }
        function handleEntryFocus(e2) {
          if (!isUsingKeyboard.value) {
            e2.preventDefault();
            e2.stopImmediatePropagation();
          }
        }
        function handleBeforeShowTooltip() {
          emit2("visible-change", true);
        }
        function handleShowTooltip(event) {
          var _a2;
          if ((event == null ? void 0 : event.type) === "keydown") {
            (_a2 = contentRef.value) == null ? void 0 : _a2.focus();
          }
        }
        function handleBeforeHideTooltip() {
          emit2("visible-change", false);
        }
        provide(DROPDOWN_INJECTION_KEY, {
          contentRef,
          role: computed(() => props2.role),
          triggerId,
          isUsingKeyboard,
          onItemEnter,
          onItemLeave
        });
        provide("elDropdown", {
          instance: _instance,
          dropdownSize,
          handleClick,
          commandHandler,
          trigger: toRef(props2, "trigger"),
          hideOnClick: toRef(props2, "hideOnClick")
        });
        const onFocusAfterTrapped = (e2) => {
          var _a2, _b2;
          e2.preventDefault();
          (_b2 = (_a2 = contentRef.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2, {
            preventScroll: true
          });
        };
        const handlerMainButtonClick = (event) => {
          emit2("click", event);
        };
        return {
          t,
          ns,
          scrollbar,
          wrapStyle,
          dropdownTriggerKls,
          dropdownSize,
          triggerId,
          currentTabId,
          handleCurrentTabIdChange,
          handlerMainButtonClick,
          handleEntryFocus,
          handleClose,
          handleOpen,
          handleBeforeShowTooltip,
          handleShowTooltip,
          handleBeforeHideTooltip,
          onFocusAfterTrapped,
          popperRef,
          contentRef,
          triggeringElementRef,
          referenceElementRef
        };
      }
    });
    function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
      var _a2;
      const _component_el_dropdown_collection = resolveComponent("el-dropdown-collection");
      const _component_el_roving_focus_group = resolveComponent("el-roving-focus-group");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_el_only_child = resolveComponent("el-only-child");
      const _component_el_tooltip = resolveComponent("el-tooltip");
      const _component_el_button = resolveComponent("el-button");
      const _component_arrow_down = resolveComponent("arrow-down");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_button_group = resolveComponent("el-button-group");
      return openBlock(), createElementBlock("div", {
        class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)])
      }, [
        createVNode$1(_component_el_tooltip, {
          ref: "popperRef",
          role: _ctx.role,
          effect: _ctx.effect,
          "fallback-placements": ["bottom", "top"],
          "popper-options": _ctx.popperOptions,
          "gpu-acceleration": false,
          "hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0,
          "manual-mode": true,
          placement: _ctx.placement,
          "popper-class": [_ctx.ns.e("popper"), _ctx.popperClass],
          "reference-element": (_a2 = _ctx.referenceElementRef) == null ? void 0 : _a2.$el,
          trigger: _ctx.trigger,
          "trigger-keys": _ctx.triggerKeys,
          "trigger-target-el": _ctx.contentRef,
          "show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0,
          "stop-popper-mouse-event": false,
          "virtual-ref": _ctx.triggeringElementRef,
          "virtual-triggering": _ctx.splitButton,
          disabled: _ctx.disabled,
          transition: `${_ctx.ns.namespace.value}-zoom-in-top`,
          teleported: _ctx.teleported,
          pure: "",
          persistent: _ctx.persistent,
          onBeforeShow: _ctx.handleBeforeShowTooltip,
          onShow: _ctx.handleShowTooltip,
          onBeforeHide: _ctx.handleBeforeHideTooltip
        }, createSlots({
          content: withCtx(() => [
            createVNode$1(_component_el_scrollbar, {
              ref: "scrollbar",
              "wrap-style": _ctx.wrapStyle,
              tag: "div",
              "view-class": _ctx.ns.e("list")
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_roving_focus_group, {
                  loop: _ctx.loop,
                  "current-tab-id": _ctx.currentTabId,
                  orientation: "horizontal",
                  onCurrentTabIdChange: _ctx.handleCurrentTabIdChange,
                  onEntryFocus: _ctx.handleEntryFocus
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_dropdown_collection, null, {
                      default: withCtx(() => [
                        renderSlot(_ctx.$slots, "dropdown")
                      ]),
                      _: 3
                    })
                  ]),
                  _: 3
                }, 8, ["loop", "current-tab-id", "onCurrentTabIdChange", "onEntryFocus"])
              ]),
              _: 3
            }, 8, ["wrap-style", "view-class"])
          ]),
          _: 2
        }, [
          !_ctx.splitButton ? {
            name: "default",
            fn: withCtx(() => [
              createVNode$1(_component_el_only_child, {
                id: _ctx.triggerId,
                ref: "triggeringElementRef",
                role: "button",
                tabindex: _ctx.tabindex
              }, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "default")
                ]),
                _: 3
              }, 8, ["id", "tabindex"])
            ])
          } : void 0
        ]), 1032, ["role", "effect", "popper-options", "hide-after", "placement", "popper-class", "reference-element", "trigger", "trigger-keys", "trigger-target-el", "show-after", "virtual-ref", "virtual-triggering", "disabled", "transition", "teleported", "persistent", "onBeforeShow", "onShow", "onBeforeHide"]),
        _ctx.splitButton ? (openBlock(), createBlock(_component_el_button_group, { key: 0 }, {
          default: withCtx(() => [
            createVNode$1(_component_el_button, mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, {
              size: _ctx.dropdownSize,
              type: _ctx.type,
              disabled: _ctx.disabled,
              tabindex: _ctx.tabindex,
              onClick: _ctx.handlerMainButtonClick
            }), {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "default")
              ]),
              _: 3
            }, 16, ["size", "type", "disabled", "tabindex", "onClick"]),
            createVNode$1(_component_el_button, mergeProps({
              id: _ctx.triggerId,
              ref: "triggeringElementRef"
            }, _ctx.buttonProps, {
              role: "button",
              size: _ctx.dropdownSize,
              type: _ctx.type,
              class: _ctx.ns.e("caret-button"),
              disabled: _ctx.disabled,
              tabindex: _ctx.tabindex,
              "aria-label": _ctx.t("el.dropdown.toggleDropdown")
            }), {
              default: withCtx(() => [
                createVNode$1(_component_el_icon, {
                  class: normalizeClass(_ctx.ns.e("icon"))
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_arrow_down)
                  ]),
                  _: 1
                }, 8, ["class"])
              ]),
              _: 1
            }, 16, ["id", "size", "type", "class", "disabled", "tabindex", "aria-label"])
          ]),
          _: 3
        })) : createCommentVNode("v-if", true)
      ], 2);
    }
    var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$m], ["__file", "dropdown.vue"]]);
    const _sfc_main$1r = /* @__PURE__ */ defineComponent({
      components: {
        ElRovingFocusCollectionItem: ElCollectionItem$1
      },
      props: {
        focusable: {
          type: Boolean,
          default: true
        },
        active: {
          type: Boolean,
          default: false
        }
      },
      emits: ["mousedown", "focus", "keydown"],
      setup(props2, { emit: emit2 }) {
        const { currentTabbedId, loop, onItemFocus, onItemShiftTab } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
        const { getItems } = inject(COLLECTION_INJECTION_KEY$1, void 0);
        const id = useId();
        const rovingFocusGroupItemRef = ref();
        const handleMousedown = composeEventHandlers((e2) => {
          emit2("mousedown", e2);
        }, (e2) => {
          if (!props2.focusable) {
            e2.preventDefault();
          } else {
            onItemFocus(unref(id));
          }
        });
        const handleFocus = composeEventHandlers((e2) => {
          emit2("focus", e2);
        }, () => {
          onItemFocus(unref(id));
        });
        const handleKeydown = composeEventHandlers((e2) => {
          emit2("keydown", e2);
        }, (e2) => {
          const { code, shiftKey, target, currentTarget } = e2;
          if (code === EVENT_CODE.tab && shiftKey) {
            onItemShiftTab();
            return;
          }
          if (target !== currentTarget)
            return;
          const focusIntent = getFocusIntent(e2);
          if (focusIntent) {
            e2.preventDefault();
            const items = getItems().filter((item) => item.focusable);
            let elements = items.map((item) => item.ref);
            switch (focusIntent) {
              case "last": {
                elements.reverse();
                break;
              }
              case "prev":
              case "next": {
                if (focusIntent === "prev") {
                  elements.reverse();
                }
                const currentIdx = elements.indexOf(currentTarget);
                elements = loop.value ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1);
                break;
              }
            }
            nextTick(() => {
              focusFirst(elements);
            });
          }
        });
        const isCurrentTab = computed(() => currentTabbedId.value === unref(id));
        provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
          rovingFocusGroupItemRef,
          tabIndex: computed(() => unref(isCurrentTab) ? 0 : -1),
          handleMousedown,
          handleFocus,
          handleKeydown
        });
        return {
          id,
          handleKeydown,
          handleFocus,
          handleMousedown
        };
      }
    });
    function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_roving_focus_collection_item = resolveComponent("el-roving-focus-collection-item");
      return openBlock(), createBlock(_component_el_roving_focus_collection_item, {
        id: _ctx.id,
        focusable: _ctx.focusable,
        active: _ctx.active
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
      }, 8, ["id", "focusable", "active"]);
    }
    var ElRovingFocusItem = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$l], ["__file", "roving-focus-item.vue"]]);
    const _sfc_main$1q = /* @__PURE__ */ defineComponent({
      name: "DropdownItemImpl",
      components: {
        ElIcon
      },
      props: dropdownItemProps,
      emits: ["pointermove", "pointerleave", "click", "clickimpl"],
      setup(_2, { emit: emit2 }) {
        const ns = useNamespace("dropdown");
        const { role: menuRole } = inject(DROPDOWN_INJECTION_KEY, void 0);
        const { collectionItemRef: dropdownCollectionItemRef } = inject(COLLECTION_ITEM_INJECTION_KEY, void 0);
        const { collectionItemRef: rovingFocusCollectionItemRef } = inject(COLLECTION_ITEM_INJECTION_KEY$1, void 0);
        const {
          rovingFocusGroupItemRef,
          tabIndex,
          handleFocus,
          handleKeydown: handleItemKeydown,
          handleMousedown
        } = inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0);
        const itemRef = composeRefs(dropdownCollectionItemRef, rovingFocusCollectionItemRef, rovingFocusGroupItemRef);
        const role = computed(() => {
          if (menuRole.value === "menu") {
            return "menuitem";
          } else if (menuRole.value === "navigation") {
            return "link";
          }
          return "button";
        });
        const handleKeydown = composeEventHandlers((e2) => {
          if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(e2.code)) {
            e2.preventDefault();
            e2.stopImmediatePropagation();
            emit2("clickimpl", e2);
            return true;
          }
        }, handleItemKeydown);
        return {
          ns,
          itemRef,
          dataset: {
            [COLLECTION_ITEM_SIGN]: ""
          },
          role,
          tabIndex,
          handleFocus,
          handleKeydown,
          handleMousedown
        };
      }
    });
    function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_icon = resolveComponent("el-icon");
      return openBlock(), createElementBlock(Fragment, null, [
        _ctx.divided ? (openBlock(), createElementBlock("li", {
          key: 0,
          role: "separator",
          class: normalizeClass(_ctx.ns.bem("menu", "item", "divided"))
        }, null, 2)) : createCommentVNode("v-if", true),
        createBaseVNode("li", mergeProps({ ref: _ctx.itemRef }, { ..._ctx.dataset, ..._ctx.$attrs }, {
          "aria-disabled": _ctx.disabled,
          class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)],
          tabindex: _ctx.tabIndex,
          role: _ctx.role,
          onClick: (e2) => _ctx.$emit("clickimpl", e2),
          onFocus: _ctx.handleFocus,
          onKeydown: withModifiers(_ctx.handleKeydown, ["self"]),
          onMousedown: _ctx.handleMousedown,
          onPointermove: (e2) => _ctx.$emit("pointermove", e2),
          onPointerleave: (e2) => _ctx.$emit("pointerleave", e2)
        }), [
          _ctx.icon ? (openBlock(), createBlock(_component_el_icon, { key: 0 }, {
            default: withCtx(() => [
              (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
            ]),
            _: 1
          })) : createCommentVNode("v-if", true),
          renderSlot(_ctx.$slots, "default")
        ], 16, ["aria-disabled", "tabindex", "role", "onClick", "onFocus", "onKeydown", "onMousedown", "onPointermove", "onPointerleave"])
      ], 64);
    }
    var ElDropdownItemImpl = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$k], ["__file", "dropdown-item-impl.vue"]]);
    const useDropdown = () => {
      const elDropdown = inject("elDropdown", {});
      const _elDropdownSize = computed(() => elDropdown == null ? void 0 : elDropdown.dropdownSize);
      return {
        elDropdown,
        _elDropdownSize
      };
    };
    const _sfc_main$1p = /* @__PURE__ */ defineComponent({
      name: "ElDropdownItem",
      components: {
        ElDropdownCollectionItem: ElCollectionItem,
        ElRovingFocusItem,
        ElDropdownItemImpl
      },
      inheritAttrs: false,
      props: dropdownItemProps,
      emits: ["pointermove", "pointerleave", "click"],
      setup(props2, { emit: emit2, attrs }) {
        const { elDropdown } = useDropdown();
        const _instance = getCurrentInstance();
        const itemRef = ref(null);
        const textContent = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = unref(itemRef)) == null ? void 0 : _a2.textContent) != null ? _b2 : "";
        });
        const { onItemEnter, onItemLeave } = inject(DROPDOWN_INJECTION_KEY, void 0);
        const handlePointerMove = composeEventHandlers((e2) => {
          emit2("pointermove", e2);
          return e2.defaultPrevented;
        }, whenMouse((e2) => {
          if (props2.disabled) {
            onItemLeave(e2);
            return;
          }
          const target = e2.currentTarget;
          if (target === document.activeElement || target.contains(document.activeElement)) {
            return;
          }
          onItemEnter(e2);
          if (!e2.defaultPrevented) {
            target == null ? void 0 : target.focus();
          }
        }));
        const handlePointerLeave = composeEventHandlers((e2) => {
          emit2("pointerleave", e2);
          return e2.defaultPrevented;
        }, whenMouse(onItemLeave));
        const handleClick = composeEventHandlers((e2) => {
          if (props2.disabled) {
            return;
          }
          emit2("click", e2);
          return e2.type !== "keydown" && e2.defaultPrevented;
        }, (e2) => {
          var _a2, _b2, _c2;
          if (props2.disabled) {
            e2.stopImmediatePropagation();
            return;
          }
          if ((_a2 = elDropdown == null ? void 0 : elDropdown.hideOnClick) == null ? void 0 : _a2.value) {
            (_b2 = elDropdown.handleClick) == null ? void 0 : _b2.call(elDropdown);
          }
          (_c2 = elDropdown.commandHandler) == null ? void 0 : _c2.call(elDropdown, props2.command, _instance, e2);
        });
        const propsAndAttrs = computed(() => ({ ...props2, ...attrs }));
        return {
          handleClick,
          handlePointerMove,
          handlePointerLeave,
          textContent,
          propsAndAttrs
        };
      }
    });
    function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
      var _a2;
      const _component_el_dropdown_item_impl = resolveComponent("el-dropdown-item-impl");
      const _component_el_roving_focus_item = resolveComponent("el-roving-focus-item");
      const _component_el_dropdown_collection_item = resolveComponent("el-dropdown-collection-item");
      return openBlock(), createBlock(_component_el_dropdown_collection_item, {
        disabled: _ctx.disabled,
        "text-value": (_a2 = _ctx.textValue) != null ? _a2 : _ctx.textContent
      }, {
        default: withCtx(() => [
          createVNode$1(_component_el_roving_focus_item, {
            focusable: !_ctx.disabled
          }, {
            default: withCtx(() => [
              createVNode$1(_component_el_dropdown_item_impl, mergeProps(_ctx.propsAndAttrs, {
                onPointerleave: _ctx.handlePointerLeave,
                onPointermove: _ctx.handlePointerMove,
                onClickimpl: _ctx.handleClick
              }), {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "default")
                ]),
                _: 3
              }, 16, ["onPointerleave", "onPointermove", "onClickimpl"])
            ]),
            _: 3
          }, 8, ["focusable"])
        ]),
        _: 3
      }, 8, ["disabled", "text-value"]);
    }
    var DropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["render", _sfc_render$j], ["__file", "dropdown-item.vue"]]);
    const _sfc_main$1o = /* @__PURE__ */ defineComponent({
      name: "ElDropdownMenu",
      props: dropdownMenuProps,
      setup(props2) {
        const ns = useNamespace("dropdown");
        const { _elDropdownSize } = useDropdown();
        const size = _elDropdownSize.value;
        const { focusTrapRef, onKeydown } = inject(FOCUS_TRAP_INJECTION_KEY, void 0);
        const { contentRef, role, triggerId } = inject(DROPDOWN_INJECTION_KEY, void 0);
        const { collectionRef: dropdownCollectionRef, getItems } = inject(COLLECTION_INJECTION_KEY, void 0);
        const {
          rovingFocusGroupRef,
          rovingFocusGroupRootStyle,
          tabIndex,
          onBlur,
          onFocus,
          onMousedown
        } = inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
        const { collectionRef: rovingFocusGroupCollectionRef } = inject(COLLECTION_INJECTION_KEY$1, void 0);
        const dropdownKls = computed(() => {
          return [ns.b("menu"), ns.bm("menu", size == null ? void 0 : size.value)];
        });
        const dropdownListWrapperRef = composeRefs(contentRef, dropdownCollectionRef, focusTrapRef, rovingFocusGroupRef, rovingFocusGroupCollectionRef);
        const composedKeydown = composeEventHandlers((e2) => {
          var _a2;
          (_a2 = props2.onKeydown) == null ? void 0 : _a2.call(props2, e2);
        }, (e2) => {
          const { currentTarget, code, target } = e2;
          currentTarget.contains(target);
          if (EVENT_CODE.tab === code) {
            e2.stopImmediatePropagation();
          }
          e2.preventDefault();
          if (target !== unref(contentRef) || !FIRST_LAST_KEYS.includes(code))
            return;
          const items = getItems().filter((item) => !item.disabled);
          const targets = items.map((item) => item.ref);
          if (LAST_KEYS.includes(code)) {
            targets.reverse();
          }
          focusFirst(targets);
        });
        const handleKeydown = (e2) => {
          composedKeydown(e2);
          onKeydown(e2);
        };
        return {
          size,
          rovingFocusGroupRootStyle,
          tabIndex,
          dropdownKls,
          role,
          triggerId,
          dropdownListWrapperRef,
          handleKeydown,
          onBlur,
          onFocus,
          onMousedown
        };
      }
    });
    function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("ul", {
        ref: _ctx.dropdownListWrapperRef,
        class: normalizeClass(_ctx.dropdownKls),
        style: normalizeStyle$1(_ctx.rovingFocusGroupRootStyle),
        tabindex: -1,
        role: _ctx.role,
        "aria-labelledby": _ctx.triggerId,
        onBlur: _ctx.onBlur,
        onFocus: _ctx.onFocus,
        onKeydown: withModifiers(_ctx.handleKeydown, ["self"]),
        onMousedown: withModifiers(_ctx.onMousedown, ["self"])
      }, [
        renderSlot(_ctx.$slots, "default")
      ], 46, ["role", "aria-labelledby", "onBlur", "onFocus", "onKeydown", "onMousedown"]);
    }
    var DropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["render", _sfc_render$i], ["__file", "dropdown-menu.vue"]]);
    const ElDropdown = withInstall(Dropdown, {
      DropdownItem,
      DropdownMenu
    });
    const ElDropdownItem = withNoopInstall(DropdownItem);
    const ElDropdownMenu = withNoopInstall(DropdownMenu);
    const __default__$11 = /* @__PURE__ */ defineComponent({
      name: "ImgEmpty"
    });
    const _sfc_main$1n = /* @__PURE__ */ defineComponent({
      ...__default__$11,
      setup(__props) {
        const ns = useNamespace("empty");
        const id = useId();
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("svg", {
            viewBox: "0 0 79 86",
            version: "1.1",
            xmlns: "http://www.w3.org/2000/svg",
            "xmlns:xlink": "http://www.w3.org/1999/xlink"
          }, [
            createBaseVNode("defs", null, [
              createBaseVNode("linearGradient", {
                id: `linearGradient-1-${unref(id)}`,
                x1: "38.8503086%",
                y1: "0%",
                x2: "61.1496914%",
                y2: "100%"
              }, [
                createBaseVNode("stop", {
                  "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
                  offset: "0%"
                }, null, 8, ["stop-color"]),
                createBaseVNode("stop", {
                  "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-4")})`,
                  offset: "100%"
                }, null, 8, ["stop-color"])
              ], 8, ["id"]),
              createBaseVNode("linearGradient", {
                id: `linearGradient-2-${unref(id)}`,
                x1: "0%",
                y1: "9.5%",
                x2: "100%",
                y2: "90.5%"
              }, [
                createBaseVNode("stop", {
                  "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-1")})`,
                  offset: "0%"
                }, null, 8, ["stop-color"]),
                createBaseVNode("stop", {
                  "stop-color": `var(${unref(ns).cssVarBlockName("fill-color-6")})`,
                  offset: "100%"
                }, null, 8, ["stop-color"])
              ], 8, ["id"]),
              createBaseVNode("rect", {
                id: `path-3-${unref(id)}`,
                x: "0",
                y: "0",
                width: "17",
                height: "36"
              }, null, 8, ["id"])
            ]),
            createBaseVNode("g", {
              stroke: "none",
              "stroke-width": "1",
              fill: "none",
              "fill-rule": "evenodd"
            }, [
              createBaseVNode("g", { transform: "translate(-1268.000000, -535.000000)" }, [
                createBaseVNode("g", { transform: "translate(1268.000000, 535.000000)" }, [
                  createBaseVNode("path", {
                    d: "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",
                    fill: `var(${unref(ns).cssVarBlockName("fill-color-3")})`
                  }, null, 8, ["fill"]),
                  createBaseVNode("polygon", {
                    fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
                    transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
                    points: "13 58 53 58 42 45 2 45"
                  }, null, 8, ["fill"]),
                  createBaseVNode("g", { transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)" }, [
                    createBaseVNode("polygon", {
                      fill: `var(${unref(ns).cssVarBlockName("fill-color-7")})`,
                      transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
                      points: "2.84078316e-14 3 18 3 23 7 5 7"
                    }, null, 8, ["fill"]),
                    createBaseVNode("polygon", {
                      fill: `var(${unref(ns).cssVarBlockName("fill-color-5")})`,
                      points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
                    }, null, 8, ["fill"]),
                    createBaseVNode("rect", {
                      fill: `url(#linearGradient-1-${unref(id)})`,
                      transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
                      x: "38",
                      y: "7",
                      width: "17",
                      height: "36"
                    }, null, 8, ["fill"]),
                    createBaseVNode("polygon", {
                      fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
                      transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
                      points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
                    }, null, 8, ["fill"])
                  ]),
                  createBaseVNode("rect", {
                    fill: `url(#linearGradient-2-${unref(id)})`,
                    x: "13",
                    y: "45",
                    width: "40",
                    height: "36"
                  }, null, 8, ["fill"]),
                  createBaseVNode("g", { transform: "translate(53.000000, 45.000000)" }, [
                    createBaseVNode("use", {
                      fill: `var(${unref(ns).cssVarBlockName("fill-color-8")})`,
                      transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
                      "xlink:href": `#path-3-${unref(id)}`
                    }, null, 8, ["fill", "xlink:href"]),
                    createBaseVNode("polygon", {
                      fill: `var(${unref(ns).cssVarBlockName("fill-color-9")})`,
                      mask: `url(#mask-4-${unref(id)})`,
                      transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
                      points: "7 0 24 0 20 18 7 16.5"
                    }, null, 8, ["fill", "mask"])
                  ]),
                  createBaseVNode("polygon", {
                    fill: `var(${unref(ns).cssVarBlockName("fill-color-2")})`,
                    transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
                    points: "62 45 79 45 70 58 53 58"
                  }, null, 8, ["fill"])
                ])
              ])
            ])
          ]);
        };
      }
    });
    var ImgEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["__file", "img-empty.vue"]]);
    const emptyProps = buildProps({
      image: {
        type: String,
        default: ""
      },
      imageSize: Number,
      description: {
        type: String,
        default: ""
      }
    });
    const __default__$10 = /* @__PURE__ */ defineComponent({
      name: "ElEmpty"
    });
    const _sfc_main$1m = /* @__PURE__ */ defineComponent({
      ...__default__$10,
      props: emptyProps,
      setup(__props) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("empty");
        const emptyDescription = computed(() => props2.description || t("el.table.emptyText"));
        const imageStyle = computed(() => ({
          width: addUnit(props2.imageSize)
        }));
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("image")),
              style: normalizeStyle$1(unref(imageStyle))
            }, [
              _ctx.image ? (openBlock(), createElementBlock("img", {
                key: 0,
                src: _ctx.image,
                ondragstart: "return false"
              }, null, 8, ["src"])) : renderSlot(_ctx.$slots, "image", { key: 1 }, () => [
                createVNode$1(ImgEmpty)
              ])
            ], 6),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("description"))
            }, [
              _ctx.$slots.description ? renderSlot(_ctx.$slots, "description", { key: 0 }) : (openBlock(), createElementBlock("p", { key: 1 }, toDisplayString(unref(emptyDescription)), 1))
            ], 2),
            _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("bottom"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var Empty$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__file", "empty.vue"]]);
    const ElEmpty = withInstall(Empty$1);
    const formMetaProps = buildProps({
      size: {
        type: String,
        values: componentSizes
      },
      disabled: Boolean
    });
    const formProps = buildProps({
      ...formMetaProps,
      model: Object,
      rules: {
        type: definePropType(Object)
      },
      labelPosition: {
        type: String,
        values: ["left", "right", "top"],
        default: "right"
      },
      requireAsteriskPosition: {
        type: String,
        values: ["left", "right"],
        default: "left"
      },
      labelWidth: {
        type: [String, Number],
        default: ""
      },
      labelSuffix: {
        type: String,
        default: ""
      },
      inline: Boolean,
      inlineMessage: Boolean,
      statusIcon: Boolean,
      showMessage: {
        type: Boolean,
        default: true
      },
      validateOnRuleChange: {
        type: Boolean,
        default: true
      },
      hideRequiredAsterisk: Boolean,
      scrollToError: Boolean,
      scrollIntoViewOptions: {
        type: [Object, Boolean]
      }
    });
    const formEmits = {
      validate: (prop, isValid, message2) => (isArray$5(prop) || isString$3(prop)) && isBoolean$1(isValid) && isString$3(message2)
    };
    function useFormLabelWidth() {
      const potentialLabelWidthArr = ref([]);
      const autoLabelWidth = computed(() => {
        if (!potentialLabelWidthArr.value.length)
          return "0";
        const max3 = Math.max(...potentialLabelWidthArr.value);
        return max3 ? `${max3}px` : "";
      });
      function getLabelWidthIndex(width) {
        const index = potentialLabelWidthArr.value.indexOf(width);
        if (index === -1 && autoLabelWidth.value === "0") ;
        return index;
      }
      function registerLabelWidth(val, oldVal) {
        if (val && oldVal) {
          const index = getLabelWidthIndex(oldVal);
          potentialLabelWidthArr.value.splice(index, 1, val);
        } else if (val) {
          potentialLabelWidthArr.value.push(val);
        }
      }
      function deregisterLabelWidth(val) {
        const index = getLabelWidthIndex(val);
        if (index > -1) {
          potentialLabelWidthArr.value.splice(index, 1);
        }
      }
      return {
        autoLabelWidth,
        registerLabelWidth,
        deregisterLabelWidth
      };
    }
    const filterFields = (fields, props2) => {
      const normalized = castArray$1(props2);
      return normalized.length > 0 ? fields.filter((field) => field.prop && normalized.includes(field.prop)) : fields;
    };
    const COMPONENT_NAME$e = "ElForm";
    const __default__$$ = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$e
    });
    const _sfc_main$1l = /* @__PURE__ */ defineComponent({
      ...__default__$$,
      props: formProps,
      emits: formEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const fields = reactive([]);
        const formSize = useFormSize();
        const ns = useNamespace("form");
        const formClasses = computed(() => {
          const { labelPosition, inline } = props2;
          return [
            ns.b(),
            ns.m(formSize.value || "default"),
            {
              [ns.m(`label-${labelPosition}`)]: labelPosition,
              [ns.m("inline")]: inline
            }
          ];
        });
        const getField = (prop) => {
          return fields.find((field) => field.prop === prop);
        };
        const addField = (field) => {
          fields.push(field);
        };
        const removeField = (field) => {
          if (field.prop) {
            fields.splice(fields.indexOf(field), 1);
          }
        };
        const resetFields = (properties = []) => {
          if (!props2.model) {
            return;
          }
          filterFields(fields, properties).forEach((field) => field.resetField());
        };
        const clearValidate = (props22 = []) => {
          filterFields(fields, props22).forEach((field) => field.clearValidate());
        };
        const isValidatable = computed(() => {
          const hasModel = !!props2.model;
          return hasModel;
        });
        const obtainValidateFields = (props22) => {
          if (fields.length === 0)
            return [];
          const filteredFields = filterFields(fields, props22);
          if (!filteredFields.length) {
            return [];
          }
          return filteredFields;
        };
        const validate = async (callback) => validateField(void 0, callback);
        const doValidateField = async (props22 = []) => {
          if (!isValidatable.value)
            return false;
          const fields2 = obtainValidateFields(props22);
          if (fields2.length === 0)
            return true;
          let validationErrors = {};
          for (const field of fields2) {
            try {
              await field.validate("");
              if (field.validateState === "error")
                field.resetField();
            } catch (fields3) {
              validationErrors = {
                ...validationErrors,
                ...fields3
              };
            }
          }
          if (Object.keys(validationErrors).length === 0)
            return true;
          return Promise.reject(validationErrors);
        };
        const validateField = async (modelProps = [], callback) => {
          const shouldThrow = !isFunction$4(callback);
          try {
            const result = await doValidateField(modelProps);
            if (result === true) {
              await (callback == null ? void 0 : callback(result));
            }
            return result;
          } catch (e2) {
            if (e2 instanceof Error)
              throw e2;
            const invalidFields = e2;
            if (props2.scrollToError) {
              scrollToField(Object.keys(invalidFields)[0]);
            }
            await (callback == null ? void 0 : callback(false, invalidFields));
            return shouldThrow && Promise.reject(invalidFields);
          }
        };
        const scrollToField = (prop) => {
          var _a2;
          const field = filterFields(fields, prop)[0];
          if (field) {
            (_a2 = field.$el) == null ? void 0 : _a2.scrollIntoView(props2.scrollIntoViewOptions);
          }
        };
        watch(() => props2.rules, () => {
          if (props2.validateOnRuleChange) {
            validate().catch((err) => debugWarn());
          }
        }, { deep: true, flush: "post" });
        provide(formContextKey, reactive({
          ...toRefs(props2),
          emit: emit2,
          resetFields,
          clearValidate,
          validateField,
          getField,
          addField,
          removeField,
          ...useFormLabelWidth()
        }));
        expose({
          validate,
          validateField,
          resetFields,
          clearValidate,
          scrollToField,
          fields
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("form", {
            class: normalizeClass(unref(formClasses))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var Form = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__file", "form.vue"]]);
    function _extends() {
      _extends = Object.assign ? Object.assign.bind() : function(target) {
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var source = arguments[i2];
          for (var key in source) {
            if (Object.prototype.hasOwnProperty.call(source, key)) {
              target[key] = source[key];
            }
          }
        }
        return target;
      };
      return _extends.apply(this, arguments);
    }
    function _inheritsLoose(subClass, superClass) {
      subClass.prototype = Object.create(superClass.prototype);
      subClass.prototype.constructor = subClass;
      _setPrototypeOf(subClass, superClass);
    }
    function _getPrototypeOf(o2) {
      _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o22) {
        return o22.__proto__ || Object.getPrototypeOf(o22);
      };
      return _getPrototypeOf(o2);
    }
    function _setPrototypeOf(o2, p2) {
      _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o22, p22) {
        o22.__proto__ = p22;
        return o22;
      };
      return _setPrototypeOf(o2, p2);
    }
    function _isNativeReflectConstruct() {
      if (typeof Reflect === "undefined" || !Reflect.construct) return false;
      if (Reflect.construct.sham) return false;
      if (typeof Proxy === "function") return true;
      try {
        Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
        return true;
      } catch (e2) {
        return false;
      }
    }
    function _construct(Parent, args, Class) {
      if (_isNativeReflectConstruct()) {
        _construct = Reflect.construct.bind();
      } else {
        _construct = function _construct2(Parent2, args2, Class2) {
          var a2 = [null];
          a2.push.apply(a2, args2);
          var Constructor = Function.bind.apply(Parent2, a2);
          var instance = new Constructor();
          if (Class2) _setPrototypeOf(instance, Class2.prototype);
          return instance;
        };
      }
      return _construct.apply(null, arguments);
    }
    function _isNativeFunction(fn2) {
      return Function.toString.call(fn2).indexOf("[native code]") !== -1;
    }
    function _wrapNativeSuper(Class) {
      var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
      _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
        if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
        if (typeof Class2 !== "function") {
          throw new TypeError("Super expression must either be null or a function");
        }
        if (typeof _cache !== "undefined") {
          if (_cache.has(Class2)) return _cache.get(Class2);
          _cache.set(Class2, Wrapper);
        }
        function Wrapper() {
          return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
        }
        Wrapper.prototype = Object.create(Class2.prototype, {
          constructor: {
            value: Wrapper,
            enumerable: false,
            writable: true,
            configurable: true
          }
        });
        return _setPrototypeOf(Wrapper, Class2);
      };
      return _wrapNativeSuper(Class);
    }
    var formatRegExp = /%[sdj%]/g;
    var warning = function warning2() {
    };
    function convertFieldsError(errors) {
      if (!errors || !errors.length) return null;
      var fields = {};
      errors.forEach(function(error) {
        var field = error.field;
        fields[field] = fields[field] || [];
        fields[field].push(error);
      });
      return fields;
    }
    function format$1(template) {
      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        args[_key - 1] = arguments[_key];
      }
      var i2 = 0;
      var len2 = args.length;
      if (typeof template === "function") {
        return template.apply(null, args);
      }
      if (typeof template === "string") {
        var str = template.replace(formatRegExp, function(x2) {
          if (x2 === "%%") {
            return "%";
          }
          if (i2 >= len2) {
            return x2;
          }
          switch (x2) {
            case "%s":
              return String(args[i2++]);
            case "%d":
              return Number(args[i2++]);
            case "%j":
              try {
                return JSON.stringify(args[i2++]);
              } catch (_2) {
                return "[Circular]";
              }
              break;
            default:
              return x2;
          }
        });
        return str;
      }
      return template;
    }
    function isNativeStringType(type4) {
      return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
    }
    function isEmptyValue$1(value, type4) {
      if (value === void 0 || value === null) {
        return true;
      }
      if (type4 === "array" && Array.isArray(value) && !value.length) {
        return true;
      }
      if (isNativeStringType(type4) && typeof value === "string" && !value) {
        return true;
      }
      return false;
    }
    function asyncParallelArray(arr, func, callback) {
      var results = [];
      var total2 = 0;
      var arrLength = arr.length;
      function count2(errors) {
        results.push.apply(results, errors || []);
        total2++;
        if (total2 === arrLength) {
          callback(results);
        }
      }
      arr.forEach(function(a2) {
        func(a2, count2);
      });
    }
    function asyncSerialArray(arr, func, callback) {
      var index = 0;
      var arrLength = arr.length;
      function next(errors) {
        if (errors && errors.length) {
          callback(errors);
          return;
        }
        var original = index;
        index = index + 1;
        if (original < arrLength) {
          func(arr[original], next);
        } else {
          callback([]);
        }
      }
      next([]);
    }
    function flattenObjArr(objArr) {
      var ret = [];
      Object.keys(objArr).forEach(function(k2) {
        ret.push.apply(ret, objArr[k2] || []);
      });
      return ret;
    }
    var AsyncValidationError = /* @__PURE__ */ function(_Error) {
      _inheritsLoose(AsyncValidationError2, _Error);
      function AsyncValidationError2(errors, fields) {
        var _this;
        _this = _Error.call(this, "Async Validation Error") || this;
        _this.errors = errors;
        _this.fields = fields;
        return _this;
      }
      return AsyncValidationError2;
    }(/* @__PURE__ */ _wrapNativeSuper(Error));
    function asyncMap(objArr, option, func, callback, source) {
      if (option.first) {
        var _pending = new Promise(function(resolve2, reject) {
          var next = function next2(errors) {
            callback(errors);
            return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve2(source);
          };
          var flattenArr = flattenObjArr(objArr);
          asyncSerialArray(flattenArr, func, next);
        });
        _pending["catch"](function(e2) {
          return e2;
        });
        return _pending;
      }
      var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
      var objArrKeys = Object.keys(objArr);
      var objArrLength = objArrKeys.length;
      var total2 = 0;
      var results = [];
      var pending = new Promise(function(resolve2, reject) {
        var next = function next2(errors) {
          results.push.apply(results, errors);
          total2++;
          if (total2 === objArrLength) {
            callback(results);
            return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve2(source);
          }
        };
        if (!objArrKeys.length) {
          callback(results);
          resolve2(source);
        }
        objArrKeys.forEach(function(key) {
          var arr = objArr[key];
          if (firstFields.indexOf(key) !== -1) {
            asyncSerialArray(arr, func, next);
          } else {
            asyncParallelArray(arr, func, next);
          }
        });
      });
      pending["catch"](function(e2) {
        return e2;
      });
      return pending;
    }
    function isErrorObj(obj) {
      return !!(obj && obj.message !== void 0);
    }
    function getValue(value, path) {
      var v4 = value;
      for (var i2 = 0; i2 < path.length; i2++) {
        if (v4 == void 0) {
          return v4;
        }
        v4 = v4[path[i2]];
      }
      return v4;
    }
    function complementError(rule, source) {
      return function(oe) {
        var fieldValue;
        if (rule.fullFields) {
          fieldValue = getValue(source, rule.fullFields);
        } else {
          fieldValue = source[oe.field || rule.fullField];
        }
        if (isErrorObj(oe)) {
          oe.field = oe.field || rule.fullField;
          oe.fieldValue = fieldValue;
          return oe;
        }
        return {
          message: typeof oe === "function" ? oe() : oe,
          fieldValue,
          field: oe.field || rule.fullField
        };
      };
    }
    function deepMerge(target, source) {
      if (source) {
        for (var s2 in source) {
          if (source.hasOwnProperty(s2)) {
            var value = source[s2];
            if (typeof value === "object" && typeof target[s2] === "object") {
              target[s2] = _extends({}, target[s2], value);
            } else {
              target[s2] = value;
            }
          }
        }
      }
      return target;
    }
    var required$1 = function required(rule, value, source, errors, options, type4) {
      if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue$1(value, type4 || rule.type))) {
        errors.push(format$1(options.messages.required, rule.fullField));
      }
    };
    var whitespace = function whitespace2(rule, value, source, errors, options) {
      if (/^\s+$/.test(value) || value === "") {
        errors.push(format$1(options.messages.whitespace, rule.fullField));
      }
    };
    var urlReg;
    var getUrlRegex = function() {
      if (urlReg) {
        return urlReg;
      }
      var word = "[a-fA-F\\d:]";
      var b2 = function b22(options) {
        return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
      };
      var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
      var v6seg = "[a-fA-F\\d]{1,4}";
      var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)|                                    // 1:2:3:4:5:6:7::  1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)|                             // 1:2:3:4:5:6::    1:2:3:4:5:6::8   1:2:3:4:5:6::8  1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)|                   // 1:2:3:4:5::      1:2:3:4:5::7:8   1:2:3:4:5::8    1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4::        1:2:3:4::6:7:8   1:2:3:4::8      1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3::          1:2:3::5:6:7:8   1:2:3::8        1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2::            1:2::4:5:6:7:8   1:2::8          1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1::              1::3:4:5:6:7:8   1::8            1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:))             // ::2:3:4:5:6:7:8  ::2:3:4:5:6:7:8  ::8             ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})?                                             // %eth0            %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
      var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
      var v4exact = new RegExp("^" + v4 + "$");
      var v6exact = new RegExp("^" + v6 + "$");
      var ip = function ip2(options) {
        return options && options.exact ? v46Exact : new RegExp("(?:" + b2(options) + v4 + b2(options) + ")|(?:" + b2(options) + v6 + b2(options) + ")", "g");
      };
      ip.v4 = function(options) {
        return options && options.exact ? v4exact : new RegExp("" + b2(options) + v4 + b2(options), "g");
      };
      ip.v6 = function(options) {
        return options && options.exact ? v6exact : new RegExp("" + b2(options) + v6 + b2(options), "g");
      };
      var protocol = "(?:(?:[a-z]+:)?//)";
      var auth = "(?:\\S+(?::\\S*)?@)?";
      var ipv4 = ip.v4().source;
      var ipv6 = ip.v6().source;
      var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
      var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
      var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
      var port = "(?::\\d{2,5})?";
      var path = '(?:[/?#][^\\s"]*)?';
      var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
      urlReg = new RegExp("(?:^" + regex + "$)", "i");
      return urlReg;
    };
    var pattern$2 = {
      // http://emailregex.com/
      email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
      // url: new RegExp(
      //   '^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$',
      //   'i',
      // ),
      hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
    };
    var types = {
      integer: function integer(value) {
        return types.number(value) && parseInt(value, 10) === value;
      },
      "float": function float2(value) {
        return types.number(value) && !types.integer(value);
      },
      array: function array(value) {
        return Array.isArray(value);
      },
      regexp: function regexp3(value) {
        if (value instanceof RegExp) {
          return true;
        }
        try {
          return !!new RegExp(value);
        } catch (e2) {
          return false;
        }
      },
      date: function date(value) {
        return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
      },
      number: function number(value) {
        if (isNaN(value)) {
          return false;
        }
        return typeof value === "number";
      },
      object: function object(value) {
        return typeof value === "object" && !types.array(value);
      },
      method: function method(value) {
        return typeof value === "function";
      },
      email: function email(value) {
        return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
      },
      url: function url(value) {
        return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
      },
      hex: function hex(value) {
        return typeof value === "string" && !!value.match(pattern$2.hex);
      }
    };
    var type$1 = function type(rule, value, source, errors, options) {
      if (rule.required && value === void 0) {
        required$1(rule, value, source, errors, options);
        return;
      }
      var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
      var ruleType = rule.type;
      if (custom.indexOf(ruleType) > -1) {
        if (!types[ruleType](value)) {
          errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));
        }
      } else if (ruleType && typeof value !== rule.type) {
        errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));
      }
    };
    var range = function range2(rule, value, source, errors, options) {
      var len2 = typeof rule.len === "number";
      var min3 = typeof rule.min === "number";
      var max3 = typeof rule.max === "number";
      var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
      var val = value;
      var key = null;
      var num = typeof value === "number";
      var str = typeof value === "string";
      var arr = Array.isArray(value);
      if (num) {
        key = "number";
      } else if (str) {
        key = "string";
      } else if (arr) {
        key = "array";
      }
      if (!key) {
        return false;
      }
      if (arr) {
        val = value.length;
      }
      if (str) {
        val = value.replace(spRegexp, "_").length;
      }
      if (len2) {
        if (val !== rule.len) {
          errors.push(format$1(options.messages[key].len, rule.fullField, rule.len));
        }
      } else if (min3 && !max3 && val < rule.min) {
        errors.push(format$1(options.messages[key].min, rule.fullField, rule.min));
      } else if (max3 && !min3 && val > rule.max) {
        errors.push(format$1(options.messages[key].max, rule.fullField, rule.max));
      } else if (min3 && max3 && (val < rule.min || val > rule.max)) {
        errors.push(format$1(options.messages[key].range, rule.fullField, rule.min, rule.max));
      }
    };
    var ENUM$1 = "enum";
    var enumerable$1 = function enumerable(rule, value, source, errors, options) {
      rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
      if (rule[ENUM$1].indexOf(value) === -1) {
        errors.push(format$1(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
      }
    };
    var pattern$1 = function pattern(rule, value, source, errors, options) {
      if (rule.pattern) {
        if (rule.pattern instanceof RegExp) {
          rule.pattern.lastIndex = 0;
          if (!rule.pattern.test(value)) {
            errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
          }
        } else if (typeof rule.pattern === "string") {
          var _pattern = new RegExp(rule.pattern);
          if (!_pattern.test(value)) {
            errors.push(format$1(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
          }
        }
      }
    };
    var rules = {
      required: required$1,
      whitespace,
      type: type$1,
      range,
      "enum": enumerable$1,
      pattern: pattern$1
    };
    var string = function string2(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value, "string") && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options, "string");
        if (!isEmptyValue$1(value, "string")) {
          rules.type(rule, value, source, errors, options);
          rules.range(rule, value, source, errors, options);
          rules.pattern(rule, value, source, errors, options);
          if (rule.whitespace === true) {
            rules.whitespace(rule, value, source, errors, options);
          }
        }
      }
      callback(errors);
    };
    var method2 = function method3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var number2 = function number3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (value === "") {
          value = void 0;
        }
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
          rules.range(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var _boolean = function _boolean2(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var regexp2 = function regexp3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (!isEmptyValue$1(value)) {
          rules.type(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var integer2 = function integer3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
          rules.range(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var floatFn = function floatFn2(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
          rules.range(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var array2 = function array3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if ((value === void 0 || value === null) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options, "array");
        if (value !== void 0 && value !== null) {
          rules.type(rule, value, source, errors, options);
          rules.range(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var object2 = function object3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules.type(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var ENUM = "enum";
    var enumerable2 = function enumerable3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (value !== void 0) {
          rules[ENUM](rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var pattern2 = function pattern3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value, "string") && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (!isEmptyValue$1(value, "string")) {
          rules.pattern(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var date2 = function date3(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value, "date") && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
        if (!isEmptyValue$1(value, "date")) {
          var dateObject;
          if (value instanceof Date) {
            dateObject = value;
          } else {
            dateObject = new Date(value);
          }
          rules.type(rule, dateObject, source, errors, options);
          if (dateObject) {
            rules.range(rule, dateObject.getTime(), source, errors, options);
          }
        }
      }
      callback(errors);
    };
    var required2 = function required3(rule, value, callback, source, options) {
      var errors = [];
      var type4 = Array.isArray(value) ? "array" : typeof value;
      rules.required(rule, value, source, errors, options, type4);
      callback(errors);
    };
    var type2 = function type3(rule, value, callback, source, options) {
      var ruleType = rule.type;
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value, ruleType) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options, ruleType);
        if (!isEmptyValue$1(value, ruleType)) {
          rules.type(rule, value, source, errors, options);
        }
      }
      callback(errors);
    };
    var any = function any2(rule, value, callback, source, options) {
      var errors = [];
      var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
      if (validate) {
        if (isEmptyValue$1(value) && !rule.required) {
          return callback();
        }
        rules.required(rule, value, source, errors, options);
      }
      callback(errors);
    };
    var validators$2 = {
      string,
      method: method2,
      number: number2,
      "boolean": _boolean,
      regexp: regexp2,
      integer: integer2,
      "float": floatFn,
      array: array2,
      object: object2,
      "enum": enumerable2,
      pattern: pattern2,
      date: date2,
      url: type2,
      hex: type2,
      email: type2,
      required: required2,
      any
    };
    function newMessages() {
      return {
        "default": "Validation error on field %s",
        required: "%s is required",
        "enum": "%s must be one of %s",
        whitespace: "%s cannot be empty",
        date: {
          format: "%s date %s is invalid for format %s",
          parse: "%s date could not be parsed, %s is invalid ",
          invalid: "%s date %s is invalid"
        },
        types: {
          string: "%s is not a %s",
          method: "%s is not a %s (function)",
          array: "%s is not an %s",
          object: "%s is not an %s",
          number: "%s is not a %s",
          date: "%s is not a %s",
          "boolean": "%s is not a %s",
          integer: "%s is not an %s",
          "float": "%s is not a %s",
          regexp: "%s is not a valid %s",
          email: "%s is not a valid %s",
          url: "%s is not a valid %s",
          hex: "%s is not a valid %s"
        },
        string: {
          len: "%s must be exactly %s characters",
          min: "%s must be at least %s characters",
          max: "%s cannot be longer than %s characters",
          range: "%s must be between %s and %s characters"
        },
        number: {
          len: "%s must equal %s",
          min: "%s cannot be less than %s",
          max: "%s cannot be greater than %s",
          range: "%s must be between %s and %s"
        },
        array: {
          len: "%s must be exactly %s in length",
          min: "%s cannot be less than %s in length",
          max: "%s cannot be greater than %s in length",
          range: "%s must be between %s and %s in length"
        },
        pattern: {
          mismatch: "%s value %s does not match pattern %s"
        },
        clone: function clone2() {
          var cloned = JSON.parse(JSON.stringify(this));
          cloned.clone = this.clone;
          return cloned;
        }
      };
    }
    var messages = newMessages();
    var Schema = /* @__PURE__ */ function() {
      function Schema2(descriptor) {
        this.rules = null;
        this._messages = messages;
        this.define(descriptor);
      }
      var _proto = Schema2.prototype;
      _proto.define = function define(rules2) {
        var _this = this;
        if (!rules2) {
          throw new Error("Cannot configure a schema with no rules");
        }
        if (typeof rules2 !== "object" || Array.isArray(rules2)) {
          throw new Error("Rules must be an object");
        }
        this.rules = {};
        Object.keys(rules2).forEach(function(name) {
          var item = rules2[name];
          _this.rules[name] = Array.isArray(item) ? item : [item];
        });
      };
      _proto.messages = function messages2(_messages) {
        if (_messages) {
          this._messages = deepMerge(newMessages(), _messages);
        }
        return this._messages;
      };
      _proto.validate = function validate(source_, o2, oc) {
        var _this2 = this;
        if (o2 === void 0) {
          o2 = {};
        }
        if (oc === void 0) {
          oc = function oc2() {
          };
        }
        var source = source_;
        var options = o2;
        var callback = oc;
        if (typeof options === "function") {
          callback = options;
          options = {};
        }
        if (!this.rules || Object.keys(this.rules).length === 0) {
          if (callback) {
            callback(null, source);
          }
          return Promise.resolve(source);
        }
        function complete(results) {
          var errors = [];
          var fields = {};
          function add2(e2) {
            if (Array.isArray(e2)) {
              var _errors;
              errors = (_errors = errors).concat.apply(_errors, e2);
            } else {
              errors.push(e2);
            }
          }
          for (var i2 = 0; i2 < results.length; i2++) {
            add2(results[i2]);
          }
          if (!errors.length) {
            callback(null, source);
          } else {
            fields = convertFieldsError(errors);
            callback(errors, fields);
          }
        }
        if (options.messages) {
          var messages$1 = this.messages();
          if (messages$1 === messages) {
            messages$1 = newMessages();
          }
          deepMerge(messages$1, options.messages);
          options.messages = messages$1;
        } else {
          options.messages = this.messages();
        }
        var series = {};
        var keys2 = options.keys || Object.keys(this.rules);
        keys2.forEach(function(z2) {
          var arr = _this2.rules[z2];
          var value = source[z2];
          arr.forEach(function(r) {
            var rule = r;
            if (typeof rule.transform === "function") {
              if (source === source_) {
                source = _extends({}, source);
              }
              value = source[z2] = rule.transform(value);
            }
            if (typeof rule === "function") {
              rule = {
                validator: rule
              };
            } else {
              rule = _extends({}, rule);
            }
            rule.validator = _this2.getValidationMethod(rule);
            if (!rule.validator) {
              return;
            }
            rule.field = z2;
            rule.fullField = rule.fullField || z2;
            rule.type = _this2.getType(rule);
            series[z2] = series[z2] || [];
            series[z2].push({
              rule,
              value,
              source,
              field: z2
            });
          });
        });
        var errorFields = {};
        return asyncMap(series, options, function(data, doIt) {
          var rule = data.rule;
          var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
          deep = deep && (rule.required || !rule.required && data.value);
          rule.field = data.field;
          function addFullField(key, schema) {
            return _extends({}, schema, {
              fullField: rule.fullField + "." + key,
              fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
            });
          }
          function cb(e2) {
            if (e2 === void 0) {
              e2 = [];
            }
            var errorList = Array.isArray(e2) ? e2 : [e2];
            if (!options.suppressWarning && errorList.length) {
              Schema2.warning("async-validator:", errorList);
            }
            if (errorList.length && rule.message !== void 0) {
              errorList = [].concat(rule.message);
            }
            var filledErrors = errorList.map(complementError(rule, source));
            if (options.first && filledErrors.length) {
              errorFields[rule.field] = 1;
              return doIt(filledErrors);
            }
            if (!deep) {
              doIt(filledErrors);
            } else {
              if (rule.required && !data.value) {
                if (rule.message !== void 0) {
                  filledErrors = [].concat(rule.message).map(complementError(rule, source));
                } else if (options.error) {
                  filledErrors = [options.error(rule, format$1(options.messages.required, rule.field))];
                }
                return doIt(filledErrors);
              }
              var fieldsSchema = {};
              if (rule.defaultField) {
                Object.keys(data.value).map(function(key) {
                  fieldsSchema[key] = rule.defaultField;
                });
              }
              fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
              var paredFieldsSchema = {};
              Object.keys(fieldsSchema).forEach(function(field) {
                var fieldSchema = fieldsSchema[field];
                var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
                paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
              });
              var schema = new Schema2(paredFieldsSchema);
              schema.messages(options.messages);
              if (data.rule.options) {
                data.rule.options.messages = options.messages;
                data.rule.options.error = options.error;
              }
              schema.validate(data.value, data.rule.options || options, function(errs) {
                var finalErrors = [];
                if (filledErrors && filledErrors.length) {
                  finalErrors.push.apply(finalErrors, filledErrors);
                }
                if (errs && errs.length) {
                  finalErrors.push.apply(finalErrors, errs);
                }
                doIt(finalErrors.length ? finalErrors : null);
              });
            }
          }
          var res;
          if (rule.asyncValidator) {
            res = rule.asyncValidator(rule, data.value, cb, data.source, options);
          } else if (rule.validator) {
            try {
              res = rule.validator(rule, data.value, cb, data.source, options);
            } catch (error) {
              console.error == null ? void 0 : console.error(error);
              if (!options.suppressValidatorError) {
                setTimeout(function() {
                  throw error;
                }, 0);
              }
              cb(error.message);
            }
            if (res === true) {
              cb();
            } else if (res === false) {
              cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
            } else if (res instanceof Array) {
              cb(res);
            } else if (res instanceof Error) {
              cb(res.message);
            }
          }
          if (res && res.then) {
            res.then(function() {
              return cb();
            }, function(e2) {
              return cb(e2);
            });
          }
        }, function(results) {
          complete(results);
        }, source);
      };
      _proto.getType = function getType(rule) {
        if (rule.type === void 0 && rule.pattern instanceof RegExp) {
          rule.type = "pattern";
        }
        if (typeof rule.validator !== "function" && rule.type && !validators$2.hasOwnProperty(rule.type)) {
          throw new Error(format$1("Unknown rule type %s", rule.type));
        }
        return rule.type || "string";
      };
      _proto.getValidationMethod = function getValidationMethod(rule) {
        if (typeof rule.validator === "function") {
          return rule.validator;
        }
        var keys2 = Object.keys(rule);
        var messageIndex = keys2.indexOf("message");
        if (messageIndex !== -1) {
          keys2.splice(messageIndex, 1);
        }
        if (keys2.length === 1 && keys2[0] === "required") {
          return validators$2.required;
        }
        return validators$2[this.getType(rule)] || void 0;
      };
      return Schema2;
    }();
    Schema.register = function register2(type4, validator2) {
      if (typeof validator2 !== "function") {
        throw new Error("Cannot register a validator by type, validator is not a function");
      }
      validators$2[type4] = validator2;
    };
    Schema.warning = warning;
    Schema.messages = messages;
    Schema.validators = validators$2;
    const formItemValidateStates = [
      "",
      "error",
      "validating",
      "success"
    ];
    const formItemProps = buildProps({
      label: String,
      labelWidth: {
        type: [String, Number],
        default: ""
      },
      labelPosition: {
        type: String,
        values: ["left", "right", "top", ""],
        default: ""
      },
      prop: {
        type: definePropType([String, Array])
      },
      required: {
        type: Boolean,
        default: void 0
      },
      rules: {
        type: definePropType([Object, Array])
      },
      error: String,
      validateStatus: {
        type: String,
        values: formItemValidateStates
      },
      for: String,
      inlineMessage: {
        type: [String, Boolean],
        default: ""
      },
      showMessage: {
        type: Boolean,
        default: true
      },
      size: {
        type: String,
        values: componentSizes
      }
    });
    const COMPONENT_NAME$d = "ElLabelWrap";
    var FormLabelWrap = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$d,
      props: {
        isAutoWidth: Boolean,
        updateAll: Boolean
      },
      setup(props2, {
        slots
      }) {
        const formContext = inject(formContextKey, void 0);
        const formItemContext = inject(formItemContextKey);
        if (!formItemContext)
          throwError$1(COMPONENT_NAME$d, "usage: <el-form-item><label-wrap /></el-form-item>");
        const ns = useNamespace("form");
        const el = ref();
        const computedWidth = ref(0);
        const getLabelWidth = () => {
          var _a2;
          if ((_a2 = el.value) == null ? void 0 : _a2.firstElementChild) {
            const width = window.getComputedStyle(el.value.firstElementChild).width;
            return Math.ceil(Number.parseFloat(width));
          } else {
            return 0;
          }
        };
        const updateLabelWidth = (action = "update") => {
          nextTick(() => {
            if (slots.default && props2.isAutoWidth) {
              if (action === "update") {
                computedWidth.value = getLabelWidth();
              } else if (action === "remove") {
                formContext == null ? void 0 : formContext.deregisterLabelWidth(computedWidth.value);
              }
            }
          });
        };
        const updateLabelWidthFn = () => updateLabelWidth("update");
        onMounted(() => {
          updateLabelWidthFn();
        });
        onBeforeUnmount(() => {
          updateLabelWidth("remove");
        });
        onUpdated(() => updateLabelWidthFn());
        watch(computedWidth, (val, oldVal) => {
          if (props2.updateAll) {
            formContext == null ? void 0 : formContext.registerLabelWidth(val, oldVal);
          }
        });
        useResizeObserver(computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = el.value) == null ? void 0 : _a2.firstElementChild) != null ? _b2 : null;
        }), updateLabelWidthFn);
        return () => {
          var _a2, _b2;
          if (!slots)
            return null;
          const {
            isAutoWidth
          } = props2;
          if (isAutoWidth) {
            const autoLabelWidth = formContext == null ? void 0 : formContext.autoLabelWidth;
            const hasLabel = formItemContext == null ? void 0 : formItemContext.hasLabel;
            const style = {};
            if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") {
              const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value);
              const labelPosition = formItemContext.labelPosition || formContext.labelPosition;
              const marginPosition = labelPosition === "left" ? "marginRight" : "marginLeft";
              if (marginWidth) {
                style[marginPosition] = `${marginWidth}px`;
              }
            }
            return createVNode$1("div", {
              "ref": el,
              "class": [ns.be("item", "label-wrap")],
              "style": style
            }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]);
          } else {
            return createVNode$1(Fragment, {
              "ref": el
            }, [(_b2 = slots.default) == null ? void 0 : _b2.call(slots)]);
          }
        };
      }
    });
    const __default__$_ = /* @__PURE__ */ defineComponent({
      name: "ElFormItem"
    });
    const _sfc_main$1k = /* @__PURE__ */ defineComponent({
      ...__default__$_,
      props: formItemProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const slots = useSlots();
        const formContext = inject(formContextKey, void 0);
        const parentFormItemContext = inject(formItemContextKey, void 0);
        const _size = useFormSize(void 0, { formItem: false });
        const ns = useNamespace("form-item");
        const labelId = useId().value;
        const inputIds = ref([]);
        const validateState = ref("");
        const validateStateDebounced = refDebounced(validateState, 100);
        const validateMessage = ref("");
        const formItemRef = ref();
        let initialValue = void 0;
        let isResettingField = false;
        const labelPosition = computed(() => props2.labelPosition || (formContext == null ? void 0 : formContext.labelPosition));
        const labelStyle = computed(() => {
          if (labelPosition.value === "top") {
            return {};
          }
          const labelWidth = addUnit(props2.labelWidth || (formContext == null ? void 0 : formContext.labelWidth) || "");
          if (labelWidth)
            return { width: labelWidth };
          return {};
        });
        const contentStyle = computed(() => {
          if (labelPosition.value === "top" || (formContext == null ? void 0 : formContext.inline)) {
            return {};
          }
          if (!props2.label && !props2.labelWidth && isNested) {
            return {};
          }
          const labelWidth = addUnit(props2.labelWidth || (formContext == null ? void 0 : formContext.labelWidth) || "");
          if (!props2.label && !slots.label) {
            return { marginLeft: labelWidth };
          }
          return {};
        });
        const formItemClasses = computed(() => [
          ns.b(),
          ns.m(_size.value),
          ns.is("error", validateState.value === "error"),
          ns.is("validating", validateState.value === "validating"),
          ns.is("success", validateState.value === "success"),
          ns.is("required", isRequired.value || props2.required),
          ns.is("no-asterisk", formContext == null ? void 0 : formContext.hideRequiredAsterisk),
          (formContext == null ? void 0 : formContext.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
          {
            [ns.m("feedback")]: formContext == null ? void 0 : formContext.statusIcon,
            [ns.m(`label-${labelPosition.value}`)]: labelPosition.value
          }
        ]);
        const _inlineMessage = computed(() => isBoolean$1(props2.inlineMessage) ? props2.inlineMessage : (formContext == null ? void 0 : formContext.inlineMessage) || false);
        const validateClasses = computed(() => [
          ns.e("error"),
          { [ns.em("error", "inline")]: _inlineMessage.value }
        ]);
        const propString = computed(() => {
          if (!props2.prop)
            return "";
          return isString$3(props2.prop) ? props2.prop : props2.prop.join(".");
        });
        const hasLabel = computed(() => {
          return !!(props2.label || slots.label);
        });
        const labelFor = computed(() => {
          return props2.for || (inputIds.value.length === 1 ? inputIds.value[0] : void 0);
        });
        const isGroup = computed(() => {
          return !labelFor.value && hasLabel.value;
        });
        const isNested = !!parentFormItemContext;
        const fieldValue = computed(() => {
          const model = formContext == null ? void 0 : formContext.model;
          if (!model || !props2.prop) {
            return;
          }
          return getProp(model, props2.prop).value;
        });
        const normalizedRules = computed(() => {
          const { required } = props2;
          const rules2 = [];
          if (props2.rules) {
            rules2.push(...castArray$1(props2.rules));
          }
          const formRules = formContext == null ? void 0 : formContext.rules;
          if (formRules && props2.prop) {
            const _rules = getProp(formRules, props2.prop).value;
            if (_rules) {
              rules2.push(...castArray$1(_rules));
            }
          }
          if (required !== void 0) {
            const requiredRules = rules2.map((rule, i2) => [rule, i2]).filter(([rule]) => Object.keys(rule).includes("required"));
            if (requiredRules.length > 0) {
              for (const [rule, i2] of requiredRules) {
                if (rule.required === required)
                  continue;
                rules2[i2] = { ...rule, required };
              }
            } else {
              rules2.push({ required });
            }
          }
          return rules2;
        });
        const validateEnabled = computed(() => normalizedRules.value.length > 0);
        const getFilteredRule = (trigger2) => {
          const rules2 = normalizedRules.value;
          return rules2.filter((rule) => {
            if (!rule.trigger || !trigger2)
              return true;
            if (isArray$5(rule.trigger)) {
              return rule.trigger.includes(trigger2);
            } else {
              return rule.trigger === trigger2;
            }
          }).map(({ trigger: trigger22, ...rule }) => rule);
        };
        const isRequired = computed(() => normalizedRules.value.some((rule) => rule.required));
        const shouldShowError = computed(() => {
          var _a2;
          return validateStateDebounced.value === "error" && props2.showMessage && ((_a2 = formContext == null ? void 0 : formContext.showMessage) != null ? _a2 : true);
        });
        const currentLabel = computed(() => `${props2.label || ""}${(formContext == null ? void 0 : formContext.labelSuffix) || ""}`);
        const setValidationState = (state) => {
          validateState.value = state;
        };
        const onValidationFailed = (error) => {
          var _a2, _b2;
          const { errors, fields } = error;
          if (!errors || !fields) {
            console.error(error);
          }
          setValidationState("error");
          validateMessage.value = errors ? (_b2 = (_a2 = errors == null ? void 0 : errors[0]) == null ? void 0 : _a2.message) != null ? _b2 : `${props2.prop} is required` : "";
          formContext == null ? void 0 : formContext.emit("validate", props2.prop, false, validateMessage.value);
        };
        const onValidationSucceeded = () => {
          setValidationState("success");
          formContext == null ? void 0 : formContext.emit("validate", props2.prop, true, "");
        };
        const doValidate = async (rules2) => {
          const modelName = propString.value;
          const validator2 = new Schema({
            [modelName]: rules2
          });
          return validator2.validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => {
            onValidationSucceeded();
            return true;
          }).catch((err) => {
            onValidationFailed(err);
            return Promise.reject(err);
          });
        };
        const validate = async (trigger2, callback) => {
          if (isResettingField || !props2.prop) {
            return false;
          }
          const hasCallback = isFunction$4(callback);
          if (!validateEnabled.value) {
            callback == null ? void 0 : callback(false);
            return false;
          }
          const rules2 = getFilteredRule(trigger2);
          if (rules2.length === 0) {
            callback == null ? void 0 : callback(true);
            return true;
          }
          setValidationState("validating");
          return doValidate(rules2).then(() => {
            callback == null ? void 0 : callback(true);
            return true;
          }).catch((err) => {
            const { fields } = err;
            callback == null ? void 0 : callback(false, fields);
            return hasCallback ? false : Promise.reject(fields);
          });
        };
        const clearValidate = () => {
          setValidationState("");
          validateMessage.value = "";
          isResettingField = false;
        };
        const resetField = async () => {
          const model = formContext == null ? void 0 : formContext.model;
          if (!model || !props2.prop)
            return;
          const computedValue = getProp(model, props2.prop);
          isResettingField = true;
          computedValue.value = clone$5(initialValue);
          await nextTick();
          clearValidate();
          isResettingField = false;
        };
        const addInputId = (id) => {
          if (!inputIds.value.includes(id)) {
            inputIds.value.push(id);
          }
        };
        const removeInputId = (id) => {
          inputIds.value = inputIds.value.filter((listId) => listId !== id);
        };
        watch(() => props2.error, (val) => {
          validateMessage.value = val || "";
          setValidationState(val ? "error" : "");
        }, { immediate: true });
        watch(() => props2.validateStatus, (val) => setValidationState(val || ""));
        const context = reactive({
          ...toRefs(props2),
          $el: formItemRef,
          size: _size,
          validateState,
          labelId,
          inputIds,
          isGroup,
          hasLabel,
          fieldValue,
          addInputId,
          removeInputId,
          resetField,
          clearValidate,
          validate
        });
        provide(formItemContextKey, context);
        onMounted(() => {
          if (props2.prop) {
            formContext == null ? void 0 : formContext.addField(context);
            initialValue = clone$5(fieldValue.value);
          }
        });
        onBeforeUnmount(() => {
          formContext == null ? void 0 : formContext.removeField(context);
        });
        expose({
          size: _size,
          validateMessage,
          validateState,
          validate,
          clearValidate,
          resetField
        });
        return (_ctx, _cache) => {
          var _a2;
          return openBlock(), createElementBlock("div", {
            ref_key: "formItemRef",
            ref: formItemRef,
            class: normalizeClass(unref(formItemClasses)),
            role: unref(isGroup) ? "group" : void 0,
            "aria-labelledby": unref(isGroup) ? unref(labelId) : void 0
          }, [
            createVNode$1(unref(FormLabelWrap), {
              "is-auto-width": unref(labelStyle).width === "auto",
              "update-all": ((_a2 = unref(formContext)) == null ? void 0 : _a2.labelWidth) === "auto"
            }, {
              default: withCtx(() => [
                unref(hasLabel) ? (openBlock(), createBlock(resolveDynamicComponent(unref(labelFor) ? "label" : "div"), {
                  key: 0,
                  id: unref(labelId),
                  for: unref(labelFor),
                  class: normalizeClass(unref(ns).e("label")),
                  style: normalizeStyle$1(unref(labelStyle))
                }, {
                  default: withCtx(() => [
                    renderSlot(_ctx.$slots, "label", { label: unref(currentLabel) }, () => [
                      createTextVNode(toDisplayString(unref(currentLabel)), 1)
                    ])
                  ]),
                  _: 3
                }, 8, ["id", "for", "class", "style"])) : createCommentVNode("v-if", true)
              ]),
              _: 3
            }, 8, ["is-auto-width", "update-all"]),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("content")),
              style: normalizeStyle$1(unref(contentStyle))
            }, [
              renderSlot(_ctx.$slots, "default"),
              createVNode$1(TransitionGroup, {
                name: `${unref(ns).namespace.value}-zoom-in-top`
              }, {
                default: withCtx(() => [
                  unref(shouldShowError) ? renderSlot(_ctx.$slots, "error", {
                    key: 0,
                    error: validateMessage.value
                  }, () => [
                    createBaseVNode("div", {
                      class: normalizeClass(unref(validateClasses))
                    }, toDisplayString(validateMessage.value), 3)
                  ]) : createCommentVNode("v-if", true)
                ]),
                _: 3
              }, 8, ["name"])
            ], 6)
          ], 10, ["role", "aria-labelledby"]);
        };
      }
    });
    var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__file", "form-item.vue"]]);
    const ElForm = withInstall(Form, {
      FormItem
    });
    const ElFormItem = withNoopInstall(FormItem);
    const imageViewerProps = buildProps({
      urlList: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      zIndex: {
        type: Number
      },
      initialIndex: {
        type: Number,
        default: 0
      },
      infinite: {
        type: Boolean,
        default: true
      },
      hideOnClickModal: Boolean,
      teleported: Boolean,
      closeOnPressEscape: {
        type: Boolean,
        default: true
      },
      zoomRate: {
        type: Number,
        default: 1.2
      },
      minScale: {
        type: Number,
        default: 0.2
      },
      maxScale: {
        type: Number,
        default: 7
      },
      showProgress: {
        type: Boolean,
        default: false
      },
      crossorigin: {
        type: definePropType(String)
      }
    });
    const imageViewerEmits = {
      close: () => true,
      switch: (index) => isNumber$2(index),
      rotate: (deg2) => isNumber$2(deg2)
    };
    const __default__$Z = /* @__PURE__ */ defineComponent({
      name: "ElImageViewer"
    });
    const _sfc_main$1j = /* @__PURE__ */ defineComponent({
      ...__default__$Z,
      props: imageViewerProps,
      emits: imageViewerEmits,
      setup(__props, { expose, emit: emit2 }) {
        var _a2;
        const props2 = __props;
        const modes = {
          CONTAIN: {
            name: "contain",
            icon: markRaw(full_screen_default)
          },
          ORIGINAL: {
            name: "original",
            icon: markRaw(scale_to_original_default)
          }
        };
        let stopWheelListener;
        let prevOverflow = "";
        const { t } = useLocale();
        const ns = useNamespace("image-viewer");
        const { nextZIndex } = useZIndex();
        const wrapper = ref();
        const imgRefs = ref([]);
        const scopeEventListener = effectScope();
        const loading = ref(true);
        const activeIndex = ref(props2.initialIndex);
        const mode = shallowRef(modes.CONTAIN);
        const transform2 = ref({
          scale: 1,
          deg: 0,
          offsetX: 0,
          offsetY: 0,
          enableTransition: false
        });
        const zIndex2 = ref((_a2 = props2.zIndex) != null ? _a2 : nextZIndex());
        const isSingle = computed(() => {
          const { urlList } = props2;
          return urlList.length <= 1;
        });
        const isFirst = computed(() => activeIndex.value === 0);
        const isLast = computed(() => activeIndex.value === props2.urlList.length - 1);
        const currentImg = computed(() => props2.urlList[activeIndex.value]);
        const arrowPrevKls = computed(() => [
          ns.e("btn"),
          ns.e("prev"),
          ns.is("disabled", !props2.infinite && isFirst.value)
        ]);
        const arrowNextKls = computed(() => [
          ns.e("btn"),
          ns.e("next"),
          ns.is("disabled", !props2.infinite && isLast.value)
        ]);
        const imgStyle = computed(() => {
          const { scale: scale2, deg: deg2, offsetX, offsetY, enableTransition } = transform2.value;
          let translateX = offsetX / scale2;
          let translateY = offsetY / scale2;
          const radian = deg2 * Math.PI / 180;
          const cosRadian = Math.cos(radian);
          const sinRadian = Math.sin(radian);
          translateX = translateX * cosRadian + translateY * sinRadian;
          translateY = translateY * cosRadian - offsetX / scale2 * sinRadian;
          const style = {
            transform: `scale(${scale2}) rotate(${deg2}deg) translate(${translateX}px, ${translateY}px)`,
            transition: enableTransition ? "transform .3s" : ""
          };
          if (mode.value.name === modes.CONTAIN.name) {
            style.maxWidth = style.maxHeight = "100%";
          }
          return style;
        });
        const progress = computed(() => `${activeIndex.value + 1} / ${props2.urlList.length}`);
        function hide() {
          unregisterEventListener();
          stopWheelListener == null ? void 0 : stopWheelListener();
          document.body.style.overflow = prevOverflow;
          emit2("close");
        }
        function registerEventListener() {
          const keydownHandler = throttle$2((e2) => {
            switch (e2.code) {
              case EVENT_CODE.esc:
                props2.closeOnPressEscape && hide();
                break;
              case EVENT_CODE.space:
                toggleMode();
                break;
              case EVENT_CODE.left:
                prev();
                break;
              case EVENT_CODE.up:
                handleActions("zoomIn");
                break;
              case EVENT_CODE.right:
                next();
                break;
              case EVENT_CODE.down:
                handleActions("zoomOut");
                break;
            }
          });
          const mousewheelHandler = throttle$2((e2) => {
            const delta = e2.deltaY || e2.deltaX;
            handleActions(delta < 0 ? "zoomIn" : "zoomOut", {
              zoomRate: props2.zoomRate,
              enableTransition: false
            });
          });
          scopeEventListener.run(() => {
            useEventListener(document, "keydown", keydownHandler);
            useEventListener(document, "wheel", mousewheelHandler);
          });
        }
        function unregisterEventListener() {
          scopeEventListener.stop();
        }
        function handleImgLoad() {
          loading.value = false;
        }
        function handleImgError(e2) {
          loading.value = false;
          e2.target.alt = t("el.image.error");
        }
        function handleMouseDown(e2) {
          if (loading.value || e2.button !== 0 || !wrapper.value)
            return;
          transform2.value.enableTransition = false;
          const { offsetX, offsetY } = transform2.value;
          const startX = e2.pageX;
          const startY = e2.pageY;
          const dragHandler = throttle$2((ev) => {
            transform2.value = {
              ...transform2.value,
              offsetX: offsetX + ev.pageX - startX,
              offsetY: offsetY + ev.pageY - startY
            };
          });
          const removeMousemove = useEventListener(document, "mousemove", dragHandler);
          useEventListener(document, "mouseup", () => {
            removeMousemove();
          });
          e2.preventDefault();
        }
        function reset() {
          transform2.value = {
            scale: 1,
            deg: 0,
            offsetX: 0,
            offsetY: 0,
            enableTransition: false
          };
        }
        function toggleMode() {
          if (loading.value)
            return;
          const modeNames = keysOf(modes);
          const modeValues = Object.values(modes);
          const currentMode = mode.value.name;
          const index = modeValues.findIndex((i2) => i2.name === currentMode);
          const nextIndex = (index + 1) % modeNames.length;
          mode.value = modes[modeNames[nextIndex]];
          reset();
        }
        function setActiveItem(index) {
          const len2 = props2.urlList.length;
          activeIndex.value = (index + len2) % len2;
        }
        function prev() {
          if (isFirst.value && !props2.infinite)
            return;
          setActiveItem(activeIndex.value - 1);
        }
        function next() {
          if (isLast.value && !props2.infinite)
            return;
          setActiveItem(activeIndex.value + 1);
        }
        function handleActions(action, options = {}) {
          if (loading.value)
            return;
          const { minScale, maxScale } = props2;
          const { zoomRate, rotateDeg, enableTransition } = {
            zoomRate: props2.zoomRate,
            rotateDeg: 90,
            enableTransition: true,
            ...options
          };
          switch (action) {
            case "zoomOut":
              if (transform2.value.scale > minScale) {
                transform2.value.scale = Number.parseFloat((transform2.value.scale / zoomRate).toFixed(3));
              }
              break;
            case "zoomIn":
              if (transform2.value.scale < maxScale) {
                transform2.value.scale = Number.parseFloat((transform2.value.scale * zoomRate).toFixed(3));
              }
              break;
            case "clockwise":
              transform2.value.deg += rotateDeg;
              emit2("rotate", transform2.value.deg);
              break;
            case "anticlockwise":
              transform2.value.deg -= rotateDeg;
              emit2("rotate", transform2.value.deg);
              break;
          }
          transform2.value.enableTransition = enableTransition;
        }
        function onFocusoutPrevented(event) {
          var _a22;
          if (((_a22 = event.detail) == null ? void 0 : _a22.focusReason) === "pointer") {
            event.preventDefault();
          }
        }
        function onCloseRequested() {
          if (props2.closeOnPressEscape) {
            hide();
          }
        }
        function wheelHandler(e2) {
          if (!e2.ctrlKey)
            return;
          if (e2.deltaY < 0) {
            e2.preventDefault();
            return false;
          } else if (e2.deltaY > 0) {
            e2.preventDefault();
            return false;
          }
        }
        watch(currentImg, () => {
          nextTick(() => {
            const $img = imgRefs.value[0];
            if (!($img == null ? void 0 : $img.complete)) {
              loading.value = true;
            }
          });
        });
        watch(activeIndex, (val) => {
          reset();
          emit2("switch", val);
        });
        onMounted(() => {
          registerEventListener();
          stopWheelListener = useEventListener("wheel", wheelHandler, {
            passive: false
          });
          prevOverflow = document.body.style.overflow;
          document.body.style.overflow = "hidden";
        });
        expose({
          setActiveItem
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTeleport), {
            to: "body",
            disabled: !_ctx.teleported
          }, {
            default: withCtx(() => [
              createVNode$1(Transition, {
                name: "viewer-fade",
                appear: ""
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", {
                    ref_key: "wrapper",
                    ref: wrapper,
                    tabindex: -1,
                    class: normalizeClass(unref(ns).e("wrapper")),
                    style: normalizeStyle$1({ zIndex: zIndex2.value })
                  }, [
                    createVNode$1(unref(ElFocusTrap), {
                      loop: "",
                      trapped: "",
                      "focus-trap-el": wrapper.value,
                      "focus-start-el": "container",
                      onFocusoutPrevented,
                      onReleaseRequested: onCloseRequested
                    }, {
                      default: withCtx(() => [
                        createBaseVNode("div", {
                          class: normalizeClass(unref(ns).e("mask")),
                          onClick: withModifiers(($event) => _ctx.hideOnClickModal && hide(), ["self"])
                        }, null, 10, ["onClick"]),
                        createCommentVNode(" CLOSE "),
                        createBaseVNode("span", {
                          class: normalizeClass([unref(ns).e("btn"), unref(ns).e("close")]),
                          onClick: hide
                        }, [
                          createVNode$1(unref(ElIcon), null, {
                            default: withCtx(() => [
                              createVNode$1(unref(close_default))
                            ]),
                            _: 1
                          })
                        ], 2),
                        createCommentVNode(" ARROW "),
                        !unref(isSingle) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                          createBaseVNode("span", {
                            class: normalizeClass(unref(arrowPrevKls)),
                            onClick: prev
                          }, [
                            createVNode$1(unref(ElIcon), null, {
                              default: withCtx(() => [
                                createVNode$1(unref(arrow_left_default))
                              ]),
                              _: 1
                            })
                          ], 2),
                          createBaseVNode("span", {
                            class: normalizeClass(unref(arrowNextKls)),
                            onClick: next
                          }, [
                            createVNode$1(unref(ElIcon), null, {
                              default: withCtx(() => [
                                createVNode$1(unref(arrow_right_default))
                              ]),
                              _: 1
                            })
                          ], 2)
                        ], 64)) : createCommentVNode("v-if", true),
                        _ctx.$slots.progress || _ctx.showProgress ? (openBlock(), createElementBlock("div", {
                          key: 1,
                          class: normalizeClass([unref(ns).e("btn"), unref(ns).e("progress")])
                        }, [
                          renderSlot(_ctx.$slots, "progress", {
                            activeIndex: activeIndex.value,
                            total: _ctx.urlList.length
                          }, () => [
                            createTextVNode(toDisplayString(unref(progress)), 1)
                          ])
                        ], 2)) : createCommentVNode("v-if", true),
                        createCommentVNode(" ACTIONS "),
                        createBaseVNode("div", {
                          class: normalizeClass([unref(ns).e("btn"), unref(ns).e("actions")])
                        }, [
                          createBaseVNode("div", {
                            class: normalizeClass(unref(ns).e("actions__inner"))
                          }, [
                            renderSlot(_ctx.$slots, "toolbar", {
                              actions: handleActions,
                              prev,
                              next,
                              reset: toggleMode,
                              activeIndex: activeIndex.value,
                              setActiveItem
                            }, () => [
                              createVNode$1(unref(ElIcon), {
                                onClick: ($event) => handleActions("zoomOut")
                              }, {
                                default: withCtx(() => [
                                  createVNode$1(unref(zoom_out_default))
                                ]),
                                _: 1
                              }, 8, ["onClick"]),
                              createVNode$1(unref(ElIcon), {
                                onClick: ($event) => handleActions("zoomIn")
                              }, {
                                default: withCtx(() => [
                                  createVNode$1(unref(zoom_in_default))
                                ]),
                                _: 1
                              }, 8, ["onClick"]),
                              createBaseVNode("i", {
                                class: normalizeClass(unref(ns).e("actions__divider"))
                              }, null, 2),
                              createVNode$1(unref(ElIcon), { onClick: toggleMode }, {
                                default: withCtx(() => [
                                  (openBlock(), createBlock(resolveDynamicComponent(unref(mode).icon)))
                                ]),
                                _: 1
                              }),
                              createBaseVNode("i", {
                                class: normalizeClass(unref(ns).e("actions__divider"))
                              }, null, 2),
                              createVNode$1(unref(ElIcon), {
                                onClick: ($event) => handleActions("anticlockwise")
                              }, {
                                default: withCtx(() => [
                                  createVNode$1(unref(refresh_left_default))
                                ]),
                                _: 1
                              }, 8, ["onClick"]),
                              createVNode$1(unref(ElIcon), {
                                onClick: ($event) => handleActions("clockwise")
                              }, {
                                default: withCtx(() => [
                                  createVNode$1(unref(refresh_right_default))
                                ]),
                                _: 1
                              }, 8, ["onClick"])
                            ])
                          ], 2)
                        ], 2),
                        createCommentVNode(" CANVAS "),
                        createBaseVNode("div", {
                          class: normalizeClass(unref(ns).e("canvas"))
                        }, [
                          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.urlList, (url, i2) => {
                            return withDirectives((openBlock(), createElementBlock("img", {
                              ref_for: true,
                              ref: (el) => imgRefs.value[i2] = el,
                              key: url,
                              src: url,
                              style: normalizeStyle$1(unref(imgStyle)),
                              class: normalizeClass(unref(ns).e("img")),
                              crossorigin: _ctx.crossorigin,
                              onLoad: handleImgLoad,
                              onError: handleImgError,
                              onMousedown: handleMouseDown
                            }, null, 46, ["src", "crossorigin"])), [
                              [vShow, i2 === activeIndex.value]
                            ]);
                          }), 128))
                        ], 2),
                        renderSlot(_ctx.$slots, "default")
                      ]),
                      _: 3
                    }, 8, ["focus-trap-el"])
                  ], 6)
                ]),
                _: 3
              })
            ]),
            _: 3
          }, 8, ["disabled"]);
        };
      }
    });
    var ImageViewer = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__file", "image-viewer.vue"]]);
    const ElImageViewer = withInstall(ImageViewer);
    const imageProps = buildProps({
      hideOnClickModal: Boolean,
      src: {
        type: String,
        default: ""
      },
      fit: {
        type: String,
        values: ["", "contain", "cover", "fill", "none", "scale-down"],
        default: ""
      },
      loading: {
        type: String,
        values: ["eager", "lazy"]
      },
      lazy: Boolean,
      scrollContainer: {
        type: definePropType([String, Object])
      },
      previewSrcList: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      previewTeleported: Boolean,
      zIndex: {
        type: Number
      },
      initialIndex: {
        type: Number,
        default: 0
      },
      infinite: {
        type: Boolean,
        default: true
      },
      closeOnPressEscape: {
        type: Boolean,
        default: true
      },
      zoomRate: {
        type: Number,
        default: 1.2
      },
      minScale: {
        type: Number,
        default: 0.2
      },
      maxScale: {
        type: Number,
        default: 7
      },
      showProgress: {
        type: Boolean,
        default: false
      },
      crossorigin: {
        type: definePropType(String)
      }
    });
    const imageEmits = {
      load: (evt) => evt instanceof Event,
      error: (evt) => evt instanceof Event,
      switch: (val) => isNumber$2(val),
      close: () => true,
      show: () => true
    };
    const __default__$Y = /* @__PURE__ */ defineComponent({
      name: "ElImage",
      inheritAttrs: false
    });
    const _sfc_main$1i = /* @__PURE__ */ defineComponent({
      ...__default__$Y,
      props: imageProps,
      emits: imageEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("image");
        const rawAttrs = useAttrs$1();
        const containerAttrs = computed(() => {
          return fromPairs(Object.entries(rawAttrs).filter(([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)));
        });
        const imgAttrs = useAttrs({
          excludeListeners: true,
          excludeKeys: computed(() => {
            return Object.keys(containerAttrs.value);
          })
        });
        const imageSrc = ref();
        const hasLoadError = ref(false);
        const isLoading = ref(true);
        const showViewer = ref(false);
        const container = ref();
        const _scrollContainer = ref();
        const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
        let stopScrollListener;
        const imageKls = computed(() => [
          ns.e("inner"),
          preview.value && ns.e("preview"),
          isLoading.value && ns.is("loading")
        ]);
        const imageStyle = computed(() => {
          const { fit } = props2;
          if (isClient && fit) {
            return { objectFit: fit };
          }
          return {};
        });
        const preview = computed(() => {
          const { previewSrcList } = props2;
          return isArray$5(previewSrcList) && previewSrcList.length > 0;
        });
        const imageIndex = computed(() => {
          const { previewSrcList, initialIndex } = props2;
          let previewIndex = initialIndex;
          if (initialIndex > previewSrcList.length - 1) {
            previewIndex = 0;
          }
          return previewIndex;
        });
        const isManual = computed(() => {
          if (props2.loading === "eager")
            return false;
          return !supportLoading && props2.loading === "lazy" || props2.lazy;
        });
        const loadImage = () => {
          if (!isClient)
            return;
          isLoading.value = true;
          hasLoadError.value = false;
          imageSrc.value = props2.src;
        };
        function handleLoad(event) {
          isLoading.value = false;
          hasLoadError.value = false;
          emit2("load", event);
        }
        function handleError2(event) {
          isLoading.value = false;
          hasLoadError.value = true;
          emit2("error", event);
        }
        function handleLazyLoad() {
          if (isInContainer(container.value, _scrollContainer.value)) {
            loadImage();
            removeLazyLoadListener();
          }
        }
        const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true);
        async function addLazyLoadListener() {
          var _a2;
          if (!isClient)
            return;
          await nextTick();
          const { scrollContainer } = props2;
          if (isElement$1(scrollContainer)) {
            _scrollContainer.value = scrollContainer;
          } else if (isString$3(scrollContainer) && scrollContainer !== "") {
            _scrollContainer.value = (_a2 = document.querySelector(scrollContainer)) != null ? _a2 : void 0;
          } else if (container.value) {
            _scrollContainer.value = getScrollContainer(container.value);
          }
          if (_scrollContainer.value) {
            stopScrollListener = useEventListener(_scrollContainer, "scroll", lazyLoadHandler);
            setTimeout(() => handleLazyLoad(), 100);
          }
        }
        function removeLazyLoadListener() {
          if (!isClient || !_scrollContainer.value || !lazyLoadHandler)
            return;
          stopScrollListener == null ? void 0 : stopScrollListener();
          _scrollContainer.value = void 0;
        }
        function clickHandler() {
          if (!preview.value)
            return;
          showViewer.value = true;
          emit2("show");
        }
        function closeViewer() {
          showViewer.value = false;
          emit2("close");
        }
        function switchViewer(val) {
          emit2("switch", val);
        }
        watch(() => props2.src, () => {
          if (isManual.value) {
            isLoading.value = true;
            hasLoadError.value = false;
            removeLazyLoadListener();
            addLazyLoadListener();
          } else {
            loadImage();
          }
        });
        onMounted(() => {
          if (isManual.value) {
            addLazyLoadListener();
          } else {
            loadImage();
          }
        });
        expose({
          showPreview: clickHandler
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", mergeProps({
            ref_key: "container",
            ref: container
          }, unref(containerAttrs), {
            class: [unref(ns).b(), _ctx.$attrs.class]
          }), [
            hasLoadError.value ? renderSlot(_ctx.$slots, "error", { key: 0 }, () => [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("error"))
              }, toDisplayString(unref(t)("el.image.error")), 3)
            ]) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
              imageSrc.value !== void 0 ? (openBlock(), createElementBlock("img", mergeProps({ key: 0 }, unref(imgAttrs), {
                src: imageSrc.value,
                loading: _ctx.loading,
                style: unref(imageStyle),
                class: unref(imageKls),
                crossorigin: _ctx.crossorigin,
                onClick: clickHandler,
                onLoad: handleLoad,
                onError: handleError2
              }), null, 16, ["src", "loading", "crossorigin"])) : createCommentVNode("v-if", true),
              isLoading.value ? (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass(unref(ns).e("wrapper"))
              }, [
                renderSlot(_ctx.$slots, "placeholder", {}, () => [
                  createBaseVNode("div", {
                    class: normalizeClass(unref(ns).e("placeholder"))
                  }, null, 2)
                ])
              ], 2)) : createCommentVNode("v-if", true)
            ], 64)),
            unref(preview) ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
              showViewer.value ? (openBlock(), createBlock(unref(ElImageViewer), {
                key: 0,
                "z-index": _ctx.zIndex,
                "initial-index": unref(imageIndex),
                infinite: _ctx.infinite,
                "zoom-rate": _ctx.zoomRate,
                "min-scale": _ctx.minScale,
                "max-scale": _ctx.maxScale,
                "show-progress": _ctx.showProgress,
                "url-list": _ctx.previewSrcList,
                crossorigin: _ctx.crossorigin,
                "hide-on-click-modal": _ctx.hideOnClickModal,
                teleported: _ctx.previewTeleported,
                "close-on-press-escape": _ctx.closeOnPressEscape,
                onClose: closeViewer,
                onSwitch: switchViewer
              }, createSlots({
                toolbar: withCtx((toolbar) => [
                  renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(toolbar)))
                ]),
                default: withCtx(() => [
                  _ctx.$slots.viewer ? (openBlock(), createElementBlock("div", { key: 0 }, [
                    renderSlot(_ctx.$slots, "viewer")
                  ])) : createCommentVNode("v-if", true)
                ]),
                _: 2
              }, [
                _ctx.$slots.progress ? {
                  name: "progress",
                  fn: withCtx((progress) => [
                    renderSlot(_ctx.$slots, "progress", normalizeProps(guardReactiveProps(progress)))
                  ])
                } : void 0
              ]), 1032, ["z-index", "initial-index", "infinite", "zoom-rate", "min-scale", "max-scale", "show-progress", "url-list", "crossorigin", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : createCommentVNode("v-if", true)
            ], 64)) : createCommentVNode("v-if", true)
          ], 16);
        };
      }
    });
    var Image$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__file", "image.vue"]]);
    const ElImage = withInstall(Image$1);
    const inputNumberProps = buildProps({
      id: {
        type: String,
        default: void 0
      },
      step: {
        type: Number,
        default: 1
      },
      stepStrictly: Boolean,
      max: {
        type: Number,
        default: Number.POSITIVE_INFINITY
      },
      min: {
        type: Number,
        default: Number.NEGATIVE_INFINITY
      },
      modelValue: Number,
      readonly: Boolean,
      disabled: Boolean,
      size: useSizeProp,
      controls: {
        type: Boolean,
        default: true
      },
      controlsPosition: {
        type: String,
        default: "",
        values: ["", "right"]
      },
      valueOnClear: {
        type: [String, Number, null],
        validator: (val) => val === null || isNumber$2(val) || ["min", "max"].includes(val),
        default: null
      },
      name: String,
      placeholder: String,
      precision: {
        type: Number,
        validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaLabel"])
    });
    const inputNumberEmits = {
      [CHANGE_EVENT]: (cur, prev) => prev !== cur,
      blur: (e2) => e2 instanceof FocusEvent,
      focus: (e2) => e2 instanceof FocusEvent,
      [INPUT_EVENT]: (val) => isNumber$2(val) || isNil(val),
      [UPDATE_MODEL_EVENT]: (val) => isNumber$2(val) || isNil(val)
    };
    const __default__$X = /* @__PURE__ */ defineComponent({
      name: "ElInputNumber"
    });
    const _sfc_main$1h = /* @__PURE__ */ defineComponent({
      ...__default__$X,
      props: inputNumberProps,
      emits: inputNumberEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("input-number");
        const input = ref();
        const data = reactive({
          currentValue: props2.modelValue,
          userInput: null
        });
        const { formItem } = useFormItem();
        const minDisabled = computed(() => isNumber$2(props2.modelValue) && props2.modelValue <= props2.min);
        const maxDisabled = computed(() => isNumber$2(props2.modelValue) && props2.modelValue >= props2.max);
        const numPrecision = computed(() => {
          const stepPrecision = getPrecision2(props2.step);
          if (!isUndefined$1(props2.precision)) {
            if (stepPrecision > props2.precision) ;
            return props2.precision;
          } else {
            return Math.max(getPrecision2(props2.modelValue), stepPrecision);
          }
        });
        const controlsAtRight = computed(() => {
          return props2.controls && props2.controlsPosition === "right";
        });
        const inputNumberSize = useFormSize();
        const inputNumberDisabled = useFormDisabled();
        const displayValue = computed(() => {
          if (data.userInput !== null) {
            return data.userInput;
          }
          let currentValue = data.currentValue;
          if (isNil(currentValue))
            return "";
          if (isNumber$2(currentValue)) {
            if (Number.isNaN(currentValue))
              return "";
            if (!isUndefined$1(props2.precision)) {
              currentValue = currentValue.toFixed(props2.precision);
            }
          }
          return currentValue;
        });
        const toPrecision = (num, pre) => {
          if (isUndefined$1(pre))
            pre = numPrecision.value;
          if (pre === 0)
            return Math.round(num);
          let snum = String(num);
          const pointPos = snum.indexOf(".");
          if (pointPos === -1)
            return num;
          const nums = snum.replace(".", "").split("");
          const datum = nums[pointPos + pre];
          if (!datum)
            return num;
          const length = snum.length;
          if (snum.charAt(length - 1) === "5") {
            snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
          }
          return Number.parseFloat(Number(snum).toFixed(pre));
        };
        const getPrecision2 = (value) => {
          if (isNil(value))
            return 0;
          const valueString = value.toString();
          const dotPosition = valueString.indexOf(".");
          let precision = 0;
          if (dotPosition !== -1) {
            precision = valueString.length - dotPosition - 1;
          }
          return precision;
        };
        const ensurePrecision = (val, coefficient = 1) => {
          if (!isNumber$2(val))
            return data.currentValue;
          return toPrecision(val + props2.step * coefficient);
        };
        const increase = () => {
          if (props2.readonly || inputNumberDisabled.value || maxDisabled.value)
            return;
          const value = Number(displayValue.value) || 0;
          const newVal = ensurePrecision(value);
          setCurrentValue(newVal);
          emit2(INPUT_EVENT, data.currentValue);
          setCurrentValueToModelValue();
        };
        const decrease = () => {
          if (props2.readonly || inputNumberDisabled.value || minDisabled.value)
            return;
          const value = Number(displayValue.value) || 0;
          const newVal = ensurePrecision(value, -1);
          setCurrentValue(newVal);
          emit2(INPUT_EVENT, data.currentValue);
          setCurrentValueToModelValue();
        };
        const verifyValue = (value, update) => {
          const { max: max3, min: min3, step, precision, stepStrictly, valueOnClear } = props2;
          if (max3 < min3) {
            throwError$1("InputNumber", "min should not be greater than max.");
          }
          let newVal = Number(value);
          if (isNil(value) || Number.isNaN(newVal)) {
            return null;
          }
          if (value === "") {
            if (valueOnClear === null) {
              return null;
            }
            newVal = isString$3(valueOnClear) ? { min: min3, max: max3 }[valueOnClear] : valueOnClear;
          }
          if (stepStrictly) {
            newVal = toPrecision(Math.round(newVal / step) * step, precision);
            if (newVal !== value) {
              update && emit2(UPDATE_MODEL_EVENT, newVal);
            }
          }
          if (!isUndefined$1(precision)) {
            newVal = toPrecision(newVal, precision);
          }
          if (newVal > max3 || newVal < min3) {
            newVal = newVal > max3 ? max3 : min3;
            update && emit2(UPDATE_MODEL_EVENT, newVal);
          }
          return newVal;
        };
        const setCurrentValue = (value, emitChange = true) => {
          var _a2;
          const oldVal = data.currentValue;
          const newVal = verifyValue(value);
          if (!emitChange) {
            emit2(UPDATE_MODEL_EVENT, newVal);
            return;
          }
          if (oldVal === newVal && value)
            return;
          data.userInput = null;
          emit2(UPDATE_MODEL_EVENT, newVal);
          if (oldVal !== newVal) {
            emit2(CHANGE_EVENT, newVal, oldVal);
          }
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
          }
          data.currentValue = newVal;
        };
        const handleInput = (value) => {
          data.userInput = value;
          const newVal = value === "" ? null : Number(value);
          emit2(INPUT_EVENT, newVal);
          setCurrentValue(newVal, false);
        };
        const handleInputChange = (value) => {
          const newVal = value !== "" ? Number(value) : "";
          if (isNumber$2(newVal) && !Number.isNaN(newVal) || value === "") {
            setCurrentValue(newVal);
          }
          setCurrentValueToModelValue();
          data.userInput = null;
        };
        const focus = () => {
          var _a2, _b2;
          (_b2 = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
        };
        const blur = () => {
          var _a2, _b2;
          (_b2 = (_a2 = input.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b2.call(_a2);
        };
        const handleFocus = (event) => {
          emit2("focus", event);
        };
        const handleBlur = (event) => {
          var _a2, _b2;
          data.userInput = null;
          if (isFirefox() && data.currentValue === null && ((_a2 = input.value) == null ? void 0 : _a2.input)) {
            input.value.input.value = "";
          }
          emit2("blur", event);
          if (props2.validateEvent) {
            (_b2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _b2.call(formItem, "blur").catch((err) => debugWarn());
          }
        };
        const setCurrentValueToModelValue = () => {
          if (data.currentValue !== props2.modelValue) {
            data.currentValue = props2.modelValue;
          }
        };
        const handleWheel = (e2) => {
          if (document.activeElement === e2.target)
            e2.preventDefault();
        };
        watch(() => props2.modelValue, (value, oldValue) => {
          const newValue = verifyValue(value, true);
          if (data.userInput === null && newValue !== oldValue) {
            data.currentValue = newValue;
          }
        }, { immediate: true });
        onMounted(() => {
          var _a2;
          const { min: min3, max: max3, modelValue } = props2;
          const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
          innerInput.setAttribute("role", "spinbutton");
          if (Number.isFinite(max3)) {
            innerInput.setAttribute("aria-valuemax", String(max3));
          } else {
            innerInput.removeAttribute("aria-valuemax");
          }
          if (Number.isFinite(min3)) {
            innerInput.setAttribute("aria-valuemin", String(min3));
          } else {
            innerInput.removeAttribute("aria-valuemin");
          }
          innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
          innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
          if (!isNumber$2(modelValue) && modelValue != null) {
            let val = Number(modelValue);
            if (Number.isNaN(val)) {
              val = null;
            }
            emit2(UPDATE_MODEL_EVENT, val);
          }
          innerInput.addEventListener("wheel", handleWheel, { passive: false });
        });
        onUpdated(() => {
          var _a2, _b2;
          const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
          innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b2 = data.currentValue) != null ? _b2 : ""}`);
        });
        expose({
          focus,
          blur
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ns).b(),
              unref(ns).m(unref(inputNumberSize)),
              unref(ns).is("disabled", unref(inputNumberDisabled)),
              unref(ns).is("without-controls", !_ctx.controls),
              unref(ns).is("controls-right", unref(controlsAtRight))
            ]),
            onDragstart: withModifiers(() => {
            }, ["prevent"])
          }, [
            _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
              key: 0,
              role: "button",
              "aria-label": unref(t)("el.inputNumber.decrease"),
              class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
              onKeydown: withKeys(decrease, ["enter"])
            }, [
              renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
                createVNode$1(unref(ElIcon), null, {
                  default: withCtx(() => [
                    unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))
                  ]),
                  _: 1
                })
              ])
            ], 42, ["aria-label", "onKeydown"])), [
              [unref(vRepeatClick), decrease]
            ]) : createCommentVNode("v-if", true),
            _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
              key: 1,
              role: "button",
              "aria-label": unref(t)("el.inputNumber.increase"),
              class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
              onKeydown: withKeys(increase, ["enter"])
            }, [
              renderSlot(_ctx.$slots, "increase-icon", {}, () => [
                createVNode$1(unref(ElIcon), null, {
                  default: withCtx(() => [
                    unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))
                  ]),
                  _: 1
                })
              ])
            ], 42, ["aria-label", "onKeydown"])), [
              [unref(vRepeatClick), increase]
            ]) : createCommentVNode("v-if", true),
            createVNode$1(unref(ElInput), {
              id: _ctx.id,
              ref_key: "input",
              ref: input,
              type: "number",
              step: _ctx.step,
              "model-value": unref(displayValue),
              placeholder: _ctx.placeholder,
              readonly: _ctx.readonly,
              disabled: unref(inputNumberDisabled),
              size: unref(inputNumberSize),
              max: _ctx.max,
              min: _ctx.min,
              name: _ctx.name,
              "aria-label": _ctx.ariaLabel,
              "validate-event": false,
              onKeydown: [
                withKeys(withModifiers(increase, ["prevent"]), ["up"]),
                withKeys(withModifiers(decrease, ["prevent"]), ["down"])
              ],
              onBlur: handleBlur,
              onFocus: handleFocus,
              onInput: handleInput,
              onChange: handleInputChange
            }, createSlots({
              _: 2
            }, [
              _ctx.$slots.prefix ? {
                name: "prefix",
                fn: withCtx(() => [
                  renderSlot(_ctx.$slots, "prefix")
                ])
              } : void 0,
              _ctx.$slots.suffix ? {
                name: "suffix",
                fn: withCtx(() => [
                  renderSlot(_ctx.$slots, "suffix")
                ])
              } : void 0
            ]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
          ], 42, ["onDragstart"]);
        };
      }
    });
    var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__file", "input-number.vue"]]);
    const ElInputNumber = withInstall(InputNumber);
    const inputTagProps = buildProps({
      modelValue: {
        type: definePropType(Array)
      },
      max: Number,
      tagType: { ...tagProps.type, default: "info" },
      tagEffect: tagProps.effect,
      trigger: {
        type: definePropType(String),
        default: EVENT_CODE.enter
      },
      draggable: {
        type: Boolean,
        default: false
      },
      delimiter: {
        type: [String, RegExp],
        default: ""
      },
      size: useSizeProp,
      clearable: Boolean,
      disabled: {
        type: Boolean,
        default: void 0
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      readonly: Boolean,
      autofocus: Boolean,
      id: {
        type: String,
        default: void 0
      },
      tabindex: {
        type: [String, Number],
        default: 0
      },
      maxlength: {
        type: [String, Number]
      },
      minlength: {
        type: [String, Number]
      },
      placeholder: String,
      autocomplete: {
        type: String,
        default: "off"
      },
      saveOnBlur: {
        type: Boolean,
        default: true
      },
      ariaLabel: String
    });
    const inputTagEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isArray$5(value) || isUndefined$1(value),
      [CHANGE_EVENT]: (value) => isArray$5(value) || isUndefined$1(value),
      [INPUT_EVENT]: (value) => isString$3(value),
      "add-tag": (value) => isString$3(value),
      "remove-tag": (value) => isString$3(value),
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent,
      clear: () => true
    };
    function useInputTag({ props: props2, emit: emit2, formItem }) {
      const disabled = useFormDisabled();
      const size = useFormSize();
      const inputRef = shallowRef();
      const inputValue = ref();
      const tagSize = computed(() => {
        return ["small"].includes(size.value) ? "small" : "default";
      });
      const placeholder = computed(() => {
        var _a2;
        return ((_a2 = props2.modelValue) == null ? void 0 : _a2.length) ? void 0 : props2.placeholder;
      });
      const closable = computed(() => !(props2.readonly || disabled.value));
      const inputLimit = computed(() => {
        var _a2, _b2;
        return isUndefined$1(props2.max) ? false : ((_b2 = (_a2 = props2.modelValue) == null ? void 0 : _a2.length) != null ? _b2 : 0) >= props2.max;
      });
      const handleInput = (event) => {
        var _a2, _b2;
        if (inputLimit.value) {
          inputValue.value = void 0;
          return;
        }
        if (isComposing.value)
          return;
        if (props2.delimiter) {
          const replacement = (_a2 = inputValue.value) == null ? void 0 : _a2.replace(props2.delimiter, "");
          if ((replacement == null ? void 0 : replacement.length) !== ((_b2 = inputValue.value) == null ? void 0 : _b2.length)) {
            inputValue.value = replacement;
            handleAddTag();
          }
        }
        emit2(INPUT_EVENT, event.target.value);
      };
      const handleKeydown = (event) => {
        var _a2;
        if (isComposing.value)
          return;
        switch (event.code) {
          case props2.trigger:
            event.preventDefault();
            event.stopPropagation();
            handleAddTag();
            break;
          case EVENT_CODE.numpadEnter:
            if (props2.trigger === EVENT_CODE.enter) {
              event.preventDefault();
              event.stopPropagation();
              handleAddTag();
            }
            break;
          case EVENT_CODE.backspace:
            if (!inputValue.value && ((_a2 = props2.modelValue) == null ? void 0 : _a2.length)) {
              event.preventDefault();
              event.stopPropagation();
              handleRemoveTag(props2.modelValue.length - 1);
            }
            break;
        }
      };
      const handleAddTag = () => {
        var _a2, _b2;
        const value = (_a2 = inputValue.value) == null ? void 0 : _a2.trim();
        if (!value || inputLimit.value)
          return;
        const list = [...(_b2 = props2.modelValue) != null ? _b2 : [], value];
        emit2(UPDATE_MODEL_EVENT, list);
        emit2(CHANGE_EVENT, list);
        emit2("add-tag", value);
        inputValue.value = void 0;
      };
      const handleRemoveTag = (index) => {
        var _a2;
        const value = ((_a2 = props2.modelValue) != null ? _a2 : []).slice();
        const [item] = value.splice(index, 1);
        emit2(UPDATE_MODEL_EVENT, value);
        emit2(CHANGE_EVENT, value);
        emit2("remove-tag", item);
      };
      const handleClear = () => {
        inputValue.value = void 0;
        emit2(UPDATE_MODEL_EVENT, void 0);
        emit2(CHANGE_EVENT, void 0);
        emit2("clear");
      };
      const handleDragged = (draggingIndex, dropIndex, type) => {
        var _a2;
        const value = ((_a2 = props2.modelValue) != null ? _a2 : []).slice();
        const [draggedItem] = value.splice(draggingIndex, 1);
        const step = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0;
        value.splice(dropIndex + step, 0, draggedItem);
        emit2(UPDATE_MODEL_EVENT, value);
        emit2(CHANGE_EVENT, value);
      };
      const focus = () => {
        var _a2;
        (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
      };
      const blur = () => {
        var _a2;
        (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
      };
      const { wrapperRef, isFocused } = useFocusController(inputRef, {
        beforeFocus() {
          return disabled.value;
        },
        afterBlur() {
          var _a2;
          if (props2.saveOnBlur) {
            handleAddTag();
          } else {
            inputValue.value = void 0;
          }
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
          }
        }
      });
      const {
        isComposing,
        handleCompositionStart,
        handleCompositionUpdate,
        handleCompositionEnd
      } = useComposition({ afterComposition: handleInput });
      watch(() => props2.modelValue, () => {
        var _a2;
        if (props2.validateEvent) {
          (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, CHANGE_EVENT).catch((err) => debugWarn());
        }
      });
      return {
        inputRef,
        wrapperRef,
        isFocused,
        isComposing,
        inputValue,
        size,
        tagSize,
        placeholder,
        closable,
        disabled,
        inputLimit,
        handleDragged,
        handleInput,
        handleKeydown,
        handleAddTag,
        handleRemoveTag,
        handleClear,
        handleCompositionStart,
        handleCompositionUpdate,
        handleCompositionEnd,
        focus,
        blur
      };
    }
    function useHovering() {
      const hovering = ref(false);
      const handleMouseEnter = () => {
        hovering.value = true;
      };
      const handleMouseLeave = () => {
        hovering.value = false;
      };
      return {
        hovering,
        handleMouseEnter,
        handleMouseLeave
      };
    }
    function useCalcInputWidth() {
      const calculatorRef = shallowRef();
      const calculatorWidth = ref(0);
      const MINIMUM_INPUT_WIDTH = 11;
      const inputStyle = computed(() => ({
        minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px`
      }));
      const resetCalculatorWidth = () => {
        var _a2, _b2;
        calculatorWidth.value = (_b2 = (_a2 = calculatorRef.value) == null ? void 0 : _a2.getBoundingClientRect().width) != null ? _b2 : 0;
      };
      useResizeObserver(calculatorRef, resetCalculatorWidth);
      return {
        calculatorRef,
        calculatorWidth,
        inputStyle
      };
    }
    function useDragTag({
      wrapperRef,
      handleDragged,
      afterDragged
    }) {
      const ns = useNamespace("input-tag");
      const dropIndicatorRef = shallowRef();
      const showDropIndicator = ref(false);
      let draggingIndex;
      let draggingTag;
      let dropIndex;
      let dropType;
      function getTagClassName(index) {
        return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
      }
      function handleDragStart(event, index) {
        draggingIndex = index;
        draggingTag = wrapperRef.value.querySelector(getTagClassName(index));
        if (draggingTag) {
          draggingTag.style.opacity = "0.5";
        }
        event.dataTransfer.effectAllowed = "move";
      }
      function handleDragOver(event, index) {
        dropIndex = index;
        event.preventDefault();
        event.dataTransfer.dropEffect = "move";
        if (isUndefined$1(draggingIndex) || draggingIndex === index) {
          showDropIndicator.value = false;
          return;
        }
        const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
        const dropPrev = !(draggingIndex + 1 === index);
        const dropNext = !(draggingIndex - 1 === index);
        const distance2 = event.clientX - dropPosition.left;
        const prevPercent = dropPrev ? dropNext ? 0.5 : 1 : -1;
        const nextPercent = dropNext ? dropPrev ? 0.5 : 0 : 1;
        if (distance2 <= dropPosition.width * prevPercent) {
          dropType = "before";
        } else if (distance2 > dropPosition.width * nextPercent) {
          dropType = "after";
        } else {
          dropType = void 0;
        }
        const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`);
        const innerPosition = innerEl.getBoundingClientRect();
        const gap = Number.parseFloat(getStyle$1(innerEl, "gap")) / 2;
        const indicatorTop = dropPosition.top - innerPosition.top;
        let indicatorLeft = -9999;
        if (dropType === "before") {
          indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2));
        } else if (dropType === "after") {
          const left = dropPosition.right - innerPosition.left;
          indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
        }
        setStyle(dropIndicatorRef.value, {
          top: `${indicatorTop}px`,
          left: `${indicatorLeft}px`
        });
        showDropIndicator.value = !!dropType;
      }
      function handleDragEnd2(event) {
        event.preventDefault();
        if (draggingTag) {
          draggingTag.style.opacity = "";
        }
        if (dropType && !isUndefined$1(draggingIndex) && !isUndefined$1(dropIndex) && draggingIndex !== dropIndex) {
          handleDragged(draggingIndex, dropIndex, dropType);
        }
        showDropIndicator.value = false;
        draggingIndex = void 0;
        draggingTag = null;
        dropIndex = void 0;
        dropType = void 0;
        afterDragged == null ? void 0 : afterDragged();
      }
      return {
        dropIndicatorRef,
        showDropIndicator,
        handleDragStart,
        handleDragOver,
        handleDragEnd: handleDragEnd2
      };
    }
    function useInputTagDom({
      props: props2,
      isFocused,
      hovering,
      disabled,
      inputValue,
      size,
      validateState,
      validateIcon,
      needStatusIcon
    }) {
      const attrs = useAttrs$1();
      const slots = useSlots();
      const ns = useNamespace("input-tag");
      const nsInput = useNamespace("input");
      const containerKls = computed(() => [
        ns.b(),
        ns.is("focused", isFocused.value),
        ns.is("hovering", hovering.value),
        ns.is("disabled", disabled.value),
        ns.m(size.value),
        ns.e("wrapper"),
        attrs.class
      ]);
      const containerStyle = computed(() => [attrs.style]);
      const innerKls = computed(() => {
        var _a2, _b2;
        return [
          ns.e("inner"),
          ns.is("draggable", props2.draggable),
          ns.is("left-space", !((_a2 = props2.modelValue) == null ? void 0 : _a2.length) && !slots.prefix),
          ns.is("right-space", !((_b2 = props2.modelValue) == null ? void 0 : _b2.length) && !showSuffix.value)
        ];
      });
      const showClear = computed(() => {
        var _a2;
        return props2.clearable && !disabled.value && !props2.readonly && (((_a2 = props2.modelValue) == null ? void 0 : _a2.length) || inputValue.value) && (isFocused.value || hovering.value);
      });
      const showSuffix = computed(() => {
        return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
      });
      return {
        ns,
        nsInput,
        containerKls,
        containerStyle,
        innerKls,
        showClear,
        showSuffix
      };
    }
    const __default__$W = /* @__PURE__ */ defineComponent({
      name: "ElInputTag",
      inheritAttrs: false
    });
    const _sfc_main$1g = /* @__PURE__ */ defineComponent({
      ...__default__$W,
      props: inputTagProps,
      emits: inputTagEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const attrs = useAttrs();
        const slots = useSlots();
        const { form, formItem } = useFormItem();
        const { inputId } = useFormItemInputId(props2, { formItemContext: formItem });
        const needStatusIcon = computed(() => {
          var _a2;
          return (_a2 = form == null ? void 0 : form.statusIcon) != null ? _a2 : false;
        });
        const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
        const validateIcon = computed(() => {
          return validateState.value && ValidateComponentsMap[validateState.value];
        });
        const {
          inputRef,
          wrapperRef,
          isFocused,
          inputValue,
          size,
          tagSize,
          placeholder,
          closable,
          disabled,
          handleDragged,
          handleInput,
          handleKeydown,
          handleRemoveTag,
          handleClear,
          handleCompositionStart,
          handleCompositionUpdate,
          handleCompositionEnd,
          focus,
          blur
        } = useInputTag({ props: props2, emit: emit2, formItem });
        const { hovering, handleMouseEnter, handleMouseLeave } = useHovering();
        const { calculatorRef, inputStyle } = useCalcInputWidth();
        const {
          dropIndicatorRef,
          showDropIndicator,
          handleDragStart,
          handleDragOver,
          handleDragEnd: handleDragEnd2
        } = useDragTag({ wrapperRef, handleDragged, afterDragged: focus });
        const {
          ns,
          nsInput,
          containerKls,
          containerStyle,
          innerKls,
          showClear,
          showSuffix
        } = useInputTagDom({
          props: props2,
          hovering,
          isFocused,
          inputValue,
          disabled,
          size,
          validateState,
          validateIcon,
          needStatusIcon
        });
        expose({
          focus,
          blur
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "wrapperRef",
            ref: wrapperRef,
            class: normalizeClass(unref(containerKls)),
            style: normalizeStyle$1(unref(containerStyle)),
            onMouseenter: unref(handleMouseEnter),
            onMouseleave: unref(handleMouseLeave)
          }, [
            unref(slots).prefix ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("prefix"))
            }, [
              renderSlot(_ctx.$slots, "prefix")
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(innerKls))
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.modelValue, (item, index) => {
                return openBlock(), createBlock(unref(ElTag), {
                  key: index,
                  size: unref(tagSize),
                  closable: unref(closable),
                  type: _ctx.tagType,
                  effect: _ctx.tagEffect,
                  draggable: unref(closable) && _ctx.draggable,
                  "disable-transitions": "",
                  onClose: ($event) => unref(handleRemoveTag)(index),
                  onDragstart: (event) => unref(handleDragStart)(event, index),
                  onDragover: (event) => unref(handleDragOver)(event, index),
                  onDragend: unref(handleDragEnd2),
                  onDrop: withModifiers(() => {
                  }, ["stop"])
                }, {
                  default: withCtx(() => [
                    renderSlot(_ctx.$slots, "tag", {
                      value: item,
                      index
                    }, () => [
                      createTextVNode(toDisplayString(item), 1)
                    ])
                  ]),
                  _: 2
                }, 1032, ["size", "closable", "type", "effect", "draggable", "onClose", "onDragstart", "onDragover", "onDragend", "onDrop"]);
              }), 128)),
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("input-wrapper"))
              }, [
                withDirectives(createBaseVNode("input", mergeProps({
                  id: unref(inputId),
                  ref_key: "inputRef",
                  ref: inputRef,
                  "onUpdate:modelValue": ($event) => isRef(inputValue) ? inputValue.value = $event : null
                }, unref(attrs), {
                  type: "text",
                  minlength: _ctx.minlength,
                  maxlength: _ctx.maxlength,
                  disabled: unref(disabled),
                  readonly: _ctx.readonly,
                  autocomplete: _ctx.autocomplete,
                  tabindex: _ctx.tabindex,
                  placeholder: unref(placeholder),
                  autofocus: _ctx.autofocus,
                  ariaLabel: _ctx.ariaLabel,
                  class: unref(ns).e("input"),
                  style: unref(inputStyle),
                  onCompositionstart: unref(handleCompositionStart),
                  onCompositionupdate: unref(handleCompositionUpdate),
                  onCompositionend: unref(handleCompositionEnd),
                  onInput: unref(handleInput),
                  onKeydown: unref(handleKeydown)
                }), null, 16, ["id", "onUpdate:modelValue", "minlength", "maxlength", "disabled", "readonly", "autocomplete", "tabindex", "placeholder", "autofocus", "ariaLabel", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onKeydown"]), [
                  [vModelText, unref(inputValue)]
                ]),
                createBaseVNode("span", {
                  ref_key: "calculatorRef",
                  ref: calculatorRef,
                  "aria-hidden": "true",
                  class: normalizeClass(unref(ns).e("input-calculator")),
                  textContent: toDisplayString(unref(inputValue))
                }, null, 10, ["textContent"])
              ], 2),
              withDirectives(createBaseVNode("div", {
                ref_key: "dropIndicatorRef",
                ref: dropIndicatorRef,
                class: normalizeClass(unref(ns).e("drop-indicator"))
              }, null, 2), [
                [vShow, unref(showDropIndicator)]
              ])
            ], 2),
            unref(showSuffix) ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("suffix"))
            }, [
              renderSlot(_ctx.$slots, "suffix"),
              unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
                key: 0,
                class: normalizeClass([unref(ns).e("icon"), unref(ns).e("clear")]),
                onMousedown: withModifiers(unref(NOOP), ["prevent"]),
                onClick: unref(handleClear)
              }, {
                default: withCtx(() => [
                  createVNode$1(unref(circle_close_default))
                ]),
                _: 1
              }, 8, ["class", "onMousedown", "onClick"])) : createCommentVNode("v-if", true),
              unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
                key: 1,
                class: normalizeClass([
                  unref(nsInput).e("icon"),
                  unref(nsInput).e("validateIcon"),
                  unref(nsInput).is("loading", unref(validateState) === "validating")
                ])
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ], 2)) : createCommentVNode("v-if", true)
          ], 46, ["onMouseenter", "onMouseleave"]);
        };
      }
    });
    var InputTag = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__file", "input-tag.vue"]]);
    const ElInputTag = withInstall(InputTag);
    const linkProps = buildProps({
      type: {
        type: String,
        values: ["primary", "success", "warning", "info", "danger", "default"],
        default: "default"
      },
      underline: {
        type: [Boolean, String],
        values: [true, false, "always", "never", "hover"],
        default: "hover"
      },
      disabled: Boolean,
      href: { type: String, default: "" },
      target: {
        type: String,
        default: "_self"
      },
      icon: {
        type: iconPropType
      }
    });
    const linkEmits = {
      click: (evt) => evt instanceof MouseEvent
    };
    const __default__$V = /* @__PURE__ */ defineComponent({
      name: "ElLink"
    });
    const _sfc_main$1f = /* @__PURE__ */ defineComponent({
      ...__default__$V,
      props: linkProps,
      emits: linkEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        useDeprecated({
          scope: "el-link",
          from: "The underline option (boolean)",
          replacement: "'always' | 'hover' | 'never'",
          version: "3.0.0",
          ref: "https://element-plus.org/en-US/component/link.html#underline"
        }, computed(() => isBoolean$1(props2.underline)));
        const ns = useNamespace("link");
        const linkKls = computed(() => [
          ns.b(),
          ns.m(props2.type),
          ns.is("disabled", props2.disabled),
          ns.is("underline", underline.value === "always"),
          ns.is("hover-underline", underline.value === "hover" && !props2.disabled)
        ]);
        const underline = computed(() => {
          if (isBoolean$1(props2.underline)) {
            return props2.underline ? "hover" : "never";
          } else
            return props2.underline;
        });
        function handleClick(event) {
          if (!props2.disabled)
            emit2("click", event);
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("a", {
            class: normalizeClass(unref(linkKls)),
            href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
            target: _ctx.disabled || !_ctx.href ? void 0 : _ctx.target,
            onClick: handleClick
          }, [
            _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
              ]),
              _: 1
            })) : createCommentVNode("v-if", true),
            _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
              key: 1,
              class: normalizeClass(unref(ns).e("inner"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)) : createCommentVNode("v-if", true),
            _ctx.$slots.icon ? renderSlot(_ctx.$slots, "icon", { key: 2 }) : createCommentVNode("v-if", true)
          ], 10, ["href", "target"]);
        };
      }
    });
    var Link = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__file", "link.vue"]]);
    const ElLink = withInstall(Link);
    let SubMenu$1 = class SubMenu {
      constructor(parent2, domNode) {
        this.parent = parent2;
        this.domNode = domNode;
        this.subIndex = 0;
        this.subIndex = 0;
        this.init();
      }
      init() {
        this.subMenuItems = this.domNode.querySelectorAll("li");
        this.addListeners();
      }
      gotoSubIndex(idx) {
        if (idx === this.subMenuItems.length) {
          idx = 0;
        } else if (idx < 0) {
          idx = this.subMenuItems.length - 1;
        }
        this.subMenuItems[idx].focus();
        this.subIndex = idx;
      }
      addListeners() {
        const parentNode2 = this.parent.domNode;
        Array.prototype.forEach.call(this.subMenuItems, (el) => {
          el.addEventListener("keydown", (event) => {
            let prevDef = false;
            switch (event.code) {
              case EVENT_CODE.down: {
                this.gotoSubIndex(this.subIndex + 1);
                prevDef = true;
                break;
              }
              case EVENT_CODE.up: {
                this.gotoSubIndex(this.subIndex - 1);
                prevDef = true;
                break;
              }
              case EVENT_CODE.tab: {
                triggerEvent(parentNode2, "mouseleave");
                break;
              }
              case EVENT_CODE.enter:
              case EVENT_CODE.numpadEnter:
              case EVENT_CODE.space: {
                prevDef = true;
                event.currentTarget.click();
                break;
              }
            }
            if (prevDef) {
              event.preventDefault();
              event.stopPropagation();
            }
            return false;
          });
        });
      }
    };
    let MenuItem$1 = class MenuItem {
      constructor(domNode, namespace) {
        this.domNode = domNode;
        this.submenu = null;
        this.submenu = null;
        this.init(namespace);
      }
      init(namespace) {
        this.domNode.setAttribute("tabindex", "0");
        const menuChild = this.domNode.querySelector(`.${namespace}-menu`);
        if (menuChild) {
          this.submenu = new SubMenu$1(this, menuChild);
        }
        this.addListeners();
      }
      addListeners() {
        this.domNode.addEventListener("keydown", (event) => {
          let prevDef = false;
          switch (event.code) {
            case EVENT_CODE.down: {
              triggerEvent(event.currentTarget, "mouseenter");
              this.submenu && this.submenu.gotoSubIndex(0);
              prevDef = true;
              break;
            }
            case EVENT_CODE.up: {
              triggerEvent(event.currentTarget, "mouseenter");
              this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
              prevDef = true;
              break;
            }
            case EVENT_CODE.tab: {
              triggerEvent(event.currentTarget, "mouseleave");
              break;
            }
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
            case EVENT_CODE.space: {
              prevDef = true;
              event.currentTarget.click();
              break;
            }
          }
          if (prevDef) {
            event.preventDefault();
          }
        });
      }
    };
    let Menu$1 = class Menu {
      constructor(domNode, namespace) {
        this.domNode = domNode;
        this.init(namespace);
      }
      init(namespace) {
        const menuChildren = this.domNode.childNodes;
        Array.from(menuChildren).forEach((child) => {
          if (child.nodeType === 1) {
            new MenuItem$1(child, namespace);
          }
        });
      }
    };
    const __default__$U = /* @__PURE__ */ defineComponent({
      name: "ElMenuCollapseTransition"
    });
    const _sfc_main$1e = /* @__PURE__ */ defineComponent({
      ...__default__$U,
      setup(__props) {
        const ns = useNamespace("menu");
        const listeners = {
          onBeforeEnter: (el) => el.style.opacity = "0.2",
          onEnter(el, done) {
            addClass(el, `${ns.namespace.value}-opacity-transition`);
            el.style.opacity = "1";
            done();
          },
          onAfterEnter(el) {
            removeClass(el, `${ns.namespace.value}-opacity-transition`);
            el.style.opacity = "";
          },
          onBeforeLeave(el) {
            if (!el.dataset)
              el.dataset = {};
            if (hasClass(el, ns.m("collapse"))) {
              removeClass(el, ns.m("collapse"));
              el.dataset.oldOverflow = el.style.overflow;
              el.dataset.scrollWidth = el.clientWidth.toString();
              addClass(el, ns.m("collapse"));
            } else {
              addClass(el, ns.m("collapse"));
              el.dataset.oldOverflow = el.style.overflow;
              el.dataset.scrollWidth = el.clientWidth.toString();
              removeClass(el, ns.m("collapse"));
            }
            el.style.width = `${el.scrollWidth}px`;
            el.style.overflow = "hidden";
          },
          onLeave(el) {
            addClass(el, "horizontal-collapse-transition");
            el.style.width = `${el.dataset.scrollWidth}px`;
          }
        };
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, mergeProps({ mode: "out-in" }, unref(listeners)), {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 16);
        };
      }
    });
    var ElMenuCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__file", "menu-collapse-transition.vue"]]);
    function useMenu(instance, currentIndex) {
      const indexPath = computed(() => {
        let parent2 = instance.parent;
        const path = [currentIndex.value];
        while (parent2.type.name !== "ElMenu") {
          if (parent2.props.index) {
            path.unshift(parent2.props.index);
          }
          parent2 = parent2.parent;
        }
        return path;
      });
      const parentMenu = computed(() => {
        let parent2 = instance.parent;
        while (parent2 && !["ElMenu", "ElSubMenu"].includes(parent2.type.name)) {
          parent2 = parent2.parent;
        }
        return parent2;
      });
      return {
        parentMenu,
        indexPath
      };
    }
    function useMenuColor(props2) {
      const menuBarColor = computed(() => {
        const color2 = props2.backgroundColor;
        return color2 ? new TinyColor(color2).shade(20).toString() : "";
      });
      return menuBarColor;
    }
    const useMenuCssVar = (props2, level) => {
      const ns = useNamespace("menu");
      return computed(() => ns.cssVarBlock({
        "text-color": props2.textColor || "",
        "hover-text-color": props2.textColor || "",
        "bg-color": props2.backgroundColor || "",
        "hover-bg-color": useMenuColor(props2).value || "",
        "active-color": props2.activeTextColor || "",
        level: `${level}`
      }));
    };
    const subMenuProps = buildProps({
      index: {
        type: String,
        required: true
      },
      showTimeout: Number,
      hideTimeout: Number,
      popperClass: String,
      disabled: Boolean,
      teleported: {
        type: Boolean,
        default: void 0
      },
      popperOffset: Number,
      expandCloseIcon: {
        type: iconPropType
      },
      expandOpenIcon: {
        type: iconPropType
      },
      collapseCloseIcon: {
        type: iconPropType
      },
      collapseOpenIcon: {
        type: iconPropType
      }
    });
    const COMPONENT_NAME$c = "ElSubMenu";
    var SubMenu = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$c,
      props: subMenuProps,
      setup(props2, { slots, expose }) {
        const instance = getCurrentInstance();
        const { indexPath, parentMenu } = useMenu(instance, computed(() => props2.index));
        const nsMenu = useNamespace("menu");
        const nsSubMenu = useNamespace("sub-menu");
        const rootMenu = inject("rootMenu");
        if (!rootMenu)
          throwError$1(COMPONENT_NAME$c, "can not inject root menu");
        const subMenu = inject(`subMenu:${parentMenu.value.uid}`);
        if (!subMenu)
          throwError$1(COMPONENT_NAME$c, "can not inject sub menu");
        const items = ref({});
        const subMenus = ref({});
        let timeout;
        const mouseInChild = ref(false);
        const verticalTitleRef = ref();
        const vPopper = ref();
        const currentPlacement = computed(() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start");
        const subMenuTitleIcon = computed(() => {
          return mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse ? props2.expandCloseIcon && props2.expandOpenIcon ? opened.value ? props2.expandOpenIcon : props2.expandCloseIcon : arrow_down_default : props2.collapseCloseIcon && props2.collapseOpenIcon ? opened.value ? props2.collapseOpenIcon : props2.collapseCloseIcon : arrow_right_default;
        });
        const isFirstLevel = computed(() => subMenu.level === 0);
        const appendToBody = computed(() => {
          const value = props2.teleported;
          return isUndefined$1(value) ? isFirstLevel.value : value;
        });
        const menuTransitionName = computed(() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`);
        const fallbackPlacements = computed(() => mode.value === "horizontal" && isFirstLevel.value ? [
          "bottom-start",
          "bottom-end",
          "top-start",
          "top-end",
          "right-start",
          "left-start"
        ] : [
          "right-start",
          "right",
          "right-end",
          "left-start",
          "bottom-start",
          "bottom-end",
          "top-start",
          "top-end"
        ]);
        const opened = computed(() => rootMenu.openedMenus.includes(props2.index));
        const active = computed(() => [...Object.values(items.value), ...Object.values(subMenus.value)].some(({ active: active2 }) => active2));
        const mode = computed(() => rootMenu.props.mode);
        const persistent = computed(() => rootMenu.props.persistent);
        const item = reactive({
          index: props2.index,
          indexPath,
          active
        });
        const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1);
        const subMenuPopperOffset = computed(() => {
          var _a2;
          return (_a2 = props2.popperOffset) != null ? _a2 : rootMenu.props.popperOffset;
        });
        const subMenuPopperClass = computed(() => {
          var _a2;
          return (_a2 = props2.popperClass) != null ? _a2 : rootMenu.props.popperClass;
        });
        const subMenuShowTimeout = computed(() => {
          var _a2;
          return (_a2 = props2.showTimeout) != null ? _a2 : rootMenu.props.showTimeout;
        });
        const subMenuHideTimeout = computed(() => {
          var _a2;
          return (_a2 = props2.hideTimeout) != null ? _a2 : rootMenu.props.hideTimeout;
        });
        const doDestroy = () => {
          var _a2, _b2, _c2;
          return (_c2 = (_b2 = (_a2 = vPopper.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.popperInstanceRef) == null ? void 0 : _c2.destroy();
        };
        const handleCollapseToggle = (value) => {
          if (!value) {
            doDestroy();
          }
        };
        const handleClick = () => {
          if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled)
            return;
          rootMenu.handleSubMenuClick({
            index: props2.index,
            indexPath: indexPath.value,
            active: active.value
          });
        };
        const handleMouseenter = (event, showTimeout = subMenuShowTimeout.value) => {
          var _a2;
          if (event.type === "focus")
            return;
          if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props2.disabled) {
            subMenu.mouseInChild.value = true;
            return;
          }
          subMenu.mouseInChild.value = true;
          timeout == null ? void 0 : timeout();
          ({ stop: timeout } = useTimeoutFn(() => {
            rootMenu.openMenu(props2.index, indexPath.value);
          }, showTimeout));
          if (appendToBody.value) {
            (_a2 = parentMenu.value.vnode.el) == null ? void 0 : _a2.dispatchEvent(new MouseEvent("mouseenter"));
          }
        };
        const handleMouseleave = (deepDispatch = false) => {
          var _a2;
          if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") {
            subMenu.mouseInChild.value = false;
            return;
          }
          timeout == null ? void 0 : timeout();
          subMenu.mouseInChild.value = false;
          ({ stop: timeout } = useTimeoutFn(() => !mouseInChild.value && rootMenu.closeMenu(props2.index, indexPath.value), subMenuHideTimeout.value));
          if (appendToBody.value && deepDispatch) {
            (_a2 = subMenu.handleMouseleave) == null ? void 0 : _a2.call(subMenu, true);
          }
        };
        watch(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value)));
        {
          const addSubMenu = (item2) => {
            subMenus.value[item2.index] = item2;
          };
          const removeSubMenu = (item2) => {
            delete subMenus.value[item2.index];
          };
          provide(`subMenu:${instance.uid}`, {
            addSubMenu,
            removeSubMenu,
            handleMouseleave,
            mouseInChild,
            level: subMenu.level + 1
          });
        }
        expose({
          opened
        });
        onMounted(() => {
          rootMenu.addSubMenu(item);
          subMenu.addSubMenu(item);
        });
        onBeforeUnmount(() => {
          subMenu.removeSubMenu(item);
          rootMenu.removeSubMenu(item);
        });
        return () => {
          var _a2;
          const titleTag = [
            (_a2 = slots.title) == null ? void 0 : _a2.call(slots),
            h$1(ElIcon, {
              class: nsSubMenu.e("icon-arrow"),
              style: {
                transform: opened.value ? props2.expandCloseIcon && props2.expandOpenIcon || props2.collapseCloseIcon && props2.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none"
              }
            }, {
              default: () => isString$3(subMenuTitleIcon.value) ? h$1(instance.appContext.components[subMenuTitleIcon.value]) : h$1(subMenuTitleIcon.value)
            })
          ];
          const child = rootMenu.isMenuPopup ? h$1(ElTooltip, {
            ref: vPopper,
            visible: opened.value,
            effect: "light",
            pure: true,
            offset: subMenuPopperOffset.value,
            showArrow: false,
            persistent: persistent.value,
            popperClass: subMenuPopperClass.value,
            placement: currentPlacement.value,
            teleported: appendToBody.value,
            fallbackPlacements: fallbackPlacements.value,
            transition: menuTransitionName.value,
            gpuAcceleration: false
          }, {
            content: () => {
              var _a22;
              return h$1("div", {
                class: [
                  nsMenu.m(mode.value),
                  nsMenu.m("popup-container"),
                  subMenuPopperClass.value
                ],
                onMouseenter: (evt) => handleMouseenter(evt, 100),
                onMouseleave: () => handleMouseleave(true),
                onFocus: (evt) => handleMouseenter(evt, 100)
              }, [
                h$1("ul", {
                  class: [
                    nsMenu.b(),
                    nsMenu.m("popup"),
                    nsMenu.m(`popup-${currentPlacement.value}`)
                  ],
                  style: ulStyle.value
                }, [(_a22 = slots.default) == null ? void 0 : _a22.call(slots)])
              ]);
            },
            default: () => h$1("div", {
              class: nsSubMenu.e("title"),
              onClick: handleClick
            }, titleTag)
          }) : h$1(Fragment, {}, [
            h$1("div", {
              class: nsSubMenu.e("title"),
              ref: verticalTitleRef,
              onClick: handleClick
            }, titleTag),
            h$1(ElCollapseTransition, {}, {
              default: () => {
                var _a22;
                return withDirectives(h$1("ul", {
                  role: "menu",
                  class: [nsMenu.b(), nsMenu.m("inline")],
                  style: ulStyle.value
                }, [(_a22 = slots.default) == null ? void 0 : _a22.call(slots)]), [[vShow, opened.value]]);
              }
            })
          ]);
          return h$1("li", {
            class: [
              nsSubMenu.b(),
              nsSubMenu.is("active", active.value),
              nsSubMenu.is("opened", opened.value),
              nsSubMenu.is("disabled", props2.disabled)
            ],
            role: "menuitem",
            ariaHaspopup: true,
            ariaExpanded: opened.value,
            onMouseenter: handleMouseenter,
            onMouseleave: () => handleMouseleave(),
            onFocus: handleMouseenter
          }, [child]);
        };
      }
    });
    const menuProps = buildProps({
      mode: {
        type: String,
        values: ["horizontal", "vertical"],
        default: "vertical"
      },
      defaultActive: {
        type: String,
        default: ""
      },
      defaultOpeneds: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      uniqueOpened: Boolean,
      router: Boolean,
      menuTrigger: {
        type: String,
        values: ["hover", "click"],
        default: "hover"
      },
      collapse: Boolean,
      backgroundColor: String,
      textColor: String,
      activeTextColor: String,
      closeOnClickOutside: Boolean,
      collapseTransition: {
        type: Boolean,
        default: true
      },
      ellipsis: {
        type: Boolean,
        default: true
      },
      popperOffset: {
        type: Number,
        default: 6
      },
      ellipsisIcon: {
        type: iconPropType,
        default: () => more_default
      },
      popperEffect: {
        type: definePropType(String),
        default: "dark"
      },
      popperClass: String,
      showTimeout: {
        type: Number,
        default: 300
      },
      hideTimeout: {
        type: Number,
        default: 300
      },
      persistent: {
        type: Boolean,
        default: true
      }
    });
    const checkIndexPath = (indexPath) => isArray$5(indexPath) && indexPath.every((path) => isString$3(path));
    const menuEmits = {
      close: (index, indexPath) => isString$3(index) && checkIndexPath(indexPath),
      open: (index, indexPath) => isString$3(index) && checkIndexPath(indexPath),
      select: (index, indexPath, item, routerResult) => isString$3(index) && checkIndexPath(indexPath) && isObject$7(item) && (isUndefined$1(routerResult) || routerResult instanceof Promise)
    };
    var Menu = /* @__PURE__ */ defineComponent({
      name: "ElMenu",
      props: menuProps,
      emits: menuEmits,
      setup(props2, { emit: emit2, slots, expose }) {
        const instance = getCurrentInstance();
        const router2 = instance.appContext.config.globalProperties.$router;
        const menu = ref();
        const nsMenu = useNamespace("menu");
        const nsSubMenu = useNamespace("sub-menu");
        const sliceIndex = ref(-1);
        const openedMenus = ref(props2.defaultOpeneds && !props2.collapse ? props2.defaultOpeneds.slice(0) : []);
        const activeIndex = ref(props2.defaultActive);
        const items = ref({});
        const subMenus = ref({});
        const isMenuPopup = computed(() => props2.mode === "horizontal" || props2.mode === "vertical" && props2.collapse);
        const initMenu = () => {
          const activeItem = activeIndex.value && items.value[activeIndex.value];
          if (!activeItem || props2.mode === "horizontal" || props2.collapse)
            return;
          const indexPath = activeItem.indexPath;
          indexPath.forEach((index) => {
            const subMenu = subMenus.value[index];
            subMenu && openMenu(index, subMenu.indexPath);
          });
        };
        const openMenu = (index, indexPath) => {
          if (openedMenus.value.includes(index))
            return;
          if (props2.uniqueOpened) {
            openedMenus.value = openedMenus.value.filter((index2) => indexPath.includes(index2));
          }
          openedMenus.value.push(index);
          emit2("open", index, indexPath);
        };
        const close2 = (index) => {
          const i2 = openedMenus.value.indexOf(index);
          if (i2 !== -1) {
            openedMenus.value.splice(i2, 1);
          }
        };
        const closeMenu = (index, indexPath) => {
          close2(index);
          emit2("close", index, indexPath);
        };
        const handleSubMenuClick = ({
          index,
          indexPath
        }) => {
          const isOpened = openedMenus.value.includes(index);
          isOpened ? closeMenu(index, indexPath) : openMenu(index, indexPath);
        };
        const handleMenuItemClick = (menuItem) => {
          if (props2.mode === "horizontal" || props2.collapse) {
            openedMenus.value = [];
          }
          const { index, indexPath } = menuItem;
          if (isNil(index) || isNil(indexPath))
            return;
          if (props2.router && router2) {
            const route = menuItem.route || index;
            const routerResult = router2.push(route).then((res) => {
              if (!res)
                activeIndex.value = index;
              return res;
            });
            emit2("select", index, indexPath, { index, indexPath, route }, routerResult);
          } else {
            activeIndex.value = index;
            emit2("select", index, indexPath, { index, indexPath });
          }
        };
        const updateActiveIndex = (val) => {
          var _a2;
          const itemsInData = items.value;
          const item = itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props2.defaultActive];
          activeIndex.value = (_a2 = item == null ? void 0 : item.index) != null ? _a2 : val;
        };
        const calcMenuItemWidth = (menuItem) => {
          const computedStyle = getComputedStyle(menuItem);
          const marginLeft2 = Number.parseInt(computedStyle.marginLeft, 10);
          const marginRight2 = Number.parseInt(computedStyle.marginRight, 10);
          return menuItem.offsetWidth + marginLeft2 + marginRight2 || 0;
        };
        const calcSliceIndex = () => {
          var _a2, _b2;
          if (!menu.value)
            return -1;
          const items2 = Array.from((_b2 = (_a2 = menu.value) == null ? void 0 : _a2.childNodes) != null ? _b2 : []).filter((item) => item.nodeName !== "#text" || item.nodeValue);
          const moreItemWidth = 64;
          const computedMenuStyle = getComputedStyle(menu.value);
          const paddingLeft2 = Number.parseInt(computedMenuStyle.paddingLeft, 10);
          const paddingRight2 = Number.parseInt(computedMenuStyle.paddingRight, 10);
          const menuWidth = menu.value.clientWidth - paddingLeft2 - paddingRight2;
          let calcWidth = 0;
          let sliceIndex2 = 0;
          items2.forEach((item, index) => {
            if (item.nodeName === "#comment")
              return;
            calcWidth += calcMenuItemWidth(item);
            if (calcWidth <= menuWidth - moreItemWidth) {
              sliceIndex2 = index + 1;
            }
          });
          return sliceIndex2 === items2.length ? -1 : sliceIndex2;
        };
        const getIndexPath = (index) => subMenus.value[index].indexPath;
        const debounce2 = (fn2, wait = 33.34) => {
          let timmer;
          return () => {
            timmer && clearTimeout(timmer);
            timmer = setTimeout(() => {
              fn2();
            }, wait);
          };
        };
        let isFirstTimeRender = true;
        const handleResize = () => {
          if (sliceIndex.value === calcSliceIndex())
            return;
          const callback = () => {
            sliceIndex.value = -1;
            nextTick(() => {
              sliceIndex.value = calcSliceIndex();
            });
          };
          isFirstTimeRender ? callback() : debounce2(callback)();
          isFirstTimeRender = false;
        };
        watch(() => props2.defaultActive, (currentActive) => {
          if (!items.value[currentActive]) {
            activeIndex.value = "";
          }
          updateActiveIndex(currentActive);
        });
        watch(() => props2.collapse, (value) => {
          if (value)
            openedMenus.value = [];
        });
        watch(items.value, initMenu);
        let resizeStopper;
        watchEffect(() => {
          if (props2.mode === "horizontal" && props2.ellipsis)
            resizeStopper = useResizeObserver(menu, handleResize).stop;
          else
            resizeStopper == null ? void 0 : resizeStopper();
        });
        const mouseInChild = ref(false);
        {
          const addSubMenu = (item) => {
            subMenus.value[item.index] = item;
          };
          const removeSubMenu = (item) => {
            delete subMenus.value[item.index];
          };
          const addMenuItem = (item) => {
            items.value[item.index] = item;
          };
          const removeMenuItem = (item) => {
            delete items.value[item.index];
          };
          provide("rootMenu", reactive({
            props: props2,
            openedMenus,
            items,
            subMenus,
            activeIndex,
            isMenuPopup,
            addMenuItem,
            removeMenuItem,
            addSubMenu,
            removeSubMenu,
            openMenu,
            closeMenu,
            handleMenuItemClick,
            handleSubMenuClick
          }));
          provide(`subMenu:${instance.uid}`, {
            addSubMenu,
            removeSubMenu,
            mouseInChild,
            level: 0
          });
        }
        onMounted(() => {
          if (props2.mode === "horizontal") {
            new Menu$1(instance.vnode.el, nsMenu.namespace.value);
          }
        });
        {
          const open2 = (index) => {
            const { indexPath } = subMenus.value[index];
            indexPath.forEach((i2) => openMenu(i2, indexPath));
          };
          expose({
            open: open2,
            close: close2,
            updateActiveIndex,
            handleResize
          });
        }
        const ulStyle = useMenuCssVar(props2, 0);
        return () => {
          var _a2, _b2;
          let slot = (_b2 = (_a2 = slots.default) == null ? void 0 : _a2.call(slots)) != null ? _b2 : [];
          const vShowMore = [];
          if (props2.mode === "horizontal" && menu.value) {
            const originalSlot = flattedChildren(slot);
            const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value);
            const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value);
            if ((slotMore == null ? void 0 : slotMore.length) && props2.ellipsis) {
              slot = slotDefault;
              vShowMore.push(h$1(SubMenu, {
                index: "sub-menu-more",
                class: nsSubMenu.e("hide-arrow"),
                popperOffset: props2.popperOffset
              }, {
                title: () => h$1(ElIcon, {
                  class: nsSubMenu.e("icon-more")
                }, {
                  default: () => h$1(props2.ellipsisIcon)
                }),
                default: () => slotMore
              }));
            }
          }
          const directives = props2.closeOnClickOutside ? [
            [
              ClickOutside,
              () => {
                if (!openedMenus.value.length)
                  return;
                if (!mouseInChild.value) {
                  openedMenus.value.forEach((openedMenu) => emit2("close", openedMenu, getIndexPath(openedMenu)));
                  openedMenus.value = [];
                }
              }
            ]
          ] : [];
          const vMenu = withDirectives(h$1("ul", {
            key: String(props2.collapse),
            role: "menubar",
            ref: menu,
            style: ulStyle.value,
            class: {
              [nsMenu.b()]: true,
              [nsMenu.m(props2.mode)]: true,
              [nsMenu.m("collapse")]: props2.collapse
            }
          }, [...slot, ...vShowMore]), directives);
          if (props2.collapseTransition && props2.mode === "vertical") {
            return h$1(ElMenuCollapseTransition, () => vMenu);
          }
          return vMenu;
        };
      }
    });
    const menuItemProps = buildProps({
      index: {
        type: definePropType([String, null]),
        default: null
      },
      route: {
        type: definePropType([String, Object])
      },
      disabled: Boolean
    });
    const menuItemEmits = {
      click: (item) => isString$3(item.index) && isArray$5(item.indexPath)
    };
    const COMPONENT_NAME$b = "ElMenuItem";
    const __default__$T = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$b
    });
    const _sfc_main$1d = /* @__PURE__ */ defineComponent({
      ...__default__$T,
      props: menuItemProps,
      emits: menuItemEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const instance = getCurrentInstance();
        const rootMenu = inject("rootMenu");
        const nsMenu = useNamespace("menu");
        const nsMenuItem = useNamespace("menu-item");
        if (!rootMenu)
          throwError$1(COMPONENT_NAME$b, "can not inject root menu");
        const { parentMenu, indexPath } = useMenu(instance, toRef(props2, "index"));
        const subMenu = inject(`subMenu:${parentMenu.value.uid}`);
        if (!subMenu)
          throwError$1(COMPONENT_NAME$b, "can not inject sub menu");
        const active = computed(() => props2.index === rootMenu.activeIndex);
        const item = reactive({
          index: props2.index,
          indexPath,
          active
        });
        const handleClick = () => {
          if (!props2.disabled) {
            rootMenu.handleMenuItemClick({
              index: props2.index,
              indexPath: indexPath.value,
              route: props2.route
            });
            emit2("click", item);
          }
        };
        onMounted(() => {
          subMenu.addSubMenu(item);
          rootMenu.addMenuItem(item);
        });
        onBeforeUnmount(() => {
          subMenu.removeSubMenu(item);
          rootMenu.removeMenuItem(item);
        });
        expose({
          parentMenu,
          rootMenu,
          active,
          nsMenu,
          nsMenuItem,
          handleClick
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("li", {
            class: normalizeClass([
              unref(nsMenuItem).b(),
              unref(nsMenuItem).is("active", unref(active)),
              unref(nsMenuItem).is("disabled", _ctx.disabled)
            ]),
            role: "menuitem",
            tabindex: "-1",
            onClick: handleClick
          }, [
            unref(parentMenu).type.name === "ElMenu" && unref(rootMenu).props.collapse && _ctx.$slots.title ? (openBlock(), createBlock(unref(ElTooltip), {
              key: 0,
              effect: unref(rootMenu).props.popperEffect,
              placement: "right",
              "fallback-placements": ["left"],
              persistent: unref(rootMenu).props.persistent
            }, {
              content: withCtx(() => [
                renderSlot(_ctx.$slots, "title")
              ]),
              default: withCtx(() => [
                createBaseVNode("div", {
                  class: normalizeClass(unref(nsMenu).be("tooltip", "trigger"))
                }, [
                  renderSlot(_ctx.$slots, "default")
                ], 2)
              ]),
              _: 3
            }, 8, ["effect", "persistent"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
              renderSlot(_ctx.$slots, "default"),
              renderSlot(_ctx.$slots, "title")
            ], 64))
          ], 2);
        };
      }
    });
    var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__file", "menu-item.vue"]]);
    const menuItemGroupProps = {
      title: String
    };
    const __default__$S = /* @__PURE__ */ defineComponent({
      name: "ElMenuItemGroup"
    });
    const _sfc_main$1c = /* @__PURE__ */ defineComponent({
      ...__default__$S,
      props: menuItemGroupProps,
      setup(__props) {
        const ns = useNamespace("menu-item-group");
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("li", {
            class: normalizeClass(unref(ns).b())
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("title"))
            }, [
              !_ctx.$slots.title ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                createTextVNode(toDisplayString(_ctx.title), 1)
              ], 64)) : renderSlot(_ctx.$slots, "title", { key: 1 })
            ], 2),
            createBaseVNode("ul", null, [
              renderSlot(_ctx.$slots, "default")
            ])
          ], 2);
        };
      }
    });
    var MenuItemGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__file", "menu-item-group.vue"]]);
    const ElMenu = withInstall(Menu, {
      MenuItem,
      MenuItemGroup,
      SubMenu
    });
    const ElMenuItem = withNoopInstall(MenuItem);
    const ElMenuItemGroup = withNoopInstall(MenuItemGroup);
    const ElSubMenu = withNoopInstall(SubMenu);
    const pageHeaderProps = buildProps({
      icon: {
        type: iconPropType,
        default: () => back_default
      },
      title: String,
      content: {
        type: String,
        default: ""
      }
    });
    const pageHeaderEmits = {
      back: () => true
    };
    const __default__$R = /* @__PURE__ */ defineComponent({
      name: "ElPageHeader"
    });
    const _sfc_main$1b = /* @__PURE__ */ defineComponent({
      ...__default__$R,
      props: pageHeaderProps,
      emits: pageHeaderEmits,
      setup(__props, { emit: emit2 }) {
        const { t } = useLocale();
        const ns = useNamespace("page-header");
        function handleClick() {
          emit2("back");
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ns).b(),
              {
                [unref(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb,
                [unref(ns).m("has-extra")]: !!_ctx.$slots.extra,
                [unref(ns).is("contentful")]: !!_ctx.$slots.default
              }
            ])
          }, [
            _ctx.$slots.breadcrumb ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("breadcrumb"))
            }, [
              renderSlot(_ctx.$slots, "breadcrumb")
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("header"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("left"))
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("back")),
                  role: "button",
                  tabindex: "0",
                  onClick: handleClick
                }, [
                  _ctx.icon || _ctx.$slots.icon ? (openBlock(), createElementBlock("div", {
                    key: 0,
                    "aria-label": _ctx.title || unref(t)("el.pageHeader.title"),
                    class: normalizeClass(unref(ns).e("icon"))
                  }, [
                    renderSlot(_ctx.$slots, "icon", {}, () => [
                      _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                        default: withCtx(() => [
                          (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
                        ]),
                        _: 1
                      })) : createCommentVNode("v-if", true)
                    ])
                  ], 10, ["aria-label"])) : createCommentVNode("v-if", true),
                  createBaseVNode("div", {
                    class: normalizeClass(unref(ns).e("title"))
                  }, [
                    renderSlot(_ctx.$slots, "title", {}, () => [
                      createTextVNode(toDisplayString(_ctx.title || unref(t)("el.pageHeader.title")), 1)
                    ])
                  ], 2)
                ], 2),
                createVNode$1(unref(ElDivider), { direction: "vertical" }),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("content"))
                }, [
                  renderSlot(_ctx.$slots, "content", {}, () => [
                    createTextVNode(toDisplayString(_ctx.content), 1)
                  ])
                ], 2)
              ], 2),
              _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("extra"))
              }, [
                renderSlot(_ctx.$slots, "extra")
              ], 2)) : createCommentVNode("v-if", true)
            ], 2),
            _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("main"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var PageHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__file", "page-header.vue"]]);
    const ElPageHeader = withInstall(PageHeader);
    const elPaginationKey = Symbol("elPaginationKey");
    const paginationPrevProps = buildProps({
      disabled: Boolean,
      currentPage: {
        type: Number,
        default: 1
      },
      prevText: {
        type: String
      },
      prevIcon: {
        type: iconPropType
      }
    });
    const paginationPrevEmits = {
      click: (evt) => evt instanceof MouseEvent
    };
    const __default__$Q = /* @__PURE__ */ defineComponent({
      name: "ElPaginationPrev"
    });
    const _sfc_main$1a = /* @__PURE__ */ defineComponent({
      ...__default__$Q,
      props: paginationPrevProps,
      emits: paginationPrevEmits,
      setup(__props) {
        const props2 = __props;
        const { t } = useLocale();
        const internalDisabled = computed(() => props2.disabled || props2.currentPage <= 1);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("button", {
            type: "button",
            class: "btn-prev",
            disabled: unref(internalDisabled),
            "aria-label": _ctx.prevText || unref(t)("el.pagination.prev"),
            "aria-disabled": unref(internalDisabled),
            onClick: ($event) => _ctx.$emit("click", $event)
          }, [
            _ctx.prevText ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.prevText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(_ctx.prevIcon)))
              ]),
              _: 1
            }))
          ], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
        };
      }
    });
    var Prev = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__file", "prev.vue"]]);
    const paginationNextProps = buildProps({
      disabled: Boolean,
      currentPage: {
        type: Number,
        default: 1
      },
      pageCount: {
        type: Number,
        default: 50
      },
      nextText: {
        type: String
      },
      nextIcon: {
        type: iconPropType
      }
    });
    const __default__$P = /* @__PURE__ */ defineComponent({
      name: "ElPaginationNext"
    });
    const _sfc_main$19 = /* @__PURE__ */ defineComponent({
      ...__default__$P,
      props: paginationNextProps,
      emits: ["click"],
      setup(__props) {
        const props2 = __props;
        const { t } = useLocale();
        const internalDisabled = computed(() => props2.disabled || props2.currentPage === props2.pageCount || props2.pageCount === 0);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("button", {
            type: "button",
            class: "btn-next",
            disabled: unref(internalDisabled),
            "aria-label": _ctx.nextText || unref(t)("el.pagination.next"),
            "aria-disabled": unref(internalDisabled),
            onClick: ($event) => _ctx.$emit("click", $event)
          }, [
            _ctx.nextText ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.nextText), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
              default: withCtx(() => [
                (openBlock(), createBlock(resolveDynamicComponent(_ctx.nextIcon)))
              ]),
              _: 1
            }))
          ], 8, ["disabled", "aria-label", "aria-disabled", "onClick"]);
        };
      }
    });
    var Next = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["__file", "next.vue"]]);
    const selectGroupKey = Symbol("ElSelectGroup");
    const selectKey = Symbol("ElSelect");
    const COMPONENT_NAME$a = "ElOption";
    const optionProps = buildProps({
      value: {
        type: [String, Number, Boolean, Object],
        required: true
      },
      label: {
        type: [String, Number]
      },
      created: Boolean,
      disabled: Boolean
    });
    function useOption$1(props2, states) {
      const select = inject(selectKey);
      if (!select) {
        throwError$1(COMPONENT_NAME$a, "usage: <el-select><el-option /></el-select/>");
      }
      const selectGroup = inject(selectGroupKey, { disabled: false });
      const itemSelected = computed(() => {
        return contains2(castArray$1(select.props.modelValue), props2.value);
      });
      const limitReached = computed(() => {
        var _a2;
        if (select.props.multiple) {
          const modelValue = castArray$1((_a2 = select.props.modelValue) != null ? _a2 : []);
          return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
        } else {
          return false;
        }
      });
      const currentLabel = computed(() => {
        return props2.label || (isObject$7(props2.value) ? "" : props2.value);
      });
      const currentValue = computed(() => {
        return props2.value || props2.label || "";
      });
      const isDisabled = computed(() => {
        return props2.disabled || states.groupDisabled || limitReached.value;
      });
      const instance = getCurrentInstance();
      const contains2 = (arr = [], target) => {
        if (!isObject$7(props2.value)) {
          return arr && arr.includes(target);
        } else {
          const valueKey = select.props.valueKey;
          return arr && arr.some((item) => {
            return toRaw(get$1(item, valueKey)) === get$1(target, valueKey);
          });
        }
      };
      const hoverItem = () => {
        if (!props2.disabled && !selectGroup.disabled) {
          select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy);
        }
      };
      const updateOption = (query) => {
        const regexp3 = new RegExp(escapeStringRegexp(query), "i");
        states.visible = regexp3.test(String(currentLabel.value)) || props2.created;
      };
      watch(() => currentLabel.value, () => {
        if (!props2.created && !select.props.remote)
          select.setSelected();
      });
      watch(() => props2.value, (val, oldVal) => {
        const { remote, valueKey } = select.props;
        const shouldUpdate = remote ? val !== oldVal : !isEqual$1(val, oldVal);
        if (shouldUpdate) {
          select.onOptionDestroy(oldVal, instance.proxy);
          select.onOptionCreate(instance.proxy);
        }
        if (!props2.created && !remote) {
          if (valueKey && isObject$7(val) && isObject$7(oldVal) && val[valueKey] === oldVal[valueKey]) {
            return;
          }
          select.setSelected();
        }
      });
      watch(() => selectGroup.disabled, () => {
        states.groupDisabled = selectGroup.disabled;
      }, { immediate: true });
      return {
        select,
        currentLabel,
        currentValue,
        itemSelected,
        isDisabled,
        hoverItem,
        updateOption
      };
    }
    const _sfc_main$18 = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$a,
      componentName: COMPONENT_NAME$a,
      props: optionProps,
      setup(props2) {
        const ns = useNamespace("select");
        const id = useId();
        const containerKls = computed(() => [
          ns.be("dropdown", "item"),
          ns.is("disabled", unref(isDisabled)),
          ns.is("selected", unref(itemSelected)),
          ns.is("hovering", unref(hover))
        ]);
        const states = reactive({
          index: -1,
          groupDisabled: false,
          visible: true,
          hover: false
        });
        const {
          currentLabel,
          itemSelected,
          isDisabled,
          select,
          hoverItem,
          updateOption
        } = useOption$1(props2, states);
        const { visible, hover } = toRefs(states);
        const vm = getCurrentInstance().proxy;
        select.onOptionCreate(vm);
        onBeforeUnmount(() => {
          const key = vm.value;
          const { selected: selectedOptions } = select.states;
          const doesSelected = selectedOptions.some((item) => {
            return item.value === vm.value;
          });
          nextTick(() => {
            if (select.states.cachedOptions.get(key) === vm && !doesSelected) {
              select.states.cachedOptions.delete(key);
            }
          });
          select.onOptionDestroy(key, vm);
        });
        function selectOptionClick() {
          if (!isDisabled.value) {
            select.handleOptionSelect(vm);
          }
        }
        return {
          ns,
          id,
          containerKls,
          currentLabel,
          itemSelected,
          isDisabled,
          select,
          visible,
          hover,
          states,
          hoverItem,
          updateOption,
          selectOptionClick
        };
      }
    });
    function _sfc_render$h(_ctx, _cache) {
      return withDirectives((openBlock(), createElementBlock("li", {
        id: _ctx.id,
        class: normalizeClass(_ctx.containerKls),
        role: "option",
        "aria-disabled": _ctx.isDisabled || void 0,
        "aria-selected": _ctx.itemSelected,
        onMousemove: _ctx.hoverItem,
        onClick: withModifiers(_ctx.selectOptionClick, ["stop"])
      }, [
        renderSlot(_ctx.$slots, "default", {}, () => [
          createBaseVNode("span", null, toDisplayString(_ctx.currentLabel), 1)
        ])
      ], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"])), [
        [vShow, _ctx.visible]
      ]);
    }
    var Option = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$h], ["__file", "option.vue"]]);
    const _sfc_main$17 = /* @__PURE__ */ defineComponent({
      name: "ElSelectDropdown",
      componentName: "ElSelectDropdown",
      setup() {
        const select = inject(selectKey);
        const ns = useNamespace("select");
        const popperClass = computed(() => select.props.popperClass);
        const isMultiple2 = computed(() => select.props.multiple);
        const isFitInputWidth = computed(() => select.props.fitInputWidth);
        const minWidth = ref("");
        function updateMinWidth() {
          var _a2;
          minWidth.value = `${(_a2 = select.selectRef) == null ? void 0 : _a2.offsetWidth}px`;
        }
        onMounted(() => {
          updateMinWidth();
          useResizeObserver(select.selectRef, updateMinWidth);
        });
        return {
          ns,
          minWidth,
          popperClass,
          isMultiple: isMultiple2,
          isFitInputWidth
        };
      }
    });
    function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
        style: normalizeStyle$1({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
      }, [
        _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(_ctx.ns.be("dropdown", "header"))
        }, [
          renderSlot(_ctx.$slots, "header")
        ], 2)) : createCommentVNode("v-if", true),
        renderSlot(_ctx.$slots, "default"),
        _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
          key: 1,
          class: normalizeClass(_ctx.ns.be("dropdown", "footer"))
        }, [
          renderSlot(_ctx.$slots, "footer")
        ], 2)) : createCommentVNode("v-if", true)
      ], 6);
    }
    var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$g], ["__file", "select-dropdown.vue"]]);
    const useSelect$2 = (props2, emit2) => {
      const { t } = useLocale();
      const contentId = useId();
      const nsSelect = useNamespace("select");
      const nsInput = useNamespace("input");
      const states = reactive({
        inputValue: "",
        options: /* @__PURE__ */ new Map(),
        cachedOptions: /* @__PURE__ */ new Map(),
        optionValues: [],
        selected: [],
        selectionWidth: 0,
        collapseItemWidth: 0,
        selectedLabel: "",
        hoveringIndex: -1,
        previousQuery: null,
        inputHovering: false,
        menuVisibleOnFocus: false,
        isBeforeHide: false
      });
      const selectRef = ref();
      const selectionRef = ref();
      const tooltipRef = ref();
      const tagTooltipRef = ref();
      const inputRef = ref();
      const prefixRef = ref();
      const suffixRef = ref();
      const menuRef = ref();
      const tagMenuRef = ref();
      const collapseItemRef = ref();
      const scrollbarRef = ref();
      const {
        isComposing,
        handleCompositionStart,
        handleCompositionUpdate,
        handleCompositionEnd
      } = useComposition({
        afterComposition: (e2) => onInput(e2)
      });
      const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
        beforeFocus() {
          return selectDisabled.value;
        },
        afterFocus() {
          if (props2.automaticDropdown && !expanded.value) {
            expanded.value = true;
            states.menuVisibleOnFocus = true;
          }
        },
        beforeBlur(event) {
          var _a2, _b2;
          return ((_a2 = tooltipRef.value) == null ? void 0 : _a2.isFocusInsideContent(event)) || ((_b2 = tagTooltipRef.value) == null ? void 0 : _b2.isFocusInsideContent(event));
        },
        afterBlur() {
          var _a2;
          expanded.value = false;
          states.menuVisibleOnFocus = false;
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
          }
        }
      });
      const expanded = ref(false);
      const hoverOption = ref();
      const { form, formItem } = useFormItem();
      const { inputId } = useFormItemInputId(props2, {
        formItemContext: formItem
      });
      const { valueOnClear, isEmptyValue: isEmptyValue2 } = useEmptyValues(props2);
      const selectDisabled = computed(() => props2.disabled || (form == null ? void 0 : form.disabled));
      const hasModelValue = computed(() => {
        return isArray$5(props2.modelValue) ? props2.modelValue.length > 0 : !isEmptyValue2(props2.modelValue);
      });
      const needStatusIcon = computed(() => {
        var _a2;
        return (_a2 = form == null ? void 0 : form.statusIcon) != null ? _a2 : false;
      });
      const showClose = computed(() => {
        return props2.clearable && !selectDisabled.value && states.inputHovering && hasModelValue.value;
      });
      const iconComponent = computed(() => props2.remote && props2.filterable && !props2.remoteShowSuffix ? "" : props2.suffixIcon);
      const iconReverse = computed(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value)));
      const validateState = computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
      const validateIcon = computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
      const debounce$1 = computed(() => props2.remote ? 300 : 0);
      const isRemoteSearchEmpty = computed(() => props2.remote && !states.inputValue && states.options.size === 0);
      const emptyText = computed(() => {
        if (props2.loading) {
          return props2.loadingText || t("el.select.loading");
        } else {
          if (props2.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) {
            return props2.noMatchText || t("el.select.noMatch");
          }
          if (states.options.size === 0) {
            return props2.noDataText || t("el.select.noData");
          }
        }
        return null;
      });
      const filteredOptionsCount = computed(() => optionsArray.value.filter((option) => option.visible).length);
      const optionsArray = computed(() => {
        const list = Array.from(states.options.values());
        const newList = [];
        states.optionValues.forEach((item) => {
          const index = list.findIndex((i2) => i2.value === item);
          if (index > -1) {
            newList.push(list[index]);
          }
        });
        return newList.length >= list.length ? newList : list;
      });
      const cachedOptionsArray = computed(() => Array.from(states.cachedOptions.values()));
      const showNewOption = computed(() => {
        const hasExistingOption = optionsArray.value.filter((option) => {
          return !option.created;
        }).some((option) => {
          return option.currentLabel === states.inputValue;
        });
        return props2.filterable && props2.allowCreate && states.inputValue !== "" && !hasExistingOption;
      });
      const updateOptions2 = () => {
        if (props2.filterable && isFunction$4(props2.filterMethod))
          return;
        if (props2.filterable && props2.remote && isFunction$4(props2.remoteMethod))
          return;
        optionsArray.value.forEach((option) => {
          var _a2;
          (_a2 = option.updateOption) == null ? void 0 : _a2.call(option, states.inputValue);
        });
      };
      const selectSize = useFormSize();
      const collapseTagSize = computed(() => ["small"].includes(selectSize.value) ? "small" : "default");
      const dropdownMenuVisible = computed({
        get() {
          return expanded.value && !isRemoteSearchEmpty.value;
        },
        set(val) {
          expanded.value = val;
        }
      });
      const shouldShowPlaceholder = computed(() => {
        if (props2.multiple && !isUndefined$1(props2.modelValue)) {
          return castArray$1(props2.modelValue).length === 0 && !states.inputValue;
        }
        const value = isArray$5(props2.modelValue) ? props2.modelValue[0] : props2.modelValue;
        return props2.filterable || isUndefined$1(value) ? !states.inputValue : true;
      });
      const currentPlaceholder = computed(() => {
        var _a2;
        const _placeholder = (_a2 = props2.placeholder) != null ? _a2 : t("el.select.placeholder");
        return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
      });
      const mouseEnterEventName = computed(() => isIOS ? null : "mouseenter");
      watch(() => props2.modelValue, (val, oldVal) => {
        if (props2.multiple) {
          if (props2.filterable && !props2.reserveKeyword) {
            states.inputValue = "";
            handleQueryChange("");
          }
        }
        setSelected();
        if (!isEqual$1(val, oldVal) && props2.validateEvent) {
          formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
        }
      }, {
        flush: "post",
        deep: true
      });
      watch(() => expanded.value, (val) => {
        if (val) {
          handleQueryChange(states.inputValue);
        } else {
          states.inputValue = "";
          states.previousQuery = null;
          states.isBeforeHide = true;
        }
        emit2("visible-change", val);
      });
      watch(() => states.options.entries(), () => {
        if (!isClient)
          return;
        setSelected();
        if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) {
          checkDefaultFirstOption();
        }
      }, {
        flush: "post"
      });
      watch([() => states.hoveringIndex, optionsArray], ([val]) => {
        if (isNumber$2(val) && val > -1) {
          hoverOption.value = optionsArray.value[val] || {};
        } else {
          hoverOption.value = {};
        }
        optionsArray.value.forEach((option) => {
          option.hover = hoverOption.value === option;
        });
      });
      watchEffect(() => {
        if (states.isBeforeHide)
          return;
        updateOptions2();
      });
      const handleQueryChange = (val) => {
        if (states.previousQuery === val || isComposing.value) {
          return;
        }
        states.previousQuery = val;
        if (props2.filterable && isFunction$4(props2.filterMethod)) {
          props2.filterMethod(val);
        } else if (props2.filterable && props2.remote && isFunction$4(props2.remoteMethod)) {
          props2.remoteMethod(val);
        }
        if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptionsCount.value) {
          nextTick(checkDefaultFirstOption);
        } else {
          nextTick(updateHoveringIndex);
        }
      };
      const checkDefaultFirstOption = () => {
        const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
        const userCreatedOption = optionsInDropdown.find((n) => n.created);
        const firstOriginOption = optionsInDropdown[0];
        const valueList = optionsArray.value.map((item) => item.value);
        states.hoveringIndex = getValueIndex(valueList, userCreatedOption || firstOriginOption);
      };
      const setSelected = () => {
        if (!props2.multiple) {
          const value = isArray$5(props2.modelValue) ? props2.modelValue[0] : props2.modelValue;
          const option = getOption(value);
          states.selectedLabel = option.currentLabel;
          states.selected = [option];
          return;
        } else {
          states.selectedLabel = "";
        }
        const result = [];
        if (!isUndefined$1(props2.modelValue)) {
          castArray$1(props2.modelValue).forEach((value) => {
            result.push(getOption(value));
          });
        }
        states.selected = result;
      };
      const getOption = (value) => {
        let option;
        const isObjectValue = isPlainObject$2(value);
        for (let i2 = states.cachedOptions.size - 1; i2 >= 0; i2--) {
          const cachedOption = cachedOptionsArray.value[i2];
          const isEqualValue = isObjectValue ? get$1(cachedOption.value, props2.valueKey) === get$1(value, props2.valueKey) : cachedOption.value === value;
          if (isEqualValue) {
            option = {
              value,
              currentLabel: cachedOption.currentLabel,
              get isDisabled() {
                return cachedOption.isDisabled;
              }
            };
            break;
          }
        }
        if (option)
          return option;
        const label = isObjectValue ? value.label : value != null ? value : "";
        const newOption = {
          value,
          currentLabel: label
        };
        return newOption;
      };
      const updateHoveringIndex = () => {
        states.hoveringIndex = optionsArray.value.findIndex((item) => states.selected.some((selected) => getValueKey(selected) === getValueKey(item)));
      };
      const resetSelectionWidth = () => {
        states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
      };
      const resetCollapseItemWidth = () => {
        states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
      };
      const updateTooltip = () => {
        var _a2, _b2;
        (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
      };
      const updateTagTooltip = () => {
        var _a2, _b2;
        (_b2 = (_a2 = tagTooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
      };
      const onInputChange = () => {
        if (states.inputValue.length > 0 && !expanded.value) {
          expanded.value = true;
        }
        handleQueryChange(states.inputValue);
      };
      const onInput = (event) => {
        states.inputValue = event.target.value;
        if (props2.remote) {
          debouncedOnInputChange();
        } else {
          return onInputChange();
        }
      };
      const debouncedOnInputChange = debounce(() => {
        onInputChange();
      }, debounce$1.value);
      const emitChange = (val) => {
        if (!isEqual$1(props2.modelValue, val)) {
          emit2(CHANGE_EVENT, val);
        }
      };
      const getLastNotDisabledIndex = (value) => findLastIndex(value, (it2) => {
        const option = states.cachedOptions.get(it2);
        return option && !option.disabled && !option.states.groupDisabled;
      });
      const deletePrevTag = (e2) => {
        if (!props2.multiple)
          return;
        if (e2.code === EVENT_CODE.delete)
          return;
        if (e2.target.value.length <= 0) {
          const value = castArray$1(props2.modelValue).slice();
          const lastNotDisabledIndex = getLastNotDisabledIndex(value);
          if (lastNotDisabledIndex < 0)
            return;
          const removeTagValue = value[lastNotDisabledIndex];
          value.splice(lastNotDisabledIndex, 1);
          emit2(UPDATE_MODEL_EVENT, value);
          emitChange(value);
          emit2("remove-tag", removeTagValue);
        }
      };
      const deleteTag = (event, tag) => {
        const index = states.selected.indexOf(tag);
        if (index > -1 && !selectDisabled.value) {
          const value = castArray$1(props2.modelValue).slice();
          value.splice(index, 1);
          emit2(UPDATE_MODEL_EVENT, value);
          emitChange(value);
          emit2("remove-tag", tag.value);
        }
        event.stopPropagation();
        focus();
      };
      const deleteSelected = (event) => {
        event.stopPropagation();
        const value = props2.multiple ? [] : valueOnClear.value;
        if (props2.multiple) {
          for (const item of states.selected) {
            if (item.isDisabled)
              value.push(item.value);
          }
        }
        emit2(UPDATE_MODEL_EVENT, value);
        emitChange(value);
        states.hoveringIndex = -1;
        expanded.value = false;
        emit2("clear");
        focus();
      };
      const handleOptionSelect = (option) => {
        var _a2;
        if (props2.multiple) {
          const value = castArray$1((_a2 = props2.modelValue) != null ? _a2 : []).slice();
          const optionIndex = getValueIndex(value, option);
          if (optionIndex > -1) {
            value.splice(optionIndex, 1);
          } else if (props2.multipleLimit <= 0 || value.length < props2.multipleLimit) {
            value.push(option.value);
          }
          emit2(UPDATE_MODEL_EVENT, value);
          emitChange(value);
          if (option.created) {
            handleQueryChange("");
          }
          if (props2.filterable && !props2.reserveKeyword) {
            states.inputValue = "";
          }
        } else {
          emit2(UPDATE_MODEL_EVENT, option.value);
          emitChange(option.value);
          expanded.value = false;
        }
        focus();
        if (expanded.value)
          return;
        nextTick(() => {
          scrollToOption(option);
        });
      };
      const getValueIndex = (arr, option) => {
        if (isUndefined$1(option))
          return -1;
        if (!isObject$7(option.value))
          return arr.indexOf(option.value);
        return arr.findIndex((item) => {
          return isEqual$1(get$1(item, props2.valueKey), getValueKey(option));
        });
      };
      const scrollToOption = (option) => {
        var _a2, _b2, _c2, _d, _e;
        const targetOption = isArray$5(option) ? option[0] : option;
        let target = null;
        if (targetOption == null ? void 0 : targetOption.value) {
          const options = optionsArray.value.filter((item) => item.value === targetOption.value);
          if (options.length > 0) {
            target = options[0].$el;
          }
        }
        if (tooltipRef.value && target) {
          const menu = (_d = (_c2 = (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef) == null ? void 0 : _c2.querySelector) == null ? void 0 : _d.call(_c2, `.${nsSelect.be("dropdown", "wrap")}`);
          if (menu) {
            scrollIntoView(menu, target);
          }
        }
        (_e = scrollbarRef.value) == null ? void 0 : _e.handleScroll();
      };
      const onOptionCreate = (vm) => {
        states.options.set(vm.value, vm);
        states.cachedOptions.set(vm.value, vm);
      };
      const onOptionDestroy = (key, vm) => {
        if (states.options.get(key) === vm) {
          states.options.delete(key);
        }
      };
      const popperRef = computed(() => {
        var _a2, _b2;
        return (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef;
      });
      const handleMenuEnter = () => {
        states.isBeforeHide = false;
        nextTick(() => {
          var _a2;
          (_a2 = scrollbarRef.value) == null ? void 0 : _a2.update();
          scrollToOption(states.selected);
        });
      };
      const focus = () => {
        var _a2;
        (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
      };
      const blur = () => {
        var _a2;
        if (expanded.value) {
          expanded.value = false;
          nextTick(() => {
            var _a22;
            return (_a22 = inputRef.value) == null ? void 0 : _a22.blur();
          });
          return;
        }
        (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
      };
      const handleClearClick = (event) => {
        deleteSelected(event);
      };
      const handleClickOutside = (event) => {
        expanded.value = false;
        if (isFocused.value) {
          const _event2 = new FocusEvent("focus", event);
          nextTick(() => handleBlur(_event2));
        }
      };
      const handleEsc = () => {
        if (states.inputValue.length > 0) {
          states.inputValue = "";
        } else {
          expanded.value = false;
        }
      };
      const toggleMenu = () => {
        if (selectDisabled.value)
          return;
        if (isIOS)
          states.inputHovering = true;
        if (states.menuVisibleOnFocus) {
          states.menuVisibleOnFocus = false;
        } else {
          expanded.value = !expanded.value;
        }
      };
      const selectOption = () => {
        if (!expanded.value) {
          toggleMenu();
        } else {
          const option = optionsArray.value[states.hoveringIndex];
          if (option && !option.isDisabled) {
            handleOptionSelect(option);
          }
        }
      };
      const getValueKey = (item) => {
        return isObject$7(item.value) ? get$1(item.value, props2.valueKey) : item.value;
      };
      const optionsAllDisabled = computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled));
      const showTagList = computed(() => {
        if (!props2.multiple) {
          return [];
        }
        return props2.collapseTags ? states.selected.slice(0, props2.maxCollapseTags) : states.selected;
      });
      const collapseTagList = computed(() => {
        if (!props2.multiple) {
          return [];
        }
        return props2.collapseTags ? states.selected.slice(props2.maxCollapseTags) : [];
      });
      const navigateOptions = (direction2) => {
        if (!expanded.value) {
          expanded.value = true;
          return;
        }
        if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value)
          return;
        if (!optionsAllDisabled.value) {
          if (direction2 === "next") {
            states.hoveringIndex++;
            if (states.hoveringIndex === states.options.size) {
              states.hoveringIndex = 0;
            }
          } else if (direction2 === "prev") {
            states.hoveringIndex--;
            if (states.hoveringIndex < 0) {
              states.hoveringIndex = states.options.size - 1;
            }
          }
          const option = optionsArray.value[states.hoveringIndex];
          if (option.isDisabled || !option.visible) {
            navigateOptions(direction2);
          }
          nextTick(() => scrollToOption(hoverOption.value));
        }
      };
      const getGapWidth = () => {
        if (!selectionRef.value)
          return 0;
        const style = window.getComputedStyle(selectionRef.value);
        return Number.parseFloat(style.gap || "6px");
      };
      const tagStyle = computed(() => {
        const gapWidth = getGapWidth();
        const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth : states.selectionWidth;
        return { maxWidth: `${maxWidth}px` };
      });
      const collapseTagStyle = computed(() => {
        return { maxWidth: `${states.selectionWidth}px` };
      });
      const popupScroll = (data) => {
        emit2("popup-scroll", data);
      };
      useResizeObserver(selectionRef, resetSelectionWidth);
      useResizeObserver(menuRef, updateTooltip);
      useResizeObserver(wrapperRef, updateTooltip);
      useResizeObserver(tagMenuRef, updateTagTooltip);
      useResizeObserver(collapseItemRef, resetCollapseItemWidth);
      onMounted(() => {
        setSelected();
      });
      return {
        inputId,
        contentId,
        nsSelect,
        nsInput,
        states,
        isFocused,
        expanded,
        optionsArray,
        hoverOption,
        selectSize,
        filteredOptionsCount,
        updateTooltip,
        updateTagTooltip,
        debouncedOnInputChange,
        onInput,
        deletePrevTag,
        deleteTag,
        deleteSelected,
        handleOptionSelect,
        scrollToOption,
        hasModelValue,
        shouldShowPlaceholder,
        currentPlaceholder,
        mouseEnterEventName,
        needStatusIcon,
        showClose,
        iconComponent,
        iconReverse,
        validateState,
        validateIcon,
        showNewOption,
        updateOptions: updateOptions2,
        collapseTagSize,
        setSelected,
        selectDisabled,
        emptyText,
        handleCompositionStart,
        handleCompositionUpdate,
        handleCompositionEnd,
        onOptionCreate,
        onOptionDestroy,
        handleMenuEnter,
        focus,
        blur,
        handleClearClick,
        handleClickOutside,
        handleEsc,
        toggleMenu,
        selectOption,
        getValueKey,
        navigateOptions,
        dropdownMenuVisible,
        showTagList,
        collapseTagList,
        popupScroll,
        tagStyle,
        collapseTagStyle,
        popperRef,
        inputRef,
        tooltipRef,
        tagTooltipRef,
        prefixRef,
        suffixRef,
        selectRef,
        wrapperRef,
        selectionRef,
        scrollbarRef,
        menuRef,
        tagMenuRef,
        collapseItemRef
      };
    };
    var ElOptions = /* @__PURE__ */ defineComponent({
      name: "ElOptions",
      setup(_2, { slots }) {
        const select = inject(selectKey);
        let cachedValueList = [];
        return () => {
          var _a2, _b2;
          const children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
          const valueList = [];
          function filterOptions(children2) {
            if (!isArray$5(children2))
              return;
            children2.forEach((item) => {
              var _a22, _b22, _c2, _d;
              const name = (_a22 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a22.name;
              if (name === "ElOptionGroup") {
                filterOptions(!isString$3(item.children) && !isArray$5(item.children) && isFunction$4((_b22 = item.children) == null ? void 0 : _b22.default) ? (_c2 = item.children) == null ? void 0 : _c2.default() : item.children);
              } else if (name === "ElOption") {
                valueList.push((_d = item.props) == null ? void 0 : _d.value);
              } else if (isArray$5(item.children)) {
                filterOptions(item.children);
              }
            });
          }
          if (children.length) {
            filterOptions((_b2 = children[0]) == null ? void 0 : _b2.children);
          }
          if (!isEqual$1(valueList, cachedValueList)) {
            cachedValueList = valueList;
            if (select) {
              select.states.optionValues = valueList;
            }
          }
          return children;
        };
      }
    });
    const SelectProps$1 = buildProps({
      name: String,
      id: String,
      modelValue: {
        type: definePropType([
          Array,
          String,
          Number,
          Boolean,
          Object
        ]),
        default: void 0
      },
      autocomplete: {
        type: String,
        default: "off"
      },
      automaticDropdown: Boolean,
      size: useSizeProp,
      effect: {
        type: definePropType(String),
        default: "light"
      },
      disabled: Boolean,
      clearable: Boolean,
      filterable: Boolean,
      allowCreate: Boolean,
      loading: Boolean,
      popperClass: {
        type: String,
        default: ""
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      },
      remote: Boolean,
      loadingText: String,
      noMatchText: String,
      noDataText: String,
      remoteMethod: Function,
      filterMethod: Function,
      multiple: Boolean,
      multipleLimit: {
        type: Number,
        default: 0
      },
      placeholder: {
        type: String
      },
      defaultFirstOption: Boolean,
      reserveKeyword: {
        type: Boolean,
        default: true
      },
      valueKey: {
        type: String,
        default: "value"
      },
      collapseTags: Boolean,
      collapseTagsTooltip: Boolean,
      maxCollapseTags: {
        type: Number,
        default: 1
      },
      teleported: useTooltipContentProps.teleported,
      persistent: {
        type: Boolean,
        default: true
      },
      clearIcon: {
        type: iconPropType,
        default: circle_close_default
      },
      fitInputWidth: Boolean,
      suffixIcon: {
        type: iconPropType,
        default: arrow_down_default
      },
      tagType: { ...tagProps.type, default: "info" },
      tagEffect: { ...tagProps.effect, default: "light" },
      validateEvent: {
        type: Boolean,
        default: true
      },
      remoteShowSuffix: Boolean,
      showArrow: {
        type: Boolean,
        default: true
      },
      offset: {
        type: Number,
        default: 12
      },
      placement: {
        type: definePropType(String),
        values: Ee,
        default: "bottom-start"
      },
      fallbackPlacements: {
        type: definePropType(Array),
        default: ["bottom-start", "top-start", "right", "left"]
      },
      tabindex: {
        type: [String, Number],
        default: 0
      },
      appendTo: useTooltipContentProps.appendTo,
      ...useEmptyValuesProps,
      ...useAriaProps(["ariaLabel"])
    });
    ({
      "popup-scroll": scrollbarEmits.scroll
    });
    const COMPONENT_NAME$9 = "ElSelect";
    const _sfc_main$16 = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$9,
      componentName: COMPONENT_NAME$9,
      components: {
        ElSelectMenu: ElSelectMenu$1,
        ElOption: Option,
        ElOptions,
        ElTag,
        ElScrollbar,
        ElTooltip,
        ElIcon
      },
      directives: { ClickOutside },
      props: SelectProps$1,
      emits: [
        UPDATE_MODEL_EVENT,
        CHANGE_EVENT,
        "remove-tag",
        "clear",
        "visible-change",
        "focus",
        "blur",
        "popup-scroll"
      ],
      setup(props2, { emit: emit2 }) {
        const modelValue = computed(() => {
          const { modelValue: rawModelValue, multiple } = props2;
          const fallback = multiple ? [] : void 0;
          if (isArray$5(rawModelValue)) {
            return multiple ? rawModelValue : fallback;
          }
          return multiple ? fallback : rawModelValue;
        });
        const _props = reactive({
          ...toRefs(props2),
          modelValue
        });
        const API = useSelect$2(_props, emit2);
        const { calculatorRef, inputStyle } = useCalcInputWidth();
        provide(selectKey, reactive({
          props: _props,
          states: API.states,
          selectRef: API.selectRef,
          optionsArray: API.optionsArray,
          setSelected: API.setSelected,
          handleOptionSelect: API.handleOptionSelect,
          onOptionCreate: API.onOptionCreate,
          onOptionDestroy: API.onOptionDestroy
        }));
        const selectedLabel = computed(() => {
          if (!props2.multiple) {
            return API.states.selectedLabel;
          }
          return API.states.selected.map((i2) => i2.currentLabel);
        });
        return {
          ...API,
          modelValue,
          selectedLabel,
          calculatorRef,
          inputStyle
        };
      }
    });
    function _sfc_render$f(_ctx, _cache) {
      const _component_el_tag = resolveComponent("el-tag");
      const _component_el_tooltip = resolveComponent("el-tooltip");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_options = resolveComponent("el-options");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_el_select_menu = resolveComponent("el-select-menu");
      const _directive_click_outside = resolveDirective("click-outside");
      return withDirectives((openBlock(), createElementBlock("div", {
        ref: "selectRef",
        class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
        [toHandlerKey(_ctx.mouseEnterEventName)]: ($event) => _ctx.states.inputHovering = true,
        onMouseleave: ($event) => _ctx.states.inputHovering = false
      }, [
        createVNode$1(_component_el_tooltip, {
          ref: "tooltipRef",
          visible: _ctx.dropdownMenuVisible,
          placement: _ctx.placement,
          teleported: _ctx.teleported,
          "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
          "popper-options": _ctx.popperOptions,
          "fallback-placements": _ctx.fallbackPlacements,
          effect: _ctx.effect,
          pure: "",
          trigger: "click",
          transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
          "stop-popper-mouse-event": false,
          "gpu-acceleration": false,
          persistent: _ctx.persistent,
          "append-to": _ctx.appendTo,
          "show-arrow": _ctx.showArrow,
          offset: _ctx.offset,
          onBeforeShow: _ctx.handleMenuEnter,
          onHide: ($event) => _ctx.states.isBeforeHide = false
        }, {
          default: withCtx(() => {
            var _a2;
            return [
              createBaseVNode("div", {
                ref: "wrapperRef",
                class: normalizeClass([
                  _ctx.nsSelect.e("wrapper"),
                  _ctx.nsSelect.is("focused", _ctx.isFocused),
                  _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
                  _ctx.nsSelect.is("filterable", _ctx.filterable),
                  _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
                ]),
                onClick: withModifiers(_ctx.toggleMenu, ["prevent"])
              }, [
                _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  ref: "prefixRef",
                  class: normalizeClass(_ctx.nsSelect.e("prefix"))
                }, [
                  renderSlot(_ctx.$slots, "prefix")
                ], 2)) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  ref: "selectionRef",
                  class: normalizeClass([
                    _ctx.nsSelect.e("selection"),
                    _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length)
                  ])
                }, [
                  _ctx.multiple ? renderSlot(_ctx.$slots, "tag", { key: 0 }, () => [
                    (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
                      return openBlock(), createElementBlock("div", {
                        key: _ctx.getValueKey(item),
                        class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                      }, [
                        createVNode$1(_component_el_tag, {
                          closable: !_ctx.selectDisabled && !item.isDisabled,
                          size: _ctx.collapseTagSize,
                          type: _ctx.tagType,
                          effect: _ctx.tagEffect,
                          "disable-transitions": "",
                          style: normalizeStyle$1(_ctx.tagStyle),
                          onClose: ($event) => _ctx.deleteTag($event, item)
                        }, {
                          default: withCtx(() => [
                            createBaseVNode("span", {
                              class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                            }, [
                              renderSlot(_ctx.$slots, "label", {
                                label: item.currentLabel,
                                value: item.value
                              }, () => [
                                createTextVNode(toDisplayString(item.currentLabel), 1)
                              ])
                            ], 2)
                          ]),
                          _: 2
                        }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
                      ], 2);
                    }), 128)),
                    _ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
                      key: 0,
                      ref: "tagTooltipRef",
                      disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
                      "fallback-placements": ["bottom", "top", "right", "left"],
                      effect: _ctx.effect,
                      placement: "bottom",
                      teleported: _ctx.teleported
                    }, {
                      default: withCtx(() => [
                        createBaseVNode("div", {
                          ref: "collapseItemRef",
                          class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                        }, [
                          createVNode$1(_component_el_tag, {
                            closable: false,
                            size: _ctx.collapseTagSize,
                            type: _ctx.tagType,
                            effect: _ctx.tagEffect,
                            "disable-transitions": "",
                            style: normalizeStyle$1(_ctx.collapseTagStyle)
                          }, {
                            default: withCtx(() => [
                              createBaseVNode("span", {
                                class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                              }, " + " + toDisplayString(_ctx.states.selected.length - _ctx.maxCollapseTags), 3)
                            ]),
                            _: 1
                          }, 8, ["size", "type", "effect", "style"])
                        ], 2)
                      ]),
                      content: withCtx(() => [
                        createBaseVNode("div", {
                          ref: "tagMenuRef",
                          class: normalizeClass(_ctx.nsSelect.e("selection"))
                        }, [
                          (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
                            return openBlock(), createElementBlock("div", {
                              key: _ctx.getValueKey(item),
                              class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                            }, [
                              createVNode$1(_component_el_tag, {
                                class: "in-tooltip",
                                closable: !_ctx.selectDisabled && !item.isDisabled,
                                size: _ctx.collapseTagSize,
                                type: _ctx.tagType,
                                effect: _ctx.tagEffect,
                                "disable-transitions": "",
                                onClose: ($event) => _ctx.deleteTag($event, item)
                              }, {
                                default: withCtx(() => [
                                  createBaseVNode("span", {
                                    class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                                  }, [
                                    renderSlot(_ctx.$slots, "label", {
                                      label: item.currentLabel,
                                      value: item.value
                                    }, () => [
                                      createTextVNode(toDisplayString(item.currentLabel), 1)
                                    ])
                                  ], 2)
                                ]),
                                _: 2
                              }, 1032, ["closable", "size", "type", "effect", "onClose"])
                            ], 2);
                          }), 128))
                        ], 2)
                      ]),
                      _: 3
                    }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true)
                  ]) : createCommentVNode("v-if", true),
                  createBaseVNode("div", {
                    class: normalizeClass([
                      _ctx.nsSelect.e("selected-item"),
                      _ctx.nsSelect.e("input-wrapper"),
                      _ctx.nsSelect.is("hidden", !_ctx.filterable)
                    ])
                  }, [
                    withDirectives(createBaseVNode("input", {
                      id: _ctx.inputId,
                      ref: "inputRef",
                      "onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
                      type: "text",
                      name: _ctx.name,
                      class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
                      disabled: _ctx.selectDisabled,
                      autocomplete: _ctx.autocomplete,
                      style: normalizeStyle$1(_ctx.inputStyle),
                      tabindex: _ctx.tabindex,
                      role: "combobox",
                      readonly: !_ctx.filterable,
                      spellcheck: "false",
                      "aria-activedescendant": ((_a2 = _ctx.hoverOption) == null ? void 0 : _a2.id) || "",
                      "aria-controls": _ctx.contentId,
                      "aria-expanded": _ctx.dropdownMenuVisible,
                      "aria-label": _ctx.ariaLabel,
                      "aria-autocomplete": "none",
                      "aria-haspopup": "listbox",
                      onKeydown: [
                        withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"]),
                        withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"]),
                        withKeys(withModifiers(_ctx.handleEsc, ["stop", "prevent"]), ["esc"]),
                        withKeys(withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
                        withKeys(withModifiers(_ctx.deletePrevTag, ["stop"]), ["delete"])
                      ],
                      onCompositionstart: _ctx.handleCompositionStart,
                      onCompositionupdate: _ctx.handleCompositionUpdate,
                      onCompositionend: _ctx.handleCompositionEnd,
                      onInput: _ctx.onInput,
                      onClick: withModifiers(_ctx.toggleMenu, ["stop"])
                    }, null, 46, ["id", "onUpdate:modelValue", "name", "disabled", "autocomplete", "tabindex", "readonly", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "onKeydown", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput", "onClick"]), [
                      [vModelText, _ctx.states.inputValue]
                    ]),
                    _ctx.filterable ? (openBlock(), createElementBlock("span", {
                      key: 0,
                      ref: "calculatorRef",
                      "aria-hidden": "true",
                      class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
                      textContent: toDisplayString(_ctx.states.inputValue)
                    }, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
                  ], 2),
                  _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
                    key: 1,
                    class: normalizeClass([
                      _ctx.nsSelect.e("selected-item"),
                      _ctx.nsSelect.e("placeholder"),
                      _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
                    ])
                  }, [
                    _ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
                      key: 0,
                      label: _ctx.currentPlaceholder,
                      value: _ctx.modelValue
                    }, () => [
                      createBaseVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)
                    ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.currentPlaceholder), 1))
                  ], 2)) : createCommentVNode("v-if", true)
                ], 2),
                createBaseVNode("div", {
                  ref: "suffixRef",
                  class: normalizeClass(_ctx.nsSelect.e("suffix"))
                }, [
                  _ctx.iconComponent && !_ctx.showClose ? (openBlock(), createBlock(_component_el_icon, {
                    key: 0,
                    class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
                    ]),
                    _: 1
                  }, 8, ["class"])) : createCommentVNode("v-if", true),
                  _ctx.showClose && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
                    key: 1,
                    class: normalizeClass([
                      _ctx.nsSelect.e("caret"),
                      _ctx.nsSelect.e("icon"),
                      _ctx.nsSelect.e("clear")
                    ]),
                    onClick: _ctx.handleClearClick
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
                    ]),
                    _: 1
                  }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
                  _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
                    key: 2,
                    class: normalizeClass([
                      _ctx.nsInput.e("icon"),
                      _ctx.nsInput.e("validateIcon"),
                      _ctx.nsInput.is("loading", _ctx.validateState === "validating")
                    ])
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
                    ]),
                    _: 1
                  }, 8, ["class"])) : createCommentVNode("v-if", true)
                ], 2)
              ], 10, ["onClick"])
            ];
          }),
          content: withCtx(() => [
            createVNode$1(_component_el_select_menu, { ref: "menuRef" }, {
              default: withCtx(() => [
                _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  class: normalizeClass(_ctx.nsSelect.be("dropdown", "header")),
                  onClick: withModifiers(() => {
                  }, ["stop"])
                }, [
                  renderSlot(_ctx.$slots, "header")
                ], 10, ["onClick"])) : createCommentVNode("v-if", true),
                withDirectives(createVNode$1(_component_el_scrollbar, {
                  id: _ctx.contentId,
                  ref: "scrollbarRef",
                  tag: "ul",
                  "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
                  "view-class": _ctx.nsSelect.be("dropdown", "list"),
                  class: normalizeClass([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
                  role: "listbox",
                  "aria-label": _ctx.ariaLabel,
                  "aria-orientation": "vertical",
                  onScroll: _ctx.popupScroll
                }, {
                  default: withCtx(() => [
                    _ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
                      key: 0,
                      value: _ctx.states.inputValue,
                      created: true
                    }, null, 8, ["value"])) : createCommentVNode("v-if", true),
                    createVNode$1(_component_el_options, null, {
                      default: withCtx(() => [
                        renderSlot(_ctx.$slots, "default")
                      ]),
                      _: 3
                    })
                  ]),
                  _: 3
                }, 8, ["id", "wrap-class", "view-class", "class", "aria-label", "onScroll"]), [
                  [vShow, _ctx.states.options.size > 0 && !_ctx.loading]
                ]),
                _ctx.$slots.loading && _ctx.loading ? (openBlock(), createElementBlock("div", {
                  key: 1,
                  class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
                }, [
                  renderSlot(_ctx.$slots, "loading")
                ], 2)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? (openBlock(), createElementBlock("div", {
                  key: 2,
                  class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
                }, [
                  renderSlot(_ctx.$slots, "empty", {}, () => [
                    createBaseVNode("span", null, toDisplayString(_ctx.emptyText), 1)
                  ])
                ], 2)) : createCommentVNode("v-if", true),
                _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
                  key: 3,
                  class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer")),
                  onClick: withModifiers(() => {
                  }, ["stop"])
                }, [
                  renderSlot(_ctx.$slots, "footer")
                ], 10, ["onClick"])) : createCommentVNode("v-if", true)
              ]),
              _: 3
            }, 512)
          ]),
          _: 3
        }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
      ], 16, ["onMouseleave"])), [
        [_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
      ]);
    }
    var Select$1 = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$f], ["__file", "select.vue"]]);
    const _sfc_main$15 = /* @__PURE__ */ defineComponent({
      name: "ElOptionGroup",
      componentName: "ElOptionGroup",
      props: {
        label: String,
        disabled: Boolean
      },
      setup(props2) {
        const ns = useNamespace("select");
        const groupRef = ref();
        const instance = getCurrentInstance();
        const children = ref([]);
        provide(selectGroupKey, reactive({
          ...toRefs(props2)
        }));
        const visible = computed(() => children.value.some((option) => option.visible === true));
        const isOption = (node) => {
          var _a2;
          return node.type.name === "ElOption" && !!((_a2 = node.component) == null ? void 0 : _a2.proxy);
        };
        const flattedChildren2 = (node) => {
          const nodes = castArray$1(node);
          const children2 = [];
          nodes.forEach((child) => {
            var _a2;
            if (!isVNode(child))
              return;
            if (isOption(child)) {
              children2.push(child.component.proxy);
            } else if (isArray$5(child.children) && child.children.length) {
              children2.push(...flattedChildren2(child.children));
            } else if ((_a2 = child.component) == null ? void 0 : _a2.subTree) {
              children2.push(...flattedChildren2(child.component.subTree));
            }
          });
          return children2;
        };
        const updateChildren2 = () => {
          children.value = flattedChildren2(instance.subTree);
        };
        onMounted(() => {
          updateChildren2();
        });
        useMutationObserver(groupRef, updateChildren2, {
          attributes: true,
          subtree: true,
          childList: true
        });
        return {
          groupRef,
          visible,
          ns
        };
      }
    });
    function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
      return withDirectives((openBlock(), createElementBlock("ul", {
        ref: "groupRef",
        class: normalizeClass(_ctx.ns.be("group", "wrap"))
      }, [
        createBaseVNode("li", {
          class: normalizeClass(_ctx.ns.be("group", "title"))
        }, toDisplayString(_ctx.label), 3),
        createBaseVNode("li", null, [
          createBaseVNode("ul", {
            class: normalizeClass(_ctx.ns.b("group"))
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2)
        ])
      ], 2)), [
        [vShow, _ctx.visible]
      ]);
    }
    var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$e], ["__file", "option-group.vue"]]);
    const ElSelect = withInstall(Select$1, {
      Option,
      OptionGroup
    });
    const ElOption = withNoopInstall(Option);
    const ElOptionGroup = withNoopInstall(OptionGroup);
    const usePagination = () => inject(elPaginationKey, {});
    const paginationSizesProps = buildProps({
      pageSize: {
        type: Number,
        required: true
      },
      pageSizes: {
        type: definePropType(Array),
        default: () => mutable([10, 20, 30, 40, 50, 100])
      },
      popperClass: {
        type: String
      },
      disabled: Boolean,
      teleported: Boolean,
      size: {
        type: String,
        values: componentSizes
      },
      appendSizeTo: String
    });
    const __default__$O = /* @__PURE__ */ defineComponent({
      name: "ElPaginationSizes"
    });
    const _sfc_main$14 = /* @__PURE__ */ defineComponent({
      ...__default__$O,
      props: paginationSizesProps,
      emits: ["page-size-change"],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("pagination");
        const pagination = usePagination();
        const innerPageSize = ref(props2.pageSize);
        watch(() => props2.pageSizes, (newVal, oldVal) => {
          if (isEqual$1(newVal, oldVal))
            return;
          if (isArray$5(newVal)) {
            const pageSize = newVal.includes(props2.pageSize) ? props2.pageSize : props2.pageSizes[0];
            emit2("page-size-change", pageSize);
          }
        });
        watch(() => props2.pageSize, (newVal) => {
          innerPageSize.value = newVal;
        });
        const innerPageSizes = computed(() => props2.pageSizes);
        function handleChange(val) {
          var _a2;
          if (val !== innerPageSize.value) {
            innerPageSize.value = val;
            (_a2 = pagination.handleSizeChange) == null ? void 0 : _a2.call(pagination, Number(val));
          }
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(ns).e("sizes"))
          }, [
            createVNode$1(unref(ElSelect), {
              "model-value": innerPageSize.value,
              disabled: _ctx.disabled,
              "popper-class": _ctx.popperClass,
              size: _ctx.size,
              teleported: _ctx.teleported,
              "validate-event": false,
              "append-to": _ctx.appendSizeTo,
              onChange: handleChange
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(innerPageSizes), (item) => {
                  return openBlock(), createBlock(unref(ElOption), {
                    key: item,
                    value: item,
                    label: item + unref(t)("el.pagination.pagesize")
                  }, null, 8, ["value", "label"]);
                }), 128))
              ]),
              _: 1
            }, 8, ["model-value", "disabled", "popper-class", "size", "teleported", "append-to"])
          ], 2);
        };
      }
    });
    var Sizes = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__file", "sizes.vue"]]);
    const paginationJumperProps = buildProps({
      size: {
        type: String,
        values: componentSizes
      }
    });
    const __default__$N = /* @__PURE__ */ defineComponent({
      name: "ElPaginationJumper"
    });
    const _sfc_main$13 = /* @__PURE__ */ defineComponent({
      ...__default__$N,
      props: paginationJumperProps,
      setup(__props) {
        const { t } = useLocale();
        const ns = useNamespace("pagination");
        const { pageCount, disabled, currentPage, changeEvent } = usePagination();
        const userInput = ref();
        const innerValue = computed(() => {
          var _a2;
          return (_a2 = userInput.value) != null ? _a2 : currentPage == null ? void 0 : currentPage.value;
        });
        function handleInput(val) {
          userInput.value = val ? +val : "";
        }
        function handleChange(val) {
          val = Math.trunc(+val);
          changeEvent == null ? void 0 : changeEvent(val);
          userInput.value = void 0;
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(ns).e("jump")),
            disabled: unref(disabled)
          }, [
            createBaseVNode("span", {
              class: normalizeClass([unref(ns).e("goto")])
            }, toDisplayString(unref(t)("el.pagination.goto")), 3),
            createVNode$1(unref(ElInput), {
              size: _ctx.size,
              class: normalizeClass([unref(ns).e("editor"), unref(ns).is("in-pagination")]),
              min: 1,
              max: unref(pageCount),
              disabled: unref(disabled),
              "model-value": unref(innerValue),
              "validate-event": false,
              "aria-label": unref(t)("el.pagination.page"),
              type: "number",
              "onUpdate:modelValue": handleInput,
              onChange: handleChange
            }, null, 8, ["size", "class", "max", "disabled", "model-value", "aria-label"]),
            createBaseVNode("span", {
              class: normalizeClass([unref(ns).e("classifier")])
            }, toDisplayString(unref(t)("el.pagination.pageClassifier")), 3)
          ], 10, ["disabled"]);
        };
      }
    });
    var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__file", "jumper.vue"]]);
    const paginationTotalProps = buildProps({
      total: {
        type: Number,
        default: 1e3
      }
    });
    const __default__$M = /* @__PURE__ */ defineComponent({
      name: "ElPaginationTotal"
    });
    const _sfc_main$12 = /* @__PURE__ */ defineComponent({
      ...__default__$M,
      props: paginationTotalProps,
      setup(__props) {
        const { t } = useLocale();
        const ns = useNamespace("pagination");
        const { disabled } = usePagination();
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            class: normalizeClass(unref(ns).e("total")),
            disabled: unref(disabled)
          }, toDisplayString(unref(t)("el.pagination.total", {
            total: _ctx.total
          })), 11, ["disabled"]);
        };
      }
    });
    var Total = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["__file", "total.vue"]]);
    const paginationPagerProps = buildProps({
      currentPage: {
        type: Number,
        default: 1
      },
      pageCount: {
        type: Number,
        required: true
      },
      pagerCount: {
        type: Number,
        default: 7
      },
      disabled: Boolean
    });
    const __default__$L = /* @__PURE__ */ defineComponent({
      name: "ElPaginationPager"
    });
    const _sfc_main$11 = /* @__PURE__ */ defineComponent({
      ...__default__$L,
      props: paginationPagerProps,
      emits: [CHANGE_EVENT],
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const nsPager = useNamespace("pager");
        const nsIcon = useNamespace("icon");
        const { t } = useLocale();
        const showPrevMore = ref(false);
        const showNextMore = ref(false);
        const quickPrevHover = ref(false);
        const quickNextHover = ref(false);
        const quickPrevFocus = ref(false);
        const quickNextFocus = ref(false);
        const pagers = computed(() => {
          const pagerCount = props2.pagerCount;
          const halfPagerCount = (pagerCount - 1) / 2;
          const currentPage = Number(props2.currentPage);
          const pageCount = Number(props2.pageCount);
          let showPrevMore2 = false;
          let showNextMore2 = false;
          if (pageCount > pagerCount) {
            if (currentPage > pagerCount - halfPagerCount) {
              showPrevMore2 = true;
            }
            if (currentPage < pageCount - halfPagerCount) {
              showNextMore2 = true;
            }
          }
          const array = [];
          if (showPrevMore2 && !showNextMore2) {
            const startPage = pageCount - (pagerCount - 2);
            for (let i2 = startPage; i2 < pageCount; i2++) {
              array.push(i2);
            }
          } else if (!showPrevMore2 && showNextMore2) {
            for (let i2 = 2; i2 < pagerCount; i2++) {
              array.push(i2);
            }
          } else if (showPrevMore2 && showNextMore2) {
            const offset2 = Math.floor(pagerCount / 2) - 1;
            for (let i2 = currentPage - offset2; i2 <= currentPage + offset2; i2++) {
              array.push(i2);
            }
          } else {
            for (let i2 = 2; i2 < pageCount; i2++) {
              array.push(i2);
            }
          }
          return array;
        });
        const prevMoreKls = computed(() => [
          "more",
          "btn-quickprev",
          nsIcon.b(),
          nsPager.is("disabled", props2.disabled)
        ]);
        const nextMoreKls = computed(() => [
          "more",
          "btn-quicknext",
          nsIcon.b(),
          nsPager.is("disabled", props2.disabled)
        ]);
        const tabindex = computed(() => props2.disabled ? -1 : 0);
        watchEffect(() => {
          const halfPagerCount = (props2.pagerCount - 1) / 2;
          showPrevMore.value = false;
          showNextMore.value = false;
          if (props2.pageCount > props2.pagerCount) {
            if (props2.currentPage > props2.pagerCount - halfPagerCount) {
              showPrevMore.value = true;
            }
            if (props2.currentPage < props2.pageCount - halfPagerCount) {
              showNextMore.value = true;
            }
          }
        });
        function onMouseEnter(forward = false) {
          if (props2.disabled)
            return;
          if (forward) {
            quickPrevHover.value = true;
          } else {
            quickNextHover.value = true;
          }
        }
        function onFocus(forward = false) {
          if (forward) {
            quickPrevFocus.value = true;
          } else {
            quickNextFocus.value = true;
          }
        }
        function onEnter(e2) {
          const target = e2.target;
          if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
            const newPage = Number(target.textContent);
            if (newPage !== props2.currentPage) {
              emit2(CHANGE_EVENT, newPage);
            }
          } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
            onPagerClick(e2);
          }
        }
        function onPagerClick(event) {
          const target = event.target;
          if (target.tagName.toLowerCase() === "ul" || props2.disabled) {
            return;
          }
          let newPage = Number(target.textContent);
          const pageCount = props2.pageCount;
          const currentPage = props2.currentPage;
          const pagerCountOffset = props2.pagerCount - 2;
          if (target.className.includes("more")) {
            if (target.className.includes("quickprev")) {
              newPage = currentPage - pagerCountOffset;
            } else if (target.className.includes("quicknext")) {
              newPage = currentPage + pagerCountOffset;
            }
          }
          if (!Number.isNaN(+newPage)) {
            if (newPage < 1) {
              newPage = 1;
            }
            if (newPage > pageCount) {
              newPage = pageCount;
            }
          }
          if (newPage !== currentPage) {
            emit2(CHANGE_EVENT, newPage);
          }
        }
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("ul", {
            class: normalizeClass(unref(nsPager).b()),
            onClick: onPagerClick,
            onKeyup: withKeys(onEnter, ["enter"])
          }, [
            _ctx.pageCount > 0 ? (openBlock(), createElementBlock("li", {
              key: 0,
              class: normalizeClass([[
                unref(nsPager).is("active", _ctx.currentPage === 1),
                unref(nsPager).is("disabled", _ctx.disabled)
              ], "number"]),
              "aria-current": _ctx.currentPage === 1,
              "aria-label": unref(t)("el.pagination.currentPage", { pager: 1 }),
              tabindex: unref(tabindex)
            }, " 1 ", 10, ["aria-current", "aria-label", "tabindex"])) : createCommentVNode("v-if", true),
            showPrevMore.value ? (openBlock(), createElementBlock("li", {
              key: 1,
              class: normalizeClass(unref(prevMoreKls)),
              tabindex: unref(tabindex),
              "aria-label": unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
              onMouseenter: ($event) => onMouseEnter(true),
              onMouseleave: ($event) => quickPrevHover.value = false,
              onFocus: ($event) => onFocus(true),
              onBlur: ($event) => quickPrevFocus.value = false
            }, [
              (quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_left_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))
            ], 42, ["tabindex", "aria-label", "onMouseenter", "onMouseleave", "onFocus", "onBlur"])) : createCommentVNode("v-if", true),
            (openBlock(true), createElementBlock(Fragment, null, renderList(unref(pagers), (pager) => {
              return openBlock(), createElementBlock("li", {
                key: pager,
                class: normalizeClass([[
                  unref(nsPager).is("active", _ctx.currentPage === pager),
                  unref(nsPager).is("disabled", _ctx.disabled)
                ], "number"]),
                "aria-current": _ctx.currentPage === pager,
                "aria-label": unref(t)("el.pagination.currentPage", { pager }),
                tabindex: unref(tabindex)
              }, toDisplayString(pager), 11, ["aria-current", "aria-label", "tabindex"]);
            }), 128)),
            showNextMore.value ? (openBlock(), createElementBlock("li", {
              key: 2,
              class: normalizeClass(unref(nextMoreKls)),
              tabindex: unref(tabindex),
              "aria-label": unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
              onMouseenter: ($event) => onMouseEnter(),
              onMouseleave: ($event) => quickNextHover.value = false,
              onFocus: ($event) => onFocus(),
              onBlur: ($event) => quickNextFocus.value = false
            }, [
              (quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (openBlock(), createBlock(unref(d_arrow_right_default), { key: 0 })) : (openBlock(), createBlock(unref(more_filled_default), { key: 1 }))
            ], 42, ["tabindex", "aria-label", "onMouseenter", "onMouseleave", "onFocus", "onBlur"])) : createCommentVNode("v-if", true),
            _ctx.pageCount > 1 ? (openBlock(), createElementBlock("li", {
              key: 3,
              class: normalizeClass([[
                unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
                unref(nsPager).is("disabled", _ctx.disabled)
              ], "number"]),
              "aria-current": _ctx.currentPage === _ctx.pageCount,
              "aria-label": unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
              tabindex: unref(tabindex)
            }, toDisplayString(_ctx.pageCount), 11, ["aria-current", "aria-label", "tabindex"])) : createCommentVNode("v-if", true)
          ], 42, ["onKeyup"]);
        };
      }
    });
    var Pager = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__file", "pager.vue"]]);
    const isAbsent = (v4) => typeof v4 !== "number";
    const paginationProps = buildProps({
      pageSize: Number,
      defaultPageSize: Number,
      total: Number,
      pageCount: Number,
      pagerCount: {
        type: Number,
        validator: (value) => {
          return isNumber$2(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
        },
        default: 7
      },
      currentPage: Number,
      defaultCurrentPage: Number,
      layout: {
        type: String,
        default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
      },
      pageSizes: {
        type: definePropType(Array),
        default: () => mutable([10, 20, 30, 40, 50, 100])
      },
      popperClass: {
        type: String,
        default: ""
      },
      prevText: {
        type: String,
        default: ""
      },
      prevIcon: {
        type: iconPropType,
        default: () => arrow_left_default
      },
      nextText: {
        type: String,
        default: ""
      },
      nextIcon: {
        type: iconPropType,
        default: () => arrow_right_default
      },
      teleported: {
        type: Boolean,
        default: true
      },
      small: Boolean,
      size: useSizeProp,
      background: Boolean,
      disabled: Boolean,
      hideOnSinglePage: Boolean,
      appendSizeTo: String
    });
    const paginationEmits = {
      "update:current-page": (val) => isNumber$2(val),
      "update:page-size": (val) => isNumber$2(val),
      "size-change": (val) => isNumber$2(val),
      change: (currentPage, pageSize) => isNumber$2(currentPage) && isNumber$2(pageSize),
      "current-change": (val) => isNumber$2(val),
      "prev-click": (val) => isNumber$2(val),
      "next-click": (val) => isNumber$2(val)
    };
    const componentName = "ElPagination";
    var Pagination = /* @__PURE__ */ defineComponent({
      name: componentName,
      props: paginationProps,
      emits: paginationEmits,
      setup(props2, { emit: emit2, slots }) {
        const { t } = useLocale();
        const ns = useNamespace("pagination");
        const vnodeProps = getCurrentInstance().vnode.props || {};
        const _globalSize = useGlobalSize();
        const _size = computed(() => {
          var _a2;
          return props2.small ? "small" : (_a2 = props2.size) != null ? _a2 : _globalSize.value;
        });
        useDeprecated({
          from: "small",
          replacement: "size",
          version: "3.0.0",
          scope: "el-pagination",
          ref: "https://element-plus.org/zh-CN/component/pagination.html"
        }, computed(() => !!props2.small));
        const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
        const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
        const assertValidUsage = computed(() => {
          if (isAbsent(props2.total) && isAbsent(props2.pageCount))
            return false;
          if (!isAbsent(props2.currentPage) && !hasCurrentPageListener)
            return false;
          if (props2.layout.includes("sizes")) {
            if (!isAbsent(props2.pageCount)) {
              if (!hasPageSizeListener)
                return false;
            } else if (!isAbsent(props2.total)) {
              if (!isAbsent(props2.pageSize)) {
                if (!hasPageSizeListener) {
                  return false;
                }
              }
            }
          }
          return true;
        });
        const innerPageSize = ref(isAbsent(props2.defaultPageSize) ? 10 : props2.defaultPageSize);
        const innerCurrentPage = ref(isAbsent(props2.defaultCurrentPage) ? 1 : props2.defaultCurrentPage);
        const pageSizeBridge = computed({
          get() {
            return isAbsent(props2.pageSize) ? innerPageSize.value : props2.pageSize;
          },
          set(v4) {
            if (isAbsent(props2.pageSize)) {
              innerPageSize.value = v4;
            }
            if (hasPageSizeListener) {
              emit2("update:page-size", v4);
              emit2("size-change", v4);
            }
          }
        });
        const pageCountBridge = computed(() => {
          let pageCount = 0;
          if (!isAbsent(props2.pageCount)) {
            pageCount = props2.pageCount;
          } else if (!isAbsent(props2.total)) {
            pageCount = Math.max(1, Math.ceil(props2.total / pageSizeBridge.value));
          }
          return pageCount;
        });
        const currentPageBridge = computed({
          get() {
            return isAbsent(props2.currentPage) ? innerCurrentPage.value : props2.currentPage;
          },
          set(v4) {
            let newCurrentPage = v4;
            if (v4 < 1) {
              newCurrentPage = 1;
            } else if (v4 > pageCountBridge.value) {
              newCurrentPage = pageCountBridge.value;
            }
            if (isAbsent(props2.currentPage)) {
              innerCurrentPage.value = newCurrentPage;
            }
            if (hasCurrentPageListener) {
              emit2("update:current-page", newCurrentPage);
              emit2("current-change", newCurrentPage);
            }
          }
        });
        watch(pageCountBridge, (val) => {
          if (currentPageBridge.value > val)
            currentPageBridge.value = val;
        });
        watch([currentPageBridge, pageSizeBridge], (value) => {
          emit2(CHANGE_EVENT, ...value);
        }, { flush: "post" });
        function handleCurrentChange2(val) {
          currentPageBridge.value = val;
        }
        function handleSizeChange(val) {
          pageSizeBridge.value = val;
          const newPageCount = pageCountBridge.value;
          if (currentPageBridge.value > newPageCount) {
            currentPageBridge.value = newPageCount;
          }
        }
        function prev() {
          if (props2.disabled)
            return;
          currentPageBridge.value -= 1;
          emit2("prev-click", currentPageBridge.value);
        }
        function next() {
          if (props2.disabled)
            return;
          currentPageBridge.value += 1;
          emit2("next-click", currentPageBridge.value);
        }
        function addClass2(element, cls) {
          if (element) {
            if (!element.props) {
              element.props = {};
            }
            element.props.class = [element.props.class, cls].join(" ");
          }
        }
        provide(elPaginationKey, {
          pageCount: pageCountBridge,
          disabled: computed(() => props2.disabled),
          currentPage: currentPageBridge,
          changeEvent: handleCurrentChange2,
          handleSizeChange
        });
        return () => {
          var _a2, _b2;
          if (!assertValidUsage.value) {
            debugWarn(componentName, t("el.pagination.deprecationWarning"));
            return null;
          }
          if (!props2.layout)
            return null;
          if (props2.hideOnSinglePage && pageCountBridge.value <= 1)
            return null;
          const rootChildren = [];
          const rightWrapperChildren = [];
          const rightWrapperRoot = h$1("div", { class: ns.e("rightwrapper") }, rightWrapperChildren);
          const TEMPLATE_MAP = {
            prev: h$1(Prev, {
              disabled: props2.disabled,
              currentPage: currentPageBridge.value,
              prevText: props2.prevText,
              prevIcon: props2.prevIcon,
              onClick: prev
            }),
            jumper: h$1(Jumper, {
              size: _size.value
            }),
            pager: h$1(Pager, {
              currentPage: currentPageBridge.value,
              pageCount: pageCountBridge.value,
              pagerCount: props2.pagerCount,
              onChange: handleCurrentChange2,
              disabled: props2.disabled
            }),
            next: h$1(Next, {
              disabled: props2.disabled,
              currentPage: currentPageBridge.value,
              pageCount: pageCountBridge.value,
              nextText: props2.nextText,
              nextIcon: props2.nextIcon,
              onClick: next
            }),
            sizes: h$1(Sizes, {
              pageSize: pageSizeBridge.value,
              pageSizes: props2.pageSizes,
              popperClass: props2.popperClass,
              disabled: props2.disabled,
              teleported: props2.teleported,
              size: _size.value,
              appendSizeTo: props2.appendSizeTo
            }),
            slot: (_b2 = (_a2 = slots == null ? void 0 : slots.default) == null ? void 0 : _a2.call(slots)) != null ? _b2 : null,
            total: h$1(Total, { total: isAbsent(props2.total) ? 0 : props2.total })
          };
          const components = props2.layout.split(",").map((item) => item.trim());
          let haveRightWrapper = false;
          components.forEach((c2) => {
            if (c2 === "->") {
              haveRightWrapper = true;
              return;
            }
            if (!haveRightWrapper) {
              rootChildren.push(TEMPLATE_MAP[c2]);
            } else {
              rightWrapperChildren.push(TEMPLATE_MAP[c2]);
            }
          });
          addClass2(rootChildren[0], ns.is("first"));
          addClass2(rootChildren[rootChildren.length - 1], ns.is("last"));
          if (haveRightWrapper && rightWrapperChildren.length > 0) {
            addClass2(rightWrapperChildren[0], ns.is("first"));
            addClass2(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last"));
            rootChildren.push(rightWrapperRoot);
          }
          return h$1("div", {
            class: [
              ns.b(),
              ns.is("background", props2.background),
              ns.m(_size.value)
            ]
          }, rootChildren);
        };
      }
    });
    const ElPagination = withInstall(Pagination);
    const popconfirmProps = buildProps({
      title: String,
      confirmButtonText: String,
      cancelButtonText: String,
      confirmButtonType: {
        type: String,
        values: buttonTypes,
        default: "primary"
      },
      cancelButtonType: {
        type: String,
        values: buttonTypes,
        default: "text"
      },
      icon: {
        type: iconPropType,
        default: () => question_filled_default
      },
      iconColor: {
        type: String,
        default: "#f90"
      },
      hideIcon: {
        type: Boolean,
        default: false
      },
      hideAfter: {
        type: Number,
        default: 200
      },
      teleported: useTooltipContentProps.teleported,
      persistent: useTooltipContentProps.persistent,
      width: {
        type: [String, Number],
        default: 150
      }
    });
    const popconfirmEmits = {
      confirm: (e2) => e2 instanceof MouseEvent,
      cancel: (e2) => e2 instanceof MouseEvent
    };
    const __default__$K = /* @__PURE__ */ defineComponent({
      name: "ElPopconfirm"
    });
    const _sfc_main$10 = /* @__PURE__ */ defineComponent({
      ...__default__$K,
      props: popconfirmProps,
      emits: popconfirmEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const ns = useNamespace("popconfirm");
        const tooltipRef = ref();
        const hidePopper = () => {
          var _a2, _b2;
          (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.onClose) == null ? void 0 : _b2.call(_a2);
        };
        const style = computed(() => {
          return {
            width: addUnit(props2.width)
          };
        });
        const confirm = (e2) => {
          emit2("confirm", e2);
          hidePopper();
        };
        const cancel = (e2) => {
          emit2("cancel", e2);
          hidePopper();
        };
        const finalConfirmButtonText = computed(() => props2.confirmButtonText || t("el.popconfirm.confirmButtonText"));
        const finalCancelButtonText = computed(() => props2.cancelButtonText || t("el.popconfirm.cancelButtonText"));
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), mergeProps({
            ref_key: "tooltipRef",
            ref: tooltipRef,
            trigger: "click",
            effect: "light"
          }, _ctx.$attrs, {
            "popper-class": `${unref(ns).namespace.value}-popover`,
            "popper-style": unref(style),
            teleported: _ctx.teleported,
            "fallback-placements": ["bottom", "top", "right", "left"],
            "hide-after": _ctx.hideAfter,
            persistent: _ctx.persistent
          }), {
            content: withCtx(() => [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).b())
              }, [
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("main"))
                }, [
                  !_ctx.hideIcon && _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(unref(ns).e("icon")),
                    style: normalizeStyle$1({ color: _ctx.iconColor })
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
                    ]),
                    _: 1
                  }, 8, ["class", "style"])) : createCommentVNode("v-if", true),
                  createTextVNode(" " + toDisplayString(_ctx.title), 1)
                ], 2),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("action"))
                }, [
                  renderSlot(_ctx.$slots, "actions", {
                    confirm,
                    cancel
                  }, () => [
                    createVNode$1(unref(ElButton), {
                      size: "small",
                      type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
                      text: _ctx.cancelButtonType === "text",
                      onClick: cancel
                    }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(unref(finalCancelButtonText)), 1)
                      ]),
                      _: 1
                    }, 8, ["type", "text"]),
                    createVNode$1(unref(ElButton), {
                      size: "small",
                      type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
                      text: _ctx.confirmButtonType === "text",
                      onClick: confirm
                    }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(unref(finalConfirmButtonText)), 1)
                      ]),
                      _: 1
                    }, 8, ["type", "text"])
                  ])
                ], 2)
              ], 2)
            ]),
            default: withCtx(() => [
              _ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
            ]),
            _: 3
          }, 16, ["popper-class", "popper-style", "teleported", "hide-after", "persistent"]);
        };
      }
    });
    var Popconfirm = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__file", "popconfirm.vue"]]);
    const ElPopconfirm = withInstall(Popconfirm);
    const popoverProps = buildProps({
      trigger: useTooltipTriggerProps.trigger,
      triggerKeys: useTooltipTriggerProps.triggerKeys,
      placement: dropdownProps.placement,
      disabled: useTooltipTriggerProps.disabled,
      visible: useTooltipContentProps.visible,
      transition: useTooltipContentProps.transition,
      popperOptions: dropdownProps.popperOptions,
      tabindex: dropdownProps.tabindex,
      content: useTooltipContentProps.content,
      popperStyle: useTooltipContentProps.popperStyle,
      popperClass: useTooltipContentProps.popperClass,
      enterable: {
        ...useTooltipContentProps.enterable,
        default: true
      },
      effect: {
        ...useTooltipContentProps.effect,
        default: "light"
      },
      teleported: useTooltipContentProps.teleported,
      appendTo: useTooltipContentProps.appendTo,
      title: String,
      width: {
        type: [String, Number],
        default: 150
      },
      offset: {
        type: Number,
        default: void 0
      },
      showAfter: {
        type: Number,
        default: 0
      },
      hideAfter: {
        type: Number,
        default: 200
      },
      autoClose: {
        type: Number,
        default: 0
      },
      showArrow: {
        type: Boolean,
        default: true
      },
      persistent: {
        type: Boolean,
        default: true
      },
      "onUpdate:visible": {
        type: Function
      }
    });
    const popoverEmits = {
      "update:visible": (value) => isBoolean$1(value),
      "before-enter": () => true,
      "before-leave": () => true,
      "after-enter": () => true,
      "after-leave": () => true
    };
    const updateEventKeyRaw = `onUpdate:visible`;
    const __default__$J = /* @__PURE__ */ defineComponent({
      name: "ElPopover"
    });
    const _sfc_main$$ = /* @__PURE__ */ defineComponent({
      ...__default__$J,
      props: popoverProps,
      emits: popoverEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const onUpdateVisible = computed(() => {
          return props2[updateEventKeyRaw];
        });
        const ns = useNamespace("popover");
        const tooltipRef = ref();
        const popperRef = computed(() => {
          var _a2;
          return (_a2 = unref(tooltipRef)) == null ? void 0 : _a2.popperRef;
        });
        const style = computed(() => {
          return [
            {
              width: addUnit(props2.width)
            },
            props2.popperStyle
          ];
        });
        const kls = computed(() => {
          return [ns.b(), props2.popperClass, { [ns.m("plain")]: !!props2.content }];
        });
        const gpuAcceleration = computed(() => {
          return props2.transition === `${ns.namespace.value}-fade-in-linear`;
        });
        const hide = () => {
          var _a2;
          (_a2 = tooltipRef.value) == null ? void 0 : _a2.hide();
        };
        const beforeEnter = () => {
          emit2("before-enter");
        };
        const beforeLeave = () => {
          emit2("before-leave");
        };
        const afterEnter = () => {
          emit2("after-enter");
        };
        const afterLeave = () => {
          emit2("update:visible", false);
          emit2("after-leave");
        };
        expose({
          popperRef,
          hide
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElTooltip), mergeProps({
            ref_key: "tooltipRef",
            ref: tooltipRef
          }, _ctx.$attrs, {
            trigger: _ctx.trigger,
            "trigger-keys": _ctx.triggerKeys,
            placement: _ctx.placement,
            disabled: _ctx.disabled,
            visible: _ctx.visible,
            transition: _ctx.transition,
            "popper-options": _ctx.popperOptions,
            tabindex: _ctx.tabindex,
            content: _ctx.content,
            offset: _ctx.offset,
            "show-after": _ctx.showAfter,
            "hide-after": _ctx.hideAfter,
            "auto-close": _ctx.autoClose,
            "show-arrow": _ctx.showArrow,
            "aria-label": _ctx.title,
            effect: _ctx.effect,
            enterable: _ctx.enterable,
            "popper-class": unref(kls),
            "popper-style": unref(style),
            teleported: _ctx.teleported,
            "append-to": _ctx.appendTo,
            persistent: _ctx.persistent,
            "gpu-acceleration": unref(gpuAcceleration),
            "onUpdate:visible": unref(onUpdateVisible),
            onBeforeShow: beforeEnter,
            onBeforeHide: beforeLeave,
            onShow: afterEnter,
            onHide: afterLeave
          }), {
            content: withCtx(() => [
              _ctx.title ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("title")),
                role: "title"
              }, toDisplayString(_ctx.title), 3)) : createCommentVNode("v-if", true),
              renderSlot(_ctx.$slots, "default", {}, () => [
                createTextVNode(toDisplayString(_ctx.content), 1)
              ])
            ]),
            default: withCtx(() => [
              _ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
            ]),
            _: 3
          }, 16, ["trigger", "trigger-keys", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "append-to", "persistent", "gpu-acceleration", "onUpdate:visible"]);
        };
      }
    });
    var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__file", "popover.vue"]]);
    const attachEvents = (el, binding) => {
      const popperComponent = binding.arg || binding.value;
      const popover = popperComponent == null ? void 0 : popperComponent.popperRef;
      if (popover) {
        popover.triggerRef = el;
      }
    };
    var PopoverDirective = {
      mounted(el, binding) {
        attachEvents(el, binding);
      },
      updated(el, binding) {
        attachEvents(el, binding);
      }
    };
    const VPopover = "popover";
    const ElPopoverDirective = withInstallDirective(PopoverDirective, VPopover);
    const ElPopover = withInstall(Popover, {
      directive: ElPopoverDirective
    });
    const progressProps = buildProps({
      type: {
        type: String,
        default: "line",
        values: ["line", "circle", "dashboard"]
      },
      percentage: {
        type: Number,
        default: 0,
        validator: (val) => val >= 0 && val <= 100
      },
      status: {
        type: String,
        default: "",
        values: ["", "success", "exception", "warning"]
      },
      indeterminate: Boolean,
      duration: {
        type: Number,
        default: 3
      },
      strokeWidth: {
        type: Number,
        default: 6
      },
      strokeLinecap: {
        type: definePropType(String),
        default: "round"
      },
      textInside: Boolean,
      width: {
        type: Number,
        default: 126
      },
      showText: {
        type: Boolean,
        default: true
      },
      color: {
        type: definePropType([
          String,
          Array,
          Function
        ]),
        default: ""
      },
      striped: Boolean,
      stripedFlow: Boolean,
      format: {
        type: definePropType(Function),
        default: (percentage) => `${percentage}%`
      }
    });
    const __default__$I = /* @__PURE__ */ defineComponent({
      name: "ElProgress"
    });
    const _sfc_main$_ = /* @__PURE__ */ defineComponent({
      ...__default__$I,
      props: progressProps,
      setup(__props) {
        const props2 = __props;
        const STATUS_COLOR_MAP = {
          success: "#13ce66",
          exception: "#ff4949",
          warning: "#e6a23c",
          default: "#20a0ff"
        };
        const ns = useNamespace("progress");
        const barStyle = computed(() => {
          const barStyle2 = {
            width: `${props2.percentage}%`,
            animationDuration: `${props2.duration}s`
          };
          const color2 = getCurrentColor(props2.percentage);
          if (color2.includes("gradient")) {
            barStyle2.background = color2;
          } else {
            barStyle2.backgroundColor = color2;
          }
          return barStyle2;
        });
        const relativeStrokeWidth = computed(() => (props2.strokeWidth / props2.width * 100).toFixed(1));
        const radius = computed(() => {
          if (["circle", "dashboard"].includes(props2.type)) {
            return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10);
          }
          return 0;
        });
        const trackPath = computed(() => {
          const r = radius.value;
          const isDashboard = props2.type === "dashboard";
          return `
          M 50 50
          m 0 ${isDashboard ? "" : "-"}${r}
          a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
          a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
          `;
        });
        const perimeter = computed(() => 2 * Math.PI * radius.value);
        const rate = computed(() => props2.type === "dashboard" ? 0.75 : 1);
        const strokeDashoffset = computed(() => {
          const offset2 = -1 * perimeter.value * (1 - rate.value) / 2;
          return `${offset2}px`;
        });
        const trailPathStyle = computed(() => ({
          strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
          strokeDashoffset: strokeDashoffset.value
        }));
        const circlePathStyle = computed(() => ({
          strokeDasharray: `${perimeter.value * rate.value * (props2.percentage / 100)}px, ${perimeter.value}px`,
          strokeDashoffset: strokeDashoffset.value,
          transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
        }));
        const stroke = computed(() => {
          let ret;
          if (props2.color) {
            ret = getCurrentColor(props2.percentage);
          } else {
            ret = STATUS_COLOR_MAP[props2.status] || STATUS_COLOR_MAP.default;
          }
          return ret;
        });
        const statusIcon = computed(() => {
          if (props2.status === "warning") {
            return warning_filled_default;
          }
          if (props2.type === "line") {
            return props2.status === "success" ? circle_check_default : circle_close_default;
          } else {
            return props2.status === "success" ? check_default : close_default;
          }
        });
        const progressTextSize = computed(() => {
          return props2.type === "line" ? 12 + props2.strokeWidth * 0.4 : props2.width * 0.111111 + 2;
        });
        const content2 = computed(() => props2.format(props2.percentage));
        function getColors(color2) {
          const span = 100 / color2.length;
          const seriesColors = color2.map((seriesColor, index) => {
            if (isString$3(seriesColor)) {
              return {
                color: seriesColor,
                percentage: (index + 1) * span
              };
            }
            return seriesColor;
          });
          return seriesColors.sort((a2, b2) => a2.percentage - b2.percentage);
        }
        const getCurrentColor = (percentage) => {
          var _a2;
          const { color: color2 } = props2;
          if (isFunction$4(color2)) {
            return color2(percentage);
          } else if (isString$3(color2)) {
            return color2;
          } else {
            const colors = getColors(color2);
            for (const color22 of colors) {
              if (color22.percentage > percentage)
                return color22.color;
            }
            return (_a2 = colors[colors.length - 1]) == null ? void 0 : _a2.color;
          }
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ns).b(),
              unref(ns).m(_ctx.type),
              unref(ns).is(_ctx.status),
              {
                [unref(ns).m("without-text")]: !_ctx.showText,
                [unref(ns).m("text-inside")]: _ctx.textInside
              }
            ]),
            role: "progressbar",
            "aria-valuenow": _ctx.percentage,
            "aria-valuemin": "0",
            "aria-valuemax": "100"
          }, [
            _ctx.type === "line" ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).b("bar"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).be("bar", "outer")),
                style: normalizeStyle$1({ height: `${_ctx.strokeWidth}px` })
              }, [
                createBaseVNode("div", {
                  class: normalizeClass([
                    unref(ns).be("bar", "inner"),
                    { [unref(ns).bem("bar", "inner", "indeterminate")]: _ctx.indeterminate },
                    { [unref(ns).bem("bar", "inner", "striped")]: _ctx.striped },
                    { [unref(ns).bem("bar", "inner", "striped-flow")]: _ctx.stripedFlow }
                  ]),
                  style: normalizeStyle$1(unref(barStyle))
                }, [
                  (_ctx.showText || _ctx.$slots.default) && _ctx.textInside ? (openBlock(), createElementBlock("div", {
                    key: 0,
                    class: normalizeClass(unref(ns).be("bar", "innerText"))
                  }, [
                    renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
                      createBaseVNode("span", null, toDisplayString(unref(content2)), 1)
                    ])
                  ], 2)) : createCommentVNode("v-if", true)
                ], 6)
              ], 6)
            ], 2)) : (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).b("circle")),
              style: normalizeStyle$1({ height: `${_ctx.width}px`, width: `${_ctx.width}px` })
            }, [
              (openBlock(), createElementBlock("svg", { viewBox: "0 0 100 100" }, [
                createBaseVNode("path", {
                  class: normalizeClass(unref(ns).be("circle", "track")),
                  d: unref(trackPath),
                  stroke: `var(${unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
                  "stroke-linecap": _ctx.strokeLinecap,
                  "stroke-width": unref(relativeStrokeWidth),
                  fill: "none",
                  style: normalizeStyle$1(unref(trailPathStyle))
                }, null, 14, ["d", "stroke", "stroke-linecap", "stroke-width"]),
                createBaseVNode("path", {
                  class: normalizeClass(unref(ns).be("circle", "path")),
                  d: unref(trackPath),
                  stroke: unref(stroke),
                  fill: "none",
                  opacity: _ctx.percentage ? 1 : 0,
                  "stroke-linecap": _ctx.strokeLinecap,
                  "stroke-width": unref(relativeStrokeWidth),
                  style: normalizeStyle$1(unref(circlePathStyle))
                }, null, 14, ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"])
              ]))
            ], 6)),
            (_ctx.showText || _ctx.$slots.default) && !_ctx.textInside ? (openBlock(), createElementBlock("div", {
              key: 2,
              class: normalizeClass(unref(ns).e("text")),
              style: normalizeStyle$1({ fontSize: `${unref(progressTextSize)}px` })
            }, [
              renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
                !_ctx.status ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(unref(content2)), 1)) : (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(unref(statusIcon))))
                  ]),
                  _: 1
                }))
              ])
            ], 6)) : createCommentVNode("v-if", true)
          ], 10, ["aria-valuenow"]);
        };
      }
    });
    var Progress = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__file", "progress.vue"]]);
    const ElProgress = withInstall(Progress);
    const rateProps = buildProps({
      modelValue: {
        type: Number,
        default: 0
      },
      id: {
        type: String,
        default: void 0
      },
      lowThreshold: {
        type: Number,
        default: 2
      },
      highThreshold: {
        type: Number,
        default: 4
      },
      max: {
        type: Number,
        default: 5
      },
      colors: {
        type: definePropType([Array, Object]),
        default: () => mutable(["", "", ""])
      },
      voidColor: {
        type: String,
        default: ""
      },
      disabledVoidColor: {
        type: String,
        default: ""
      },
      icons: {
        type: definePropType([Array, Object]),
        default: () => [star_filled_default, star_filled_default, star_filled_default]
      },
      voidIcon: {
        type: iconPropType,
        default: () => star_default
      },
      disabledVoidIcon: {
        type: iconPropType,
        default: () => star_filled_default
      },
      disabled: Boolean,
      allowHalf: Boolean,
      showText: Boolean,
      showScore: Boolean,
      textColor: {
        type: String,
        default: ""
      },
      texts: {
        type: definePropType(Array),
        default: () => mutable([
          "Extremely bad",
          "Disappointed",
          "Fair",
          "Satisfied",
          "Surprise"
        ])
      },
      scoreTemplate: {
        type: String,
        default: "{value}"
      },
      size: useSizeProp,
      clearable: Boolean,
      ...useAriaProps(["ariaLabel"])
    });
    const rateEmits = {
      [CHANGE_EVENT]: (value) => isNumber$2(value),
      [UPDATE_MODEL_EVENT]: (value) => isNumber$2(value)
    };
    const __default__$H = /* @__PURE__ */ defineComponent({
      name: "ElRate"
    });
    const _sfc_main$Z = /* @__PURE__ */ defineComponent({
      ...__default__$H,
      props: rateProps,
      emits: rateEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        function getValueFromMap(value, map2) {
          const isExcludedObject = (val) => isObject$7(val);
          const matchedKeys = Object.keys(map2).map((key) => +key).filter((key) => {
            const val = map2[key];
            const excluded = isExcludedObject(val) ? val.excluded : false;
            return excluded ? value < key : value <= key;
          }).sort((a2, b2) => a2 - b2);
          const matchedValue = map2[matchedKeys[0]];
          return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
        }
        const formContext = inject(formContextKey, void 0);
        const formItemContext = inject(formItemContextKey, void 0);
        const rateSize = useFormSize();
        const ns = useNamespace("rate");
        const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext
        });
        const currentValue = ref(props2.modelValue);
        const hoverIndex = ref(-1);
        const pointerAtLeftHalf = ref(true);
        const rateClasses = computed(() => [ns.b(), ns.m(rateSize.value)]);
        const rateDisabled = computed(() => props2.disabled || (formContext == null ? void 0 : formContext.disabled));
        const rateStyles = computed(() => {
          return ns.cssVarBlock({
            "void-color": props2.voidColor,
            "disabled-void-color": props2.disabledVoidColor,
            "fill-color": activeColor.value
          });
        });
        const text = computed(() => {
          let result = "";
          if (props2.showScore) {
            result = props2.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props2.modelValue}` : `${currentValue.value}`);
          } else if (props2.showText) {
            result = props2.texts[Math.ceil(currentValue.value) - 1];
          }
          return result;
        });
        const valueDecimal = computed(() => props2.modelValue * 100 - Math.floor(props2.modelValue) * 100);
        const colorMap = computed(() => isArray$5(props2.colors) ? {
          [props2.lowThreshold]: props2.colors[0],
          [props2.highThreshold]: { value: props2.colors[1], excluded: true },
          [props2.max]: props2.colors[2]
        } : props2.colors);
        const activeColor = computed(() => {
          const color2 = getValueFromMap(currentValue.value, colorMap.value);
          return isObject$7(color2) ? "" : color2;
        });
        const decimalStyle = computed(() => {
          let width = "";
          if (rateDisabled.value) {
            width = `${valueDecimal.value}%`;
          } else if (props2.allowHalf) {
            width = "50%";
          }
          return {
            color: activeColor.value,
            width
          };
        });
        const componentMap = computed(() => {
          let icons = isArray$5(props2.icons) ? [...props2.icons] : { ...props2.icons };
          icons = markRaw(icons);
          return isArray$5(icons) ? {
            [props2.lowThreshold]: icons[0],
            [props2.highThreshold]: {
              value: icons[1],
              excluded: true
            },
            [props2.max]: icons[2]
          } : icons;
        });
        const decimalIconComponent = computed(() => getValueFromMap(props2.modelValue, componentMap.value));
        const voidComponent = computed(() => rateDisabled.value ? isString$3(props2.disabledVoidIcon) ? props2.disabledVoidIcon : markRaw(props2.disabledVoidIcon) : isString$3(props2.voidIcon) ? props2.voidIcon : markRaw(props2.voidIcon));
        const activeComponent = computed(() => getValueFromMap(currentValue.value, componentMap.value));
        function showDecimalIcon(item) {
          const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props2.modelValue && item > props2.modelValue;
          const showWhenAllowHalf = props2.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
          return showWhenDisabled || showWhenAllowHalf;
        }
        function emitValue(value) {
          if (props2.clearable && value === props2.modelValue) {
            value = 0;
          }
          emit2(UPDATE_MODEL_EVENT, value);
          if (props2.modelValue !== value) {
            emit2(CHANGE_EVENT, value);
          }
        }
        function selectValue(value) {
          if (rateDisabled.value) {
            return;
          }
          if (props2.allowHalf && pointerAtLeftHalf.value) {
            emitValue(currentValue.value);
          } else {
            emitValue(value);
          }
        }
        function handleKey(e2) {
          if (rateDisabled.value) {
            return;
          }
          let _currentValue = currentValue.value;
          const code = e2.code;
          if (code === EVENT_CODE.up || code === EVENT_CODE.right) {
            if (props2.allowHalf) {
              _currentValue += 0.5;
            } else {
              _currentValue += 1;
            }
            e2.stopPropagation();
            e2.preventDefault();
          } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {
            if (props2.allowHalf) {
              _currentValue -= 0.5;
            } else {
              _currentValue -= 1;
            }
            e2.stopPropagation();
            e2.preventDefault();
          }
          _currentValue = _currentValue < 0 ? 0 : _currentValue;
          _currentValue = _currentValue > props2.max ? props2.max : _currentValue;
          emit2(UPDATE_MODEL_EVENT, _currentValue);
          emit2(CHANGE_EVENT, _currentValue);
          return _currentValue;
        }
        function setCurrentValue(value, event) {
          if (rateDisabled.value) {
            return;
          }
          if (props2.allowHalf && event) {
            let target = event.target;
            if (hasClass(target, ns.e("item"))) {
              target = target.querySelector(`.${ns.e("icon")}`);
            }
            if (target.clientWidth === 0 || hasClass(target, ns.e("decimal"))) {
              target = target.parentNode;
            }
            pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
            currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
          } else {
            currentValue.value = value;
          }
          hoverIndex.value = value;
        }
        function resetCurrentValue() {
          if (rateDisabled.value) {
            return;
          }
          if (props2.allowHalf) {
            pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue);
          }
          currentValue.value = props2.modelValue;
          hoverIndex.value = -1;
        }
        watch(() => props2.modelValue, (val) => {
          currentValue.value = val;
          pointerAtLeftHalf.value = props2.modelValue !== Math.floor(props2.modelValue);
        });
        if (!props2.modelValue) {
          emit2(UPDATE_MODEL_EVENT, 0);
        }
        expose({
          setCurrentValue,
          resetCurrentValue
        });
        return (_ctx, _cache) => {
          var _a2;
          return openBlock(), createElementBlock("div", {
            id: unref(inputId),
            class: normalizeClass([unref(rateClasses), unref(ns).is("disabled", unref(rateDisabled))]),
            role: "slider",
            "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "rating" : void 0,
            "aria-labelledby": unref(isLabeledByFormItem) ? (_a2 = unref(formItemContext)) == null ? void 0 : _a2.labelId : void 0,
            "aria-valuenow": currentValue.value,
            "aria-valuetext": unref(text) || void 0,
            "aria-valuemin": "0",
            "aria-valuemax": _ctx.max,
            tabindex: "0",
            style: normalizeStyle$1(unref(rateStyles)),
            onKeydown: handleKey
          }, [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.max, (item, key) => {
              return openBlock(), createElementBlock("span", {
                key,
                class: normalizeClass(unref(ns).e("item")),
                onMousemove: ($event) => setCurrentValue(item, $event),
                onMouseleave: resetCurrentValue,
                onClick: ($event) => selectValue(item)
              }, [
                createVNode$1(unref(ElIcon), {
                  class: normalizeClass([
                    unref(ns).e("icon"),
                    { hover: hoverIndex.value === item },
                    unref(ns).is("active", item <= currentValue.value)
                  ])
                }, {
                  default: withCtx(() => [
                    !showDecimalIcon(item) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                      withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(activeComponent)), null, null, 512)), [
                        [vShow, item <= currentValue.value]
                      ]),
                      withDirectives((openBlock(), createBlock(resolveDynamicComponent(unref(voidComponent)), null, null, 512)), [
                        [vShow, !(item <= currentValue.value)]
                      ])
                    ], 64)) : createCommentVNode("v-if", true),
                    showDecimalIcon(item) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                      (openBlock(), createBlock(resolveDynamicComponent(unref(voidComponent)), {
                        class: normalizeClass([unref(ns).em("decimal", "box")])
                      }, null, 8, ["class"])),
                      createVNode$1(unref(ElIcon), {
                        style: normalizeStyle$1(unref(decimalStyle)),
                        class: normalizeClass([unref(ns).e("icon"), unref(ns).e("decimal")])
                      }, {
                        default: withCtx(() => [
                          (openBlock(), createBlock(resolveDynamicComponent(unref(decimalIconComponent))))
                        ]),
                        _: 1
                      }, 8, ["style", "class"])
                    ], 64)) : createCommentVNode("v-if", true)
                  ]),
                  _: 2
                }, 1032, ["class"])
              ], 42, ["onMousemove", "onClick"]);
            }), 128)),
            _ctx.showText || _ctx.showScore ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: normalizeClass(unref(ns).e("text")),
              style: normalizeStyle$1({ color: _ctx.textColor })
            }, toDisplayString(unref(text)), 7)) : createCommentVNode("v-if", true)
          ], 46, ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax"]);
        };
      }
    });
    var Rate = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__file", "rate.vue"]]);
    const ElRate = withInstall(Rate);
    const IconMap = {
      success: "icon-success",
      warning: "icon-warning",
      error: "icon-error",
      info: "icon-info"
    };
    const IconComponentMap = {
      [IconMap.success]: circle_check_filled_default,
      [IconMap.warning]: warning_filled_default,
      [IconMap.error]: circle_close_filled_default,
      [IconMap.info]: info_filled_default
    };
    const resultProps = buildProps({
      title: {
        type: String,
        default: ""
      },
      subTitle: {
        type: String,
        default: ""
      },
      icon: {
        type: String,
        values: ["success", "warning", "info", "error"],
        default: "info"
      }
    });
    const __default__$G = /* @__PURE__ */ defineComponent({
      name: "ElResult"
    });
    const _sfc_main$Y = /* @__PURE__ */ defineComponent({
      ...__default__$G,
      props: resultProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("result");
        const resultIcon = computed(() => {
          const icon = props2.icon;
          const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
          const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
          return {
            class: iconClass,
            component: iconComponent
          };
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("icon"))
            }, [
              renderSlot(_ctx.$slots, "icon", {}, () => [
                unref(resultIcon).component ? (openBlock(), createBlock(resolveDynamicComponent(unref(resultIcon).component), {
                  key: 0,
                  class: normalizeClass(unref(resultIcon).class)
                }, null, 8, ["class"])) : createCommentVNode("v-if", true)
              ])
            ], 2),
            _ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("title"))
            }, [
              renderSlot(_ctx.$slots, "title", {}, () => [
                createBaseVNode("p", null, toDisplayString(_ctx.title), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            _ctx.subTitle || _ctx.$slots["sub-title"] ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("subtitle"))
            }, [
              renderSlot(_ctx.$slots, "sub-title", {}, () => [
                createBaseVNode("p", null, toDisplayString(_ctx.subTitle), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            _ctx.$slots.extra ? (openBlock(), createElementBlock("div", {
              key: 2,
              class: normalizeClass(unref(ns).e("extra"))
            }, [
              renderSlot(_ctx.$slots, "extra")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var Result = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__file", "result.vue"]]);
    const ElResult = withInstall(Result);
    const RowJustify = [
      "start",
      "center",
      "end",
      "space-around",
      "space-between",
      "space-evenly"
    ];
    const RowAlign = ["top", "middle", "bottom"];
    const rowProps = buildProps({
      tag: {
        type: String,
        default: "div"
      },
      gutter: {
        type: Number,
        default: 0
      },
      justify: {
        type: String,
        values: RowJustify,
        default: "start"
      },
      align: {
        type: String,
        values: RowAlign
      }
    });
    const __default__$F = /* @__PURE__ */ defineComponent({
      name: "ElRow"
    });
    const _sfc_main$X = /* @__PURE__ */ defineComponent({
      ...__default__$F,
      props: rowProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("row");
        const gutter = computed(() => props2.gutter);
        provide(rowContextKey, {
          gutter
        });
        const style = computed(() => {
          const styles = {};
          if (!props2.gutter) {
            return styles;
          }
          styles.marginRight = styles.marginLeft = `-${props2.gutter / 2}px`;
          return styles;
        });
        const rowKls = computed(() => [
          ns.b(),
          ns.is(`justify-${props2.justify}`, props2.justify !== "start"),
          ns.is(`align-${props2.align}`, !!props2.align)
        ]);
        return (_ctx, _cache) => {
          return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
            class: normalizeClass(unref(rowKls)),
            style: normalizeStyle$1(unref(style))
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 8, ["class", "style"]);
        };
      }
    });
    var Row$2 = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__file", "row.vue"]]);
    const ElRow = withInstall(Row$2);
    const _sfc_main$W = /* @__PURE__ */ defineComponent({
      props: {
        item: {
          type: Object,
          required: true
        },
        style: {
          type: Object
        },
        height: Number
      },
      setup() {
        const ns = useNamespace("select");
        return {
          ns
        };
      }
    });
    function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(_ctx.ns.be("group", "title")),
        style: normalizeStyle$1({ ..._ctx.style, lineHeight: `${_ctx.height}px` })
      }, toDisplayString(_ctx.item.label), 7);
    }
    var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$d], ["__file", "group-item.vue"]]);
    function useOption(props2, { emit: emit2 }) {
      return {
        hoverItem: () => {
          if (!props2.disabled) {
            emit2("hover", props2.index);
          }
        },
        selectOptionClick: () => {
          if (!props2.disabled) {
            emit2("select", props2.item, props2.index);
          }
        }
      };
    }
    const defaultProps$4 = {
      label: "label",
      value: "value",
      disabled: "disabled",
      options: "options"
    };
    function useProps(props2) {
      const aliasProps = computed(() => ({ ...defaultProps$4, ...props2.props }));
      const getLabel = (option) => get$1(option, aliasProps.value.label);
      const getValue2 = (option) => get$1(option, aliasProps.value.value);
      const getDisabled = (option) => get$1(option, aliasProps.value.disabled);
      const getOptions = (option) => get$1(option, aliasProps.value.options);
      return {
        aliasProps,
        getLabel,
        getValue: getValue2,
        getDisabled,
        getOptions
      };
    }
    const SelectProps = buildProps({
      allowCreate: Boolean,
      autocomplete: {
        type: definePropType(String),
        default: "none"
      },
      automaticDropdown: Boolean,
      clearable: Boolean,
      clearIcon: {
        type: iconPropType,
        default: circle_close_default
      },
      effect: {
        type: definePropType(String),
        default: "light"
      },
      collapseTags: Boolean,
      collapseTagsTooltip: Boolean,
      maxCollapseTags: {
        type: Number,
        default: 1
      },
      defaultFirstOption: Boolean,
      disabled: Boolean,
      estimatedOptionHeight: {
        type: Number,
        default: void 0
      },
      filterable: Boolean,
      filterMethod: Function,
      height: {
        type: Number,
        default: 274
      },
      itemHeight: {
        type: Number,
        default: 34
      },
      id: String,
      loading: Boolean,
      loadingText: String,
      modelValue: {
        type: definePropType([Array, String, Number, Boolean, Object])
      },
      multiple: Boolean,
      multipleLimit: {
        type: Number,
        default: 0
      },
      name: String,
      noDataText: String,
      noMatchText: String,
      remoteMethod: Function,
      reserveKeyword: {
        type: Boolean,
        default: true
      },
      options: {
        type: definePropType(Array),
        required: true
      },
      placeholder: {
        type: String
      },
      teleported: useTooltipContentProps.teleported,
      persistent: {
        type: Boolean,
        default: true
      },
      popperClass: {
        type: String,
        default: ""
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      },
      remote: Boolean,
      size: useSizeProp,
      props: {
        type: definePropType(Object),
        default: () => defaultProps$4
      },
      valueKey: {
        type: String,
        default: "value"
      },
      scrollbarAlwaysOn: Boolean,
      validateEvent: {
        type: Boolean,
        default: true
      },
      offset: {
        type: Number,
        default: 12
      },
      showArrow: {
        type: Boolean,
        default: true
      },
      placement: {
        type: definePropType(String),
        values: Ee,
        default: "bottom-start"
      },
      fallbackPlacements: {
        type: definePropType(Array),
        default: ["bottom-start", "top-start", "right", "left"]
      },
      tagType: { ...tagProps.type, default: "info" },
      tagEffect: { ...tagProps.effect, default: "light" },
      tabindex: {
        type: [String, Number],
        default: 0
      },
      appendTo: useTooltipContentProps.appendTo,
      fitInputWidth: {
        type: [Boolean, Number],
        default: true,
        validator(val) {
          return isBoolean$1(val) || isNumber$2(val);
        }
      },
      suffixIcon: {
        type: iconPropType,
        default: arrow_down_default
      },
      ...useEmptyValuesProps,
      ...useAriaProps(["ariaLabel"])
    });
    const OptionProps = buildProps({
      data: Array,
      disabled: Boolean,
      hovering: Boolean,
      item: {
        type: definePropType(Object),
        required: true
      },
      index: Number,
      style: Object,
      selected: Boolean,
      created: Boolean
    });
    const selectEmits = {
      [UPDATE_MODEL_EVENT]: (val) => true,
      [CHANGE_EVENT]: (val) => true,
      "remove-tag": (val) => true,
      "visible-change": (visible) => true,
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent,
      clear: () => true
    };
    const optionEmits = {
      hover: (index) => isNumber$2(index),
      select: (val, index) => true
    };
    const selectV2InjectionKey = Symbol("ElSelectV2Injection");
    const _sfc_main$V = /* @__PURE__ */ defineComponent({
      props: OptionProps,
      emits: optionEmits,
      setup(props2, { emit: emit2 }) {
        const select = inject(selectV2InjectionKey);
        const ns = useNamespace("select");
        const { hoverItem, selectOptionClick } = useOption(props2, { emit: emit2 });
        const { getLabel } = useProps(select.props);
        return {
          ns,
          hoverItem,
          selectOptionClick,
          getLabel
        };
      }
    });
    function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("li", {
        "aria-selected": _ctx.selected,
        style: normalizeStyle$1(_ctx.style),
        class: normalizeClass([
          _ctx.ns.be("dropdown", "item"),
          _ctx.ns.is("selected", _ctx.selected),
          _ctx.ns.is("disabled", _ctx.disabled),
          _ctx.ns.is("created", _ctx.created),
          _ctx.ns.is("hovering", _ctx.hovering)
        ]),
        onMousemove: _ctx.hoverItem,
        onClick: withModifiers(_ctx.selectOptionClick, ["stop"])
      }, [
        renderSlot(_ctx.$slots, "default", {
          item: _ctx.item,
          index: _ctx.index,
          disabled: _ctx.disabled
        }, () => [
          createBaseVNode("span", null, toDisplayString(_ctx.getLabel(_ctx.item)), 1)
        ])
      ], 46, ["aria-selected", "onMousemove", "onClick"]);
    }
    var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$c], ["__file", "option-item.vue"]]);
    var safeIsNaN = Number.isNaN || function ponyfill(value) {
      return typeof value === "number" && value !== value;
    };
    function isEqual(first, second) {
      if (first === second) {
        return true;
      }
      if (safeIsNaN(first) && safeIsNaN(second)) {
        return true;
      }
      return false;
    }
    function areInputsEqual(newInputs, lastInputs) {
      if (newInputs.length !== lastInputs.length) {
        return false;
      }
      for (var i2 = 0; i2 < newInputs.length; i2++) {
        if (!isEqual(newInputs[i2], lastInputs[i2])) {
          return false;
        }
      }
      return true;
    }
    function memoizeOne(resultFn, isEqual2) {
      if (isEqual2 === void 0) {
        isEqual2 = areInputsEqual;
      }
      var cache2 = null;
      function memoized() {
        var newArgs = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          newArgs[_i] = arguments[_i];
        }
        if (cache2 && cache2.lastThis === this && isEqual2(newArgs, cache2.lastArgs)) {
          return cache2.lastResult;
        }
        var lastResult = resultFn.apply(this, newArgs);
        cache2 = {
          lastResult,
          lastArgs: newArgs,
          lastThis: this
        };
        return lastResult;
      }
      memoized.clear = function clear2() {
        cache2 = null;
      };
      return memoized;
    }
    const useCache = () => {
      const vm = getCurrentInstance();
      const props2 = vm.proxy.$props;
      return computed(() => {
        const _getItemStyleCache = (_2, __, ___) => ({});
        return props2.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
      });
    };
    const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
    const ITEM_RENDER_EVT = "itemRendered";
    const SCROLL_EVT = "scroll";
    const FORWARD = "forward";
    const BACKWARD = "backward";
    const AUTO_ALIGNMENT = "auto";
    const SMART_ALIGNMENT = "smart";
    const START_ALIGNMENT = "start";
    const CENTERED_ALIGNMENT = "center";
    const END_ALIGNMENT = "end";
    const HORIZONTAL$1 = "horizontal";
    const VERTICAL$1 = "vertical";
    const LTR = "ltr";
    const RTL = "rtl";
    const RTL_OFFSET_NAG = "negative";
    const RTL_OFFSET_POS_ASC = "positive-ascending";
    const RTL_OFFSET_POS_DESC = "positive-descending";
    const ScrollbarDirKey = {
      [HORIZONTAL$1]: "left",
      [VERTICAL$1]: "top"
    };
    const SCROLLBAR_MIN_SIZE = 20;
    const LayoutKeys = {
      [HORIZONTAL$1]: "deltaX",
      [VERTICAL$1]: "deltaY"
    };
    const useWheel = ({ atEndEdge, atStartEdge, layout: layout2 }, onWheelDelta) => {
      let frameHandle;
      let offset2 = 0;
      const hasReachedEdge = (offset22) => {
        const edgeReached = offset22 < 0 && atStartEdge.value || offset22 > 0 && atEndEdge.value;
        return edgeReached;
      };
      const onWheel = (e2) => {
        cAF(frameHandle);
        const newOffset = e2[LayoutKeys[layout2.value]];
        if (hasReachedEdge(offset2) && hasReachedEdge(offset2 + newOffset))
          return;
        offset2 += newOffset;
        if (!isFirefox()) {
          e2.preventDefault();
        }
        frameHandle = rAF(() => {
          onWheelDelta(offset2);
          offset2 = 0;
        });
      };
      return {
        hasReachedEdge,
        onWheel
      };
    };
    const itemSize$1 = buildProp({
      type: definePropType([Number, Function]),
      required: true
    });
    const estimatedItemSize = buildProp({
      type: Number
    });
    const cache = buildProp({
      type: Number,
      default: 2
    });
    const direction$1 = buildProp({
      type: String,
      values: ["ltr", "rtl"],
      default: "ltr"
    });
    const initScrollOffset = buildProp({
      type: Number,
      default: 0
    });
    const total = buildProp({
      type: Number,
      required: true
    });
    const layout$4 = buildProp({
      type: String,
      values: ["horizontal", "vertical"],
      default: VERTICAL$1
    });
    const virtualizedProps = buildProps({
      className: {
        type: String,
        default: ""
      },
      containerElement: {
        type: definePropType([String, Object]),
        default: "div"
      },
      data: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      direction: direction$1,
      height: {
        type: [String, Number],
        required: true
      },
      innerElement: {
        type: [String, Object],
        default: "div"
      },
      style: {
        type: definePropType([Object, String, Array])
      },
      useIsScrolling: {
        type: Boolean,
        default: false
      },
      width: {
        type: [Number, String],
        required: false
      },
      perfMode: {
        type: Boolean,
        default: true
      },
      scrollbarAlwaysOn: {
        type: Boolean,
        default: false
      }
    });
    const virtualizedListProps = buildProps({
      cache,
      estimatedItemSize,
      layout: layout$4,
      initScrollOffset,
      total,
      itemSize: itemSize$1,
      ...virtualizedProps
    });
    const scrollbarSize = {
      type: Number,
      default: 6
    };
    const startGap = { type: Number, default: 0 };
    const endGap = { type: Number, default: 2 };
    const virtualizedGridProps = buildProps({
      columnCache: cache,
      columnWidth: itemSize$1,
      estimatedColumnWidth: estimatedItemSize,
      estimatedRowHeight: estimatedItemSize,
      initScrollLeft: initScrollOffset,
      initScrollTop: initScrollOffset,
      itemKey: {
        type: definePropType(Function),
        default: ({
          columnIndex,
          rowIndex
        }) => `${rowIndex}:${columnIndex}`
      },
      rowCache: cache,
      rowHeight: itemSize$1,
      totalColumn: total,
      totalRow: total,
      hScrollbarSize: scrollbarSize,
      vScrollbarSize: scrollbarSize,
      scrollbarStartGap: startGap,
      scrollbarEndGap: endGap,
      role: String,
      ...virtualizedProps
    });
    const virtualizedScrollbarProps = buildProps({
      alwaysOn: Boolean,
      class: String,
      layout: layout$4,
      total,
      ratio: {
        type: Number,
        required: true
      },
      clientSize: {
        type: Number,
        required: true
      },
      scrollFrom: {
        type: Number,
        required: true
      },
      scrollbarSize,
      startGap,
      endGap,
      visible: Boolean
    });
    const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
    const isHorizontal = (dir3) => dir3 === LTR || dir3 === RTL || dir3 === HORIZONTAL$1;
    const isRTL$1 = (dir3) => dir3 === RTL;
    let cachedRTLResult = null;
    function getRTLOffsetType(recalculate = false) {
      if (cachedRTLResult === null || recalculate) {
        const outerDiv = document.createElement("div");
        const outerStyle = outerDiv.style;
        outerStyle.width = "50px";
        outerStyle.height = "50px";
        outerStyle.overflow = "scroll";
        outerStyle.direction = "rtl";
        const innerDiv = document.createElement("div");
        const innerStyle = innerDiv.style;
        innerStyle.width = "100px";
        innerStyle.height = "100px";
        outerDiv.appendChild(innerDiv);
        document.body.appendChild(outerDiv);
        if (outerDiv.scrollLeft > 0) {
          cachedRTLResult = RTL_OFFSET_POS_DESC;
        } else {
          outerDiv.scrollLeft = 1;
          if (outerDiv.scrollLeft === 0) {
            cachedRTLResult = RTL_OFFSET_NAG;
          } else {
            cachedRTLResult = RTL_OFFSET_POS_ASC;
          }
        }
        document.body.removeChild(outerDiv);
        return cachedRTLResult;
      }
      return cachedRTLResult;
    }
    function renderThumbStyle({ move, size, bar }, layout2) {
      const style = {};
      const translate2 = `translate${bar.axis}(${move}px)`;
      style[bar.size] = size;
      style.transform = translate2;
      if (layout2 === "horizontal") {
        style.height = "100%";
      } else {
        style.width = "100%";
      }
      return style;
    }
    const ScrollBar = /* @__PURE__ */ defineComponent({
      name: "ElVirtualScrollBar",
      props: virtualizedScrollbarProps,
      emits: ["scroll", "start-move", "stop-move"],
      setup(props2, { emit: emit2 }) {
        const GAP2 = computed(() => props2.startGap + props2.endGap);
        const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
        const nsScrollbar = useNamespace("scrollbar");
        const trackRef = ref();
        const thumbRef = ref();
        let frameHandle = null;
        let onselectstartStore = null;
        const state = reactive({
          isDragging: false,
          traveled: 0
        });
        const bar = computed(() => BAR_MAP[props2.layout]);
        const trackSize = computed(() => props2.clientSize - unref(GAP2));
        const trackStyle = computed(() => ({
          position: "absolute",
          width: `${HORIZONTAL$1 === props2.layout ? trackSize.value : props2.scrollbarSize}px`,
          height: `${HORIZONTAL$1 === props2.layout ? props2.scrollbarSize : trackSize.value}px`,
          [ScrollbarDirKey[props2.layout]]: "2px",
          right: "2px",
          bottom: "2px",
          borderRadius: "4px"
        }));
        const thumbSize = computed(() => {
          const ratio = props2.ratio;
          const clientSize = props2.clientSize;
          if (ratio >= 100) {
            return Number.POSITIVE_INFINITY;
          }
          if (ratio >= 50) {
            return ratio * clientSize / 100;
          }
          const SCROLLBAR_MAX_SIZE = clientSize / 3;
          return Math.floor(Math.min(Math.max(ratio * clientSize, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
        });
        const thumbStyle = computed(() => {
          if (!Number.isFinite(thumbSize.value)) {
            return {
              display: "none"
            };
          }
          const thumb = `${thumbSize.value}px`;
          const style = renderThumbStyle({
            bar: bar.value,
            size: thumb,
            move: state.traveled
          }, props2.layout);
          return style;
        });
        const totalSteps = computed(() => Math.floor(props2.clientSize - thumbSize.value - unref(GAP2)));
        const attachEvents2 = () => {
          window.addEventListener("mousemove", onMouseMove);
          window.addEventListener("mouseup", onMouseUp);
          const thumbEl = unref(thumbRef);
          if (!thumbEl)
            return;
          onselectstartStore = document.onselectstart;
          document.onselectstart = () => false;
          thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
          thumbEl.addEventListener("touchend", onMouseUp);
        };
        const detachEvents = () => {
          window.removeEventListener("mousemove", onMouseMove);
          window.removeEventListener("mouseup", onMouseUp);
          document.onselectstart = onselectstartStore;
          onselectstartStore = null;
          const thumbEl = unref(thumbRef);
          if (!thumbEl)
            return;
          thumbEl.removeEventListener("touchmove", onMouseMove);
          thumbEl.removeEventListener("touchend", onMouseUp);
        };
        const onThumbMouseDown = (e2) => {
          e2.stopImmediatePropagation();
          if (e2.ctrlKey || [1, 2].includes(e2.button)) {
            return;
          }
          state.isDragging = true;
          state[bar.value.axis] = e2.currentTarget[bar.value.offset] - (e2[bar.value.client] - e2.currentTarget.getBoundingClientRect()[bar.value.direction]);
          emit2("start-move");
          attachEvents2();
        };
        const onMouseUp = () => {
          state.isDragging = false;
          state[bar.value.axis] = 0;
          emit2("stop-move");
          detachEvents();
        };
        const onMouseMove = (e2) => {
          const { isDragging: isDragging2 } = state;
          if (!isDragging2)
            return;
          if (!thumbRef.value || !trackRef.value)
            return;
          const prevPage = state[bar.value.axis];
          if (!prevPage)
            return;
          cAF(frameHandle);
          const offset2 = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e2[bar.value.client]) * -1;
          const thumbClickPosition = thumbRef.value[bar.value.offset] - prevPage;
          const distance2 = offset2 - thumbClickPosition;
          frameHandle = rAF(() => {
            state.traveled = Math.max(props2.startGap, Math.min(distance2, totalSteps.value));
            emit2("scroll", distance2, totalSteps.value);
          });
        };
        const clickTrackHandler = (e2) => {
          const offset2 = Math.abs(e2.target.getBoundingClientRect()[bar.value.direction] - e2[bar.value.client]);
          const thumbHalf = thumbRef.value[bar.value.offset] / 2;
          const distance2 = offset2 - thumbHalf;
          state.traveled = Math.max(0, Math.min(distance2, totalSteps.value));
          emit2("scroll", distance2, totalSteps.value);
        };
        watch(() => props2.scrollFrom, (v4) => {
          if (state.isDragging)
            return;
          state.traveled = Math.ceil(v4 * totalSteps.value);
        });
        onBeforeUnmount(() => {
          detachEvents();
        });
        return () => {
          return h$1("div", {
            role: "presentation",
            ref: trackRef,
            class: [
              nsVirtualScrollbar.b(),
              props2.class,
              (props2.alwaysOn || state.isDragging) && "always-on"
            ],
            style: trackStyle.value,
            onMousedown: withModifiers(clickTrackHandler, ["stop", "prevent"]),
            onTouchstartPrevent: onThumbMouseDown
          }, h$1("div", {
            ref: thumbRef,
            class: nsScrollbar.e("thumb"),
            style: thumbStyle.value,
            onMousedown: onThumbMouseDown
          }, []));
        };
      }
    });
    const createList$2 = ({
      name,
      getOffset: getOffset2,
      getItemSize,
      getItemOffset,
      getEstimatedTotalSize: getEstimatedTotalSize2,
      getStartIndexForOffset,
      getStopIndexForStartIndex,
      initCache,
      clearCache,
      validateProps
    }) => {
      return /* @__PURE__ */ defineComponent({
        name: name != null ? name : "ElVirtualList",
        props: virtualizedListProps,
        emits: [ITEM_RENDER_EVT, SCROLL_EVT],
        setup(props2, { emit: emit2, expose }) {
          validateProps(props2);
          const instance = getCurrentInstance();
          const ns = useNamespace("vl");
          const dynamicSizeCache = ref(initCache(props2, instance));
          const getItemStyleCache = useCache();
          const windowRef = ref();
          const innerRef = ref();
          const scrollbarRef = ref();
          const states = ref({
            isScrolling: false,
            scrollDir: "forward",
            scrollOffset: isNumber$2(props2.initScrollOffset) ? props2.initScrollOffset : 0,
            updateRequested: false,
            isScrollbarDragging: false,
            scrollbarAlwaysOn: props2.scrollbarAlwaysOn
          });
          const itemsToRender = computed(() => {
            const { total: total2, cache: cache2 } = props2;
            const { isScrolling, scrollDir, scrollOffset } = unref(states);
            if (total2 === 0) {
              return [0, 0, 0, 0];
            }
            const startIndex = getStartIndexForOffset(props2, scrollOffset, unref(dynamicSizeCache));
            const stopIndex = getStopIndexForStartIndex(props2, startIndex, scrollOffset, unref(dynamicSizeCache));
            const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache2) : 1;
            const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache2) : 1;
            return [
              Math.max(0, startIndex - cacheBackward),
              Math.max(0, Math.min(total2 - 1, stopIndex + cacheForward)),
              startIndex,
              stopIndex
            ];
          });
          const estimatedTotalSize = computed(() => getEstimatedTotalSize2(props2, unref(dynamicSizeCache)));
          const _isHorizontal = computed(() => isHorizontal(props2.layout));
          const windowStyle = computed(() => [
            {
              position: "relative",
              [`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
              WebkitOverflowScrolling: "touch",
              willChange: "transform"
            },
            {
              direction: props2.direction,
              height: isNumber$2(props2.height) ? `${props2.height}px` : props2.height,
              width: isNumber$2(props2.width) ? `${props2.width}px` : props2.width
            },
            props2.style
          ]);
          const innerStyle = computed(() => {
            const size = unref(estimatedTotalSize);
            const horizontal = unref(_isHorizontal);
            return {
              height: horizontal ? "100%" : `${size}px`,
              pointerEvents: unref(states).isScrolling ? "none" : void 0,
              width: horizontal ? `${size}px` : "100%"
            };
          });
          const clientSize = computed(() => _isHorizontal.value ? props2.width : props2.height);
          const { onWheel } = useWheel({
            atStartEdge: computed(() => states.value.scrollOffset <= 0),
            atEndEdge: computed(() => states.value.scrollOffset >= estimatedTotalSize.value),
            layout: computed(() => props2.layout)
          }, (offset2) => {
            var _a2, _b2;
            (_b2 = (_a2 = scrollbarRef.value).onMouseUp) == null ? void 0 : _b2.call(_a2);
            scrollTo(Math.min(states.value.scrollOffset + offset2, estimatedTotalSize.value - clientSize.value));
          });
          useEventListener(windowRef, "wheel", onWheel, {
            passive: false
          });
          const emitEvents = () => {
            const { total: total2 } = props2;
            if (total2 > 0) {
              const [cacheStart, cacheEnd, visibleStart, visibleEnd] = unref(itemsToRender);
              emit2(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
            }
            const { scrollDir, scrollOffset, updateRequested } = unref(states);
            emit2(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
          };
          const scrollVertically = (e2) => {
            const { clientHeight, scrollHeight, scrollTop } = e2.currentTarget;
            const _states = unref(states);
            if (_states.scrollOffset === scrollTop) {
              return;
            }
            const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
            states.value = {
              ..._states,
              isScrolling: true,
              scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
              scrollOffset,
              updateRequested: false
            };
            nextTick(resetIsScrolling);
          };
          const scrollHorizontally = (e2) => {
            const { clientWidth, scrollLeft, scrollWidth } = e2.currentTarget;
            const _states = unref(states);
            if (_states.scrollOffset === scrollLeft) {
              return;
            }
            const { direction: direction2 } = props2;
            let scrollOffset = scrollLeft;
            if (direction2 === RTL) {
              switch (getRTLOffsetType()) {
                case RTL_OFFSET_NAG: {
                  scrollOffset = -scrollLeft;
                  break;
                }
                case RTL_OFFSET_POS_DESC: {
                  scrollOffset = scrollWidth - clientWidth - scrollLeft;
                  break;
                }
              }
            }
            scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
            states.value = {
              ..._states,
              isScrolling: true,
              scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
              scrollOffset,
              updateRequested: false
            };
            nextTick(resetIsScrolling);
          };
          const onScroll = (e2) => {
            unref(_isHorizontal) ? scrollHorizontally(e2) : scrollVertically(e2);
            emitEvents();
          };
          const onScrollbarScroll = (distanceToGo, totalSteps) => {
            const offset2 = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
            scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset2));
          };
          const scrollTo = (offset2) => {
            offset2 = Math.max(offset2, 0);
            if (offset2 === unref(states).scrollOffset) {
              return;
            }
            states.value = {
              ...unref(states),
              scrollOffset: offset2,
              scrollDir: getScrollDir(unref(states).scrollOffset, offset2),
              updateRequested: true
            };
            nextTick(resetIsScrolling);
          };
          const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
            const { scrollOffset } = unref(states);
            idx = Math.max(0, Math.min(idx, props2.total - 1));
            scrollTo(getOffset2(props2, idx, alignment, scrollOffset, unref(dynamicSizeCache)));
          };
          const getItemStyle2 = (idx) => {
            const { direction: direction2, itemSize: itemSize2, layout: layout2 } = props2;
            const itemStyleCache = getItemStyleCache.value(clearCache && itemSize2, clearCache && layout2, clearCache && direction2);
            let style;
            if (hasOwn$1(itemStyleCache, String(idx))) {
              style = itemStyleCache[idx];
            } else {
              const offset2 = getItemOffset(props2, idx, unref(dynamicSizeCache));
              const size = getItemSize(props2, idx, unref(dynamicSizeCache));
              const horizontal = unref(_isHorizontal);
              const isRtl = direction2 === RTL;
              const offsetHorizontal = horizontal ? offset2 : 0;
              itemStyleCache[idx] = style = {
                position: "absolute",
                left: isRtl ? void 0 : `${offsetHorizontal}px`,
                right: isRtl ? `${offsetHorizontal}px` : void 0,
                top: !horizontal ? `${offset2}px` : 0,
                height: !horizontal ? `${size}px` : "100%",
                width: horizontal ? `${size}px` : "100%"
              };
            }
            return style;
          };
          const resetIsScrolling = () => {
            states.value.isScrolling = false;
            nextTick(() => {
              getItemStyleCache.value(-1, null, null);
            });
          };
          const resetScrollTop = () => {
            const window2 = windowRef.value;
            if (window2) {
              window2.scrollTop = 0;
            }
          };
          onMounted(() => {
            if (!isClient)
              return;
            const { initScrollOffset: initScrollOffset2 } = props2;
            const windowElement = unref(windowRef);
            if (isNumber$2(initScrollOffset2) && windowElement) {
              if (unref(_isHorizontal)) {
                windowElement.scrollLeft = initScrollOffset2;
              } else {
                windowElement.scrollTop = initScrollOffset2;
              }
            }
            emitEvents();
          });
          onUpdated(() => {
            const { direction: direction2, layout: layout2 } = props2;
            const { scrollOffset, updateRequested } = unref(states);
            const windowElement = unref(windowRef);
            if (updateRequested && windowElement) {
              if (layout2 === HORIZONTAL$1) {
                if (direction2 === RTL) {
                  switch (getRTLOffsetType()) {
                    case RTL_OFFSET_NAG: {
                      windowElement.scrollLeft = -scrollOffset;
                      break;
                    }
                    case RTL_OFFSET_POS_ASC: {
                      windowElement.scrollLeft = scrollOffset;
                      break;
                    }
                    default: {
                      const { clientWidth, scrollWidth } = windowElement;
                      windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
                      break;
                    }
                  }
                } else {
                  windowElement.scrollLeft = scrollOffset;
                }
              } else {
                windowElement.scrollTop = scrollOffset;
              }
            }
          });
          onActivated(() => {
            unref(windowRef).scrollTop = unref(states).scrollOffset;
          });
          const api2 = {
            ns,
            clientSize,
            estimatedTotalSize,
            windowStyle,
            windowRef,
            innerRef,
            innerStyle,
            itemsToRender,
            scrollbarRef,
            states,
            getItemStyle: getItemStyle2,
            onScroll,
            onScrollbarScroll,
            onWheel,
            scrollTo,
            scrollToItem,
            resetScrollTop
          };
          expose({
            windowRef,
            innerRef,
            getItemStyleCache,
            scrollTo,
            scrollToItem,
            resetScrollTop,
            states
          });
          return api2;
        },
        render(ctx) {
          var _a2;
          const {
            $slots,
            className,
            clientSize,
            containerElement,
            data,
            getItemStyle: getItemStyle2,
            innerElement,
            itemsToRender,
            innerStyle,
            layout: layout2,
            total: total2,
            onScroll,
            onScrollbarScroll,
            states,
            useIsScrolling,
            windowStyle,
            ns
          } = ctx;
          const [start2, end2] = itemsToRender;
          const Container2 = resolveDynamicComponent(containerElement);
          const Inner = resolveDynamicComponent(innerElement);
          const children = [];
          if (total2 > 0) {
            for (let i2 = start2; i2 <= end2; i2++) {
              children.push(h$1(Fragment, { key: i2 }, (_a2 = $slots.default) == null ? void 0 : _a2.call($slots, {
                data,
                index: i2,
                isScrolling: useIsScrolling ? states.isScrolling : void 0,
                style: getItemStyle2(i2)
              })));
            }
          }
          const InnerNode = [
            h$1(Inner, {
              style: innerStyle,
              ref: "innerRef"
            }, !isString$3(Inner) ? {
              default: () => children
            } : children)
          ];
          const scrollbar = h$1(ScrollBar, {
            ref: "scrollbarRef",
            clientSize,
            layout: layout2,
            onScroll: onScrollbarScroll,
            ratio: clientSize * 100 / this.estimatedTotalSize,
            scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
            total: total2
          });
          const listContainer = h$1(Container2, {
            class: [ns.e("window"), className],
            style: windowStyle,
            onScroll,
            ref: "windowRef",
            key: 0
          }, !isString$3(Container2) ? { default: () => [InnerNode] } : [InnerNode]);
          return h$1("div", {
            key: 0,
            class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
          }, [listContainer, scrollbar]);
        }
      });
    };
    const FixedSizeList = createList$2({
      name: "ElFixedSizeList",
      getItemOffset: ({ itemSize: itemSize2 }, index) => index * itemSize2,
      getItemSize: ({ itemSize: itemSize2 }) => itemSize2,
      getEstimatedTotalSize: ({ total: total2, itemSize: itemSize2 }) => itemSize2 * total2,
      getOffset: ({ height, total: total2, itemSize: itemSize2, layout: layout2, width }, index, alignment, scrollOffset) => {
        const size = isHorizontal(layout2) ? width : height;
        const lastItemOffset = Math.max(0, total2 * itemSize2 - size);
        const maxOffset = Math.min(lastItemOffset, index * itemSize2);
        const minOffset = Math.max(0, (index + 1) * itemSize2 - size);
        if (alignment === SMART_ALIGNMENT) {
          if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
            alignment = AUTO_ALIGNMENT;
          } else {
            alignment = CENTERED_ALIGNMENT;
          }
        }
        switch (alignment) {
          case START_ALIGNMENT: {
            return maxOffset;
          }
          case END_ALIGNMENT: {
            return minOffset;
          }
          case CENTERED_ALIGNMENT: {
            const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
            if (middleOffset < Math.ceil(size / 2)) {
              return 0;
            } else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
              return lastItemOffset;
            } else {
              return middleOffset;
            }
          }
          case AUTO_ALIGNMENT:
          default: {
            if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
              return scrollOffset;
            } else if (scrollOffset < minOffset) {
              return minOffset;
            } else {
              return maxOffset;
            }
          }
        }
      },
      getStartIndexForOffset: ({ total: total2, itemSize: itemSize2 }, offset2) => Math.max(0, Math.min(total2 - 1, Math.floor(offset2 / itemSize2))),
      getStopIndexForStartIndex: ({ height, total: total2, itemSize: itemSize2, layout: layout2, width }, startIndex, scrollOffset) => {
        const offset2 = startIndex * itemSize2;
        const size = isHorizontal(layout2) ? width : height;
        const numVisibleItems = Math.ceil((size + scrollOffset - offset2) / itemSize2);
        return Math.max(0, Math.min(total2 - 1, startIndex + numVisibleItems - 1));
      },
      initCache() {
        return void 0;
      },
      clearCache: true,
      validateProps() {
      }
    });
    const getItemFromCache$1 = (props2, index, listCache) => {
      const { itemSize: itemSize2 } = props2;
      const { items, lastVisitedIndex } = listCache;
      if (index > lastVisitedIndex) {
        let offset2 = 0;
        if (lastVisitedIndex >= 0) {
          const item = items[lastVisitedIndex];
          offset2 = item.offset + item.size;
        }
        for (let i2 = lastVisitedIndex + 1; i2 <= index; i2++) {
          const size = itemSize2(i2);
          items[i2] = {
            offset: offset2,
            size
          };
          offset2 += size;
        }
        listCache.lastVisitedIndex = index;
      }
      return items[index];
    };
    const findItem$1 = (props2, listCache, offset2) => {
      const { items, lastVisitedIndex } = listCache;
      const lastVisitedOffset = lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0;
      if (lastVisitedOffset >= offset2) {
        return bs$1(props2, listCache, 0, lastVisitedIndex, offset2);
      }
      return es$1(props2, listCache, Math.max(0, lastVisitedIndex), offset2);
    };
    const bs$1 = (props2, listCache, low, high, offset2) => {
      while (low <= high) {
        const mid = low + Math.floor((high - low) / 2);
        const currentOffset = getItemFromCache$1(props2, mid, listCache).offset;
        if (currentOffset === offset2) {
          return mid;
        } else if (currentOffset < offset2) {
          low = mid + 1;
        } else if (currentOffset > offset2) {
          high = mid - 1;
        }
      }
      return Math.max(0, low - 1);
    };
    const es$1 = (props2, listCache, index, offset2) => {
      const { total: total2 } = props2;
      let exponent = 1;
      while (index < total2 && getItemFromCache$1(props2, index, listCache).offset < offset2) {
        index += exponent;
        exponent *= 2;
      }
      return bs$1(props2, listCache, Math.floor(index / 2), Math.min(index, total2 - 1), offset2);
    };
    const getEstimatedTotalSize = ({ total: total2 }, { items, estimatedItemSize: estimatedItemSize2, lastVisitedIndex }) => {
      let totalSizeOfMeasuredItems = 0;
      if (lastVisitedIndex >= total2) {
        lastVisitedIndex = total2 - 1;
      }
      if (lastVisitedIndex >= 0) {
        const item = items[lastVisitedIndex];
        totalSizeOfMeasuredItems = item.offset + item.size;
      }
      const numUnmeasuredItems = total2 - lastVisitedIndex - 1;
      const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize2;
      return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
    };
    const DynamicSizeList = createList$2({
      name: "ElDynamicSizeList",
      getItemOffset: (props2, index, listCache) => getItemFromCache$1(props2, index, listCache).offset,
      getItemSize: (_2, index, { items }) => items[index].size,
      getEstimatedTotalSize,
      getOffset: (props2, index, alignment, scrollOffset, listCache) => {
        const { height, layout: layout2, width } = props2;
        const size = isHorizontal(layout2) ? width : height;
        const item = getItemFromCache$1(props2, index, listCache);
        const estimatedTotalSize = getEstimatedTotalSize(props2, listCache);
        const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
        const minOffset = Math.max(0, item.offset - size + item.size);
        if (alignment === SMART_ALIGNMENT) {
          if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
            alignment = AUTO_ALIGNMENT;
          } else {
            alignment = CENTERED_ALIGNMENT;
          }
        }
        switch (alignment) {
          case START_ALIGNMENT: {
            return maxOffset;
          }
          case END_ALIGNMENT: {
            return minOffset;
          }
          case CENTERED_ALIGNMENT: {
            return Math.round(minOffset + (maxOffset - minOffset) / 2);
          }
          case AUTO_ALIGNMENT:
          default: {
            if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
              return scrollOffset;
            } else if (scrollOffset < minOffset) {
              return minOffset;
            } else {
              return maxOffset;
            }
          }
        }
      },
      getStartIndexForOffset: (props2, offset2, listCache) => findItem$1(props2, listCache, offset2),
      getStopIndexForStartIndex: (props2, startIndex, scrollOffset, listCache) => {
        const { height, total: total2, layout: layout2, width } = props2;
        const size = isHorizontal(layout2) ? width : height;
        const item = getItemFromCache$1(props2, startIndex, listCache);
        const maxOffset = scrollOffset + size;
        let offset2 = item.offset + item.size;
        let stopIndex = startIndex;
        while (stopIndex < total2 - 1 && offset2 < maxOffset) {
          stopIndex++;
          offset2 += getItemFromCache$1(props2, stopIndex, listCache).size;
        }
        return stopIndex;
      },
      initCache({ estimatedItemSize: estimatedItemSize2 = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
        const cache2 = {
          items: {},
          estimatedItemSize: estimatedItemSize2,
          lastVisitedIndex: -1
        };
        cache2.clearCacheAfterIndex = (index, forceUpdate = true) => {
          var _a2, _b2;
          cache2.lastVisitedIndex = Math.min(cache2.lastVisitedIndex, index - 1);
          (_a2 = instance.exposed) == null ? void 0 : _a2.getItemStyleCache(-1);
          if (forceUpdate) {
            (_b2 = instance.proxy) == null ? void 0 : _b2.$forceUpdate();
          }
        };
        return cache2;
      },
      clearCache: false,
      validateProps: ({ itemSize: itemSize2 }) => {
      }
    });
    const props = {
      loading: Boolean,
      data: {
        type: Array,
        required: true
      },
      hoveringIndex: Number,
      width: Number
    };
    var ElSelectMenu = /* @__PURE__ */ defineComponent({
      name: "ElSelectDropdown",
      props,
      setup(props2, {
        slots,
        expose
      }) {
        const select = inject(selectV2InjectionKey);
        const ns = useNamespace("select");
        const {
          getLabel,
          getValue: getValue2,
          getDisabled
        } = useProps(select.props);
        const cachedHeights = ref([]);
        const listRef = ref();
        const size = computed(() => props2.data.length);
        watch(() => size.value, () => {
          var _a2, _b2;
          (_b2 = (_a2 = select.tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
        });
        const isSized = computed(() => isUndefined$1(select.props.estimatedOptionHeight));
        const listProps = computed(() => {
          if (isSized.value) {
            return {
              itemSize: select.props.itemHeight
            };
          }
          return {
            estimatedSize: select.props.estimatedOptionHeight,
            itemSize: (idx) => cachedHeights.value[idx]
          };
        });
        const contains2 = (arr = [], target) => {
          const {
            props: {
              valueKey
            }
          } = select;
          if (!isObject$7(target)) {
            return arr.includes(target);
          }
          return arr && arr.some((item) => {
            return toRaw(get$1(item, valueKey)) === get$1(target, valueKey);
          });
        };
        const isEqual2 = (selected, target) => {
          if (!isObject$7(target)) {
            return selected === target;
          } else {
            const {
              valueKey
            } = select.props;
            return get$1(selected, valueKey) === get$1(target, valueKey);
          }
        };
        const isItemSelected = (modelValue, target) => {
          if (select.props.multiple) {
            return contains2(modelValue, getValue2(target));
          }
          return isEqual2(modelValue, getValue2(target));
        };
        const isItemDisabled = (modelValue, selected) => {
          const {
            disabled,
            multiple,
            multipleLimit
          } = select.props;
          return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
        };
        const isItemHovering = (target) => props2.hoveringIndex === target;
        const scrollToItem = (index) => {
          const list = listRef.value;
          if (list) {
            list.scrollToItem(index);
          }
        };
        const resetScrollTop = () => {
          const list = listRef.value;
          if (list) {
            list.resetScrollTop();
          }
        };
        const exposed = {
          listRef,
          isSized,
          isItemDisabled,
          isItemHovering,
          isItemSelected,
          scrollToItem,
          resetScrollTop
        };
        expose(exposed);
        const Item = (itemProps) => {
          const {
            index,
            data,
            style
          } = itemProps;
          const sized = unref(isSized);
          const {
            itemSize: itemSize2,
            estimatedSize
          } = unref(listProps);
          const {
            modelValue
          } = select.props;
          const {
            onSelect,
            onHover
          } = select;
          const item = data[index];
          if (item.type === "Group") {
            return createVNode$1(GroupItem, {
              "item": item,
              "style": style,
              "height": sized ? itemSize2 : estimatedSize
            }, null);
          }
          const isSelected = isItemSelected(modelValue, item);
          const isDisabled = isItemDisabled(modelValue, isSelected);
          const isHovering = isItemHovering(index);
          return createVNode$1(OptionItem, mergeProps(itemProps, {
            "selected": isSelected,
            "disabled": getDisabled(item) || isDisabled,
            "created": !!item.created,
            "hovering": isHovering,
            "item": item,
            "onSelect": onSelect,
            "onHover": onHover
          }), {
            default: (props3) => {
              var _a2;
              return ((_a2 = slots.default) == null ? void 0 : _a2.call(slots, props3)) || createVNode$1("span", null, [getLabel(item)]);
            }
          });
        };
        const {
          onKeyboardNavigate,
          onKeyboardSelect
        } = select;
        const onForward = () => {
          onKeyboardNavigate("forward");
        };
        const onBackward = () => {
          onKeyboardNavigate("backward");
        };
        const onKeydown = (e2) => {
          const {
            code
          } = e2;
          const {
            tab,
            esc,
            down,
            up,
            enter,
            numpadEnter
          } = EVENT_CODE;
          if ([esc, down, up, enter, numpadEnter].includes(code)) {
            e2.preventDefault();
            e2.stopPropagation();
          }
          switch (code) {
            case tab:
            case esc:
              break;
            case down:
              onForward();
              break;
            case up:
              onBackward();
              break;
            case enter:
            case numpadEnter:
              onKeyboardSelect();
              break;
          }
        };
        return () => {
          var _a2, _b2, _c2, _d;
          const {
            data,
            width
          } = props2;
          const {
            height,
            multiple,
            scrollbarAlwaysOn
          } = select.props;
          const isScrollbarAlwaysOn = computed(() => {
            return isIOS ? true : scrollbarAlwaysOn;
          });
          const List = unref(isSized) ? FixedSizeList : DynamicSizeList;
          return createVNode$1("div", {
            "class": [ns.b("dropdown"), ns.is("multiple", multiple)],
            "style": {
              width: `${width}px`
            }
          }, [(_a2 = slots.header) == null ? void 0 : _a2.call(slots), ((_b2 = slots.loading) == null ? void 0 : _b2.call(slots)) || ((_c2 = slots.empty) == null ? void 0 : _c2.call(slots)) || createVNode$1(List, mergeProps({
            "ref": listRef
          }, unref(listProps), {
            "className": ns.be("dropdown", "list"),
            "scrollbarAlwaysOn": isScrollbarAlwaysOn.value,
            "data": data,
            "height": height,
            "width": width,
            "total": data.length,
            "onKeydown": onKeydown
          }), {
            default: (props3) => createVNode$1(Item, props3, null)
          }), (_d = slots.footer) == null ? void 0 : _d.call(slots)]);
        };
      }
    });
    function useAllowCreate(props2, states) {
      const { aliasProps, getLabel, getValue: getValue2 } = useProps(props2);
      const createOptionCount = ref(0);
      const cachedSelectedOption = ref();
      const enableAllowCreateMode = computed(() => {
        return props2.allowCreate && props2.filterable;
      });
      function hasExistingOption(query) {
        const hasOption = (option) => getLabel(option) === query;
        return props2.options && props2.options.some(hasOption) || states.createdOptions.some(hasOption);
      }
      function selectNewOption(option) {
        if (!enableAllowCreateMode.value) {
          return;
        }
        if (props2.multiple && option.created) {
          createOptionCount.value++;
        } else {
          cachedSelectedOption.value = option;
        }
      }
      function createNewOption(query) {
        if (enableAllowCreateMode.value) {
          if (query && query.length > 0) {
            if (hasExistingOption(query)) {
              return;
            }
            const newOption = {
              [aliasProps.value.value]: query,
              [aliasProps.value.label]: query,
              created: true,
              [aliasProps.value.disabled]: false
            };
            if (states.createdOptions.length >= createOptionCount.value) {
              states.createdOptions[createOptionCount.value] = newOption;
            } else {
              states.createdOptions.push(newOption);
            }
          } else {
            if (props2.multiple) {
              states.createdOptions.length = createOptionCount.value;
            } else {
              const selectedOption = cachedSelectedOption.value;
              states.createdOptions.length = 0;
              if (selectedOption && selectedOption.created) {
                states.createdOptions.push(selectedOption);
              }
            }
          }
        }
      }
      function removeNewOption(option) {
        if (!enableAllowCreateMode.value || !option || !option.created || option.created && props2.reserveKeyword && states.inputValue === getLabel(option)) {
          return;
        }
        const idx = states.createdOptions.findIndex((it2) => getValue2(it2) === getValue2(option));
        if (~idx) {
          states.createdOptions.splice(idx, 1);
          createOptionCount.value--;
        }
      }
      function clearAllNewOption() {
        if (enableAllowCreateMode.value) {
          states.createdOptions.length = 0;
          createOptionCount.value = 0;
        }
      }
      return {
        createNewOption,
        removeNewOption,
        selectNewOption,
        clearAllNewOption
      };
    }
    const useSelect$1 = (props2, emit2) => {
      const { t } = useLocale();
      const nsSelect = useNamespace("select");
      const nsInput = useNamespace("input");
      const { form: elForm, formItem: elFormItem } = useFormItem();
      const { inputId } = useFormItemInputId(props2, {
        formItemContext: elFormItem
      });
      const { aliasProps, getLabel, getValue: getValue2, getDisabled, getOptions } = useProps(props2);
      const { valueOnClear, isEmptyValue: isEmptyValue2 } = useEmptyValues(props2);
      const states = reactive({
        inputValue: "",
        cachedOptions: [],
        createdOptions: [],
        hoveringIndex: -1,
        inputHovering: false,
        selectionWidth: 0,
        collapseItemWidth: 0,
        previousQuery: null,
        previousValue: void 0,
        selectedLabel: "",
        menuVisibleOnFocus: false,
        isBeforeHide: false
      });
      const popperSize = ref(-1);
      const selectRef = ref();
      const selectionRef = ref();
      const tooltipRef = ref();
      const tagTooltipRef = ref();
      const inputRef = ref();
      const prefixRef = ref();
      const suffixRef = ref();
      const menuRef = ref();
      const tagMenuRef = ref();
      const collapseItemRef = ref();
      const {
        isComposing,
        handleCompositionStart,
        handleCompositionEnd,
        handleCompositionUpdate
      } = useComposition({
        afterComposition: (e2) => onInput(e2)
      });
      const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
        beforeFocus() {
          return selectDisabled.value;
        },
        afterFocus() {
          if (props2.automaticDropdown && !expanded.value) {
            expanded.value = true;
            states.menuVisibleOnFocus = true;
          }
        },
        beforeBlur(event) {
          var _a2, _b2;
          return ((_a2 = tooltipRef.value) == null ? void 0 : _a2.isFocusInsideContent(event)) || ((_b2 = tagTooltipRef.value) == null ? void 0 : _b2.isFocusInsideContent(event));
        },
        afterBlur() {
          var _a2;
          expanded.value = false;
          states.menuVisibleOnFocus = false;
          if (props2.validateEvent) {
            (_a2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a2.call(elFormItem, "blur").catch((err) => debugWarn());
          }
        }
      });
      const allOptions = computed(() => filterOptions(""));
      const hasOptions = computed(() => {
        if (props2.loading)
          return false;
        return props2.options.length > 0 || states.createdOptions.length > 0;
      });
      const filteredOptions = ref([]);
      const expanded = ref(false);
      const selectDisabled = computed(() => props2.disabled || (elForm == null ? void 0 : elForm.disabled));
      const needStatusIcon = computed(() => {
        var _a2;
        return (_a2 = elForm == null ? void 0 : elForm.statusIcon) != null ? _a2 : false;
      });
      const popupHeight = computed(() => {
        const totalHeight = filteredOptions.value.length * props2.itemHeight;
        return totalHeight > props2.height ? props2.height : totalHeight;
      });
      const hasModelValue = computed(() => {
        return props2.multiple ? isArray$5(props2.modelValue) && props2.modelValue.length > 0 : !isEmptyValue2(props2.modelValue);
      });
      const showClearBtn = computed(() => {
        return props2.clearable && !selectDisabled.value && states.inputHovering && hasModelValue.value;
      });
      const iconComponent = computed(() => props2.remote && props2.filterable ? "" : props2.suffixIcon);
      const iconReverse = computed(() => iconComponent.value && nsSelect.is("reverse", expanded.value));
      const validateState = computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
      const validateIcon = computed(() => {
        if (!validateState.value)
          return;
        return ValidateComponentsMap[validateState.value];
      });
      const debounce$1 = computed(() => props2.remote ? 300 : 0);
      const emptyText = computed(() => {
        if (props2.loading) {
          return props2.loadingText || t("el.select.loading");
        } else {
          if (props2.remote && !states.inputValue && !hasOptions.value)
            return false;
          if (props2.filterable && states.inputValue && hasOptions.value && filteredOptions.value.length === 0) {
            return props2.noMatchText || t("el.select.noMatch");
          }
          if (!hasOptions.value) {
            return props2.noDataText || t("el.select.noData");
          }
        }
        return null;
      });
      const filterOptions = (query) => {
        const regexp3 = new RegExp(escapeStringRegexp(query), "i");
        const isFilterMethodValid = props2.filterable && isFunction$4(props2.filterMethod);
        const isRemoteMethodValid = props2.filterable && props2.remote && isFunction$4(props2.remoteMethod);
        const isValidOption = (o2) => {
          if (isFilterMethodValid || isRemoteMethodValid)
            return true;
          return query ? regexp3.test(getLabel(o2) || "") : true;
        };
        if (props2.loading) {
          return [];
        }
        return [...states.createdOptions, ...props2.options].reduce((all2, item) => {
          const options = getOptions(item);
          if (isArray$5(options)) {
            const filtered = options.filter(isValidOption);
            if (filtered.length > 0) {
              all2.push({
                label: getLabel(item),
                type: "Group"
              }, ...filtered);
            }
          } else if (props2.remote || isValidOption(item)) {
            all2.push(item);
          }
          return all2;
        }, []);
      };
      const updateOptions2 = () => {
        filteredOptions.value = filterOptions(states.inputValue);
      };
      const allOptionsValueMap = computed(() => {
        const valueMap = /* @__PURE__ */ new Map();
        allOptions.value.forEach((option, index) => {
          valueMap.set(getValueKey(getValue2(option)), { option, index });
        });
        return valueMap;
      });
      const filteredOptionsValueMap = computed(() => {
        const valueMap = /* @__PURE__ */ new Map();
        filteredOptions.value.forEach((option, index) => {
          valueMap.set(getValueKey(getValue2(option)), { option, index });
        });
        return valueMap;
      });
      const optionsAllDisabled = computed(() => filteredOptions.value.every((option) => getDisabled(option)));
      const selectSize = useFormSize();
      const collapseTagSize = computed(() => selectSize.value === "small" ? "small" : "default");
      const calculatePopperSize = () => {
        var _a2;
        if (isNumber$2(props2.fitInputWidth)) {
          popperSize.value = props2.fitInputWidth;
          return;
        }
        const width = ((_a2 = selectRef.value) == null ? void 0 : _a2.offsetWidth) || 200;
        if (!props2.fitInputWidth && hasOptions.value) {
          nextTick(() => {
            popperSize.value = Math.max(width, calculateLabelMaxWidth());
          });
        } else {
          popperSize.value = width;
        }
      };
      const calculateLabelMaxWidth = () => {
        var _a2, _b2;
        const canvas = document.createElement("canvas");
        const ctx = canvas.getContext("2d");
        const selector2 = nsSelect.be("dropdown", "item");
        const dom = ((_b2 = (_a2 = menuRef.value) == null ? void 0 : _a2.listRef) == null ? void 0 : _b2.innerRef) || document;
        const dropdownItemEl = dom.querySelector(`.${selector2}`);
        if (dropdownItemEl === null || ctx === null)
          return 0;
        const style = getComputedStyle(dropdownItemEl);
        const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
        ctx.font = `bold ${style.font.replace(new RegExp(`\\b${style.fontWeight}\\b`), "")}`;
        const maxWidth = filteredOptions.value.reduce((max3, option) => {
          const metrics = ctx.measureText(getLabel(option));
          return Math.max(metrics.width, max3);
        }, 0);
        return maxWidth + padding;
      };
      const getGapWidth = () => {
        if (!selectionRef.value)
          return 0;
        const style = window.getComputedStyle(selectionRef.value);
        return Number.parseFloat(style.gap || "6px");
      };
      const tagStyle = computed(() => {
        const gapWidth = getGapWidth();
        const maxWidth = collapseItemRef.value && props2.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth : states.selectionWidth;
        return { maxWidth: `${maxWidth}px` };
      });
      const collapseTagStyle = computed(() => {
        return { maxWidth: `${states.selectionWidth}px` };
      });
      const shouldShowPlaceholder = computed(() => {
        if (isArray$5(props2.modelValue)) {
          return props2.modelValue.length === 0 && !states.inputValue;
        }
        return props2.filterable ? !states.inputValue : true;
      });
      const currentPlaceholder = computed(() => {
        var _a2;
        const _placeholder = (_a2 = props2.placeholder) != null ? _a2 : t("el.select.placeholder");
        return props2.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
      });
      const popperRef = computed(() => {
        var _a2, _b2;
        return (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef;
      });
      const indexRef = computed(() => {
        if (props2.multiple) {
          const len2 = props2.modelValue.length;
          if (props2.modelValue.length > 0 && filteredOptionsValueMap.value.has(props2.modelValue[len2 - 1])) {
            const { index } = filteredOptionsValueMap.value.get(props2.modelValue[len2 - 1]);
            return index;
          }
        } else {
          if (!isEmptyValue2(props2.modelValue) && filteredOptionsValueMap.value.has(props2.modelValue)) {
            const { index } = filteredOptionsValueMap.value.get(props2.modelValue);
            return index;
          }
        }
        return -1;
      });
      const dropdownMenuVisible = computed({
        get() {
          return expanded.value && emptyText.value !== false;
        },
        set(val) {
          expanded.value = val;
        }
      });
      const showTagList = computed(() => {
        if (!props2.multiple) {
          return [];
        }
        return props2.collapseTags ? states.cachedOptions.slice(0, props2.maxCollapseTags) : states.cachedOptions;
      });
      const collapseTagList = computed(() => {
        if (!props2.multiple) {
          return [];
        }
        return props2.collapseTags ? states.cachedOptions.slice(props2.maxCollapseTags) : [];
      });
      const {
        createNewOption,
        removeNewOption,
        selectNewOption,
        clearAllNewOption
      } = useAllowCreate(props2, states);
      const toggleMenu = () => {
        if (selectDisabled.value)
          return;
        if (states.menuVisibleOnFocus) {
          states.menuVisibleOnFocus = false;
        } else {
          expanded.value = !expanded.value;
        }
      };
      const onInputChange = () => {
        if (states.inputValue.length > 0 && !expanded.value) {
          expanded.value = true;
        }
        createNewOption(states.inputValue);
        handleQueryChange(states.inputValue);
      };
      const debouncedOnInputChange = debounce(onInputChange, debounce$1.value);
      const handleQueryChange = (val) => {
        if (states.previousQuery === val || isComposing.value) {
          return;
        }
        states.previousQuery = val;
        if (props2.filterable && isFunction$4(props2.filterMethod)) {
          props2.filterMethod(val);
        } else if (props2.filterable && props2.remote && isFunction$4(props2.remoteMethod)) {
          props2.remoteMethod(val);
        }
        if (props2.defaultFirstOption && (props2.filterable || props2.remote) && filteredOptions.value.length) {
          nextTick(checkDefaultFirstOption);
        } else {
          nextTick(updateHoveringIndex);
        }
      };
      const checkDefaultFirstOption = () => {
        const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group");
        const userCreatedOption = optionsInDropdown.find((n) => n.created);
        const firstOriginOption = optionsInDropdown[0];
        states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption);
      };
      const emitChange = (val) => {
        if (!isEqual$1(props2.modelValue, val)) {
          emit2(CHANGE_EVENT, val);
        }
      };
      const update = (val) => {
        emit2(UPDATE_MODEL_EVENT, val);
        emitChange(val);
        states.previousValue = props2.multiple ? String(val) : val;
        nextTick(() => {
          if (props2.multiple && isArray$5(props2.modelValue)) {
            const cachedOptions = states.cachedOptions.slice();
            const selectedOptions = props2.modelValue.map((value) => getOption(value, cachedOptions));
            if (!isEqual$1(states.cachedOptions, selectedOptions)) {
              states.cachedOptions = selectedOptions;
            }
          } else {
            initStates(true);
          }
        });
      };
      const getValueIndex = (arr = [], value) => {
        if (!isObject$7(value)) {
          return arr.indexOf(value);
        }
        const valueKey = props2.valueKey;
        let index = -1;
        arr.some((item, i2) => {
          if (get$1(item, valueKey) === get$1(value, valueKey)) {
            index = i2;
            return true;
          }
          return false;
        });
        return index;
      };
      const getValueKey = (item) => {
        return isObject$7(item) ? get$1(item, props2.valueKey) : item;
      };
      const handleResize = () => {
        calculatePopperSize();
      };
      const resetSelectionWidth = () => {
        states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
      };
      const resetCollapseItemWidth = () => {
        states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
      };
      const updateTooltip = () => {
        var _a2, _b2;
        (_b2 = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
      };
      const updateTagTooltip = () => {
        var _a2, _b2;
        (_b2 = (_a2 = tagTooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b2.call(_a2);
      };
      const onSelect = (option) => {
        if (props2.multiple) {
          let selectedOptions = props2.modelValue.slice();
          const index = getValueIndex(selectedOptions, getValue2(option));
          if (index > -1) {
            selectedOptions = [
              ...selectedOptions.slice(0, index),
              ...selectedOptions.slice(index + 1)
            ];
            states.cachedOptions.splice(index, 1);
            removeNewOption(option);
          } else if (props2.multipleLimit <= 0 || selectedOptions.length < props2.multipleLimit) {
            selectedOptions = [...selectedOptions, getValue2(option)];
            states.cachedOptions.push(option);
            selectNewOption(option);
          }
          update(selectedOptions);
          if (option.created) {
            handleQueryChange("");
          }
          if (props2.filterable && !props2.reserveKeyword) {
            states.inputValue = "";
          }
        } else {
          states.selectedLabel = getLabel(option);
          update(getValue2(option));
          expanded.value = false;
          selectNewOption(option);
          if (!option.created) {
            clearAllNewOption();
          }
        }
        focus();
      };
      const deleteTag = (event, option) => {
        let selectedOptions = props2.modelValue.slice();
        const index = getValueIndex(selectedOptions, getValue2(option));
        if (index > -1 && !selectDisabled.value) {
          selectedOptions = [
            ...props2.modelValue.slice(0, index),
            ...props2.modelValue.slice(index + 1)
          ];
          states.cachedOptions.splice(index, 1);
          update(selectedOptions);
          emit2("remove-tag", getValue2(option));
          removeNewOption(option);
        }
        event.stopPropagation();
        focus();
      };
      const focus = () => {
        var _a2;
        (_a2 = inputRef.value) == null ? void 0 : _a2.focus();
      };
      const blur = () => {
        var _a2;
        if (expanded.value) {
          expanded.value = false;
          nextTick(() => {
            var _a22;
            return (_a22 = inputRef.value) == null ? void 0 : _a22.blur();
          });
          return;
        }
        (_a2 = inputRef.value) == null ? void 0 : _a2.blur();
      };
      const handleEsc = () => {
        if (states.inputValue.length > 0) {
          states.inputValue = "";
        } else {
          expanded.value = false;
        }
      };
      const getLastNotDisabledIndex = (value) => findLastIndex(value, (it2) => !states.cachedOptions.some((option) => getValue2(option) === it2 && getDisabled(option)));
      const handleDel = (e2) => {
        if (!props2.multiple)
          return;
        if (e2.code === EVENT_CODE.delete)
          return;
        if (states.inputValue.length === 0) {
          e2.preventDefault();
          const selected = props2.modelValue.slice();
          const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
          if (lastNotDisabledIndex < 0)
            return;
          const removeTagValue = selected[lastNotDisabledIndex];
          selected.splice(lastNotDisabledIndex, 1);
          const option = states.cachedOptions[lastNotDisabledIndex];
          states.cachedOptions.splice(lastNotDisabledIndex, 1);
          removeNewOption(option);
          update(selected);
          emit2("remove-tag", removeTagValue);
        }
      };
      const handleClear = () => {
        let emptyValue;
        if (isArray$5(props2.modelValue)) {
          emptyValue = [];
        } else {
          emptyValue = valueOnClear.value;
        }
        states.selectedLabel = "";
        expanded.value = false;
        update(emptyValue);
        emit2("clear");
        clearAllNewOption();
        focus();
      };
      const onKeyboardNavigate = (direction2, hoveringIndex = void 0) => {
        const options = filteredOptions.value;
        if (!["forward", "backward"].includes(direction2) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) {
          return;
        }
        if (!expanded.value) {
          return toggleMenu();
        }
        if (isUndefined$1(hoveringIndex)) {
          hoveringIndex = states.hoveringIndex;
        }
        let newIndex = -1;
        if (direction2 === "forward") {
          newIndex = hoveringIndex + 1;
          if (newIndex >= options.length) {
            newIndex = 0;
          }
        } else if (direction2 === "backward") {
          newIndex = hoveringIndex - 1;
          if (newIndex < 0 || newIndex >= options.length) {
            newIndex = options.length - 1;
          }
        }
        const option = options[newIndex];
        if (getDisabled(option) || option.type === "Group") {
          return onKeyboardNavigate(direction2, newIndex);
        } else {
          states.hoveringIndex = newIndex;
          scrollToItem(newIndex);
        }
      };
      const onKeyboardSelect = () => {
        if (!expanded.value) {
          return toggleMenu();
        } else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) {
          onSelect(filteredOptions.value[states.hoveringIndex]);
        }
      };
      const onHoverOption = (idx) => {
        states.hoveringIndex = idx != null ? idx : -1;
      };
      const updateHoveringIndex = () => {
        if (!props2.multiple) {
          states.hoveringIndex = filteredOptions.value.findIndex((item) => {
            return getValueKey(item) === getValueKey(props2.modelValue);
          });
        } else {
          states.hoveringIndex = filteredOptions.value.findIndex((item) => props2.modelValue.some((modelValue) => getValueKey(modelValue) === getValueKey(item)));
        }
      };
      const onInput = (event) => {
        states.inputValue = event.target.value;
        if (props2.remote) {
          debouncedOnInputChange();
        } else {
          return onInputChange();
        }
      };
      const handleClickOutside = (event) => {
        expanded.value = false;
        if (isFocused.value) {
          const _event2 = new FocusEvent("focus", event);
          handleBlur(_event2);
        }
      };
      const handleMenuEnter = () => {
        states.isBeforeHide = false;
        return nextTick(() => {
          if (~indexRef.value) {
            scrollToItem(states.hoveringIndex);
          }
        });
      };
      const scrollToItem = (index) => {
        menuRef.value.scrollToItem(index);
      };
      const getOption = (value, cachedOptions) => {
        const selectValue = getValueKey(value);
        if (allOptionsValueMap.value.has(selectValue)) {
          const { option } = allOptionsValueMap.value.get(selectValue);
          return option;
        }
        if (cachedOptions && cachedOptions.length) {
          const option = cachedOptions.find((option2) => getValueKey(getValue2(option2)) === selectValue);
          if (option) {
            return option;
          }
        }
        return {
          [aliasProps.value.value]: value,
          [aliasProps.value.label]: value
        };
      };
      const initStates = (needUpdateSelectedLabel = false) => {
        if (props2.multiple) {
          if (props2.modelValue.length > 0) {
            const cachedOptions = states.cachedOptions.slice();
            states.cachedOptions.length = 0;
            states.previousValue = props2.modelValue.toString();
            for (const value of props2.modelValue) {
              const option = getOption(value, cachedOptions);
              states.cachedOptions.push(option);
            }
          } else {
            states.cachedOptions = [];
            states.previousValue = void 0;
          }
        } else {
          if (hasModelValue.value) {
            states.previousValue = props2.modelValue;
            const options = filteredOptions.value;
            const selectedItemIndex = options.findIndex((option) => getValueKey(getValue2(option)) === getValueKey(props2.modelValue));
            if (~selectedItemIndex) {
              states.selectedLabel = getLabel(options[selectedItemIndex]);
            } else {
              if (!states.selectedLabel || needUpdateSelectedLabel) {
                states.selectedLabel = getValueKey(props2.modelValue);
              }
            }
          } else {
            states.selectedLabel = "";
            states.previousValue = void 0;
          }
        }
        clearAllNewOption();
        calculatePopperSize();
      };
      watch(() => props2.fitInputWidth, () => {
        calculatePopperSize();
      });
      watch(expanded, (val) => {
        if (val) {
          if (!props2.persistent) {
            calculatePopperSize();
          }
          handleQueryChange("");
        } else {
          states.inputValue = "";
          states.previousQuery = null;
          states.isBeforeHide = true;
          createNewOption("");
        }
        emit2("visible-change", val);
      });
      watch(() => props2.modelValue, (val, oldVal) => {
        var _a2;
        const isValEmpty = !val || isArray$5(val) && val.length === 0;
        if (isValEmpty || props2.multiple && !isEqual$1(val.toString(), states.previousValue) || !props2.multiple && getValueKey(val) !== getValueKey(states.previousValue)) {
          initStates(true);
        }
        if (!isEqual$1(val, oldVal) && props2.validateEvent) {
          (_a2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a2.call(elFormItem, "change").catch((err) => debugWarn());
        }
      }, {
        deep: true
      });
      watch(() => props2.options, () => {
        const input = inputRef.value;
        if (!input || input && document.activeElement !== input) {
          initStates();
        }
      }, {
        deep: true,
        flush: "post"
      });
      watch(() => filteredOptions.value, () => {
        calculatePopperSize();
        return menuRef.value && nextTick(menuRef.value.resetScrollTop);
      });
      watchEffect(() => {
        if (states.isBeforeHide)
          return;
        updateOptions2();
      });
      watchEffect(() => {
        const { valueKey, options } = props2;
        const duplicateValue = /* @__PURE__ */ new Map();
        for (const item of options) {
          const optionValue = getValue2(item);
          let v4 = optionValue;
          if (isObject$7(v4)) {
            v4 = get$1(optionValue, valueKey);
          }
          if (duplicateValue.get(v4)) {
            break;
          } else {
            duplicateValue.set(v4, true);
          }
        }
      });
      onMounted(() => {
        initStates();
      });
      useResizeObserver(selectRef, handleResize);
      useResizeObserver(selectionRef, resetSelectionWidth);
      useResizeObserver(menuRef, updateTooltip);
      useResizeObserver(wrapperRef, updateTooltip);
      useResizeObserver(tagMenuRef, updateTagTooltip);
      useResizeObserver(collapseItemRef, resetCollapseItemWidth);
      return {
        inputId,
        collapseTagSize,
        currentPlaceholder,
        expanded,
        emptyText,
        popupHeight,
        debounce: debounce$1,
        allOptions,
        filteredOptions,
        iconComponent,
        iconReverse,
        tagStyle,
        collapseTagStyle,
        popperSize,
        dropdownMenuVisible,
        hasModelValue,
        shouldShowPlaceholder,
        selectDisabled,
        selectSize,
        needStatusIcon,
        showClearBtn,
        states,
        isFocused,
        nsSelect,
        nsInput,
        inputRef,
        menuRef,
        tagMenuRef,
        tooltipRef,
        tagTooltipRef,
        selectRef,
        wrapperRef,
        selectionRef,
        prefixRef,
        suffixRef,
        collapseItemRef,
        popperRef,
        validateState,
        validateIcon,
        showTagList,
        collapseTagList,
        debouncedOnInputChange,
        deleteTag,
        getLabel,
        getValue: getValue2,
        getDisabled,
        getValueKey,
        handleClear,
        handleClickOutside,
        handleDel,
        handleEsc,
        focus,
        blur,
        handleMenuEnter,
        handleResize,
        resetSelectionWidth,
        updateTooltip,
        updateTagTooltip,
        updateOptions: updateOptions2,
        toggleMenu,
        scrollTo: scrollToItem,
        onInput,
        onKeyboardNavigate,
        onKeyboardSelect,
        onSelect,
        onHover: onHoverOption,
        handleCompositionStart,
        handleCompositionEnd,
        handleCompositionUpdate
      };
    };
    const _sfc_main$U = /* @__PURE__ */ defineComponent({
      name: "ElSelectV2",
      components: {
        ElSelectMenu,
        ElTag,
        ElTooltip,
        ElIcon
      },
      directives: { ClickOutside },
      props: SelectProps,
      emits: selectEmits,
      setup(props2, { emit: emit2 }) {
        const modelValue = computed(() => {
          const { modelValue: rawModelValue, multiple } = props2;
          const fallback = multiple ? [] : void 0;
          if (isArray$5(rawModelValue)) {
            return multiple ? rawModelValue : fallback;
          }
          return multiple ? fallback : rawModelValue;
        });
        const API = useSelect$1(reactive({
          ...toRefs(props2),
          modelValue
        }), emit2);
        const { calculatorRef, inputStyle } = useCalcInputWidth();
        provide(selectV2InjectionKey, {
          props: reactive({
            ...toRefs(props2),
            height: API.popupHeight,
            modelValue
          }),
          expanded: API.expanded,
          tooltipRef: API.tooltipRef,
          onSelect: API.onSelect,
          onHover: API.onHover,
          onKeyboardNavigate: API.onKeyboardNavigate,
          onKeyboardSelect: API.onKeyboardSelect
        });
        const selectedLabel = computed(() => {
          if (!props2.multiple) {
            return API.states.selectedLabel;
          }
          return API.states.cachedOptions.map((i2) => i2.label);
        });
        return {
          ...API,
          modelValue,
          selectedLabel,
          calculatorRef,
          inputStyle
        };
      }
    });
    function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_tag = resolveComponent("el-tag");
      const _component_el_tooltip = resolveComponent("el-tooltip");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_select_menu = resolveComponent("el-select-menu");
      const _directive_click_outside = resolveDirective("click-outside");
      return withDirectives((openBlock(), createElementBlock("div", {
        ref: "selectRef",
        class: normalizeClass([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
        onMouseenter: ($event) => _ctx.states.inputHovering = true,
        onMouseleave: ($event) => _ctx.states.inputHovering = false
      }, [
        createVNode$1(_component_el_tooltip, {
          ref: "tooltipRef",
          visible: _ctx.dropdownMenuVisible,
          teleported: _ctx.teleported,
          "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
          "gpu-acceleration": false,
          "stop-popper-mouse-event": false,
          "popper-options": _ctx.popperOptions,
          "fallback-placements": _ctx.fallbackPlacements,
          effect: _ctx.effect,
          placement: _ctx.placement,
          pure: "",
          transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
          trigger: "click",
          persistent: _ctx.persistent,
          "append-to": _ctx.appendTo,
          "show-arrow": _ctx.showArrow,
          offset: _ctx.offset,
          onBeforeShow: _ctx.handleMenuEnter,
          onHide: ($event) => _ctx.states.isBeforeHide = false
        }, {
          default: withCtx(() => [
            createBaseVNode("div", {
              ref: "wrapperRef",
              class: normalizeClass([
                _ctx.nsSelect.e("wrapper"),
                _ctx.nsSelect.is("focused", _ctx.isFocused),
                _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
                _ctx.nsSelect.is("filterable", _ctx.filterable),
                _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
              ]),
              onClick: withModifiers(_ctx.toggleMenu, ["prevent"])
            }, [
              _ctx.$slots.prefix ? (openBlock(), createElementBlock("div", {
                key: 0,
                ref: "prefixRef",
                class: normalizeClass(_ctx.nsSelect.e("prefix"))
              }, [
                renderSlot(_ctx.$slots, "prefix")
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                ref: "selectionRef",
                class: normalizeClass([
                  _ctx.nsSelect.e("selection"),
                  _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)
                ])
              }, [
                _ctx.multiple ? renderSlot(_ctx.$slots, "tag", { key: 0 }, () => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
                    return openBlock(), createElementBlock("div", {
                      key: _ctx.getValueKey(_ctx.getValue(item)),
                      class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                    }, [
                      createVNode$1(_component_el_tag, {
                        closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
                        size: _ctx.collapseTagSize,
                        type: _ctx.tagType,
                        effect: _ctx.tagEffect,
                        "disable-transitions": "",
                        style: normalizeStyle$1(_ctx.tagStyle),
                        onClose: ($event) => _ctx.deleteTag($event, item)
                      }, {
                        default: withCtx(() => [
                          createBaseVNode("span", {
                            class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                          }, [
                            renderSlot(_ctx.$slots, "label", {
                              label: _ctx.getLabel(item),
                              value: _ctx.getValue(item)
                            }, () => [
                              createTextVNode(toDisplayString(_ctx.getLabel(item)), 1)
                            ])
                          ], 2)
                        ]),
                        _: 2
                      }, 1032, ["closable", "size", "type", "effect", "style", "onClose"])
                    ], 2);
                  }), 128)),
                  _ctx.collapseTags && _ctx.modelValue.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tooltip, {
                    key: 0,
                    ref: "tagTooltipRef",
                    disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
                    "fallback-placements": ["bottom", "top", "right", "left"],
                    effect: _ctx.effect,
                    placement: "bottom",
                    teleported: _ctx.teleported
                  }, {
                    default: withCtx(() => [
                      createBaseVNode("div", {
                        ref: "collapseItemRef",
                        class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                      }, [
                        createVNode$1(_component_el_tag, {
                          closable: false,
                          size: _ctx.collapseTagSize,
                          type: _ctx.tagType,
                          effect: _ctx.tagEffect,
                          style: normalizeStyle$1(_ctx.collapseTagStyle),
                          "disable-transitions": ""
                        }, {
                          default: withCtx(() => [
                            createBaseVNode("span", {
                              class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                            }, " + " + toDisplayString(_ctx.modelValue.length - _ctx.maxCollapseTags), 3)
                          ]),
                          _: 1
                        }, 8, ["size", "type", "effect", "style"])
                      ], 2)
                    ]),
                    content: withCtx(() => [
                      createBaseVNode("div", {
                        ref: "tagMenuRef",
                        class: normalizeClass(_ctx.nsSelect.e("selection"))
                      }, [
                        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (selected) => {
                          return openBlock(), createElementBlock("div", {
                            key: _ctx.getValueKey(_ctx.getValue(selected)),
                            class: normalizeClass(_ctx.nsSelect.e("selected-item"))
                          }, [
                            createVNode$1(_component_el_tag, {
                              class: "in-tooltip",
                              closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
                              size: _ctx.collapseTagSize,
                              type: _ctx.tagType,
                              effect: _ctx.tagEffect,
                              "disable-transitions": "",
                              onClose: ($event) => _ctx.deleteTag($event, selected)
                            }, {
                              default: withCtx(() => [
                                createBaseVNode("span", {
                                  class: normalizeClass(_ctx.nsSelect.e("tags-text"))
                                }, [
                                  renderSlot(_ctx.$slots, "label", {
                                    label: _ctx.getLabel(selected),
                                    value: _ctx.getValue(selected)
                                  }, () => [
                                    createTextVNode(toDisplayString(_ctx.getLabel(selected)), 1)
                                  ])
                                ], 2)
                              ]),
                              _: 2
                            }, 1032, ["closable", "size", "type", "effect", "onClose"])
                          ], 2);
                        }), 128))
                      ], 2)
                    ]),
                    _: 3
                  }, 8, ["disabled", "effect", "teleported"])) : createCommentVNode("v-if", true)
                ]) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass([
                    _ctx.nsSelect.e("selected-item"),
                    _ctx.nsSelect.e("input-wrapper"),
                    _ctx.nsSelect.is("hidden", !_ctx.filterable)
                  ])
                }, [
                  withDirectives(createBaseVNode("input", {
                    id: _ctx.inputId,
                    ref: "inputRef",
                    "onUpdate:modelValue": ($event) => _ctx.states.inputValue = $event,
                    style: normalizeStyle$1(_ctx.inputStyle),
                    autocomplete: _ctx.autocomplete,
                    tabindex: _ctx.tabindex,
                    "aria-autocomplete": "list",
                    "aria-haspopup": "listbox",
                    autocapitalize: "off",
                    "aria-expanded": _ctx.expanded,
                    "aria-label": _ctx.ariaLabel,
                    class: normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
                    disabled: _ctx.selectDisabled,
                    role: "combobox",
                    readonly: !_ctx.filterable,
                    spellcheck: "false",
                    type: "text",
                    name: _ctx.name,
                    onInput: _ctx.onInput,
                    onCompositionstart: _ctx.handleCompositionStart,
                    onCompositionupdate: _ctx.handleCompositionUpdate,
                    onCompositionend: _ctx.handleCompositionEnd,
                    onKeydown: [
                      withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"]),
                      withKeys(withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"]),
                      withKeys(withModifiers(_ctx.onKeyboardSelect, ["stop", "prevent"]), ["enter"]),
                      withKeys(withModifiers(_ctx.handleEsc, ["stop", "prevent"]), ["esc"]),
                      withKeys(withModifiers(_ctx.handleDel, ["stop"]), ["delete"])
                    ],
                    onClick: withModifiers(_ctx.toggleMenu, ["stop"])
                  }, null, 46, ["id", "onUpdate:modelValue", "autocomplete", "tabindex", "aria-expanded", "aria-label", "disabled", "readonly", "name", "onInput", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown", "onClick"]), [
                    [vModelText, _ctx.states.inputValue]
                  ]),
                  _ctx.filterable ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    ref: "calculatorRef",
                    "aria-hidden": "true",
                    class: normalizeClass(_ctx.nsSelect.e("input-calculator")),
                    textContent: toDisplayString(_ctx.states.inputValue)
                  }, null, 10, ["textContent"])) : createCommentVNode("v-if", true)
                ], 2),
                _ctx.shouldShowPlaceholder ? (openBlock(), createElementBlock("div", {
                  key: 1,
                  class: normalizeClass([
                    _ctx.nsSelect.e("selected-item"),
                    _ctx.nsSelect.e("placeholder"),
                    _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
                  ])
                }, [
                  _ctx.hasModelValue ? renderSlot(_ctx.$slots, "label", {
                    key: 0,
                    label: _ctx.currentPlaceholder,
                    value: _ctx.modelValue
                  }, () => [
                    createBaseVNode("span", null, toDisplayString(_ctx.currentPlaceholder), 1)
                  ]) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.currentPlaceholder), 1))
                ], 2)) : createCommentVNode("v-if", true)
              ], 2),
              createBaseVNode("div", {
                ref: "suffixRef",
                class: normalizeClass(_ctx.nsSelect.e("suffix"))
              }, [
                _ctx.iconComponent ? withDirectives((openBlock(), createBlock(_component_el_icon, {
                  key: 0,
                  class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse])
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
                  ]),
                  _: 1
                }, 8, ["class"])), [
                  [vShow, !_ctx.showClearBtn]
                ]) : createCommentVNode("v-if", true),
                _ctx.showClearBtn && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
                  key: 1,
                  class: normalizeClass([
                    _ctx.nsSelect.e("caret"),
                    _ctx.nsInput.e("icon"),
                    _ctx.nsSelect.e("clear")
                  ]),
                  onClick: withModifiers(_ctx.handleClear, ["prevent", "stop"])
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
                  ]),
                  _: 1
                }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
                _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? (openBlock(), createBlock(_component_el_icon, {
                  key: 2,
                  class: normalizeClass([
                    _ctx.nsInput.e("icon"),
                    _ctx.nsInput.e("validateIcon"),
                    _ctx.nsInput.is("loading", _ctx.validateState === "validating")
                  ])
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(_ctx.validateIcon)))
                  ]),
                  _: 1
                }, 8, ["class"])) : createCommentVNode("v-if", true)
              ], 2)
            ], 10, ["onClick"])
          ]),
          content: withCtx(() => [
            createVNode$1(_component_el_select_menu, {
              ref: "menuRef",
              data: _ctx.filteredOptions,
              width: _ctx.popperSize,
              "hovering-index": _ctx.states.hoveringIndex,
              "scrollbar-always-on": _ctx.scrollbarAlwaysOn
            }, createSlots({
              default: withCtx((scope) => [
                renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(scope)))
              ]),
              _: 2
            }, [
              _ctx.$slots.header ? {
                name: "header",
                fn: withCtx(() => [
                  createBaseVNode("div", {
                    class: normalizeClass(_ctx.nsSelect.be("dropdown", "header"))
                  }, [
                    renderSlot(_ctx.$slots, "header")
                  ], 2)
                ])
              } : void 0,
              _ctx.$slots.loading && _ctx.loading ? {
                name: "loading",
                fn: withCtx(() => [
                  createBaseVNode("div", {
                    class: normalizeClass(_ctx.nsSelect.be("dropdown", "loading"))
                  }, [
                    renderSlot(_ctx.$slots, "loading")
                  ], 2)
                ])
              } : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
                name: "empty",
                fn: withCtx(() => [
                  createBaseVNode("div", {
                    class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
                  }, [
                    renderSlot(_ctx.$slots, "empty", {}, () => [
                      createBaseVNode("span", null, toDisplayString(_ctx.emptyText), 1)
                    ])
                  ], 2)
                ])
              } : void 0,
              _ctx.$slots.footer ? {
                name: "footer",
                fn: withCtx(() => [
                  createBaseVNode("div", {
                    class: normalizeClass(_ctx.nsSelect.be("dropdown", "footer"))
                  }, [
                    renderSlot(_ctx.$slots, "footer")
                  ], 2)
                ])
              } : void 0
            ]), 1032, ["data", "width", "hovering-index", "scrollbar-always-on"])
          ]),
          _: 3
        }, 8, ["visible", "teleported", "popper-class", "popper-options", "fallback-placements", "effect", "placement", "transition", "persistent", "append-to", "show-arrow", "offset", "onBeforeShow", "onHide"])
      ], 42, ["onMouseenter", "onMouseleave"])), [
        [_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
      ]);
    }
    var Select = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$b], ["__file", "select.vue"]]);
    const ElSelectV2 = withInstall(Select);
    const skeletonProps = buildProps({
      animated: {
        type: Boolean,
        default: false
      },
      count: {
        type: Number,
        default: 1
      },
      rows: {
        type: Number,
        default: 3
      },
      loading: {
        type: Boolean,
        default: true
      },
      throttle: {
        type: definePropType([Number, Object])
      }
    });
    const skeletonItemProps = buildProps({
      variant: {
        type: String,
        values: [
          "circle",
          "rect",
          "h1",
          "h3",
          "text",
          "caption",
          "p",
          "image",
          "button"
        ],
        default: "text"
      }
    });
    const __default__$E = /* @__PURE__ */ defineComponent({
      name: "ElSkeletonItem"
    });
    const _sfc_main$T = /* @__PURE__ */ defineComponent({
      ...__default__$E,
      props: skeletonItemProps,
      setup(__props) {
        const ns = useNamespace("skeleton");
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).e("item"), unref(ns).e(_ctx.variant)])
          }, [
            _ctx.variant === "image" ? (openBlock(), createBlock(unref(picture_filled_default), { key: 0 })) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var SkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__file", "skeleton-item.vue"]]);
    const useThrottleRender = (loading, throttle2 = 0) => {
      if (throttle2 === 0)
        return loading;
      const initVal = isObject$7(throttle2) && Boolean(throttle2.initVal);
      const throttled = ref(initVal);
      let timeoutHandle = null;
      const dispatchThrottling = (timer) => {
        if (isUndefined$1(timer)) {
          throttled.value = loading.value;
          return;
        }
        if (timeoutHandle) {
          clearTimeout(timeoutHandle);
        }
        timeoutHandle = setTimeout(() => {
          throttled.value = loading.value;
        }, timer);
      };
      const dispatcher = (type) => {
        if (type === "leading") {
          if (isNumber$2(throttle2)) {
            dispatchThrottling(throttle2);
          } else {
            dispatchThrottling(throttle2.leading);
          }
        } else {
          if (isObject$7(throttle2)) {
            dispatchThrottling(throttle2.trailing);
          } else {
            throttled.value = false;
          }
        }
      };
      onMounted(() => dispatcher("leading"));
      watch(() => loading.value, (val) => {
        dispatcher(val ? "leading" : "trailing");
      });
      return throttled;
    };
    const __default__$D = /* @__PURE__ */ defineComponent({
      name: "ElSkeleton"
    });
    const _sfc_main$S = /* @__PURE__ */ defineComponent({
      ...__default__$D,
      props: skeletonProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const ns = useNamespace("skeleton");
        const uiLoading = useThrottleRender(toRef(props2, "loading"), props2.throttle);
        expose({
          uiLoading
        });
        return (_ctx, _cache) => {
          return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            class: [unref(ns).b(), unref(ns).is("animated", _ctx.animated)]
          }, _ctx.$attrs), [
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.count, (i2) => {
              return openBlock(), createElementBlock(Fragment, { key: i2 }, [
                unref(uiLoading) ? renderSlot(_ctx.$slots, "template", { key: i2 }, () => [
                  createVNode$1(SkeletonItem, {
                    class: normalizeClass(unref(ns).is("first")),
                    variant: "p"
                  }, null, 8, ["class"]),
                  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
                    return openBlock(), createBlock(SkeletonItem, {
                      key: item,
                      class: normalizeClass([
                        unref(ns).e("paragraph"),
                        unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
                      ]),
                      variant: "p"
                    }, null, 8, ["class"]);
                  }), 128))
                ]) : createCommentVNode("v-if", true)
              ], 64);
            }), 128))
          ], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
        };
      }
    });
    var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__file", "skeleton.vue"]]);
    const ElSkeleton = withInstall(Skeleton, {
      SkeletonItem
    });
    const ElSkeletonItem = withNoopInstall(SkeletonItem);
    const sliderContextKey = Symbol("sliderContextKey");
    const sliderProps = buildProps({
      modelValue: {
        type: definePropType([Number, Array]),
        default: 0
      },
      id: {
        type: String,
        default: void 0
      },
      min: {
        type: Number,
        default: 0
      },
      max: {
        type: Number,
        default: 100
      },
      step: {
        type: Number,
        default: 1
      },
      showInput: Boolean,
      showInputControls: {
        type: Boolean,
        default: true
      },
      size: useSizeProp,
      inputSize: useSizeProp,
      showStops: Boolean,
      showTooltip: {
        type: Boolean,
        default: true
      },
      formatTooltip: {
        type: definePropType(Function),
        default: void 0
      },
      disabled: Boolean,
      range: Boolean,
      vertical: Boolean,
      height: String,
      debounce: {
        type: Number,
        default: 300
      },
      rangeStartLabel: {
        type: String,
        default: void 0
      },
      rangeEndLabel: {
        type: String,
        default: void 0
      },
      formatValueText: {
        type: definePropType(Function),
        default: void 0
      },
      tooltipClass: {
        type: String,
        default: void 0
      },
      placement: {
        type: String,
        values: Ee,
        default: "top"
      },
      marks: {
        type: definePropType(Object)
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      persistent: {
        type: Boolean,
        default: true
      },
      ...useAriaProps(["ariaLabel"])
    });
    const isValidValue$1 = (value) => isNumber$2(value) || isArray$5(value) && value.every(isNumber$2);
    const sliderEmits = {
      [UPDATE_MODEL_EVENT]: isValidValue$1,
      [INPUT_EVENT]: isValidValue$1,
      [CHANGE_EVENT]: isValidValue$1
    };
    const sliderButtonProps = buildProps({
      modelValue: {
        type: Number,
        default: 0
      },
      vertical: Boolean,
      tooltipClass: String,
      placement: {
        type: String,
        values: Ee,
        default: "top"
      }
    });
    const sliderButtonEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isNumber$2(value)
    };
    const useTooltip = (props2, formatTooltip, showTooltip2) => {
      const tooltip = ref();
      const tooltipVisible = ref(false);
      const enableFormat = computed(() => {
        return formatTooltip.value instanceof Function;
      });
      const formatValue = computed(() => {
        return enableFormat.value && formatTooltip.value(props2.modelValue) || props2.modelValue;
      });
      const displayTooltip = debounce(() => {
        showTooltip2.value && (tooltipVisible.value = true);
      }, 50);
      const hideTooltip = debounce(() => {
        showTooltip2.value && (tooltipVisible.value = false);
      }, 50);
      return {
        tooltip,
        tooltipVisible,
        formatValue,
        displayTooltip,
        hideTooltip
      };
    };
    const useSliderButton = (props2, initData, emit2) => {
      const {
        disabled,
        min: min3,
        max: max3,
        step,
        showTooltip: showTooltip2,
        persistent,
        precision,
        sliderSize,
        formatTooltip,
        emitChange,
        resetSize,
        updateDragging
      } = inject(sliderContextKey);
      const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props2, formatTooltip, showTooltip2);
      const button = ref();
      const currentPosition = computed(() => {
        return `${(props2.modelValue - min3.value) / (max3.value - min3.value) * 100}%`;
      });
      const wrapperStyle = computed(() => {
        return props2.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
      });
      const handleMouseEnter = () => {
        initData.hovering = true;
        displayTooltip();
      };
      const handleMouseLeave = () => {
        initData.hovering = false;
        if (!initData.dragging) {
          hideTooltip();
        }
      };
      const onButtonDown = (event) => {
        if (disabled.value)
          return;
        event.preventDefault();
        onDragStart(event);
        window.addEventListener("mousemove", onDragging);
        window.addEventListener("touchmove", onDragging);
        window.addEventListener("mouseup", onDragEnd);
        window.addEventListener("touchend", onDragEnd);
        window.addEventListener("contextmenu", onDragEnd);
        button.value.focus();
      };
      const incrementPosition = (amount) => {
        if (disabled.value)
          return;
        initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max3.value - min3.value) * 100;
        setPosition(initData.newPosition);
        emitChange();
      };
      const onLeftKeyDown = () => {
        incrementPosition(-step.value);
      };
      const onRightKeyDown = () => {
        incrementPosition(step.value);
      };
      const onPageDownKeyDown = () => {
        incrementPosition(-step.value * 4);
      };
      const onPageUpKeyDown = () => {
        incrementPosition(step.value * 4);
      };
      const onHomeKeyDown = () => {
        if (disabled.value)
          return;
        setPosition(0);
        emitChange();
      };
      const onEndKeyDown = () => {
        if (disabled.value)
          return;
        setPosition(100);
        emitChange();
      };
      const onKeyDown = (event) => {
        let isPreventDefault = true;
        switch (event.code) {
          case EVENT_CODE.left:
          case EVENT_CODE.down:
            onLeftKeyDown();
            break;
          case EVENT_CODE.right:
          case EVENT_CODE.up:
            onRightKeyDown();
            break;
          case EVENT_CODE.home:
            onHomeKeyDown();
            break;
          case EVENT_CODE.end:
            onEndKeyDown();
            break;
          case EVENT_CODE.pageDown:
            onPageDownKeyDown();
            break;
          case EVENT_CODE.pageUp:
            onPageUpKeyDown();
            break;
          default:
            isPreventDefault = false;
            break;
        }
        isPreventDefault && event.preventDefault();
      };
      const getClientXY2 = (event) => {
        let clientX;
        let clientY;
        if (event.type.startsWith("touch")) {
          clientY = event.touches[0].clientY;
          clientX = event.touches[0].clientX;
        } else {
          clientY = event.clientY;
          clientX = event.clientX;
        }
        return {
          clientX,
          clientY
        };
      };
      const onDragStart = (event) => {
        initData.dragging = true;
        initData.isClick = true;
        const { clientX, clientY } = getClientXY2(event);
        if (props2.vertical) {
          initData.startY = clientY;
        } else {
          initData.startX = clientX;
        }
        initData.startPosition = Number.parseFloat(currentPosition.value);
        initData.newPosition = initData.startPosition;
      };
      const onDragging = (event) => {
        if (initData.dragging) {
          initData.isClick = false;
          displayTooltip();
          resetSize();
          let diff;
          const { clientX, clientY } = getClientXY2(event);
          if (props2.vertical) {
            initData.currentY = clientY;
            diff = (initData.startY - initData.currentY) / sliderSize.value * 100;
          } else {
            initData.currentX = clientX;
            diff = (initData.currentX - initData.startX) / sliderSize.value * 100;
          }
          initData.newPosition = initData.startPosition + diff;
          setPosition(initData.newPosition);
        }
      };
      const onDragEnd = () => {
        if (initData.dragging) {
          setTimeout(() => {
            initData.dragging = false;
            if (!initData.hovering) {
              hideTooltip();
            }
            if (!initData.isClick) {
              setPosition(initData.newPosition);
            }
            emitChange();
          }, 0);
          window.removeEventListener("mousemove", onDragging);
          window.removeEventListener("touchmove", onDragging);
          window.removeEventListener("mouseup", onDragEnd);
          window.removeEventListener("touchend", onDragEnd);
          window.removeEventListener("contextmenu", onDragEnd);
        }
      };
      const setPosition = async (newPosition) => {
        if (newPosition === null || Number.isNaN(+newPosition))
          return;
        if (newPosition < 0) {
          newPosition = 0;
        } else if (newPosition > 100) {
          newPosition = 100;
        }
        const lengthPerStep = 100 / ((max3.value - min3.value) / step.value);
        const steps = Math.round(newPosition / lengthPerStep);
        let value = steps * lengthPerStep * (max3.value - min3.value) * 0.01 + min3.value;
        value = Number.parseFloat(value.toFixed(precision.value));
        if (value !== props2.modelValue) {
          emit2(UPDATE_MODEL_EVENT, value);
        }
        if (!initData.dragging && props2.modelValue !== initData.oldValue) {
          initData.oldValue = props2.modelValue;
        }
        await nextTick();
        initData.dragging && displayTooltip();
        tooltip.value.updatePopper();
      };
      watch(() => initData.dragging, (val) => {
        updateDragging(val);
      });
      useEventListener(button, "touchstart", onButtonDown, { passive: false });
      return {
        disabled,
        button,
        tooltip,
        tooltipVisible,
        showTooltip: showTooltip2,
        persistent,
        wrapperStyle,
        formatValue,
        handleMouseEnter,
        handleMouseLeave,
        onButtonDown,
        onKeyDown,
        setPosition
      };
    };
    const __default__$C = /* @__PURE__ */ defineComponent({
      name: "ElSliderButton"
    });
    const _sfc_main$R = /* @__PURE__ */ defineComponent({
      ...__default__$C,
      props: sliderButtonProps,
      emits: sliderButtonEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("slider");
        const initData = reactive({
          hovering: false,
          dragging: false,
          isClick: false,
          startX: 0,
          currentX: 0,
          startY: 0,
          currentY: 0,
          startPosition: 0,
          newPosition: 0,
          oldValue: props2.modelValue
        });
        const tooltipPersistent = computed(() => !showTooltip2.value ? false : persistent.value);
        const {
          disabled,
          button,
          tooltip,
          showTooltip: showTooltip2,
          persistent,
          tooltipVisible,
          wrapperStyle,
          formatValue,
          handleMouseEnter,
          handleMouseLeave,
          onButtonDown,
          onKeyDown,
          setPosition
        } = useSliderButton(props2, initData, emit2);
        const { hovering, dragging } = toRefs(initData);
        expose({
          onButtonDown,
          onKeyDown,
          setPosition,
          hovering,
          dragging
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "button",
            ref: button,
            class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
            style: normalizeStyle$1(unref(wrapperStyle)),
            tabindex: unref(disabled) ? -1 : 0,
            onMouseenter: unref(handleMouseEnter),
            onMouseleave: unref(handleMouseLeave),
            onMousedown: unref(onButtonDown),
            onFocus: unref(handleMouseEnter),
            onBlur: unref(handleMouseLeave),
            onKeydown: unref(onKeyDown)
          }, [
            createVNode$1(unref(ElTooltip), {
              ref_key: "tooltip",
              ref: tooltip,
              visible: unref(tooltipVisible),
              placement: _ctx.placement,
              "fallback-placements": ["top", "bottom", "right", "left"],
              "stop-popper-mouse-event": false,
              "popper-class": _ctx.tooltipClass,
              disabled: !unref(showTooltip2),
              persistent: unref(tooltipPersistent)
            }, {
              content: withCtx(() => [
                createBaseVNode("span", null, toDisplayString(unref(formatValue)), 1)
              ]),
              default: withCtx(() => [
                createBaseVNode("div", {
                  class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
                }, null, 2)
              ]),
              _: 1
            }, 8, ["visible", "placement", "popper-class", "disabled", "persistent"])
          ], 46, ["tabindex", "onMouseenter", "onMouseleave", "onMousedown", "onFocus", "onBlur", "onKeydown"]);
        };
      }
    });
    var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__file", "button.vue"]]);
    const sliderMarkerProps = buildProps({
      mark: {
        type: definePropType([String, Object]),
        default: void 0
      }
    });
    var SliderMarker = /* @__PURE__ */ defineComponent({
      name: "ElSliderMarker",
      props: sliderMarkerProps,
      setup(props2) {
        const ns = useNamespace("slider");
        const label = computed(() => {
          return isString$3(props2.mark) ? props2.mark : props2.mark.label;
        });
        const style = computed(() => isString$3(props2.mark) ? void 0 : props2.mark.style);
        return () => h$1("div", {
          class: ns.e("marks-text"),
          style: style.value
        }, label.value);
      }
    });
    const useSlide = (props2, initData, emit2) => {
      const { form: elForm, formItem: elFormItem } = useFormItem();
      const slider = shallowRef();
      const firstButton = ref();
      const secondButton = ref();
      const buttonRefs = {
        firstButton,
        secondButton
      };
      const sliderDisabled = computed(() => {
        return props2.disabled || (elForm == null ? void 0 : elForm.disabled) || false;
      });
      const minValue = computed(() => {
        return Math.min(initData.firstValue, initData.secondValue);
      });
      const maxValue = computed(() => {
        return Math.max(initData.firstValue, initData.secondValue);
      });
      const barSize = computed(() => {
        return props2.range ? `${100 * (maxValue.value - minValue.value) / (props2.max - props2.min)}%` : `${100 * (initData.firstValue - props2.min) / (props2.max - props2.min)}%`;
      });
      const barStart = computed(() => {
        return props2.range ? `${100 * (minValue.value - props2.min) / (props2.max - props2.min)}%` : "0%";
      });
      const runwayStyle = computed(() => {
        return props2.vertical ? { height: props2.height } : {};
      });
      const barStyle = computed(() => {
        return props2.vertical ? {
          height: barSize.value,
          bottom: barStart.value
        } : {
          width: barSize.value,
          left: barStart.value
        };
      });
      const resetSize = () => {
        if (slider.value) {
          initData.sliderSize = slider.value[`client${props2.vertical ? "Height" : "Width"}`];
        }
      };
      const getButtonRefByPercent = (percent) => {
        const targetValue = props2.min + percent * (props2.max - props2.min) / 100;
        if (!props2.range) {
          return firstButton;
        }
        let buttonRefName;
        if (Math.abs(minValue.value - targetValue) < Math.abs(maxValue.value - targetValue)) {
          buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton";
        } else {
          buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton";
        }
        return buttonRefs[buttonRefName];
      };
      const setPosition = (percent) => {
        const buttonRef = getButtonRefByPercent(percent);
        buttonRef.value.setPosition(percent);
        return buttonRef;
      };
      const setFirstValue = (firstValue) => {
        initData.firstValue = firstValue != null ? firstValue : props2.min;
        _emit(props2.range ? [minValue.value, maxValue.value] : firstValue != null ? firstValue : props2.min);
      };
      const setSecondValue = (secondValue) => {
        initData.secondValue = secondValue;
        if (props2.range) {
          _emit([minValue.value, maxValue.value]);
        }
      };
      const _emit = (val) => {
        emit2(UPDATE_MODEL_EVENT, val);
        emit2(INPUT_EVENT, val);
      };
      const emitChange = async () => {
        await nextTick();
        emit2(CHANGE_EVENT, props2.range ? [minValue.value, maxValue.value] : props2.modelValue);
      };
      const handleSliderPointerEvent = (event) => {
        var _a2, _b2, _c2, _d, _e, _f;
        if (sliderDisabled.value || initData.dragging)
          return;
        resetSize();
        let newPercent = 0;
        if (props2.vertical) {
          const clientY = (_c2 = (_b2 = (_a2 = event.touches) == null ? void 0 : _a2.item(0)) == null ? void 0 : _b2.clientY) != null ? _c2 : event.clientY;
          const sliderOffsetBottom = slider.value.getBoundingClientRect().bottom;
          newPercent = (sliderOffsetBottom - clientY) / initData.sliderSize * 100;
        } else {
          const clientX = (_f = (_e = (_d = event.touches) == null ? void 0 : _d.item(0)) == null ? void 0 : _e.clientX) != null ? _f : event.clientX;
          const sliderOffsetLeft = slider.value.getBoundingClientRect().left;
          newPercent = (clientX - sliderOffsetLeft) / initData.sliderSize * 100;
        }
        if (newPercent < 0 || newPercent > 100)
          return;
        return setPosition(newPercent);
      };
      const onSliderWrapperPrevent = (event) => {
        var _a2, _b2;
        if (((_a2 = buttonRefs["firstButton"].value) == null ? void 0 : _a2.dragging) || ((_b2 = buttonRefs["secondButton"].value) == null ? void 0 : _b2.dragging)) {
          event.preventDefault();
        }
      };
      const onSliderDown = async (event) => {
        const buttonRef = handleSliderPointerEvent(event);
        if (buttonRef) {
          await nextTick();
          buttonRef.value.onButtonDown(event);
        }
      };
      const onSliderClick = (event) => {
        const buttonRef = handleSliderPointerEvent(event);
        if (buttonRef) {
          emitChange();
        }
      };
      const onSliderMarkerDown = (position2) => {
        if (sliderDisabled.value || initData.dragging)
          return;
        const buttonRef = setPosition(position2);
        if (buttonRef) {
          emitChange();
        }
      };
      return {
        elFormItem,
        slider,
        firstButton,
        secondButton,
        sliderDisabled,
        minValue,
        maxValue,
        runwayStyle,
        barStyle,
        resetSize,
        setPosition,
        emitChange,
        onSliderWrapperPrevent,
        onSliderClick,
        onSliderDown,
        onSliderMarkerDown,
        setFirstValue,
        setSecondValue
      };
    };
    const useStops = (props2, initData, minValue, maxValue) => {
      const stops = computed(() => {
        if (!props2.showStops || props2.min > props2.max)
          return [];
        if (props2.step === 0) {
          return [];
        }
        const stopCount = (props2.max - props2.min) / props2.step;
        const stepWidth = 100 * props2.step / (props2.max - props2.min);
        const result = Array.from({ length: stopCount - 1 }).map((_2, index) => (index + 1) * stepWidth);
        if (props2.range) {
          return result.filter((step) => {
            return step < 100 * (minValue.value - props2.min) / (props2.max - props2.min) || step > 100 * (maxValue.value - props2.min) / (props2.max - props2.min);
          });
        } else {
          return result.filter((step) => step > 100 * (initData.firstValue - props2.min) / (props2.max - props2.min));
        }
      });
      const getStopStyle = (position2) => {
        return props2.vertical ? { bottom: `${position2}%` } : { left: `${position2}%` };
      };
      return {
        stops,
        getStopStyle
      };
    };
    const useMarks = (props2) => {
      return computed(() => {
        if (!props2.marks) {
          return [];
        }
        const marksKeys = Object.keys(props2.marks);
        return marksKeys.map(Number.parseFloat).sort((a2, b2) => a2 - b2).filter((point) => point <= props2.max && point >= props2.min).map((point) => ({
          point,
          position: (point - props2.min) * 100 / (props2.max - props2.min),
          mark: props2.marks[point]
        }));
      });
    };
    const useWatch = (props2, initData, minValue, maxValue, emit2, elFormItem) => {
      const _emit = (val) => {
        emit2(UPDATE_MODEL_EVENT, val);
        emit2(INPUT_EVENT, val);
      };
      const valueChanged = () => {
        if (props2.range) {
          return ![minValue.value, maxValue.value].every((item, index) => item === initData.oldValue[index]);
        } else {
          return props2.modelValue !== initData.oldValue;
        }
      };
      const setValues = () => {
        var _a2, _b2;
        if (props2.min > props2.max) {
          throwError$1("Slider", "min should not be greater than max.");
        }
        const val = props2.modelValue;
        if (props2.range && isArray$5(val)) {
          if (val[1] < props2.min) {
            _emit([props2.min, props2.min]);
          } else if (val[0] > props2.max) {
            _emit([props2.max, props2.max]);
          } else if (val[0] < props2.min) {
            _emit([props2.min, val[1]]);
          } else if (val[1] > props2.max) {
            _emit([val[0], props2.max]);
          } else {
            initData.firstValue = val[0];
            initData.secondValue = val[1];
            if (valueChanged()) {
              if (props2.validateEvent) {
                (_a2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a2.call(elFormItem, "change").catch((err) => debugWarn());
              }
              initData.oldValue = val.slice();
            }
          }
        } else if (!props2.range && isNumber$2(val) && !Number.isNaN(val)) {
          if (val < props2.min) {
            _emit(props2.min);
          } else if (val > props2.max) {
            _emit(props2.max);
          } else {
            initData.firstValue = val;
            if (valueChanged()) {
              if (props2.validateEvent) {
                (_b2 = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _b2.call(elFormItem, "change").catch((err) => debugWarn());
              }
              initData.oldValue = val;
            }
          }
        }
      };
      setValues();
      watch(() => initData.dragging, (val) => {
        if (!val) {
          setValues();
        }
      });
      watch(() => props2.modelValue, (val, oldVal) => {
        if (initData.dragging || isArray$5(val) && isArray$5(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) {
          return;
        }
        setValues();
      }, {
        deep: true
      });
      watch(() => [props2.min, props2.max], () => {
        setValues();
      });
    };
    const useLifecycle = (props2, initData, resetSize) => {
      const sliderWrapper = ref();
      onMounted(async () => {
        if (props2.range) {
          if (isArray$5(props2.modelValue)) {
            initData.firstValue = Math.max(props2.min, props2.modelValue[0]);
            initData.secondValue = Math.min(props2.max, props2.modelValue[1]);
          } else {
            initData.firstValue = props2.min;
            initData.secondValue = props2.max;
          }
          initData.oldValue = [initData.firstValue, initData.secondValue];
        } else {
          if (!isNumber$2(props2.modelValue) || Number.isNaN(props2.modelValue)) {
            initData.firstValue = props2.min;
          } else {
            initData.firstValue = Math.min(props2.max, Math.max(props2.min, props2.modelValue));
          }
          initData.oldValue = initData.firstValue;
        }
        useEventListener(window, "resize", resetSize);
        await nextTick();
        resetSize();
      });
      return {
        sliderWrapper
      };
    };
    const __default__$B = /* @__PURE__ */ defineComponent({
      name: "ElSlider"
    });
    const _sfc_main$Q = /* @__PURE__ */ defineComponent({
      ...__default__$B,
      props: sliderProps,
      emits: sliderEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("slider");
        const { t } = useLocale();
        const initData = reactive({
          firstValue: 0,
          secondValue: 0,
          oldValue: 0,
          dragging: false,
          sliderSize: 1
        });
        const {
          elFormItem,
          slider,
          firstButton,
          secondButton,
          sliderDisabled,
          minValue,
          maxValue,
          runwayStyle,
          barStyle,
          resetSize,
          emitChange,
          onSliderWrapperPrevent,
          onSliderClick,
          onSliderDown,
          onSliderMarkerDown,
          setFirstValue,
          setSecondValue
        } = useSlide(props2, initData, emit2);
        const { stops, getStopStyle } = useStops(props2, initData, minValue, maxValue);
        const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext: elFormItem
        });
        const sliderWrapperSize = useFormSize();
        const sliderInputSize = computed(() => props2.inputSize || sliderWrapperSize.value);
        const groupLabel = computed(() => {
          return props2.ariaLabel || t("el.slider.defaultLabel", {
            min: props2.min,
            max: props2.max
          });
        });
        const firstButtonLabel = computed(() => {
          if (props2.range) {
            return props2.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
          } else {
            return groupLabel.value;
          }
        });
        const firstValueText = computed(() => {
          return props2.formatValueText ? props2.formatValueText(firstValue.value) : `${firstValue.value}`;
        });
        const secondButtonLabel = computed(() => {
          return props2.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
        });
        const secondValueText = computed(() => {
          return props2.formatValueText ? props2.formatValueText(secondValue.value) : `${secondValue.value}`;
        });
        const sliderKls = computed(() => [
          ns.b(),
          ns.m(sliderWrapperSize.value),
          ns.is("vertical", props2.vertical),
          { [ns.m("with-input")]: props2.showInput }
        ]);
        const markList = useMarks(props2);
        useWatch(props2, initData, minValue, maxValue, emit2, elFormItem);
        const precision = computed(() => {
          const precisions = [props2.min, props2.max, props2.step].map((item) => {
            const decimal = `${item}`.split(".")[1];
            return decimal ? decimal.length : 0;
          });
          return Math.max.apply(null, precisions);
        });
        const { sliderWrapper } = useLifecycle(props2, initData, resetSize);
        const { firstValue, secondValue, sliderSize } = toRefs(initData);
        const updateDragging = (val) => {
          initData.dragging = val;
        };
        useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, {
          passive: false
        });
        useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, {
          passive: false
        });
        provide(sliderContextKey, {
          ...toRefs(props2),
          sliderSize,
          disabled: sliderDisabled,
          precision,
          emitChange,
          resetSize,
          updateDragging
        });
        expose({
          onSliderClick
        });
        return (_ctx, _cache) => {
          var _a2, _b2;
          return openBlock(), createElementBlock("div", {
            id: _ctx.range ? unref(inputId) : void 0,
            ref_key: "sliderWrapper",
            ref: sliderWrapper,
            class: normalizeClass(unref(sliderKls)),
            role: _ctx.range ? "group" : void 0,
            "aria-label": _ctx.range && !unref(isLabeledByFormItem) ? unref(groupLabel) : void 0,
            "aria-labelledby": _ctx.range && unref(isLabeledByFormItem) ? (_a2 = unref(elFormItem)) == null ? void 0 : _a2.labelId : void 0
          }, [
            createBaseVNode("div", {
              ref_key: "slider",
              ref: slider,
              class: normalizeClass([
                unref(ns).e("runway"),
                { "show-input": _ctx.showInput && !_ctx.range },
                unref(ns).is("disabled", unref(sliderDisabled))
              ]),
              style: normalizeStyle$1(unref(runwayStyle)),
              onMousedown: unref(onSliderDown),
              onTouchstartPassive: unref(onSliderDown)
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("bar")),
                style: normalizeStyle$1(unref(barStyle))
              }, null, 6),
              createVNode$1(SliderButton, {
                id: !_ctx.range ? unref(inputId) : void 0,
                ref_key: "firstButton",
                ref: firstButton,
                "model-value": unref(firstValue),
                vertical: _ctx.vertical,
                "tooltip-class": _ctx.tooltipClass,
                placement: _ctx.placement,
                role: "slider",
                "aria-label": _ctx.range || !unref(isLabeledByFormItem) ? unref(firstButtonLabel) : void 0,
                "aria-labelledby": !_ctx.range && unref(isLabeledByFormItem) ? (_b2 = unref(elFormItem)) == null ? void 0 : _b2.labelId : void 0,
                "aria-valuemin": _ctx.min,
                "aria-valuemax": _ctx.range ? unref(secondValue) : _ctx.max,
                "aria-valuenow": unref(firstValue),
                "aria-valuetext": unref(firstValueText),
                "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
                "aria-disabled": unref(sliderDisabled),
                "onUpdate:modelValue": unref(setFirstValue)
              }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
              _ctx.range ? (openBlock(), createBlock(SliderButton, {
                key: 0,
                ref_key: "secondButton",
                ref: secondButton,
                "model-value": unref(secondValue),
                vertical: _ctx.vertical,
                "tooltip-class": _ctx.tooltipClass,
                placement: _ctx.placement,
                role: "slider",
                "aria-label": unref(secondButtonLabel),
                "aria-valuemin": unref(firstValue),
                "aria-valuemax": _ctx.max,
                "aria-valuenow": unref(secondValue),
                "aria-valuetext": unref(secondValueText),
                "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
                "aria-disabled": unref(sliderDisabled),
                "onUpdate:modelValue": unref(setSecondValue)
              }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : createCommentVNode("v-if", true),
              _ctx.showStops ? (openBlock(), createElementBlock("div", { key: 1 }, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(unref(stops), (item, key) => {
                  return openBlock(), createElementBlock("div", {
                    key,
                    class: normalizeClass(unref(ns).e("stop")),
                    style: normalizeStyle$1(unref(getStopStyle)(item))
                  }, null, 6);
                }), 128))
              ])) : createCommentVNode("v-if", true),
              unref(markList).length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
                createBaseVNode("div", null, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
                    return openBlock(), createElementBlock("div", {
                      key,
                      style: normalizeStyle$1(unref(getStopStyle)(item.position)),
                      class: normalizeClass([unref(ns).e("stop"), unref(ns).e("marks-stop")])
                    }, null, 6);
                  }), 128))
                ]),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("marks"))
                }, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(markList), (item, key) => {
                    return openBlock(), createBlock(unref(SliderMarker), {
                      key,
                      mark: item.mark,
                      style: normalizeStyle$1(unref(getStopStyle)(item.position)),
                      onMousedown: withModifiers(($event) => unref(onSliderMarkerDown)(item.position), ["stop"])
                    }, null, 8, ["mark", "style", "onMousedown"]);
                  }), 128))
                ], 2)
              ], 64)) : createCommentVNode("v-if", true)
            ], 46, ["onMousedown", "onTouchstartPassive"]),
            _ctx.showInput && !_ctx.range ? (openBlock(), createBlock(unref(ElInputNumber), {
              key: 0,
              ref: "input",
              "model-value": unref(firstValue),
              class: normalizeClass(unref(ns).e("input")),
              step: _ctx.step,
              disabled: unref(sliderDisabled),
              controls: _ctx.showInputControls,
              min: _ctx.min,
              max: _ctx.max,
              precision: unref(precision),
              debounce: _ctx.debounce,
              size: unref(sliderInputSize),
              "onUpdate:modelValue": unref(setFirstValue),
              onChange: unref(emitChange)
            }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "precision", "debounce", "size", "onUpdate:modelValue", "onChange"])) : createCommentVNode("v-if", true)
          ], 10, ["id", "role", "aria-label", "aria-labelledby"]);
        };
      }
    });
    var Slider = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__file", "slider.vue"]]);
    const ElSlider = withInstall(Slider);
    const spaceItemProps = buildProps({
      prefixCls: {
        type: String
      }
    });
    const SpaceItem = /* @__PURE__ */ defineComponent({
      name: "ElSpaceItem",
      props: spaceItemProps,
      setup(props2, { slots }) {
        const ns = useNamespace("space");
        const classes = computed(() => `${props2.prefixCls || ns.b()}__item`);
        return () => h$1("div", { class: classes.value }, renderSlot(slots, "default"));
      }
    });
    const SIZE_MAP = {
      small: 8,
      default: 12,
      large: 16
    };
    function useSpace(props2) {
      const ns = useNamespace("space");
      const classes = computed(() => [ns.b(), ns.m(props2.direction), props2.class]);
      const horizontalSize = ref(0);
      const verticalSize = ref(0);
      const containerStyle = computed(() => {
        const wrapKls = props2.wrap || props2.fill ? { flexWrap: "wrap" } : {};
        const alignment = {
          alignItems: props2.alignment
        };
        const gap = {
          rowGap: `${verticalSize.value}px`,
          columnGap: `${horizontalSize.value}px`
        };
        return [wrapKls, alignment, gap, props2.style];
      });
      const itemStyle = computed(() => {
        return props2.fill ? { flexGrow: 1, minWidth: `${props2.fillRatio}%` } : {};
      });
      watchEffect(() => {
        const { size = "small", wrap, direction: dir3, fill: fill2 } = props2;
        if (isArray$5(size)) {
          const [h2 = 0, v4 = 0] = size;
          horizontalSize.value = h2;
          verticalSize.value = v4;
        } else {
          let val;
          if (isNumber$2(size)) {
            val = size;
          } else {
            val = SIZE_MAP[size || "small"] || SIZE_MAP.small;
          }
          if ((wrap || fill2) && dir3 === "horizontal") {
            horizontalSize.value = verticalSize.value = val;
          } else {
            if (dir3 === "horizontal") {
              horizontalSize.value = val;
              verticalSize.value = 0;
            } else {
              verticalSize.value = val;
              horizontalSize.value = 0;
            }
          }
        }
      });
      return {
        classes,
        containerStyle,
        itemStyle
      };
    }
    const spaceProps = buildProps({
      direction: {
        type: String,
        values: ["horizontal", "vertical"],
        default: "horizontal"
      },
      class: {
        type: definePropType([
          String,
          Object,
          Array
        ]),
        default: ""
      },
      style: {
        type: definePropType([String, Array, Object]),
        default: ""
      },
      alignment: {
        type: definePropType(String),
        default: "center"
      },
      prefixCls: {
        type: String
      },
      spacer: {
        type: definePropType([Object, String, Number, Array]),
        default: null,
        validator: (val) => isVNode(val) || isNumber$2(val) || isString$3(val)
      },
      wrap: Boolean,
      fill: Boolean,
      fillRatio: {
        type: Number,
        default: 100
      },
      size: {
        type: [String, Array, Number],
        values: componentSizes,
        validator: (val) => {
          return isNumber$2(val) || isArray$5(val) && val.length === 2 && val.every(isNumber$2);
        }
      }
    });
    const Space = /* @__PURE__ */ defineComponent({
      name: "ElSpace",
      props: spaceProps,
      setup(props2, { slots }) {
        const { classes, containerStyle, itemStyle } = useSpace(props2);
        function extractChildren(children, parentKey = "", extractedChildren = []) {
          const { prefixCls } = props2;
          children.forEach((child, loopKey) => {
            if (isFragment(child)) {
              if (isArray$5(child.children)) {
                child.children.forEach((nested, key) => {
                  if (isFragment(nested) && isArray$5(nested.children)) {
                    extractChildren(nested.children, `${parentKey + key}-`, extractedChildren);
                  } else {
                    extractedChildren.push(createVNode$1(SpaceItem, {
                      style: itemStyle.value,
                      prefixCls,
                      key: `nested-${parentKey + key}`
                    }, {
                      default: () => [nested]
                    }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
                  }
                });
              }
            } else if (isValidElementNode(child)) {
              extractedChildren.push(createVNode$1(SpaceItem, {
                style: itemStyle.value,
                prefixCls,
                key: `LoopKey${parentKey + loopKey}`
              }, {
                default: () => [child]
              }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
            }
          });
          return extractedChildren;
        }
        return () => {
          var _a2;
          const { spacer, direction: direction2 } = props2;
          const children = renderSlot(slots, "default", { key: 0 }, () => []);
          if (((_a2 = children.children) != null ? _a2 : []).length === 0)
            return null;
          if (isArray$5(children.children)) {
            let extractedChildren = extractChildren(children.children);
            if (spacer) {
              const len2 = extractedChildren.length - 1;
              extractedChildren = extractedChildren.reduce((acc, child, idx) => {
                const children2 = [...acc, child];
                if (idx !== len2) {
                  children2.push(createVNode$1("span", {
                    style: [
                      itemStyle.value,
                      direction2 === "vertical" ? "width: 100%" : null
                    ],
                    key: idx
                  }, [
                    isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)
                  ], PatchFlags.STYLE));
                }
                return children2;
              }, []);
            }
            return createVNode$1("div", {
              class: classes.value,
              style: containerStyle.value
            }, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS);
          }
          return children.children;
        };
      }
    });
    const ElSpace = withInstall(Space);
    const statisticProps = buildProps({
      decimalSeparator: {
        type: String,
        default: "."
      },
      groupSeparator: {
        type: String,
        default: ","
      },
      precision: {
        type: Number,
        default: 0
      },
      formatter: Function,
      value: {
        type: definePropType([Number, Object]),
        default: 0
      },
      prefix: String,
      suffix: String,
      title: String,
      valueStyle: {
        type: definePropType([String, Object, Array])
      }
    });
    const __default__$A = /* @__PURE__ */ defineComponent({
      name: "ElStatistic"
    });
    const _sfc_main$P = /* @__PURE__ */ defineComponent({
      ...__default__$A,
      props: statisticProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const ns = useNamespace("statistic");
        const displayValue = computed(() => {
          const { value, formatter: formatter2, precision, decimalSeparator, groupSeparator } = props2;
          if (isFunction$4(formatter2))
            return formatter2(value);
          if (!isNumber$2(value) || Number.isNaN(value))
            return value;
          let [integer, decimal = ""] = String(value).split(".");
          decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
          integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
          return [integer, decimal].join(decimal ? decimalSeparator : "");
        });
        expose({
          displayValue
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            _ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("head"))
            }, [
              renderSlot(_ctx.$slots, "title", {}, () => [
                createTextVNode(toDisplayString(_ctx.title), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("content"))
            }, [
              _ctx.$slots.prefix || _ctx.prefix ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("prefix"))
              }, [
                renderSlot(_ctx.$slots, "prefix", {}, () => [
                  createBaseVNode("span", null, toDisplayString(_ctx.prefix), 1)
                ])
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("span", {
                class: normalizeClass(unref(ns).e("number")),
                style: normalizeStyle$1(_ctx.valueStyle)
              }, toDisplayString(unref(displayValue)), 7),
              _ctx.$slots.suffix || _ctx.suffix ? (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass(unref(ns).e("suffix"))
              }, [
                renderSlot(_ctx.$slots, "suffix", {}, () => [
                  createBaseVNode("span", null, toDisplayString(_ctx.suffix), 1)
                ])
              ], 2)) : createCommentVNode("v-if", true)
            ], 2)
          ], 2);
        };
      }
    });
    var Statistic = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__file", "statistic.vue"]]);
    const ElStatistic = withInstall(Statistic);
    const countdownProps = buildProps({
      format: {
        type: String,
        default: "HH:mm:ss"
      },
      prefix: String,
      suffix: String,
      title: String,
      value: {
        type: definePropType([Number, Object]),
        default: 0
      },
      valueStyle: {
        type: definePropType([String, Object, Array])
      }
    });
    const countdownEmits = {
      finish: () => true,
      [CHANGE_EVENT]: (value) => isNumber$2(value)
    };
    const timeUnits$1 = [
      ["Y", 1e3 * 60 * 60 * 24 * 365],
      ["M", 1e3 * 60 * 60 * 24 * 30],
      ["D", 1e3 * 60 * 60 * 24],
      ["H", 1e3 * 60 * 60],
      ["m", 1e3 * 60],
      ["s", 1e3],
      ["S", 1]
    ];
    const getTime$1 = (value) => {
      return isNumber$2(value) ? new Date(value).getTime() : value.valueOf();
    };
    const formatTime$1 = (timestamp, format2) => {
      let timeLeft = timestamp;
      const escapeRegex = /\[([^\]]*)]/g;
      const replacedText = timeUnits$1.reduce((current, [name, unit2]) => {
        const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g");
        if (replaceRegex.test(current)) {
          const value = Math.floor(timeLeft / unit2);
          timeLeft -= value * unit2;
          return current.replace(replaceRegex, (match) => String(value).padStart(match.length, "0"));
        }
        return current;
      }, format2);
      return replacedText.replace(escapeRegex, "$1");
    };
    const __default__$z = /* @__PURE__ */ defineComponent({
      name: "ElCountdown"
    });
    const _sfc_main$O = /* @__PURE__ */ defineComponent({
      ...__default__$z,
      props: countdownProps,
      emits: countdownEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        let timer;
        const rawValue = ref(0);
        const displayValue = computed(() => formatTime$1(rawValue.value, props2.format));
        const formatter2 = (val) => formatTime$1(val, props2.format);
        const stopTimer = () => {
          if (timer) {
            cAF(timer);
            timer = void 0;
          }
        };
        const startTimer = () => {
          const timestamp = getTime$1(props2.value);
          const frameFunc = () => {
            let diff = timestamp - Date.now();
            emit2(CHANGE_EVENT, diff);
            if (diff <= 0) {
              diff = 0;
              stopTimer();
              emit2("finish");
            } else {
              timer = rAF(frameFunc);
            }
            rawValue.value = diff;
          };
          timer = rAF(frameFunc);
        };
        onMounted(() => {
          rawValue.value = getTime$1(props2.value) - Date.now();
          watch(() => [props2.value, props2.format], () => {
            stopTimer();
            startTimer();
          }, {
            immediate: true
          });
        });
        onBeforeUnmount(() => {
          stopTimer();
        });
        expose({
          displayValue
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElStatistic), {
            value: rawValue.value,
            title: _ctx.title,
            prefix: _ctx.prefix,
            suffix: _ctx.suffix,
            "value-style": _ctx.valueStyle,
            formatter: formatter2
          }, createSlots({
            _: 2
          }, [
            renderList(_ctx.$slots, (_2, name) => {
              return {
                name,
                fn: withCtx(() => [
                  renderSlot(_ctx.$slots, name)
                ])
              };
            })
          ]), 1032, ["value", "title", "prefix", "suffix", "value-style"]);
        };
      }
    });
    var Countdown = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__file", "countdown.vue"]]);
    const ElCountdown = withInstall(Countdown);
    const stepsProps = buildProps({
      space: {
        type: [Number, String],
        default: ""
      },
      active: {
        type: Number,
        default: 0
      },
      direction: {
        type: String,
        default: "horizontal",
        values: ["horizontal", "vertical"]
      },
      alignCenter: {
        type: Boolean
      },
      simple: {
        type: Boolean
      },
      finishStatus: {
        type: String,
        values: ["wait", "process", "finish", "error", "success"],
        default: "finish"
      },
      processStatus: {
        type: String,
        values: ["wait", "process", "finish", "error", "success"],
        default: "process"
      }
    });
    const stepsEmits = {
      [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber$2)
    };
    const __default__$y = /* @__PURE__ */ defineComponent({
      name: "ElSteps"
    });
    const _sfc_main$N = /* @__PURE__ */ defineComponent({
      ...__default__$y,
      props: stepsProps,
      emits: stepsEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("steps");
        const {
          children: steps,
          addChild: addStep,
          removeChild: removeStep
        } = useOrderedChildren(getCurrentInstance(), "ElStep");
        watch(steps, () => {
          steps.value.forEach((instance, index) => {
            instance.setIndex(index);
          });
        });
        provide("ElSteps", { props: props2, steps, addStep, removeStep });
        watch(() => props2.active, (newVal, oldVal) => {
          emit2(CHANGE_EVENT, newVal, oldVal);
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.simple ? "simple" : _ctx.direction)])
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 2);
        };
      }
    });
    var Steps = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__file", "steps.vue"]]);
    const stepProps = buildProps({
      title: {
        type: String,
        default: ""
      },
      icon: {
        type: iconPropType
      },
      description: {
        type: String,
        default: ""
      },
      status: {
        type: String,
        values: ["", "wait", "process", "finish", "error", "success"],
        default: ""
      }
    });
    const __default__$x = /* @__PURE__ */ defineComponent({
      name: "ElStep"
    });
    const _sfc_main$M = /* @__PURE__ */ defineComponent({
      ...__default__$x,
      props: stepProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("step");
        const index = ref(-1);
        const lineStyle = ref({});
        const internalStatus = ref("");
        const parent2 = inject("ElSteps");
        const currentInstance2 = getCurrentInstance();
        onMounted(() => {
          watch([
            () => parent2.props.active,
            () => parent2.props.processStatus,
            () => parent2.props.finishStatus
          ], ([active]) => {
            updateStatus(active);
          }, { immediate: true });
        });
        onBeforeUnmount(() => {
          parent2.removeStep(stepItemState.uid);
        });
        const currentStatus = computed(() => {
          return props2.status || internalStatus.value;
        });
        const prevStatus = computed(() => {
          const prevStep = parent2.steps.value[index.value - 1];
          return prevStep ? prevStep.currentStatus : "wait";
        });
        const isCenter = computed(() => {
          return parent2.props.alignCenter;
        });
        const isVertical = computed(() => {
          return parent2.props.direction === "vertical";
        });
        const isSimple = computed(() => {
          return parent2.props.simple;
        });
        const stepsCount = computed(() => {
          return parent2.steps.value.length;
        });
        const isLast = computed(() => {
          var _a2;
          return ((_a2 = parent2.steps.value[stepsCount.value - 1]) == null ? void 0 : _a2.uid) === (currentInstance2 == null ? void 0 : currentInstance2.uid);
        });
        const space = computed(() => {
          return isSimple.value ? "" : parent2.props.space;
        });
        const containerKls = computed(() => {
          return [
            ns.b(),
            ns.is(isSimple.value ? "simple" : parent2.props.direction),
            ns.is("flex", isLast.value && !space.value && !isCenter.value),
            ns.is("center", isCenter.value && !isVertical.value && !isSimple.value)
          ];
        });
        const style = computed(() => {
          const style2 = {
            flexBasis: isNumber$2(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%`
          };
          if (isVertical.value)
            return style2;
          if (isLast.value) {
            style2.maxWidth = `${100 / stepsCount.value}%`;
          }
          return style2;
        });
        const setIndex = (val) => {
          index.value = val;
        };
        const calcProgress = (status) => {
          const isWait = status === "wait";
          const style2 = {
            transitionDelay: `${isWait ? "-" : ""}${150 * index.value}ms`
          };
          const step = status === parent2.props.processStatus || isWait ? 0 : 100;
          style2.borderWidth = step && !isSimple.value ? "1px" : 0;
          style2[parent2.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
          lineStyle.value = style2;
        };
        const updateStatus = (activeIndex) => {
          if (activeIndex > index.value) {
            internalStatus.value = parent2.props.finishStatus;
          } else if (activeIndex === index.value && prevStatus.value !== "error") {
            internalStatus.value = parent2.props.processStatus;
          } else {
            internalStatus.value = "wait";
          }
          const prevChild = parent2.steps.value[index.value - 1];
          if (prevChild)
            prevChild.calcProgress(internalStatus.value);
        };
        const stepItemState = reactive({
          uid: currentInstance2.uid,
          currentStatus,
          setIndex,
          calcProgress
        });
        parent2.addStep(stepItemState);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            style: normalizeStyle$1(unref(style)),
            class: normalizeClass(unref(containerKls))
          }, [
            createCommentVNode(" icon & line "),
            createBaseVNode("div", {
              class: normalizeClass([unref(ns).e("head"), unref(ns).is(unref(currentStatus))])
            }, [
              !unref(isSimple) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("line"))
              }, [
                createBaseVNode("i", {
                  class: normalizeClass(unref(ns).e("line-inner")),
                  style: normalizeStyle$1(lineStyle.value)
                }, null, 6)
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass([unref(ns).e("icon"), unref(ns).is(_ctx.icon || _ctx.$slots.icon ? "icon" : "text")])
              }, [
                renderSlot(_ctx.$slots, "icon", {}, () => [
                  _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(unref(ns).e("icon-inner"))
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
                    ]),
                    _: 1
                  }, 8, ["class"])) : unref(currentStatus) === "success" ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 1,
                    class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
                  }, {
                    default: withCtx(() => [
                      createVNode$1(unref(check_default))
                    ]),
                    _: 1
                  }, 8, ["class"])) : unref(currentStatus) === "error" ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 2,
                    class: normalizeClass([unref(ns).e("icon-inner"), unref(ns).is("status")])
                  }, {
                    default: withCtx(() => [
                      createVNode$1(unref(close_default))
                    ]),
                    _: 1
                  }, 8, ["class"])) : !unref(isSimple) ? (openBlock(), createElementBlock("div", {
                    key: 3,
                    class: normalizeClass(unref(ns).e("icon-inner"))
                  }, toDisplayString(index.value + 1), 3)) : createCommentVNode("v-if", true)
                ])
              ], 2)
            ], 2),
            createCommentVNode(" title & description "),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("main"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass([unref(ns).e("title"), unref(ns).is(unref(currentStatus))])
              }, [
                renderSlot(_ctx.$slots, "title", {}, () => [
                  createTextVNode(toDisplayString(_ctx.title), 1)
                ])
              ], 2),
              unref(isSimple) ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("arrow"))
              }, null, 2)) : (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass([unref(ns).e("description"), unref(ns).is(unref(currentStatus))])
              }, [
                renderSlot(_ctx.$slots, "description", {}, () => [
                  createTextVNode(toDisplayString(_ctx.description), 1)
                ])
              ], 2))
            ], 2)
          ], 6);
        };
      }
    });
    var Step = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__file", "item.vue"]]);
    const ElSteps = withInstall(Steps, {
      Step
    });
    const ElStep = withNoopInstall(Step);
    const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
    const switchProps = buildProps({
      modelValue: {
        type: [Boolean, String, Number],
        default: false
      },
      disabled: Boolean,
      loading: Boolean,
      size: {
        type: String,
        validator: isValidComponentSize
      },
      width: {
        type: [String, Number],
        default: ""
      },
      inlinePrompt: Boolean,
      inactiveActionIcon: {
        type: iconPropType
      },
      activeActionIcon: {
        type: iconPropType
      },
      activeIcon: {
        type: iconPropType
      },
      inactiveIcon: {
        type: iconPropType
      },
      activeText: {
        type: String,
        default: ""
      },
      inactiveText: {
        type: String,
        default: ""
      },
      activeValue: {
        type: [Boolean, String, Number],
        default: true
      },
      inactiveValue: {
        type: [Boolean, String, Number],
        default: false
      },
      name: {
        type: String,
        default: ""
      },
      validateEvent: {
        type: Boolean,
        default: true
      },
      beforeChange: {
        type: definePropType(Function)
      },
      id: String,
      tabindex: {
        type: [String, Number]
      },
      ...useAriaProps(["ariaLabel"])
    });
    const switchEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isBoolean$1(val) || isString$3(val) || isNumber$2(val),
      [CHANGE_EVENT]: (val) => isBoolean$1(val) || isString$3(val) || isNumber$2(val),
      [INPUT_EVENT]: (val) => isBoolean$1(val) || isString$3(val) || isNumber$2(val)
    };
    const COMPONENT_NAME$8 = "ElSwitch";
    const __default__$w = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$8
    });
    const _sfc_main$L = /* @__PURE__ */ defineComponent({
      ...__default__$w,
      props: switchProps,
      emits: switchEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { formItem } = useFormItem();
        const switchSize = useFormSize();
        const ns = useNamespace("switch");
        const { inputId } = useFormItemInputId(props2, {
          formItemContext: formItem
        });
        const switchDisabled = useFormDisabled(computed(() => props2.loading));
        const isControlled = ref(props2.modelValue !== false);
        const input = ref();
        const core = ref();
        const switchKls = computed(() => [
          ns.b(),
          ns.m(switchSize.value),
          ns.is("disabled", switchDisabled.value),
          ns.is("checked", checked.value)
        ]);
        const labelLeftKls = computed(() => [
          ns.e("label"),
          ns.em("label", "left"),
          ns.is("active", !checked.value)
        ]);
        const labelRightKls = computed(() => [
          ns.e("label"),
          ns.em("label", "right"),
          ns.is("active", checked.value)
        ]);
        const coreStyle = computed(() => ({
          width: addUnit(props2.width)
        }));
        watch(() => props2.modelValue, () => {
          isControlled.value = true;
        });
        const actualValue = computed(() => {
          return isControlled.value ? props2.modelValue : false;
        });
        const checked = computed(() => actualValue.value === props2.activeValue);
        if (![props2.activeValue, props2.inactiveValue].includes(actualValue.value)) {
          emit2(UPDATE_MODEL_EVENT, props2.inactiveValue);
          emit2(CHANGE_EVENT, props2.inactiveValue);
          emit2(INPUT_EVENT, props2.inactiveValue);
        }
        watch(checked, (val) => {
          var _a2;
          input.value.checked = val;
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
          }
        });
        const handleChange = () => {
          const val = checked.value ? props2.inactiveValue : props2.activeValue;
          emit2(UPDATE_MODEL_EVENT, val);
          emit2(CHANGE_EVENT, val);
          emit2(INPUT_EVENT, val);
          nextTick(() => {
            input.value.checked = checked.value;
          });
        };
        const switchValue = () => {
          if (switchDisabled.value)
            return;
          const { beforeChange } = props2;
          if (!beforeChange) {
            handleChange();
            return;
          }
          const shouldChange = beforeChange();
          const isPromiseOrBool = [
            isPromise$1(shouldChange),
            isBoolean$1(shouldChange)
          ].includes(true);
          if (!isPromiseOrBool) {
            throwError$1(COMPONENT_NAME$8, "beforeChange must return type `Promise<boolean>` or `boolean`");
          }
          if (isPromise$1(shouldChange)) {
            shouldChange.then((result) => {
              if (result) {
                handleChange();
              }
            }).catch((e2) => {
            });
          } else if (shouldChange) {
            handleChange();
          }
        };
        const focus = () => {
          var _a2, _b2;
          (_b2 = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
        };
        onMounted(() => {
          input.value.checked = checked.value;
        });
        expose({
          focus,
          checked
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(switchKls)),
            onClick: withModifiers(switchValue, ["prevent"])
          }, [
            createBaseVNode("input", {
              id: unref(inputId),
              ref_key: "input",
              ref: input,
              class: normalizeClass(unref(ns).e("input")),
              type: "checkbox",
              role: "switch",
              "aria-checked": unref(checked),
              "aria-disabled": unref(switchDisabled),
              "aria-label": _ctx.ariaLabel,
              name: _ctx.name,
              "true-value": _ctx.activeValue,
              "false-value": _ctx.inactiveValue,
              disabled: unref(switchDisabled),
              tabindex: _ctx.tabindex,
              onChange: handleChange,
              onKeydown: withKeys(switchValue, ["enter"])
            }, null, 42, ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"]),
            !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
              key: 0,
              class: normalizeClass(unref(labelLeftKls))
            }, [
              _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
                ]),
                _: 1
              })) : createCommentVNode("v-if", true),
              !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
                key: 1,
                "aria-hidden": unref(checked)
              }, toDisplayString(_ctx.inactiveText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("span", {
              ref_key: "core",
              ref: core,
              class: normalizeClass(unref(ns).e("core")),
              style: normalizeStyle$1(unref(coreStyle))
            }, [
              _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass(unref(ns).e("inner"))
              }, [
                _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 0,
                  class: normalizeClass(unref(ns).is("icon"))
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
                  ]),
                  _: 1
                }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
                  key: 1,
                  class: normalizeClass(unref(ns).is("text")),
                  "aria-hidden": !unref(checked)
                }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, ["aria-hidden"])) : createCommentVNode("v-if", true)
              ], 2)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("action"))
              }, [
                _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 0,
                  class: normalizeClass(unref(ns).is("loading"))
                }, {
                  default: withCtx(() => [
                    createVNode$1(unref(loading_default))
                  ]),
                  _: 1
                }, 8, ["class"])) : unref(checked) ? renderSlot(_ctx.$slots, "active-action", { key: 1 }, () => [
                  _ctx.activeActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeActionIcon)))
                    ]),
                    _: 1
                  })) : createCommentVNode("v-if", true)
                ]) : !unref(checked) ? renderSlot(_ctx.$slots, "inactive-action", { key: 2 }, () => [
                  _ctx.inactiveActionIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveActionIcon)))
                    ]),
                    _: 1
                  })) : createCommentVNode("v-if", true)
                ]) : createCommentVNode("v-if", true)
              ], 2)
            ], 6),
            !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
              key: 1,
              class: normalizeClass(unref(labelRightKls))
            }, [
              _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
                ]),
                _: 1
              })) : createCommentVNode("v-if", true),
              !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
                key: 1,
                "aria-hidden": !unref(checked)
              }, toDisplayString(_ctx.activeText), 9, ["aria-hidden"])) : createCommentVNode("v-if", true)
            ], 2)) : createCommentVNode("v-if", true)
          ], 10, ["onClick"]);
        };
      }
    });
    var Switch = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__file", "switch.vue"]]);
    const ElSwitch = withInstall(Switch);
    const getCell = function(event) {
      var _a2;
      return (_a2 = event.target) == null ? void 0 : _a2.closest("td");
    };
    const orderBy = function(array, sortKey, reverse2, sortMethod, sortBy) {
      if (!sortKey && !sortMethod && (!sortBy || isArray$5(sortBy) && !sortBy.length)) {
        return array;
      }
      if (isString$3(reverse2)) {
        reverse2 = reverse2 === "descending" ? -1 : 1;
      } else {
        reverse2 = reverse2 && reverse2 < 0 ? -1 : 1;
      }
      const getKey2 = sortMethod ? null : function(value, index) {
        if (sortBy) {
          if (!isArray$5(sortBy)) {
            sortBy = [sortBy];
          }
          return sortBy.map((by) => {
            if (isString$3(by)) {
              return get$1(value, by);
            } else {
              return by(value, index, array);
            }
          });
        }
        if (sortKey !== "$key") {
          if (isObject$7(value) && "$value" in value)
            value = value.$value;
        }
        return [isObject$7(value) ? get$1(value, sortKey) : value];
      };
      const compare2 = function(a2, b2) {
        if (sortMethod) {
          return sortMethod(a2.value, b2.value);
        }
        for (let i2 = 0, len2 = a2.key.length; i2 < len2; i2++) {
          if (a2.key[i2] < b2.key[i2]) {
            return -1;
          }
          if (a2.key[i2] > b2.key[i2]) {
            return 1;
          }
        }
        return 0;
      };
      return array.map((value, index) => {
        return {
          value,
          index,
          key: getKey2 ? getKey2(value, index) : null
        };
      }).sort((a2, b2) => {
        let order = compare2(a2, b2);
        if (!order) {
          order = a2.index - b2.index;
        }
        return order * +reverse2;
      }).map((item) => item.value);
    };
    const getColumnById = function(table, columnId) {
      let column = null;
      table.columns.forEach((item) => {
        if (item.id === columnId) {
          column = item;
        }
      });
      return column;
    };
    const getColumnByKey = function(table, columnKey) {
      let column = null;
      for (let i2 = 0; i2 < table.columns.length; i2++) {
        const item = table.columns[i2];
        if (item.columnKey === columnKey) {
          column = item;
          break;
        }
      }
      if (!column)
        throwError$1("ElTable", `No column matching with column-key: ${columnKey}`);
      return column;
    };
    const getColumnByCell = function(table, cell, namespace) {
      const matches = (cell.className || "").match(new RegExp(`${namespace}-table_[^\\s]+`, "gm"));
      if (matches) {
        return getColumnById(table, matches[0]);
      }
      return null;
    };
    const getRowIdentity = (row, rowKey2) => {
      if (!row)
        throw new Error("Row is required when get row identity");
      if (isString$3(rowKey2)) {
        if (!rowKey2.includes(".")) {
          return `${row[rowKey2]}`;
        }
        const key = rowKey2.split(".");
        let current = row;
        for (const element of key) {
          current = current[element];
        }
        return `${current}`;
      } else if (isFunction$4(rowKey2)) {
        return rowKey2.call(null, row);
      }
    };
    const getKeysMap = function(array, rowKey2, flatten2 = false, childrenKey = "children") {
      const data = array || [];
      const arrayMap2 = {};
      data.forEach((row, index) => {
        arrayMap2[getRowIdentity(row, rowKey2)] = { row, index };
        if (flatten2) {
          const children = row[childrenKey];
          if (isArray$5(children)) {
            Object.assign(arrayMap2, getKeysMap(children, rowKey2, true, childrenKey));
          }
        }
      });
      return arrayMap2;
    };
    function mergeOptions(defaults2, config) {
      const options = {};
      let key;
      for (key in defaults2) {
        options[key] = defaults2[key];
      }
      for (key in config) {
        if (hasOwn$1(config, key)) {
          const value = config[key];
          if (!isUndefined$1(value)) {
            options[key] = value;
          }
        }
      }
      return options;
    }
    function parseWidth(width) {
      if (width === "")
        return width;
      if (!isUndefined$1(width)) {
        width = Number.parseInt(width, 10);
        if (Number.isNaN(width)) {
          width = "";
        }
      }
      return width;
    }
    function parseMinWidth(minWidth) {
      if (minWidth === "")
        return minWidth;
      if (!isUndefined$1(minWidth)) {
        minWidth = parseWidth(minWidth);
        if (Number.isNaN(minWidth)) {
          minWidth = 80;
        }
      }
      return minWidth;
    }
    function parseHeight(height) {
      if (isNumber$2(height)) {
        return height;
      }
      if (isString$3(height)) {
        if (/^\d+(?:px)?$/.test(height)) {
          return Number.parseInt(height, 10);
        } else {
          return height;
        }
      }
      return null;
    }
    function compose(...funcs) {
      if (funcs.length === 0) {
        return (arg) => arg;
      }
      if (funcs.length === 1) {
        return funcs[0];
      }
      return funcs.reduce((a2, b2) => (...args) => a2(b2(...args)));
    }
    function toggleRowStatus(statusArr, row, newVal, tableTreeProps, selectable, rowIndex) {
      let _rowIndex = rowIndex != null ? rowIndex : 0;
      let changed = false;
      const index = statusArr.indexOf(row);
      const included = index !== -1;
      const isRowSelectable = selectable == null ? void 0 : selectable.call(null, row, _rowIndex);
      const toggleStatus = (type) => {
        if (type === "add") {
          statusArr.push(row);
        } else {
          statusArr.splice(index, 1);
        }
        changed = true;
      };
      const getChildrenCount = (row2) => {
        let count2 = 0;
        const children = (tableTreeProps == null ? void 0 : tableTreeProps.children) && row2[tableTreeProps.children];
        if (children && isArray$5(children)) {
          count2 += children.length;
          children.forEach((item) => {
            count2 += getChildrenCount(item);
          });
        }
        return count2;
      };
      if (!selectable || isRowSelectable) {
        if (isBoolean$1(newVal)) {
          if (newVal && !included) {
            toggleStatus("add");
          } else if (!newVal && included) {
            toggleStatus("remove");
          }
        } else {
          included ? toggleStatus("remove") : toggleStatus("add");
        }
      }
      if (!(tableTreeProps == null ? void 0 : tableTreeProps.checkStrictly) && (tableTreeProps == null ? void 0 : tableTreeProps.children) && isArray$5(row[tableTreeProps.children])) {
        row[tableTreeProps.children].forEach((item) => {
          const childChanged = toggleRowStatus(statusArr, item, newVal != null ? newVal : !included, tableTreeProps, selectable, _rowIndex + 1);
          _rowIndex += getChildrenCount(item) + 1;
          if (childChanged) {
            changed = childChanged;
          }
        });
      }
      return changed;
    }
    function walkTreeNode(root2, cb, childrenKey = "children", lazyKey = "hasChildren") {
      const isNil2 = (array) => !(isArray$5(array) && array.length);
      function _walker(parent2, children, level) {
        cb(parent2, children, level);
        children.forEach((item) => {
          if (item[lazyKey]) {
            cb(item, null, level + 1);
            return;
          }
          const children2 = item[childrenKey];
          if (!isNil2(children2)) {
            _walker(item, children2, level + 1);
          }
        });
      }
      root2.forEach((item) => {
        if (item[lazyKey]) {
          cb(item, null, 0);
          return;
        }
        const children = item[childrenKey];
        if (!isNil2(children)) {
          _walker(item, children, 0);
        }
      });
    }
    const getTableOverflowTooltipProps = (props2, innerText, row, column) => {
      const popperOptions = {
        strategy: "fixed",
        ...props2.popperOptions
      };
      const tooltipFormatterContent = isFunction$4(column.tooltipFormatter) ? column.tooltipFormatter({
        row,
        column,
        cellValue: getProp(row, column.property).value
      }) : void 0;
      if (isVNode(tooltipFormatterContent)) {
        return {
          slotContent: tooltipFormatterContent,
          content: null,
          ...props2,
          popperOptions
        };
      }
      return {
        slotContent: null,
        content: tooltipFormatterContent != null ? tooltipFormatterContent : innerText,
        ...props2,
        popperOptions
      };
    };
    let removePopper = null;
    function createTablePopper(props2, popperContent, row, column, trigger2, table) {
      const tableOverflowTooltipProps = getTableOverflowTooltipProps(props2, popperContent, row, column);
      const mergedProps = {
        ...tableOverflowTooltipProps,
        slotContent: void 0
      };
      if ((removePopper == null ? void 0 : removePopper.trigger) === trigger2) {
        const comp = removePopper.vm.component;
        merge$2(comp.props, mergedProps);
        if (tableOverflowTooltipProps.slotContent) {
          comp.slots.content = () => [tableOverflowTooltipProps.slotContent];
        }
        return;
      }
      removePopper == null ? void 0 : removePopper();
      const parentNode2 = table == null ? void 0 : table.refs.tableWrapper;
      const ns = parentNode2 == null ? void 0 : parentNode2.dataset.prefix;
      const vm = createVNode$1(ElTooltip, {
        virtualTriggering: true,
        virtualRef: trigger2,
        appendTo: parentNode2,
        placement: "top",
        transition: "none",
        offset: 0,
        hideAfter: 0,
        ...mergedProps
      }, tableOverflowTooltipProps.slotContent ? {
        content: () => tableOverflowTooltipProps.slotContent
      } : void 0);
      vm.appContext = { ...table.appContext, ...table };
      const container = document.createElement("div");
      render$1(vm, container);
      vm.component.exposed.onOpen();
      const scrollContainer = parentNode2 == null ? void 0 : parentNode2.querySelector(`.${ns}-scrollbar__wrap`);
      removePopper = () => {
        render$1(null, container);
        scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", removePopper);
        removePopper = null;
      };
      removePopper.trigger = trigger2;
      removePopper.vm = vm;
      scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", removePopper);
    }
    function getCurrentColumns(column) {
      if (column.children) {
        return flatMap(column.children, getCurrentColumns);
      } else {
        return [column];
      }
    }
    function getColSpan(colSpan, column) {
      return colSpan + column.colSpan;
    }
    const isFixedColumn = (index, fixed, store2, realColumns) => {
      let start2 = 0;
      let after = index;
      const columns2 = store2.states.columns.value;
      if (realColumns) {
        const curColumns = getCurrentColumns(realColumns[index]);
        const preColumns = columns2.slice(0, columns2.indexOf(curColumns[0]));
        start2 = preColumns.reduce(getColSpan, 0);
        after = start2 + curColumns.reduce(getColSpan, 0) - 1;
      } else {
        start2 = index;
      }
      let fixedLayout;
      switch (fixed) {
        case "left":
          if (after < store2.states.fixedLeafColumnsLength.value) {
            fixedLayout = "left";
          }
          break;
        case "right":
          if (start2 >= columns2.length - store2.states.rightFixedLeafColumnsLength.value) {
            fixedLayout = "right";
          }
          break;
        default:
          if (after < store2.states.fixedLeafColumnsLength.value) {
            fixedLayout = "left";
          } else if (start2 >= columns2.length - store2.states.rightFixedLeafColumnsLength.value) {
            fixedLayout = "right";
          }
      }
      return fixedLayout ? {
        direction: fixedLayout,
        start: start2,
        after
      } : {};
    };
    const getFixedColumnsClass = (namespace, index, fixed, store2, realColumns, offset2 = 0) => {
      const classes = [];
      const { direction: direction2, start: start2, after } = isFixedColumn(index, fixed, store2, realColumns);
      if (direction2) {
        const isLeft = direction2 === "left";
        classes.push(`${namespace}-fixed-column--${direction2}`);
        if (isLeft && after + offset2 === store2.states.fixedLeafColumnsLength.value - 1) {
          classes.push("is-last-column");
        } else if (!isLeft && start2 - offset2 === store2.states.columns.value.length - store2.states.rightFixedLeafColumnsLength.value) {
          classes.push("is-first-column");
        }
      }
      return classes;
    };
    function getOffset$1(offset2, column) {
      return offset2 + (isNull(column.realWidth) || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
    }
    const getFixedColumnOffset = (index, fixed, store2, realColumns) => {
      const {
        direction: direction2,
        start: start2 = 0,
        after = 0
      } = isFixedColumn(index, fixed, store2, realColumns);
      if (!direction2) {
        return;
      }
      const styles = {};
      const isLeft = direction2 === "left";
      const columns2 = store2.states.columns.value;
      if (isLeft) {
        styles.left = columns2.slice(0, start2).reduce(getOffset$1, 0);
      } else {
        styles.right = columns2.slice(after + 1).reverse().reduce(getOffset$1, 0);
      }
      return styles;
    };
    const ensurePosition = (style, key) => {
      if (!style)
        return;
      if (!Number.isNaN(style[key])) {
        style[key] = `${style[key]}px`;
      }
    };
    function useExpand(watcherData) {
      const instance = getCurrentInstance();
      const defaultExpandAll = ref(false);
      const expandRows = ref([]);
      const updateExpandRows = () => {
        const data = watcherData.data.value || [];
        const rowKey2 = watcherData.rowKey.value;
        if (defaultExpandAll.value) {
          expandRows.value = data.slice();
        } else if (rowKey2) {
          const expandRowsMap = getKeysMap(expandRows.value, rowKey2);
          expandRows.value = data.reduce((prev, row) => {
            const rowId = getRowIdentity(row, rowKey2);
            const rowInfo = expandRowsMap[rowId];
            if (rowInfo) {
              prev.push(row);
            }
            return prev;
          }, []);
        } else {
          expandRows.value = [];
        }
      };
      const toggleRowExpansion = (row, expanded) => {
        const changed = toggleRowStatus(expandRows.value, row, expanded);
        if (changed) {
          instance.emit("expand-change", row, expandRows.value.slice());
        }
      };
      const setExpandRowKeys = (rowKeys) => {
        instance.store.assertRowKey();
        const data = watcherData.data.value || [];
        const rowKey2 = watcherData.rowKey.value;
        const keysMap = getKeysMap(data, rowKey2);
        expandRows.value = rowKeys.reduce((prev, cur) => {
          const info = keysMap[cur];
          if (info) {
            prev.push(info.row);
          }
          return prev;
        }, []);
      };
      const isRowExpanded = (row) => {
        const rowKey2 = watcherData.rowKey.value;
        if (rowKey2) {
          const expandMap = getKeysMap(expandRows.value, rowKey2);
          return !!expandMap[getRowIdentity(row, rowKey2)];
        }
        return expandRows.value.includes(row);
      };
      return {
        updateExpandRows,
        toggleRowExpansion,
        setExpandRowKeys,
        isRowExpanded,
        states: {
          expandRows,
          defaultExpandAll
        }
      };
    }
    function useCurrent(watcherData) {
      const instance = getCurrentInstance();
      const _currentRowKey = ref(null);
      const currentRow = ref(null);
      const setCurrentRowKey = (key) => {
        instance.store.assertRowKey();
        _currentRowKey.value = key;
        setCurrentRowByKey(key);
      };
      const restoreCurrentRowKey = () => {
        _currentRowKey.value = null;
      };
      const setCurrentRowByKey = (key) => {
        const { data, rowKey: rowKey2 } = watcherData;
        let _currentRow = null;
        if (rowKey2.value) {
          _currentRow = (unref(data) || []).find((item) => getRowIdentity(item, rowKey2.value) === key);
        }
        currentRow.value = _currentRow;
        instance.emit("current-change", currentRow.value, null);
      };
      const updateCurrentRow = (_currentRow) => {
        const oldCurrentRow = currentRow.value;
        if (_currentRow && _currentRow !== oldCurrentRow) {
          currentRow.value = _currentRow;
          instance.emit("current-change", currentRow.value, oldCurrentRow);
          return;
        }
        if (!_currentRow && oldCurrentRow) {
          currentRow.value = null;
          instance.emit("current-change", null, oldCurrentRow);
        }
      };
      const updateCurrentRowData = () => {
        const rowKey2 = watcherData.rowKey.value;
        const data = watcherData.data.value || [];
        const oldCurrentRow = currentRow.value;
        if (!data.includes(oldCurrentRow) && oldCurrentRow) {
          if (rowKey2) {
            const currentRowKey = getRowIdentity(oldCurrentRow, rowKey2);
            setCurrentRowByKey(currentRowKey);
          } else {
            currentRow.value = null;
          }
          if (isNull(currentRow.value)) {
            instance.emit("current-change", null, oldCurrentRow);
          }
        } else if (_currentRowKey.value) {
          setCurrentRowByKey(_currentRowKey.value);
          restoreCurrentRowKey();
        }
      };
      return {
        setCurrentRowKey,
        restoreCurrentRowKey,
        setCurrentRowByKey,
        updateCurrentRow,
        updateCurrentRowData,
        states: {
          _currentRowKey,
          currentRow
        }
      };
    }
    function useTree$2(watcherData) {
      const expandRowKeys = ref([]);
      const treeData = ref({});
      const indent = ref(16);
      const lazy = ref(false);
      const lazyTreeNodeMap = ref({});
      const lazyColumnIdentifier = ref("hasChildren");
      const childrenColumnName = ref("children");
      const checkStrictly = ref(false);
      const instance = getCurrentInstance();
      const normalizedData = computed(() => {
        if (!watcherData.rowKey.value)
          return {};
        const data = watcherData.data.value || [];
        return normalize2(data);
      });
      const normalizedLazyNode = computed(() => {
        const rowKey2 = watcherData.rowKey.value;
        const keys2 = Object.keys(lazyTreeNodeMap.value);
        const res = {};
        if (!keys2.length)
          return res;
        keys2.forEach((key) => {
          if (lazyTreeNodeMap.value[key].length) {
            const item = { children: [] };
            lazyTreeNodeMap.value[key].forEach((row) => {
              const currentRowKey = getRowIdentity(row, rowKey2);
              item.children.push(currentRowKey);
              if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {
                res[currentRowKey] = { children: [] };
              }
            });
            res[key] = item;
          }
        });
        return res;
      });
      const normalize2 = (data) => {
        const rowKey2 = watcherData.rowKey.value;
        const res = {};
        walkTreeNode(data, (parent2, children, level) => {
          const parentId = getRowIdentity(parent2, rowKey2);
          if (isArray$5(children)) {
            res[parentId] = {
              children: children.map((row) => getRowIdentity(row, rowKey2)),
              level
            };
          } else if (lazy.value) {
            res[parentId] = {
              children: [],
              lazy: true,
              level
            };
          }
        }, childrenColumnName.value, lazyColumnIdentifier.value);
        return res;
      };
      let isInitTree = true;
      const updateTreeData = (ifChangeExpandRowKeys = false) => {
        var _a2, _b2;
        const nested = normalizedData.value;
        const normalizedLazyNode_ = normalizedLazyNode.value;
        const keys2 = Object.keys(nested);
        const newTreeData = {};
        const ifExpandAll = ((_a2 = instance.store) == null ? void 0 : _a2.states.defaultExpandAll.value) && isInitTree;
        isInitTree = false;
        if (keys2.length) {
          const oldTreeData = unref(treeData);
          const rootLazyRowKeys = [];
          const getExpanded = (oldValue, key) => {
            if (ifChangeExpandRowKeys) {
              if (expandRowKeys.value.length) {
                return ifExpandAll || expandRowKeys.value.includes(key);
              } else {
                return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded));
              }
            } else {
              const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key);
              return !!((oldValue == null ? void 0 : oldValue.expanded) || included);
            }
          };
          keys2.forEach((key) => {
            const oldValue = oldTreeData[key];
            const newValue = { ...nested[key] };
            newValue.expanded = getExpanded(oldValue, key);
            if (newValue.lazy) {
              const { loaded = false, loading = false } = oldValue || {};
              newValue.loaded = !!loaded;
              newValue.loading = !!loading;
              rootLazyRowKeys.push(key);
            }
            newTreeData[key] = newValue;
          });
          const lazyKeys = Object.keys(normalizedLazyNode_);
          if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {
            lazyKeys.forEach((key) => {
              const oldValue = oldTreeData[key];
              const lazyNodeChildren = normalizedLazyNode_[key].children;
              if (rootLazyRowKeys.includes(key)) {
                if (newTreeData[key].children.length !== 0) {
                  throw new Error("[ElTable]children must be an empty array.");
                }
                newTreeData[key].children = lazyNodeChildren;
              } else {
                const { loaded = false, loading = false } = oldValue || {};
                newTreeData[key] = {
                  lazy: true,
                  loaded: !!loaded,
                  loading: !!loading,
                  expanded: getExpanded(oldValue, key),
                  children: lazyNodeChildren,
                  level: ""
                };
              }
            });
          }
        }
        treeData.value = newTreeData;
        (_b2 = instance.store) == null ? void 0 : _b2.updateTableScrollY();
      };
      watch(() => expandRowKeys.value, () => {
        updateTreeData(true);
      });
      watch(() => normalizedData.value, () => {
        updateTreeData();
      });
      watch(() => normalizedLazyNode.value, () => {
        updateTreeData();
      });
      const updateTreeExpandKeys = (value) => {
        expandRowKeys.value = value;
        updateTreeData();
      };
      const isUseLazy = (data) => {
        return lazy.value && data && "loaded" in data && !data.loaded;
      };
      const toggleTreeExpansion = (row, expanded) => {
        instance.store.assertRowKey();
        const rowKey2 = watcherData.rowKey.value;
        const id = getRowIdentity(row, rowKey2);
        const data = id && treeData.value[id];
        if (id && data && "expanded" in data) {
          const oldExpanded = data.expanded;
          expanded = isUndefined$1(expanded) ? !data.expanded : expanded;
          treeData.value[id].expanded = expanded;
          if (oldExpanded !== expanded) {
            instance.emit("expand-change", row, expanded);
          }
          isUseLazy(data) && loadData(row, id, data);
          instance.store.updateTableScrollY();
        }
      };
      const loadOrToggle = (row) => {
        instance.store.assertRowKey();
        const rowKey2 = watcherData.rowKey.value;
        const id = getRowIdentity(row, rowKey2);
        const data = treeData.value[id];
        if (isUseLazy(data)) {
          loadData(row, id, data);
        } else {
          toggleTreeExpansion(row, void 0);
        }
      };
      const loadData = (row, key, treeNode) => {
        const { load } = instance.props;
        if (load && !treeData.value[key].loaded) {
          treeData.value[key].loading = true;
          load(row, treeNode, (data) => {
            if (!isArray$5(data)) {
              throw new TypeError("[ElTable] data must be an array");
            }
            treeData.value[key].loading = false;
            treeData.value[key].loaded = true;
            treeData.value[key].expanded = true;
            if (data.length) {
              lazyTreeNodeMap.value[key] = data;
            }
            instance.emit("expand-change", row, true);
          });
        }
      };
      const updateKeyChildren = (key, data) => {
        const { lazy: lazy2, rowKey: rowKey2 } = instance.props;
        if (!lazy2)
          return;
        if (!rowKey2)
          throw new Error("[Table] rowKey is required in updateKeyChild");
        if (lazyTreeNodeMap.value[key]) {
          lazyTreeNodeMap.value[key] = data;
        }
      };
      return {
        loadData,
        loadOrToggle,
        toggleTreeExpansion,
        updateTreeExpandKeys,
        updateTreeData,
        updateKeyChildren,
        normalize: normalize2,
        states: {
          expandRowKeys,
          treeData,
          indent,
          lazy,
          lazyTreeNodeMap,
          lazyColumnIdentifier,
          childrenColumnName,
          checkStrictly
        }
      };
    }
    const sortData = (data, states) => {
      const sortingColumn = states.sortingColumn;
      if (!sortingColumn || isString$3(sortingColumn.sortable)) {
        return data;
      }
      return orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
    };
    const doFlattenColumns = (columns2) => {
      const result = [];
      columns2.forEach((column) => {
        if (column.children && column.children.length > 0) {
          result.push.apply(result, doFlattenColumns(column.children));
        } else {
          result.push(column);
        }
      });
      return result;
    };
    function useWatcher$1() {
      var _a2;
      const instance = getCurrentInstance();
      const { size: tableSize } = toRefs((_a2 = instance.proxy) == null ? void 0 : _a2.$props);
      const rowKey2 = ref(null);
      const data = ref([]);
      const _data = ref([]);
      const isComplex = ref(false);
      const _columns = ref([]);
      const originColumns = ref([]);
      const columns2 = ref([]);
      const fixedColumns = ref([]);
      const rightFixedColumns = ref([]);
      const leafColumns = ref([]);
      const fixedLeafColumns = ref([]);
      const rightFixedLeafColumns = ref([]);
      const updateOrderFns = [];
      const leafColumnsLength = ref(0);
      const fixedLeafColumnsLength = ref(0);
      const rightFixedLeafColumnsLength = ref(0);
      const isAllSelected = ref(false);
      const selection = ref([]);
      const reserveSelection = ref(false);
      const selectOnIndeterminate = ref(false);
      const selectable = ref(null);
      const filters = ref({});
      const filteredData = ref(null);
      const sortingColumn = ref(null);
      const sortProp = ref(null);
      const sortOrder = ref(null);
      const hoverRow = ref(null);
      const selectedMap = computed(() => {
        return rowKey2.value ? getKeysMap(selection.value, rowKey2.value) : void 0;
      });
      watch(data, () => {
        var _a22;
        if (instance.state) {
          scheduleLayout(false);
          const needUpdateFixed = instance.props.tableLayout === "auto";
          if (needUpdateFixed) {
            (_a22 = instance.refs.tableHeaderRef) == null ? void 0 : _a22.updateFixedColumnStyle();
          }
        }
      }, {
        deep: true
      });
      const assertRowKey = () => {
        if (!rowKey2.value)
          throw new Error("[ElTable] prop row-key is required");
      };
      const updateChildFixed = (column) => {
        var _a22;
        (_a22 = column.children) == null ? void 0 : _a22.forEach((childColumn) => {
          childColumn.fixed = column.fixed;
          updateChildFixed(childColumn);
        });
      };
      const updateColumns = () => {
        var _a22, _b2;
        _columns.value.forEach((column) => {
          updateChildFixed(column);
        });
        fixedColumns.value = _columns.value.filter((column) => column.type !== "selection" && [true, "left"].includes(column.fixed));
        let selectColFixLeft;
        if (((_b2 = (_a22 = _columns.value) == null ? void 0 : _a22[0]) == null ? void 0 : _b2.type) === "selection") {
          const selectColumn = _columns.value[0];
          selectColFixLeft = [true, "left"].includes(selectColumn.fixed) || fixedColumns.value.length && selectColumn.fixed !== "right";
          if (selectColFixLeft) {
            fixedColumns.value.unshift(selectColumn);
          }
        }
        rightFixedColumns.value = _columns.value.filter((column) => column.fixed === "right");
        const notFixedColumns = _columns.value.filter((column) => (selectColFixLeft ? column.type !== "selection" : true) && !column.fixed);
        originColumns.value = [].concat(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value);
        const leafColumns2 = doFlattenColumns(notFixedColumns);
        const fixedLeafColumns2 = doFlattenColumns(fixedColumns.value);
        const rightFixedLeafColumns2 = doFlattenColumns(rightFixedColumns.value);
        leafColumnsLength.value = leafColumns2.length;
        fixedLeafColumnsLength.value = fixedLeafColumns2.length;
        rightFixedLeafColumnsLength.value = rightFixedLeafColumns2.length;
        columns2.value = [].concat(fixedLeafColumns2).concat(leafColumns2).concat(rightFixedLeafColumns2);
        isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0;
      };
      const scheduleLayout = (needUpdateColumns, immediate = false) => {
        if (needUpdateColumns) {
          updateColumns();
        }
        if (immediate) {
          instance.state.doLayout();
        } else {
          instance.state.debouncedUpdateLayout();
        }
      };
      const isSelected = (row) => {
        if (selectedMap.value) {
          return !!selectedMap.value[getRowIdentity(row, rowKey2.value)];
        } else {
          return selection.value.includes(row);
        }
      };
      const clearSelection = () => {
        isAllSelected.value = false;
        const oldSelection = selection.value;
        selection.value = [];
        if (oldSelection.length) {
          instance.emit("selection-change", []);
        }
      };
      const cleanSelection = () => {
        var _a22, _b2;
        let deleted;
        if (rowKey2.value) {
          deleted = [];
          const childrenKey = (_b2 = (_a22 = instance == null ? void 0 : instance.store) == null ? void 0 : _a22.states) == null ? void 0 : _b2.childrenColumnName.value;
          const dataMap = getKeysMap(data.value, rowKey2.value, true, childrenKey);
          for (const key in selectedMap.value) {
            if (hasOwn$1(selectedMap.value, key) && !dataMap[key]) {
              deleted.push(selectedMap.value[key].row);
            }
          }
        } else {
          deleted = selection.value.filter((item) => !data.value.includes(item));
        }
        if (deleted.length) {
          const newSelection = selection.value.filter((item) => !deleted.includes(item));
          selection.value = newSelection;
          instance.emit("selection-change", newSelection.slice());
        }
      };
      const getSelectionRows = () => {
        return (selection.value || []).slice();
      };
      const toggleRowSelection = (row, selected, emitChange = true, ignoreSelectable = false) => {
        var _a22, _b2, _c2, _d;
        const treeProps2 = {
          children: (_b2 = (_a22 = instance == null ? void 0 : instance.store) == null ? void 0 : _a22.states) == null ? void 0 : _b2.childrenColumnName.value,
          checkStrictly: (_d = (_c2 = instance == null ? void 0 : instance.store) == null ? void 0 : _c2.states) == null ? void 0 : _d.checkStrictly.value
        };
        const changed = toggleRowStatus(selection.value, row, selected, treeProps2, ignoreSelectable ? void 0 : selectable.value, data.value.indexOf(row));
        if (changed) {
          const newSelection = (selection.value || []).slice();
          if (emitChange) {
            instance.emit("select", newSelection, row);
          }
          instance.emit("selection-change", newSelection);
        }
      };
      const _toggleAllSelection = () => {
        var _a22, _b2;
        const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length);
        isAllSelected.value = value;
        let selectionChanged = false;
        let childrenCount = 0;
        const rowKey22 = (_b2 = (_a22 = instance == null ? void 0 : instance.store) == null ? void 0 : _a22.states) == null ? void 0 : _b2.rowKey.value;
        const { childrenColumnName } = instance.store.states;
        const treeProps2 = {
          children: childrenColumnName.value,
          checkStrictly: false
        };
        data.value.forEach((row, index) => {
          const rowIndex = index + childrenCount;
          if (toggleRowStatus(selection.value, row, value, treeProps2, selectable.value, rowIndex)) {
            selectionChanged = true;
          }
          childrenCount += getChildrenCount(getRowIdentity(row, rowKey22));
        });
        if (selectionChanged) {
          instance.emit("selection-change", selection.value ? selection.value.slice() : []);
        }
        instance.emit("select-all", (selection.value || []).slice());
      };
      const updateSelectionByRowKey = () => {
        data.value.forEach((row) => {
          const rowId = getRowIdentity(row, rowKey2.value);
          const rowInfo = selectedMap.value[rowId];
          if (rowInfo) {
            selection.value[rowInfo.index] = row;
          }
        });
      };
      const updateAllSelected = () => {
        var _a22;
        if (((_a22 = data.value) == null ? void 0 : _a22.length) === 0) {
          isAllSelected.value = false;
          return;
        }
        const { childrenColumnName } = instance.store.states;
        let rowIndex = 0;
        let selectedCount = 0;
        const checkSelectedStatus = (data2) => {
          var _a3;
          for (const row of data2) {
            const isRowSelectable = selectable.value && selectable.value.call(null, row, rowIndex);
            if (!isSelected(row)) {
              if (!selectable.value || isRowSelectable) {
                return false;
              }
            } else {
              selectedCount++;
            }
            rowIndex++;
            if (((_a3 = row[childrenColumnName.value]) == null ? void 0 : _a3.length) && !checkSelectedStatus(row[childrenColumnName.value])) {
              return false;
            }
          }
          return true;
        };
        const isAllSelected_ = checkSelectedStatus(data.value || []);
        isAllSelected.value = selectedCount === 0 ? false : isAllSelected_;
      };
      const getChildrenCount = (rowKey22) => {
        var _a22;
        if (!instance || !instance.store)
          return 0;
        const { treeData } = instance.store.states;
        let count2 = 0;
        const children = (_a22 = treeData.value[rowKey22]) == null ? void 0 : _a22.children;
        if (children) {
          count2 += children.length;
          children.forEach((childKey) => {
            count2 += getChildrenCount(childKey);
          });
        }
        return count2;
      };
      const updateFilters = (columns22, values) => {
        if (!isArray$5(columns22)) {
          columns22 = [columns22];
        }
        const filters_ = {};
        columns22.forEach((col) => {
          filters.value[col.id] = values;
          filters_[col.columnKey || col.id] = values;
        });
        return filters_;
      };
      const updateSort = (column, prop, order) => {
        if (sortingColumn.value && sortingColumn.value !== column) {
          sortingColumn.value.order = null;
        }
        sortingColumn.value = column;
        sortProp.value = prop;
        sortOrder.value = order;
      };
      const execFilter = () => {
        let sourceData = unref(_data);
        Object.keys(filters.value).forEach((columnId) => {
          const values = filters.value[columnId];
          if (!values || values.length === 0)
            return;
          const column = getColumnById({
            columns: columns2.value
          }, columnId);
          if (column && column.filterMethod) {
            sourceData = sourceData.filter((row) => {
              return values.some((value) => column.filterMethod.call(null, value, row, column));
            });
          }
        });
        filteredData.value = sourceData;
      };
      const execSort = () => {
        data.value = sortData(filteredData.value, {
          sortingColumn: sortingColumn.value,
          sortProp: sortProp.value,
          sortOrder: sortOrder.value
        });
      };
      const execQuery = (ignore = void 0) => {
        if (!(ignore && ignore.filter)) {
          execFilter();
        }
        execSort();
      };
      const clearFilter = (columnKeys) => {
        const { tableHeaderRef } = instance.refs;
        if (!tableHeaderRef)
          return;
        const panels = Object.assign({}, tableHeaderRef.filterPanels);
        const keys2 = Object.keys(panels);
        if (!keys2.length)
          return;
        if (isString$3(columnKeys)) {
          columnKeys = [columnKeys];
        }
        if (isArray$5(columnKeys)) {
          const columns_ = columnKeys.map((key) => getColumnByKey({
            columns: columns2.value
          }, key));
          keys2.forEach((key) => {
            const column = columns_.find((col) => col.id === key);
            if (column) {
              column.filteredValue = [];
            }
          });
          instance.store.commit("filterChange", {
            column: columns_,
            values: [],
            silent: true,
            multi: true
          });
        } else {
          keys2.forEach((key) => {
            const column = columns2.value.find((col) => col.id === key);
            if (column) {
              column.filteredValue = [];
            }
          });
          filters.value = {};
          instance.store.commit("filterChange", {
            column: {},
            values: [],
            silent: true
          });
        }
      };
      const clearSort = () => {
        if (!sortingColumn.value)
          return;
        updateSort(null, null, null);
        instance.store.commit("changeSortCondition", {
          silent: true
        });
      };
      const {
        setExpandRowKeys,
        toggleRowExpansion,
        updateExpandRows,
        states: expandStates,
        isRowExpanded
      } = useExpand({
        data,
        rowKey: rowKey2
      });
      const {
        updateTreeExpandKeys,
        toggleTreeExpansion,
        updateTreeData,
        updateKeyChildren,
        loadOrToggle,
        states: treeStates
      } = useTree$2({
        data,
        rowKey: rowKey2
      });
      const {
        updateCurrentRowData,
        updateCurrentRow,
        setCurrentRowKey,
        states: currentData
      } = useCurrent({
        data,
        rowKey: rowKey2
      });
      const setExpandRowKeysAdapter = (val) => {
        setExpandRowKeys(val);
        updateTreeExpandKeys(val);
      };
      const toggleRowExpansionAdapter = (row, expanded) => {
        const hasExpandColumn = columns2.value.some(({ type }) => type === "expand");
        if (hasExpandColumn) {
          toggleRowExpansion(row, expanded);
        } else {
          toggleTreeExpansion(row, expanded);
        }
      };
      return {
        assertRowKey,
        updateColumns,
        scheduleLayout,
        isSelected,
        clearSelection,
        cleanSelection,
        getSelectionRows,
        toggleRowSelection,
        _toggleAllSelection,
        toggleAllSelection: null,
        updateSelectionByRowKey,
        updateAllSelected,
        updateFilters,
        updateCurrentRow,
        updateSort,
        execFilter,
        execSort,
        execQuery,
        clearFilter,
        clearSort,
        toggleRowExpansion,
        setExpandRowKeysAdapter,
        setCurrentRowKey,
        toggleRowExpansionAdapter,
        isRowExpanded,
        updateExpandRows,
        updateCurrentRowData,
        loadOrToggle,
        updateTreeData,
        updateKeyChildren,
        states: {
          tableSize,
          rowKey: rowKey2,
          data,
          _data,
          isComplex,
          _columns,
          originColumns,
          columns: columns2,
          fixedColumns,
          rightFixedColumns,
          leafColumns,
          fixedLeafColumns,
          rightFixedLeafColumns,
          updateOrderFns,
          leafColumnsLength,
          fixedLeafColumnsLength,
          rightFixedLeafColumnsLength,
          isAllSelected,
          selection,
          reserveSelection,
          selectOnIndeterminate,
          selectable,
          filters,
          filteredData,
          sortingColumn,
          sortProp,
          sortOrder,
          hoverRow,
          ...expandStates,
          ...treeStates,
          ...currentData
        }
      };
    }
    function replaceColumn(array, column) {
      return array.map((item) => {
        var _a2;
        if (item.id === column.id) {
          return column;
        } else if ((_a2 = item.children) == null ? void 0 : _a2.length) {
          item.children = replaceColumn(item.children, column);
        }
        return item;
      });
    }
    function sortColumn(array) {
      array.forEach((item) => {
        var _a2, _b2;
        item.no = (_a2 = item.getColumnIndex) == null ? void 0 : _a2.call(item);
        if ((_b2 = item.children) == null ? void 0 : _b2.length) {
          sortColumn(item.children);
        }
      });
      array.sort((cur, pre) => cur.no - pre.no);
    }
    function useStore() {
      const instance = getCurrentInstance();
      const watcher = useWatcher$1();
      const ns = useNamespace("table");
      const mutations = {
        setData(states, data) {
          const dataInstanceChanged = unref(states._data) !== data;
          states.data.value = data;
          states._data.value = data;
          instance.store.execQuery();
          instance.store.updateCurrentRowData();
          instance.store.updateExpandRows();
          instance.store.updateTreeData(instance.store.states.defaultExpandAll.value);
          if (unref(states.reserveSelection)) {
            instance.store.assertRowKey();
            instance.store.updateSelectionByRowKey();
          } else {
            if (dataInstanceChanged) {
              instance.store.clearSelection();
            } else {
              instance.store.cleanSelection();
            }
          }
          instance.store.updateAllSelected();
          if (instance.$ready) {
            instance.store.scheduleLayout();
          }
        },
        insertColumn(states, column, parent2, updateColumnOrder) {
          const array = unref(states._columns);
          let newColumns = [];
          if (!parent2) {
            array.push(column);
            newColumns = array;
          } else {
            if (parent2 && !parent2.children) {
              parent2.children = [];
            }
            parent2.children.push(column);
            newColumns = replaceColumn(array, parent2);
          }
          sortColumn(newColumns);
          states._columns.value = newColumns;
          states.updateOrderFns.push(updateColumnOrder);
          if (column.type === "selection") {
            states.selectable.value = column.selectable;
            states.reserveSelection.value = column.reserveSelection;
          }
          if (instance.$ready) {
            instance.store.updateColumns();
            instance.store.scheduleLayout();
          }
        },
        updateColumnOrder(states, column) {
          var _a2;
          const newColumnIndex = (_a2 = column.getColumnIndex) == null ? void 0 : _a2.call(column);
          if (newColumnIndex === column.no)
            return;
          sortColumn(states._columns.value);
          if (instance.$ready) {
            instance.store.updateColumns();
          }
        },
        removeColumn(states, column, parent2, updateColumnOrder) {
          const array = unref(states._columns) || [];
          if (parent2) {
            parent2.children.splice(parent2.children.findIndex((item) => item.id === column.id), 1);
            nextTick(() => {
              var _a2;
              if (((_a2 = parent2.children) == null ? void 0 : _a2.length) === 0) {
                delete parent2.children;
              }
            });
            states._columns.value = replaceColumn(array, parent2);
          } else {
            const index = array.indexOf(column);
            if (index > -1) {
              array.splice(index, 1);
              states._columns.value = array;
            }
          }
          const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder);
          updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1);
          if (instance.$ready) {
            instance.store.updateColumns();
            instance.store.scheduleLayout();
          }
        },
        sort(states, options) {
          const { prop, order, init: init2 } = options;
          if (prop) {
            const column = unref(states.columns).find((column2) => column2.property === prop);
            if (column) {
              column.order = order;
              instance.store.updateSort(column, prop, order);
              instance.store.commit("changeSortCondition", { init: init2 });
            }
          }
        },
        changeSortCondition(states, options) {
          const { sortingColumn, sortProp, sortOrder } = states;
          const columnValue = unref(sortingColumn), propValue = unref(sortProp), orderValue = unref(sortOrder);
          if (isNull(orderValue)) {
            states.sortingColumn.value = null;
            states.sortProp.value = null;
          }
          const ignore = { filter: true };
          instance.store.execQuery(ignore);
          if (!options || !(options.silent || options.init)) {
            instance.emit("sort-change", {
              column: columnValue,
              prop: propValue,
              order: orderValue
            });
          }
          instance.store.updateTableScrollY();
        },
        filterChange(_states, options) {
          const { column, values, silent } = options;
          const newFilters = instance.store.updateFilters(column, values);
          instance.store.execQuery();
          if (!silent) {
            instance.emit("filter-change", newFilters);
          }
          instance.store.updateTableScrollY();
        },
        toggleAllSelection() {
          instance.store.toggleAllSelection();
        },
        rowSelectedChanged(_states, row) {
          instance.store.toggleRowSelection(row);
          instance.store.updateAllSelected();
        },
        setHoverRow(states, row) {
          states.hoverRow.value = row;
        },
        setCurrentRow(_states, row) {
          instance.store.updateCurrentRow(row);
        }
      };
      const commit = function(name, ...args) {
        const mutations2 = instance.store.mutations;
        if (mutations2[name]) {
          mutations2[name].apply(instance, [instance.store.states].concat(args));
        } else {
          throw new Error(`Action not found: ${name}`);
        }
      };
      const updateTableScrollY = function() {
        nextTick(() => instance.layout.updateScrollY.apply(instance.layout));
      };
      return {
        ns,
        ...watcher,
        mutations,
        commit,
        updateTableScrollY
      };
    }
    const InitialStateMap = {
      rowKey: "rowKey",
      defaultExpandAll: "defaultExpandAll",
      selectOnIndeterminate: "selectOnIndeterminate",
      indent: "indent",
      lazy: "lazy",
      data: "data",
      ["treeProps.hasChildren"]: {
        key: "lazyColumnIdentifier",
        default: "hasChildren"
      },
      ["treeProps.children"]: {
        key: "childrenColumnName",
        default: "children"
      },
      ["treeProps.checkStrictly"]: {
        key: "checkStrictly",
        default: false
      }
    };
    function createStore$1(table, props2) {
      if (!table) {
        throw new Error("Table is required.");
      }
      const store2 = useStore();
      store2.toggleAllSelection = debounce(store2._toggleAllSelection, 10);
      Object.keys(InitialStateMap).forEach((key) => {
        handleValue(getArrKeysValue(props2, key), key, store2);
      });
      proxyTableProps(store2, props2);
      return store2;
    }
    function proxyTableProps(store2, props2) {
      Object.keys(InitialStateMap).forEach((key) => {
        watch(() => getArrKeysValue(props2, key), (value) => {
          handleValue(value, key, store2);
        });
      });
    }
    function handleValue(value, propsKey, store2) {
      let newVal = value;
      let storeKey2 = InitialStateMap[propsKey];
      if (isObject$7(InitialStateMap[propsKey])) {
        storeKey2 = storeKey2.key;
        newVal = newVal || InitialStateMap[propsKey].default;
      }
      store2.states[storeKey2].value = newVal;
    }
    function getArrKeysValue(props2, keys2) {
      if (keys2.includes(".")) {
        const keyList = keys2.split(".");
        let value = props2;
        keyList.forEach((key) => {
          value = value[key];
        });
        return value;
      } else {
        return props2[keys2];
      }
    }
    class TableLayout {
      constructor(options) {
        this.observers = [];
        this.table = null;
        this.store = null;
        this.columns = [];
        this.fit = true;
        this.showHeader = true;
        this.height = ref(null);
        this.scrollX = ref(false);
        this.scrollY = ref(false);
        this.bodyWidth = ref(null);
        this.fixedWidth = ref(null);
        this.rightFixedWidth = ref(null);
        this.gutterWidth = 0;
        for (const name in options) {
          if (hasOwn$1(options, name)) {
            if (isRef(this[name])) {
              this[name].value = options[name];
            } else {
              this[name] = options[name];
            }
          }
        }
        if (!this.table) {
          throw new Error("Table is required for Table Layout");
        }
        if (!this.store) {
          throw new Error("Store is required for Table Layout");
        }
      }
      updateScrollY() {
        const height = this.height.value;
        if (isNull(height))
          return false;
        const scrollBarRef = this.table.refs.scrollBarRef;
        if (this.table.vnode.el && (scrollBarRef == null ? void 0 : scrollBarRef.wrapRef)) {
          let scrollY = true;
          const prevScrollY = this.scrollY.value;
          scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight;
          this.scrollY.value = scrollY;
          return prevScrollY !== scrollY;
        }
        return false;
      }
      setHeight(value, prop = "height") {
        if (!isClient)
          return;
        const el = this.table.vnode.el;
        value = parseHeight(value);
        this.height.value = Number(value);
        if (!el && (value || value === 0))
          return nextTick(() => this.setHeight(value, prop));
        if (isNumber$2(value)) {
          el.style[prop] = `${value}px`;
          this.updateElsHeight();
        } else if (isString$3(value)) {
          el.style[prop] = value;
          this.updateElsHeight();
        }
      }
      setMaxHeight(value) {
        this.setHeight(value, "max-height");
      }
      getFlattenColumns() {
        const flattenColumns = [];
        const columns2 = this.table.store.states.columns.value;
        columns2.forEach((column) => {
          if (column.isColumnGroup) {
            flattenColumns.push.apply(flattenColumns, column.columns);
          } else {
            flattenColumns.push(column);
          }
        });
        return flattenColumns;
      }
      updateElsHeight() {
        this.updateScrollY();
        this.notifyObservers("scrollable");
      }
      headerDisplayNone(elm) {
        if (!elm)
          return true;
        let headerChild = elm;
        while (headerChild.tagName !== "DIV") {
          if (getComputedStyle(headerChild).display === "none") {
            return true;
          }
          headerChild = headerChild.parentElement;
        }
        return false;
      }
      updateColumnsWidth() {
        if (!isClient)
          return;
        const fit = this.fit;
        const bodyWidth = this.table.vnode.el.clientWidth;
        let bodyMinWidth = 0;
        const flattenColumns = this.getFlattenColumns();
        const flexColumns = flattenColumns.filter((column) => !isNumber$2(column.width));
        flattenColumns.forEach((column) => {
          if (isNumber$2(column.width) && column.realWidth)
            column.realWidth = null;
        });
        if (flexColumns.length > 0 && fit) {
          flattenColumns.forEach((column) => {
            bodyMinWidth += Number(column.width || column.minWidth || 80);
          });
          if (bodyMinWidth <= bodyWidth) {
            this.scrollX.value = false;
            const totalFlexWidth = bodyWidth - bodyMinWidth;
            if (flexColumns.length === 1) {
              flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth;
            } else {
              const allColumnsWidth = flexColumns.reduce((prev, column) => prev + Number(column.minWidth || 80), 0);
              const flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
              let noneFirstWidth = 0;
              flexColumns.forEach((column, index) => {
                if (index === 0)
                  return;
                const flexWidth = Math.floor(Number(column.minWidth || 80) * flexWidthPerPixel);
                noneFirstWidth += flexWidth;
                column.realWidth = Number(column.minWidth || 80) + flexWidth;
              });
              flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
            }
          } else {
            this.scrollX.value = true;
            flexColumns.forEach((column) => {
              column.realWidth = Number(column.minWidth);
            });
          }
          this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth);
          this.table.state.resizeState.value.width = this.bodyWidth.value;
        } else {
          flattenColumns.forEach((column) => {
            if (!column.width && !column.minWidth) {
              column.realWidth = 80;
            } else {
              column.realWidth = Number(column.width || column.minWidth);
            }
            bodyMinWidth += column.realWidth;
          });
          this.scrollX.value = bodyMinWidth > bodyWidth;
          this.bodyWidth.value = bodyMinWidth;
        }
        const fixedColumns = this.store.states.fixedColumns.value;
        if (fixedColumns.length > 0) {
          let fixedWidth = 0;
          fixedColumns.forEach((column) => {
            fixedWidth += Number(column.realWidth || column.width);
          });
          this.fixedWidth.value = fixedWidth;
        }
        const rightFixedColumns = this.store.states.rightFixedColumns.value;
        if (rightFixedColumns.length > 0) {
          let rightFixedWidth = 0;
          rightFixedColumns.forEach((column) => {
            rightFixedWidth += Number(column.realWidth || column.width);
          });
          this.rightFixedWidth.value = rightFixedWidth;
        }
        this.notifyObservers("columns");
      }
      addObserver(observer) {
        this.observers.push(observer);
      }
      removeObserver(observer) {
        const index = this.observers.indexOf(observer);
        if (index !== -1) {
          this.observers.splice(index, 1);
        }
      }
      notifyObservers(event) {
        const observers = this.observers;
        observers.forEach((observer) => {
          var _a2, _b2;
          switch (event) {
            case "columns":
              (_a2 = observer.state) == null ? void 0 : _a2.onColumnsChange(this);
              break;
            case "scrollable":
              (_b2 = observer.state) == null ? void 0 : _b2.onScrollableChange(this);
              break;
            default:
              throw new Error(`Table Layout don't have event ${event}.`);
          }
        });
      }
    }
    const { CheckboxGroup: ElCheckboxGroup } = ElCheckbox;
    const _sfc_main$K = /* @__PURE__ */ defineComponent({
      name: "ElTableFilterPanel",
      components: {
        ElCheckbox,
        ElCheckboxGroup,
        ElScrollbar,
        ElTooltip,
        ElIcon,
        ArrowDown: arrow_down_default,
        ArrowUp: arrow_up_default
      },
      directives: { ClickOutside },
      props: {
        placement: {
          type: String,
          default: "bottom-start"
        },
        store: {
          type: Object
        },
        column: {
          type: Object
        },
        upDataColumn: {
          type: Function
        },
        appendTo: useTooltipContentProps.appendTo
      },
      setup(props2) {
        const instance = getCurrentInstance();
        const { t } = useLocale();
        const ns = useNamespace("table-filter");
        const parent2 = instance == null ? void 0 : instance.parent;
        if (!parent2.filterPanels.value[props2.column.id]) {
          parent2.filterPanels.value[props2.column.id] = instance;
        }
        const tooltipVisible = ref(false);
        const tooltip = ref(null);
        const filters = computed(() => {
          return props2.column && props2.column.filters;
        });
        const filterClassName = computed(() => {
          if (props2.column.filterClassName) {
            return `${ns.b()} ${props2.column.filterClassName}`;
          }
          return ns.b();
        });
        const filterValue = computed({
          get: () => {
            var _a2;
            return (((_a2 = props2.column) == null ? void 0 : _a2.filteredValue) || [])[0];
          },
          set: (value) => {
            if (filteredValue.value) {
              if (!isPropAbsent(value)) {
                filteredValue.value.splice(0, 1, value);
              } else {
                filteredValue.value.splice(0, 1);
              }
            }
          }
        });
        const filteredValue = computed({
          get() {
            if (props2.column) {
              return props2.column.filteredValue || [];
            }
            return [];
          },
          set(value) {
            if (props2.column) {
              props2.upDataColumn("filteredValue", value);
            }
          }
        });
        const multiple = computed(() => {
          if (props2.column) {
            return props2.column.filterMultiple;
          }
          return true;
        });
        const isActive = (filter2) => {
          return filter2.value === filterValue.value;
        };
        const hidden = () => {
          tooltipVisible.value = false;
        };
        const showFilterPanel = (e2) => {
          e2.stopPropagation();
          tooltipVisible.value = !tooltipVisible.value;
        };
        const hideFilterPanel = () => {
          tooltipVisible.value = false;
        };
        const handleConfirm = () => {
          confirmFilter(filteredValue.value);
          hidden();
        };
        const handleReset = () => {
          filteredValue.value = [];
          confirmFilter(filteredValue.value);
          hidden();
        };
        const handleSelect = (_filterValue) => {
          filterValue.value = _filterValue;
          if (!isPropAbsent(_filterValue)) {
            confirmFilter(filteredValue.value);
          } else {
            confirmFilter([]);
          }
          hidden();
        };
        const confirmFilter = (filteredValue2) => {
          props2.store.commit("filterChange", {
            column: props2.column,
            values: filteredValue2
          });
          props2.store.updateAllSelected();
        };
        watch(tooltipVisible, (value) => {
          if (props2.column) {
            props2.upDataColumn("filterOpened", value);
          }
        }, {
          immediate: true
        });
        const popperPaneRef = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = tooltip.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b2.contentRef;
        });
        return {
          tooltipVisible,
          multiple,
          filterClassName,
          filteredValue,
          filterValue,
          filters,
          handleConfirm,
          handleReset,
          handleSelect,
          isPropAbsent,
          isActive,
          t,
          ns,
          showFilterPanel,
          hideFilterPanel,
          popperPaneRef,
          tooltip
        };
      }
    });
    function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _component_arrow_up = resolveComponent("arrow-up");
      const _component_arrow_down = resolveComponent("arrow-down");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_tooltip = resolveComponent("el-tooltip");
      const _directive_click_outside = resolveDirective("click-outside");
      return openBlock(), createBlock(_component_el_tooltip, {
        ref: "tooltip",
        visible: _ctx.tooltipVisible,
        offset: 0,
        placement: _ctx.placement,
        "show-arrow": false,
        "stop-popper-mouse-event": false,
        teleported: "",
        effect: "light",
        pure: "",
        "popper-class": _ctx.filterClassName,
        persistent: "",
        "append-to": _ctx.appendTo
      }, {
        content: withCtx(() => [
          _ctx.multiple ? (openBlock(), createElementBlock("div", { key: 0 }, [
            createBaseVNode("div", {
              class: normalizeClass(_ctx.ns.e("content"))
            }, [
              createVNode$1(_component_el_scrollbar, {
                "wrap-class": _ctx.ns.e("wrap")
              }, {
                default: withCtx(() => [
                  createVNode$1(_component_el_checkbox_group, {
                    modelValue: _ctx.filteredValue,
                    "onUpdate:modelValue": ($event) => _ctx.filteredValue = $event,
                    class: normalizeClass(_ctx.ns.e("checkbox-group"))
                  }, {
                    default: withCtx(() => [
                      (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter2) => {
                        return openBlock(), createBlock(_component_el_checkbox, {
                          key: filter2.value,
                          value: filter2.value
                        }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(filter2.text), 1)
                          ]),
                          _: 2
                        }, 1032, ["value"]);
                      }), 128))
                    ]),
                    _: 1
                  }, 8, ["modelValue", "onUpdate:modelValue", "class"])
                ]),
                _: 1
              }, 8, ["wrap-class"])
            ], 2),
            createBaseVNode("div", {
              class: normalizeClass(_ctx.ns.e("bottom"))
            }, [
              createBaseVNode("button", {
                class: normalizeClass({ [_ctx.ns.is("disabled")]: _ctx.filteredValue.length === 0 }),
                disabled: _ctx.filteredValue.length === 0,
                type: "button",
                onClick: _ctx.handleConfirm
              }, toDisplayString(_ctx.t("el.table.confirmFilter")), 11, ["disabled", "onClick"]),
              createBaseVNode("button", {
                type: "button",
                onClick: _ctx.handleReset
              }, toDisplayString(_ctx.t("el.table.resetFilter")), 9, ["onClick"])
            ], 2)
          ])) : (openBlock(), createElementBlock("ul", {
            key: 1,
            class: normalizeClass(_ctx.ns.e("list"))
          }, [
            createBaseVNode("li", {
              class: normalizeClass([
                _ctx.ns.e("list-item"),
                {
                  [_ctx.ns.is("active")]: _ctx.isPropAbsent(_ctx.filterValue)
                }
              ]),
              onClick: ($event) => _ctx.handleSelect(null)
            }, toDisplayString(_ctx.t("el.table.clearFilter")), 11, ["onClick"]),
            (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filters, (filter2) => {
              return openBlock(), createElementBlock("li", {
                key: filter2.value,
                class: normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter2))]),
                label: filter2.value,
                onClick: ($event) => _ctx.handleSelect(filter2.value)
              }, toDisplayString(filter2.text), 11, ["label", "onClick"]);
            }), 128))
          ], 2))
        ]),
        default: withCtx(() => [
          withDirectives((openBlock(), createElementBlock("span", {
            class: normalizeClass([
              `${_ctx.ns.namespace.value}-table__column-filter-trigger`,
              `${_ctx.ns.namespace.value}-none-outline`
            ]),
            onClick: _ctx.showFilterPanel
          }, [
            createVNode$1(_component_el_icon, null, {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "filter-icon", {}, () => [
                  _ctx.column.filterOpened ? (openBlock(), createBlock(_component_arrow_up, { key: 0 })) : (openBlock(), createBlock(_component_arrow_down, { key: 1 }))
                ])
              ]),
              _: 3
            })
          ], 10, ["onClick"])), [
            [_directive_click_outside, _ctx.hideFilterPanel, _ctx.popperPaneRef]
          ])
        ]),
        _: 3
      }, 8, ["visible", "placement", "popper-class", "append-to"]);
    }
    var FilterPanel = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$a], ["__file", "filter-panel.vue"]]);
    function useLayoutObserver(root2) {
      const instance = getCurrentInstance();
      onBeforeMount(() => {
        tableLayout.value.addObserver(instance);
      });
      onMounted(() => {
        onColumnsChange(tableLayout.value);
        onScrollableChange(tableLayout.value);
      });
      onUpdated(() => {
        onColumnsChange(tableLayout.value);
        onScrollableChange(tableLayout.value);
      });
      onUnmounted(() => {
        tableLayout.value.removeObserver(instance);
      });
      const tableLayout = computed(() => {
        const layout2 = root2.layout;
        if (!layout2) {
          throw new Error("Can not find table layout.");
        }
        return layout2;
      });
      const onColumnsChange = (layout2) => {
        var _a2;
        const cols = ((_a2 = root2.vnode.el) == null ? void 0 : _a2.querySelectorAll("colgroup > col")) || [];
        if (!cols.length)
          return;
        const flattenColumns = layout2.getFlattenColumns();
        const columnsMap = {};
        flattenColumns.forEach((column) => {
          columnsMap[column.id] = column;
        });
        for (let i2 = 0, j = cols.length; i2 < j; i2++) {
          const col = cols[i2];
          const name = col.getAttribute("name");
          const column = columnsMap[name];
          if (column) {
            col.setAttribute("width", column.realWidth || column.width);
          }
        }
      };
      const onScrollableChange = (layout2) => {
        var _a2, _b2;
        const cols = ((_a2 = root2.vnode.el) == null ? void 0 : _a2.querySelectorAll("colgroup > col[name=gutter]")) || [];
        for (let i2 = 0, j = cols.length; i2 < j; i2++) {
          const col = cols[i2];
          col.setAttribute("width", layout2.scrollY.value ? layout2.gutterWidth : "0");
        }
        const ths = ((_b2 = root2.vnode.el) == null ? void 0 : _b2.querySelectorAll("th.gutter")) || [];
        for (let i2 = 0, j = ths.length; i2 < j; i2++) {
          const th = ths[i2];
          th.style.width = layout2.scrollY.value ? `${layout2.gutterWidth}px` : "0";
          th.style.display = layout2.scrollY.value ? "" : "none";
        }
      };
      return {
        tableLayout: tableLayout.value,
        onColumnsChange,
        onScrollableChange
      };
    }
    const TABLE_INJECTION_KEY = Symbol("ElTable");
    function useEvent(props2, emit2) {
      const instance = getCurrentInstance();
      const parent2 = inject(TABLE_INJECTION_KEY);
      const handleFilterClick = (event) => {
        event.stopPropagation();
        return;
      };
      const handleHeaderClick = (event, column) => {
        if (!column.filters && column.sortable) {
          handleSortClick(event, column, false);
        } else if (column.filterable && !column.sortable) {
          handleFilterClick(event);
        }
        parent2 == null ? void 0 : parent2.emit("header-click", column, event);
      };
      const handleHeaderContextMenu = (event, column) => {
        parent2 == null ? void 0 : parent2.emit("header-contextmenu", column, event);
      };
      const draggingColumn = ref(null);
      const dragging = ref(false);
      const dragState = ref({});
      const handleMouseDown = (event, column) => {
        if (!isClient)
          return;
        if (column.children && column.children.length > 0)
          return;
        if (draggingColumn.value && props2.border) {
          dragging.value = true;
          const table = parent2;
          emit2("set-drag-visible", true);
          const tableEl = table == null ? void 0 : table.vnode.el;
          const tableLeft = tableEl.getBoundingClientRect().left;
          const columnEl = instance.vnode.el.querySelector(`th.${column.id}`);
          const columnRect = columnEl.getBoundingClientRect();
          const minLeft = columnRect.left - tableLeft + 30;
          addClass(columnEl, "noclick");
          dragState.value = {
            startMouseLeft: event.clientX,
            startLeft: columnRect.right - tableLeft,
            startColumnLeft: columnRect.left - tableLeft,
            tableLeft
          };
          const resizeProxy = table == null ? void 0 : table.refs.resizeProxy;
          resizeProxy.style.left = `${dragState.value.startLeft}px`;
          document.onselectstart = function() {
            return false;
          };
          document.ondragstart = function() {
            return false;
          };
          const handleMouseMove2 = (event2) => {
            const deltaLeft = event2.clientX - dragState.value.startMouseLeft;
            const proxyLeft = dragState.value.startLeft + deltaLeft;
            resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`;
          };
          const handleMouseUp = () => {
            if (dragging.value) {
              const { startColumnLeft, startLeft } = dragState.value;
              const finalLeft = Number.parseInt(resizeProxy.style.left, 10);
              const columnWidth = finalLeft - startColumnLeft;
              column.width = column.realWidth = columnWidth;
              table == null ? void 0 : table.emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
              requestAnimationFrame(() => {
                props2.store.scheduleLayout(false, true);
              });
              document.body.style.cursor = "";
              dragging.value = false;
              draggingColumn.value = null;
              dragState.value = {};
              emit2("set-drag-visible", false);
            }
            document.removeEventListener("mousemove", handleMouseMove2);
            document.removeEventListener("mouseup", handleMouseUp);
            document.onselectstart = null;
            document.ondragstart = null;
            setTimeout(() => {
              removeClass(columnEl, "noclick");
            }, 0);
          };
          document.addEventListener("mousemove", handleMouseMove2);
          document.addEventListener("mouseup", handleMouseUp);
        }
      };
      const handleMouseMove = (event, column) => {
        var _a2;
        if (column.children && column.children.length > 0)
          return;
        const el = event.target;
        if (!isElement$1(el)) {
          return;
        }
        const target = el == null ? void 0 : el.closest("th");
        if (!column || !column.resizable || !target)
          return;
        if (!dragging.value && props2.border) {
          const rect = target.getBoundingClientRect();
          const bodyStyle = document.body.style;
          const isLastTh = ((_a2 = target.parentNode) == null ? void 0 : _a2.lastElementChild) === target;
          const allowDarg = props2.allowDragLastColumn || !isLastTh;
          if (rect.width > 12 && rect.right - event.clientX < 8 && allowDarg) {
            bodyStyle.cursor = "col-resize";
            if (hasClass(target, "is-sortable")) {
              target.style.cursor = "col-resize";
            }
            draggingColumn.value = column;
          } else if (!dragging.value) {
            bodyStyle.cursor = "";
            if (hasClass(target, "is-sortable")) {
              target.style.cursor = "pointer";
            }
            draggingColumn.value = null;
          }
        }
      };
      const handleMouseOut = () => {
        if (!isClient)
          return;
        document.body.style.cursor = "";
      };
      const toggleOrder = ({ order, sortOrders }) => {
        if (order === "")
          return sortOrders[0];
        const index = sortOrders.indexOf(order || null);
        return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
      };
      const handleSortClick = (event, column, givenOrder) => {
        var _a2;
        event.stopPropagation();
        const order = column.order === givenOrder ? null : givenOrder || toggleOrder(column);
        const target = (_a2 = event.target) == null ? void 0 : _a2.closest("th");
        if (target) {
          if (hasClass(target, "noclick")) {
            removeClass(target, "noclick");
            return;
          }
        }
        if (!column.sortable)
          return;
        const clickTarget = event.currentTarget;
        if (["ascending", "descending"].some((str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str))) {
          return;
        }
        const states = props2.store.states;
        let sortProp = states.sortProp.value;
        let sortOrder;
        const sortingColumn = states.sortingColumn.value;
        if (sortingColumn !== column || sortingColumn === column && isNull(sortingColumn.order)) {
          if (sortingColumn) {
            sortingColumn.order = null;
          }
          states.sortingColumn.value = column;
          sortProp = column.property;
        }
        if (!order) {
          sortOrder = column.order = null;
        } else {
          sortOrder = column.order = order;
        }
        states.sortProp.value = sortProp;
        states.sortOrder.value = sortOrder;
        parent2 == null ? void 0 : parent2.store.commit("changeSortCondition");
      };
      return {
        handleHeaderClick,
        handleHeaderContextMenu,
        handleMouseDown,
        handleMouseMove,
        handleMouseOut,
        handleSortClick,
        handleFilterClick
      };
    }
    function useStyle$2(props2) {
      const parent2 = inject(TABLE_INJECTION_KEY);
      const ns = useNamespace("table");
      const getHeaderRowStyle = (rowIndex) => {
        const headerRowStyle = parent2 == null ? void 0 : parent2.props.headerRowStyle;
        if (isFunction$4(headerRowStyle)) {
          return headerRowStyle.call(null, { rowIndex });
        }
        return headerRowStyle;
      };
      const getHeaderRowClass = (rowIndex) => {
        const classes = [];
        const headerRowClassName = parent2 == null ? void 0 : parent2.props.headerRowClassName;
        if (isString$3(headerRowClassName)) {
          classes.push(headerRowClassName);
        } else if (isFunction$4(headerRowClassName)) {
          classes.push(headerRowClassName.call(null, { rowIndex }));
        }
        return classes.join(" ");
      };
      const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => {
        var _a2;
        let headerCellStyles = (_a2 = parent2 == null ? void 0 : parent2.props.headerCellStyle) != null ? _a2 : {};
        if (isFunction$4(headerCellStyles)) {
          headerCellStyles = headerCellStyles.call(null, {
            rowIndex,
            columnIndex,
            row,
            column
          });
        }
        const fixedStyle = getFixedColumnOffset(columnIndex, column.fixed, props2.store, row);
        ensurePosition(fixedStyle, "left");
        ensurePosition(fixedStyle, "right");
        return Object.assign({}, headerCellStyles, fixedStyle);
      };
      const getHeaderCellClass = (rowIndex, columnIndex, row, column) => {
        const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, column.fixed, props2.store, row);
        const classes = [
          column.id,
          column.order,
          column.headerAlign,
          column.className,
          column.labelClassName,
          ...fixedClasses
        ];
        if (!column.children) {
          classes.push("is-leaf");
        }
        if (column.sortable) {
          classes.push("is-sortable");
        }
        const headerCellClassName = parent2 == null ? void 0 : parent2.props.headerCellClassName;
        if (isString$3(headerCellClassName)) {
          classes.push(headerCellClassName);
        } else if (isFunction$4(headerCellClassName)) {
          classes.push(headerCellClassName.call(null, {
            rowIndex,
            columnIndex,
            row,
            column
          }));
        }
        classes.push(ns.e("cell"));
        return classes.filter((className) => Boolean(className)).join(" ");
      };
      return {
        getHeaderRowStyle,
        getHeaderRowClass,
        getHeaderCellStyle,
        getHeaderCellClass
      };
    }
    const getAllColumns = (columns2) => {
      const result = [];
      columns2.forEach((column) => {
        if (column.children) {
          result.push(column);
          result.push.apply(result, getAllColumns(column.children));
        } else {
          result.push(column);
        }
      });
      return result;
    };
    const convertToRows = (originColumns) => {
      let maxLevel = 1;
      const traverse2 = (column, parent2) => {
        if (parent2) {
          column.level = parent2.level + 1;
          if (maxLevel < column.level) {
            maxLevel = column.level;
          }
        }
        if (column.children) {
          let colSpan = 0;
          column.children.forEach((subColumn) => {
            traverse2(subColumn, column);
            colSpan += subColumn.colSpan;
          });
          column.colSpan = colSpan;
        } else {
          column.colSpan = 1;
        }
      };
      originColumns.forEach((column) => {
        column.level = 1;
        traverse2(column, void 0);
      });
      const rows = [];
      for (let i2 = 0; i2 < maxLevel; i2++) {
        rows.push([]);
      }
      const allColumns = getAllColumns(originColumns);
      allColumns.forEach((column) => {
        if (!column.children) {
          column.rowSpan = maxLevel - column.level + 1;
        } else {
          column.rowSpan = 1;
          column.children.forEach((col) => col.isSubColumn = true);
        }
        rows[column.level - 1].push(column);
      });
      return rows;
    };
    function useUtils$1(props2) {
      const parent2 = inject(TABLE_INJECTION_KEY);
      const columnRows = computed(() => {
        return convertToRows(props2.store.states.originColumns.value);
      });
      const isGroup = computed(() => {
        const result = columnRows.value.length > 1;
        if (result && parent2) {
          parent2.state.isGroup.value = true;
        }
        return result;
      });
      const toggleAllSelection = (event) => {
        event.stopPropagation();
        parent2 == null ? void 0 : parent2.store.commit("toggleAllSelection");
      };
      return {
        isGroup,
        toggleAllSelection,
        columnRows
      };
    }
    var TableHeader = /* @__PURE__ */ defineComponent({
      name: "ElTableHeader",
      components: {
        ElCheckbox
      },
      props: {
        fixed: {
          type: String,
          default: ""
        },
        store: {
          required: true,
          type: Object
        },
        border: Boolean,
        defaultSort: {
          type: Object,
          default: () => {
            return {
              prop: "",
              order: ""
            };
          }
        },
        appendFilterPanelTo: {
          type: String
        },
        allowDragLastColumn: {
          type: Boolean
        }
      },
      setup(props2, { emit: emit2 }) {
        const instance = getCurrentInstance();
        const parent2 = inject(TABLE_INJECTION_KEY);
        const ns = useNamespace("table");
        const filterPanels = ref({});
        const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent2);
        const isTableLayoutAuto = (parent2 == null ? void 0 : parent2.props.tableLayout) === "auto";
        const saveIndexSelection = reactive(/* @__PURE__ */ new Map());
        const theadRef = ref();
        const updateFixedColumnStyle = () => {
          setTimeout(() => {
            if (saveIndexSelection.size > 0) {
              saveIndexSelection.forEach((column, key) => {
                const el = theadRef.value.querySelector(`.${key.replace(/\s/g, ".")}`);
                if (el) {
                  const width = el.getBoundingClientRect().width;
                  column.width = width;
                }
              });
              saveIndexSelection.clear();
            }
          });
        };
        watch(saveIndexSelection, updateFixedColumnStyle);
        onMounted(async () => {
          await nextTick();
          await nextTick();
          const { prop, order } = props2.defaultSort;
          parent2 == null ? void 0 : parent2.store.commit("sort", { prop, order, init: true });
          updateFixedColumnStyle();
        });
        const {
          handleHeaderClick,
          handleHeaderContextMenu,
          handleMouseDown,
          handleMouseMove,
          handleMouseOut,
          handleSortClick,
          handleFilterClick
        } = useEvent(props2, emit2);
        const {
          getHeaderRowStyle,
          getHeaderRowClass,
          getHeaderCellStyle,
          getHeaderCellClass
        } = useStyle$2(props2);
        const { isGroup, toggleAllSelection, columnRows } = useUtils$1(props2);
        instance.state = {
          onColumnsChange,
          onScrollableChange
        };
        instance.filterPanels = filterPanels;
        return {
          ns,
          filterPanels,
          onColumnsChange,
          onScrollableChange,
          columnRows,
          getHeaderRowClass,
          getHeaderRowStyle,
          getHeaderCellClass,
          getHeaderCellStyle,
          handleHeaderClick,
          handleHeaderContextMenu,
          handleMouseDown,
          handleMouseMove,
          handleMouseOut,
          handleSortClick,
          handleFilterClick,
          isGroup,
          toggleAllSelection,
          saveIndexSelection,
          isTableLayoutAuto,
          theadRef,
          updateFixedColumnStyle
        };
      },
      render() {
        const {
          ns,
          isGroup,
          columnRows,
          getHeaderCellStyle,
          getHeaderCellClass,
          getHeaderRowClass,
          getHeaderRowStyle,
          handleHeaderClick,
          handleHeaderContextMenu,
          handleMouseDown,
          handleMouseMove,
          handleSortClick,
          handleMouseOut,
          store: store2,
          $parent,
          saveIndexSelection,
          isTableLayoutAuto
        } = this;
        let rowSpan = 1;
        return h$1("thead", {
          ref: "theadRef",
          class: { [ns.is("group")]: isGroup }
        }, columnRows.map((subColumns, rowIndex) => h$1("tr", {
          class: getHeaderRowClass(rowIndex),
          key: rowIndex,
          style: getHeaderRowStyle(rowIndex)
        }, subColumns.map((column, cellIndex) => {
          if (column.rowSpan > rowSpan) {
            rowSpan = column.rowSpan;
          }
          const _class = getHeaderCellClass(rowIndex, cellIndex, subColumns, column);
          if (isTableLayoutAuto && column.fixed) {
            saveIndexSelection.set(_class, column);
          }
          return h$1("th", {
            class: _class,
            colspan: column.colSpan,
            key: `${column.id}-thead`,
            rowspan: column.rowSpan,
            style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
            onClick: ($event) => {
              if ($event.currentTarget.classList.contains("noclick")) {
                return;
              }
              handleHeaderClick($event, column);
            },
            onContextmenu: ($event) => handleHeaderContextMenu($event, column),
            onMousedown: ($event) => handleMouseDown($event, column),
            onMousemove: ($event) => handleMouseMove($event, column),
            onMouseout: handleMouseOut
          }, [
            h$1("div", {
              class: [
                "cell",
                column.filteredValue && column.filteredValue.length > 0 ? "highlight" : ""
              ]
            }, [
              column.renderHeader ? column.renderHeader({
                column,
                $index: cellIndex,
                store: store2,
                _self: $parent
              }) : column.label,
              column.sortable && h$1("span", {
                onClick: ($event) => handleSortClick($event, column),
                class: "caret-wrapper"
              }, [
                h$1("i", {
                  onClick: ($event) => handleSortClick($event, column, "ascending"),
                  class: "sort-caret ascending"
                }),
                h$1("i", {
                  onClick: ($event) => handleSortClick($event, column, "descending"),
                  class: "sort-caret descending"
                })
              ]),
              column.filterable && h$1(FilterPanel, {
                store: store2,
                placement: column.filterPlacement || "bottom-start",
                appendTo: $parent.appendFilterPanelTo,
                column,
                upDataColumn: (key, value) => {
                  column[key] = value;
                }
              }, {
                "filter-icon": () => column.renderFilterIcon ? column.renderFilterIcon({
                  filterOpened: column.filterOpened
                }) : null
              })
            ])
          ]);
        }))));
      }
    });
    function isGreaterThan(a2, b2, epsilon = 0.03) {
      return a2 - b2 > epsilon;
    }
    function useEvents(props2) {
      const parent2 = inject(TABLE_INJECTION_KEY);
      const tooltipContent = ref("");
      const tooltipTrigger = ref(h$1("div"));
      const handleEvent = (event, row, name) => {
        var _a2;
        const table = parent2;
        const cell = getCell(event);
        let column;
        const namespace = (_a2 = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a2.dataset.prefix;
        if (cell) {
          column = getColumnByCell({
            columns: props2.store.states.columns.value
          }, cell, namespace);
          if (column) {
            table == null ? void 0 : table.emit(`cell-${name}`, row, column, cell, event);
          }
        }
        table == null ? void 0 : table.emit(`row-${name}`, row, column, event);
      };
      const handleDoubleClick = (event, row) => {
        handleEvent(event, row, "dblclick");
      };
      const handleClick = (event, row) => {
        props2.store.commit("setCurrentRow", row);
        handleEvent(event, row, "click");
      };
      const handleContextMenu = (event, row) => {
        handleEvent(event, row, "contextmenu");
      };
      const handleMouseEnter = debounce((index) => {
        props2.store.commit("setHoverRow", index);
      }, 30);
      const handleMouseLeave = debounce(() => {
        props2.store.commit("setHoverRow", null);
      }, 30);
      const getPadding = (el) => {
        const style = window.getComputedStyle(el, null);
        const paddingLeft2 = Number.parseInt(style.paddingLeft, 10) || 0;
        const paddingRight2 = Number.parseInt(style.paddingRight, 10) || 0;
        const paddingTop2 = Number.parseInt(style.paddingTop, 10) || 0;
        const paddingBottom2 = Number.parseInt(style.paddingBottom, 10) || 0;
        return {
          left: paddingLeft2,
          right: paddingRight2,
          top: paddingTop2,
          bottom: paddingBottom2
        };
      };
      const toggleRowClassByCell = (rowSpan, event, toggle) => {
        let node = event.target.parentNode;
        while (rowSpan > 1) {
          node = node == null ? void 0 : node.nextSibling;
          if (!node || node.nodeName !== "TR")
            break;
          toggle(node, "hover-row hover-fixed-row");
          rowSpan--;
        }
      };
      const handleCellMouseEnter = (event, row, tooltipOptions) => {
        var _a2, _b2, _c2;
        const table = parent2;
        const cell = getCell(event);
        const namespace = (_a2 = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a2.dataset.prefix;
        let column;
        if (cell) {
          column = getColumnByCell({
            columns: props2.store.states.columns.value
          }, cell, namespace);
          if (cell.rowSpan > 1) {
            toggleRowClassByCell(cell.rowSpan, event, addClass);
          }
          const hoverState = table.hoverState = { cell, column, row };
          table == null ? void 0 : table.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, event);
        }
        if (!tooltipOptions) {
          return;
        }
        const cellChild = event.target.querySelector(".cell");
        if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length)) {
          return;
        }
        const range2 = document.createRange();
        range2.setStart(cellChild, 0);
        range2.setEnd(cellChild, cellChild.childNodes.length);
        const { width: rangeWidth, height: rangeHeight } = range2.getBoundingClientRect();
        const { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect();
        const { top, left, right, bottom } = getPadding(cellChild);
        const horizontalPadding = left + right;
        const verticalPadding = top + bottom;
        if (isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) || isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) || isGreaterThan(cellChild.scrollWidth, cellChildWidth)) {
          createTablePopper(tooltipOptions, cell.innerText || cell.textContent, row, column, cell, table);
        } else if (((_b2 = removePopper) == null ? void 0 : _b2.trigger) === cell) {
          (_c2 = removePopper) == null ? void 0 : _c2();
        }
      };
      const handleCellMouseLeave = (event) => {
        const cell = getCell(event);
        if (!cell)
          return;
        if (cell.rowSpan > 1) {
          toggleRowClassByCell(cell.rowSpan, event, removeClass);
        }
        const oldHoverState = parent2 == null ? void 0 : parent2.hoverState;
        parent2 == null ? void 0 : parent2.emit("cell-mouse-leave", oldHoverState == null ? void 0 : oldHoverState.row, oldHoverState == null ? void 0 : oldHoverState.column, oldHoverState == null ? void 0 : oldHoverState.cell, event);
      };
      return {
        handleDoubleClick,
        handleClick,
        handleContextMenu,
        handleMouseEnter,
        handleMouseLeave,
        handleCellMouseEnter,
        handleCellMouseLeave,
        tooltipContent,
        tooltipTrigger
      };
    }
    function useStyles$1(props2) {
      const parent2 = inject(TABLE_INJECTION_KEY);
      const ns = useNamespace("table");
      const getRowStyle = (row, rowIndex) => {
        const rowStyle = parent2 == null ? void 0 : parent2.props.rowStyle;
        if (isFunction$4(rowStyle)) {
          return rowStyle.call(null, {
            row,
            rowIndex
          });
        }
        return rowStyle || null;
      };
      const getRowClass = (row, rowIndex) => {
        const classes = [ns.e("row")];
        if ((parent2 == null ? void 0 : parent2.props.highlightCurrentRow) && row === props2.store.states.currentRow.value) {
          classes.push("current-row");
        }
        if (props2.stripe && rowIndex % 2 === 1) {
          classes.push(ns.em("row", "striped"));
        }
        const rowClassName = parent2 == null ? void 0 : parent2.props.rowClassName;
        if (isString$3(rowClassName)) {
          classes.push(rowClassName);
        } else if (isFunction$4(rowClassName)) {
          classes.push(rowClassName.call(null, {
            row,
            rowIndex
          }));
        }
        return classes;
      };
      const getCellStyle = (rowIndex, columnIndex, row, column) => {
        const cellStyle = parent2 == null ? void 0 : parent2.props.cellStyle;
        let cellStyles = cellStyle != null ? cellStyle : {};
        if (isFunction$4(cellStyle)) {
          cellStyles = cellStyle.call(null, {
            rowIndex,
            columnIndex,
            row,
            column
          });
        }
        const fixedStyle = getFixedColumnOffset(columnIndex, props2 == null ? void 0 : props2.fixed, props2.store);
        ensurePosition(fixedStyle, "left");
        ensurePosition(fixedStyle, "right");
        return Object.assign({}, cellStyles, fixedStyle);
      };
      const getCellClass = (rowIndex, columnIndex, row, column, offset2) => {
        const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, props2 == null ? void 0 : props2.fixed, props2.store, void 0, offset2);
        const classes = [column.id, column.align, column.className, ...fixedClasses];
        const cellClassName = parent2 == null ? void 0 : parent2.props.cellClassName;
        if (isString$3(cellClassName)) {
          classes.push(cellClassName);
        } else if (isFunction$4(cellClassName)) {
          classes.push(cellClassName.call(null, {
            rowIndex,
            columnIndex,
            row,
            column
          }));
        }
        classes.push(ns.e("cell"));
        return classes.filter((className) => Boolean(className)).join(" ");
      };
      const getSpan = (row, column, rowIndex, columnIndex) => {
        let rowspan = 1;
        let colspan = 1;
        const fn2 = parent2 == null ? void 0 : parent2.props.spanMethod;
        if (isFunction$4(fn2)) {
          const result = fn2({
            row,
            column,
            rowIndex,
            columnIndex
          });
          if (isArray$5(result)) {
            rowspan = result[0];
            colspan = result[1];
          } else if (isObject$7(result)) {
            rowspan = result.rowspan;
            colspan = result.colspan;
          }
        }
        return { rowspan, colspan };
      };
      const getColspanRealWidth = (columns2, colspan, index) => {
        if (colspan < 1) {
          return columns2[index].realWidth;
        }
        const widthArr = columns2.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan);
        return Number(widthArr.reduce((acc, width) => Number(acc) + Number(width), -1));
      };
      return {
        getRowStyle,
        getRowClass,
        getCellStyle,
        getCellClass,
        getSpan,
        getColspanRealWidth
      };
    }
    const __default__$v = /* @__PURE__ */ defineComponent({
      name: "TableTdWrapper"
    });
    const _sfc_main$J = /* @__PURE__ */ defineComponent({
      ...__default__$v,
      props: {
        colspan: {
          type: Number,
          default: 1
        },
        rowspan: {
          type: Number,
          default: 1
        }
      },
      setup(__props) {
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("td", {
            colspan: __props.colspan,
            rowspan: __props.rowspan
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 8, ["colspan", "rowspan"]);
        };
      }
    });
    var TdWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__file", "td-wrapper.vue"]]);
    function useRender$1(props2) {
      const parent2 = inject(TABLE_INJECTION_KEY);
      const ns = useNamespace("table");
      const {
        handleDoubleClick,
        handleClick,
        handleContextMenu,
        handleMouseEnter,
        handleMouseLeave,
        handleCellMouseEnter,
        handleCellMouseLeave,
        tooltipContent,
        tooltipTrigger
      } = useEvents(props2);
      const {
        getRowStyle,
        getRowClass,
        getCellStyle,
        getCellClass,
        getSpan,
        getColspanRealWidth
      } = useStyles$1(props2);
      const firstDefaultColumnIndex = computed(() => {
        return props2.store.states.columns.value.findIndex(({ type }) => type === "default");
      });
      const getKeyOfRow = (row, index) => {
        const rowKey2 = parent2.props.rowKey;
        if (rowKey2) {
          return getRowIdentity(row, rowKey2);
        }
        return index;
      };
      const rowRender = (row, $index, treeRowData, expanded = false) => {
        const { tooltipEffect, tooltipOptions, store: store2 } = props2;
        const { indent, columns: columns2 } = store2.states;
        const rowClasses = getRowClass(row, $index);
        let display2 = true;
        if (treeRowData) {
          rowClasses.push(ns.em("row", `level-${treeRowData.level}`));
          display2 = treeRowData.display;
        }
        const displayStyle = display2 ? null : { display: "none" };
        return h$1("tr", {
          style: [displayStyle, getRowStyle(row, $index)],
          class: rowClasses,
          key: getKeyOfRow(row, $index),
          onDblclick: ($event) => handleDoubleClick($event, row),
          onClick: ($event) => handleClick($event, row),
          onContextmenu: ($event) => handleContextMenu($event, row),
          onMouseenter: () => handleMouseEnter($index),
          onMouseleave: handleMouseLeave
        }, columns2.value.map((column, cellIndex) => {
          const { rowspan, colspan } = getSpan(row, column, $index, cellIndex);
          if (!rowspan || !colspan) {
            return null;
          }
          const columnData = Object.assign({}, column);
          columnData.realWidth = getColspanRealWidth(columns2.value, colspan, cellIndex);
          const data = {
            store: props2.store,
            _self: props2.context || parent2,
            column: columnData,
            row,
            $index,
            cellIndex,
            expanded
          };
          if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {
            data.treeNode = {
              indent: treeRowData.level * indent.value,
              level: treeRowData.level
            };
            if (isBoolean$1(treeRowData.expanded)) {
              data.treeNode.expanded = treeRowData.expanded;
              if ("loading" in treeRowData) {
                data.treeNode.loading = treeRowData.loading;
              }
              if ("noLazyChildren" in treeRowData) {
                data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
              }
            }
          }
          const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`;
          const patchKey = columnData.columnKey || columnData.rawColumnKey || "";
          const mergedTooltipOptions = column.showOverflowTooltip && merge$2({
            effect: tooltipEffect
          }, tooltipOptions, column.showOverflowTooltip);
          return h$1(TdWrapper, {
            style: getCellStyle($index, cellIndex, row, column),
            class: getCellClass($index, cellIndex, row, column, colspan - 1),
            key: `${patchKey}${baseKey}`,
            rowspan,
            colspan,
            onMouseenter: ($event) => handleCellMouseEnter($event, row, mergedTooltipOptions),
            onMouseleave: handleCellMouseLeave
          }, {
            default: () => cellChildren(cellIndex, column, data)
          });
        }));
      };
      const cellChildren = (cellIndex, column, data) => {
        return column.renderCell(data);
      };
      const wrappedRowRender = (row, $index) => {
        const store2 = props2.store;
        const { isRowExpanded, assertRowKey } = store2;
        const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey: rowKey2 } = store2.states;
        const columns2 = store2.states.columns.value;
        const hasExpandColumn = columns2.some(({ type }) => type === "expand");
        if (hasExpandColumn) {
          const expanded = isRowExpanded(row);
          const tr = rowRender(row, $index, void 0, expanded);
          const renderExpanded = parent2.renderExpanded;
          if (!renderExpanded) {
            console.error("[Element Error]renderExpanded is required.");
            return tr;
          }
          const rows = [[tr]];
          if (parent2.props.preserveExpandedContent || expanded) {
            rows[0].push(h$1("tr", {
              key: `expanded-row__${tr.key}`,
              style: { display: expanded ? "" : "none" }
            }, [
              h$1("td", {
                colspan: columns2.length,
                class: `${ns.e("cell")} ${ns.e("expanded-cell")}`
              }, [renderExpanded({ row, $index, store: store2, expanded })])
            ]));
          }
          return rows;
        } else if (Object.keys(treeData.value).length) {
          assertRowKey();
          const key = getRowIdentity(row, rowKey2.value);
          let cur = treeData.value[key];
          let treeRowData = null;
          if (cur) {
            treeRowData = {
              expanded: cur.expanded,
              level: cur.level,
              display: true
            };
            if (isBoolean$1(cur.lazy)) {
              if (isBoolean$1(cur.loaded) && cur.loaded) {
                treeRowData.noLazyChildren = !(cur.children && cur.children.length);
              }
              treeRowData.loading = cur.loading;
            }
          }
          const tmp = [rowRender(row, $index, treeRowData)];
          if (cur) {
            let i2 = 0;
            const traverse2 = (children, parent22) => {
              if (!(children && children.length && parent22))
                return;
              children.forEach((node) => {
                const innerTreeRowData = {
                  display: parent22.display && parent22.expanded,
                  level: parent22.level + 1,
                  expanded: false,
                  noLazyChildren: false,
                  loading: false
                };
                const childKey = getRowIdentity(node, rowKey2.value);
                if (isPropAbsent(childKey)) {
                  throw new Error("For nested data item, row-key is required.");
                }
                cur = { ...treeData.value[childKey] };
                if (cur) {
                  innerTreeRowData.expanded = cur.expanded;
                  cur.level = cur.level || innerTreeRowData.level;
                  cur.display = !!(cur.expanded && innerTreeRowData.display);
                  if (isBoolean$1(cur.lazy)) {
                    if (isBoolean$1(cur.loaded) && cur.loaded) {
                      innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
                    }
                    innerTreeRowData.loading = cur.loading;
                  }
                }
                i2++;
                tmp.push(rowRender(node, $index + i2, innerTreeRowData));
                if (cur) {
                  const nodes2 = lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value];
                  traverse2(nodes2, cur);
                }
              });
            };
            cur.display = true;
            const nodes = lazyTreeNodeMap.value[key] || row[childrenColumnName.value];
            traverse2(nodes, cur);
          }
          return tmp;
        } else {
          return rowRender(row, $index, void 0);
        }
      };
      return {
        wrappedRowRender,
        tooltipContent,
        tooltipTrigger
      };
    }
    const defaultProps$3 = {
      store: {
        required: true,
        type: Object
      },
      stripe: Boolean,
      tooltipEffect: String,
      tooltipOptions: {
        type: Object
      },
      context: {
        default: () => ({}),
        type: Object
      },
      rowClassName: [String, Function],
      rowStyle: [Object, Function],
      fixed: {
        type: String,
        default: ""
      },
      highlight: Boolean
    };
    var TableBody = /* @__PURE__ */ defineComponent({
      name: "ElTableBody",
      props: defaultProps$3,
      setup(props2) {
        const instance = getCurrentInstance();
        const parent2 = inject(TABLE_INJECTION_KEY);
        const ns = useNamespace("table");
        const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender$1(props2);
        const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent2);
        const hoveredCellList = [];
        watch(props2.store.states.hoverRow, (newVal, oldVal) => {
          var _a2;
          const el = instance == null ? void 0 : instance.vnode.el;
          const rows = Array.from((el == null ? void 0 : el.children) || []).filter((e2) => e2 == null ? void 0 : e2.classList.contains(`${ns.e("row")}`));
          let rowNum = newVal;
          const childNodes = (_a2 = rows[rowNum]) == null ? void 0 : _a2.childNodes;
          if (childNodes == null ? void 0 : childNodes.length) {
            let control = 0;
            const indexes = Array.from(childNodes).reduce((acc, item, index) => {
              var _a22, _b2;
              if (((_a22 = childNodes[index]) == null ? void 0 : _a22.colSpan) > 1) {
                control = (_b2 = childNodes[index]) == null ? void 0 : _b2.colSpan;
              }
              if (item.nodeName !== "TD" && control === 0) {
                acc.push(index);
              }
              control > 0 && control--;
              return acc;
            }, []);
            indexes.forEach((rowIndex) => {
              var _a22;
              rowNum = newVal;
              while (rowNum > 0) {
                const preChildNodes = (_a22 = rows[rowNum - 1]) == null ? void 0 : _a22.childNodes;
                if (preChildNodes[rowIndex] && preChildNodes[rowIndex].nodeName === "TD" && preChildNodes[rowIndex].rowSpan > 1) {
                  addClass(preChildNodes[rowIndex], "hover-cell");
                  hoveredCellList.push(preChildNodes[rowIndex]);
                  break;
                }
                rowNum--;
              }
            });
          } else {
            hoveredCellList.forEach((item) => removeClass(item, "hover-cell"));
            hoveredCellList.length = 0;
          }
          if (!props2.store.states.isComplex.value || !isClient)
            return;
          rAF(() => {
            const oldRow = rows[oldVal];
            const newRow = rows[newVal];
            if (oldRow && !oldRow.classList.contains("hover-fixed-row")) {
              removeClass(oldRow, "hover-row");
            }
            if (newRow) {
              addClass(newRow, "hover-row");
            }
          });
        });
        onUnmounted(() => {
          var _a2;
          (_a2 = removePopper) == null ? void 0 : _a2();
        });
        return {
          ns,
          onColumnsChange,
          onScrollableChange,
          wrappedRowRender,
          tooltipContent,
          tooltipTrigger
        };
      },
      render() {
        const { wrappedRowRender, store: store2 } = this;
        const data = store2.states.data.value || [];
        return h$1("tbody", { tabIndex: -1 }, [
          data.reduce((acc, row) => {
            return acc.concat(wrappedRowRender(row, acc.length));
          }, [])
        ]);
      }
    });
    function useMapState() {
      var _a2;
      const table = inject(TABLE_INJECTION_KEY);
      const store2 = table == null ? void 0 : table.store;
      const leftFixedLeafCount = computed(() => {
        var _a22;
        return (_a22 = store2 == null ? void 0 : store2.states.fixedLeafColumnsLength.value) != null ? _a22 : 0;
      });
      const rightFixedLeafCount = computed(() => {
        var _a22;
        return (_a22 = store2 == null ? void 0 : store2.states.rightFixedColumns.value.length) != null ? _a22 : 0;
      });
      const columnsCount = computed(() => {
        var _a22;
        return (_a22 = store2 == null ? void 0 : store2.states.columns.value.length) != null ? _a22 : 0;
      });
      const leftFixedCount = computed(() => {
        var _a22;
        return (_a22 = store2 == null ? void 0 : store2.states.fixedColumns.value.length) != null ? _a22 : 0;
      });
      const rightFixedCount = computed(() => {
        var _a22;
        return (_a22 = store2 == null ? void 0 : store2.states.rightFixedColumns.value.length) != null ? _a22 : 0;
      });
      return {
        leftFixedLeafCount,
        rightFixedLeafCount,
        columnsCount,
        leftFixedCount,
        rightFixedCount,
        columns: (_a2 = store2 == null ? void 0 : store2.states.columns) != null ? _a2 : []
      };
    }
    function useStyle$1(props2) {
      const { columns: columns2 } = useMapState();
      const ns = useNamespace("table");
      const getCellClasses = (columns22, cellIndex) => {
        const column = columns22[cellIndex];
        const classes = [
          ns.e("cell"),
          column.id,
          column.align,
          column.labelClassName,
          ...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props2.store)
        ];
        if (column.className) {
          classes.push(column.className);
        }
        if (!column.children) {
          classes.push(ns.is("leaf"));
        }
        return classes;
      };
      const getCellStyles = (column, cellIndex) => {
        const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props2.store);
        ensurePosition(fixedStyle, "left");
        ensurePosition(fixedStyle, "right");
        return fixedStyle;
      };
      return {
        getCellClasses,
        getCellStyles,
        columns: columns2
      };
    }
    var TableFooter = /* @__PURE__ */ defineComponent({
      name: "ElTableFooter",
      props: {
        fixed: {
          type: String,
          default: ""
        },
        store: {
          required: true,
          type: Object
        },
        summaryMethod: Function,
        sumText: String,
        border: Boolean,
        defaultSort: {
          type: Object,
          default: () => {
            return {
              prop: "",
              order: ""
            };
          }
        }
      },
      setup(props2) {
        const parent2 = inject(TABLE_INJECTION_KEY);
        const ns = useNamespace("table");
        const { getCellClasses, getCellStyles, columns: columns2 } = useStyle$1(props2);
        const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent2);
        return {
          ns,
          onScrollableChange,
          onColumnsChange,
          getCellClasses,
          getCellStyles,
          columns: columns2
        };
      },
      render() {
        const { columns: columns2, getCellStyles, getCellClasses, summaryMethod, sumText } = this;
        const data = this.store.states.data.value;
        let sums = [];
        if (summaryMethod) {
          sums = summaryMethod({
            columns: columns2,
            data
          });
        } else {
          columns2.forEach((column, index) => {
            if (index === 0) {
              sums[index] = sumText;
              return;
            }
            const values = data.map((item) => Number(item[column.property]));
            const precisions = [];
            let notNumber = true;
            values.forEach((value) => {
              if (!Number.isNaN(+value)) {
                notNumber = false;
                const decimal = `${value}`.split(".")[1];
                precisions.push(decimal ? decimal.length : 0);
              }
            });
            const precision = Math.max.apply(null, precisions);
            if (!notNumber) {
              sums[index] = values.reduce((prev, curr) => {
                const value = Number(curr);
                if (!Number.isNaN(+value)) {
                  return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
                } else {
                  return prev;
                }
              }, 0);
            } else {
              sums[index] = "";
            }
          });
        }
        return h$1(h$1("tfoot", [
          h$1("tr", {}, [
            ...columns2.map((column, cellIndex) => h$1("td", {
              key: cellIndex,
              colspan: column.colSpan,
              rowspan: column.rowSpan,
              class: getCellClasses(columns2, cellIndex),
              style: getCellStyles(column, cellIndex)
            }, [
              h$1("div", {
                class: ["cell", column.labelClassName]
              }, [sums[cellIndex]])
            ]))
          ])
        ]));
      }
    });
    function useUtils(store2) {
      const setCurrentRow = (row) => {
        store2.commit("setCurrentRow", row);
      };
      const getSelectionRows = () => {
        return store2.getSelectionRows();
      };
      const toggleRowSelection = (row, selected, ignoreSelectable = true) => {
        store2.toggleRowSelection(row, selected, false, ignoreSelectable);
        store2.updateAllSelected();
      };
      const clearSelection = () => {
        store2.clearSelection();
      };
      const clearFilter = (columnKeys) => {
        store2.clearFilter(columnKeys);
      };
      const toggleAllSelection = () => {
        store2.commit("toggleAllSelection");
      };
      const toggleRowExpansion = (row, expanded) => {
        store2.toggleRowExpansionAdapter(row, expanded);
      };
      const clearSort = () => {
        store2.clearSort();
      };
      const sort2 = (prop, order) => {
        store2.commit("sort", { prop, order });
      };
      const updateKeyChildren = (key, data) => {
        store2.updateKeyChildren(key, data);
      };
      return {
        setCurrentRow,
        getSelectionRows,
        toggleRowSelection,
        clearSelection,
        clearFilter,
        toggleAllSelection,
        toggleRowExpansion,
        clearSort,
        sort: sort2,
        updateKeyChildren
      };
    }
    function useStyle(props2, layout2, store2, table) {
      const isHidden2 = ref(false);
      const renderExpanded = ref(null);
      const resizeProxyVisible = ref(false);
      const setDragVisible = (visible) => {
        resizeProxyVisible.value = visible;
      };
      const resizeState = ref({
        width: null,
        height: null,
        headerHeight: null
      });
      const isGroup = ref(false);
      const scrollbarViewStyle = {
        display: "inline-block",
        verticalAlign: "middle"
      };
      const tableWidth = ref();
      const tableScrollHeight = ref(0);
      const bodyScrollHeight = ref(0);
      const headerScrollHeight = ref(0);
      const footerScrollHeight = ref(0);
      const appendScrollHeight = ref(0);
      watchEffect(() => {
        layout2.setHeight(props2.height);
      });
      watchEffect(() => {
        layout2.setMaxHeight(props2.maxHeight);
      });
      watch(() => [props2.currentRowKey, store2.states.rowKey], ([currentRowKey, rowKey2]) => {
        if (!unref(rowKey2) || !unref(currentRowKey))
          return;
        store2.setCurrentRowKey(`${currentRowKey}`);
      }, {
        immediate: true
      });
      watch(() => props2.data, (data) => {
        table.store.commit("setData", data);
      }, {
        immediate: true,
        deep: true
      });
      watchEffect(() => {
        if (props2.expandRowKeys) {
          store2.setExpandRowKeysAdapter(props2.expandRowKeys);
        }
      });
      const handleMouseLeave = () => {
        table.store.commit("setHoverRow", null);
        if (table.hoverState)
          table.hoverState = null;
      };
      const handleHeaderFooterMousewheel = (event, data) => {
        const { pixelX, pixelY } = data;
        if (Math.abs(pixelX) >= Math.abs(pixelY)) {
          table.refs.bodyWrapper.scrollLeft += data.pixelX / 5;
        }
      };
      const shouldUpdateHeight = computed(() => {
        return props2.height || props2.maxHeight || store2.states.fixedColumns.value.length > 0 || store2.states.rightFixedColumns.value.length > 0;
      });
      const tableBodyStyles = computed(() => {
        return {
          width: layout2.bodyWidth.value ? `${layout2.bodyWidth.value}px` : ""
        };
      });
      const doLayout = () => {
        if (shouldUpdateHeight.value) {
          layout2.updateElsHeight();
        }
        layout2.updateColumnsWidth();
        if (typeof window === "undefined")
          return;
        requestAnimationFrame(syncPosition);
      };
      onMounted(async () => {
        await nextTick();
        store2.updateColumns();
        bindEvents();
        requestAnimationFrame(doLayout);
        const el = table.vnode.el;
        const tableHeader = table.refs.headerWrapper;
        if (props2.flexible && el && el.parentElement) {
          el.parentElement.style.minWidth = "0";
        }
        resizeState.value = {
          width: tableWidth.value = el.offsetWidth,
          height: el.offsetHeight,
          headerHeight: props2.showHeader && tableHeader ? tableHeader.offsetHeight : null
        };
        store2.states.columns.value.forEach((column) => {
          if (column.filteredValue && column.filteredValue.length) {
            table.store.commit("filterChange", {
              column,
              values: column.filteredValue,
              silent: true
            });
          }
        });
        table.$ready = true;
      });
      const setScrollClassByEl = (el, className) => {
        if (!el)
          return;
        const classList = Array.from(el.classList).filter((item) => !item.startsWith("is-scrolling-"));
        classList.push(layout2.scrollX.value ? className : "is-scrolling-none");
        el.className = classList.join(" ");
      };
      const setScrollClass = (className) => {
        const { tableWrapper } = table.refs;
        setScrollClassByEl(tableWrapper, className);
      };
      const hasScrollClass = (className) => {
        const { tableWrapper } = table.refs;
        return !!(tableWrapper && tableWrapper.classList.contains(className));
      };
      const syncPosition = function() {
        if (!table.refs.scrollBarRef)
          return;
        if (!layout2.scrollX.value) {
          const scrollingNoneClass = "is-scrolling-none";
          if (!hasScrollClass(scrollingNoneClass)) {
            setScrollClass(scrollingNoneClass);
          }
          return;
        }
        const scrollContainer = table.refs.scrollBarRef.wrapRef;
        if (!scrollContainer)
          return;
        const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
        const { headerWrapper, footerWrapper } = table.refs;
        if (headerWrapper)
          headerWrapper.scrollLeft = scrollLeft;
        if (footerWrapper)
          footerWrapper.scrollLeft = scrollLeft;
        const maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
        if (scrollLeft >= maxScrollLeftPosition) {
          setScrollClass("is-scrolling-right");
        } else if (scrollLeft === 0) {
          setScrollClass("is-scrolling-left");
        } else {
          setScrollClass("is-scrolling-middle");
        }
      };
      const bindEvents = () => {
        if (!table.refs.scrollBarRef)
          return;
        if (table.refs.scrollBarRef.wrapRef) {
          useEventListener(table.refs.scrollBarRef.wrapRef, "scroll", syncPosition, {
            passive: true
          });
        }
        if (props2.fit) {
          useResizeObserver(table.vnode.el, resizeListener);
        } else {
          useEventListener(window, "resize", resizeListener);
        }
        useResizeObserver(table.refs.bodyWrapper, () => {
          var _a2, _b2;
          resizeListener();
          (_b2 = (_a2 = table.refs) == null ? void 0 : _a2.scrollBarRef) == null ? void 0 : _b2.update();
        });
      };
      const resizeListener = () => {
        var _a2, _b2, _c2, _d;
        const el = table.vnode.el;
        if (!table.$ready || !el)
          return;
        let shouldUpdateLayout = false;
        const {
          width: oldWidth,
          height: oldHeight,
          headerHeight: oldHeaderHeight
        } = resizeState.value;
        const width = tableWidth.value = el.offsetWidth;
        if (oldWidth !== width) {
          shouldUpdateLayout = true;
        }
        const height = el.offsetHeight;
        if ((props2.height || shouldUpdateHeight.value) && oldHeight !== height) {
          shouldUpdateLayout = true;
        }
        const tableHeader = props2.tableLayout === "fixed" ? table.refs.headerWrapper : (_a2 = table.refs.tableHeaderRef) == null ? void 0 : _a2.$el;
        if (props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) !== oldHeaderHeight) {
          shouldUpdateLayout = true;
        }
        tableScrollHeight.value = ((_b2 = table.refs.tableWrapper) == null ? void 0 : _b2.scrollHeight) || 0;
        headerScrollHeight.value = (tableHeader == null ? void 0 : tableHeader.scrollHeight) || 0;
        footerScrollHeight.value = ((_c2 = table.refs.footerWrapper) == null ? void 0 : _c2.offsetHeight) || 0;
        appendScrollHeight.value = ((_d = table.refs.appendWrapper) == null ? void 0 : _d.offsetHeight) || 0;
        bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value - appendScrollHeight.value;
        if (shouldUpdateLayout) {
          resizeState.value = {
            width,
            height,
            headerHeight: props2.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) || 0
          };
          doLayout();
        }
      };
      const tableSize = useFormSize();
      const bodyWidth = computed(() => {
        const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout2;
        return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : "";
      });
      const tableLayout = computed(() => {
        if (props2.maxHeight)
          return "fixed";
        return props2.tableLayout;
      });
      const emptyBlockStyle = computed(() => {
        if (props2.data && props2.data.length)
          return null;
        let height = "100%";
        if (props2.height && bodyScrollHeight.value) {
          height = `${bodyScrollHeight.value}px`;
        }
        const width = tableWidth.value;
        return {
          width: width ? `${width}px` : "",
          height
        };
      });
      const scrollbarStyle = computed(() => {
        if (props2.height) {
          return {
            height: "100%"
          };
        }
        if (props2.maxHeight) {
          if (!Number.isNaN(Number(props2.maxHeight))) {
            return {
              maxHeight: `${props2.maxHeight - headerScrollHeight.value - footerScrollHeight.value}px`
            };
          } else {
            return {
              maxHeight: `calc(${props2.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)`
            };
          }
        }
        return {};
      });
      const handleFixedMousewheel = (event, data) => {
        const bodyWrapper = table.refs.bodyWrapper;
        if (Math.abs(data.spinY) > 0) {
          const currentScrollTop = bodyWrapper.scrollTop;
          if (data.pixelY < 0 && currentScrollTop !== 0) {
            event.preventDefault();
          }
          if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
            event.preventDefault();
          }
          bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
        } else {
          bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
        }
      };
      return {
        isHidden: isHidden2,
        renderExpanded,
        setDragVisible,
        isGroup,
        handleMouseLeave,
        handleHeaderFooterMousewheel,
        tableSize,
        emptyBlockStyle,
        handleFixedMousewheel,
        resizeProxyVisible,
        bodyWidth,
        resizeState,
        doLayout,
        tableBodyStyles,
        tableLayout,
        scrollbarViewStyle,
        scrollbarStyle
      };
    }
    function useKeyRender(table) {
      const observer = ref();
      const initWatchDom = () => {
        const el = table.vnode.el;
        const columnsWrapper = el.querySelector(".hidden-columns");
        const config = { childList: true, subtree: true };
        const updateOrderFns = table.store.states.updateOrderFns;
        observer.value = new MutationObserver(() => {
          updateOrderFns.forEach((fn2) => fn2());
        });
        observer.value.observe(columnsWrapper, config);
      };
      onMounted(() => {
        initWatchDom();
      });
      onUnmounted(() => {
        var _a2;
        (_a2 = observer.value) == null ? void 0 : _a2.disconnect();
      });
    }
    var defaultProps$2 = {
      data: {
        type: Array,
        default: () => []
      },
      size: useSizeProp,
      width: [String, Number],
      height: [String, Number],
      maxHeight: [String, Number],
      fit: {
        type: Boolean,
        default: true
      },
      stripe: Boolean,
      border: Boolean,
      rowKey: [String, Function],
      showHeader: {
        type: Boolean,
        default: true
      },
      showSummary: Boolean,
      sumText: String,
      summaryMethod: Function,
      rowClassName: [String, Function],
      rowStyle: [Object, Function],
      cellClassName: [String, Function],
      cellStyle: [Object, Function],
      headerRowClassName: [String, Function],
      headerRowStyle: [Object, Function],
      headerCellClassName: [String, Function],
      headerCellStyle: [Object, Function],
      highlightCurrentRow: Boolean,
      currentRowKey: [String, Number],
      emptyText: String,
      expandRowKeys: Array,
      defaultExpandAll: Boolean,
      defaultSort: Object,
      tooltipEffect: String,
      tooltipOptions: Object,
      spanMethod: Function,
      selectOnIndeterminate: {
        type: Boolean,
        default: true
      },
      indent: {
        type: Number,
        default: 16
      },
      treeProps: {
        type: Object,
        default: () => {
          return {
            hasChildren: "hasChildren",
            children: "children",
            checkStrictly: false
          };
        }
      },
      lazy: Boolean,
      load: Function,
      style: {
        type: Object,
        default: () => ({})
      },
      className: {
        type: String,
        default: ""
      },
      tableLayout: {
        type: String,
        default: "fixed"
      },
      scrollbarAlwaysOn: Boolean,
      flexible: Boolean,
      showOverflowTooltip: [Boolean, Object],
      tooltipFormatter: Function,
      appendFilterPanelTo: String,
      scrollbarTabindex: {
        type: [Number, String],
        default: void 0
      },
      allowDragLastColumn: {
        type: Boolean,
        default: true
      },
      preserveExpandedContent: {
        type: Boolean,
        default: false
      }
    };
    function hColgroup(props2) {
      const isAuto2 = props2.tableLayout === "auto";
      let columns2 = props2.columns || [];
      if (isAuto2) {
        if (columns2.every(({ width }) => isUndefined$1(width))) {
          columns2 = [];
        }
      }
      const getPropsData = (column) => {
        const propsData = {
          key: `${props2.tableLayout}_${column.id}`,
          style: {},
          name: void 0
        };
        if (isAuto2) {
          propsData.style = {
            width: `${column.width}px`
          };
        } else {
          propsData.name = column.id;
        }
        return propsData;
      };
      return h$1("colgroup", {}, columns2.map((column) => h$1("col", getPropsData(column))));
    }
    hColgroup.props = ["columns", "tableLayout"];
    const useScrollbar$1 = () => {
      const scrollBarRef = ref();
      const scrollTo = (options, yCoord) => {
        const scrollbar = scrollBarRef.value;
        if (scrollbar) {
          scrollbar.scrollTo(options, yCoord);
        }
      };
      const setScrollPosition = (position2, offset2) => {
        const scrollbar = scrollBarRef.value;
        if (scrollbar && isNumber$2(offset2) && ["Top", "Left"].includes(position2)) {
          scrollbar[`setScroll${position2}`](offset2);
        }
      };
      const setScrollTop = (top) => setScrollPosition("Top", top);
      const setScrollLeft = (left) => setScrollPosition("Left", left);
      return {
        scrollBarRef,
        scrollTo,
        setScrollTop,
        setScrollLeft
      };
    };
    var v = false, o, f$1, s, u$1, d, N, l, p, m$1, w, D, x, E$1, M, F$1;
    function a$1() {
      if (!v) {
        v = true;
        var e2 = navigator.userAgent, n = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e2), i2 = /(Mac OS X)|(Windows)|(Linux)/.exec(e2);
        if (x = /\b(iPhone|iP[ao]d)/.exec(e2), E$1 = /\b(iP[ao]d)/.exec(e2), w = /Android/i.exec(e2), M = /FBAN\/\w+;/i.exec(e2), F$1 = /Mobile/i.exec(e2), D = !!/Win64/.exec(e2), n) {
          o = n[1] ? parseFloat(n[1]) : n[5] ? parseFloat(n[5]) : NaN, o && document && document.documentMode && (o = document.documentMode);
          var r = /(?:Trident\/(\d+.\d+))/.exec(e2);
          N = r ? parseFloat(r[1]) + 4 : o, f$1 = n[2] ? parseFloat(n[2]) : NaN, s = n[3] ? parseFloat(n[3]) : NaN, u$1 = n[4] ? parseFloat(n[4]) : NaN, u$1 ? (n = /(?:Chrome\/(\d+\.\d+))/.exec(e2), d = n && n[1] ? parseFloat(n[1]) : NaN) : d = NaN;
        } else o = f$1 = s = d = u$1 = NaN;
        if (i2) {
          if (i2[1]) {
            var t = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e2);
            l = t ? parseFloat(t[1].replace("_", ".")) : true;
          } else l = false;
          p = !!i2[2], m$1 = !!i2[3];
        } else l = p = m$1 = false;
      }
    }
    var _ = { ie: function() {
      return a$1() || o;
    }, ieCompatibilityMode: function() {
      return a$1() || N > o;
    }, ie64: function() {
      return _.ie() && D;
    }, firefox: function() {
      return a$1() || f$1;
    }, opera: function() {
      return a$1() || s;
    }, webkit: function() {
      return a$1() || u$1;
    }, safari: function() {
      return _.webkit();
    }, chrome: function() {
      return a$1() || d;
    }, windows: function() {
      return a$1() || p;
    }, osx: function() {
      return a$1() || l;
    }, linux: function() {
      return a$1() || m$1;
    }, iphone: function() {
      return a$1() || x;
    }, mobile: function() {
      return a$1() || x || E$1 || w || F$1;
    }, nativeApp: function() {
      return a$1() || M;
    }, android: function() {
      return a$1() || w;
    }, ipad: function() {
      return a$1() || E$1;
    } }, A$1 = _;
    var c = !!(typeof window < "u" && window.document && window.document.createElement), U$1 = { canUseDOM: c }, h = U$1;
    var X;
    h.canUseDOM && (X = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== true);
    function S(e2, n) {
      if (!h.canUseDOM || n && !("addEventListener" in document)) return false;
      var i2 = "on" + e2, r = i2 in document;
      if (!r) {
        var t = document.createElement("div");
        t.setAttribute(i2, "return;"), r = typeof t[i2] == "function";
      }
      return !r && X && e2 === "wheel" && (r = document.implementation.hasFeature("Events.wheel", "3.0")), r;
    }
    var b = S;
    var O = 10, I = 40, P = 800;
    function T$1(e2) {
      var n = 0, i2 = 0, r = 0, t = 0;
      return "detail" in e2 && (i2 = e2.detail), "wheelDelta" in e2 && (i2 = -e2.wheelDelta / 120), "wheelDeltaY" in e2 && (i2 = -e2.wheelDeltaY / 120), "wheelDeltaX" in e2 && (n = -e2.wheelDeltaX / 120), "axis" in e2 && e2.axis === e2.HORIZONTAL_AXIS && (n = i2, i2 = 0), r = n * O, t = i2 * O, "deltaY" in e2 && (t = e2.deltaY), "deltaX" in e2 && (r = e2.deltaX), (r || t) && e2.deltaMode && (e2.deltaMode == 1 ? (r *= I, t *= I) : (r *= P, t *= P)), r && !n && (n = r < 1 ? -1 : 1), t && !i2 && (i2 = t < 1 ? -1 : 1), { spinX: n, spinY: i2, pixelX: r, pixelY: t };
    }
    T$1.getEventType = function() {
      return A$1.firefox() ? "DOMMouseScroll" : b("wheel") ? "wheel" : "mousewheel";
    };
    var Y = T$1;
    /**
    * Checks if an event is supported in the current execution environment.
    *
    * NOTE: This will not work correctly for non-generic events such as `change`,
    * `reset`, `load`, `error`, and `select`.
    *
    * Borrows from Modernizr.
    *
    * @param {string} eventNameSuffix Event name, e.g. "click".
    * @param {?boolean} capture Check if the capture phase is supported.
    * @return {boolean} True if the event is supported.
    * @internal
    * @license Modernizr 3.0.0pre (Custom Build) | MIT
    */
    const mousewheel = function(element, callback) {
      if (element && element.addEventListener) {
        const fn2 = function(event) {
          const normalized = Y(event);
          callback && Reflect.apply(callback, this, [event, normalized]);
        };
        element.addEventListener("wheel", fn2, { passive: true });
      }
    };
    const Mousewheel = {
      beforeMount(el, binding) {
        mousewheel(el, binding.value);
      }
    };
    let tableIdSeed = 1;
    const _sfc_main$I = /* @__PURE__ */ defineComponent({
      name: "ElTable",
      directives: {
        Mousewheel
      },
      components: {
        TableHeader,
        TableBody,
        TableFooter,
        ElScrollbar,
        hColgroup
      },
      props: defaultProps$2,
      emits: [
        "select",
        "select-all",
        "selection-change",
        "cell-mouse-enter",
        "cell-mouse-leave",
        "cell-contextmenu",
        "cell-click",
        "cell-dblclick",
        "row-click",
        "row-contextmenu",
        "row-dblclick",
        "header-click",
        "header-contextmenu",
        "sort-change",
        "filter-change",
        "current-change",
        "header-dragend",
        "expand-change",
        "scroll"
      ],
      setup(props2) {
        const { t } = useLocale();
        const ns = useNamespace("table");
        const table = getCurrentInstance();
        provide(TABLE_INJECTION_KEY, table);
        const store2 = createStore$1(table, props2);
        table.store = store2;
        const layout2 = new TableLayout({
          store: table.store,
          table,
          fit: props2.fit,
          showHeader: props2.showHeader
        });
        table.layout = layout2;
        const isEmpty2 = computed(() => (store2.states.data.value || []).length === 0);
        const {
          setCurrentRow,
          getSelectionRows,
          toggleRowSelection,
          clearSelection,
          clearFilter,
          toggleAllSelection,
          toggleRowExpansion,
          clearSort,
          sort: sort2,
          updateKeyChildren
        } = useUtils(store2);
        const {
          isHidden: isHidden2,
          renderExpanded,
          setDragVisible,
          isGroup,
          handleMouseLeave,
          handleHeaderFooterMousewheel,
          tableSize,
          emptyBlockStyle,
          handleFixedMousewheel,
          resizeProxyVisible,
          bodyWidth,
          resizeState,
          doLayout,
          tableBodyStyles,
          tableLayout,
          scrollbarViewStyle,
          scrollbarStyle
        } = useStyle(props2, layout2, store2, table);
        const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } = useScrollbar$1();
        const debouncedUpdateLayout = debounce(doLayout, 50);
        const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;
        table.tableId = tableId;
        table.state = {
          isGroup,
          resizeState,
          doLayout,
          debouncedUpdateLayout
        };
        const computedSumText = computed(() => {
          var _a2;
          return (_a2 = props2.sumText) != null ? _a2 : t("el.table.sumText");
        });
        const computedEmptyText = computed(() => {
          var _a2;
          return (_a2 = props2.emptyText) != null ? _a2 : t("el.table.emptyText");
        });
        const columns2 = computed(() => {
          return convertToRows(store2.states.originColumns.value)[0];
        });
        useKeyRender(table);
        onBeforeUnmount(() => {
          debouncedUpdateLayout.cancel();
        });
        return {
          ns,
          layout: layout2,
          store: store2,
          columns: columns2,
          handleHeaderFooterMousewheel,
          handleMouseLeave,
          tableId,
          tableSize,
          isHidden: isHidden2,
          isEmpty: isEmpty2,
          renderExpanded,
          resizeProxyVisible,
          resizeState,
          isGroup,
          bodyWidth,
          tableBodyStyles,
          emptyBlockStyle,
          debouncedUpdateLayout,
          handleFixedMousewheel,
          setCurrentRow,
          getSelectionRows,
          toggleRowSelection,
          clearSelection,
          clearFilter,
          toggleAllSelection,
          toggleRowExpansion,
          clearSort,
          doLayout,
          sort: sort2,
          updateKeyChildren,
          t,
          setDragVisible,
          context: table,
          computedSumText,
          computedEmptyText,
          tableLayout,
          scrollbarViewStyle,
          scrollbarStyle,
          scrollBarRef,
          scrollTo,
          setScrollLeft,
          setScrollTop,
          allowDragLastColumn: props2.allowDragLastColumn
        };
      }
    });
    function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_hColgroup = resolveComponent("hColgroup");
      const _component_table_header = resolveComponent("table-header");
      const _component_table_body = resolveComponent("table-body");
      const _component_table_footer = resolveComponent("table-footer");
      const _component_el_scrollbar = resolveComponent("el-scrollbar");
      const _directive_mousewheel = resolveDirective("mousewheel");
      return openBlock(), createElementBlock("div", {
        ref: "tableWrapper",
        class: normalizeClass([
          {
            [_ctx.ns.m("fit")]: _ctx.fit,
            [_ctx.ns.m("striped")]: _ctx.stripe,
            [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
            [_ctx.ns.m("hidden")]: _ctx.isHidden,
            [_ctx.ns.m("group")]: _ctx.isGroup,
            [_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
            [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
            [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
            [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
            [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
            "has-footer": _ctx.showSummary
          },
          _ctx.ns.m(_ctx.tableSize),
          _ctx.className,
          _ctx.ns.b(),
          _ctx.ns.m(`layout-${_ctx.tableLayout}`)
        ]),
        style: normalizeStyle$1(_ctx.style),
        "data-prefix": _ctx.ns.namespace.value,
        onMouseleave: _ctx.handleMouseLeave
      }, [
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.e("inner-wrapper"))
        }, [
          createBaseVNode("div", {
            ref: "hiddenColumns",
            class: "hidden-columns"
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 512),
          _ctx.showHeader && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
            key: 0,
            ref: "headerWrapper",
            class: normalizeClass(_ctx.ns.e("header-wrapper"))
          }, [
            createBaseVNode("table", {
              ref: "tableHeader",
              class: normalizeClass(_ctx.ns.e("header")),
              style: normalizeStyle$1(_ctx.tableBodyStyles),
              border: "0",
              cellpadding: "0",
              cellspacing: "0"
            }, [
              createVNode$1(_component_hColgroup, {
                columns: _ctx.store.states.columns.value,
                "table-layout": _ctx.tableLayout
              }, null, 8, ["columns", "table-layout"]),
              createVNode$1(_component_table_header, {
                ref: "tableHeaderRef",
                border: _ctx.border,
                "default-sort": _ctx.defaultSort,
                store: _ctx.store,
                "append-filter-panel-to": _ctx.appendFilterPanelTo,
                "allow-drag-last-column": _ctx.allowDragLastColumn,
                onSetDragVisible: _ctx.setDragVisible
              }, null, 8, ["border", "default-sort", "store", "append-filter-panel-to", "allow-drag-last-column", "onSetDragVisible"])
            ], 6)
          ], 2)), [
            [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
          ]) : createCommentVNode("v-if", true),
          createBaseVNode("div", {
            ref: "bodyWrapper",
            class: normalizeClass(_ctx.ns.e("body-wrapper"))
          }, [
            createVNode$1(_component_el_scrollbar, {
              ref: "scrollBarRef",
              "view-style": _ctx.scrollbarViewStyle,
              "wrap-style": _ctx.scrollbarStyle,
              always: _ctx.scrollbarAlwaysOn,
              tabindex: _ctx.scrollbarTabindex,
              onScroll: ($event) => _ctx.$emit("scroll", $event)
            }, {
              default: withCtx(() => [
                createBaseVNode("table", {
                  ref: "tableBody",
                  class: normalizeClass(_ctx.ns.e("body")),
                  cellspacing: "0",
                  cellpadding: "0",
                  border: "0",
                  style: normalizeStyle$1({
                    width: _ctx.bodyWidth,
                    tableLayout: _ctx.tableLayout
                  })
                }, [
                  createVNode$1(_component_hColgroup, {
                    columns: _ctx.store.states.columns.value,
                    "table-layout": _ctx.tableLayout
                  }, null, 8, ["columns", "table-layout"]),
                  _ctx.showHeader && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_header, {
                    key: 0,
                    ref: "tableHeaderRef",
                    class: normalizeClass(_ctx.ns.e("body-header")),
                    border: _ctx.border,
                    "default-sort": _ctx.defaultSort,
                    store: _ctx.store,
                    "append-filter-panel-to": _ctx.appendFilterPanelTo,
                    onSetDragVisible: _ctx.setDragVisible
                  }, null, 8, ["class", "border", "default-sort", "store", "append-filter-panel-to", "onSetDragVisible"])) : createCommentVNode("v-if", true),
                  createVNode$1(_component_table_body, {
                    context: _ctx.context,
                    highlight: _ctx.highlightCurrentRow,
                    "row-class-name": _ctx.rowClassName,
                    "tooltip-effect": _ctx.tooltipEffect,
                    "tooltip-options": _ctx.tooltipOptions,
                    "row-style": _ctx.rowStyle,
                    store: _ctx.store,
                    stripe: _ctx.stripe
                  }, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "tooltip-options", "row-style", "store", "stripe"]),
                  _ctx.showSummary && _ctx.tableLayout === "auto" ? (openBlock(), createBlock(_component_table_footer, {
                    key: 1,
                    class: normalizeClass(_ctx.ns.e("body-footer")),
                    border: _ctx.border,
                    "default-sort": _ctx.defaultSort,
                    store: _ctx.store,
                    "sum-text": _ctx.computedSumText,
                    "summary-method": _ctx.summaryMethod
                  }, null, 8, ["class", "border", "default-sort", "store", "sum-text", "summary-method"])) : createCommentVNode("v-if", true)
                ], 6),
                _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
                  key: 0,
                  ref: "emptyBlock",
                  style: normalizeStyle$1(_ctx.emptyBlockStyle),
                  class: normalizeClass(_ctx.ns.e("empty-block"))
                }, [
                  createBaseVNode("span", {
                    class: normalizeClass(_ctx.ns.e("empty-text"))
                  }, [
                    renderSlot(_ctx.$slots, "empty", {}, () => [
                      createTextVNode(toDisplayString(_ctx.computedEmptyText), 1)
                    ])
                  ], 2)
                ], 6)) : createCommentVNode("v-if", true),
                _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
                  key: 1,
                  ref: "appendWrapper",
                  class: normalizeClass(_ctx.ns.e("append-wrapper"))
                }, [
                  renderSlot(_ctx.$slots, "append")
                ], 2)) : createCommentVNode("v-if", true)
              ]),
              _: 3
            }, 8, ["view-style", "wrap-style", "always", "tabindex", "onScroll"])
          ], 2),
          _ctx.showSummary && _ctx.tableLayout === "fixed" ? withDirectives((openBlock(), createElementBlock("div", {
            key: 1,
            ref: "footerWrapper",
            class: normalizeClass(_ctx.ns.e("footer-wrapper"))
          }, [
            createBaseVNode("table", {
              class: normalizeClass(_ctx.ns.e("footer")),
              cellspacing: "0",
              cellpadding: "0",
              border: "0",
              style: normalizeStyle$1(_ctx.tableBodyStyles)
            }, [
              createVNode$1(_component_hColgroup, {
                columns: _ctx.store.states.columns.value,
                "table-layout": _ctx.tableLayout
              }, null, 8, ["columns", "table-layout"]),
              createVNode$1(_component_table_footer, {
                border: _ctx.border,
                "default-sort": _ctx.defaultSort,
                store: _ctx.store,
                "sum-text": _ctx.computedSumText,
                "summary-method": _ctx.summaryMethod
              }, null, 8, ["border", "default-sort", "store", "sum-text", "summary-method"])
            ], 6)
          ], 2)), [
            [vShow, !_ctx.isEmpty],
            [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
          ]) : createCommentVNode("v-if", true),
          _ctx.border || _ctx.isGroup ? (openBlock(), createElementBlock("div", {
            key: 2,
            class: normalizeClass(_ctx.ns.e("border-left-patch"))
          }, null, 2)) : createCommentVNode("v-if", true)
        ], 2),
        withDirectives(createBaseVNode("div", {
          ref: "resizeProxy",
          class: normalizeClass(_ctx.ns.e("column-resize-proxy"))
        }, null, 2), [
          [vShow, _ctx.resizeProxyVisible]
        ])
      ], 46, ["data-prefix", "onMouseleave"]);
    }
    var Table$1 = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$9], ["__file", "table.vue"]]);
    const defaultClassNames = {
      selection: "table-column--selection",
      expand: "table__expand-column"
    };
    const cellStarts = {
      default: {
        order: ""
      },
      selection: {
        width: 48,
        minWidth: 48,
        realWidth: 48,
        order: ""
      },
      expand: {
        width: 48,
        minWidth: 48,
        realWidth: 48,
        order: ""
      },
      index: {
        width: 48,
        minWidth: 48,
        realWidth: 48,
        order: ""
      }
    };
    const getDefaultClassName = (type) => {
      return defaultClassNames[type] || "";
    };
    const cellForced = {
      selection: {
        renderHeader({ store: store2, column }) {
          function isDisabled() {
            return store2.states.data.value && store2.states.data.value.length === 0;
          }
          return h$1(ElCheckbox, {
            disabled: isDisabled(),
            size: store2.states.tableSize.value,
            indeterminate: store2.states.selection.value.length > 0 && !store2.states.isAllSelected.value,
            "onUpdate:modelValue": store2.toggleAllSelection,
            modelValue: store2.states.isAllSelected.value,
            ariaLabel: column.label
          });
        },
        renderCell({
          row,
          column,
          store: store2,
          $index
        }) {
          return h$1(ElCheckbox, {
            disabled: column.selectable ? !column.selectable.call(null, row, $index) : false,
            size: store2.states.tableSize.value,
            onChange: () => {
              store2.commit("rowSelectedChanged", row);
            },
            onClick: (event) => event.stopPropagation(),
            modelValue: store2.isSelected(row),
            ariaLabel: column.label
          });
        },
        sortable: false,
        resizable: false
      },
      index: {
        renderHeader({ column }) {
          return column.label || "#";
        },
        renderCell({
          column,
          $index
        }) {
          let i2 = $index + 1;
          const index = column.index;
          if (isNumber$2(index)) {
            i2 = $index + index;
          } else if (isFunction$4(index)) {
            i2 = index($index);
          }
          return h$1("div", {}, [i2]);
        },
        sortable: false
      },
      expand: {
        renderHeader({ column }) {
          return column.label || "";
        },
        renderCell({
          row,
          store: store2,
          expanded
        }) {
          const { ns } = store2;
          const classes = [ns.e("expand-icon")];
          if (expanded) {
            classes.push(ns.em("expand-icon", "expanded"));
          }
          const callback = function(e2) {
            e2.stopPropagation();
            store2.toggleRowExpansion(row);
          };
          return h$1("div", {
            class: classes,
            onClick: callback
          }, {
            default: () => {
              return [
                h$1(ElIcon, null, {
                  default: () => {
                    return [h$1(arrow_right_default)];
                  }
                })
              ];
            }
          });
        },
        sortable: false,
        resizable: false
      }
    };
    function defaultRenderCell({
      row,
      column,
      $index
    }) {
      var _a2;
      const property2 = column.property;
      const value = property2 && getProp(row, property2).value;
      if (column && column.formatter) {
        return column.formatter(row, column, value, $index);
      }
      return ((_a2 = value == null ? void 0 : value.toString) == null ? void 0 : _a2.call(value)) || "";
    }
    function treeCellPrefix({
      row,
      treeNode,
      store: store2
    }, createPlaceholder = false) {
      const { ns } = store2;
      if (!treeNode) {
        if (createPlaceholder) {
          return [
            h$1("span", {
              class: ns.e("placeholder")
            })
          ];
        }
        return null;
      }
      const ele = [];
      const callback = function(e2) {
        e2.stopPropagation();
        if (treeNode.loading) {
          return;
        }
        store2.loadOrToggle(row);
      };
      if (treeNode.indent) {
        ele.push(h$1("span", {
          class: ns.e("indent"),
          style: { "padding-left": `${treeNode.indent}px` }
        }));
      }
      if (isBoolean$1(treeNode.expanded) && !treeNode.noLazyChildren) {
        const expandClasses = [
          ns.e("expand-icon"),
          treeNode.expanded ? ns.em("expand-icon", "expanded") : ""
        ];
        let icon = arrow_right_default;
        if (treeNode.loading) {
          icon = loading_default;
        }
        ele.push(h$1("div", {
          class: expandClasses,
          onClick: callback
        }, {
          default: () => {
            return [
              h$1(ElIcon, { class: { [ns.is("loading")]: treeNode.loading } }, {
                default: () => [h$1(icon)]
              })
            ];
          }
        }));
      } else {
        ele.push(h$1("span", {
          class: ns.e("placeholder")
        }));
      }
      return ele;
    }
    function getAllAliases(props2, aliases) {
      return props2.reduce((prev, cur) => {
        prev[cur] = cur;
        return prev;
      }, aliases);
    }
    function useWatcher(owner, props_) {
      const instance = getCurrentInstance();
      const registerComplexWatchers = () => {
        const props2 = ["fixed"];
        const aliases = {
          realWidth: "width",
          realMinWidth: "minWidth"
        };
        const allAliases = getAllAliases(props2, aliases);
        Object.keys(allAliases).forEach((key) => {
          const columnKey = aliases[key];
          if (hasOwn$1(props_, columnKey)) {
            watch(() => props_[columnKey], (newVal) => {
              let value = newVal;
              if (columnKey === "width" && key === "realWidth") {
                value = parseWidth(newVal);
              }
              if (columnKey === "minWidth" && key === "realMinWidth") {
                value = parseMinWidth(newVal);
              }
              instance.columnConfig.value[columnKey] = value;
              instance.columnConfig.value[key] = value;
              const updateColumns = columnKey === "fixed";
              owner.value.store.scheduleLayout(updateColumns);
            });
          }
        });
      };
      const registerNormalWatchers = () => {
        const props2 = [
          "label",
          "filters",
          "filterMultiple",
          "filteredValue",
          "sortable",
          "index",
          "formatter",
          "className",
          "labelClassName",
          "filterClassName",
          "showOverflowTooltip",
          "tooltipFormatter"
        ];
        const aliases = {
          property: "prop",
          align: "realAlign",
          headerAlign: "realHeaderAlign"
        };
        const allAliases = getAllAliases(props2, aliases);
        Object.keys(allAliases).forEach((key) => {
          const columnKey = aliases[key];
          if (hasOwn$1(props_, columnKey)) {
            watch(() => props_[columnKey], (newVal) => {
              instance.columnConfig.value[key] = newVal;
            });
          }
        });
      };
      return {
        registerComplexWatchers,
        registerNormalWatchers
      };
    }
    function useRender(props2, slots, owner) {
      const instance = getCurrentInstance();
      const columnId = ref("");
      const isSubColumn = ref(false);
      const realAlign = ref();
      const realHeaderAlign = ref();
      const ns = useNamespace("table");
      watchEffect(() => {
        realAlign.value = props2.align ? `is-${props2.align}` : null;
        realAlign.value;
      });
      watchEffect(() => {
        realHeaderAlign.value = props2.headerAlign ? `is-${props2.headerAlign}` : realAlign.value;
        realHeaderAlign.value;
      });
      const columnOrTableParent = computed(() => {
        let parent2 = instance.vnode.vParent || instance.parent;
        while (parent2 && !parent2.tableId && !parent2.columnId) {
          parent2 = parent2.vnode.vParent || parent2.parent;
        }
        return parent2;
      });
      const hasTreeColumn = computed(() => {
        const { store: store2 } = instance.parent;
        if (!store2)
          return false;
        const { treeData } = store2.states;
        const treeDataValue = treeData.value;
        return treeDataValue && Object.keys(treeDataValue).length > 0;
      });
      const realWidth = ref(parseWidth(props2.width));
      const realMinWidth = ref(parseMinWidth(props2.minWidth));
      const setColumnWidth = (column) => {
        if (realWidth.value)
          column.width = realWidth.value;
        if (realMinWidth.value) {
          column.minWidth = realMinWidth.value;
        }
        if (!realWidth.value && realMinWidth.value) {
          column.width = void 0;
        }
        if (!column.minWidth) {
          column.minWidth = 80;
        }
        column.realWidth = Number(isUndefined$1(column.width) ? column.minWidth : column.width);
        return column;
      };
      const setColumnForcedProps = (column) => {
        const type = column.type;
        const source = cellForced[type] || {};
        Object.keys(source).forEach((prop) => {
          const value = source[prop];
          if (prop !== "className" && !isUndefined$1(value)) {
            column[prop] = value;
          }
        });
        const className = getDefaultClassName(type);
        if (className) {
          const forceClass = `${unref(ns.namespace)}-${className}`;
          column.className = column.className ? `${column.className} ${forceClass}` : forceClass;
        }
        return column;
      };
      const checkSubColumn = (children) => {
        if (isArray$5(children)) {
          children.forEach((child) => check(child));
        } else {
          check(children);
        }
        function check(item) {
          var _a2;
          if (((_a2 = item == null ? void 0 : item.type) == null ? void 0 : _a2.name) === "ElTableColumn") {
            item.vParent = instance;
          }
        }
      };
      const setColumnRenders = (column) => {
        if (props2.renderHeader) ;
        else if (column.type !== "selection") {
          column.renderHeader = (scope) => {
            instance.columnConfig.value["label"];
            return renderSlot(slots, "header", scope, () => [column.label]);
          };
        }
        if (slots["filter-icon"]) {
          column.renderFilterIcon = (scope) => {
            return renderSlot(slots, "filter-icon", scope);
          };
        }
        let originRenderCell = column.renderCell;
        if (column.type === "expand") {
          column.renderCell = (data) => h$1("div", {
            class: "cell"
          }, [originRenderCell(data)]);
          owner.value.renderExpanded = (data) => {
            return slots.default ? slots.default(data) : slots.default;
          };
        } else {
          originRenderCell = originRenderCell || defaultRenderCell;
          column.renderCell = (data) => {
            let children = null;
            if (slots.default) {
              const vnodes = slots.default(data);
              children = vnodes.some((v4) => v4.type !== Comment) ? vnodes : originRenderCell(data);
            } else {
              children = originRenderCell(data);
            }
            const { columns: columns2 } = owner.value.store.states;
            const firstUserColumnIndex = columns2.value.findIndex((item) => item.type === "default");
            const shouldCreatePlaceholder = hasTreeColumn.value && data.cellIndex === firstUserColumnIndex;
            const prefix = treeCellPrefix(data, shouldCreatePlaceholder);
            const props22 = {
              class: "cell",
              style: {}
            };
            if (column.showOverflowTooltip) {
              props22.class = `${props22.class} ${unref(ns.namespace)}-tooltip`;
              props22.style = {
                width: `${(data.column.realWidth || Number(data.column.width)) - 1}px`
              };
            }
            checkSubColumn(children);
            return h$1("div", props22, [prefix, children]);
          };
        }
        return column;
      };
      const getPropsData = (...propsKey) => {
        return propsKey.reduce((prev, cur) => {
          if (isArray$5(cur)) {
            cur.forEach((key) => {
              prev[key] = props2[key];
            });
          }
          return prev;
        }, {});
      };
      const getColumnElIndex = (children, child) => {
        return Array.prototype.indexOf.call(children, child);
      };
      const updateColumnOrder = () => {
        owner.value.store.commit("updateColumnOrder", instance.columnConfig.value);
      };
      return {
        columnId,
        realAlign,
        isSubColumn,
        realHeaderAlign,
        columnOrTableParent,
        setColumnWidth,
        setColumnForcedProps,
        setColumnRenders,
        getPropsData,
        getColumnElIndex,
        updateColumnOrder
      };
    }
    var defaultProps$1 = {
      type: {
        type: String,
        default: "default"
      },
      label: String,
      className: String,
      labelClassName: String,
      property: String,
      prop: String,
      width: {
        type: [String, Number],
        default: ""
      },
      minWidth: {
        type: [String, Number],
        default: ""
      },
      renderHeader: Function,
      sortable: {
        type: [Boolean, String],
        default: false
      },
      sortMethod: Function,
      sortBy: [String, Function, Array],
      resizable: {
        type: Boolean,
        default: true
      },
      columnKey: String,
      align: String,
      headerAlign: String,
      showOverflowTooltip: {
        type: [Boolean, Object],
        default: void 0
      },
      tooltipFormatter: Function,
      fixed: [Boolean, String],
      formatter: Function,
      selectable: Function,
      reserveSelection: Boolean,
      filterMethod: Function,
      filteredValue: Array,
      filters: Array,
      filterPlacement: String,
      filterMultiple: {
        type: Boolean,
        default: true
      },
      filterClassName: String,
      index: [Number, Function],
      sortOrders: {
        type: Array,
        default: () => {
          return ["ascending", "descending", null];
        },
        validator: (val) => {
          return val.every((order) => ["ascending", "descending", null].includes(order));
        }
      }
    };
    let columnIdSeed = 1;
    var ElTableColumn$1 = /* @__PURE__ */ defineComponent({
      name: "ElTableColumn",
      components: {
        ElCheckbox
      },
      props: defaultProps$1,
      setup(props2, { slots }) {
        const instance = getCurrentInstance();
        const columnConfig = ref({});
        const owner = computed(() => {
          let parent22 = instance.parent;
          while (parent22 && !parent22.tableId) {
            parent22 = parent22.parent;
          }
          return parent22;
        });
        const { registerNormalWatchers, registerComplexWatchers } = useWatcher(owner, props2);
        const {
          columnId,
          isSubColumn,
          realHeaderAlign,
          columnOrTableParent,
          setColumnWidth,
          setColumnForcedProps,
          setColumnRenders,
          getPropsData,
          getColumnElIndex,
          realAlign,
          updateColumnOrder
        } = useRender(props2, slots, owner);
        const parent2 = columnOrTableParent.value;
        columnId.value = `${parent2.tableId || parent2.columnId}_column_${columnIdSeed++}`;
        onBeforeMount(() => {
          isSubColumn.value = owner.value !== parent2;
          const type = props2.type || "default";
          const sortable = props2.sortable === "" ? true : props2.sortable;
          const showOverflowTooltip = type === "selection" ? false : isUndefined$1(props2.showOverflowTooltip) ? parent2.props.showOverflowTooltip : props2.showOverflowTooltip;
          const tooltipFormatter = isUndefined$1(props2.tooltipFormatter) ? parent2.props.tooltipFormatter : props2.tooltipFormatter;
          const defaults2 = {
            ...cellStarts[type],
            id: columnId.value,
            type,
            property: props2.prop || props2.property,
            align: realAlign,
            headerAlign: realHeaderAlign,
            showOverflowTooltip,
            tooltipFormatter,
            filterable: props2.filters || props2.filterMethod,
            filteredValue: [],
            filterPlacement: "",
            filterClassName: "",
            isColumnGroup: false,
            isSubColumn: false,
            filterOpened: false,
            sortable,
            index: props2.index,
            rawColumnKey: instance.vnode.key
          };
          const basicProps = [
            "columnKey",
            "label",
            "className",
            "labelClassName",
            "type",
            "renderHeader",
            "formatter",
            "fixed",
            "resizable"
          ];
          const sortProps = ["sortMethod", "sortBy", "sortOrders"];
          const selectProps = ["selectable", "reserveSelection"];
          const filterProps = [
            "filterMethod",
            "filters",
            "filterMultiple",
            "filterOpened",
            "filteredValue",
            "filterPlacement",
            "filterClassName"
          ];
          let column = getPropsData(basicProps, sortProps, selectProps, filterProps);
          column = mergeOptions(defaults2, column);
          const chains = compose(setColumnRenders, setColumnWidth, setColumnForcedProps);
          column = chains(column);
          columnConfig.value = column;
          registerNormalWatchers();
          registerComplexWatchers();
        });
        onMounted(() => {
          var _a2;
          const parent22 = columnOrTableParent.value;
          const children = isSubColumn.value ? parent22.vnode.el.children : (_a2 = parent22.refs.hiddenColumns) == null ? void 0 : _a2.children;
          const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el);
          columnConfig.value.getColumnIndex = getColumnIndex;
          const columnIndex = getColumnIndex();
          columnIndex > -1 && owner.value.store.commit("insertColumn", columnConfig.value, isSubColumn.value ? parent22.columnConfig.value : null, updateColumnOrder);
        });
        onBeforeUnmount(() => {
          const getColumnIndex = columnConfig.value.getColumnIndex;
          const columnIndex = getColumnIndex ? getColumnIndex() : -1;
          columnIndex > -1 && owner.value.store.commit("removeColumn", columnConfig.value, isSubColumn.value ? parent2.columnConfig.value : null, updateColumnOrder);
        });
        instance.columnId = columnId.value;
        instance.columnConfig = columnConfig;
        return;
      },
      render() {
        var _a2, _b2, _c2;
        try {
          const renderDefault = (_b2 = (_a2 = this.$slots).default) == null ? void 0 : _b2.call(_a2, {
            row: {},
            column: {},
            $index: -1
          });
          const children = [];
          if (isArray$5(renderDefault)) {
            for (const childNode of renderDefault) {
              if (((_c2 = childNode.type) == null ? void 0 : _c2.name) === "ElTableColumn" || childNode.shapeFlag & 2) {
                children.push(childNode);
              } else if (childNode.type === Fragment && isArray$5(childNode.children)) {
                childNode.children.forEach((vnode2) => {
                  if ((vnode2 == null ? void 0 : vnode2.patchFlag) !== 1024 && !isString$3(vnode2 == null ? void 0 : vnode2.children)) {
                    children.push(vnode2);
                  }
                });
              }
            }
          }
          const vnode = h$1("div", children);
          return vnode;
        } catch (e2) {
          return h$1("div", []);
        }
      }
    });
    const ElTable = withInstall(Table$1, {
      TableColumn: ElTableColumn$1
    });
    const ElTableColumn = withNoopInstall(ElTableColumn$1);
    var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
      SortOrder2["ASC"] = "asc";
      SortOrder2["DESC"] = "desc";
      return SortOrder2;
    })(SortOrder || {});
    var Alignment = /* @__PURE__ */ ((Alignment2) => {
      Alignment2["CENTER"] = "center";
      Alignment2["RIGHT"] = "right";
      return Alignment2;
    })(Alignment || {});
    var FixedDir = /* @__PURE__ */ ((FixedDir2) => {
      FixedDir2["LEFT"] = "left";
      FixedDir2["RIGHT"] = "right";
      return FixedDir2;
    })(FixedDir || {});
    const oppositeOrderMap = {
      [
        "asc"
        /* ASC */
      ]: "desc",
      [
        "desc"
        /* DESC */
      ]: "asc"
      /* ASC */
    };
    const placeholderSign = Symbol("placeholder");
    const calcColumnStyle = (column, fixedColumn, fixed) => {
      var _a2;
      const flex = {
        flexGrow: 0,
        flexShrink: 0,
        ...fixed ? {} : {
          flexGrow: column.flexGrow || 0,
          flexShrink: column.flexShrink || 1
        }
      };
      if (!fixed) {
        flex.flexShrink = 1;
      }
      const style = {
        ...(_a2 = column.style) != null ? _a2 : {},
        ...flex,
        flexBasis: "auto",
        width: column.width
      };
      if (!fixedColumn) {
        if (column.maxWidth)
          style.maxWidth = column.maxWidth;
        if (column.minWidth)
          style.minWidth = column.minWidth;
      }
      return style;
    };
    function useColumns(props2, columns2, fixed) {
      const _columns = computed(() => unref(columns2).map((column, index) => {
        var _a2, _b2;
        return {
          ...column,
          key: (_b2 = (_a2 = column.key) != null ? _a2 : column.dataKey) != null ? _b2 : index
        };
      }));
      const visibleColumns = computed(() => {
        return unref(_columns).filter((column) => !column.hidden);
      });
      const fixedColumnsOnLeft = computed(() => unref(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true));
      const fixedColumnsOnRight = computed(() => unref(visibleColumns).filter((column) => column.fixed === "right"));
      const normalColumns = computed(() => unref(visibleColumns).filter((column) => !column.fixed));
      const mainColumns = computed(() => {
        const ret = [];
        unref(fixedColumnsOnLeft).forEach((column) => {
          ret.push({
            ...column,
            placeholderSign
          });
        });
        unref(normalColumns).forEach((column) => {
          ret.push(column);
        });
        unref(fixedColumnsOnRight).forEach((column) => {
          ret.push({
            ...column,
            placeholderSign
          });
        });
        return ret;
      });
      const hasFixedColumns = computed(() => {
        return unref(fixedColumnsOnLeft).length || unref(fixedColumnsOnRight).length;
      });
      const columnsStyles = computed(() => {
        return unref(_columns).reduce((style, column) => {
          style[column.key] = calcColumnStyle(column, unref(fixed), props2.fixed);
          return style;
        }, {});
      });
      const columnsTotalWidth = computed(() => {
        return unref(visibleColumns).reduce((width, column) => width + column.width, 0);
      });
      const getColumn = (key) => {
        return unref(_columns).find((column) => column.key === key);
      };
      const getColumnStyle = (key) => {
        return unref(columnsStyles)[key];
      };
      const updateColumnWidth = (column, width) => {
        column.width = width;
      };
      function onColumnSorted(e2) {
        var _a2;
        const { key } = e2.currentTarget.dataset;
        if (!key)
          return;
        const { sortState, sortBy } = props2;
        let order = SortOrder.ASC;
        if (isObject$7(sortState)) {
          order = oppositeOrderMap[sortState[key]];
        } else {
          order = oppositeOrderMap[sortBy.order];
        }
        (_a2 = props2.onColumnSort) == null ? void 0 : _a2.call(props2, { column: getColumn(key), key, order });
      }
      return {
        columns: _columns,
        columnsStyles,
        columnsTotalWidth,
        fixedColumnsOnLeft,
        fixedColumnsOnRight,
        hasFixedColumns,
        mainColumns,
        normalColumns,
        visibleColumns,
        getColumn,
        getColumnStyle,
        updateColumnWidth,
        onColumnSorted
      };
    }
    const useScrollbar = (props2, {
      mainTableRef,
      leftTableRef,
      rightTableRef,
      onMaybeEndReached
    }) => {
      const scrollPos = ref({ scrollLeft: 0, scrollTop: 0 });
      function doScroll(params) {
        var _a2, _b2, _c2;
        const { scrollTop } = params;
        (_a2 = mainTableRef.value) == null ? void 0 : _a2.scrollTo(params);
        (_b2 = leftTableRef.value) == null ? void 0 : _b2.scrollToTop(scrollTop);
        (_c2 = rightTableRef.value) == null ? void 0 : _c2.scrollToTop(scrollTop);
      }
      function scrollTo(params) {
        scrollPos.value = params;
        doScroll(params);
      }
      function scrollToTop(scrollTop) {
        scrollPos.value.scrollTop = scrollTop;
        doScroll(unref(scrollPos));
      }
      function scrollToLeft(scrollLeft) {
        var _a2, _b2;
        scrollPos.value.scrollLeft = scrollLeft;
        (_b2 = (_a2 = mainTableRef.value) == null ? void 0 : _a2.scrollTo) == null ? void 0 : _b2.call(_a2, unref(scrollPos));
      }
      function onScroll(params) {
        var _a2;
        scrollTo(params);
        (_a2 = props2.onScroll) == null ? void 0 : _a2.call(props2, params);
      }
      function onVerticalScroll({ scrollTop }) {
        const { scrollTop: currentScrollTop } = unref(scrollPos);
        if (scrollTop !== currentScrollTop)
          scrollToTop(scrollTop);
      }
      function scrollToRow(row, strategy = "auto") {
        var _a2;
        (_a2 = mainTableRef.value) == null ? void 0 : _a2.scrollToRow(row, strategy);
      }
      watch(() => unref(scrollPos).scrollTop, (cur, prev) => {
        if (cur > prev)
          onMaybeEndReached();
      });
      return {
        scrollPos,
        scrollTo,
        scrollToLeft,
        scrollToTop,
        scrollToRow,
        onScroll,
        onVerticalScroll
      };
    };
    const useRow = (props2, {
      mainTableRef,
      leftTableRef,
      rightTableRef,
      tableInstance,
      ns,
      isScrolling
    }) => {
      const vm = getCurrentInstance();
      const { emit: emit2 } = vm;
      const isResetting = shallowRef(false);
      const expandedRowKeys = ref(props2.defaultExpandedRowKeys || []);
      const lastRenderedRowIndex = ref(-1);
      const resetIndex = shallowRef(null);
      const rowHeights = ref({});
      const pendingRowHeights = ref({});
      const leftTableHeights = shallowRef({});
      const mainTableHeights = shallowRef({});
      const rightTableHeights = shallowRef({});
      const isDynamic = computed(() => isNumber$2(props2.estimatedRowHeight));
      function onRowsRendered(params) {
        var _a2;
        (_a2 = props2.onRowsRendered) == null ? void 0 : _a2.call(props2, params);
        if (params.rowCacheEnd > unref(lastRenderedRowIndex)) {
          lastRenderedRowIndex.value = params.rowCacheEnd;
        }
      }
      function onRowHovered({ hovered, rowKey: rowKey2 }) {
        if (isScrolling.value) {
          return;
        }
        const tableRoot = tableInstance.vnode.el;
        const rows = tableRoot.querySelectorAll(`[rowkey="${String(rowKey2)}"]`);
        rows.forEach((row) => {
          if (hovered) {
            row.classList.add(ns.is("hovered"));
          } else {
            row.classList.remove(ns.is("hovered"));
          }
        });
      }
      function onRowExpanded({
        expanded,
        rowData,
        rowIndex,
        rowKey: rowKey2
      }) {
        var _a2, _b2;
        const _expandedRowKeys = [...unref(expandedRowKeys)];
        const currentKeyIndex = _expandedRowKeys.indexOf(rowKey2);
        if (expanded) {
          if (currentKeyIndex === -1)
            _expandedRowKeys.push(rowKey2);
        } else {
          if (currentKeyIndex > -1)
            _expandedRowKeys.splice(currentKeyIndex, 1);
        }
        expandedRowKeys.value = _expandedRowKeys;
        emit2("update:expandedRowKeys", _expandedRowKeys);
        (_a2 = props2.onRowExpand) == null ? void 0 : _a2.call(props2, {
          expanded,
          rowData,
          rowIndex,
          rowKey: rowKey2
        });
        (_b2 = props2.onExpandedRowsChange) == null ? void 0 : _b2.call(props2, _expandedRowKeys);
      }
      const flushingRowHeights = debounce(() => {
        var _a2, _b2, _c2, _d;
        isResetting.value = true;
        rowHeights.value = { ...unref(rowHeights), ...unref(pendingRowHeights) };
        resetAfterIndex(unref(resetIndex), false);
        pendingRowHeights.value = {};
        resetIndex.value = null;
        (_a2 = mainTableRef.value) == null ? void 0 : _a2.forceUpdate();
        (_b2 = leftTableRef.value) == null ? void 0 : _b2.forceUpdate();
        (_c2 = rightTableRef.value) == null ? void 0 : _c2.forceUpdate();
        (_d = vm.proxy) == null ? void 0 : _d.$forceUpdate();
        isResetting.value = false;
      }, 0);
      function resetAfterIndex(index, forceUpdate = false) {
        if (!unref(isDynamic))
          return;
        [mainTableRef, leftTableRef, rightTableRef].forEach((tableRef) => {
          const table = unref(tableRef);
          if (table)
            table.resetAfterRowIndex(index, forceUpdate);
        });
      }
      function resetHeights(rowKey2, height, rowIdx) {
        const resetIdx = unref(resetIndex);
        if (resetIdx === null) {
          resetIndex.value = rowIdx;
        } else {
          if (resetIdx > rowIdx) {
            resetIndex.value = rowIdx;
          }
        }
        pendingRowHeights.value[rowKey2] = height;
      }
      function onRowHeightChange({ rowKey: rowKey2, height, rowIndex }, fixedDir) {
        if (!fixedDir) {
          mainTableHeights.value[rowKey2] = height;
        } else {
          if (fixedDir === FixedDir.RIGHT) {
            rightTableHeights.value[rowKey2] = height;
          } else {
            leftTableHeights.value[rowKey2] = height;
          }
        }
        const maximumHeight = Math.max(...[leftTableHeights, rightTableHeights, mainTableHeights].map((records) => records.value[rowKey2] || 0));
        if (unref(rowHeights)[rowKey2] !== maximumHeight) {
          resetHeights(rowKey2, maximumHeight, rowIndex);
          flushingRowHeights();
        }
      }
      return {
        expandedRowKeys,
        lastRenderedRowIndex,
        isDynamic,
        isResetting,
        rowHeights,
        resetAfterIndex,
        onRowExpanded,
        onRowHovered,
        onRowsRendered,
        onRowHeightChange
      };
    };
    const useData = (props2, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
      const depthMap = ref({});
      const flattenedData = computed(() => {
        const depths = {};
        const { data: data2, rowKey: rowKey2 } = props2;
        const _expandedRowKeys = unref(expandedRowKeys);
        if (!_expandedRowKeys || !_expandedRowKeys.length)
          return data2;
        const array = [];
        const keysSet = /* @__PURE__ */ new Set();
        _expandedRowKeys.forEach((x2) => keysSet.add(x2));
        let copy2 = data2.slice();
        copy2.forEach((x2) => depths[x2[rowKey2]] = 0);
        while (copy2.length > 0) {
          const item = copy2.shift();
          array.push(item);
          if (keysSet.has(item[rowKey2]) && isArray$5(item.children) && item.children.length > 0) {
            copy2 = [...item.children, ...copy2];
            item.children.forEach((child) => depths[child[rowKey2]] = depths[item[rowKey2]] + 1);
          }
        }
        depthMap.value = depths;
        return array;
      });
      const data = computed(() => {
        const { data: data2, expandColumnKey: expandColumnKey2 } = props2;
        return expandColumnKey2 ? unref(flattenedData) : data2;
      });
      watch(data, (val, prev) => {
        if (val !== prev) {
          lastRenderedRowIndex.value = -1;
          resetAfterIndex(0, true);
        }
      });
      return {
        data,
        depthMap
      };
    };
    const sumReducer = (sum2, num) => sum2 + num;
    const sum$1 = (listLike) => {
      return isArray$5(listLike) ? listLike.reduce(sumReducer, 0) : listLike;
    };
    const tryCall = (fLike, params, defaultRet = {}) => {
      return isFunction$4(fLike) ? fLike(params) : fLike != null ? fLike : defaultRet;
    };
    const enforceUnit = (style) => {
      ["width", "maxWidth", "minWidth", "height"].forEach((key) => {
        style[key] = addUnit(style[key]);
      });
      return style;
    };
    const componentToSlot = (ComponentLike) => isVNode(ComponentLike) ? (props2) => h$1(ComponentLike, props2) : ComponentLike;
    const useStyles = (props2, {
      columnsTotalWidth,
      rowsHeight,
      fixedColumnsOnLeft,
      fixedColumnsOnRight
    }) => {
      const bodyWidth = computed(() => {
        const { fixed, width, vScrollbarSize } = props2;
        const ret = width - vScrollbarSize;
        return fixed ? Math.max(Math.round(unref(columnsTotalWidth)), ret) : ret;
      });
      const headerWidth = computed(() => unref(bodyWidth) + props2.vScrollbarSize);
      const mainTableHeight = computed(() => {
        const { height = 0, maxHeight = 0, footerHeight: footerHeight2, hScrollbarSize } = props2;
        if (maxHeight > 0) {
          const _fixedRowsHeight = unref(fixedRowsHeight);
          const _rowsHeight = unref(rowsHeight);
          const _headerHeight = unref(headerHeight);
          const total2 = _headerHeight + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
          return Math.min(total2, maxHeight - footerHeight2);
        }
        return height - footerHeight2;
      });
      const fixedTableHeight = computed(() => {
        const { maxHeight } = props2;
        const tableHeight = unref(mainTableHeight);
        if (isNumber$2(maxHeight) && maxHeight > 0)
          return tableHeight;
        const totalHeight = unref(rowsHeight) + unref(headerHeight) + unref(fixedRowsHeight);
        return Math.min(tableHeight, totalHeight);
      });
      const mapColumn = (column) => column.width;
      const leftTableWidth = computed(() => sum$1(unref(fixedColumnsOnLeft).map(mapColumn)));
      const rightTableWidth = computed(() => sum$1(unref(fixedColumnsOnRight).map(mapColumn)));
      const headerHeight = computed(() => sum$1(props2.headerHeight));
      const fixedRowsHeight = computed(() => {
        var _a2;
        return (((_a2 = props2.fixedData) == null ? void 0 : _a2.length) || 0) * props2.rowHeight;
      });
      const windowHeight = computed(() => {
        return unref(mainTableHeight) - unref(headerHeight) - unref(fixedRowsHeight);
      });
      const rootStyle = computed(() => {
        const { style = {}, height, width } = props2;
        return enforceUnit({
          ...style,
          height,
          width
        });
      });
      const footerHeight = computed(() => enforceUnit({ height: props2.footerHeight }));
      const emptyStyle = computed(() => ({
        top: addUnit(unref(headerHeight)),
        bottom: addUnit(props2.footerHeight),
        width: addUnit(props2.width)
      }));
      return {
        bodyWidth,
        fixedTableHeight,
        mainTableHeight,
        leftTableWidth,
        rightTableWidth,
        headerWidth,
        windowHeight,
        footerHeight,
        emptyStyle,
        rootStyle,
        headerHeight
      };
    };
    function useTable(props2) {
      const mainTableRef = ref();
      const leftTableRef = ref();
      const rightTableRef = ref();
      const {
        columns: columns2,
        columnsStyles,
        columnsTotalWidth,
        fixedColumnsOnLeft,
        fixedColumnsOnRight,
        hasFixedColumns,
        mainColumns,
        onColumnSorted
      } = useColumns(props2, toRef(props2, "columns"), toRef(props2, "fixed"));
      const {
        scrollTo,
        scrollToLeft,
        scrollToTop,
        scrollToRow,
        onScroll,
        onVerticalScroll,
        scrollPos
      } = useScrollbar(props2, {
        mainTableRef,
        leftTableRef,
        rightTableRef,
        onMaybeEndReached
      });
      const ns = useNamespace("table-v2");
      const instance = getCurrentInstance();
      const isScrolling = shallowRef(false);
      const {
        expandedRowKeys,
        lastRenderedRowIndex,
        isDynamic,
        isResetting,
        rowHeights,
        resetAfterIndex,
        onRowExpanded,
        onRowHeightChange,
        onRowHovered,
        onRowsRendered
      } = useRow(props2, {
        mainTableRef,
        leftTableRef,
        rightTableRef,
        tableInstance: instance,
        ns,
        isScrolling
      });
      const { data, depthMap } = useData(props2, {
        expandedRowKeys,
        lastRenderedRowIndex,
        resetAfterIndex
      });
      const rowsHeight = computed(() => {
        const { estimatedRowHeight, rowHeight } = props2;
        const _data = unref(data);
        if (isNumber$2(estimatedRowHeight)) {
          return Object.values(unref(rowHeights)).reduce((acc, curr) => acc + curr, 0);
        }
        return _data.length * rowHeight;
      });
      const {
        bodyWidth,
        fixedTableHeight,
        mainTableHeight,
        leftTableWidth,
        rightTableWidth,
        headerWidth,
        windowHeight,
        footerHeight,
        emptyStyle,
        rootStyle,
        headerHeight
      } = useStyles(props2, {
        columnsTotalWidth,
        fixedColumnsOnLeft,
        fixedColumnsOnRight,
        rowsHeight
      });
      const containerRef = ref();
      const showEmpty = computed(() => {
        const noData = unref(data).length === 0;
        return isArray$5(props2.fixedData) ? props2.fixedData.length === 0 && noData : noData;
      });
      function getRowHeight(rowIndex) {
        const { estimatedRowHeight, rowHeight, rowKey: rowKey2 } = props2;
        if (!estimatedRowHeight)
          return rowHeight;
        return unref(rowHeights)[unref(data)[rowIndex][rowKey2]] || estimatedRowHeight;
      }
      const isEndReached = ref(false);
      function onMaybeEndReached() {
        const { onEndReached } = props2;
        if (!onEndReached)
          return;
        const { scrollTop } = unref(scrollPos);
        const _totalHeight = unref(rowsHeight);
        const clientHeight = unref(windowHeight);
        const remainDistance = _totalHeight - (scrollTop + clientHeight) + props2.hScrollbarSize;
        if (!isEndReached.value && unref(lastRenderedRowIndex) >= 0 && _totalHeight <= scrollTop + unref(mainTableHeight) - unref(headerHeight)) {
          isEndReached.value = true;
          onEndReached(remainDistance);
        } else {
          isEndReached.value = false;
        }
      }
      watch(() => unref(rowsHeight), () => isEndReached.value = false);
      watch(() => props2.expandedRowKeys, (val) => expandedRowKeys.value = val, {
        deep: true
      });
      return {
        columns: columns2,
        containerRef,
        mainTableRef,
        leftTableRef,
        rightTableRef,
        isDynamic,
        isResetting,
        isScrolling,
        hasFixedColumns,
        columnsStyles,
        columnsTotalWidth,
        data,
        expandedRowKeys,
        depthMap,
        fixedColumnsOnLeft,
        fixedColumnsOnRight,
        mainColumns,
        bodyWidth,
        emptyStyle,
        rootStyle,
        headerWidth,
        footerHeight,
        mainTableHeight,
        fixedTableHeight,
        leftTableWidth,
        rightTableWidth,
        showEmpty,
        getRowHeight,
        onColumnSorted,
        onRowHovered,
        onRowExpanded,
        onRowsRendered,
        onRowHeightChange,
        scrollTo,
        scrollToLeft,
        scrollToTop,
        scrollToRow,
        onScroll,
        onVerticalScroll
      };
    }
    const TableV2InjectionKey = Symbol("tableV2");
    const classType = String;
    const columns = {
      type: definePropType(Array),
      required: true
    };
    const fixedDataType = {
      type: definePropType(Array)
    };
    const dataType = {
      ...fixedDataType,
      required: true
    };
    const expandColumnKey = String;
    const expandKeys = {
      type: definePropType(Array),
      default: () => mutable([])
    };
    const requiredNumber = {
      type: Number,
      required: true
    };
    const rowKey = {
      type: definePropType([String, Number, Symbol]),
      default: "id"
    };
    const styleType = {
      type: definePropType(Object)
    };
    const tableV2RowProps = buildProps({
      class: String,
      columns,
      columnsStyles: {
        type: definePropType(Object),
        required: true
      },
      depth: Number,
      expandColumnKey,
      estimatedRowHeight: {
        ...virtualizedGridProps.estimatedRowHeight,
        default: void 0
      },
      isScrolling: Boolean,
      onRowExpand: {
        type: definePropType(Function)
      },
      onRowHover: {
        type: definePropType(Function)
      },
      onRowHeightChange: {
        type: definePropType(Function)
      },
      rowData: {
        type: definePropType(Object),
        required: true
      },
      rowEventHandlers: {
        type: definePropType(Object)
      },
      rowIndex: {
        type: Number,
        required: true
      },
      rowKey,
      style: {
        type: definePropType(Object)
      }
    });
    const requiredNumberType = {
      type: Number,
      required: true
    };
    const tableV2HeaderProps = buildProps({
      class: String,
      columns,
      fixedHeaderData: {
        type: definePropType(Array)
      },
      headerData: {
        type: definePropType(Array),
        required: true
      },
      headerHeight: {
        type: definePropType([Number, Array]),
        default: 50
      },
      rowWidth: requiredNumberType,
      rowHeight: {
        type: Number,
        default: 50
      },
      height: requiredNumberType,
      width: requiredNumberType
    });
    const tableV2GridProps = buildProps({
      columns,
      data: dataType,
      fixedData: fixedDataType,
      estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
      width: requiredNumber,
      height: requiredNumber,
      headerWidth: requiredNumber,
      headerHeight: tableV2HeaderProps.headerHeight,
      bodyWidth: requiredNumber,
      rowHeight: requiredNumber,
      cache: virtualizedListProps.cache,
      useIsScrolling: Boolean,
      scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,
      scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,
      scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,
      class: classType,
      style: styleType,
      containerStyle: styleType,
      getRowHeight: {
        type: definePropType(Function),
        required: true
      },
      rowKey: tableV2RowProps.rowKey,
      onRowsRendered: {
        type: definePropType(Function)
      },
      onScroll: {
        type: definePropType(Function)
      }
    });
    const tableV2Props = buildProps({
      cache: tableV2GridProps.cache,
      estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
      rowKey,
      headerClass: {
        type: definePropType([
          String,
          Function
        ])
      },
      headerProps: {
        type: definePropType([
          Object,
          Function
        ])
      },
      headerCellProps: {
        type: definePropType([
          Object,
          Function
        ])
      },
      headerHeight: tableV2HeaderProps.headerHeight,
      footerHeight: {
        type: Number,
        default: 0
      },
      rowClass: {
        type: definePropType([String, Function])
      },
      rowProps: {
        type: definePropType([Object, Function])
      },
      rowHeight: {
        type: Number,
        default: 50
      },
      cellProps: {
        type: definePropType([
          Object,
          Function
        ])
      },
      columns,
      data: dataType,
      dataGetter: {
        type: definePropType(Function)
      },
      fixedData: fixedDataType,
      expandColumnKey: tableV2RowProps.expandColumnKey,
      expandedRowKeys: expandKeys,
      defaultExpandedRowKeys: expandKeys,
      class: classType,
      fixed: Boolean,
      style: {
        type: definePropType(Object)
      },
      width: requiredNumber,
      height: requiredNumber,
      maxHeight: Number,
      useIsScrolling: Boolean,
      indentSize: {
        type: Number,
        default: 12
      },
      iconSize: {
        type: Number,
        default: 12
      },
      hScrollbarSize: virtualizedGridProps.hScrollbarSize,
      vScrollbarSize: virtualizedGridProps.vScrollbarSize,
      scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,
      sortBy: {
        type: definePropType(Object),
        default: () => ({})
      },
      sortState: {
        type: definePropType(Object),
        default: void 0
      },
      onColumnSort: {
        type: definePropType(Function)
      },
      onExpandedRowsChange: {
        type: definePropType(Function)
      },
      onEndReached: {
        type: definePropType(Function)
      },
      onRowExpand: tableV2RowProps.onRowExpand,
      onScroll: tableV2GridProps.onScroll,
      onRowsRendered: tableV2GridProps.onRowsRendered,
      rowEventHandlers: tableV2RowProps.rowEventHandlers
    });
    const COMPONENT_NAME$7 = "ElTableV2Header";
    const TableV2Header = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$7,
      props: tableV2HeaderProps,
      setup(props2, {
        slots,
        expose
      }) {
        const ns = useNamespace("table-v2");
        const scrollLeftInfo = inject("tableV2GridScrollLeft");
        const headerRef = ref();
        const headerStyle = computed(() => enforceUnit({
          width: props2.width,
          height: props2.height
        }));
        const rowStyle = computed(() => enforceUnit({
          width: props2.rowWidth,
          height: props2.height
        }));
        const headerHeights = computed(() => castArray$1(unref(props2.headerHeight)));
        const scrollToLeft = (left) => {
          const headerEl = unref(headerRef);
          nextTick(() => {
            (headerEl == null ? void 0 : headerEl.scroll) && headerEl.scroll({
              left
            });
          });
        };
        const renderFixedRows = () => {
          const fixedRowClassName = ns.e("fixed-header-row");
          const {
            columns: columns2,
            fixedHeaderData,
            rowHeight
          } = props2;
          return fixedHeaderData == null ? void 0 : fixedHeaderData.map((fixedRowData, fixedRowIndex) => {
            var _a2;
            const style = enforceUnit({
              height: rowHeight,
              width: "100%"
            });
            return (_a2 = slots.fixed) == null ? void 0 : _a2.call(slots, {
              class: fixedRowClassName,
              columns: columns2,
              rowData: fixedRowData,
              rowIndex: -(fixedRowIndex + 1),
              style
            });
          });
        };
        const renderDynamicRows = () => {
          const dynamicRowClassName = ns.e("dynamic-header-row");
          const {
            columns: columns2
          } = props2;
          return unref(headerHeights).map((rowHeight, rowIndex) => {
            var _a2;
            const style = enforceUnit({
              width: "100%",
              height: rowHeight
            });
            return (_a2 = slots.dynamic) == null ? void 0 : _a2.call(slots, {
              class: dynamicRowClassName,
              columns: columns2,
              headerIndex: rowIndex,
              style
            });
          });
        };
        onUpdated(() => {
          if (scrollLeftInfo == null ? void 0 : scrollLeftInfo.value) {
            scrollToLeft(scrollLeftInfo.value);
          }
        });
        expose({
          scrollToLeft
        });
        return () => {
          if (props2.height <= 0)
            return;
          return createVNode$1("div", {
            "ref": headerRef,
            "class": props2.class,
            "style": unref(headerStyle),
            "role": "rowgroup"
          }, [createVNode$1("div", {
            "style": unref(rowStyle),
            "class": ns.e("header")
          }, [renderDynamicRows(), renderFixedRows()])]);
        };
      }
    });
    var Header$1 = TableV2Header;
    const useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => {
      let frameHandle = null;
      let xOffset = 0;
      let yOffset = 0;
      const hasReachedEdge = (x2, y) => {
        const xEdgeReached = x2 <= 0 && atXStartEdge.value || x2 >= 0 && atXEndEdge.value;
        const yEdgeReached = y <= 0 && atYStartEdge.value || y >= 0 && atYEndEdge.value;
        return xEdgeReached && yEdgeReached;
      };
      const onWheel = (e2) => {
        cAF(frameHandle);
        let x2 = e2.deltaX;
        let y = e2.deltaY;
        if (Math.abs(x2) > Math.abs(y)) {
          y = 0;
        } else {
          x2 = 0;
        }
        if (e2.shiftKey && y !== 0) {
          x2 = y;
          y = 0;
        }
        if (hasReachedEdge(xOffset, yOffset) && hasReachedEdge(xOffset + x2, yOffset + y))
          return;
        xOffset += x2;
        yOffset += y;
        e2.preventDefault();
        frameHandle = rAF(() => {
          onWheelDelta(xOffset, yOffset);
          xOffset = 0;
          yOffset = 0;
        });
      };
      return {
        hasReachedEdge,
        onWheel
      };
    };
    const createGrid = ({
      name,
      clearCache,
      getColumnPosition,
      getColumnStartIndexForOffset,
      getColumnStopIndexForStartIndex,
      getEstimatedTotalHeight: getEstimatedTotalHeight2,
      getEstimatedTotalWidth: getEstimatedTotalWidth2,
      getColumnOffset,
      getRowOffset,
      getRowPosition,
      getRowStartIndexForOffset,
      getRowStopIndexForStartIndex,
      initCache,
      injectToInstance,
      validateProps
    }) => {
      return /* @__PURE__ */ defineComponent({
        name: name != null ? name : "ElVirtualList",
        props: virtualizedGridProps,
        emits: [ITEM_RENDER_EVT, SCROLL_EVT],
        setup(props2, { emit: emit2, expose, slots }) {
          const ns = useNamespace("vl");
          validateProps(props2);
          const instance = getCurrentInstance();
          const cache2 = ref(initCache(props2, instance));
          injectToInstance == null ? void 0 : injectToInstance(instance, cache2);
          const windowRef = ref();
          const hScrollbar = ref();
          const vScrollbar = ref();
          const innerRef = ref(null);
          const states = ref({
            isScrolling: false,
            scrollLeft: isNumber$2(props2.initScrollLeft) ? props2.initScrollLeft : 0,
            scrollTop: isNumber$2(props2.initScrollTop) ? props2.initScrollTop : 0,
            updateRequested: false,
            xAxisScrollDir: FORWARD,
            yAxisScrollDir: FORWARD
          });
          const getItemStyleCache = useCache();
          const parsedHeight = computed(() => Number.parseInt(`${props2.height}`, 10));
          const parsedWidth = computed(() => Number.parseInt(`${props2.width}`, 10));
          const columnsToRender = computed(() => {
            const { totalColumn, totalRow, columnCache } = props2;
            const { isScrolling, xAxisScrollDir, scrollLeft } = unref(states);
            if (totalColumn === 0 || totalRow === 0) {
              return [0, 0, 0, 0];
            }
            const startIndex = getColumnStartIndexForOffset(props2, scrollLeft, unref(cache2));
            const stopIndex = getColumnStopIndexForStartIndex(props2, startIndex, scrollLeft, unref(cache2));
            const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1;
            const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1;
            return [
              Math.max(0, startIndex - cacheBackward),
              Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)),
              startIndex,
              stopIndex
            ];
          });
          const rowsToRender = computed(() => {
            const { totalColumn, totalRow, rowCache } = props2;
            const { isScrolling, yAxisScrollDir, scrollTop } = unref(states);
            if (totalColumn === 0 || totalRow === 0) {
              return [0, 0, 0, 0];
            }
            const startIndex = getRowStartIndexForOffset(props2, scrollTop, unref(cache2));
            const stopIndex = getRowStopIndexForStartIndex(props2, startIndex, scrollTop, unref(cache2));
            const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1;
            const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1;
            return [
              Math.max(0, startIndex - cacheBackward),
              Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)),
              startIndex,
              stopIndex
            ];
          });
          const estimatedTotalHeight = computed(() => getEstimatedTotalHeight2(props2, unref(cache2)));
          const estimatedTotalWidth = computed(() => getEstimatedTotalWidth2(props2, unref(cache2)));
          const windowStyle = computed(() => {
            var _a2;
            return [
              {
                position: "relative",
                overflow: "hidden",
                WebkitOverflowScrolling: "touch",
                willChange: "transform"
              },
              {
                direction: props2.direction,
                height: isNumber$2(props2.height) ? `${props2.height}px` : props2.height,
                width: isNumber$2(props2.width) ? `${props2.width}px` : props2.width
              },
              (_a2 = props2.style) != null ? _a2 : {}
            ];
          });
          const innerStyle = computed(() => {
            const width = `${unref(estimatedTotalWidth)}px`;
            const height = `${unref(estimatedTotalHeight)}px`;
            return {
              height,
              pointerEvents: unref(states).isScrolling ? "none" : void 0,
              width
            };
          });
          const emitEvents = () => {
            const { totalColumn, totalRow } = props2;
            if (totalColumn > 0 && totalRow > 0) {
              const [
                columnCacheStart,
                columnCacheEnd,
                columnVisibleStart,
                columnVisibleEnd
              ] = unref(columnsToRender);
              const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = unref(rowsToRender);
              emit2(ITEM_RENDER_EVT, {
                columnCacheStart,
                columnCacheEnd,
                rowCacheStart,
                rowCacheEnd,
                columnVisibleStart,
                columnVisibleEnd,
                rowVisibleStart,
                rowVisibleEnd
              });
            }
            const {
              scrollLeft,
              scrollTop,
              updateRequested,
              xAxisScrollDir,
              yAxisScrollDir
            } = unref(states);
            emit2(SCROLL_EVT, {
              xAxisScrollDir,
              scrollLeft,
              yAxisScrollDir,
              scrollTop,
              updateRequested
            });
          };
          const onScroll = (e2) => {
            const {
              clientHeight,
              clientWidth,
              scrollHeight,
              scrollLeft,
              scrollTop,
              scrollWidth
            } = e2.currentTarget;
            const _states = unref(states);
            if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) {
              return;
            }
            let _scrollLeft = scrollLeft;
            if (isRTL$1(props2.direction)) {
              switch (getRTLOffsetType()) {
                case RTL_OFFSET_NAG:
                  _scrollLeft = -scrollLeft;
                  break;
                case RTL_OFFSET_POS_DESC:
                  _scrollLeft = scrollWidth - clientWidth - scrollLeft;
                  break;
              }
            }
            states.value = {
              ..._states,
              isScrolling: true,
              scrollLeft: _scrollLeft,
              scrollTop: Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)),
              updateRequested: true,
              xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft),
              yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop)
            };
            nextTick(() => resetIsScrolling());
            onUpdated2();
            emitEvents();
          };
          const onVerticalScroll = (distance2, totalSteps) => {
            const height = unref(parsedHeight);
            const offset2 = (estimatedTotalHeight.value - height) / totalSteps * distance2;
            scrollTo({
              scrollTop: Math.min(estimatedTotalHeight.value - height, offset2)
            });
          };
          const onHorizontalScroll = (distance2, totalSteps) => {
            const width = unref(parsedWidth);
            const offset2 = (estimatedTotalWidth.value - width) / totalSteps * distance2;
            scrollTo({
              scrollLeft: Math.min(estimatedTotalWidth.value - width, offset2)
            });
          };
          const { onWheel } = useGridWheel({
            atXStartEdge: computed(() => states.value.scrollLeft <= 0),
            atXEndEdge: computed(() => states.value.scrollLeft >= estimatedTotalWidth.value - unref(parsedWidth)),
            atYStartEdge: computed(() => states.value.scrollTop <= 0),
            atYEndEdge: computed(() => states.value.scrollTop >= estimatedTotalHeight.value - unref(parsedHeight))
          }, (x2, y) => {
            var _a2, _b2, _c2, _d;
            (_b2 = (_a2 = hScrollbar.value) == null ? void 0 : _a2.onMouseUp) == null ? void 0 : _b2.call(_a2);
            (_d = (_c2 = vScrollbar.value) == null ? void 0 : _c2.onMouseUp) == null ? void 0 : _d.call(_c2);
            const width = unref(parsedWidth);
            const height = unref(parsedHeight);
            scrollTo({
              scrollLeft: Math.min(states.value.scrollLeft + x2, estimatedTotalWidth.value - width),
              scrollTop: Math.min(states.value.scrollTop + y, estimatedTotalHeight.value - height)
            });
          });
          useEventListener(windowRef, "wheel", onWheel, {
            passive: false
          });
          const scrollTo = ({
            scrollLeft = states.value.scrollLeft,
            scrollTop = states.value.scrollTop
          }) => {
            scrollLeft = Math.max(scrollLeft, 0);
            scrollTop = Math.max(scrollTop, 0);
            const _states = unref(states);
            if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) {
              return;
            }
            states.value = {
              ..._states,
              xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft),
              yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop),
              scrollLeft,
              scrollTop,
              updateRequested: true
            };
            nextTick(() => resetIsScrolling());
            onUpdated2();
            emitEvents();
          };
          const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => {
            const _states = unref(states);
            columnIdx = Math.max(0, Math.min(columnIdx, props2.totalColumn - 1));
            rowIndex = Math.max(0, Math.min(rowIndex, props2.totalRow - 1));
            const scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
            const _cache = unref(cache2);
            const estimatedHeight = getEstimatedTotalHeight2(props2, _cache);
            const estimatedWidth = getEstimatedTotalWidth2(props2, _cache);
            scrollTo({
              scrollLeft: getColumnOffset(props2, columnIdx, alignment, _states.scrollLeft, _cache, estimatedWidth > props2.width ? scrollBarWidth2 : 0),
              scrollTop: getRowOffset(props2, rowIndex, alignment, _states.scrollTop, _cache, estimatedHeight > props2.height ? scrollBarWidth2 : 0)
            });
          };
          const getItemStyle2 = (rowIndex, columnIndex) => {
            const { columnWidth, direction: direction2, rowHeight } = props2;
            const itemStyleCache = getItemStyleCache.value(clearCache && columnWidth, clearCache && rowHeight, clearCache && direction2);
            const key = `${rowIndex},${columnIndex}`;
            if (hasOwn$1(itemStyleCache, key)) {
              return itemStyleCache[key];
            } else {
              const [, left] = getColumnPosition(props2, columnIndex, unref(cache2));
              const _cache = unref(cache2);
              const rtl = isRTL$1(direction2);
              const [height, top] = getRowPosition(props2, rowIndex, _cache);
              const [width] = getColumnPosition(props2, columnIndex, _cache);
              itemStyleCache[key] = {
                position: "absolute",
                left: rtl ? void 0 : `${left}px`,
                right: rtl ? `${left}px` : void 0,
                top: `${top}px`,
                height: `${height}px`,
                width: `${width}px`
              };
              return itemStyleCache[key];
            }
          };
          const resetIsScrolling = () => {
            states.value.isScrolling = false;
            nextTick(() => {
              getItemStyleCache.value(-1, null, null);
            });
          };
          onMounted(() => {
            if (!isClient)
              return;
            const { initScrollLeft, initScrollTop } = props2;
            const windowElement = unref(windowRef);
            if (windowElement) {
              if (isNumber$2(initScrollLeft)) {
                windowElement.scrollLeft = initScrollLeft;
              }
              if (isNumber$2(initScrollTop)) {
                windowElement.scrollTop = initScrollTop;
              }
            }
            emitEvents();
          });
          const onUpdated2 = () => {
            const { direction: direction2 } = props2;
            const { scrollLeft, scrollTop, updateRequested } = unref(states);
            const windowElement = unref(windowRef);
            if (updateRequested && windowElement) {
              if (direction2 === RTL) {
                switch (getRTLOffsetType()) {
                  case RTL_OFFSET_NAG: {
                    windowElement.scrollLeft = -scrollLeft;
                    break;
                  }
                  case RTL_OFFSET_POS_ASC: {
                    windowElement.scrollLeft = scrollLeft;
                    break;
                  }
                  default: {
                    const { clientWidth, scrollWidth } = windowElement;
                    windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft;
                    break;
                  }
                }
              } else {
                windowElement.scrollLeft = Math.max(0, scrollLeft);
              }
              windowElement.scrollTop = Math.max(0, scrollTop);
            }
          };
          const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy;
          expose({
            windowRef,
            innerRef,
            getItemStyleCache,
            scrollTo,
            scrollToItem,
            states,
            resetAfterColumnIndex,
            resetAfterRowIndex,
            resetAfter
          });
          const renderScrollbars = () => {
            const {
              scrollbarAlwaysOn,
              scrollbarStartGap,
              scrollbarEndGap,
              totalColumn,
              totalRow
            } = props2;
            const width = unref(parsedWidth);
            const height = unref(parsedHeight);
            const estimatedWidth = unref(estimatedTotalWidth);
            const estimatedHeight = unref(estimatedTotalHeight);
            const { scrollLeft, scrollTop } = unref(states);
            const horizontalScrollbar = h$1(ScrollBar, {
              ref: hScrollbar,
              alwaysOn: scrollbarAlwaysOn,
              startGap: scrollbarStartGap,
              endGap: scrollbarEndGap,
              class: ns.e("horizontal"),
              clientSize: width,
              layout: "horizontal",
              onScroll: onHorizontalScroll,
              ratio: width * 100 / estimatedWidth,
              scrollFrom: scrollLeft / (estimatedWidth - width),
              total: totalRow,
              visible: true
            });
            const verticalScrollbar = h$1(ScrollBar, {
              ref: vScrollbar,
              alwaysOn: scrollbarAlwaysOn,
              startGap: scrollbarStartGap,
              endGap: scrollbarEndGap,
              class: ns.e("vertical"),
              clientSize: height,
              layout: "vertical",
              onScroll: onVerticalScroll,
              ratio: height * 100 / estimatedHeight,
              scrollFrom: scrollTop / (estimatedHeight - height),
              total: totalColumn,
              visible: true
            });
            return {
              horizontalScrollbar,
              verticalScrollbar
            };
          };
          const renderItems = () => {
            var _a2;
            const [columnStart, columnEnd] = unref(columnsToRender);
            const [rowStart, rowEnd] = unref(rowsToRender);
            const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props2;
            const children = [];
            if (totalRow > 0 && totalColumn > 0) {
              for (let row = rowStart; row <= rowEnd; row++) {
                for (let column = columnStart; column <= columnEnd; column++) {
                  const key = itemKey({ columnIndex: column, data, rowIndex: row });
                  children.push(h$1(Fragment, { key }, (_a2 = slots.default) == null ? void 0 : _a2.call(slots, {
                    columnIndex: column,
                    data,
                    isScrolling: useIsScrolling ? unref(states).isScrolling : void 0,
                    style: getItemStyle2(row, column),
                    rowIndex: row
                  })));
                }
              }
            }
            return children;
          };
          const renderInner = () => {
            const Inner = resolveDynamicComponent(props2.innerElement);
            const children = renderItems();
            return [
              h$1(Inner, {
                style: unref(innerStyle),
                ref: innerRef
              }, !isString$3(Inner) ? {
                default: () => children
              } : children)
            ];
          };
          const renderWindow = () => {
            const Container2 = resolveDynamicComponent(props2.containerElement);
            const { horizontalScrollbar, verticalScrollbar } = renderScrollbars();
            const Inner = renderInner();
            return h$1("div", {
              key: 0,
              class: ns.e("wrapper"),
              role: props2.role
            }, [
              h$1(Container2, {
                class: props2.className,
                style: unref(windowStyle),
                onScroll,
                ref: windowRef
              }, !isString$3(Container2) ? { default: () => Inner } : Inner),
              horizontalScrollbar,
              verticalScrollbar
            ]);
          };
          return renderWindow;
        }
      });
    };
    const { max: max$3, min: min$3, floor: floor$1 } = Math;
    const ACCESS_SIZER_KEY_MAP = {
      column: "columnWidth",
      row: "rowHeight"
    };
    const ACCESS_LAST_VISITED_KEY_MAP = {
      column: "lastVisitedColumnIndex",
      row: "lastVisitedRowIndex"
    };
    const getItemFromCache = (props2, index, gridCache, type) => {
      const [cachedItems, sizer, lastVisited] = [
        gridCache[type],
        props2[ACCESS_SIZER_KEY_MAP[type]],
        gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
      ];
      if (index > lastVisited) {
        let offset2 = 0;
        if (lastVisited >= 0) {
          const item = cachedItems[lastVisited];
          offset2 = item.offset + item.size;
        }
        for (let i2 = lastVisited + 1; i2 <= index; i2++) {
          const size = sizer(i2);
          cachedItems[i2] = {
            offset: offset2,
            size
          };
          offset2 += size;
        }
        gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index;
      }
      return cachedItems[index];
    };
    const bs = (props2, gridCache, low, high, offset2, type) => {
      while (low <= high) {
        const mid = low + floor$1((high - low) / 2);
        const currentOffset = getItemFromCache(props2, mid, gridCache, type).offset;
        if (currentOffset === offset2) {
          return mid;
        } else if (currentOffset < offset2) {
          low = mid + 1;
        } else {
          high = mid - 1;
        }
      }
      return max$3(0, low - 1);
    };
    const es = (props2, gridCache, idx, offset2, type) => {
      const total2 = type === "column" ? props2.totalColumn : props2.totalRow;
      let exponent = 1;
      while (idx < total2 && getItemFromCache(props2, idx, gridCache, type).offset < offset2) {
        idx += exponent;
        exponent *= 2;
      }
      return bs(props2, gridCache, floor$1(idx / 2), min$3(idx, total2 - 1), offset2, type);
    };
    const findItem = (props2, gridCache, offset2, type) => {
      const [cache2, lastVisitedIndex] = [
        gridCache[type],
        gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
      ];
      const lastVisitedItemOffset = lastVisitedIndex > 0 ? cache2[lastVisitedIndex].offset : 0;
      if (lastVisitedItemOffset >= offset2) {
        return bs(props2, gridCache, 0, lastVisitedIndex, offset2, type);
      }
      return es(props2, gridCache, max$3(0, lastVisitedIndex), offset2, type);
    };
    const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
      let sizeOfVisitedRows = 0;
      if (lastVisitedRowIndex >= totalRow) {
        lastVisitedRowIndex = totalRow - 1;
      }
      if (lastVisitedRowIndex >= 0) {
        const item = row[lastVisitedRowIndex];
        sizeOfVisitedRows = item.offset + item.size;
      }
      const unvisitedItems = totalRow - lastVisitedRowIndex - 1;
      const sizeOfUnvisitedItems = unvisitedItems * estimatedRowHeight;
      return sizeOfVisitedRows + sizeOfUnvisitedItems;
    };
    const getEstimatedTotalWidth = ({ totalColumn }, { column, estimatedColumnWidth, lastVisitedColumnIndex }) => {
      let sizeOfVisitedColumns = 0;
      if (lastVisitedColumnIndex > totalColumn) {
        lastVisitedColumnIndex = totalColumn - 1;
      }
      if (lastVisitedColumnIndex >= 0) {
        const item = column[lastVisitedColumnIndex];
        sizeOfVisitedColumns = item.offset + item.size;
      }
      const unvisitedItems = totalColumn - lastVisitedColumnIndex - 1;
      const sizeOfUnvisitedItems = unvisitedItems * estimatedColumnWidth;
      return sizeOfVisitedColumns + sizeOfUnvisitedItems;
    };
    const ACCESS_ESTIMATED_SIZE_KEY_MAP = {
      column: getEstimatedTotalWidth,
      row: getEstimatedTotalHeight
    };
    const getOffset = (props2, index, alignment, scrollOffset, cache2, type, scrollBarWidth2) => {
      const [size, estimatedSizeAssociates] = [
        type === "row" ? props2.height : props2.width,
        ACCESS_ESTIMATED_SIZE_KEY_MAP[type]
      ];
      const item = getItemFromCache(props2, index, cache2, type);
      const estimatedSize = estimatedSizeAssociates(props2, cache2);
      const maxOffset = max$3(0, min$3(estimatedSize - size, item.offset));
      const minOffset = max$3(0, item.offset - size + scrollBarWidth2 + item.size);
      if (alignment === SMART_ALIGNMENT) {
        if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
          alignment = AUTO_ALIGNMENT;
        } else {
          alignment = CENTERED_ALIGNMENT;
        }
      }
      switch (alignment) {
        case START_ALIGNMENT: {
          return maxOffset;
        }
        case END_ALIGNMENT: {
          return minOffset;
        }
        case CENTERED_ALIGNMENT: {
          return Math.round(minOffset + (maxOffset - minOffset) / 2);
        }
        case AUTO_ALIGNMENT:
        default: {
          if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
            return scrollOffset;
          } else if (minOffset > maxOffset) {
            return minOffset;
          } else if (scrollOffset < minOffset) {
            return minOffset;
          } else {
            return maxOffset;
          }
        }
      }
    };
    const DynamicSizeGrid = createGrid({
      name: "ElDynamicSizeGrid",
      getColumnPosition: (props2, idx, cache2) => {
        const item = getItemFromCache(props2, idx, cache2, "column");
        return [item.size, item.offset];
      },
      getRowPosition: (props2, idx, cache2) => {
        const item = getItemFromCache(props2, idx, cache2, "row");
        return [item.size, item.offset];
      },
      getColumnOffset: (props2, columnIndex, alignment, scrollLeft, cache2, scrollBarWidth2) => getOffset(props2, columnIndex, alignment, scrollLeft, cache2, "column", scrollBarWidth2),
      getRowOffset: (props2, rowIndex, alignment, scrollTop, cache2, scrollBarWidth2) => getOffset(props2, rowIndex, alignment, scrollTop, cache2, "row", scrollBarWidth2),
      getColumnStartIndexForOffset: (props2, scrollLeft, cache2) => findItem(props2, cache2, scrollLeft, "column"),
      getColumnStopIndexForStartIndex: (props2, startIndex, scrollLeft, cache2) => {
        const item = getItemFromCache(props2, startIndex, cache2, "column");
        const maxOffset = scrollLeft + props2.width;
        let offset2 = item.offset + item.size;
        let stopIndex = startIndex;
        while (stopIndex < props2.totalColumn - 1 && offset2 < maxOffset) {
          stopIndex++;
          offset2 += getItemFromCache(props2, startIndex, cache2, "column").size;
        }
        return stopIndex;
      },
      getEstimatedTotalHeight,
      getEstimatedTotalWidth,
      getRowStartIndexForOffset: (props2, scrollTop, cache2) => findItem(props2, cache2, scrollTop, "row"),
      getRowStopIndexForStartIndex: (props2, startIndex, scrollTop, cache2) => {
        const { totalRow, height } = props2;
        const item = getItemFromCache(props2, startIndex, cache2, "row");
        const maxOffset = scrollTop + height;
        let offset2 = item.size + item.offset;
        let stopIndex = startIndex;
        while (stopIndex < totalRow - 1 && offset2 < maxOffset) {
          stopIndex++;
          offset2 += getItemFromCache(props2, stopIndex, cache2, "row").size;
        }
        return stopIndex;
      },
      injectToInstance: (instance, cache2) => {
        const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => {
          var _a2, _b2;
          forceUpdate = isUndefined$1(forceUpdate) ? true : forceUpdate;
          if (isNumber$2(columnIndex)) {
            cache2.value.lastVisitedColumnIndex = Math.min(cache2.value.lastVisitedColumnIndex, columnIndex - 1);
          }
          if (isNumber$2(rowIndex)) {
            cache2.value.lastVisitedRowIndex = Math.min(cache2.value.lastVisitedRowIndex, rowIndex - 1);
          }
          (_a2 = instance.exposed) == null ? void 0 : _a2.getItemStyleCache.value(-1, null, null);
          if (forceUpdate)
            (_b2 = instance.proxy) == null ? void 0 : _b2.$forceUpdate();
        };
        const resetAfterColumnIndex = (columnIndex, forceUpdate) => {
          resetAfter({
            columnIndex
          }, forceUpdate);
        };
        const resetAfterRowIndex = (rowIndex, forceUpdate) => {
          resetAfter({
            rowIndex
          }, forceUpdate);
        };
        Object.assign(instance.proxy, {
          resetAfterColumnIndex,
          resetAfterRowIndex,
          resetAfter
        });
      },
      initCache: ({
        estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE,
        estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE
      }) => {
        const cache2 = {
          column: {},
          estimatedColumnWidth,
          estimatedRowHeight,
          lastVisitedColumnIndex: -1,
          lastVisitedRowIndex: -1,
          row: {}
        };
        return cache2;
      },
      clearCache: false,
      validateProps: ({ columnWidth, rowHeight }) => {
      }
    });
    const FixedSizeGrid = createGrid({
      name: "ElFixedSizeGrid",
      getColumnPosition: ({ columnWidth }, index) => [
        columnWidth,
        index * columnWidth
      ],
      getRowPosition: ({ rowHeight }, index) => [
        rowHeight,
        index * rowHeight
      ],
      getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow,
      getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn,
      getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _2, scrollBarWidth2) => {
        width = Number(width);
        const lastColumnOffset = Math.max(0, totalColumn * columnWidth - width);
        const maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth);
        const minOffset = Math.max(0, columnIndex * columnWidth - width + scrollBarWidth2 + columnWidth);
        if (alignment === "smart") {
          if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) {
            alignment = AUTO_ALIGNMENT;
          } else {
            alignment = CENTERED_ALIGNMENT;
          }
        }
        switch (alignment) {
          case START_ALIGNMENT:
            return maxOffset;
          case END_ALIGNMENT:
            return minOffset;
          case CENTERED_ALIGNMENT: {
            const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
            if (middleOffset < Math.ceil(width / 2)) {
              return 0;
            } else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) {
              return lastColumnOffset;
            } else {
              return middleOffset;
            }
          }
          case AUTO_ALIGNMENT:
          default:
            if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
              return scrollLeft;
            } else if (minOffset > maxOffset) {
              return minOffset;
            } else if (scrollLeft < minOffset) {
              return minOffset;
            } else {
              return maxOffset;
            }
        }
      },
      getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _2, scrollBarWidth2) => {
        height = Number(height);
        const lastRowOffset = Math.max(0, totalRow * rowHeight - height);
        const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
        const minOffset = Math.max(0, rowIndex * rowHeight - height + scrollBarWidth2 + rowHeight);
        if (align === SMART_ALIGNMENT) {
          if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) {
            align = AUTO_ALIGNMENT;
          } else {
            align = CENTERED_ALIGNMENT;
          }
        }
        switch (align) {
          case START_ALIGNMENT:
            return maxOffset;
          case END_ALIGNMENT:
            return minOffset;
          case CENTERED_ALIGNMENT: {
            const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
            if (middleOffset < Math.ceil(height / 2)) {
              return 0;
            } else if (middleOffset > lastRowOffset + Math.floor(height / 2)) {
              return lastRowOffset;
            } else {
              return middleOffset;
            }
          }
          case AUTO_ALIGNMENT:
          default:
            if (scrollTop >= minOffset && scrollTop <= maxOffset) {
              return scrollTop;
            } else if (minOffset > maxOffset) {
              return minOffset;
            } else if (scrollTop < minOffset) {
              return minOffset;
            } else {
              return maxOffset;
            }
        }
      },
      getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(0, Math.min(totalColumn - 1, Math.floor(scrollLeft / columnWidth))),
      getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => {
        const left = startIndex * columnWidth;
        const visibleColumnsCount = Math.ceil((width + scrollLeft - left) / columnWidth);
        return Math.max(0, Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1));
      },
      getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(0, Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))),
      getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => {
        const top = startIndex * rowHeight;
        const numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight);
        return Math.max(0, Math.min(totalRow - 1, startIndex + numVisibleRows - 1));
      },
      initCache: () => void 0,
      clearCache: true,
      validateProps: ({ columnWidth, rowHeight }) => {
      }
    });
    const COMPONENT_NAME$6 = "ElTableV2Grid";
    const useTableGrid = (props2) => {
      const headerRef = ref();
      const bodyRef = ref();
      const scrollLeft = ref(0);
      const totalHeight = computed(() => {
        const {
          data,
          rowHeight,
          estimatedRowHeight
        } = props2;
        if (estimatedRowHeight) {
          return;
        }
        return data.length * rowHeight;
      });
      const fixedRowHeight = computed(() => {
        const {
          fixedData,
          rowHeight
        } = props2;
        return ((fixedData == null ? void 0 : fixedData.length) || 0) * rowHeight;
      });
      const headerHeight = computed(() => sum$1(props2.headerHeight));
      const gridHeight = computed(() => {
        const {
          height
        } = props2;
        return Math.max(0, height - unref(headerHeight) - unref(fixedRowHeight));
      });
      const hasHeader = computed(() => {
        return unref(headerHeight) + unref(fixedRowHeight) > 0;
      });
      const itemKey = ({
        data,
        rowIndex
      }) => data[rowIndex][props2.rowKey];
      function onItemRendered({
        rowCacheStart,
        rowCacheEnd,
        rowVisibleStart,
        rowVisibleEnd
      }) {
        var _a2;
        (_a2 = props2.onRowsRendered) == null ? void 0 : _a2.call(props2, {
          rowCacheStart,
          rowCacheEnd,
          rowVisibleStart,
          rowVisibleEnd
        });
      }
      function resetAfterRowIndex(index, forceUpdate2) {
        var _a2;
        (_a2 = bodyRef.value) == null ? void 0 : _a2.resetAfterRowIndex(index, forceUpdate2);
      }
      function scrollTo(leftOrOptions, top) {
        const header$ = unref(headerRef);
        const body$ = unref(bodyRef);
        if (isObject$7(leftOrOptions)) {
          header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions.scrollLeft);
          scrollLeft.value = leftOrOptions.scrollLeft;
          body$ == null ? void 0 : body$.scrollTo(leftOrOptions);
        } else {
          header$ == null ? void 0 : header$.scrollToLeft(leftOrOptions);
          scrollLeft.value = leftOrOptions;
          body$ == null ? void 0 : body$.scrollTo({
            scrollLeft: leftOrOptions,
            scrollTop: top
          });
        }
      }
      function scrollToTop(scrollTop) {
        var _a2;
        (_a2 = unref(bodyRef)) == null ? void 0 : _a2.scrollTo({
          scrollTop
        });
      }
      function scrollToRow(row, strategy) {
        var _a2;
        (_a2 = unref(bodyRef)) == null ? void 0 : _a2.scrollToItem(row, 1, strategy);
      }
      function forceUpdate() {
        var _a2, _b2;
        (_a2 = unref(bodyRef)) == null ? void 0 : _a2.$forceUpdate();
        (_b2 = unref(headerRef)) == null ? void 0 : _b2.$forceUpdate();
      }
      watch(() => props2.bodyWidth, () => {
        var _a2;
        if (isNumber$2(props2.estimatedRowHeight))
          (_a2 = bodyRef.value) == null ? void 0 : _a2.resetAfter({
            columnIndex: 0
          }, false);
      });
      return {
        bodyRef,
        forceUpdate,
        fixedRowHeight,
        gridHeight,
        hasHeader,
        headerHeight,
        headerRef,
        totalHeight,
        itemKey,
        onItemRendered,
        resetAfterRowIndex,
        scrollTo,
        scrollToTop,
        scrollToRow,
        scrollLeft
      };
    };
    const TableGrid = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$6,
      props: tableV2GridProps,
      setup(props2, {
        slots,
        expose
      }) {
        const {
          ns
        } = inject(TableV2InjectionKey);
        const {
          bodyRef,
          fixedRowHeight,
          gridHeight,
          hasHeader,
          headerRef,
          headerHeight,
          totalHeight,
          forceUpdate,
          itemKey,
          onItemRendered,
          resetAfterRowIndex,
          scrollTo,
          scrollToTop,
          scrollToRow,
          scrollLeft
        } = useTableGrid(props2);
        provide("tableV2GridScrollLeft", scrollLeft);
        expose({
          forceUpdate,
          totalHeight,
          scrollTo,
          scrollToTop,
          scrollToRow,
          resetAfterRowIndex
        });
        const getColumnWidth = () => props2.bodyWidth;
        return () => {
          const {
            cache: cache2,
            columns: columns2,
            data,
            fixedData,
            useIsScrolling,
            scrollbarAlwaysOn,
            scrollbarEndGap,
            scrollbarStartGap,
            style,
            rowHeight,
            bodyWidth,
            estimatedRowHeight,
            headerWidth,
            height,
            width,
            getRowHeight,
            onScroll
          } = props2;
          const isDynamicRowEnabled = isNumber$2(estimatedRowHeight);
          const Grid2 = isDynamicRowEnabled ? DynamicSizeGrid : FixedSizeGrid;
          const _headerHeight = unref(headerHeight);
          return createVNode$1("div", {
            "role": "table",
            "class": [ns.e("table"), props2.class],
            "style": style
          }, [createVNode$1(Grid2, {
            "ref": bodyRef,
            "data": data,
            "useIsScrolling": useIsScrolling,
            "itemKey": itemKey,
            "columnCache": 0,
            "columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth,
            "totalColumn": 1,
            "totalRow": data.length,
            "rowCache": cache2,
            "rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight,
            "width": width,
            "height": unref(gridHeight),
            "class": ns.e("body"),
            "role": "rowgroup",
            "scrollbarStartGap": scrollbarStartGap,
            "scrollbarEndGap": scrollbarEndGap,
            "scrollbarAlwaysOn": scrollbarAlwaysOn,
            "onScroll": onScroll,
            "onItemRendered": onItemRendered,
            "perfMode": false
          }, {
            default: (params) => {
              var _a2;
              const rowData = data[params.rowIndex];
              return (_a2 = slots.row) == null ? void 0 : _a2.call(slots, {
                ...params,
                columns: columns2,
                rowData
              });
            }
          }), unref(hasHeader) && createVNode$1(Header$1, {
            "ref": headerRef,
            "class": ns.e("header-wrapper"),
            "columns": columns2,
            "headerData": data,
            "headerHeight": props2.headerHeight,
            "fixedHeaderData": fixedData,
            "rowWidth": headerWidth,
            "rowHeight": rowHeight,
            "width": width,
            "height": Math.min(_headerHeight + unref(fixedRowHeight), height)
          }, {
            dynamic: slots.header,
            fixed: slots.row
          })]);
        };
      }
    });
    var Table = TableGrid;
    function _isSlot$5(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const MainTable = (props2, {
      slots
    }) => {
      const {
        mainTableRef,
        ...rest
      } = props2;
      return createVNode$1(Table, mergeProps({
        "ref": mainTableRef
      }, rest), _isSlot$5(slots) ? slots : {
        default: () => [slots]
      });
    };
    var MainTable$1 = MainTable;
    function _isSlot$4(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const LeftTable$1 = (props2, {
      slots
    }) => {
      if (!props2.columns.length)
        return;
      const {
        leftTableRef,
        ...rest
      } = props2;
      return createVNode$1(Table, mergeProps({
        "ref": leftTableRef
      }, rest), _isSlot$4(slots) ? slots : {
        default: () => [slots]
      });
    };
    var LeftTable$1$1 = LeftTable$1;
    function _isSlot$3(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const LeftTable = (props2, {
      slots
    }) => {
      if (!props2.columns.length)
        return;
      const {
        rightTableRef,
        ...rest
      } = props2;
      return createVNode$1(Table, mergeProps({
        "ref": rightTableRef
      }, rest), _isSlot$3(slots) ? slots : {
        default: () => [slots]
      });
    };
    var RightTable = LeftTable;
    const useTableRow = (props2) => {
      const {
        isScrolling
      } = inject(TableV2InjectionKey);
      const measured = ref(false);
      const rowRef = ref();
      const measurable = computed(() => {
        return isNumber$2(props2.estimatedRowHeight) && props2.rowIndex >= 0;
      });
      const doMeasure = (isInit = false) => {
        const $rowRef = unref(rowRef);
        if (!$rowRef)
          return;
        const {
          columns: columns2,
          onRowHeightChange,
          rowKey: rowKey2,
          rowIndex,
          style
        } = props2;
        const {
          height
        } = $rowRef.getBoundingClientRect();
        measured.value = true;
        nextTick(() => {
          if (isInit || height !== Number.parseInt(style.height)) {
            const firstColumn = columns2[0];
            const isPlaceholder = (firstColumn == null ? void 0 : firstColumn.placeholderSign) === placeholderSign;
            onRowHeightChange == null ? void 0 : onRowHeightChange({
              rowKey: rowKey2,
              height,
              rowIndex
            }, firstColumn && !isPlaceholder && firstColumn.fixed);
          }
        });
      };
      const eventHandlers = computed(() => {
        const {
          rowData,
          rowIndex,
          rowKey: rowKey2,
          onRowHover
        } = props2;
        const handlers2 = props2.rowEventHandlers || {};
        const eventHandlers2 = {};
        Object.entries(handlers2).forEach(([eventName, handler]) => {
          if (isFunction$4(handler)) {
            eventHandlers2[eventName] = (event) => {
              handler({
                event,
                rowData,
                rowIndex,
                rowKey: rowKey2
              });
            };
          }
        });
        if (onRowHover) {
          [{
            name: "onMouseleave",
            hovered: false
          }, {
            name: "onMouseenter",
            hovered: true
          }].forEach(({
            name,
            hovered
          }) => {
            const existedHandler = eventHandlers2[name];
            eventHandlers2[name] = (event) => {
              onRowHover({
                event,
                hovered,
                rowData,
                rowIndex,
                rowKey: rowKey2
              });
              existedHandler == null ? void 0 : existedHandler(event);
            };
          });
        }
        return eventHandlers2;
      });
      const onExpand = (expanded) => {
        const {
          onRowExpand,
          rowData,
          rowIndex,
          rowKey: rowKey2
        } = props2;
        onRowExpand == null ? void 0 : onRowExpand({
          expanded,
          rowData,
          rowIndex,
          rowKey: rowKey2
        });
      };
      onMounted(() => {
        if (unref(measurable)) {
          doMeasure(true);
        }
      });
      return {
        isScrolling,
        measurable,
        measured,
        rowRef,
        eventHandlers,
        onExpand
      };
    };
    const COMPONENT_NAME$5 = "ElTableV2TableRow";
    const TableV2Row = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$5,
      props: tableV2RowProps,
      setup(props2, {
        expose,
        slots,
        attrs
      }) {
        const {
          eventHandlers,
          isScrolling,
          measurable,
          measured,
          rowRef,
          onExpand
        } = useTableRow(props2);
        expose({
          onExpand
        });
        return () => {
          const {
            columns: columns2,
            columnsStyles,
            expandColumnKey: expandColumnKey2,
            depth,
            rowData,
            rowIndex,
            style
          } = props2;
          let ColumnCells = columns2.map((column, columnIndex) => {
            const expandable = isArray$5(rowData.children) && rowData.children.length > 0 && column.key === expandColumnKey2;
            return slots.cell({
              column,
              columns: columns2,
              columnIndex,
              depth,
              style: columnsStyles[column.key],
              rowData,
              rowIndex,
              isScrolling: unref(isScrolling),
              expandIconProps: expandable ? {
                rowData,
                rowIndex,
                onExpand
              } : void 0
            });
          });
          if (slots.row) {
            ColumnCells = slots.row({
              cells: ColumnCells.map((node) => {
                if (isArray$5(node) && node.length === 1) {
                  return node[0];
                }
                return node;
              }),
              style,
              columns: columns2,
              depth,
              rowData,
              rowIndex,
              isScrolling: unref(isScrolling)
            });
          }
          if (unref(measurable)) {
            const {
              height,
              ...exceptHeightStyle
            } = style || {};
            const _measured = unref(measured);
            return createVNode$1("div", mergeProps({
              "ref": rowRef,
              "class": props2.class,
              "style": _measured ? style : exceptHeightStyle,
              "role": "row"
            }, attrs, unref(eventHandlers)), [ColumnCells]);
          }
          return createVNode$1("div", mergeProps(attrs, {
            "ref": rowRef,
            "class": props2.class,
            "style": style,
            "role": "row"
          }, unref(eventHandlers)), [ColumnCells]);
        };
      }
    });
    var Row$1 = TableV2Row;
    function _isSlot$2(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const RowRenderer = (props2, {
      slots
    }) => {
      const {
        columns: columns2,
        columnsStyles,
        depthMap,
        expandColumnKey: expandColumnKey2,
        expandedRowKeys,
        estimatedRowHeight,
        hasFixedColumns,
        rowData,
        rowIndex,
        style,
        isScrolling,
        rowProps: rowProps2,
        rowClass,
        rowKey: rowKey2,
        rowEventHandlers,
        ns,
        onRowHovered,
        onRowExpanded
      } = props2;
      const rowKls = tryCall(rowClass, {
        columns: columns2,
        rowData,
        rowIndex
      }, "");
      const additionalProps = tryCall(rowProps2, {
        columns: columns2,
        rowData,
        rowIndex
      });
      const _rowKey = rowData[rowKey2];
      const depth = depthMap[_rowKey] || 0;
      const canExpand = Boolean(expandColumnKey2);
      const isFixedRow = rowIndex < 0;
      const kls = [ns.e("row"), rowKls, {
        [ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0,
        [ns.is("expanded")]: canExpand && expandedRowKeys.includes(_rowKey),
        [ns.is("fixed")]: !depth && isFixedRow,
        [ns.is("customized")]: Boolean(slots.row)
      }];
      const onRowHover = hasFixedColumns ? onRowHovered : void 0;
      const _rowProps = {
        ...additionalProps,
        columns: columns2,
        columnsStyles,
        class: kls,
        depth,
        expandColumnKey: expandColumnKey2,
        estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
        isScrolling,
        rowIndex,
        rowData,
        rowKey: _rowKey,
        rowEventHandlers,
        style
      };
      const handlerMosueEnter = (e2) => {
        onRowHover == null ? void 0 : onRowHover({
          hovered: true,
          rowKey: _rowKey,
          event: e2,
          rowData,
          rowIndex
        });
      };
      const handlerMouseLeave = (e2) => {
        onRowHover == null ? void 0 : onRowHover({
          hovered: false,
          rowKey: _rowKey,
          event: e2,
          rowData,
          rowIndex
        });
      };
      return createVNode$1(Row$1, mergeProps(_rowProps, {
        "onRowExpand": onRowExpanded,
        "onMouseenter": handlerMosueEnter,
        "onMouseleave": handlerMouseLeave,
        "rowkey": _rowKey
      }), _isSlot$2(slots) ? slots : {
        default: () => [slots]
      });
    };
    var Row = RowRenderer;
    const TableV2Cell = (props2, {
      slots
    }) => {
      var _a2;
      const {
        cellData,
        style
      } = props2;
      const displayText = ((_a2 = cellData == null ? void 0 : cellData.toString) == null ? void 0 : _a2.call(cellData)) || "";
      const defaultSlot = renderSlot(slots, "default", props2, () => [displayText]);
      return createVNode$1("div", {
        "class": props2.class,
        "title": displayText,
        "style": style
      }, [defaultSlot]);
    };
    TableV2Cell.displayName = "ElTableV2Cell";
    TableV2Cell.inheritAttrs = false;
    var TableCell = TableV2Cell;
    const ExpandIcon = (props2) => {
      const {
        expanded,
        expandable,
        onExpand,
        style,
        size
      } = props2;
      const expandIconProps = {
        onClick: expandable ? () => onExpand(!expanded) : void 0,
        class: props2.class
      };
      return createVNode$1(ElIcon, mergeProps(expandIconProps, {
        "size": size,
        "style": style
      }), {
        default: () => [createVNode$1(arrow_right_default, null, null)]
      });
    };
    var ExpandIcon$1 = ExpandIcon;
    const CellRenderer = ({
      columns: columns2,
      column,
      columnIndex,
      depth,
      expandIconProps,
      isScrolling,
      rowData,
      rowIndex,
      style,
      expandedRowKeys,
      ns,
      cellProps: _cellProps,
      expandColumnKey: expandColumnKey2,
      indentSize,
      iconSize,
      rowKey: rowKey2
    }, {
      slots
    }) => {
      const cellStyle = enforceUnit(style);
      if (column.placeholderSign === placeholderSign) {
        return createVNode$1("div", {
          "class": ns.em("row-cell", "placeholder"),
          "style": cellStyle
        }, null);
      }
      const {
        cellRenderer,
        dataKey,
        dataGetter
      } = column;
      const cellData = isFunction$4(dataGetter) ? dataGetter({
        columns: columns2,
        column,
        columnIndex,
        rowData,
        rowIndex
      }) : get$1(rowData, dataKey != null ? dataKey : "");
      const extraCellProps = tryCall(_cellProps, {
        cellData,
        columns: columns2,
        column,
        columnIndex,
        rowIndex,
        rowData
      });
      const cellProps = {
        class: ns.e("cell-text"),
        columns: columns2,
        column,
        columnIndex,
        cellData,
        isScrolling,
        rowData,
        rowIndex
      };
      const columnCellRenderer = componentToSlot(cellRenderer);
      const Cell2 = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode$1(TableCell, cellProps, null)]);
      const kls = [ns.e("row-cell"), column.class, column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right")];
      const expandable = rowIndex >= 0 && expandColumnKey2 && column.key === expandColumnKey2;
      const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey2]);
      let IconOrPlaceholder;
      const iconStyle = `margin-inline-start: ${depth * indentSize}px;`;
      if (expandable) {
        if (isObject$7(expandIconProps)) {
          IconOrPlaceholder = createVNode$1(ExpandIcon$1, mergeProps(expandIconProps, {
            "class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
            "size": iconSize,
            "expanded": expanded,
            "style": iconStyle,
            "expandable": true
          }), null);
        } else {
          IconOrPlaceholder = createVNode$1("div", {
            "style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ")
          }, null);
        }
      }
      return createVNode$1("div", mergeProps({
        "class": kls,
        "style": cellStyle
      }, extraCellProps, {
        "role": "cell"
      }), [IconOrPlaceholder, Cell2]);
    };
    CellRenderer.inheritAttrs = false;
    var Cell = CellRenderer;
    const tableV2HeaderRowProps = buildProps({
      class: String,
      columns,
      columnsStyles: {
        type: definePropType(Object),
        required: true
      },
      headerIndex: Number,
      style: { type: definePropType(Object) }
    });
    const TableV2HeaderRow = /* @__PURE__ */ defineComponent({
      name: "ElTableV2HeaderRow",
      props: tableV2HeaderRowProps,
      setup(props2, {
        slots
      }) {
        return () => {
          const {
            columns: columns2,
            columnsStyles,
            headerIndex,
            style
          } = props2;
          let Cells = columns2.map((column, columnIndex) => {
            return slots.cell({
              columns: columns2,
              column,
              columnIndex,
              headerIndex,
              style: columnsStyles[column.key]
            });
          });
          if (slots.header) {
            Cells = slots.header({
              cells: Cells.map((node) => {
                if (isArray$5(node) && node.length === 1) {
                  return node[0];
                }
                return node;
              }),
              columns: columns2,
              headerIndex
            });
          }
          return createVNode$1("div", {
            "class": props2.class,
            "style": style,
            "role": "row"
          }, [Cells]);
        };
      }
    });
    var HeaderRow = TableV2HeaderRow;
    function _isSlot$1(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const HeaderRenderer = ({
      columns: columns2,
      columnsStyles,
      headerIndex,
      style,
      headerClass,
      headerProps,
      ns
    }, {
      slots
    }) => {
      const param = {
        columns: columns2,
        headerIndex
      };
      const kls = [ns.e("header-row"), tryCall(headerClass, param, ""), {
        [ns.is("customized")]: Boolean(slots.header)
      }];
      const extraProps = {
        ...tryCall(headerProps, param),
        columnsStyles,
        class: kls,
        columns: columns2,
        headerIndex,
        style
      };
      return createVNode$1(HeaderRow, extraProps, _isSlot$1(slots) ? slots : {
        default: () => [slots]
      });
    };
    var Header = HeaderRenderer;
    const HeaderCell$1 = (props2, {
      slots
    }) => renderSlot(slots, "default", props2, () => {
      var _a2, _b2;
      return [createVNode$1("div", {
        "class": props2.class,
        "title": (_a2 = props2.column) == null ? void 0 : _a2.title
      }, [(_b2 = props2.column) == null ? void 0 : _b2.title])];
    });
    HeaderCell$1.displayName = "ElTableV2HeaderCell";
    HeaderCell$1.inheritAttrs = false;
    var HeaderCell$1$1 = HeaderCell$1;
    const SortIcon = (props2) => {
      const {
        sortOrder
      } = props2;
      return createVNode$1(ElIcon, {
        "size": 14,
        "class": props2.class
      }, {
        default: () => [sortOrder === SortOrder.ASC ? createVNode$1(sort_up_default, null, null) : createVNode$1(sort_down_default, null, null)]
      });
    };
    var SortIcon$1 = SortIcon;
    const HeaderCellRenderer = (props2, {
      slots
    }) => {
      const {
        column,
        ns,
        style,
        onColumnSorted
      } = props2;
      const cellStyle = enforceUnit(style);
      if (column.placeholderSign === placeholderSign) {
        return createVNode$1("div", {
          "class": ns.em("header-row-cell", "placeholder"),
          "style": cellStyle
        }, null);
      }
      const {
        headerCellRenderer,
        headerClass,
        sortable
      } = column;
      const cellProps = {
        ...props2,
        class: ns.e("header-cell-text")
      };
      const columnCellRenderer = componentToSlot(headerCellRenderer);
      const Cell2 = columnCellRenderer ? columnCellRenderer(cellProps) : renderSlot(slots, "default", cellProps, () => [createVNode$1(HeaderCell$1$1, cellProps, null)]);
      const {
        sortBy,
        sortState,
        headerCellProps
      } = props2;
      let sorting, sortOrder;
      if (sortState) {
        const order = sortState[column.key];
        sorting = Boolean(oppositeOrderMap[order]);
        sortOrder = sorting ? order : SortOrder.ASC;
      } else {
        sorting = column.key === sortBy.key;
        sortOrder = sorting ? sortBy.order : SortOrder.ASC;
      }
      const cellKls = [ns.e("header-cell"), tryCall(headerClass, props2, ""), column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right"), sortable && ns.is("sortable")];
      const cellWrapperProps = {
        ...tryCall(headerCellProps, props2),
        onClick: column.sortable ? onColumnSorted : void 0,
        class: cellKls,
        style: cellStyle,
        ["data-key"]: column.key
      };
      return createVNode$1("div", mergeProps(cellWrapperProps, {
        "role": "columnheader"
      }), [Cell2, sortable && createVNode$1(SortIcon$1, {
        "class": [ns.e("sort-icon"), sorting && ns.is("sorting")],
        "sortOrder": sortOrder
      }, null)]);
    };
    var HeaderCell = HeaderCellRenderer;
    const Footer$1 = (props2, {
      slots
    }) => {
      var _a2;
      return createVNode$1("div", {
        "class": props2.class,
        "style": props2.style
      }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]);
    };
    Footer$1.displayName = "ElTableV2Footer";
    var Footer$1$1 = Footer$1;
    const Footer = (props2, {
      slots
    }) => {
      const defaultSlot = renderSlot(slots, "default", {}, () => [createVNode$1(ElEmpty, null, null)]);
      return createVNode$1("div", {
        "class": props2.class,
        "style": props2.style
      }, [defaultSlot]);
    };
    Footer.displayName = "ElTableV2Empty";
    var Empty = Footer;
    const Overlay = (props2, {
      slots
    }) => {
      var _a2;
      return createVNode$1("div", {
        "class": props2.class,
        "style": props2.style
      }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]);
    };
    Overlay.displayName = "ElTableV2Overlay";
    var Overlay$1 = Overlay;
    function _isSlot(s2) {
      return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
    }
    const COMPONENT_NAME$4 = "ElTableV2";
    const TableV2 = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$4,
      props: tableV2Props,
      setup(props2, {
        slots,
        expose
      }) {
        const ns = useNamespace("table-v2");
        const {
          columnsStyles,
          fixedColumnsOnLeft,
          fixedColumnsOnRight,
          mainColumns,
          mainTableHeight,
          fixedTableHeight,
          leftTableWidth,
          rightTableWidth,
          data,
          depthMap,
          expandedRowKeys,
          hasFixedColumns,
          mainTableRef,
          leftTableRef,
          rightTableRef,
          isDynamic,
          isResetting,
          isScrolling,
          bodyWidth,
          emptyStyle,
          rootStyle,
          headerWidth,
          footerHeight,
          showEmpty,
          scrollTo,
          scrollToLeft,
          scrollToTop,
          scrollToRow,
          getRowHeight,
          onColumnSorted,
          onRowHeightChange,
          onRowHovered,
          onRowExpanded,
          onRowsRendered,
          onScroll,
          onVerticalScroll
        } = useTable(props2);
        expose({
          scrollTo,
          scrollToLeft,
          scrollToTop,
          scrollToRow
        });
        provide(TableV2InjectionKey, {
          ns,
          isResetting,
          isScrolling
        });
        return () => {
          const {
            cache: cache2,
            cellProps,
            estimatedRowHeight,
            expandColumnKey: expandColumnKey2,
            fixedData,
            headerHeight,
            headerClass,
            headerProps,
            headerCellProps,
            sortBy,
            sortState,
            rowHeight,
            rowClass,
            rowEventHandlers,
            rowKey: rowKey2,
            rowProps: rowProps2,
            scrollbarAlwaysOn,
            indentSize,
            iconSize,
            useIsScrolling,
            vScrollbarSize,
            width
          } = props2;
          const _data = unref(data);
          const mainTableProps = {
            cache: cache2,
            class: ns.e("main"),
            columns: unref(mainColumns),
            data: _data,
            fixedData,
            estimatedRowHeight,
            bodyWidth: unref(bodyWidth) + vScrollbarSize,
            headerHeight,
            headerWidth: unref(headerWidth),
            height: unref(mainTableHeight),
            mainTableRef,
            rowKey: rowKey2,
            rowHeight,
            scrollbarAlwaysOn,
            scrollbarStartGap: 2,
            scrollbarEndGap: vScrollbarSize,
            useIsScrolling,
            width,
            getRowHeight,
            onRowsRendered,
            onScroll
          };
          const leftColumnsWidth = unref(leftTableWidth);
          const _fixedTableHeight = unref(fixedTableHeight);
          const leftTableProps = {
            cache: cache2,
            class: ns.e("left"),
            columns: unref(fixedColumnsOnLeft),
            data: _data,
            fixedData,
            estimatedRowHeight,
            leftTableRef,
            rowHeight,
            bodyWidth: leftColumnsWidth,
            headerWidth: leftColumnsWidth,
            headerHeight,
            height: _fixedTableHeight,
            rowKey: rowKey2,
            scrollbarAlwaysOn,
            scrollbarStartGap: 2,
            scrollbarEndGap: vScrollbarSize,
            useIsScrolling,
            width: leftColumnsWidth,
            getRowHeight,
            onScroll: onVerticalScroll
          };
          const rightColumnsWidth = unref(rightTableWidth);
          const rightColumnsWidthWithScrollbar = rightColumnsWidth + vScrollbarSize;
          const rightTableProps = {
            cache: cache2,
            class: ns.e("right"),
            columns: unref(fixedColumnsOnRight),
            data: _data,
            fixedData,
            estimatedRowHeight,
            rightTableRef,
            rowHeight,
            bodyWidth: rightColumnsWidthWithScrollbar,
            headerWidth: rightColumnsWidthWithScrollbar,
            headerHeight,
            height: _fixedTableHeight,
            rowKey: rowKey2,
            scrollbarAlwaysOn,
            scrollbarStartGap: 2,
            scrollbarEndGap: vScrollbarSize,
            width: rightColumnsWidthWithScrollbar,
            style: `--${unref(ns.namespace)}-table-scrollbar-size: ${vScrollbarSize}px`,
            useIsScrolling,
            getRowHeight,
            onScroll: onVerticalScroll
          };
          const _columnsStyles = unref(columnsStyles);
          const tableRowProps = {
            ns,
            depthMap: unref(depthMap),
            columnsStyles: _columnsStyles,
            expandColumnKey: expandColumnKey2,
            expandedRowKeys: unref(expandedRowKeys),
            estimatedRowHeight,
            hasFixedColumns: unref(hasFixedColumns),
            rowProps: rowProps2,
            rowClass,
            rowKey: rowKey2,
            rowEventHandlers,
            onRowHovered,
            onRowExpanded,
            onRowHeightChange
          };
          const tableCellProps = {
            cellProps,
            expandColumnKey: expandColumnKey2,
            indentSize,
            iconSize,
            rowKey: rowKey2,
            expandedRowKeys: unref(expandedRowKeys),
            ns
          };
          const tableHeaderProps = {
            ns,
            headerClass,
            headerProps,
            columnsStyles: _columnsStyles
          };
          const tableHeaderCellProps = {
            ns,
            sortBy,
            sortState,
            headerCellProps,
            onColumnSorted
          };
          const tableSlots = {
            row: (props22) => createVNode$1(Row, mergeProps(props22, tableRowProps), {
              row: slots.row,
              cell: (props3) => {
                let _slot;
                return slots.cell ? createVNode$1(Cell, mergeProps(props3, tableCellProps, {
                  "style": _columnsStyles[props3.column.key]
                }), _isSlot(_slot = slots.cell(props3)) ? _slot : {
                  default: () => [_slot]
                }) : createVNode$1(Cell, mergeProps(props3, tableCellProps, {
                  "style": _columnsStyles[props3.column.key]
                }), null);
              }
            }),
            header: (props22) => createVNode$1(Header, mergeProps(props22, tableHeaderProps), {
              header: slots.header,
              cell: (props3) => {
                let _slot2;
                return slots["header-cell"] ? createVNode$1(HeaderCell, mergeProps(props3, tableHeaderCellProps, {
                  "style": _columnsStyles[props3.column.key]
                }), _isSlot(_slot2 = slots["header-cell"](props3)) ? _slot2 : {
                  default: () => [_slot2]
                }) : createVNode$1(HeaderCell, mergeProps(props3, tableHeaderCellProps, {
                  "style": _columnsStyles[props3.column.key]
                }), null);
              }
            })
          };
          const rootKls = [props2.class, ns.b(), ns.e("root"), {
            [ns.is("dynamic")]: unref(isDynamic)
          }];
          const footerProps = {
            class: ns.e("footer"),
            style: unref(footerHeight)
          };
          return createVNode$1("div", {
            "class": rootKls,
            "style": unref(rootStyle)
          }, [createVNode$1(MainTable$1, mainTableProps, _isSlot(tableSlots) ? tableSlots : {
            default: () => [tableSlots]
          }), createVNode$1(LeftTable$1$1, leftTableProps, _isSlot(tableSlots) ? tableSlots : {
            default: () => [tableSlots]
          }), createVNode$1(RightTable, rightTableProps, _isSlot(tableSlots) ? tableSlots : {
            default: () => [tableSlots]
          }), slots.footer && createVNode$1(Footer$1$1, footerProps, {
            default: slots.footer
          }), unref(showEmpty) && createVNode$1(Empty, {
            "class": ns.e("empty"),
            "style": unref(emptyStyle)
          }, {
            default: slots.empty
          }), slots.overlay && createVNode$1(Overlay$1, {
            "class": ns.e("overlay")
          }, {
            default: slots.overlay
          })]);
        };
      }
    });
    var TableV2$1 = TableV2;
    const autoResizerProps = buildProps({
      disableWidth: Boolean,
      disableHeight: Boolean,
      onResize: {
        type: definePropType(Function)
      }
    });
    const useAutoResize = (props2) => {
      const sizer = ref();
      const width$ = ref(0);
      const height$ = ref(0);
      let resizerStopper;
      onMounted(() => {
        resizerStopper = useResizeObserver(sizer, ([entry]) => {
          const { width, height } = entry.contentRect;
          const { paddingLeft: paddingLeft2, paddingRight: paddingRight2, paddingTop: paddingTop2, paddingBottom: paddingBottom2 } = getComputedStyle(entry.target);
          const left = Number.parseInt(paddingLeft2) || 0;
          const right = Number.parseInt(paddingRight2) || 0;
          const top = Number.parseInt(paddingTop2) || 0;
          const bottom = Number.parseInt(paddingBottom2) || 0;
          width$.value = width - left - right;
          height$.value = height - top - bottom;
        }).stop;
      });
      onBeforeUnmount(() => {
        resizerStopper == null ? void 0 : resizerStopper();
      });
      watch([width$, height$], ([width, height]) => {
        var _a2;
        (_a2 = props2.onResize) == null ? void 0 : _a2.call(props2, {
          width,
          height
        });
      });
      return {
        sizer,
        width: width$,
        height: height$
      };
    };
    const AutoResizer = /* @__PURE__ */ defineComponent({
      name: "ElAutoResizer",
      props: autoResizerProps,
      setup(props2, {
        slots
      }) {
        const ns = useNamespace("auto-resizer");
        const {
          height,
          width,
          sizer
        } = useAutoResize(props2);
        const style = {
          width: "100%",
          height: "100%"
        };
        return () => {
          var _a2;
          return createVNode$1("div", {
            "ref": sizer,
            "class": ns.b(),
            "style": style
          }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots, {
            height: height.value,
            width: width.value
          })]);
        };
      }
    });
    var AutoResizer$1 = AutoResizer;
    const ElTableV2 = withInstall(TableV2$1);
    const ElAutoResizer = withInstall(AutoResizer$1);
    const tabsRootContextKey = Symbol("tabsRootContextKey");
    const tabBarProps = buildProps({
      tabs: {
        type: definePropType(Array),
        default: () => mutable([])
      }
    });
    const COMPONENT_NAME$3 = "ElTabBar";
    const __default__$u = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$3
    });
    const _sfc_main$H = /* @__PURE__ */ defineComponent({
      ...__default__$u,
      props: tabBarProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const instance = getCurrentInstance();
        const rootTabs = inject(tabsRootContextKey);
        if (!rootTabs)
          throwError$1(COMPONENT_NAME$3, "<el-tabs><el-tab-bar /></el-tabs>");
        const ns = useNamespace("tabs");
        const barRef = ref();
        const barStyle = ref();
        const getBarStyle = () => {
          let offset2 = 0;
          let tabSize = 0;
          const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
          const sizeDir = sizeName === "width" ? "x" : "y";
          const position2 = sizeDir === "x" ? "left" : "top";
          props2.tabs.every((tab) => {
            var _a2, _b2;
            const $el = (_b2 = (_a2 = instance.parent) == null ? void 0 : _a2.refs) == null ? void 0 : _b2[`tab-${tab.uid}`];
            if (!$el)
              return false;
            if (!tab.active) {
              return true;
            }
            offset2 = $el[`offset${capitalize$1(position2)}`];
            tabSize = $el[`client${capitalize$1(sizeName)}`];
            const tabStyles = window.getComputedStyle($el);
            if (sizeName === "width") {
              tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
              offset2 += Number.parseFloat(tabStyles.paddingLeft);
            }
            return false;
          });
          return {
            [sizeName]: `${tabSize}px`,
            transform: `translate${capitalize$1(sizeDir)}(${offset2}px)`
          };
        };
        const update = () => barStyle.value = getBarStyle();
        const saveObserver = [];
        const observerTabs = () => {
          var _a2;
          saveObserver.forEach((observer) => observer.stop());
          saveObserver.length = 0;
          const list = (_a2 = instance.parent) == null ? void 0 : _a2.refs;
          if (!list)
            return;
          for (const key in list) {
            if (key.startsWith("tab-")) {
              const _el = list[key];
              if (_el) {
                saveObserver.push(useResizeObserver(_el, update));
              }
            }
          }
        };
        watch(() => props2.tabs, async () => {
          await nextTick();
          update();
          observerTabs();
        }, { immediate: true });
        const barObserever = useResizeObserver(barRef, () => update());
        onBeforeUnmount(() => {
          saveObserver.forEach((observer) => observer.stop());
          saveObserver.length = 0;
          barObserever.stop();
        });
        expose({
          ref: barRef,
          update
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "barRef",
            ref: barRef,
            class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
            style: normalizeStyle$1(barStyle.value)
          }, null, 6);
        };
      }
    });
    var TabBar = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__file", "tab-bar.vue"]]);
    const tabNavProps = buildProps({
      panes: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      currentName: {
        type: [String, Number],
        default: ""
      },
      editable: Boolean,
      type: {
        type: String,
        values: ["card", "border-card", ""],
        default: ""
      },
      stretch: Boolean
    });
    const tabNavEmits = {
      tabClick: (tab, tabName, ev) => ev instanceof Event,
      tabRemove: (tab, ev) => ev instanceof Event
    };
    const COMPONENT_NAME$2 = "ElTabNav";
    const TabNav = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$2,
      props: tabNavProps,
      emits: tabNavEmits,
      setup(props2, {
        expose,
        emit: emit2
      }) {
        const rootTabs = inject(tabsRootContextKey);
        if (!rootTabs)
          throwError$1(COMPONENT_NAME$2, `<el-tabs><tab-nav /></el-tabs>`);
        const ns = useNamespace("tabs");
        const visibility2 = useDocumentVisibility();
        const focused = useWindowFocus();
        const navScroll$ = ref();
        const nav$ = ref();
        const el$ = ref();
        const tabBarRef = ref();
        const scrollable = ref(false);
        const navOffset = ref(0);
        const isFocus = ref(false);
        const focusable = ref(true);
        const sizeName = computed(() => ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height");
        const navStyle = computed(() => {
          const dir3 = sizeName.value === "width" ? "X" : "Y";
          return {
            transform: `translate${dir3}(-${navOffset.value}px)`
          };
        });
        const scrollPrev = () => {
          if (!navScroll$.value)
            return;
          const containerSize = navScroll$.value[`offset${capitalize$1(sizeName.value)}`];
          const currentOffset = navOffset.value;
          if (!currentOffset)
            return;
          const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
          navOffset.value = newOffset;
        };
        const scrollNext = () => {
          if (!navScroll$.value || !nav$.value)
            return;
          const navSize = nav$.value[`offset${capitalize$1(sizeName.value)}`];
          const containerSize = navScroll$.value[`offset${capitalize$1(sizeName.value)}`];
          const currentOffset = navOffset.value;
          if (navSize - currentOffset <= containerSize)
            return;
          const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
          navOffset.value = newOffset;
        };
        const scrollToActiveTab = async () => {
          const nav = nav$.value;
          if (!scrollable.value || !el$.value || !navScroll$.value || !nav)
            return;
          await nextTick();
          const activeTab = el$.value.querySelector(".is-active");
          if (!activeTab)
            return;
          const navScroll = navScroll$.value;
          const isHorizontal2 = ["top", "bottom"].includes(rootTabs.props.tabPosition);
          const activeTabBounding = activeTab.getBoundingClientRect();
          const navScrollBounding = navScroll.getBoundingClientRect();
          const maxOffset = isHorizontal2 ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
          const currentOffset = navOffset.value;
          let newOffset = currentOffset;
          if (isHorizontal2) {
            if (activeTabBounding.left < navScrollBounding.left) {
              newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
            }
            if (activeTabBounding.right > navScrollBounding.right) {
              newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
            }
          } else {
            if (activeTabBounding.top < navScrollBounding.top) {
              newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
            }
            if (activeTabBounding.bottom > navScrollBounding.bottom) {
              newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
            }
          }
          newOffset = Math.max(newOffset, 0);
          navOffset.value = Math.min(newOffset, maxOffset);
        };
        const update = () => {
          var _a2;
          if (!nav$.value || !navScroll$.value)
            return;
          props2.stretch && ((_a2 = tabBarRef.value) == null ? void 0 : _a2.update());
          const navSize = nav$.value[`offset${capitalize$1(sizeName.value)}`];
          const containerSize = navScroll$.value[`offset${capitalize$1(sizeName.value)}`];
          const currentOffset = navOffset.value;
          if (containerSize < navSize) {
            scrollable.value = scrollable.value || {};
            scrollable.value.prev = currentOffset;
            scrollable.value.next = currentOffset + containerSize < navSize;
            if (navSize - currentOffset < containerSize) {
              navOffset.value = navSize - containerSize;
            }
          } else {
            scrollable.value = false;
            if (currentOffset > 0) {
              navOffset.value = 0;
            }
          }
        };
        const changeTab = (event) => {
          let step = 0;
          switch (event.code) {
            case EVENT_CODE.left:
            case EVENT_CODE.up:
              step = -1;
              break;
            case EVENT_CODE.right:
            case EVENT_CODE.down:
              step = 1;
              break;
            default:
              return;
          }
          const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
          const currentIndex = tabList.indexOf(event.target);
          let nextIndex = currentIndex + step;
          if (nextIndex < 0) {
            nextIndex = tabList.length - 1;
          } else if (nextIndex >= tabList.length) {
            nextIndex = 0;
          }
          tabList[nextIndex].focus({
            preventScroll: true
          });
          tabList[nextIndex].click();
          setFocus();
        };
        const setFocus = () => {
          if (focusable.value)
            isFocus.value = true;
        };
        const removeFocus = () => isFocus.value = false;
        watch(visibility2, (visibility22) => {
          if (visibility22 === "hidden") {
            focusable.value = false;
          } else if (visibility22 === "visible") {
            setTimeout(() => focusable.value = true, 50);
          }
        });
        watch(focused, (focused2) => {
          if (focused2) {
            setTimeout(() => focusable.value = true, 50);
          } else {
            focusable.value = false;
          }
        });
        useResizeObserver(el$, update);
        onMounted(() => setTimeout(() => scrollToActiveTab(), 0));
        onUpdated(() => update());
        expose({
          scrollToActiveTab,
          removeFocus,
          tabListRef: nav$,
          tabBarRef
        });
        return () => {
          const scrollBtn = scrollable.value ? [createVNode$1("span", {
            "class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
            "onClick": scrollPrev
          }, [createVNode$1(ElIcon, null, {
            default: () => [createVNode$1(arrow_left_default, null, null)]
          })]), createVNode$1("span", {
            "class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
            "onClick": scrollNext
          }, [createVNode$1(ElIcon, null, {
            default: () => [createVNode$1(arrow_right_default, null, null)]
          })])] : null;
          const tabs = props2.panes.map((pane, index) => {
            var _a2, _b2, _c2, _d;
            const uid2 = pane.uid;
            const disabled = pane.props.disabled;
            const tabName = (_b2 = (_a2 = pane.props.name) != null ? _a2 : pane.index) != null ? _b2 : `${index}`;
            const closable = !disabled && (pane.isClosable || props2.editable);
            pane.index = `${index}`;
            const btnClose = closable ? createVNode$1(ElIcon, {
              "class": "is-icon-close",
              "onClick": (ev) => emit2("tabRemove", pane, ev)
            }, {
              default: () => [createVNode$1(close_default, null, null)]
            }) : null;
            const tabLabelContent = ((_d = (_c2 = pane.slots).label) == null ? void 0 : _d.call(_c2)) || pane.props.label;
            const tabindex = !disabled && pane.active ? 0 : -1;
            return createVNode$1("div", {
              "ref": `tab-${uid2}`,
              "class": [ns.e("item"), ns.is(rootTabs.props.tabPosition), ns.is("active", pane.active), ns.is("disabled", disabled), ns.is("closable", closable), ns.is("focus", isFocus.value)],
              "id": `tab-${tabName}`,
              "key": `tab-${uid2}`,
              "aria-controls": `pane-${tabName}`,
              "role": "tab",
              "aria-selected": pane.active,
              "tabindex": tabindex,
              "onFocus": () => setFocus(),
              "onBlur": () => removeFocus(),
              "onClick": (ev) => {
                removeFocus();
                emit2("tabClick", pane, tabName, ev);
              },
              "onKeydown": (ev) => {
                if (closable && (ev.code === EVENT_CODE.delete || ev.code === EVENT_CODE.backspace)) {
                  emit2("tabRemove", pane, ev);
                }
              }
            }, [...[tabLabelContent, btnClose]]);
          });
          return createVNode$1("div", {
            "ref": el$,
            "class": [ns.e("nav-wrap"), ns.is("scrollable", !!scrollable.value), ns.is(rootTabs.props.tabPosition)]
          }, [scrollBtn, createVNode$1("div", {
            "class": ns.e("nav-scroll"),
            "ref": navScroll$
          }, [createVNode$1("div", {
            "class": [ns.e("nav"), ns.is(rootTabs.props.tabPosition), ns.is("stretch", props2.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition))],
            "ref": nav$,
            "style": navStyle.value,
            "role": "tablist",
            "onKeydown": changeTab
          }, [...[!props2.type ? createVNode$1(TabBar, {
            "ref": tabBarRef,
            "tabs": [...props2.panes]
          }, null) : null, tabs]])])]);
        };
      }
    });
    const tabsProps = buildProps({
      type: {
        type: String,
        values: ["card", "border-card", ""],
        default: ""
      },
      closable: Boolean,
      addable: Boolean,
      modelValue: {
        type: [String, Number]
      },
      editable: Boolean,
      tabPosition: {
        type: String,
        values: ["top", "right", "bottom", "left"],
        default: "top"
      },
      beforeLeave: {
        type: definePropType(Function),
        default: () => true
      },
      stretch: Boolean
    });
    const isPaneName = (value) => isString$3(value) || isNumber$2(value);
    const tabsEmits = {
      [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
      tabClick: (pane, ev) => ev instanceof Event,
      tabChange: (name) => isPaneName(name),
      edit: (paneName, action) => ["remove", "add"].includes(action),
      tabRemove: (name) => isPaneName(name),
      tabAdd: () => true
    };
    const Tabs = /* @__PURE__ */ defineComponent({
      name: "ElTabs",
      props: tabsProps,
      emits: tabsEmits,
      setup(props2, {
        emit: emit2,
        slots,
        expose
      }) {
        var _a2;
        const ns = useNamespace("tabs");
        const isVertical = computed(() => ["left", "right"].includes(props2.tabPosition));
        const {
          children: panes,
          addChild: sortPane,
          removeChild: unregisterPane
        } = useOrderedChildren(getCurrentInstance(), "ElTabPane");
        const nav$ = ref();
        const currentName = ref((_a2 = props2.modelValue) != null ? _a2 : "0");
        const setCurrentName = async (value, trigger2 = false) => {
          var _a22, _b2;
          if (currentName.value === value || isUndefined$1(value))
            return;
          try {
            let canLeave;
            if (props2.beforeLeave) {
              const result = props2.beforeLeave(value, currentName.value);
              canLeave = result instanceof Promise ? await result : result;
            } else {
              canLeave = true;
            }
            if (canLeave !== false) {
              currentName.value = value;
              if (trigger2) {
                emit2(UPDATE_MODEL_EVENT, value);
                emit2("tabChange", value);
              }
              (_b2 = (_a22 = nav$.value) == null ? void 0 : _a22.removeFocus) == null ? void 0 : _b2.call(_a22);
            }
          } catch (e2) {
          }
        };
        const handleTabClick = (tab, tabName, event) => {
          if (tab.props.disabled)
            return;
          emit2("tabClick", tab, event);
          setCurrentName(tabName, true);
        };
        const handleTabRemove = (pane, ev) => {
          if (pane.props.disabled || isUndefined$1(pane.props.name))
            return;
          ev.stopPropagation();
          emit2("edit", pane.props.name, "remove");
          emit2("tabRemove", pane.props.name);
        };
        const handleTabAdd = () => {
          emit2("edit", void 0, "add");
          emit2("tabAdd");
        };
        watch(() => props2.modelValue, (modelValue) => setCurrentName(modelValue));
        watch(currentName, async () => {
          var _a22;
          await nextTick();
          (_a22 = nav$.value) == null ? void 0 : _a22.scrollToActiveTab();
        });
        provide(tabsRootContextKey, {
          props: props2,
          currentName,
          registerPane: (pane) => {
            panes.value.push(pane);
          },
          sortPane,
          unregisterPane
        });
        expose({
          currentName,
          tabNavRef: nav$
        });
        const TabNavRenderer = ({
          render: render2
        }) => {
          return render2();
        };
        return () => {
          const addSlot = slots["add-icon"];
          const newButton = props2.editable || props2.addable ? createVNode$1("div", {
            "class": [ns.e("new-tab"), isVertical.value && ns.e("new-tab-vertical")],
            "tabindex": "0",
            "onClick": handleTabAdd,
            "onKeydown": (ev) => {
              if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(ev.code))
                handleTabAdd();
            }
          }, [addSlot ? renderSlot(slots, "add-icon") : createVNode$1(ElIcon, {
            "class": ns.is("icon-plus")
          }, {
            default: () => [createVNode$1(plus_default, null, null)]
          })]) : null;
          const header = createVNode$1("div", {
            "class": [ns.e("header"), isVertical.value && ns.e("header-vertical"), ns.is(props2.tabPosition)]
          }, [createVNode$1(TabNavRenderer, {
            "render": () => {
              const hasLabelSlot = panes.value.some((pane) => pane.slots.label);
              return createVNode$1(TabNav, {
                ref: nav$,
                currentName: currentName.value,
                editable: props2.editable,
                type: props2.type,
                panes: panes.value,
                stretch: props2.stretch,
                onTabClick: handleTabClick,
                onTabRemove: handleTabRemove
              }, {
                $stable: !hasLabelSlot
              });
            }
          }, null), newButton]);
          const panels = createVNode$1("div", {
            "class": ns.e("content")
          }, [renderSlot(slots, "default")]);
          return createVNode$1("div", {
            "class": [ns.b(), ns.m(props2.tabPosition), {
              [ns.m("card")]: props2.type === "card",
              [ns.m("border-card")]: props2.type === "border-card"
            }]
          }, [panels, header]);
        };
      }
    });
    var Tabs$1 = Tabs;
    const tabPaneProps = buildProps({
      label: {
        type: String,
        default: ""
      },
      name: {
        type: [String, Number]
      },
      closable: Boolean,
      disabled: Boolean,
      lazy: Boolean
    });
    const COMPONENT_NAME$1 = "ElTabPane";
    const __default__$t = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME$1
    });
    const _sfc_main$G = /* @__PURE__ */ defineComponent({
      ...__default__$t,
      props: tabPaneProps,
      setup(__props) {
        const props2 = __props;
        const instance = getCurrentInstance();
        const slots = useSlots();
        const tabsRoot = inject(tabsRootContextKey);
        if (!tabsRoot)
          throwError$1(COMPONENT_NAME$1, "usage: <el-tabs><el-tab-pane /></el-tabs/>");
        const ns = useNamespace("tab-pane");
        const index = ref();
        const isClosable = computed(() => props2.closable || tabsRoot.props.closable);
        const active = computedEager(() => {
          var _a2;
          return tabsRoot.currentName.value === ((_a2 = props2.name) != null ? _a2 : index.value);
        });
        const loaded = ref(active.value);
        const paneName = computed(() => {
          var _a2;
          return (_a2 = props2.name) != null ? _a2 : index.value;
        });
        const shouldBeRender = computedEager(() => !props2.lazy || loaded.value || active.value);
        watch(active, (val) => {
          if (val)
            loaded.value = true;
        });
        const pane = reactive({
          uid: instance.uid,
          slots,
          props: props2,
          paneName,
          active,
          index,
          isClosable
        });
        tabsRoot.registerPane(pane);
        onMounted(() => {
          tabsRoot.sortPane(pane);
        });
        onUnmounted(() => {
          tabsRoot.unregisterPane(pane.uid);
        });
        return (_ctx, _cache) => {
          return unref(shouldBeRender) ? withDirectives((openBlock(), createElementBlock("div", {
            key: 0,
            id: `pane-${unref(paneName)}`,
            class: normalizeClass(unref(ns).b()),
            role: "tabpanel",
            "aria-hidden": !unref(active),
            "aria-labelledby": `tab-${unref(paneName)}`
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 10, ["id", "aria-hidden", "aria-labelledby"])), [
            [vShow, unref(active)]
          ]) : createCommentVNode("v-if", true);
        };
      }
    });
    var TabPane = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__file", "tab-pane.vue"]]);
    const ElTabs = withInstall(Tabs$1, {
      TabPane
    });
    const ElTabPane = withNoopInstall(TabPane);
    const textProps = buildProps({
      type: {
        type: String,
        values: ["primary", "success", "info", "warning", "danger", ""],
        default: ""
      },
      size: {
        type: String,
        values: componentSizes,
        default: ""
      },
      truncated: Boolean,
      lineClamp: {
        type: [String, Number]
      },
      tag: {
        type: String,
        default: "span"
      }
    });
    const __default__$s = /* @__PURE__ */ defineComponent({
      name: "ElText"
    });
    const _sfc_main$F = /* @__PURE__ */ defineComponent({
      ...__default__$s,
      props: textProps,
      setup(__props) {
        const props2 = __props;
        const textRef = ref();
        const textSize = useFormSize();
        const ns = useNamespace("text");
        const textKls = computed(() => [
          ns.b(),
          ns.m(props2.type),
          ns.m(textSize.value),
          ns.is("truncated", props2.truncated),
          ns.is("line-clamp", !isUndefined$1(props2.lineClamp))
        ]);
        const inheritTitle = useAttrs$1().title;
        const bindTitle = () => {
          var _a2, _b2, _c2, _d, _e;
          if (inheritTitle)
            return;
          let shouldAddTitle = false;
          const text = ((_a2 = textRef.value) == null ? void 0 : _a2.textContent) || "";
          if (props2.truncated) {
            const width = (_b2 = textRef.value) == null ? void 0 : _b2.offsetWidth;
            const scrollWidth = (_c2 = textRef.value) == null ? void 0 : _c2.scrollWidth;
            if (width && scrollWidth && scrollWidth > width) {
              shouldAddTitle = true;
            }
          } else if (!isUndefined$1(props2.lineClamp)) {
            const height = (_d = textRef.value) == null ? void 0 : _d.offsetHeight;
            const scrollHeight = (_e = textRef.value) == null ? void 0 : _e.scrollHeight;
            if (height && scrollHeight && scrollHeight > height) {
              shouldAddTitle = true;
            }
          }
          if (shouldAddTitle) {
            textRef.value.setAttribute("title", text);
          } else {
            textRef.value.removeAttribute("title");
          }
        };
        onMounted(bindTitle);
        onUpdated(bindTitle);
        return (_ctx, _cache) => {
          return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
            ref_key: "textRef",
            ref: textRef,
            class: normalizeClass(unref(textKls)),
            style: normalizeStyle$1({ "-webkit-line-clamp": _ctx.lineClamp })
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          }, 8, ["class", "style"]);
        };
      }
    });
    var Text = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__file", "text.vue"]]);
    const ElText = withInstall(Text);
    const timeSelectProps = buildProps({
      format: {
        type: String,
        default: "HH:mm"
      },
      modelValue: String,
      disabled: Boolean,
      editable: {
        type: Boolean,
        default: true
      },
      effect: {
        type: definePropType(String),
        default: "light"
      },
      clearable: {
        type: Boolean,
        default: true
      },
      size: useSizeProp,
      placeholder: String,
      start: {
        type: String,
        default: "09:00"
      },
      end: {
        type: String,
        default: "18:00"
      },
      step: {
        type: String,
        default: "00:30"
      },
      minTime: String,
      maxTime: String,
      includeEndTime: {
        type: Boolean,
        default: false
      },
      name: String,
      prefixIcon: {
        type: definePropType([String, Object]),
        default: () => clock_default
      },
      clearIcon: {
        type: definePropType([String, Object]),
        default: () => circle_close_default
      },
      ...useEmptyValuesProps
    });
    const parseTime = (time2) => {
      const values = (time2 || "").split(":");
      if (values.length >= 2) {
        let hours = Number.parseInt(values[0], 10);
        const minutes = Number.parseInt(values[1], 10);
        const timeUpper = time2.toUpperCase();
        if (timeUpper.includes("AM") && hours === 12) {
          hours = 0;
        } else if (timeUpper.includes("PM") && hours !== 12) {
          hours += 12;
        }
        return {
          hours,
          minutes
        };
      }
      return null;
    };
    const compareTime = (time1, time2) => {
      const value1 = parseTime(time1);
      if (!value1)
        return -1;
      const value2 = parseTime(time2);
      if (!value2)
        return -1;
      const minutes1 = value1.minutes + value1.hours * 60;
      const minutes2 = value2.minutes + value2.hours * 60;
      if (minutes1 === minutes2) {
        return 0;
      }
      return minutes1 > minutes2 ? 1 : -1;
    };
    const padTime = (time2) => {
      return `${time2}`.padStart(2, "0");
    };
    const formatTime = (time2) => {
      return `${padTime(time2.hours)}:${padTime(time2.minutes)}`;
    };
    const nextTime = (time2, step) => {
      const timeValue = parseTime(time2);
      if (!timeValue)
        return "";
      const stepValue = parseTime(step);
      if (!stepValue)
        return "";
      const next = {
        hours: timeValue.hours,
        minutes: timeValue.minutes
      };
      next.minutes += stepValue.minutes;
      next.hours += stepValue.hours;
      next.hours += Math.floor(next.minutes / 60);
      next.minutes = next.minutes % 60;
      return formatTime(next);
    };
    const __default__$r = /* @__PURE__ */ defineComponent({
      name: "ElTimeSelect"
    });
    const _sfc_main$E = /* @__PURE__ */ defineComponent({
      ...__default__$r,
      props: timeSelectProps,
      emits: [CHANGE_EVENT, "blur", "focus", "clear", UPDATE_MODEL_EVENT],
      setup(__props, { expose }) {
        const props2 = __props;
        dayjs.extend(customParseFormat);
        const { Option: ElOption2 } = ElSelect;
        const nsInput = useNamespace("input");
        const select = ref();
        const _disabled = useFormDisabled();
        const { lang } = useLocale();
        const value = computed(() => props2.modelValue);
        const start2 = computed(() => {
          const time2 = parseTime(props2.start);
          return time2 ? formatTime(time2) : null;
        });
        const end2 = computed(() => {
          const time2 = parseTime(props2.end);
          return time2 ? formatTime(time2) : null;
        });
        const step = computed(() => {
          const time2 = parseTime(props2.step);
          return time2 ? formatTime(time2) : null;
        });
        const minTime = computed(() => {
          const time2 = parseTime(props2.minTime || "");
          return time2 ? formatTime(time2) : null;
        });
        const maxTime = computed(() => {
          const time2 = parseTime(props2.maxTime || "");
          return time2 ? formatTime(time2) : null;
        });
        const items = computed(() => {
          var _a2;
          const result = [];
          const push2 = (formattedValue, rawValue) => {
            result.push({
              value: formattedValue,
              disabled: compareTime(rawValue, minTime.value || "-1:-1") <= 0 || compareTime(rawValue, maxTime.value || "100:100") >= 0
            });
          };
          if (props2.start && props2.end && props2.step) {
            let current = start2.value;
            let currentTime;
            while (current && end2.value && compareTime(current, end2.value) <= 0) {
              currentTime = dayjs(current, "HH:mm").locale(lang.value).format(props2.format);
              push2(currentTime, current);
              current = nextTime(current, step.value);
            }
            if (props2.includeEndTime && end2.value && ((_a2 = result[result.length - 1]) == null ? void 0 : _a2.value) !== end2.value) {
              const formattedValue = dayjs(end2.value, "HH:mm").locale(lang.value).format(props2.format);
              push2(formattedValue, end2.value);
            }
          }
          return result;
        });
        const blur = () => {
          var _a2, _b2;
          (_b2 = (_a2 = select.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b2.call(_a2);
        };
        const focus = () => {
          var _a2, _b2;
          (_b2 = (_a2 = select.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
        };
        expose({
          blur,
          focus
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(unref(ElSelect), {
            ref_key: "select",
            ref: select,
            "model-value": unref(value),
            disabled: unref(_disabled),
            clearable: _ctx.clearable,
            "clear-icon": _ctx.clearIcon,
            size: _ctx.size,
            effect: _ctx.effect,
            placeholder: _ctx.placeholder,
            "default-first-option": "",
            filterable: _ctx.editable,
            "empty-values": _ctx.emptyValues,
            "value-on-clear": _ctx.valueOnClear,
            "onUpdate:modelValue": (event) => _ctx.$emit(unref(UPDATE_MODEL_EVENT), event),
            onChange: (event) => _ctx.$emit(unref(CHANGE_EVENT), event),
            onBlur: (event) => _ctx.$emit("blur", event),
            onFocus: (event) => _ctx.$emit("focus", event),
            onClear: () => _ctx.$emit("clear")
          }, {
            prefix: withCtx(() => [
              _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
                key: 0,
                class: normalizeClass(unref(nsInput).e("prefix-icon"))
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ]),
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(unref(items), (item) => {
                return openBlock(), createBlock(unref(ElOption2), {
                  key: item.value,
                  label: item.value,
                  value: item.value,
                  disabled: item.disabled
                }, null, 8, ["label", "value", "disabled"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["model-value", "disabled", "clearable", "clear-icon", "size", "effect", "placeholder", "filterable", "empty-values", "value-on-clear", "onUpdate:modelValue", "onChange", "onBlur", "onFocus", "onClear"]);
        };
      }
    });
    var TimeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__file", "time-select.vue"]]);
    const ElTimeSelect = withInstall(TimeSelect);
    const Timeline = /* @__PURE__ */ defineComponent({
      name: "ElTimeline",
      setup(_2, { slots }) {
        const ns = useNamespace("timeline");
        provide("timeline", slots);
        return () => {
          return h$1("ul", { class: [ns.b()] }, [renderSlot(slots, "default")]);
        };
      }
    });
    const timelineItemProps = buildProps({
      timestamp: {
        type: String,
        default: ""
      },
      hideTimestamp: Boolean,
      center: Boolean,
      placement: {
        type: String,
        values: ["top", "bottom"],
        default: "bottom"
      },
      type: {
        type: String,
        values: ["primary", "success", "warning", "danger", "info"],
        default: ""
      },
      color: {
        type: String,
        default: ""
      },
      size: {
        type: String,
        values: ["normal", "large"],
        default: "normal"
      },
      icon: {
        type: iconPropType
      },
      hollow: Boolean
    });
    const __default__$q = /* @__PURE__ */ defineComponent({
      name: "ElTimelineItem"
    });
    const _sfc_main$D = /* @__PURE__ */ defineComponent({
      ...__default__$q,
      props: timelineItemProps,
      setup(__props) {
        const props2 = __props;
        const ns = useNamespace("timeline-item");
        const defaultNodeKls = computed(() => [
          ns.e("node"),
          ns.em("node", props2.size || ""),
          ns.em("node", props2.type || ""),
          ns.is("hollow", props2.hollow)
        ]);
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("li", {
            class: normalizeClass([unref(ns).b(), { [unref(ns).e("center")]: _ctx.center }])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("tail"))
            }, null, 2),
            !_ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(defaultNodeKls)),
              style: normalizeStyle$1({
                backgroundColor: _ctx.color
              })
            }, [
              _ctx.icon ? (openBlock(), createBlock(unref(ElIcon), {
                key: 0,
                class: normalizeClass(unref(ns).e("icon"))
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon)))
                ]),
                _: 1
              }, 8, ["class"])) : createCommentVNode("v-if", true)
            ], 6)) : createCommentVNode("v-if", true),
            _ctx.$slots.dot ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("dot"))
            }, [
              renderSlot(_ctx.$slots, "dot")
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("wrapper"))
            }, [
              !_ctx.hideTimestamp && _ctx.placement === "top" ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("top")])
              }, toDisplayString(_ctx.timestamp), 3)) : createCommentVNode("v-if", true),
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).e("content"))
              }, [
                renderSlot(_ctx.$slots, "default")
              ], 2),
              !_ctx.hideTimestamp && _ctx.placement === "bottom" ? (openBlock(), createElementBlock("div", {
                key: 1,
                class: normalizeClass([unref(ns).e("timestamp"), unref(ns).is("bottom")])
              }, toDisplayString(_ctx.timestamp), 3)) : createCommentVNode("v-if", true)
            ], 2)
          ], 2);
        };
      }
    });
    var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__file", "timeline-item.vue"]]);
    const ElTimeline = withInstall(Timeline, {
      TimelineItem
    });
    const ElTimelineItem = withNoopInstall(TimelineItem);
    const tooltipV2CommonProps = buildProps({
      nowrap: Boolean
    });
    var TooltipV2Sides = /* @__PURE__ */ ((TooltipV2Sides2) => {
      TooltipV2Sides2["top"] = "top";
      TooltipV2Sides2["bottom"] = "bottom";
      TooltipV2Sides2["left"] = "left";
      TooltipV2Sides2["right"] = "right";
      return TooltipV2Sides2;
    })(TooltipV2Sides || {});
    const tooltipV2Sides = Object.values(TooltipV2Sides);
    const tooltipV2ArrowProps = buildProps({
      width: {
        type: Number,
        default: 10
      },
      height: {
        type: Number,
        default: 10
      },
      style: {
        type: definePropType(Object),
        default: null
      }
    });
    const tooltipV2ArrowSpecialProps = buildProps({
      side: {
        type: definePropType(String),
        values: tooltipV2Sides,
        required: true
      }
    });
    const tooltipV2Strategies = ["absolute", "fixed"];
    const tooltipV2Placements = [
      "top-start",
      "top-end",
      "top",
      "bottom-start",
      "bottom-end",
      "bottom",
      "left-start",
      "left-end",
      "left",
      "right-start",
      "right-end",
      "right"
    ];
    const tooltipV2ContentProps = buildProps({
      arrowPadding: {
        type: definePropType(Number),
        default: 5
      },
      effect: {
        type: definePropType(String),
        default: "light"
      },
      contentClass: String,
      placement: {
        type: definePropType(String),
        values: tooltipV2Placements,
        default: "bottom"
      },
      reference: {
        type: definePropType(Object),
        default: null
      },
      offset: {
        type: Number,
        default: 8
      },
      strategy: {
        type: definePropType(String),
        values: tooltipV2Strategies,
        default: "absolute"
      },
      showArrow: Boolean,
      ...useAriaProps(["ariaLabel"])
    });
    const tooltipV2RootProps = buildProps({
      delayDuration: {
        type: Number,
        default: 300
      },
      defaultOpen: Boolean,
      open: {
        type: Boolean,
        default: void 0
      },
      onOpenChange: {
        type: definePropType(Function)
      },
      "onUpdate:open": {
        type: definePropType(Function)
      }
    });
    const EventHandler = {
      type: definePropType(Function)
    };
    const tooltipV2TriggerProps = buildProps({
      onBlur: EventHandler,
      onClick: EventHandler,
      onFocus: EventHandler,
      onMouseDown: EventHandler,
      onMouseEnter: EventHandler,
      onMouseLeave: EventHandler
    });
    const tooltipV2Props = buildProps({
      ...tooltipV2RootProps,
      ...tooltipV2ArrowProps,
      ...tooltipV2TriggerProps,
      ...tooltipV2ContentProps,
      alwaysOn: Boolean,
      fullTransition: Boolean,
      transitionProps: {
        type: definePropType(Object),
        default: null
      },
      teleported: Boolean,
      to: {
        type: definePropType(String),
        default: "body"
      }
    });
    const tooltipV2RootKey = Symbol("tooltipV2");
    const tooltipV2ContentKey = Symbol("tooltipV2Content");
    const TOOLTIP_V2_OPEN = "tooltip_v2.open";
    const __default__$p = /* @__PURE__ */ defineComponent({
      name: "ElTooltipV2Root"
    });
    const _sfc_main$C = /* @__PURE__ */ defineComponent({
      ...__default__$p,
      props: tooltipV2RootProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const _open = ref(props2.defaultOpen);
        const triggerRef = ref(null);
        const open2 = computed({
          get: () => isPropAbsent(props2.open) ? _open.value : props2.open,
          set: (open22) => {
            var _a2;
            _open.value = open22;
            (_a2 = props2["onUpdate:open"]) == null ? void 0 : _a2.call(props2, open22);
          }
        });
        const isOpenDelayed = computed(() => isNumber$2(props2.delayDuration) && props2.delayDuration > 0);
        const { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(() => {
          open2.value = true;
        }, computed(() => props2.delayDuration), {
          immediate: false
        });
        const ns = useNamespace("tooltip-v2");
        const contentId = useId();
        const onNormalOpen = () => {
          clearTimer();
          open2.value = true;
        };
        const onDelayOpen = () => {
          unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
        };
        const onOpen = onNormalOpen;
        const onClose = () => {
          clearTimer();
          open2.value = false;
        };
        const onChange = (open22) => {
          var _a2;
          if (open22) {
            document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN));
            onOpen();
          }
          (_a2 = props2.onOpenChange) == null ? void 0 : _a2.call(props2, open22);
        };
        watch(open2, onChange);
        onMounted(() => {
          document.addEventListener(TOOLTIP_V2_OPEN, onClose);
        });
        onBeforeUnmount(() => {
          clearTimer();
          document.removeEventListener(TOOLTIP_V2_OPEN, onClose);
        });
        provide(tooltipV2RootKey, {
          contentId,
          triggerRef,
          ns,
          onClose,
          onDelayOpen,
          onOpen
        });
        expose({
          onOpen,
          onClose
        });
        return (_ctx, _cache) => {
          return renderSlot(_ctx.$slots, "default", { open: unref(open2) });
        };
      }
    });
    var TooltipV2Root = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__file", "root.vue"]]);
    const __default__$o = /* @__PURE__ */ defineComponent({
      name: "ElTooltipV2Arrow"
    });
    const _sfc_main$B = /* @__PURE__ */ defineComponent({
      ...__default__$o,
      props: {
        ...tooltipV2ArrowProps,
        ...tooltipV2ArrowSpecialProps
      },
      setup(__props) {
        const props2 = __props;
        const { ns } = inject(tooltipV2RootKey);
        const { arrowRef } = inject(tooltipV2ContentKey);
        const arrowStyle = computed(() => {
          const { style, width, height } = props2;
          const namespace = ns.namespace.value;
          return {
            [`--${namespace}-tooltip-v2-arrow-width`]: `${width}px`,
            [`--${namespace}-tooltip-v2-arrow-height`]: `${height}px`,
            [`--${namespace}-tooltip-v2-arrow-border-width`]: `${width / 2}px`,
            [`--${namespace}-tooltip-v2-arrow-cover-width`]: width / 2 - 1,
            ...style || {}
          };
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", {
            ref_key: "arrowRef",
            ref: arrowRef,
            style: normalizeStyle$1(unref(arrowStyle)),
            class: normalizeClass(unref(ns).e("arrow"))
          }, null, 6);
        };
      }
    });
    var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__file", "arrow.vue"]]);
    const min$2 = Math.min;
    const max$2 = Math.max;
    const round$4 = Math.round;
    const floor = Math.floor;
    const createCoords = (v4) => ({
      x: v4,
      y: v4
    });
    const oppositeSideMap = {
      left: "right",
      right: "left",
      bottom: "top",
      top: "bottom"
    };
    const oppositeAlignmentMap = {
      start: "end",
      end: "start"
    };
    function clamp$1(start2, value, end2) {
      return max$2(start2, min$2(value, end2));
    }
    function evaluate(value, param) {
      return typeof value === "function" ? value(param) : value;
    }
    function getSide(placement) {
      return placement.split("-")[0];
    }
    function getAlignment(placement) {
      return placement.split("-")[1];
    }
    function getOppositeAxis(axis) {
      return axis === "x" ? "y" : "x";
    }
    function getAxisLength(axis) {
      return axis === "y" ? "height" : "width";
    }
    function getSideAxis(placement) {
      return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
    }
    function getAlignmentAxis(placement) {
      return getOppositeAxis(getSideAxis(placement));
    }
    function getAlignmentSides(placement, rects, rtl) {
      if (rtl === void 0) {
        rtl = false;
      }
      const alignment = getAlignment(placement);
      const alignmentAxis = getAlignmentAxis(placement);
      const length = getAxisLength(alignmentAxis);
      let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
      if (rects.reference[length] > rects.floating[length]) {
        mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
      }
      return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
    }
    function getExpandedPlacements(placement) {
      const oppositePlacement = getOppositePlacement(placement);
      return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
    }
    function getOppositeAlignmentPlacement(placement) {
      return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
    }
    function getSideList(side, isStart, rtl) {
      const lr = ["left", "right"];
      const rl = ["right", "left"];
      const tb = ["top", "bottom"];
      const bt2 = ["bottom", "top"];
      switch (side) {
        case "top":
        case "bottom":
          if (rtl) return isStart ? rl : lr;
          return isStart ? lr : rl;
        case "left":
        case "right":
          return isStart ? tb : bt2;
        default:
          return [];
      }
    }
    function getOppositeAxisPlacements(placement, flipAlignment, direction2, rtl) {
      const alignment = getAlignment(placement);
      let list = getSideList(getSide(placement), direction2 === "start", rtl);
      if (alignment) {
        list = list.map((side) => side + "-" + alignment);
        if (flipAlignment) {
          list = list.concat(list.map(getOppositeAlignmentPlacement));
        }
      }
      return list;
    }
    function getOppositePlacement(placement) {
      return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
    }
    function expandPaddingObject(padding) {
      return {
        top: 0,
        right: 0,
        bottom: 0,
        left: 0,
        ...padding
      };
    }
    function getPaddingObject(padding) {
      return typeof padding !== "number" ? expandPaddingObject(padding) : {
        top: padding,
        right: padding,
        bottom: padding,
        left: padding
      };
    }
    function rectToClientRect(rect) {
      const {
        x: x2,
        y,
        width,
        height
      } = rect;
      return {
        width,
        height,
        top: y,
        left: x2,
        right: x2 + width,
        bottom: y + height,
        x: x2,
        y
      };
    }
    function computeCoordsFromPlacement(_ref, placement, rtl) {
      let {
        reference,
        floating
      } = _ref;
      const sideAxis = getSideAxis(placement);
      const alignmentAxis = getAlignmentAxis(placement);
      const alignLength = getAxisLength(alignmentAxis);
      const side = getSide(placement);
      const isVertical = sideAxis === "y";
      const commonX = reference.x + reference.width / 2 - floating.width / 2;
      const commonY = reference.y + reference.height / 2 - floating.height / 2;
      const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
      let coords;
      switch (side) {
        case "top":
          coords = {
            x: commonX,
            y: reference.y - floating.height
          };
          break;
        case "bottom":
          coords = {
            x: commonX,
            y: reference.y + reference.height
          };
          break;
        case "right":
          coords = {
            x: reference.x + reference.width,
            y: commonY
          };
          break;
        case "left":
          coords = {
            x: reference.x - floating.width,
            y: commonY
          };
          break;
        default:
          coords = {
            x: reference.x,
            y: reference.y
          };
      }
      switch (getAlignment(placement)) {
        case "start":
          coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
          break;
        case "end":
          coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
          break;
      }
      return coords;
    }
    const computePosition$1 = async (reference, floating, config) => {
      const {
        placement = "bottom",
        strategy = "absolute",
        middleware = [],
        platform: platform2
      } = config;
      const validMiddleware = middleware.filter(Boolean);
      const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
      let rects = await platform2.getElementRects({
        reference,
        floating,
        strategy
      });
      let {
        x: x2,
        y
      } = computeCoordsFromPlacement(rects, placement, rtl);
      let statefulPlacement = placement;
      let middlewareData = {};
      let resetCount = 0;
      for (let i2 = 0; i2 < validMiddleware.length; i2++) {
        const {
          name,
          fn: fn2
        } = validMiddleware[i2];
        const {
          x: nextX,
          y: nextY,
          data,
          reset
        } = await fn2({
          x: x2,
          y,
          initialPlacement: placement,
          placement: statefulPlacement,
          strategy,
          middlewareData,
          rects,
          platform: platform2,
          elements: {
            reference,
            floating
          }
        });
        x2 = nextX != null ? nextX : x2;
        y = nextY != null ? nextY : y;
        middlewareData = {
          ...middlewareData,
          [name]: {
            ...middlewareData[name],
            ...data
          }
        };
        if (reset && resetCount <= 50) {
          resetCount++;
          if (typeof reset === "object") {
            if (reset.placement) {
              statefulPlacement = reset.placement;
            }
            if (reset.rects) {
              rects = reset.rects === true ? await platform2.getElementRects({
                reference,
                floating,
                strategy
              }) : reset.rects;
            }
            ({
              x: x2,
              y
            } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
          }
          i2 = -1;
        }
      }
      return {
        x: x2,
        y,
        placement: statefulPlacement,
        strategy,
        middlewareData
      };
    };
    async function detectOverflow$1(state, options) {
      var _await$platform$isEle;
      if (options === void 0) {
        options = {};
      }
      const {
        x: x2,
        y,
        platform: platform2,
        rects,
        elements,
        strategy
      } = state;
      const {
        boundary = "clippingAncestors",
        rootBoundary = "viewport",
        elementContext = "floating",
        altBoundary = false,
        padding = 0
      } = evaluate(options, state);
      const paddingObject = getPaddingObject(padding);
      const altContext = elementContext === "floating" ? "reference" : "floating";
      const element = elements[altBoundary ? altContext : elementContext];
      const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
        element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
        boundary,
        rootBoundary,
        strategy
      }));
      const rect = elementContext === "floating" ? {
        x: x2,
        y,
        width: rects.floating.width,
        height: rects.floating.height
      } : rects.reference;
      const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
      const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
        x: 1,
        y: 1
      } : {
        x: 1,
        y: 1
      };
      const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
        elements,
        rect,
        offsetParent,
        strategy
      }) : rect);
      return {
        top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
        bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
        left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
        right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
      };
    }
    const arrow$1 = (options) => ({
      name: "arrow",
      options,
      async fn(state) {
        const {
          x: x2,
          y,
          placement,
          rects,
          platform: platform2,
          elements,
          middlewareData
        } = state;
        const {
          element,
          padding = 0
        } = evaluate(options, state) || {};
        if (element == null) {
          return {};
        }
        const paddingObject = getPaddingObject(padding);
        const coords = {
          x: x2,
          y
        };
        const axis = getAlignmentAxis(placement);
        const length = getAxisLength(axis);
        const arrowDimensions = await platform2.getDimensions(element);
        const isYAxis = axis === "y";
        const minProp = isYAxis ? "top" : "left";
        const maxProp = isYAxis ? "bottom" : "right";
        const clientProp = isYAxis ? "clientHeight" : "clientWidth";
        const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
        const startDiff = coords[axis] - rects.reference[axis];
        const arrowOffsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element));
        let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
        if (!clientSize || !await (platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent))) {
          clientSize = elements.floating[clientProp] || rects.floating[length];
        }
        const centerToReference = endDiff / 2 - startDiff / 2;
        const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
        const minPadding = min$2(paddingObject[minProp], largestPossiblePadding);
        const maxPadding = min$2(paddingObject[maxProp], largestPossiblePadding);
        const min$12 = minPadding;
        const max3 = clientSize - arrowDimensions[length] - maxPadding;
        const center2 = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
        const offset2 = clamp$1(min$12, center2, max3);
        const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center2 !== offset2 && rects.reference[length] / 2 - (center2 < min$12 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
        const alignmentOffset = shouldAddOffset ? center2 < min$12 ? center2 - min$12 : center2 - max3 : 0;
        return {
          [axis]: coords[axis] + alignmentOffset,
          data: {
            [axis]: offset2,
            centerOffset: center2 - offset2 - alignmentOffset,
            ...shouldAddOffset && {
              alignmentOffset
            }
          },
          reset: shouldAddOffset
        };
      }
    });
    const flip$1 = function(options) {
      if (options === void 0) {
        options = {};
      }
      return {
        name: "flip",
        options,
        async fn(state) {
          var _middlewareData$arrow, _middlewareData$flip;
          const {
            placement,
            middlewareData,
            rects,
            initialPlacement,
            platform: platform2,
            elements
          } = state;
          const {
            mainAxis: checkMainAxis = true,
            crossAxis: checkCrossAxis = true,
            fallbackPlacements: specifiedFallbackPlacements,
            fallbackStrategy = "bestFit",
            fallbackAxisSideDirection = "none",
            flipAlignment = true,
            ...detectOverflowOptions
          } = evaluate(options, state);
          if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
            return {};
          }
          const side = getSide(placement);
          const initialSideAxis = getSideAxis(initialPlacement);
          const isBasePlacement = getSide(initialPlacement) === initialPlacement;
          const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
          const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
          const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
          if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
            fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
          }
          const placements = [initialPlacement, ...fallbackPlacements];
          const overflow2 = await detectOverflow$1(state, detectOverflowOptions);
          const overflows = [];
          let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
          if (checkMainAxis) {
            overflows.push(overflow2[side]);
          }
          if (checkCrossAxis) {
            const sides = getAlignmentSides(placement, rects, rtl);
            overflows.push(overflow2[sides[0]], overflow2[sides[1]]);
          }
          overflowsData = [...overflowsData, {
            placement,
            overflows
          }];
          if (!overflows.every((side2) => side2 <= 0)) {
            var _middlewareData$flip2, _overflowsData$filter;
            const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
            const nextPlacement = placements[nextIndex];
            if (nextPlacement) {
              var _overflowsData$;
              const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
              const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0;
              if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) {
                return {
                  data: {
                    index: nextIndex,
                    overflows: overflowsData
                  },
                  reset: {
                    placement: nextPlacement
                  }
                };
              }
            }
            let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
            if (!resetPlacement) {
              switch (fallbackStrategy) {
                case "bestFit": {
                  var _overflowsData$filter2;
                  const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => {
                    if (hasFallbackAxisSideDirection) {
                      const currentSideAxis = getSideAxis(d2.placement);
                      return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
                      // reading directions favoring greater width.
                      currentSideAxis === "y";
                    }
                    return true;
                  }).map((d2) => [d2.placement, d2.overflows.filter((overflow3) => overflow3 > 0).reduce((acc, overflow3) => acc + overflow3, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
                  if (placement2) {
                    resetPlacement = placement2;
                  }
                  break;
                }
                case "initialPlacement":
                  resetPlacement = initialPlacement;
                  break;
              }
            }
            if (placement !== resetPlacement) {
              return {
                reset: {
                  placement: resetPlacement
                }
              };
            }
          }
          return {};
        }
      };
    };
    async function convertValueToCoords(state, options) {
      const {
        placement,
        platform: platform2,
        elements
      } = state;
      const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
      const side = getSide(placement);
      const alignment = getAlignment(placement);
      const isVertical = getSideAxis(placement) === "y";
      const mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
      const crossAxisMulti = rtl && isVertical ? -1 : 1;
      const rawValue = evaluate(options, state);
      let {
        mainAxis,
        crossAxis,
        alignmentAxis
      } = typeof rawValue === "number" ? {
        mainAxis: rawValue,
        crossAxis: 0,
        alignmentAxis: null
      } : {
        mainAxis: rawValue.mainAxis || 0,
        crossAxis: rawValue.crossAxis || 0,
        alignmentAxis: rawValue.alignmentAxis
      };
      if (alignment && typeof alignmentAxis === "number") {
        crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
      }
      return isVertical ? {
        x: crossAxis * crossAxisMulti,
        y: mainAxis * mainAxisMulti
      } : {
        x: mainAxis * mainAxisMulti,
        y: crossAxis * crossAxisMulti
      };
    }
    const offset$1 = function(options) {
      if (options === void 0) {
        options = 0;
      }
      return {
        name: "offset",
        options,
        async fn(state) {
          var _middlewareData$offse, _middlewareData$arrow;
          const {
            x: x2,
            y,
            placement,
            middlewareData
          } = state;
          const diffCoords = await convertValueToCoords(state, options);
          if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
            return {};
          }
          return {
            x: x2 + diffCoords.x,
            y: y + diffCoords.y,
            data: {
              ...diffCoords,
              placement
            }
          };
        }
      };
    };
    const shift$1 = function(options) {
      if (options === void 0) {
        options = {};
      }
      return {
        name: "shift",
        options,
        async fn(state) {
          const {
            x: x2,
            y,
            placement
          } = state;
          const {
            mainAxis: checkMainAxis = true,
            crossAxis: checkCrossAxis = false,
            limiter = {
              fn: (_ref) => {
                let {
                  x: x3,
                  y: y2
                } = _ref;
                return {
                  x: x3,
                  y: y2
                };
              }
            },
            ...detectOverflowOptions
          } = evaluate(options, state);
          const coords = {
            x: x2,
            y
          };
          const overflow2 = await detectOverflow$1(state, detectOverflowOptions);
          const crossAxis = getSideAxis(getSide(placement));
          const mainAxis = getOppositeAxis(crossAxis);
          let mainAxisCoord = coords[mainAxis];
          let crossAxisCoord = coords[crossAxis];
          if (checkMainAxis) {
            const minSide = mainAxis === "y" ? "top" : "left";
            const maxSide = mainAxis === "y" ? "bottom" : "right";
            const min3 = mainAxisCoord + overflow2[minSide];
            const max3 = mainAxisCoord - overflow2[maxSide];
            mainAxisCoord = clamp$1(min3, mainAxisCoord, max3);
          }
          if (checkCrossAxis) {
            const minSide = crossAxis === "y" ? "top" : "left";
            const maxSide = crossAxis === "y" ? "bottom" : "right";
            const min3 = crossAxisCoord + overflow2[minSide];
            const max3 = crossAxisCoord - overflow2[maxSide];
            crossAxisCoord = clamp$1(min3, crossAxisCoord, max3);
          }
          const limitedCoords = limiter.fn({
            ...state,
            [mainAxis]: mainAxisCoord,
            [crossAxis]: crossAxisCoord
          });
          return {
            ...limitedCoords,
            data: {
              x: limitedCoords.x - x2,
              y: limitedCoords.y - y,
              enabled: {
                [mainAxis]: checkMainAxis,
                [crossAxis]: checkCrossAxis
              }
            }
          };
        }
      };
    };
    function hasWindow() {
      return typeof window !== "undefined";
    }
    function getNodeName(node) {
      if (isNode(node)) {
        return (node.nodeName || "").toLowerCase();
      }
      return "#document";
    }
    function getWindow(node) {
      var _node$ownerDocument;
      return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
    }
    function getDocumentElement(node) {
      var _ref;
      return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
    }
    function isNode(value) {
      if (!hasWindow()) {
        return false;
      }
      return value instanceof Node || value instanceof getWindow(value).Node;
    }
    function isElement(value) {
      if (!hasWindow()) {
        return false;
      }
      return value instanceof Element || value instanceof getWindow(value).Element;
    }
    function isHTMLElement$1(value) {
      if (!hasWindow()) {
        return false;
      }
      return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
    }
    function isShadowRoot(value) {
      if (!hasWindow() || typeof ShadowRoot === "undefined") {
        return false;
      }
      return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
    }
    function isOverflowElement(element) {
      const {
        overflow: overflow2,
        overflowX,
        overflowY,
        display: display2
      } = getComputedStyle$2(element);
      return /auto|scroll|overlay|hidden|clip/.test(overflow2 + overflowY + overflowX) && !["inline", "contents"].includes(display2);
    }
    function isTableElement(element) {
      return ["table", "td", "th"].includes(getNodeName(element));
    }
    function isTopLayer(element) {
      return [":popover-open", ":modal"].some((selector2) => {
        try {
          return element.matches(selector2);
        } catch (e2) {
          return false;
        }
      });
    }
    function isContainingBlock(elementOrCss) {
      const webkit = isWebKit();
      const css = isElement(elementOrCss) ? getComputedStyle$2(elementOrCss) : elementOrCss;
      return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
    }
    function getContainingBlock(element) {
      let currentNode = getParentNode(element);
      while (isHTMLElement$1(currentNode) && !isLastTraversableNode(currentNode)) {
        if (isContainingBlock(currentNode)) {
          return currentNode;
        } else if (isTopLayer(currentNode)) {
          return null;
        }
        currentNode = getParentNode(currentNode);
      }
      return null;
    }
    function isWebKit() {
      if (typeof CSS === "undefined" || !CSS.supports) return false;
      return CSS.supports("-webkit-backdrop-filter", "none");
    }
    function isLastTraversableNode(node) {
      return ["html", "body", "#document"].includes(getNodeName(node));
    }
    function getComputedStyle$2(element) {
      return getWindow(element).getComputedStyle(element);
    }
    function getNodeScroll(element) {
      if (isElement(element)) {
        return {
          scrollLeft: element.scrollLeft,
          scrollTop: element.scrollTop
        };
      }
      return {
        scrollLeft: element.scrollX,
        scrollTop: element.scrollY
      };
    }
    function getParentNode(node) {
      if (getNodeName(node) === "html") {
        return node;
      }
      const result = (
        // Step into the shadow DOM of the parent of a slotted node.
        node.assignedSlot || // DOM Element detected.
        node.parentNode || // ShadowRoot detected.
        isShadowRoot(node) && node.host || // Fallback.
        getDocumentElement(node)
      );
      return isShadowRoot(result) ? result.host : result;
    }
    function getNearestOverflowAncestor(node) {
      const parentNode2 = getParentNode(node);
      if (isLastTraversableNode(parentNode2)) {
        return node.ownerDocument ? node.ownerDocument.body : node.body;
      }
      if (isHTMLElement$1(parentNode2) && isOverflowElement(parentNode2)) {
        return parentNode2;
      }
      return getNearestOverflowAncestor(parentNode2);
    }
    function getOverflowAncestors(node, list, traverseIframes) {
      var _node$ownerDocument2;
      if (list === void 0) {
        list = [];
      }
      if (traverseIframes === void 0) {
        traverseIframes = true;
      }
      const scrollableAncestor = getNearestOverflowAncestor(node);
      const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
      const win = getWindow(scrollableAncestor);
      if (isBody) {
        const frameElement = getFrameElement(win);
        return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
      }
      return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
    }
    function getFrameElement(win) {
      return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
    }
    function getCssDimensions(element) {
      const css = getComputedStyle$2(element);
      let width = parseFloat(css.width) || 0;
      let height = parseFloat(css.height) || 0;
      const hasOffset = isHTMLElement$1(element);
      const offsetWidth = hasOffset ? element.offsetWidth : width;
      const offsetHeight = hasOffset ? element.offsetHeight : height;
      const shouldFallback = round$4(width) !== offsetWidth || round$4(height) !== offsetHeight;
      if (shouldFallback) {
        width = offsetWidth;
        height = offsetHeight;
      }
      return {
        width,
        height,
        $: shouldFallback
      };
    }
    function unwrapElement(element) {
      return !isElement(element) ? element.contextElement : element;
    }
    function getScale(element) {
      const domElement = unwrapElement(element);
      if (!isHTMLElement$1(domElement)) {
        return createCoords(1);
      }
      const rect = domElement.getBoundingClientRect();
      const {
        width,
        height,
        $: $2
      } = getCssDimensions(domElement);
      let x2 = ($2 ? round$4(rect.width) : rect.width) / width;
      let y = ($2 ? round$4(rect.height) : rect.height) / height;
      if (!x2 || !Number.isFinite(x2)) {
        x2 = 1;
      }
      if (!y || !Number.isFinite(y)) {
        y = 1;
      }
      return {
        x: x2,
        y
      };
    }
    const noOffsets = /* @__PURE__ */ createCoords(0);
    function getVisualOffsets(element) {
      const win = getWindow(element);
      if (!isWebKit() || !win.visualViewport) {
        return noOffsets;
      }
      return {
        x: win.visualViewport.offsetLeft,
        y: win.visualViewport.offsetTop
      };
    }
    function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
      if (isFixed === void 0) {
        isFixed = false;
      }
      if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
        return false;
      }
      return isFixed;
    }
    function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
      if (includeScale === void 0) {
        includeScale = false;
      }
      if (isFixedStrategy === void 0) {
        isFixedStrategy = false;
      }
      const clientRect = element.getBoundingClientRect();
      const domElement = unwrapElement(element);
      let scale2 = createCoords(1);
      if (includeScale) {
        if (offsetParent) {
          if (isElement(offsetParent)) {
            scale2 = getScale(offsetParent);
          }
        } else {
          scale2 = getScale(element);
        }
      }
      const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
      let x2 = (clientRect.left + visualOffsets.x) / scale2.x;
      let y = (clientRect.top + visualOffsets.y) / scale2.y;
      let width = clientRect.width / scale2.x;
      let height = clientRect.height / scale2.y;
      if (domElement) {
        const win = getWindow(domElement);
        const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
        let currentWin = win;
        let currentIFrame = getFrameElement(currentWin);
        while (currentIFrame && offsetParent && offsetWin !== currentWin) {
          const iframeScale = getScale(currentIFrame);
          const iframeRect = currentIFrame.getBoundingClientRect();
          const css = getComputedStyle$2(currentIFrame);
          const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
          const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
          x2 *= iframeScale.x;
          y *= iframeScale.y;
          width *= iframeScale.x;
          height *= iframeScale.y;
          x2 += left;
          y += top;
          currentWin = getWindow(currentIFrame);
          currentIFrame = getFrameElement(currentWin);
        }
      }
      return rectToClientRect({
        width,
        height,
        x: x2,
        y
      });
    }
    function getWindowScrollBarX(element, rect) {
      const leftScroll = getNodeScroll(element).scrollLeft;
      if (!rect) {
        return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
      }
      return rect.left + leftScroll;
    }
    function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
      if (ignoreScrollbarX === void 0) {
        ignoreScrollbarX = false;
      }
      const htmlRect = documentElement.getBoundingClientRect();
      const x2 = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
        // RTL <body> scrollbar.
        getWindowScrollBarX(documentElement, htmlRect)
      ));
      const y = htmlRect.top + scroll.scrollTop;
      return {
        x: x2,
        y
      };
    }
    function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
      let {
        elements,
        rect,
        offsetParent,
        strategy
      } = _ref;
      const isFixed = strategy === "fixed";
      const documentElement = getDocumentElement(offsetParent);
      const topLayer = elements ? isTopLayer(elements.floating) : false;
      if (offsetParent === documentElement || topLayer && isFixed) {
        return rect;
      }
      let scroll = {
        scrollLeft: 0,
        scrollTop: 0
      };
      let scale2 = createCoords(1);
      const offsets = createCoords(0);
      const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
      if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
        if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
          scroll = getNodeScroll(offsetParent);
        }
        if (isHTMLElement$1(offsetParent)) {
          const offsetRect = getBoundingClientRect(offsetParent);
          scale2 = getScale(offsetParent);
          offsets.x = offsetRect.x + offsetParent.clientLeft;
          offsets.y = offsetRect.y + offsetParent.clientTop;
        }
      }
      const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
      return {
        width: rect.width * scale2.x,
        height: rect.height * scale2.y,
        x: rect.x * scale2.x - scroll.scrollLeft * scale2.x + offsets.x + htmlOffset.x,
        y: rect.y * scale2.y - scroll.scrollTop * scale2.y + offsets.y + htmlOffset.y
      };
    }
    function getClientRects(element) {
      return Array.from(element.getClientRects());
    }
    function getDocumentRect(element) {
      const html = getDocumentElement(element);
      const scroll = getNodeScroll(element);
      const body = element.ownerDocument.body;
      const width = max$2(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
      const height = max$2(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
      let x2 = -scroll.scrollLeft + getWindowScrollBarX(element);
      const y = -scroll.scrollTop;
      if (getComputedStyle$2(body).direction === "rtl") {
        x2 += max$2(html.clientWidth, body.clientWidth) - width;
      }
      return {
        width,
        height,
        x: x2,
        y
      };
    }
    function getViewportRect(element, strategy) {
      const win = getWindow(element);
      const html = getDocumentElement(element);
      const visualViewport = win.visualViewport;
      let width = html.clientWidth;
      let height = html.clientHeight;
      let x2 = 0;
      let y = 0;
      if (visualViewport) {
        width = visualViewport.width;
        height = visualViewport.height;
        const visualViewportBased = isWebKit();
        if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
          x2 = visualViewport.offsetLeft;
          y = visualViewport.offsetTop;
        }
      }
      return {
        width,
        height,
        x: x2,
        y
      };
    }
    function getInnerBoundingClientRect(element, strategy) {
      const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
      const top = clientRect.top + element.clientTop;
      const left = clientRect.left + element.clientLeft;
      const scale2 = isHTMLElement$1(element) ? getScale(element) : createCoords(1);
      const width = element.clientWidth * scale2.x;
      const height = element.clientHeight * scale2.y;
      const x2 = left * scale2.x;
      const y = top * scale2.y;
      return {
        width,
        height,
        x: x2,
        y
      };
    }
    function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
      let rect;
      if (clippingAncestor === "viewport") {
        rect = getViewportRect(element, strategy);
      } else if (clippingAncestor === "document") {
        rect = getDocumentRect(getDocumentElement(element));
      } else if (isElement(clippingAncestor)) {
        rect = getInnerBoundingClientRect(clippingAncestor, strategy);
      } else {
        const visualOffsets = getVisualOffsets(element);
        rect = {
          x: clippingAncestor.x - visualOffsets.x,
          y: clippingAncestor.y - visualOffsets.y,
          width: clippingAncestor.width,
          height: clippingAncestor.height
        };
      }
      return rectToClientRect(rect);
    }
    function hasFixedPositionAncestor(element, stopNode) {
      const parentNode2 = getParentNode(element);
      if (parentNode2 === stopNode || !isElement(parentNode2) || isLastTraversableNode(parentNode2)) {
        return false;
      }
      return getComputedStyle$2(parentNode2).position === "fixed" || hasFixedPositionAncestor(parentNode2, stopNode);
    }
    function getClippingElementAncestors(element, cache2) {
      const cachedResult = cache2.get(element);
      if (cachedResult) {
        return cachedResult;
      }
      let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
      let currentContainingBlockComputedStyle = null;
      const elementIsFixed = getComputedStyle$2(element).position === "fixed";
      let currentNode = elementIsFixed ? getParentNode(element) : element;
      while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
        const computedStyle = getComputedStyle$2(currentNode);
        const currentNodeIsContaining = isContainingBlock(currentNode);
        if (!currentNodeIsContaining && computedStyle.position === "fixed") {
          currentContainingBlockComputedStyle = null;
        }
        const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && ["absolute", "fixed"].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
        if (shouldDropCurrentNode) {
          result = result.filter((ancestor) => ancestor !== currentNode);
        } else {
          currentContainingBlockComputedStyle = computedStyle;
        }
        currentNode = getParentNode(currentNode);
      }
      cache2.set(element, result);
      return result;
    }
    function getClippingRect(_ref) {
      let {
        element,
        boundary,
        rootBoundary,
        strategy
      } = _ref;
      const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
      const clippingAncestors = [...elementClippingAncestors, rootBoundary];
      const firstClippingAncestor = clippingAncestors[0];
      const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
        const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
        accRect.top = max$2(rect.top, accRect.top);
        accRect.right = min$2(rect.right, accRect.right);
        accRect.bottom = min$2(rect.bottom, accRect.bottom);
        accRect.left = max$2(rect.left, accRect.left);
        return accRect;
      }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
      return {
        width: clippingRect.right - clippingRect.left,
        height: clippingRect.bottom - clippingRect.top,
        x: clippingRect.left,
        y: clippingRect.top
      };
    }
    function getDimensions(element) {
      const {
        width,
        height
      } = getCssDimensions(element);
      return {
        width,
        height
      };
    }
    function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
      const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
      const documentElement = getDocumentElement(offsetParent);
      const isFixed = strategy === "fixed";
      const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
      let scroll = {
        scrollLeft: 0,
        scrollTop: 0
      };
      const offsets = createCoords(0);
      function setLeftRTLScrollbarOffset() {
        offsets.x = getWindowScrollBarX(documentElement);
      }
      if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
        if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
          scroll = getNodeScroll(offsetParent);
        }
        if (isOffsetParentAnElement) {
          const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
          offsets.x = offsetRect.x + offsetParent.clientLeft;
          offsets.y = offsetRect.y + offsetParent.clientTop;
        } else if (documentElement) {
          setLeftRTLScrollbarOffset();
        }
      }
      if (isFixed && !isOffsetParentAnElement && documentElement) {
        setLeftRTLScrollbarOffset();
      }
      const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
      const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
      const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
      return {
        x: x2,
        y,
        width: rect.width,
        height: rect.height
      };
    }
    function isStaticPositioned(element) {
      return getComputedStyle$2(element).position === "static";
    }
    function getTrueOffsetParent(element, polyfill) {
      if (!isHTMLElement$1(element) || getComputedStyle$2(element).position === "fixed") {
        return null;
      }
      if (polyfill) {
        return polyfill(element);
      }
      let rawOffsetParent = element.offsetParent;
      if (getDocumentElement(element) === rawOffsetParent) {
        rawOffsetParent = rawOffsetParent.ownerDocument.body;
      }
      return rawOffsetParent;
    }
    function getOffsetParent(element, polyfill) {
      const win = getWindow(element);
      if (isTopLayer(element)) {
        return win;
      }
      if (!isHTMLElement$1(element)) {
        let svgOffsetParent = getParentNode(element);
        while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
          if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
            return svgOffsetParent;
          }
          svgOffsetParent = getParentNode(svgOffsetParent);
        }
        return win;
      }
      let offsetParent = getTrueOffsetParent(element, polyfill);
      while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
        offsetParent = getTrueOffsetParent(offsetParent, polyfill);
      }
      if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
        return win;
      }
      return offsetParent || getContainingBlock(element) || win;
    }
    const getElementRects = async function(data) {
      const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
      const getDimensionsFn = this.getDimensions;
      const floatingDimensions = await getDimensionsFn(data.floating);
      return {
        reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
        floating: {
          x: 0,
          y: 0,
          width: floatingDimensions.width,
          height: floatingDimensions.height
        }
      };
    };
    function isRTL(element) {
      return getComputedStyle$2(element).direction === "rtl";
    }
    const platform$3 = {
      convertOffsetParentRelativeRectToViewportRelativeRect,
      getDocumentElement,
      getClippingRect,
      getOffsetParent,
      getElementRects,
      getClientRects,
      getDimensions,
      getScale,
      isElement,
      isRTL
    };
    function rectsAreEqual(a2, b2) {
      return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height;
    }
    function observeMove(element, onMove) {
      let io = null;
      let timeoutId;
      const root2 = getDocumentElement(element);
      function cleanup() {
        var _io;
        clearTimeout(timeoutId);
        (_io = io) == null || _io.disconnect();
        io = null;
      }
      function refresh(skip, threshold) {
        if (skip === void 0) {
          skip = false;
        }
        if (threshold === void 0) {
          threshold = 1;
        }
        cleanup();
        const elementRectForRootMargin = element.getBoundingClientRect();
        const {
          left,
          top,
          width,
          height
        } = elementRectForRootMargin;
        if (!skip) {
          onMove();
        }
        if (!width || !height) {
          return;
        }
        const insetTop = floor(top);
        const insetRight = floor(root2.clientWidth - (left + width));
        const insetBottom = floor(root2.clientHeight - (top + height));
        const insetLeft = floor(left);
        const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
        const options = {
          rootMargin,
          threshold: max$2(0, min$2(1, threshold)) || 1
        };
        let isFirstUpdate = true;
        function handleObserve(entries) {
          const ratio = entries[0].intersectionRatio;
          if (ratio !== threshold) {
            if (!isFirstUpdate) {
              return refresh();
            }
            if (!ratio) {
              timeoutId = setTimeout(() => {
                refresh(false, 1e-7);
              }, 1e3);
            } else {
              refresh(false, ratio);
            }
          }
          if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
            refresh();
          }
          isFirstUpdate = false;
        }
        try {
          io = new IntersectionObserver(handleObserve, {
            ...options,
            // Handle <iframe>s
            root: root2.ownerDocument
          });
        } catch (_e) {
          io = new IntersectionObserver(handleObserve, options);
        }
        io.observe(element);
      }
      refresh(true);
      return cleanup;
    }
    function autoUpdate(reference, floating, update, options) {
      if (options === void 0) {
        options = {};
      }
      const {
        ancestorScroll = true,
        ancestorResize = true,
        elementResize = typeof ResizeObserver === "function",
        layoutShift = typeof IntersectionObserver === "function",
        animationFrame = false
      } = options;
      const referenceEl = unwrapElement(reference);
      const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
      ancestors.forEach((ancestor) => {
        ancestorScroll && ancestor.addEventListener("scroll", update, {
          passive: true
        });
        ancestorResize && ancestor.addEventListener("resize", update);
      });
      const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
      let reobserveFrame = -1;
      let resizeObserver = null;
      if (elementResize) {
        resizeObserver = new ResizeObserver((_ref) => {
          let [firstEntry] = _ref;
          if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
            resizeObserver.unobserve(floating);
            cancelAnimationFrame(reobserveFrame);
            reobserveFrame = requestAnimationFrame(() => {
              var _resizeObserver;
              (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
            });
          }
          update();
        });
        if (referenceEl && !animationFrame) {
          resizeObserver.observe(referenceEl);
        }
        resizeObserver.observe(floating);
      }
      let frameId;
      let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
      if (animationFrame) {
        frameLoop();
      }
      function frameLoop() {
        const nextRefRect = getBoundingClientRect(reference);
        if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
          update();
        }
        prevRefRect = nextRefRect;
        frameId = requestAnimationFrame(frameLoop);
      }
      update();
      return () => {
        var _resizeObserver2;
        ancestors.forEach((ancestor) => {
          ancestorScroll && ancestor.removeEventListener("scroll", update);
          ancestorResize && ancestor.removeEventListener("resize", update);
        });
        cleanupIo == null || cleanupIo();
        (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
        resizeObserver = null;
        if (animationFrame) {
          cancelAnimationFrame(frameId);
        }
      };
    }
    const detectOverflow = detectOverflow$1;
    const offset = offset$1;
    const shift = shift$1;
    const flip = flip$1;
    const arrow = arrow$1;
    const computePosition = (reference, floating, options) => {
      const cache2 = /* @__PURE__ */ new Map();
      const mergedOptions = {
        platform: platform$3,
        ...options
      };
      const platformWithCache = {
        ...mergedOptions.platform,
        _c: cache2
      };
      return computePosition$1(reference, floating, {
        ...mergedOptions,
        platform: platformWithCache
      });
    };
    const visualHiddenProps = buildProps({
      style: {
        type: definePropType([String, Object, Array]),
        default: () => ({})
      }
    });
    const __default__$n = /* @__PURE__ */ defineComponent({
      name: "ElVisuallyHidden"
    });
    const _sfc_main$A = /* @__PURE__ */ defineComponent({
      ...__default__$n,
      props: visualHiddenProps,
      setup(__props) {
        const props2 = __props;
        const computedStyle = computed(() => {
          return [
            props2.style,
            {
              position: "absolute",
              border: 0,
              width: 1,
              height: 1,
              padding: 0,
              margin: -1,
              overflow: "hidden",
              clip: "rect(0, 0, 0, 0)",
              whiteSpace: "nowrap",
              wordWrap: "normal"
            }
          ];
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("span", mergeProps(_ctx.$attrs, { style: unref(computedStyle) }), [
            renderSlot(_ctx.$slots, "default")
          ], 16);
        };
      }
    });
    var ElVisuallyHidden = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__file", "visual-hidden.vue"]]);
    buildProps({});
    const unrefReference = (elRef) => {
      if (!isClient)
        return;
      if (!elRef)
        return elRef;
      const unrefEl = unrefElement(elRef);
      if (unrefEl)
        return unrefEl;
      return isRef(elRef) ? unrefEl : elRef;
    };
    const useFloating$1 = ({
      middleware,
      placement,
      strategy
    }) => {
      const referenceRef = ref();
      const contentRef = ref();
      const x2 = ref();
      const y = ref();
      const middlewareData = ref({});
      const states = {
        x: x2,
        y,
        placement,
        strategy,
        middlewareData
      };
      const update = async () => {
        if (!isClient)
          return;
        const referenceEl = unrefReference(referenceRef);
        const contentEl = unrefElement(contentRef);
        if (!referenceEl || !contentEl)
          return;
        const data = await computePosition(referenceEl, contentEl, {
          placement: unref(placement),
          strategy: unref(strategy),
          middleware: unref(middleware)
        });
        keysOf(states).forEach((key) => {
          states[key].value = data[key];
        });
      };
      onMounted(() => {
        watchEffect(() => {
          update();
        });
      });
      return {
        ...states,
        update,
        referenceRef,
        contentRef
      };
    };
    const arrowMiddleware = ({
      arrowRef,
      padding
    }) => {
      return {
        name: "arrow",
        options: {
          element: arrowRef,
          padding
        },
        fn(args) {
          const arrowEl = unref(arrowRef);
          if (!arrowEl)
            return {};
          return arrow({
            element: arrowEl,
            padding
          }).fn(args);
        }
      };
    };
    const __default__$m = /* @__PURE__ */ defineComponent({
      name: "ElTooltipV2Content"
    });
    const _sfc_main$z = /* @__PURE__ */ defineComponent({
      ...__default__$m,
      props: { ...tooltipV2ContentProps, ...tooltipV2CommonProps },
      setup(__props) {
        const props2 = __props;
        const { triggerRef, contentId } = inject(tooltipV2RootKey);
        const placement = ref(props2.placement);
        const strategy = ref(props2.strategy);
        const arrowRef = ref(null);
        const { referenceRef, contentRef, middlewareData, x: x2, y, update } = useFloating$1({
          placement,
          strategy,
          middleware: computed(() => {
            const middleware = [offset(props2.offset)];
            if (props2.showArrow) {
              middleware.push(arrowMiddleware({
                arrowRef
              }));
            }
            return middleware;
          })
        });
        const zIndex2 = useZIndex().nextZIndex();
        const ns = useNamespace("tooltip-v2");
        const side = computed(() => {
          return placement.value.split("-")[0];
        });
        const contentStyle = computed(() => {
          return {
            position: unref(strategy),
            top: `${unref(y) || 0}px`,
            left: `${unref(x2) || 0}px`,
            zIndex: zIndex2
          };
        });
        const arrowStyle = computed(() => {
          if (!props2.showArrow)
            return {};
          const { arrow: arrow2 } = unref(middlewareData);
          return {
            [`--${ns.namespace.value}-tooltip-v2-arrow-x`]: `${arrow2 == null ? void 0 : arrow2.x}px` || "",
            [`--${ns.namespace.value}-tooltip-v2-arrow-y`]: `${arrow2 == null ? void 0 : arrow2.y}px` || ""
          };
        });
        const contentClass = computed(() => [
          ns.e("content"),
          ns.is("dark", props2.effect === "dark"),
          ns.is(unref(strategy)),
          props2.contentClass
        ]);
        watch(arrowRef, () => update());
        watch(() => props2.placement, (val) => placement.value = val);
        onMounted(() => {
          watch(() => props2.reference || triggerRef.value, (el) => {
            referenceRef.value = el || void 0;
          }, {
            immediate: true
          });
        });
        provide(tooltipV2ContentKey, { arrowRef });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "contentRef",
            ref: contentRef,
            style: normalizeStyle$1(unref(contentStyle)),
            "data-tooltip-v2-root": ""
          }, [
            !_ctx.nowrap ? (openBlock(), createElementBlock("div", {
              key: 0,
              "data-side": unref(side),
              class: normalizeClass(unref(contentClass))
            }, [
              renderSlot(_ctx.$slots, "default", {
                contentStyle: unref(contentStyle),
                contentClass: unref(contentClass)
              }),
              createVNode$1(unref(ElVisuallyHidden), {
                id: unref(contentId),
                role: "tooltip"
              }, {
                default: withCtx(() => [
                  _ctx.ariaLabel ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
                    createTextVNode(toDisplayString(_ctx.ariaLabel), 1)
                  ], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 })
                ]),
                _: 3
              }, 8, ["id"]),
              renderSlot(_ctx.$slots, "arrow", {
                style: normalizeStyle$1(unref(arrowStyle)),
                side: unref(side)
              })
            ], 10, ["data-side"])) : createCommentVNode("v-if", true)
          ], 4);
        };
      }
    });
    var TooltipV2Content = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__file", "content.vue"]]);
    const forwardRefProps = buildProps({
      setRef: {
        type: definePropType(Function),
        required: true
      },
      onlyChild: Boolean
    });
    var ForwardRef = /* @__PURE__ */ defineComponent({
      props: forwardRefProps,
      setup(props2, {
        slots
      }) {
        const fragmentRef = ref();
        const setRef2 = composeRefs(fragmentRef, (el) => {
          if (el) {
            props2.setRef(el.nextElementSibling);
          } else {
            props2.setRef(null);
          }
        });
        return () => {
          var _a2;
          const [firstChild] = ((_a2 = slots.default) == null ? void 0 : _a2.call(slots)) || [];
          const child = props2.onlyChild ? ensureOnlyChild(firstChild.children) : firstChild.children;
          return createVNode$1(Fragment, {
            "ref": setRef2
          }, [child]);
        };
      }
    });
    const __default__$l = /* @__PURE__ */ defineComponent({
      name: "ElTooltipV2Trigger"
    });
    const _sfc_main$y = /* @__PURE__ */ defineComponent({
      ...__default__$l,
      props: {
        ...tooltipV2CommonProps,
        ...tooltipV2TriggerProps
      },
      setup(__props) {
        const props2 = __props;
        const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = inject(tooltipV2RootKey);
        let isMousedown = false;
        const setTriggerRef = (el) => {
          triggerRef.value = el;
        };
        const onMouseup = () => {
          isMousedown = false;
        };
        const onMouseenter = composeEventHandlers(props2.onMouseEnter, onDelayOpen);
        const onMouseleave = composeEventHandlers(props2.onMouseLeave, onClose);
        const onMousedown = composeEventHandlers(props2.onMouseDown, () => {
          onClose();
          isMousedown = true;
          document.addEventListener("mouseup", onMouseup, { once: true });
        });
        const onFocus = composeEventHandlers(props2.onFocus, () => {
          if (!isMousedown)
            onOpen();
        });
        const onBlur = composeEventHandlers(props2.onBlur, onClose);
        const onClick = composeEventHandlers(props2.onClick, (e2) => {
          if (e2.detail === 0)
            onClose();
        });
        const events = {
          blur: onBlur,
          click: onClick,
          focus: onFocus,
          mousedown: onMousedown,
          mouseenter: onMouseenter,
          mouseleave: onMouseleave
        };
        const setEvents = (el, events2, type) => {
          if (el) {
            Object.entries(events2).forEach(([name, handler]) => {
              el[type](name, handler);
            });
          }
        };
        watch(triggerRef, (triggerEl, previousTriggerEl) => {
          setEvents(triggerEl, events, "addEventListener");
          setEvents(previousTriggerEl, events, "removeEventListener");
          if (triggerEl) {
            triggerEl.setAttribute("aria-describedby", contentId.value);
          }
        });
        onBeforeUnmount(() => {
          setEvents(triggerRef.value, events, "removeEventListener");
          document.removeEventListener("mouseup", onMouseup);
        });
        return (_ctx, _cache) => {
          return _ctx.nowrap ? (openBlock(), createBlock(unref(ForwardRef), {
            key: 0,
            "set-ref": setTriggerRef,
            "only-child": ""
          }, {
            default: withCtx(() => [
              renderSlot(_ctx.$slots, "default")
            ]),
            _: 3
          })) : (openBlock(), createElementBlock("button", mergeProps({
            key: 1,
            ref_key: "triggerRef",
            ref: triggerRef
          }, _ctx.$attrs), [
            renderSlot(_ctx.$slots, "default")
          ], 16));
        };
      }
    });
    var TooltipV2Trigger = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "trigger.vue"]]);
    const __default__$k = /* @__PURE__ */ defineComponent({
      name: "ElTooltipV2"
    });
    const _sfc_main$x = /* @__PURE__ */ defineComponent({
      ...__default__$k,
      props: tooltipV2Props,
      setup(__props) {
        const props2 = __props;
        const refedProps = toRefs(props2);
        const arrowProps = reactive(pick(refedProps, Object.keys(tooltipV2ArrowProps)));
        const contentProps = reactive(pick(refedProps, Object.keys(tooltipV2ContentProps)));
        const rootProps = reactive(pick(refedProps, Object.keys(tooltipV2RootProps)));
        const triggerProps = reactive(pick(refedProps, Object.keys(tooltipV2TriggerProps)));
        return (_ctx, _cache) => {
          return openBlock(), createBlock(TooltipV2Root, normalizeProps(guardReactiveProps(rootProps)), {
            default: withCtx(({ open: open2 }) => [
              createVNode$1(TooltipV2Trigger, mergeProps(triggerProps, { nowrap: "" }), {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, "trigger")
                ]),
                _: 3
              }, 16),
              createVNode$1(unref(ElTeleport), {
                to: _ctx.to,
                disabled: !_ctx.teleported
              }, {
                default: withCtx(() => [
                  _ctx.fullTransition ? (openBlock(), createBlock(Transition, normalizeProps(mergeProps({ key: 0 }, _ctx.transitionProps)), {
                    default: withCtx(() => [
                      _ctx.alwaysOn || open2 ? (openBlock(), createBlock(TooltipV2Content, normalizeProps(mergeProps({ key: 0 }, contentProps)), {
                        arrow: withCtx(({ style, side }) => [
                          _ctx.showArrow ? (openBlock(), createBlock(TooltipV2Arrow, mergeProps({ key: 0 }, arrowProps, {
                            style,
                            side
                          }), null, 16, ["style", "side"])) : createCommentVNode("v-if", true)
                        ]),
                        default: withCtx(() => [
                          renderSlot(_ctx.$slots, "default")
                        ]),
                        _: 3
                      }, 16)) : createCommentVNode("v-if", true)
                    ]),
                    _: 2
                  }, 1040)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                    _ctx.alwaysOn || open2 ? (openBlock(), createBlock(TooltipV2Content, normalizeProps(mergeProps({ key: 0 }, contentProps)), {
                      arrow: withCtx(({ style, side }) => [
                        _ctx.showArrow ? (openBlock(), createBlock(TooltipV2Arrow, mergeProps({ key: 0 }, arrowProps, {
                          style,
                          side
                        }), null, 16, ["style", "side"])) : createCommentVNode("v-if", true)
                      ]),
                      default: withCtx(() => [
                        renderSlot(_ctx.$slots, "default")
                      ]),
                      _: 3
                    }, 16)) : createCommentVNode("v-if", true)
                  ], 64))
                ]),
                _: 2
              }, 1032, ["to", "disabled"])
            ]),
            _: 3
          }, 16);
        };
      }
    });
    var TooltipV2 = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "tooltip.vue"]]);
    const ElTooltipV2 = withInstall(TooltipV2);
    const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
    const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
    const transferProps = buildProps({
      data: {
        type: definePropType(Array),
        default: () => []
      },
      titles: {
        type: definePropType(Array),
        default: () => []
      },
      buttonTexts: {
        type: definePropType(Array),
        default: () => []
      },
      filterPlaceholder: String,
      filterMethod: {
        type: definePropType(Function)
      },
      leftDefaultChecked: {
        type: definePropType(Array),
        default: () => []
      },
      rightDefaultChecked: {
        type: definePropType(Array),
        default: () => []
      },
      renderContent: {
        type: definePropType(Function)
      },
      modelValue: {
        type: definePropType(Array),
        default: () => []
      },
      format: {
        type: definePropType(Object),
        default: () => ({})
      },
      filterable: Boolean,
      props: {
        type: definePropType(Object),
        default: () => mutable({
          label: "label",
          key: "key",
          disabled: "disabled"
        })
      },
      targetOrder: {
        type: String,
        values: ["original", "push", "unshift"],
        default: "original"
      },
      validateEvent: {
        type: Boolean,
        default: true
      }
    });
    const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray$5) || isArray$5(value) && isNil(movedKeys);
    const transferEmits = {
      [CHANGE_EVENT]: (value, direction2, movedKeys) => [value, movedKeys].every(isArray$5) && ["left", "right"].includes(direction2),
      [UPDATE_MODEL_EVENT]: (value) => isArray$5(value),
      [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
      [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
    };
    const CHECKED_CHANGE_EVENT = "checked-change";
    const transferPanelProps = buildProps({
      data: transferProps.data,
      optionRender: {
        type: definePropType(Function)
      },
      placeholder: String,
      title: String,
      filterable: Boolean,
      format: transferProps.format,
      filterMethod: transferProps.filterMethod,
      defaultChecked: transferProps.leftDefaultChecked,
      props: transferProps.props
    });
    const transferPanelEmits = {
      [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn
    };
    const usePropsAlias = (props2) => {
      const initProps2 = {
        label: "label",
        key: "key",
        disabled: "disabled"
      };
      return computed(() => ({
        ...initProps2,
        ...props2.props
      }));
    };
    const useCheck$1 = (props2, panelState, emit2) => {
      const propsAlias = usePropsAlias(props2);
      const filteredData = computed(() => {
        return props2.data.filter((item) => {
          if (isFunction$4(props2.filterMethod)) {
            return props2.filterMethod(panelState.query, item);
          } else {
            const label = String(item[propsAlias.value.label] || item[propsAlias.value.key]);
            return label.toLowerCase().includes(panelState.query.toLowerCase());
          }
        });
      });
      const checkableData = computed(() => filteredData.value.filter((item) => !item[propsAlias.value.disabled]));
      const checkedSummary = computed(() => {
        const checkedLength = panelState.checked.length;
        const dataLength = props2.data.length;
        const { noChecked, hasChecked } = props2.format;
        if (noChecked && hasChecked) {
          return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
        } else {
          return `${checkedLength}/${dataLength}`;
        }
      });
      const isIndeterminate = computed(() => {
        const checkedLength = panelState.checked.length;
        return checkedLength > 0 && checkedLength < checkableData.value.length;
      });
      const updateAllChecked = () => {
        const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
        panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item));
      };
      const handleAllCheckedChange = (value) => {
        panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
      };
      watch(() => panelState.checked, (val, oldVal) => {
        updateAllChecked();
        if (panelState.checkChangeByUser) {
          const movedKeys = val.concat(oldVal).filter((v4) => !val.includes(v4) || !oldVal.includes(v4));
          emit2(CHECKED_CHANGE_EVENT, val, movedKeys);
        } else {
          emit2(CHECKED_CHANGE_EVENT, val);
          panelState.checkChangeByUser = true;
        }
      });
      watch(checkableData, () => {
        updateAllChecked();
      });
      watch(() => props2.data, () => {
        const checked = [];
        const filteredDataKeys = filteredData.value.map((item) => item[propsAlias.value.key]);
        panelState.checked.forEach((item) => {
          if (filteredDataKeys.includes(item)) {
            checked.push(item);
          }
        });
        panelState.checkChangeByUser = false;
        panelState.checked = checked;
      });
      watch(() => props2.defaultChecked, (val, oldVal) => {
        if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item)))
          return;
        const checked = [];
        const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
        val.forEach((item) => {
          if (checkableDataKeys.includes(item)) {
            checked.push(item);
          }
        });
        panelState.checkChangeByUser = false;
        panelState.checked = checked;
      }, {
        immediate: true
      });
      return {
        filteredData,
        checkableData,
        checkedSummary,
        isIndeterminate,
        updateAllChecked,
        handleAllCheckedChange
      };
    };
    const __default__$j = /* @__PURE__ */ defineComponent({
      name: "ElTransferPanel"
    });
    const _sfc_main$w = /* @__PURE__ */ defineComponent({
      ...__default__$j,
      props: transferPanelProps,
      emits: transferPanelEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const slots = useSlots();
        const OptionContent = ({ option }) => option;
        const { t } = useLocale();
        const ns = useNamespace("transfer");
        const panelState = reactive({
          checked: [],
          allChecked: false,
          query: "",
          checkChangeByUser: true
        });
        const propsAlias = usePropsAlias(props2);
        const {
          filteredData,
          checkedSummary,
          isIndeterminate,
          handleAllCheckedChange
        } = useCheck$1(props2, panelState, emit2);
        const hasNoMatch = computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
        const hasFooter = computed(() => !isEmpty(slots.default()[0].children));
        const { checked, allChecked, query } = toRefs(panelState);
        expose({
          query
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b("panel"))
          }, [
            createBaseVNode("p", {
              class: normalizeClass(unref(ns).be("panel", "header"))
            }, [
              createVNode$1(unref(ElCheckbox), {
                modelValue: unref(allChecked),
                "onUpdate:modelValue": ($event) => isRef(allChecked) ? allChecked.value = $event : null,
                indeterminate: unref(isIndeterminate),
                "validate-event": false,
                onChange: unref(handleAllCheckedChange)
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(_ctx.title) + " ", 1),
                  createBaseVNode("span", null, toDisplayString(unref(checkedSummary)), 1)
                ]),
                _: 1
              }, 8, ["modelValue", "onUpdate:modelValue", "indeterminate", "onChange"])
            ], 2),
            createBaseVNode("div", {
              class: normalizeClass([unref(ns).be("panel", "body"), unref(ns).is("with-footer", unref(hasFooter))])
            }, [
              _ctx.filterable ? (openBlock(), createBlock(unref(ElInput), {
                key: 0,
                modelValue: unref(query),
                "onUpdate:modelValue": ($event) => isRef(query) ? query.value = $event : null,
                class: normalizeClass(unref(ns).be("panel", "filter")),
                size: "default",
                placeholder: _ctx.placeholder,
                "prefix-icon": unref(search_default),
                clearable: "",
                "validate-event": false
              }, null, 8, ["modelValue", "onUpdate:modelValue", "class", "placeholder", "prefix-icon"])) : createCommentVNode("v-if", true),
              withDirectives(createVNode$1(unref(ElCheckboxGroup$1), {
                modelValue: unref(checked),
                "onUpdate:modelValue": ($event) => isRef(checked) ? checked.value = $event : null,
                "validate-event": false,
                class: normalizeClass([unref(ns).is("filterable", _ctx.filterable), unref(ns).be("panel", "list")])
              }, {
                default: withCtx(() => [
                  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filteredData), (item) => {
                    return openBlock(), createBlock(unref(ElCheckbox), {
                      key: item[unref(propsAlias).key],
                      class: normalizeClass(unref(ns).be("panel", "item")),
                      value: item[unref(propsAlias).key],
                      disabled: item[unref(propsAlias).disabled],
                      "validate-event": false
                    }, {
                      default: withCtx(() => {
                        var _a2;
                        return [
                          createVNode$1(OptionContent, {
                            option: (_a2 = _ctx.optionRender) == null ? void 0 : _a2.call(_ctx, item)
                          }, null, 8, ["option"])
                        ];
                      }),
                      _: 2
                    }, 1032, ["class", "value", "disabled"]);
                  }), 128))
                ]),
                _: 1
              }, 8, ["modelValue", "onUpdate:modelValue", "class"]), [
                [vShow, !unref(hasNoMatch) && !unref(isEmpty)(_ctx.data)]
              ]),
              withDirectives(createBaseVNode("div", {
                class: normalizeClass(unref(ns).be("panel", "empty"))
              }, [
                renderSlot(_ctx.$slots, "empty", {}, () => [
                  createTextVNode(toDisplayString(unref(hasNoMatch) ? unref(t)("el.transfer.noMatch") : unref(t)("el.transfer.noData")), 1)
                ])
              ], 2), [
                [vShow, unref(hasNoMatch) || unref(isEmpty)(_ctx.data)]
              ])
            ], 2),
            unref(hasFooter) ? (openBlock(), createElementBlock("p", {
              key: 0,
              class: normalizeClass(unref(ns).be("panel", "footer"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "transfer-panel.vue"]]);
    const useComputedData = (props2) => {
      const propsAlias = usePropsAlias(props2);
      const dataObj = computed(() => props2.data.reduce((o2, cur) => (o2[cur[propsAlias.value.key]] = cur) && o2, {}));
      const sourceData = computed(() => props2.data.filter((item) => !props2.modelValue.includes(item[propsAlias.value.key])));
      const targetData = computed(() => {
        if (props2.targetOrder === "original") {
          return props2.data.filter((item) => props2.modelValue.includes(item[propsAlias.value.key]));
        } else {
          return props2.modelValue.reduce((arr, cur) => {
            const val = dataObj.value[cur];
            if (val) {
              arr.push(val);
            }
            return arr;
          }, []);
        }
      });
      return {
        sourceData,
        targetData
      };
    };
    const useMove = (props2, checkedState, emit2) => {
      const propsAlias = usePropsAlias(props2);
      const _emit = (value, direction2, movedKeys) => {
        emit2(UPDATE_MODEL_EVENT, value);
        emit2(CHANGE_EVENT, value, direction2, movedKeys);
      };
      const addToLeft = () => {
        const currentValue = props2.modelValue.slice();
        checkedState.rightChecked.forEach((item) => {
          const index = currentValue.indexOf(item);
          if (index > -1) {
            currentValue.splice(index, 1);
          }
        });
        _emit(currentValue, "left", checkedState.rightChecked);
      };
      const addToRight = () => {
        let currentValue = props2.modelValue.slice();
        const itemsToBeMoved = props2.data.filter((item) => {
          const itemKey = item[propsAlias.value.key];
          return checkedState.leftChecked.includes(itemKey) && !props2.modelValue.includes(itemKey);
        }).map((item) => item[propsAlias.value.key]);
        currentValue = props2.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
        if (props2.targetOrder === "original") {
          currentValue = props2.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]);
        }
        _emit(currentValue, "right", checkedState.leftChecked);
      };
      return {
        addToLeft,
        addToRight
      };
    };
    const useCheckedChange = (checkedState, emit2) => {
      const onSourceCheckedChange = (val, movedKeys) => {
        checkedState.leftChecked = val;
        if (!movedKeys)
          return;
        emit2(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
      };
      const onTargetCheckedChange = (val, movedKeys) => {
        checkedState.rightChecked = val;
        if (!movedKeys)
          return;
        emit2(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
      };
      return {
        onSourceCheckedChange,
        onTargetCheckedChange
      };
    };
    const __default__$i = /* @__PURE__ */ defineComponent({
      name: "ElTransfer"
    });
    const _sfc_main$v = /* @__PURE__ */ defineComponent({
      ...__default__$i,
      props: transferProps,
      emits: transferEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const slots = useSlots();
        const { t } = useLocale();
        const ns = useNamespace("transfer");
        const { formItem } = useFormItem();
        const checkedState = reactive({
          leftChecked: [],
          rightChecked: []
        });
        const propsAlias = usePropsAlias(props2);
        const { sourceData, targetData } = useComputedData(props2);
        const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit2);
        const { addToLeft, addToRight } = useMove(props2, checkedState, emit2);
        const leftPanel = ref();
        const rightPanel = ref();
        const clearQuery = (which) => {
          switch (which) {
            case "left":
              leftPanel.value.query = "";
              break;
            case "right":
              rightPanel.value.query = "";
              break;
          }
        };
        const hasButtonTexts = computed(() => props2.buttonTexts.length === 2);
        const leftPanelTitle = computed(() => props2.titles[0] || t("el.transfer.titles.0"));
        const rightPanelTitle = computed(() => props2.titles[1] || t("el.transfer.titles.1"));
        const panelFilterPlaceholder = computed(() => props2.filterPlaceholder || t("el.transfer.filterPlaceholder"));
        watch(() => props2.modelValue, () => {
          var _a2;
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
          }
        });
        const optionRender = computed(() => (option) => {
          var _a2;
          if (props2.renderContent)
            return props2.renderContent(h$1, option);
          const defaultSlotVNodes = (((_a2 = slots.default) == null ? void 0 : _a2.call(slots, { option })) || []).filter((node) => node.type !== Comment);
          if (defaultSlotVNodes.length) {
            return defaultSlotVNodes;
          }
          return h$1("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
        });
        expose({
          clearQuery,
          leftPanel,
          rightPanel
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).b())
          }, [
            createVNode$1(TransferPanel, {
              ref_key: "leftPanel",
              ref: leftPanel,
              data: unref(sourceData),
              "option-render": unref(optionRender),
              placeholder: unref(panelFilterPlaceholder),
              title: unref(leftPanelTitle),
              filterable: _ctx.filterable,
              format: _ctx.format,
              "filter-method": _ctx.filterMethod,
              "default-checked": _ctx.leftDefaultChecked,
              props: props2.props,
              onCheckedChange: unref(onSourceCheckedChange)
            }, {
              empty: withCtx(() => [
                renderSlot(_ctx.$slots, "left-empty")
              ]),
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "left-footer")
              ]),
              _: 3
            }, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("buttons"))
            }, [
              createVNode$1(unref(ElButton), {
                type: "primary",
                class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", unref(hasButtonTexts))]),
                disabled: unref(isEmpty)(checkedState.rightChecked),
                onClick: unref(addToLeft)
              }, {
                default: withCtx(() => [
                  createVNode$1(unref(ElIcon), null, {
                    default: withCtx(() => [
                      createVNode$1(unref(arrow_left_default))
                    ]),
                    _: 1
                  }),
                  !unref(isUndefined$1)(_ctx.buttonTexts[0]) ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.buttonTexts[0]), 1)) : createCommentVNode("v-if", true)
                ]),
                _: 1
              }, 8, ["class", "disabled", "onClick"]),
              createVNode$1(unref(ElButton), {
                type: "primary",
                class: normalizeClass([unref(ns).e("button"), unref(ns).is("with-texts", unref(hasButtonTexts))]),
                disabled: unref(isEmpty)(checkedState.leftChecked),
                onClick: unref(addToRight)
              }, {
                default: withCtx(() => [
                  !unref(isUndefined$1)(_ctx.buttonTexts[1]) ? (openBlock(), createElementBlock("span", { key: 0 }, toDisplayString(_ctx.buttonTexts[1]), 1)) : createCommentVNode("v-if", true),
                  createVNode$1(unref(ElIcon), null, {
                    default: withCtx(() => [
                      createVNode$1(unref(arrow_right_default))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["class", "disabled", "onClick"])
            ], 2),
            createVNode$1(TransferPanel, {
              ref_key: "rightPanel",
              ref: rightPanel,
              data: unref(targetData),
              "option-render": unref(optionRender),
              placeholder: unref(panelFilterPlaceholder),
              filterable: _ctx.filterable,
              format: _ctx.format,
              "filter-method": _ctx.filterMethod,
              title: unref(rightPanelTitle),
              "default-checked": _ctx.rightDefaultChecked,
              props: props2.props,
              onCheckedChange: unref(onTargetCheckedChange)
            }, {
              empty: withCtx(() => [
                renderSlot(_ctx.$slots, "right-empty")
              ]),
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "right-footer")
              ]),
              _: 3
            }, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
          ], 2);
        };
      }
    });
    var Transfer = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "transfer.vue"]]);
    const ElTransfer = withInstall(Transfer);
    const NODE_KEY = "$treeNodeId";
    const markNodeData = function(node, data) {
      if (!data || data[NODE_KEY])
        return;
      Object.defineProperty(data, NODE_KEY, {
        value: node.id,
        enumerable: false,
        configurable: false,
        writable: false
      });
    };
    const getNodeKey = (key, data) => data == null ? void 0 : data[key || NODE_KEY];
    const handleCurrentChange = (store2, emit2, setCurrent) => {
      const preCurrentNode = store2.value.currentNode;
      setCurrent();
      const currentNode = store2.value.currentNode;
      if (preCurrentNode === currentNode)
        return;
      emit2("current-change", currentNode ? currentNode.data : null, currentNode);
    };
    const getChildState = (node) => {
      let all2 = true;
      let none = true;
      let allWithoutDisable = true;
      for (let i2 = 0, j = node.length; i2 < j; i2++) {
        const n = node[i2];
        if (n.checked !== true || n.indeterminate) {
          all2 = false;
          if (!n.disabled) {
            allWithoutDisable = false;
          }
        }
        if (n.checked !== false || n.indeterminate) {
          none = false;
        }
      }
      return { all: all2, none, allWithoutDisable, half: !all2 && !none };
    };
    const reInitChecked = function(node) {
      if (node.childNodes.length === 0 || node.loading)
        return;
      const { all: all2, none, half } = getChildState(node.childNodes);
      if (all2) {
        node.checked = true;
        node.indeterminate = false;
      } else if (half) {
        node.checked = false;
        node.indeterminate = true;
      } else if (none) {
        node.checked = false;
        node.indeterminate = false;
      }
      const parent2 = node.parent;
      if (!parent2 || parent2.level === 0)
        return;
      if (!node.store.checkStrictly) {
        reInitChecked(parent2);
      }
    };
    const getPropertyFromData = function(node, prop) {
      const props2 = node.store.props;
      const data = node.data || {};
      const config = props2[prop];
      if (isFunction$4(config)) {
        return config(data, node);
      } else if (isString$3(config)) {
        return data[config];
      } else if (isUndefined$1(config)) {
        const dataProp = data[prop];
        return isUndefined$1(dataProp) ? "" : dataProp;
      }
    };
    let nodeIdSeed = 0;
    let Node$1 = class Node2 {
      constructor(options) {
        this.id = nodeIdSeed++;
        this.text = null;
        this.checked = false;
        this.indeterminate = false;
        this.data = null;
        this.expanded = false;
        this.parent = null;
        this.visible = true;
        this.isCurrent = false;
        this.canFocus = false;
        for (const name in options) {
          if (hasOwn$1(options, name)) {
            this[name] = options[name];
          }
        }
        this.level = 0;
        this.loaded = false;
        this.childNodes = [];
        this.loading = false;
        if (this.parent) {
          this.level = this.parent.level + 1;
        }
      }
      initialize() {
        const store2 = this.store;
        if (!store2) {
          throw new Error("[Node]store is required!");
        }
        store2.registerNode(this);
        const props2 = store2.props;
        if (props2 && typeof props2.isLeaf !== "undefined") {
          const isLeaf2 = getPropertyFromData(this, "isLeaf");
          if (isBoolean$1(isLeaf2)) {
            this.isLeafByUser = isLeaf2;
          }
        }
        if (store2.lazy !== true && this.data) {
          this.setData(this.data);
          if (store2.defaultExpandAll) {
            this.expanded = true;
            this.canFocus = true;
          }
        } else if (this.level > 0 && store2.lazy && store2.defaultExpandAll && !this.isLeafByUser) {
          this.expand();
        }
        if (!isArray$5(this.data)) {
          markNodeData(this, this.data);
        }
        if (!this.data)
          return;
        const defaultExpandedKeys = store2.defaultExpandedKeys;
        const key = store2.key;
        if (key && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) {
          this.expand(null, store2.autoExpandParent);
        }
        if (key && store2.currentNodeKey !== void 0 && this.key === store2.currentNodeKey) {
          store2.currentNode = this;
          store2.currentNode.isCurrent = true;
        }
        if (store2.lazy) {
          store2._initDefaultCheckedNode(this);
        }
        this.updateLeafState();
        if (this.parent && (this.level === 1 || this.parent.expanded === true))
          this.canFocus = true;
      }
      setData(data) {
        if (!isArray$5(data)) {
          markNodeData(this, data);
        }
        this.data = data;
        this.childNodes = [];
        let children;
        if (this.level === 0 && isArray$5(this.data)) {
          children = this.data;
        } else {
          children = getPropertyFromData(this, "children") || [];
        }
        for (let i2 = 0, j = children.length; i2 < j; i2++) {
          this.insertChild({ data: children[i2] });
        }
      }
      get label() {
        return getPropertyFromData(this, "label");
      }
      get key() {
        const nodeKey = this.store.key;
        if (this.data)
          return this.data[nodeKey];
        return null;
      }
      get disabled() {
        return getPropertyFromData(this, "disabled");
      }
      get nextSibling() {
        const parent2 = this.parent;
        if (parent2) {
          const index = parent2.childNodes.indexOf(this);
          if (index > -1) {
            return parent2.childNodes[index + 1];
          }
        }
        return null;
      }
      get previousSibling() {
        const parent2 = this.parent;
        if (parent2) {
          const index = parent2.childNodes.indexOf(this);
          if (index > -1) {
            return index > 0 ? parent2.childNodes[index - 1] : null;
          }
        }
        return null;
      }
      contains(target, deep = true) {
        return (this.childNodes || []).some((child) => child === target || deep && child.contains(target));
      }
      remove() {
        const parent2 = this.parent;
        if (parent2) {
          parent2.removeChild(this);
        }
      }
      insertChild(child, index, batch2) {
        if (!child)
          throw new Error("InsertChild error: child is required.");
        if (!(child instanceof Node2)) {
          if (!batch2) {
            const children = this.getChildren(true);
            if (!children.includes(child.data)) {
              if (isUndefined$1(index) || index < 0) {
                children.push(child.data);
              } else {
                children.splice(index, 0, child.data);
              }
            }
          }
          Object.assign(child, {
            parent: this,
            store: this.store
          });
          child = reactive(new Node2(child));
          if (child instanceof Node2) {
            child.initialize();
          }
        }
        child.level = this.level + 1;
        if (isUndefined$1(index) || index < 0) {
          this.childNodes.push(child);
        } else {
          this.childNodes.splice(index, 0, child);
        }
        this.updateLeafState();
      }
      insertBefore(child, ref2) {
        let index;
        if (ref2) {
          index = this.childNodes.indexOf(ref2);
        }
        this.insertChild(child, index);
      }
      insertAfter(child, ref2) {
        let index;
        if (ref2) {
          index = this.childNodes.indexOf(ref2);
          if (index !== -1)
            index += 1;
        }
        this.insertChild(child, index);
      }
      removeChild(child) {
        const children = this.getChildren() || [];
        const dataIndex = children.indexOf(child.data);
        if (dataIndex > -1) {
          children.splice(dataIndex, 1);
        }
        const index = this.childNodes.indexOf(child);
        if (index > -1) {
          this.store && this.store.deregisterNode(child);
          child.parent = null;
          this.childNodes.splice(index, 1);
        }
        this.updateLeafState();
      }
      removeChildByData(data) {
        let targetNode = null;
        for (let i2 = 0; i2 < this.childNodes.length; i2++) {
          if (this.childNodes[i2].data === data) {
            targetNode = this.childNodes[i2];
            break;
          }
        }
        if (targetNode) {
          this.removeChild(targetNode);
        }
      }
      expand(callback, expandParent) {
        const done = () => {
          if (expandParent) {
            let parent2 = this.parent;
            while (parent2.level > 0) {
              parent2.expanded = true;
              parent2 = parent2.parent;
            }
          }
          this.expanded = true;
          if (callback)
            callback();
          this.childNodes.forEach((item) => {
            item.canFocus = true;
          });
        };
        if (this.shouldLoadData()) {
          this.loadData((data) => {
            if (isArray$5(data)) {
              if (this.checked) {
                this.setChecked(true, true);
              } else if (!this.store.checkStrictly) {
                reInitChecked(this);
              }
              done();
            }
          });
        } else {
          done();
        }
      }
      doCreateChildren(array, defaultProps2 = {}) {
        array.forEach((item) => {
          this.insertChild(Object.assign({ data: item }, defaultProps2), void 0, true);
        });
      }
      collapse() {
        this.expanded = false;
        this.childNodes.forEach((item) => {
          item.canFocus = false;
        });
      }
      shouldLoadData() {
        return this.store.lazy === true && this.store.load && !this.loaded;
      }
      updateLeafState() {
        if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") {
          this.isLeaf = this.isLeafByUser;
          return;
        }
        const childNodes = this.childNodes;
        if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
          this.isLeaf = !childNodes || childNodes.length === 0;
          return;
        }
        this.isLeaf = false;
      }
      setChecked(value, deep, recursion, passValue) {
        this.indeterminate = value === "half";
        this.checked = value === true;
        if (this.store.checkStrictly)
          return;
        if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
          const { all: all2, allWithoutDisable } = getChildState(this.childNodes);
          if (!this.isLeaf && !all2 && allWithoutDisable) {
            this.checked = false;
            value = false;
          }
          const handleDescendants = () => {
            if (deep) {
              const childNodes = this.childNodes;
              for (let i2 = 0, j = childNodes.length; i2 < j; i2++) {
                const child = childNodes[i2];
                passValue = passValue || value !== false;
                const isCheck = child.disabled ? child.checked : passValue;
                child.setChecked(isCheck, deep, true, passValue);
              }
              const { half, all: all22 } = getChildState(childNodes);
              if (!all22) {
                this.checked = all22;
                this.indeterminate = half;
              }
            }
          };
          if (this.shouldLoadData()) {
            this.loadData(() => {
              handleDescendants();
              reInitChecked(this);
            }, {
              checked: value !== false
            });
            return;
          } else {
            handleDescendants();
          }
        }
        const parent2 = this.parent;
        if (!parent2 || parent2.level === 0)
          return;
        if (!recursion) {
          reInitChecked(parent2);
        }
      }
      getChildren(forceInit = false) {
        if (this.level === 0)
          return this.data;
        const data = this.data;
        if (!data)
          return null;
        const props2 = this.store.props;
        let children = "children";
        if (props2) {
          children = props2.children || "children";
        }
        if (isUndefined$1(data[children])) {
          data[children] = null;
        }
        if (forceInit && !data[children]) {
          data[children] = [];
        }
        return data[children];
      }
      updateChildren() {
        const newData = this.getChildren() || [];
        const oldData = this.childNodes.map((node) => node.data);
        const newDataMap = {};
        const newNodes = [];
        newData.forEach((item, index) => {
          const key = item[NODE_KEY];
          const isNodeExists = !!key && oldData.findIndex((data) => data[NODE_KEY] === key) >= 0;
          if (isNodeExists) {
            newDataMap[key] = { index, data: item };
          } else {
            newNodes.push({ index, data: item });
          }
        });
        if (!this.store.lazy) {
          oldData.forEach((item) => {
            if (!newDataMap[item[NODE_KEY]])
              this.removeChildByData(item);
          });
        }
        newNodes.forEach(({ index, data }) => {
          this.insertChild({ data }, index);
        });
        this.updateLeafState();
      }
      loadData(callback, defaultProps2 = {}) {
        if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps2).length)) {
          this.loading = true;
          const resolve2 = (children) => {
            this.childNodes = [];
            this.doCreateChildren(children, defaultProps2);
            this.loaded = true;
            this.loading = false;
            this.updateLeafState();
            if (callback) {
              callback.call(this, children);
            }
          };
          const reject = () => {
            this.loading = false;
          };
          this.store.load(this, resolve2, reject);
        } else {
          if (callback) {
            callback.call(this);
          }
        }
      }
      eachNode(callback) {
        const arr = [this];
        while (arr.length) {
          const node = arr.shift();
          arr.unshift(...node.childNodes);
          callback(node);
        }
      }
      reInitChecked() {
        if (this.store.checkStrictly)
          return;
        reInitChecked(this);
      }
    };
    class TreeStore {
      constructor(options) {
        this.currentNode = null;
        this.currentNodeKey = null;
        for (const option in options) {
          if (hasOwn$1(options, option)) {
            this[option] = options[option];
          }
        }
        this.nodesMap = {};
      }
      initialize() {
        this.root = new Node$1({
          data: this.data,
          store: this
        });
        this.root.initialize();
        if (this.lazy && this.load) {
          const loadFn = this.load;
          loadFn(this.root, (data) => {
            this.root.doCreateChildren(data);
            this._initDefaultCheckedNodes();
          });
        } else {
          this._initDefaultCheckedNodes();
        }
      }
      filter(value) {
        const filterNodeMethod = this.filterNodeMethod;
        const lazy = this.lazy;
        const traverse2 = async function(node) {
          const childNodes = node.root ? node.root.childNodes : node.childNodes;
          for (const [index, child] of childNodes.entries()) {
            child.visible = filterNodeMethod.call(child, value, child.data, child);
            if (index % 80 === 0 && index > 0) {
              await nextTick();
            }
            await traverse2(child);
          }
          if (!node.visible && childNodes.length) {
            let allHidden = true;
            allHidden = !childNodes.some((child) => child.visible);
            if (node.root) {
              node.root.visible = allHidden === false;
            } else {
              node.visible = allHidden === false;
            }
          }
          if (!value)
            return;
          if (node.visible && !node.isLeaf) {
            if (!lazy || node.loaded) {
              node.expand();
            }
          }
        };
        traverse2(this);
      }
      setData(newVal) {
        const instanceChanged = newVal !== this.root.data;
        if (instanceChanged) {
          this.nodesMap = {};
          this.root.setData(newVal);
          this._initDefaultCheckedNodes();
          this.setCurrentNodeKey(this.currentNodeKey);
        } else {
          this.root.updateChildren();
        }
      }
      getNode(data) {
        if (data instanceof Node$1)
          return data;
        const key = isObject$7(data) ? getNodeKey(this.key, data) : data;
        return this.nodesMap[key] || null;
      }
      insertBefore(data, refData) {
        const refNode = this.getNode(refData);
        refNode.parent.insertBefore({ data }, refNode);
      }
      insertAfter(data, refData) {
        const refNode = this.getNode(refData);
        refNode.parent.insertAfter({ data }, refNode);
      }
      remove(data) {
        const node = this.getNode(data);
        if (node && node.parent) {
          if (node === this.currentNode) {
            this.currentNode = null;
          }
          node.parent.removeChild(node);
        }
      }
      append(data, parentData) {
        const parentNode2 = !isPropAbsent(parentData) ? this.getNode(parentData) : this.root;
        if (parentNode2) {
          parentNode2.insertChild({ data });
        }
      }
      _initDefaultCheckedNodes() {
        const defaultCheckedKeys = this.defaultCheckedKeys || [];
        const nodesMap = this.nodesMap;
        defaultCheckedKeys.forEach((checkedKey) => {
          const node = nodesMap[checkedKey];
          if (node) {
            node.setChecked(true, !this.checkStrictly);
          }
        });
      }
      _initDefaultCheckedNode(node) {
        const defaultCheckedKeys = this.defaultCheckedKeys || [];
        if (defaultCheckedKeys.includes(node.key)) {
          node.setChecked(true, !this.checkStrictly);
        }
      }
      setDefaultCheckedKey(newVal) {
        if (newVal !== this.defaultCheckedKeys) {
          this.defaultCheckedKeys = newVal;
          this._initDefaultCheckedNodes();
        }
      }
      registerNode(node) {
        const key = this.key;
        if (!node || !node.data)
          return;
        if (!key) {
          this.nodesMap[node.id] = node;
        } else {
          const nodeKey = node.key;
          if (nodeKey !== void 0)
            this.nodesMap[node.key] = node;
        }
      }
      deregisterNode(node) {
        const key = this.key;
        if (!key || !node || !node.data)
          return;
        node.childNodes.forEach((child) => {
          this.deregisterNode(child);
        });
        delete this.nodesMap[node.key];
      }
      getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
        const checkedNodes = [];
        const traverse2 = function(node) {
          const childNodes = node.root ? node.root.childNodes : node.childNodes;
          childNodes.forEach((child) => {
            if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
              checkedNodes.push(child.data);
            }
            traverse2(child);
          });
        };
        traverse2(this);
        return checkedNodes;
      }
      getCheckedKeys(leafOnly = false) {
        return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
      }
      getHalfCheckedNodes() {
        const nodes = [];
        const traverse2 = function(node) {
          const childNodes = node.root ? node.root.childNodes : node.childNodes;
          childNodes.forEach((child) => {
            if (child.indeterminate) {
              nodes.push(child.data);
            }
            traverse2(child);
          });
        };
        traverse2(this);
        return nodes;
      }
      getHalfCheckedKeys() {
        return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
      }
      _getAllNodes() {
        const allNodes = [];
        const nodesMap = this.nodesMap;
        for (const nodeKey in nodesMap) {
          if (hasOwn$1(nodesMap, nodeKey)) {
            allNodes.push(nodesMap[nodeKey]);
          }
        }
        return allNodes;
      }
      updateChildren(key, data) {
        const node = this.nodesMap[key];
        if (!node)
          return;
        const childNodes = node.childNodes;
        for (let i2 = childNodes.length - 1; i2 >= 0; i2--) {
          const child = childNodes[i2];
          this.remove(child.data);
        }
        for (let i2 = 0, j = data.length; i2 < j; i2++) {
          const child = data[i2];
          this.append(child, node.data);
        }
      }
      _setCheckedKeys(key, leafOnly = false, checkedKeys) {
        const allNodes = this._getAllNodes().sort((a2, b2) => a2.level - b2.level);
        const cache2 = /* @__PURE__ */ Object.create(null);
        const keys2 = Object.keys(checkedKeys);
        allNodes.forEach((node) => node.setChecked(false, false));
        const cacheCheckedChild = (node) => {
          node.childNodes.forEach((child) => {
            var _a2;
            cache2[child.data[key]] = true;
            if ((_a2 = child.childNodes) == null ? void 0 : _a2.length) {
              cacheCheckedChild(child);
            }
          });
        };
        for (let i2 = 0, j = allNodes.length; i2 < j; i2++) {
          const node = allNodes[i2];
          const nodeKey = node.data[key].toString();
          const checked = keys2.includes(nodeKey);
          if (!checked) {
            if (node.checked && !cache2[nodeKey]) {
              node.setChecked(false, false);
            }
            continue;
          }
          if (node.childNodes.length) {
            cacheCheckedChild(node);
          }
          if (node.isLeaf || this.checkStrictly) {
            node.setChecked(true, false);
            continue;
          }
          node.setChecked(true, true);
          if (leafOnly) {
            node.setChecked(false, false);
            const traverse2 = function(node2) {
              const childNodes = node2.childNodes;
              childNodes.forEach((child) => {
                if (!child.isLeaf) {
                  child.setChecked(false, false);
                }
                traverse2(child);
              });
            };
            traverse2(node);
          }
        }
      }
      setCheckedNodes(array, leafOnly = false) {
        const key = this.key;
        const checkedKeys = {};
        array.forEach((item) => {
          checkedKeys[(item || {})[key]] = true;
        });
        this._setCheckedKeys(key, leafOnly, checkedKeys);
      }
      setCheckedKeys(keys2, leafOnly = false) {
        this.defaultCheckedKeys = keys2;
        const key = this.key;
        const checkedKeys = {};
        keys2.forEach((key2) => {
          checkedKeys[key2] = true;
        });
        this._setCheckedKeys(key, leafOnly, checkedKeys);
      }
      setDefaultExpandedKeys(keys2) {
        keys2 = keys2 || [];
        this.defaultExpandedKeys = keys2;
        keys2.forEach((key) => {
          const node = this.getNode(key);
          if (node)
            node.expand(null, this.autoExpandParent);
        });
      }
      setChecked(data, checked, deep) {
        const node = this.getNode(data);
        if (node) {
          node.setChecked(!!checked, deep);
        }
      }
      getCurrentNode() {
        return this.currentNode;
      }
      setCurrentNode(currentNode) {
        const prevCurrentNode = this.currentNode;
        if (prevCurrentNode) {
          prevCurrentNode.isCurrent = false;
        }
        this.currentNode = currentNode;
        this.currentNode.isCurrent = true;
      }
      setUserCurrentNode(node, shouldAutoExpandParent = true) {
        const key = node[this.key];
        const currNode = this.nodesMap[key];
        this.setCurrentNode(currNode);
        if (shouldAutoExpandParent && this.currentNode.level > 1) {
          this.currentNode.parent.expand(null, true);
        }
      }
      setCurrentNodeKey(key, shouldAutoExpandParent = true) {
        this.currentNodeKey = key;
        if (isPropAbsent(key)) {
          this.currentNode && (this.currentNode.isCurrent = false);
          this.currentNode = null;
          return;
        }
        const node = this.getNode(key);
        if (node) {
          this.setCurrentNode(node);
          if (shouldAutoExpandParent && this.currentNode.level > 1) {
            this.currentNode.parent.expand(null, true);
          }
        }
      }
    }
    const _sfc_main$u = /* @__PURE__ */ defineComponent({
      name: "ElTreeNodeContent",
      props: {
        node: {
          type: Object,
          required: true
        },
        renderContent: Function
      },
      setup(props2) {
        const ns = useNamespace("tree");
        const nodeInstance = inject("NodeInstance");
        const tree = inject("RootTree");
        return () => {
          const node = props2.node;
          const { data, store: store2 } = node;
          return props2.renderContent ? props2.renderContent(h$1, { _self: nodeInstance, node, data, store: store2 }) : renderSlot(tree.ctx.slots, "default", { node, data }, () => [
            h$1(ElText, { tag: "span", truncated: true, class: ns.be("node", "label") }, () => [node.label])
          ]);
        };
      }
    });
    var NodeContent = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "tree-node-content.vue"]]);
    function useNodeExpandEventBroadcast(props2) {
      const parentNodeMap = inject("TreeNodeMap", null);
      const currentNodeMap = {
        treeNodeExpand: (node) => {
          if (props2.node !== node) {
            props2.node.collapse();
          }
        },
        children: []
      };
      if (parentNodeMap) {
        parentNodeMap.children.push(currentNodeMap);
      }
      provide("TreeNodeMap", currentNodeMap);
      return {
        broadcastExpanded: (node) => {
          if (!props2.accordion)
            return;
          for (const childNode of currentNodeMap.children) {
            childNode.treeNodeExpand(node);
          }
        }
      };
    }
    const dragEventsKey = Symbol("dragEvents");
    function useDragNodeHandler({ props: props2, ctx, el$, dropIndicator$, store: store2 }) {
      const ns = useNamespace("tree");
      const dragState = ref({
        showDropIndicator: false,
        draggingNode: null,
        dropNode: null,
        allowDrop: true,
        dropType: null
      });
      const treeNodeDragStart = ({ event, treeNode }) => {
        if (isFunction$4(props2.allowDrag) && !props2.allowDrag(treeNode.node)) {
          event.preventDefault();
          return false;
        }
        event.dataTransfer.effectAllowed = "move";
        try {
          event.dataTransfer.setData("text/plain", "");
        } catch (e2) {
        }
        dragState.value.draggingNode = treeNode;
        ctx.emit("node-drag-start", treeNode.node, event);
      };
      const treeNodeDragOver = ({ event, treeNode }) => {
        const dropNode = treeNode;
        const oldDropNode = dragState.value.dropNode;
        if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) {
          removeClass(oldDropNode.$el, ns.is("drop-inner"));
        }
        const draggingNode = dragState.value.draggingNode;
        if (!draggingNode || !dropNode)
          return;
        let dropPrev = true;
        let dropInner = true;
        let dropNext = true;
        let userAllowDropInner = true;
        if (isFunction$4(props2.allowDrop)) {
          dropPrev = props2.allowDrop(draggingNode.node, dropNode.node, "prev");
          userAllowDropInner = dropInner = props2.allowDrop(draggingNode.node, dropNode.node, "inner");
          dropNext = props2.allowDrop(draggingNode.node, dropNode.node, "next");
        }
        event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
        if ((dropPrev || dropInner || dropNext) && (oldDropNode == null ? void 0 : oldDropNode.node.id) !== dropNode.node.id) {
          if (oldDropNode) {
            ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
          }
          ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event);
        }
        if (dropPrev || dropInner || dropNext) {
          dragState.value.dropNode = dropNode;
        } else {
          dragState.value.dropNode = null;
        }
        if (dropNode.node.nextSibling === draggingNode.node) {
          dropNext = false;
        }
        if (dropNode.node.previousSibling === draggingNode.node) {
          dropPrev = false;
        }
        if (dropNode.node.contains(draggingNode.node, false)) {
          dropInner = false;
        }
        if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
          dropPrev = false;
          dropInner = false;
          dropNext = false;
        }
        const targetPosition = dropNode.$el.querySelector(`.${ns.be("node", "content")}`).getBoundingClientRect();
        const treePosition = el$.value.getBoundingClientRect();
        let dropType;
        const prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
        const nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
        let indicatorTop = -9999;
        const distance2 = event.clientY - targetPosition.top;
        if (distance2 < targetPosition.height * prevPercent) {
          dropType = "before";
        } else if (distance2 > targetPosition.height * nextPercent) {
          dropType = "after";
        } else if (dropInner) {
          dropType = "inner";
        } else {
          dropType = "none";
        }
        const iconPosition = dropNode.$el.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect();
        const dropIndicator = dropIndicator$.value;
        if (dropType === "before") {
          indicatorTop = iconPosition.top - treePosition.top;
        } else if (dropType === "after") {
          indicatorTop = iconPosition.bottom - treePosition.top;
        }
        dropIndicator.style.top = `${indicatorTop}px`;
        dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`;
        if (dropType === "inner") {
          addClass(dropNode.$el, ns.is("drop-inner"));
        } else {
          removeClass(dropNode.$el, ns.is("drop-inner"));
        }
        dragState.value.showDropIndicator = dropType === "before" || dropType === "after";
        dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner;
        dragState.value.dropType = dropType;
        ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event);
      };
      const treeNodeDragEnd = (event) => {
        const { draggingNode, dropType, dropNode } = dragState.value;
        event.preventDefault();
        if (event.dataTransfer) {
          event.dataTransfer.dropEffect = "move";
        }
        if (draggingNode && dropNode) {
          const draggingNodeCopy = { data: draggingNode.node.data };
          if (dropType !== "none") {
            draggingNode.node.remove();
          }
          if (dropType === "before") {
            dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
          } else if (dropType === "after") {
            dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
          } else if (dropType === "inner") {
            dropNode.node.insertChild(draggingNodeCopy);
          }
          if (dropType !== "none") {
            store2.value.registerNode(draggingNodeCopy);
            if (store2.value.key) {
              draggingNode.node.eachNode((node) => {
                var _a2;
                (_a2 = store2.value.nodesMap[node.data[store2.value.key]]) == null ? void 0 : _a2.setChecked(node.checked, !store2.value.checkStrictly);
              });
            }
          }
          removeClass(dropNode.$el, ns.is("drop-inner"));
          ctx.emit("node-drag-end", draggingNode.node, dropNode.node, dropType, event);
          if (dropType !== "none") {
            ctx.emit("node-drop", draggingNode.node, dropNode.node, dropType, event);
          }
        }
        if (draggingNode && !dropNode) {
          ctx.emit("node-drag-end", draggingNode.node, null, dropType, event);
        }
        dragState.value.showDropIndicator = false;
        dragState.value.draggingNode = null;
        dragState.value.dropNode = null;
        dragState.value.allowDrop = true;
      };
      provide(dragEventsKey, {
        treeNodeDragStart,
        treeNodeDragOver,
        treeNodeDragEnd
      });
      return {
        dragState
      };
    }
    const _sfc_main$t = /* @__PURE__ */ defineComponent({
      name: "ElTreeNode",
      components: {
        ElCollapseTransition,
        ElCheckbox,
        NodeContent,
        ElIcon,
        Loading: loading_default
      },
      props: {
        node: {
          type: Node$1,
          default: () => ({})
        },
        props: {
          type: Object,
          default: () => ({})
        },
        accordion: Boolean,
        renderContent: Function,
        renderAfterExpand: Boolean,
        showCheckbox: {
          type: Boolean,
          default: false
        }
      },
      emits: ["node-expand"],
      setup(props2, ctx) {
        const ns = useNamespace("tree");
        const { broadcastExpanded } = useNodeExpandEventBroadcast(props2);
        const tree = inject("RootTree");
        const expanded = ref(false);
        const childNodeRendered = ref(false);
        const oldChecked = ref();
        const oldIndeterminate = ref();
        const node$ = ref();
        const dragEvents = inject(dragEventsKey);
        const instance = getCurrentInstance();
        provide("NodeInstance", instance);
        if (props2.node.expanded) {
          expanded.value = true;
          childNodeRendered.value = true;
        }
        const childrenKey = tree.props.props["children"] || "children";
        watch(() => {
          var _a2;
          const children = (_a2 = props2.node.data) == null ? void 0 : _a2[childrenKey];
          return children && [...children];
        }, () => {
          props2.node.updateChildren();
        });
        watch(() => props2.node.indeterminate, (val) => {
          handleSelectChange(props2.node.checked, val);
        });
        watch(() => props2.node.checked, (val) => {
          handleSelectChange(val, props2.node.indeterminate);
        });
        watch(() => props2.node.childNodes.length, () => props2.node.reInitChecked());
        watch(() => props2.node.expanded, (val) => {
          nextTick(() => expanded.value = val);
          if (val) {
            childNodeRendered.value = true;
          }
        });
        const getNodeKey$1 = (node) => {
          return getNodeKey(tree.props.nodeKey, node.data);
        };
        const getNodeClass = (node) => {
          const nodeClassFunc = props2.props.class;
          if (!nodeClassFunc) {
            return {};
          }
          let className;
          if (isFunction$4(nodeClassFunc)) {
            const { data } = node;
            className = nodeClassFunc(data, node);
          } else {
            className = nodeClassFunc;
          }
          if (isString$3(className)) {
            return { [className]: true };
          } else {
            return className;
          }
        };
        const handleSelectChange = (checked, indeterminate) => {
          if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) {
            tree.ctx.emit("check-change", props2.node.data, checked, indeterminate);
          }
          oldChecked.value = checked;
          oldIndeterminate.value = indeterminate;
        };
        const handleClick = (e2) => {
          handleCurrentChange(tree.store, tree.ctx.emit, () => {
            var _a2;
            const nodeKeyProp = (_a2 = tree == null ? void 0 : tree.props) == null ? void 0 : _a2.nodeKey;
            if (nodeKeyProp) {
              const curNodeKey = getNodeKey$1(props2.node);
              tree.store.value.setCurrentNodeKey(curNodeKey);
            } else {
              tree.store.value.setCurrentNode(props2.node);
            }
          });
          tree.currentNode.value = props2.node;
          if (tree.props.expandOnClickNode) {
            handleExpandIconClick();
          }
          if ((tree.props.checkOnClickNode || props2.node.isLeaf && tree.props.checkOnClickLeaf && props2.showCheckbox) && !props2.node.disabled) {
            handleCheckChange(!props2.node.checked);
          }
          tree.ctx.emit("node-click", props2.node.data, props2.node, instance, e2);
        };
        const handleContextMenu = (event) => {
          var _a2;
          if ((_a2 = tree.instance.vnode.props) == null ? void 0 : _a2["onNodeContextmenu"]) {
            event.stopPropagation();
            event.preventDefault();
          }
          tree.ctx.emit("node-contextmenu", event, props2.node.data, props2.node, instance);
        };
        const handleExpandIconClick = () => {
          if (props2.node.isLeaf)
            return;
          if (expanded.value) {
            tree.ctx.emit("node-collapse", props2.node.data, props2.node, instance);
            props2.node.collapse();
          } else {
            props2.node.expand(() => {
              ctx.emit("node-expand", props2.node.data, props2.node, instance);
            });
          }
        };
        const handleCheckChange = (value) => {
          props2.node.setChecked(value, !(tree == null ? void 0 : tree.props.checkStrictly));
          nextTick(() => {
            const store2 = tree.store.value;
            tree.ctx.emit("check", props2.node.data, {
              checkedNodes: store2.getCheckedNodes(),
              checkedKeys: store2.getCheckedKeys(),
              halfCheckedNodes: store2.getHalfCheckedNodes(),
              halfCheckedKeys: store2.getHalfCheckedKeys()
            });
          });
        };
        const handleChildNodeExpand = (nodeData, node, instance2) => {
          broadcastExpanded(node);
          tree.ctx.emit("node-expand", nodeData, node, instance2);
        };
        const handleDragStart = (event) => {
          if (!tree.props.draggable)
            return;
          dragEvents.treeNodeDragStart({ event, treeNode: props2 });
        };
        const handleDragOver = (event) => {
          event.preventDefault();
          if (!tree.props.draggable)
            return;
          dragEvents.treeNodeDragOver({
            event,
            treeNode: { $el: node$.value, node: props2.node }
          });
        };
        const handleDrop = (event) => {
          event.preventDefault();
        };
        const handleDragEnd2 = (event) => {
          if (!tree.props.draggable)
            return;
          dragEvents.treeNodeDragEnd(event);
        };
        return {
          ns,
          node$,
          tree,
          expanded,
          childNodeRendered,
          oldChecked,
          oldIndeterminate,
          getNodeKey: getNodeKey$1,
          getNodeClass,
          handleSelectChange,
          handleClick,
          handleContextMenu,
          handleExpandIconClick,
          handleCheckChange,
          handleChildNodeExpand,
          handleDragStart,
          handleDragOver,
          handleDrop,
          handleDragEnd: handleDragEnd2,
          CaretRight: caret_right_default
        };
      }
    });
    function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_loading = resolveComponent("loading");
      const _component_node_content = resolveComponent("node-content");
      const _component_el_tree_node = resolveComponent("el-tree-node");
      const _component_el_collapse_transition = resolveComponent("el-collapse-transition");
      return withDirectives((openBlock(), createElementBlock("div", {
        ref: "node$",
        class: normalizeClass([
          _ctx.ns.b("node"),
          _ctx.ns.is("expanded", _ctx.expanded),
          _ctx.ns.is("current", _ctx.node.isCurrent),
          _ctx.ns.is("hidden", !_ctx.node.visible),
          _ctx.ns.is("focusable", !_ctx.node.disabled),
          _ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked),
          _ctx.getNodeClass(_ctx.node)
        ]),
        role: "treeitem",
        tabindex: "-1",
        "aria-expanded": _ctx.expanded,
        "aria-disabled": _ctx.node.disabled,
        "aria-checked": _ctx.node.checked,
        draggable: _ctx.tree.props.draggable,
        "data-key": _ctx.getNodeKey(_ctx.node),
        onClick: withModifiers(_ctx.handleClick, ["stop"]),
        onContextmenu: _ctx.handleContextMenu,
        onDragstart: withModifiers(_ctx.handleDragStart, ["stop"]),
        onDragover: withModifiers(_ctx.handleDragOver, ["stop"]),
        onDragend: withModifiers(_ctx.handleDragEnd, ["stop"]),
        onDrop: withModifiers(_ctx.handleDrop, ["stop"])
      }, [
        createBaseVNode("div", {
          class: normalizeClass(_ctx.ns.be("node", "content")),
          style: normalizeStyle$1({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" })
        }, [
          _ctx.tree.props.icon || _ctx.CaretRight ? (openBlock(), createBlock(_component_el_icon, {
            key: 0,
            class: normalizeClass([
              _ctx.ns.be("node", "expand-icon"),
              _ctx.ns.is("leaf", _ctx.node.isLeaf),
              {
                expanded: !_ctx.node.isLeaf && _ctx.expanded
              }
            ]),
            onClick: withModifiers(_ctx.handleExpandIconClick, ["stop"])
          }, {
            default: withCtx(() => [
              (openBlock(), createBlock(resolveDynamicComponent(_ctx.tree.props.icon || _ctx.CaretRight)))
            ]),
            _: 1
          }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
          _ctx.showCheckbox ? (openBlock(), createBlock(_component_el_checkbox, {
            key: 1,
            "model-value": _ctx.node.checked,
            indeterminate: _ctx.node.indeterminate,
            disabled: !!_ctx.node.disabled,
            onClick: withModifiers(() => {
            }, ["stop"]),
            onChange: _ctx.handleCheckChange
          }, null, 8, ["model-value", "indeterminate", "disabled", "onClick", "onChange"])) : createCommentVNode("v-if", true),
          _ctx.node.loading ? (openBlock(), createBlock(_component_el_icon, {
            key: 2,
            class: normalizeClass([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")])
          }, {
            default: withCtx(() => [
              createVNode$1(_component_loading)
            ]),
            _: 1
          }, 8, ["class"])) : createCommentVNode("v-if", true),
          createVNode$1(_component_node_content, {
            node: _ctx.node,
            "render-content": _ctx.renderContent
          }, null, 8, ["node", "render-content"])
        ], 6),
        createVNode$1(_component_el_collapse_transition, null, {
          default: withCtx(() => [
            !_ctx.renderAfterExpand || _ctx.childNodeRendered ? withDirectives((openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(_ctx.ns.be("node", "children")),
              role: "group",
              "aria-expanded": _ctx.expanded,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.node.childNodes, (child) => {
                return openBlock(), createBlock(_component_el_tree_node, {
                  key: _ctx.getNodeKey(child),
                  "render-content": _ctx.renderContent,
                  "render-after-expand": _ctx.renderAfterExpand,
                  "show-checkbox": _ctx.showCheckbox,
                  node: child,
                  accordion: _ctx.accordion,
                  props: _ctx.props,
                  onNodeExpand: _ctx.handleChildNodeExpand
                }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]);
              }), 128))
            ], 10, ["aria-expanded", "onClick"])), [
              [vShow, _ctx.expanded]
            ]) : createCommentVNode("v-if", true)
          ]),
          _: 1
        })
      ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key", "onClick", "onContextmenu", "onDragstart", "onDragover", "onDragend", "onDrop"])), [
        [vShow, _ctx.node.visible]
      ]);
    }
    var ElTreeNode$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$8], ["__file", "tree-node.vue"]]);
    function useKeydown({ el$ }, store2) {
      const ns = useNamespace("tree");
      onMounted(() => {
        initTabIndex();
      });
      onUpdated(() => {
        const checkboxItems = Array.from(el$.value.querySelectorAll("input[type=checkbox]"));
        checkboxItems.forEach((checkbox) => {
          checkbox.setAttribute("tabindex", "-1");
        });
      });
      const handleKeydown = (ev) => {
        const currentItem = ev.target;
        if (!currentItem.className.includes(ns.b("node")))
          return;
        const code = ev.code;
        const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
        const currentIndex = treeItems.indexOf(currentItem);
        let nextIndex;
        if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {
          ev.preventDefault();
          if (code === EVENT_CODE.up) {
            nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.length - 1;
            const startIndex = nextIndex;
            while (true) {
              if (store2.value.getNode(treeItems[nextIndex].dataset.key).canFocus)
                break;
              nextIndex--;
              if (nextIndex === startIndex) {
                nextIndex = -1;
                break;
              }
              if (nextIndex < 0) {
                nextIndex = treeItems.length - 1;
              }
            }
          } else {
            nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.length - 1 ? currentIndex + 1 : 0;
            const startIndex = nextIndex;
            while (true) {
              if (store2.value.getNode(treeItems[nextIndex].dataset.key).canFocus)
                break;
              nextIndex++;
              if (nextIndex === startIndex) {
                nextIndex = -1;
                break;
              }
              if (nextIndex >= treeItems.length) {
                nextIndex = 0;
              }
            }
          }
          nextIndex !== -1 && treeItems[nextIndex].focus();
        }
        if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {
          ev.preventDefault();
          currentItem.click();
        }
        const hasInput = currentItem.querySelector('[type="checkbox"]');
        if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space].includes(code) && hasInput) {
          ev.preventDefault();
          hasInput.click();
        }
      };
      useEventListener(el$, "keydown", handleKeydown);
      const initTabIndex = () => {
        var _a2;
        const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
        const checkboxItems = Array.from(el$.value.querySelectorAll("input[type=checkbox]"));
        checkboxItems.forEach((checkbox) => {
          checkbox.setAttribute("tabindex", "-1");
        });
        const checkedItem = el$.value.querySelectorAll(`.${ns.is("checked")}[role=treeitem]`);
        if (checkedItem.length) {
          checkedItem[0].setAttribute("tabindex", "0");
          return;
        }
        (_a2 = treeItems[0]) == null ? void 0 : _a2.setAttribute("tabindex", "0");
      };
    }
    const _sfc_main$s = /* @__PURE__ */ defineComponent({
      name: "ElTree",
      components: { ElTreeNode: ElTreeNode$1 },
      props: {
        data: {
          type: Array,
          default: () => []
        },
        emptyText: {
          type: String
        },
        renderAfterExpand: {
          type: Boolean,
          default: true
        },
        nodeKey: String,
        checkStrictly: Boolean,
        defaultExpandAll: Boolean,
        expandOnClickNode: {
          type: Boolean,
          default: true
        },
        checkOnClickNode: Boolean,
        checkOnClickLeaf: {
          type: Boolean,
          default: true
        },
        checkDescendants: {
          type: Boolean,
          default: false
        },
        autoExpandParent: {
          type: Boolean,
          default: true
        },
        defaultCheckedKeys: Array,
        defaultExpandedKeys: Array,
        currentNodeKey: [String, Number],
        renderContent: Function,
        showCheckbox: {
          type: Boolean,
          default: false
        },
        draggable: {
          type: Boolean,
          default: false
        },
        allowDrag: Function,
        allowDrop: Function,
        props: {
          type: Object,
          default: () => ({
            children: "children",
            label: "label",
            disabled: "disabled"
          })
        },
        lazy: {
          type: Boolean,
          default: false
        },
        highlightCurrent: Boolean,
        load: Function,
        filterNodeMethod: Function,
        accordion: Boolean,
        indent: {
          type: Number,
          default: 18
        },
        icon: {
          type: iconPropType
        }
      },
      emits: [
        "check-change",
        "current-change",
        "node-click",
        "node-contextmenu",
        "node-collapse",
        "node-expand",
        "check",
        "node-drag-start",
        "node-drag-end",
        "node-drop",
        "node-drag-leave",
        "node-drag-enter",
        "node-drag-over"
      ],
      setup(props2, ctx) {
        const { t } = useLocale();
        const ns = useNamespace("tree");
        const selectInfo = inject(selectKey, null);
        const store2 = ref(new TreeStore({
          key: props2.nodeKey,
          data: props2.data,
          lazy: props2.lazy,
          props: props2.props,
          load: props2.load,
          currentNodeKey: props2.currentNodeKey,
          checkStrictly: props2.checkStrictly,
          checkDescendants: props2.checkDescendants,
          defaultCheckedKeys: props2.defaultCheckedKeys,
          defaultExpandedKeys: props2.defaultExpandedKeys,
          autoExpandParent: props2.autoExpandParent,
          defaultExpandAll: props2.defaultExpandAll,
          filterNodeMethod: props2.filterNodeMethod
        }));
        store2.value.initialize();
        const root2 = ref(store2.value.root);
        const currentNode = ref(null);
        const el$ = ref(null);
        const dropIndicator$ = ref(null);
        const { broadcastExpanded } = useNodeExpandEventBroadcast(props2);
        const { dragState } = useDragNodeHandler({
          props: props2,
          ctx,
          el$,
          dropIndicator$,
          store: store2
        });
        useKeydown({ el$ }, store2);
        const isEmpty2 = computed(() => {
          const { childNodes } = root2.value;
          const hasFilteredOptions = selectInfo ? selectInfo.hasFilteredOptions !== 0 : false;
          return (!childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible)) && !hasFilteredOptions;
        });
        watch(() => props2.currentNodeKey, (newVal) => {
          store2.value.setCurrentNodeKey(newVal);
        });
        watch(() => props2.defaultCheckedKeys, (newVal) => {
          store2.value.setDefaultCheckedKey(newVal);
        });
        watch(() => props2.defaultExpandedKeys, (newVal) => {
          store2.value.setDefaultExpandedKeys(newVal);
        });
        watch(() => props2.data, (newVal) => {
          store2.value.setData(newVal);
        }, { deep: true });
        watch(() => props2.checkStrictly, (newVal) => {
          store2.value.checkStrictly = newVal;
        });
        const filter2 = (value) => {
          if (!props2.filterNodeMethod)
            throw new Error("[Tree] filterNodeMethod is required when filter");
          store2.value.filter(value);
        };
        const getNodeKey$1 = (node) => {
          return getNodeKey(props2.nodeKey, node.data);
        };
        const getNodePath = (data) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in getNodePath");
          const node = store2.value.getNode(data);
          if (!node)
            return [];
          const path = [node.data];
          let parent2 = node.parent;
          while (parent2 && parent2 !== root2.value) {
            path.push(parent2.data);
            parent2 = parent2.parent;
          }
          return path.reverse();
        };
        const getCheckedNodes = (leafOnly, includeHalfChecked) => {
          return store2.value.getCheckedNodes(leafOnly, includeHalfChecked);
        };
        const getCheckedKeys = (leafOnly) => {
          return store2.value.getCheckedKeys(leafOnly);
        };
        const getCurrentNode = () => {
          const currentNode2 = store2.value.getCurrentNode();
          return currentNode2 ? currentNode2.data : null;
        };
        const getCurrentKey = () => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in getCurrentKey");
          const currentNode2 = getCurrentNode();
          return currentNode2 ? currentNode2[props2.nodeKey] : null;
        };
        const setCheckedNodes = (nodes, leafOnly) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in setCheckedNodes");
          store2.value.setCheckedNodes(nodes, leafOnly);
        };
        const setCheckedKeys = (keys2, leafOnly) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in setCheckedKeys");
          store2.value.setCheckedKeys(keys2, leafOnly);
        };
        const setChecked2 = (data, checked, deep) => {
          store2.value.setChecked(data, checked, deep);
        };
        const getHalfCheckedNodes = () => {
          return store2.value.getHalfCheckedNodes();
        };
        const getHalfCheckedKeys = () => {
          return store2.value.getHalfCheckedKeys();
        };
        const setCurrentNode = (node, shouldAutoExpandParent = true) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in setCurrentNode");
          handleCurrentChange(store2, ctx.emit, () => {
            broadcastExpanded(node);
            store2.value.setUserCurrentNode(node, shouldAutoExpandParent);
          });
        };
        const setCurrentKey = (key, shouldAutoExpandParent = true) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in setCurrentKey");
          handleCurrentChange(store2, ctx.emit, () => {
            broadcastExpanded();
            store2.value.setCurrentNodeKey(key, shouldAutoExpandParent);
          });
        };
        const getNode = (data) => {
          return store2.value.getNode(data);
        };
        const remove2 = (data) => {
          store2.value.remove(data);
        };
        const append = (data, parentNode2) => {
          store2.value.append(data, parentNode2);
        };
        const insertBefore2 = (data, refNode) => {
          store2.value.insertBefore(data, refNode);
        };
        const insertAfter = (data, refNode) => {
          store2.value.insertAfter(data, refNode);
        };
        const handleNodeExpand = (nodeData, node, instance) => {
          broadcastExpanded(node);
          ctx.emit("node-expand", nodeData, node, instance);
        };
        const updateKeyChildren = (key, data) => {
          if (!props2.nodeKey)
            throw new Error("[Tree] nodeKey is required in updateKeyChild");
          store2.value.updateChildren(key, data);
        };
        provide("RootTree", {
          ctx,
          props: props2,
          store: store2,
          root: root2,
          currentNode,
          instance: getCurrentInstance()
        });
        provide(formItemContextKey, void 0);
        return {
          ns,
          store: store2,
          root: root2,
          currentNode,
          dragState,
          el$,
          dropIndicator$,
          isEmpty: isEmpty2,
          filter: filter2,
          getNodeKey: getNodeKey$1,
          getNodePath,
          getCheckedNodes,
          getCheckedKeys,
          getCurrentNode,
          getCurrentKey,
          setCheckedNodes,
          setCheckedKeys,
          setChecked: setChecked2,
          getHalfCheckedNodes,
          getHalfCheckedKeys,
          setCurrentNode,
          setCurrentKey,
          t,
          getNode,
          remove: remove2,
          append,
          insertBefore: insertBefore2,
          insertAfter,
          handleNodeExpand,
          updateKeyChildren
        };
      }
    });
    function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_tree_node = resolveComponent("el-tree-node");
      return openBlock(), createElementBlock("div", {
        ref: "el$",
        class: normalizeClass([
          _ctx.ns.b(),
          _ctx.ns.is("dragging", !!_ctx.dragState.draggingNode),
          _ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop),
          _ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"),
          { [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent }
        ]),
        role: "tree"
      }, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.root.childNodes, (child) => {
          return openBlock(), createBlock(_component_el_tree_node, {
            key: _ctx.getNodeKey(child),
            node: child,
            props: _ctx.props,
            accordion: _ctx.accordion,
            "render-after-expand": _ctx.renderAfterExpand,
            "show-checkbox": _ctx.showCheckbox,
            "render-content": _ctx.renderContent,
            onNodeExpand: _ctx.handleNodeExpand
          }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]);
        }), 128)),
        _ctx.isEmpty ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(_ctx.ns.e("empty-block"))
        }, [
          renderSlot(_ctx.$slots, "empty", {}, () => {
            var _a2;
            return [
              createBaseVNode("span", {
                class: normalizeClass(_ctx.ns.e("empty-text"))
              }, toDisplayString((_a2 = _ctx.emptyText) != null ? _a2 : _ctx.t("el.tree.emptyText")), 3)
            ];
          })
        ], 2)) : createCommentVNode("v-if", true),
        withDirectives(createBaseVNode("div", {
          ref: "dropIndicator$",
          class: normalizeClass(_ctx.ns.e("drop-indicator"))
        }, null, 2), [
          [vShow, _ctx.dragState.showDropIndicator]
        ])
      ], 2);
    }
    var Tree$1 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$7], ["__file", "tree.vue"]]);
    const ElTree = withInstall(Tree$1);
    const useSelect = (props2, { attrs, emit: emit2 }, {
      select,
      tree,
      key
    }) => {
      const ns = useNamespace("tree-select");
      watch(() => props2.data, () => {
        if (props2.filterable) {
          nextTick(() => {
            var _a2, _b2;
            (_b2 = tree.value) == null ? void 0 : _b2.filter((_a2 = select.value) == null ? void 0 : _a2.states.inputValue);
          });
        }
      }, { flush: "post" });
      const result = {
        ...pick(toRefs(props2), Object.keys(ElSelect.props)),
        ...attrs,
        class: computed(() => attrs.class),
        style: computed(() => attrs.style),
        "onUpdate:modelValue": (value) => emit2(UPDATE_MODEL_EVENT, value),
        valueKey: key,
        popperClass: computed(() => {
          const classes = [ns.e("popper")];
          if (props2.popperClass)
            classes.push(props2.popperClass);
          return classes.join(" ");
        }),
        filterMethod: (keyword = "") => {
          var _a2;
          if (props2.filterMethod) {
            props2.filterMethod(keyword);
          } else if (props2.remoteMethod) {
            props2.remoteMethod(keyword);
          } else {
            (_a2 = tree.value) == null ? void 0 : _a2.filter(keyword);
          }
        }
      };
      return result;
    };
    const component = /* @__PURE__ */ defineComponent({
      extends: ElOption,
      setup(props2, ctx) {
        const result = ElOption.setup(props2, ctx);
        delete result.selectOptionClick;
        const vm = getCurrentInstance().proxy;
        nextTick(() => {
          if (!result.select.states.cachedOptions.get(vm.value)) {
            result.select.onOptionCreate(vm);
          }
        });
        watch(() => ctx.attrs.visible, (val) => {
          nextTick(() => {
            result.states.visible = val;
          });
        }, {
          immediate: true
        });
        return result;
      },
      methods: {
        selectOptionClick() {
          this.$el.parentElement.click();
        }
      }
    });
    function isValidValue(val) {
      return val || val === 0;
    }
    function isValidArray(val) {
      return isArray$5(val) && val.length;
    }
    function toValidArray(val) {
      return isArray$5(val) ? val : isValidValue(val) ? [val] : [];
    }
    function treeFind(treeData, findCallback, getChildren, resultCallback, parent2) {
      for (let i2 = 0; i2 < treeData.length; i2++) {
        const data = treeData[i2];
        if (findCallback(data, i2, treeData, parent2)) {
          return resultCallback ? resultCallback(data, i2, treeData, parent2) : data;
        } else {
          const children = getChildren(data);
          if (isValidArray(children)) {
            const find2 = treeFind(children, findCallback, getChildren, resultCallback, data);
            if (find2)
              return find2;
          }
        }
      }
    }
    function treeEach(treeData, callback, getChildren, parent2) {
      for (let i2 = 0; i2 < treeData.length; i2++) {
        const data = treeData[i2];
        callback(data, i2, treeData, parent2);
        const children = getChildren(data);
        if (isValidArray(children)) {
          treeEach(children, callback, getChildren, data);
        }
      }
    }
    const useTree$1 = (props2, { attrs, slots, emit: emit2 }, {
      select,
      tree,
      key
    }) => {
      watch(() => props2.modelValue, () => {
        if (props2.showCheckbox) {
          nextTick(() => {
            const treeInstance = tree.value;
            if (treeInstance && !isEqual$1(treeInstance.getCheckedKeys(), toValidArray(props2.modelValue))) {
              treeInstance.setCheckedKeys(toValidArray(props2.modelValue));
            }
          });
        }
      }, {
        immediate: true,
        deep: true
      });
      const propsMap = computed(() => ({
        value: key.value,
        label: "label",
        children: "children",
        disabled: "disabled",
        isLeaf: "isLeaf",
        ...props2.props
      }));
      const getNodeValByProp = (prop, data) => {
        var _a2;
        const propVal = propsMap.value[prop];
        if (isFunction$4(propVal)) {
          return propVal(data, (_a2 = tree.value) == null ? void 0 : _a2.getNode(getNodeValByProp("value", data)));
        } else {
          return data[propVal];
        }
      };
      const defaultExpandedParentKeys = toValidArray(props2.modelValue).map((value) => {
        return treeFind(props2.data || [], (data) => getNodeValByProp("value", data) === value, (data) => getNodeValByProp("children", data), (data, index, array, parent2) => parent2 && getNodeValByProp("value", parent2));
      }).filter((item) => isValidValue(item));
      const cacheOptions = computed(() => {
        if (!props2.renderAfterExpand && !props2.lazy)
          return [];
        const options = [];
        treeEach(props2.data.concat(props2.cacheData), (node) => {
          const value = getNodeValByProp("value", node);
          options.push({
            value,
            currentLabel: getNodeValByProp("label", node),
            isDisabled: getNodeValByProp("disabled", node)
          });
        }, (data) => getNodeValByProp("children", data));
        return options;
      });
      const getChildCheckedKeys = () => {
        var _a2;
        return (_a2 = tree.value) == null ? void 0 : _a2.getCheckedKeys().filter((checkedKey) => {
          var _a22;
          const node = (_a22 = tree.value) == null ? void 0 : _a22.getNode(checkedKey);
          return !isNil(node) && isEmpty(node.childNodes);
        });
      };
      return {
        ...pick(toRefs(props2), Object.keys(ElTree.props)),
        ...attrs,
        nodeKey: key,
        expandOnClickNode: computed(() => {
          return !props2.checkStrictly && props2.expandOnClickNode;
        }),
        defaultExpandedKeys: computed(() => {
          return props2.defaultExpandedKeys ? props2.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys;
        }),
        renderContent: (h2, { node, data, store: store2 }) => {
          return h2(component, {
            value: getNodeValByProp("value", data),
            label: getNodeValByProp("label", data),
            disabled: getNodeValByProp("disabled", data),
            visible: node.visible
          }, props2.renderContent ? () => props2.renderContent(h2, { node, data, store: store2 }) : slots.default ? () => slots.default({ node, data, store: store2 }) : void 0);
        },
        filterNodeMethod: (value, data, node) => {
          if (props2.filterNodeMethod)
            return props2.filterNodeMethod(value, data, node);
          if (!value)
            return true;
          const regexp3 = new RegExp(escapeStringRegexp(value), "i");
          return regexp3.test(getNodeValByProp("label", data) || "");
        },
        onNodeClick: (data, node, e2) => {
          var _a2, _b2, _c2, _d;
          (_a2 = attrs.onNodeClick) == null ? void 0 : _a2.call(attrs, data, node, e2);
          if (props2.showCheckbox && props2.checkOnClickNode)
            return;
          if (!props2.showCheckbox && (props2.checkStrictly || node.isLeaf)) {
            if (!getNodeValByProp("disabled", data)) {
              const option = (_b2 = select.value) == null ? void 0 : _b2.states.options.get(getNodeValByProp("value", data));
              (_c2 = select.value) == null ? void 0 : _c2.handleOptionSelect(option);
            }
          } else if (props2.expandOnClickNode) {
            e2.proxy.handleExpandIconClick();
          }
          (_d = select.value) == null ? void 0 : _d.focus();
        },
        onCheck: (data, params) => {
          var _a2;
          if (!props2.showCheckbox)
            return;
          const dataValue = getNodeValByProp("value", data);
          const dataMap = {};
          treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes);
          const uncachedCheckedKeys = params.checkedKeys;
          const cachedKeys = props2.multiple ? toValidArray(props2.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)) : [];
          const checkedKeys = cachedKeys.concat(uncachedCheckedKeys);
          if (props2.checkStrictly) {
            emit2(UPDATE_MODEL_EVENT, props2.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0);
          } else {
            if (props2.multiple) {
              const childKeys = getChildCheckedKeys();
              emit2(UPDATE_MODEL_EVENT, cachedKeys.concat(childKeys));
            } else {
              const firstLeaf = treeFind([data], (data2) => !isValidArray(getNodeValByProp("children", data2)) && !getNodeValByProp("disabled", data2), (data2) => getNodeValByProp("children", data2));
              const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0;
              const hasCheckedChild = isValidValue(props2.modelValue) && !!treeFind([data], (data2) => getNodeValByProp("value", data2) === props2.modelValue, (data2) => getNodeValByProp("children", data2));
              emit2(UPDATE_MODEL_EVENT, firstLeafKey === props2.modelValue || hasCheckedChild ? void 0 : firstLeafKey);
            }
          }
          nextTick(() => {
            var _a22;
            const checkedKeys2 = toValidArray(props2.modelValue);
            tree.value.setCheckedKeys(checkedKeys2);
            (_a22 = attrs.onCheck) == null ? void 0 : _a22.call(attrs, data, {
              checkedKeys: tree.value.getCheckedKeys(),
              checkedNodes: tree.value.getCheckedNodes(),
              halfCheckedKeys: tree.value.getHalfCheckedKeys(),
              halfCheckedNodes: tree.value.getHalfCheckedNodes()
            });
          });
          (_a2 = select.value) == null ? void 0 : _a2.focus();
        },
        onNodeExpand: (data, node, e2) => {
          var _a2;
          (_a2 = attrs.onNodeExpand) == null ? void 0 : _a2.call(attrs, data, node, e2);
          nextTick(() => {
            if (!props2.checkStrictly && props2.lazy && props2.multiple && node.checked) {
              const dataMap = {};
              const uncachedCheckedKeys = tree.value.getCheckedKeys();
              treeEach([tree.value.store.root], (node2) => dataMap[node2.key] = node2, (node2) => node2.childNodes);
              const cachedKeys = toValidArray(props2.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item));
              const childKeys = getChildCheckedKeys();
              emit2(UPDATE_MODEL_EVENT, cachedKeys.concat(childKeys));
            }
          });
        },
        cacheOptions
      };
    };
    var CacheOptions = /* @__PURE__ */ defineComponent({
      props: {
        data: {
          type: Array,
          default: () => []
        }
      },
      setup(props2) {
        const select = inject(selectKey);
        watch(() => props2.data, () => {
          var _a2;
          props2.data.forEach((item) => {
            if (!select.states.cachedOptions.has(item.value)) {
              select.states.cachedOptions.set(item.value, item);
            }
          });
          const inputs = ((_a2 = select.selectRef) == null ? void 0 : _a2.querySelectorAll("input")) || [];
          if (isClient && !Array.from(inputs).includes(document.activeElement)) {
            select.setSelected();
          }
        }, { flush: "post", immediate: true });
        return () => void 0;
      }
    });
    const _sfc_main$r = /* @__PURE__ */ defineComponent({
      name: "ElTreeSelect",
      inheritAttrs: false,
      props: {
        ...ElSelect.props,
        ...ElTree.props,
        cacheData: {
          type: Array,
          default: () => []
        }
      },
      setup(props2, context) {
        const { slots, expose } = context;
        const select = ref();
        const tree = ref();
        const key = computed(() => props2.nodeKey || props2.valueKey || "value");
        const selectProps = useSelect(props2, context, { select, tree, key });
        const { cacheOptions, ...treeProps2 } = useTree$1(props2, context, {
          select,
          tree,
          key
        });
        const methods = reactive({});
        expose(methods);
        onMounted(() => {
          Object.assign(methods, {
            ...pick(tree.value, [
              "filter",
              "updateKeyChildren",
              "getCheckedNodes",
              "setCheckedNodes",
              "getCheckedKeys",
              "setCheckedKeys",
              "setChecked",
              "getHalfCheckedNodes",
              "getHalfCheckedKeys",
              "getCurrentKey",
              "getCurrentNode",
              "setCurrentKey",
              "setCurrentNode",
              "getNode",
              "remove",
              "append",
              "insertBefore",
              "insertAfter"
            ]),
            ...pick(select.value, ["focus", "blur", "selectedLabel"])
          });
        });
        return () => h$1(ElSelect, reactive({
          ...selectProps,
          ref: (ref2) => select.value = ref2
        }), {
          ...slots,
          default: () => [
            h$1(CacheOptions, { data: cacheOptions.value }),
            h$1(ElTree, reactive({
              ...treeProps2,
              ref: (ref2) => tree.value = ref2
            }))
          ]
        });
      }
    });
    var TreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "tree-select.vue"]]);
    const ElTreeSelect = withInstall(TreeSelect);
    const ROOT_TREE_INJECTION_KEY = Symbol();
    const EMPTY_NODE = {
      key: -1,
      level: -1,
      data: {}
    };
    var TreeOptionsEnum = /* @__PURE__ */ ((TreeOptionsEnum2) => {
      TreeOptionsEnum2["KEY"] = "id";
      TreeOptionsEnum2["LABEL"] = "label";
      TreeOptionsEnum2["CHILDREN"] = "children";
      TreeOptionsEnum2["DISABLED"] = "disabled";
      TreeOptionsEnum2["CLASS"] = "";
      return TreeOptionsEnum2;
    })(TreeOptionsEnum || {});
    var SetOperationEnum = /* @__PURE__ */ ((SetOperationEnum2) => {
      SetOperationEnum2["ADD"] = "add";
      SetOperationEnum2["DELETE"] = "delete";
      return SetOperationEnum2;
    })(SetOperationEnum || {});
    const itemSize = {
      type: Number,
      default: 26
    };
    const treeProps = buildProps({
      data: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      emptyText: {
        type: String
      },
      height: {
        type: Number,
        default: 200
      },
      props: {
        type: definePropType(Object),
        default: () => mutable({
          children: "children",
          label: "label",
          disabled: "disabled",
          value: "id",
          class: ""
          /* CLASS */
        })
      },
      highlightCurrent: {
        type: Boolean,
        default: false
      },
      showCheckbox: {
        type: Boolean,
        default: false
      },
      defaultCheckedKeys: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      checkStrictly: {
        type: Boolean,
        default: false
      },
      defaultExpandedKeys: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      indent: {
        type: Number,
        default: 16
      },
      itemSize,
      icon: {
        type: iconPropType
      },
      expandOnClickNode: {
        type: Boolean,
        default: true
      },
      checkOnClickNode: {
        type: Boolean,
        default: false
      },
      checkOnClickLeaf: {
        type: Boolean,
        default: true
      },
      currentNodeKey: {
        type: definePropType([String, Number])
      },
      accordion: {
        type: Boolean,
        default: false
      },
      filterMethod: {
        type: definePropType(Function)
      },
      perfMode: {
        type: Boolean,
        default: true
      }
    });
    const treeNodeProps = buildProps({
      node: {
        type: definePropType(Object),
        default: () => mutable(EMPTY_NODE)
      },
      expanded: {
        type: Boolean,
        default: false
      },
      checked: {
        type: Boolean,
        default: false
      },
      indeterminate: {
        type: Boolean,
        default: false
      },
      showCheckbox: {
        type: Boolean,
        default: false
      },
      disabled: {
        type: Boolean,
        default: false
      },
      current: {
        type: Boolean,
        default: false
      },
      hiddenExpandIcon: {
        type: Boolean,
        default: false
      },
      itemSize
    });
    const treeNodeContentProps = buildProps({
      node: {
        type: definePropType(Object),
        required: true
      }
    });
    const NODE_CLICK = "node-click";
    const NODE_DROP = "node-drop";
    const NODE_EXPAND = "node-expand";
    const NODE_COLLAPSE = "node-collapse";
    const CURRENT_CHANGE = "current-change";
    const NODE_CHECK = "check";
    const NODE_CHECK_CHANGE = "check-change";
    const NODE_CONTEXTMENU = "node-contextmenu";
    const treeEmits = {
      [NODE_CLICK]: (data, node, e2) => data && node && e2,
      [NODE_DROP]: (data, node, e2) => data && node && e2,
      [NODE_EXPAND]: (data, node) => data && node,
      [NODE_COLLAPSE]: (data, node) => data && node,
      [CURRENT_CHANGE]: (data, node) => data && node,
      [NODE_CHECK]: (data, checkedInfo) => data && checkedInfo,
      [NODE_CHECK_CHANGE]: (data, checked) => data && isBoolean$1(checked),
      [NODE_CONTEXTMENU]: (evt, data, node) => evt && data && node
    };
    const treeNodeEmits = {
      click: (node, e2) => !!(node && e2),
      drop: (node, e2) => !!(node && e2),
      toggle: (node) => !!node,
      check: (node, checked) => node && isBoolean$1(checked)
    };
    function useCheck(props2, tree) {
      const checkedKeys = ref(/* @__PURE__ */ new Set());
      const indeterminateKeys = ref(/* @__PURE__ */ new Set());
      const { emit: emit2 } = getCurrentInstance();
      watch([() => tree.value, () => props2.defaultCheckedKeys], () => {
        return nextTick(() => {
          _setCheckedKeys(props2.defaultCheckedKeys);
        });
      }, {
        immediate: true
      });
      const updateCheckedKeys = () => {
        if (!tree.value || !props2.showCheckbox || props2.checkStrictly) {
          return;
        }
        const { levelTreeNodeMap, maxLevel } = tree.value;
        const checkedKeySet = checkedKeys.value;
        const indeterminateKeySet = /* @__PURE__ */ new Set();
        for (let level = maxLevel - 1; level >= 1; --level) {
          const nodes = levelTreeNodeMap.get(level);
          if (!nodes)
            continue;
          nodes.forEach((node) => {
            const children = node.children;
            if (children) {
              let allChecked = true;
              let hasChecked = false;
              for (const childNode of children) {
                const key = childNode.key;
                if (checkedKeySet.has(key)) {
                  hasChecked = true;
                } else if (indeterminateKeySet.has(key)) {
                  allChecked = false;
                  hasChecked = true;
                  break;
                } else {
                  allChecked = false;
                }
              }
              if (allChecked) {
                checkedKeySet.add(node.key);
              } else if (hasChecked) {
                indeterminateKeySet.add(node.key);
                checkedKeySet.delete(node.key);
              } else {
                checkedKeySet.delete(node.key);
                indeterminateKeySet.delete(node.key);
              }
            }
          });
        }
        indeterminateKeys.value = indeterminateKeySet;
      };
      const isChecked = (node) => checkedKeys.value.has(node.key);
      const isIndeterminate = (node) => indeterminateKeys.value.has(node.key);
      const toggleCheckbox = (node, isChecked2, nodeClick = true, immediateUpdate = true) => {
        const checkedKeySet = checkedKeys.value;
        const toggle = (node2, checked) => {
          checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](node2.key);
          const children = node2.children;
          if (!props2.checkStrictly && children) {
            children.forEach((childNode) => {
              if (!childNode.disabled) {
                toggle(childNode, checked);
              }
            });
          }
        };
        toggle(node, isChecked2);
        if (immediateUpdate) {
          updateCheckedKeys();
        }
        if (nodeClick) {
          afterNodeCheck(node, isChecked2);
        }
      };
      const afterNodeCheck = (node, checked) => {
        const { checkedNodes, checkedKeys: checkedKeys2 } = getChecked();
        const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked();
        emit2(NODE_CHECK, node.data, {
          checkedKeys: checkedKeys2,
          checkedNodes,
          halfCheckedKeys,
          halfCheckedNodes
        });
        emit2(NODE_CHECK_CHANGE, node.data, checked);
      };
      function getCheckedKeys(leafOnly = false) {
        return getChecked(leafOnly).checkedKeys;
      }
      function getCheckedNodes(leafOnly = false) {
        return getChecked(leafOnly).checkedNodes;
      }
      function getHalfCheckedKeys() {
        return getHalfChecked().halfCheckedKeys;
      }
      function getHalfCheckedNodes() {
        return getHalfChecked().halfCheckedNodes;
      }
      function getChecked(leafOnly = false) {
        const checkedNodes = [];
        const keys2 = [];
        if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
          const { treeNodeMap } = tree.value;
          checkedKeys.value.forEach((key) => {
            const node = treeNodeMap.get(key);
            if (node && (!leafOnly || leafOnly && node.isLeaf)) {
              keys2.push(key);
              checkedNodes.push(node.data);
            }
          });
        }
        return {
          checkedKeys: keys2,
          checkedNodes
        };
      }
      function getHalfChecked() {
        const halfCheckedNodes = [];
        const halfCheckedKeys = [];
        if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
          const { treeNodeMap } = tree.value;
          indeterminateKeys.value.forEach((key) => {
            const node = treeNodeMap.get(key);
            if (node) {
              halfCheckedKeys.push(key);
              halfCheckedNodes.push(node.data);
            }
          });
        }
        return {
          halfCheckedNodes,
          halfCheckedKeys
        };
      }
      function setCheckedKeys(keys2) {
        checkedKeys.value.clear();
        indeterminateKeys.value.clear();
        nextTick(() => {
          _setCheckedKeys(keys2);
        });
      }
      function setChecked2(key, isChecked2) {
        if ((tree == null ? void 0 : tree.value) && props2.showCheckbox) {
          const node = tree.value.treeNodeMap.get(key);
          if (node) {
            toggleCheckbox(node, isChecked2, false);
          }
        }
      }
      function _setCheckedKeys(keys2) {
        if (tree == null ? void 0 : tree.value) {
          const { treeNodeMap } = tree.value;
          if (props2.showCheckbox && treeNodeMap && (keys2 == null ? void 0 : keys2.length) > 0) {
            for (const key of keys2) {
              const node = treeNodeMap.get(key);
              if (node && !isChecked(node)) {
                toggleCheckbox(node, true, false, false);
              }
            }
            updateCheckedKeys();
          }
        }
      }
      return {
        updateCheckedKeys,
        toggleCheckbox,
        isChecked,
        isIndeterminate,
        getCheckedKeys,
        getCheckedNodes,
        getHalfCheckedKeys,
        getHalfCheckedNodes,
        setChecked: setChecked2,
        setCheckedKeys
      };
    }
    function useFilter(props2, tree) {
      const hiddenNodeKeySet = ref(/* @__PURE__ */ new Set([]));
      const hiddenExpandIconKeySet = ref(/* @__PURE__ */ new Set([]));
      const filterable = computed(() => {
        return isFunction$4(props2.filterMethod);
      });
      function doFilter(query) {
        var _a2;
        if (!filterable.value) {
          return;
        }
        const expandKeySet = /* @__PURE__ */ new Set();
        const hiddenExpandIconKeys = hiddenExpandIconKeySet.value;
        const hiddenKeys = hiddenNodeKeySet.value;
        const family = [];
        const nodes = ((_a2 = tree.value) == null ? void 0 : _a2.treeNodes) || [];
        const filter2 = props2.filterMethod;
        hiddenKeys.clear();
        function traverse2(nodes2) {
          nodes2.forEach((node) => {
            family.push(node);
            if (filter2 == null ? void 0 : filter2(query, node.data, node)) {
              family.forEach((member) => {
                expandKeySet.add(member.key);
              });
            } else if (node.isLeaf) {
              hiddenKeys.add(node.key);
            }
            const children = node.children;
            if (children) {
              traverse2(children);
            }
            if (!node.isLeaf) {
              if (!expandKeySet.has(node.key)) {
                hiddenKeys.add(node.key);
              } else if (children) {
                let allHidden = true;
                for (const childNode of children) {
                  if (!hiddenKeys.has(childNode.key)) {
                    allHidden = false;
                    break;
                  }
                }
                if (allHidden) {
                  hiddenExpandIconKeys.add(node.key);
                } else {
                  hiddenExpandIconKeys.delete(node.key);
                }
              }
            }
            family.pop();
          });
        }
        traverse2(nodes);
        return expandKeySet;
      }
      function isForceHiddenExpandIcon(node) {
        return hiddenExpandIconKeySet.value.has(node.key);
      }
      return {
        hiddenExpandIconKeySet,
        hiddenNodeKeySet,
        doFilter,
        isForceHiddenExpandIcon
      };
    }
    function useTree(props2, emit2) {
      const expandedKeySet = ref(new Set(props2.defaultExpandedKeys));
      const currentKey = ref();
      const tree = shallowRef();
      const listRef = ref();
      watch(() => props2.currentNodeKey, (key) => {
        currentKey.value = key;
      }, {
        immediate: true
      });
      watch(() => props2.data, (data) => {
        setData(data);
      }, {
        immediate: true
      });
      const {
        isIndeterminate,
        isChecked,
        toggleCheckbox,
        getCheckedKeys,
        getCheckedNodes,
        getHalfCheckedKeys,
        getHalfCheckedNodes,
        setChecked: setChecked2,
        setCheckedKeys
      } = useCheck(props2, tree);
      const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(props2, tree);
      const valueKey = computed(() => {
        var _a2;
        return ((_a2 = props2.props) == null ? void 0 : _a2.value) || TreeOptionsEnum.KEY;
      });
      const childrenKey = computed(() => {
        var _a2;
        return ((_a2 = props2.props) == null ? void 0 : _a2.children) || TreeOptionsEnum.CHILDREN;
      });
      const disabledKey = computed(() => {
        var _a2;
        return ((_a2 = props2.props) == null ? void 0 : _a2.disabled) || TreeOptionsEnum.DISABLED;
      });
      const labelKey = computed(() => {
        var _a2;
        return ((_a2 = props2.props) == null ? void 0 : _a2.label) || TreeOptionsEnum.LABEL;
      });
      const flattenTree = computed(() => {
        var _a2;
        const expandedKeys = expandedKeySet.value;
        const hiddenKeys = hiddenNodeKeySet.value;
        const flattenNodes = [];
        const nodes = ((_a2 = tree.value) == null ? void 0 : _a2.treeNodes) || [];
        const stack2 = [];
        for (let i2 = nodes.length - 1; i2 >= 0; --i2) {
          stack2.push(nodes[i2]);
        }
        while (stack2.length) {
          const node = stack2.pop();
          if (hiddenKeys.has(node.key))
            continue;
          flattenNodes.push(node);
          if (node.children && expandedKeys.has(node.key)) {
            for (let i2 = node.children.length - 1; i2 >= 0; --i2) {
              stack2.push(node.children[i2]);
            }
          }
        }
        return flattenNodes;
      });
      const isNotEmpty = computed(() => {
        return flattenTree.value.length > 0;
      });
      function createTree(data) {
        const treeNodeMap = /* @__PURE__ */ new Map();
        const levelTreeNodeMap = /* @__PURE__ */ new Map();
        let maxLevel = 1;
        function traverse2(nodes, level = 1, parent2 = void 0) {
          var _a2;
          const siblings = [];
          for (const rawNode of nodes) {
            const value = getKey2(rawNode);
            const node = {
              level,
              key: value,
              data: rawNode
            };
            node.label = getLabel(rawNode);
            node.parent = parent2;
            const children = getChildren(rawNode);
            node.disabled = getDisabled(rawNode);
            node.isLeaf = !children || children.length === 0;
            if (children && children.length) {
              node.children = traverse2(children, level + 1, node);
            }
            siblings.push(node);
            treeNodeMap.set(value, node);
            if (!levelTreeNodeMap.has(level)) {
              levelTreeNodeMap.set(level, []);
            }
            (_a2 = levelTreeNodeMap.get(level)) == null ? void 0 : _a2.push(node);
          }
          if (level > maxLevel) {
            maxLevel = level;
          }
          return siblings;
        }
        const treeNodes = traverse2(data);
        return {
          treeNodeMap,
          levelTreeNodeMap,
          maxLevel,
          treeNodes
        };
      }
      function filter2(query) {
        const keys2 = doFilter(query);
        if (keys2) {
          expandedKeySet.value = keys2;
        }
      }
      function getChildren(node) {
        return node[childrenKey.value];
      }
      function getKey2(node) {
        if (!node) {
          return "";
        }
        return node[valueKey.value];
      }
      function getDisabled(node) {
        return node[disabledKey.value];
      }
      function getLabel(node) {
        return node[labelKey.value];
      }
      function toggleExpand(node) {
        const expandedKeys = expandedKeySet.value;
        if (expandedKeys.has(node.key)) {
          collapseNode(node);
        } else {
          expandNode(node);
        }
      }
      function setExpandedKeys(keys2) {
        const expandedKeys = /* @__PURE__ */ new Set();
        const nodeMap = tree.value.treeNodeMap;
        keys2.forEach((k2) => {
          let node = nodeMap.get(k2);
          while (node && !expandedKeys.has(node.key)) {
            expandedKeys.add(node.key);
            node = node.parent;
          }
        });
        expandedKeySet.value = expandedKeys;
      }
      function handleNodeClick(node, e2) {
        emit2(NODE_CLICK, node.data, node, e2);
        handleCurrentChange2(node);
        if (props2.expandOnClickNode) {
          toggleExpand(node);
        }
        if (props2.showCheckbox && (props2.checkOnClickNode || node.isLeaf && props2.checkOnClickLeaf) && !node.disabled) {
          toggleCheckbox(node, !isChecked(node), true);
        }
      }
      function handleNodeDrop(node, e2) {
        emit2(NODE_DROP, node.data, node, e2);
      }
      function handleCurrentChange2(node) {
        if (!isCurrent(node)) {
          currentKey.value = node.key;
          emit2(CURRENT_CHANGE, node.data, node);
        }
      }
      function handleNodeCheck(node, checked) {
        toggleCheckbox(node, checked);
      }
      function expandNode(node) {
        const keySet = expandedKeySet.value;
        if (tree.value && props2.accordion) {
          const { treeNodeMap } = tree.value;
          keySet.forEach((key) => {
            const treeNode = treeNodeMap.get(key);
            if (node && node.level === (treeNode == null ? void 0 : treeNode.level)) {
              keySet.delete(key);
            }
          });
        }
        keySet.add(node.key);
        emit2(NODE_EXPAND, node.data, node);
      }
      function collapseNode(node) {
        expandedKeySet.value.delete(node.key);
        emit2(NODE_COLLAPSE, node.data, node);
      }
      function isExpanded(node) {
        return expandedKeySet.value.has(node.key);
      }
      function isDisabled(node) {
        return !!node.disabled;
      }
      function isCurrent(node) {
        const current = currentKey.value;
        return current !== void 0 && current === node.key;
      }
      function getCurrentNode() {
        var _a2, _b2;
        if (!currentKey.value)
          return void 0;
        return (_b2 = (_a2 = tree.value) == null ? void 0 : _a2.treeNodeMap.get(currentKey.value)) == null ? void 0 : _b2.data;
      }
      function getCurrentKey() {
        return currentKey.value;
      }
      function setCurrentKey(key) {
        currentKey.value = key;
      }
      function setData(data) {
        nextTick(() => tree.value = createTree(data));
      }
      function getNode(data) {
        var _a2;
        const key = isObject$7(data) ? getKey2(data) : data;
        return (_a2 = tree.value) == null ? void 0 : _a2.treeNodeMap.get(key);
      }
      function scrollToNode(key, strategy = "auto") {
        const node = getNode(key);
        if (node && listRef.value) {
          listRef.value.scrollToItem(flattenTree.value.indexOf(node), strategy);
        }
      }
      function scrollTo(offset2) {
        var _a2;
        (_a2 = listRef.value) == null ? void 0 : _a2.scrollTo(offset2);
      }
      return {
        tree,
        flattenTree,
        isNotEmpty,
        listRef,
        getKey: getKey2,
        getChildren,
        toggleExpand,
        toggleCheckbox,
        isExpanded,
        isChecked,
        isIndeterminate,
        isDisabled,
        isCurrent,
        isForceHiddenExpandIcon,
        handleNodeClick,
        handleNodeDrop,
        handleNodeCheck,
        getCurrentNode,
        getCurrentKey,
        setCurrentKey,
        getCheckedKeys,
        getCheckedNodes,
        getHalfCheckedKeys,
        getHalfCheckedNodes,
        setChecked: setChecked2,
        setCheckedKeys,
        filter: filter2,
        setData,
        getNode,
        expandNode,
        collapseNode,
        setExpandedKeys,
        scrollToNode,
        scrollTo
      };
    }
    var ElNodeContent = /* @__PURE__ */ defineComponent({
      name: "ElTreeNodeContent",
      props: treeNodeContentProps,
      setup(props2) {
        const tree = inject(ROOT_TREE_INJECTION_KEY);
        const ns = useNamespace("tree");
        return () => {
          const node = props2.node;
          const { data } = node;
          return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({ node, data }) : h$1(ElText, { tag: "span", truncated: true, class: ns.be("node", "label") }, () => [node == null ? void 0 : node.label]);
        };
      }
    });
    const __default__$h = /* @__PURE__ */ defineComponent({
      name: "ElTreeNode"
    });
    const _sfc_main$q = /* @__PURE__ */ defineComponent({
      ...__default__$h,
      props: treeNodeProps,
      emits: treeNodeEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const tree = inject(ROOT_TREE_INJECTION_KEY);
        const ns = useNamespace("tree");
        const indent = computed(() => {
          var _a2;
          return (_a2 = tree == null ? void 0 : tree.props.indent) != null ? _a2 : 16;
        });
        const icon = computed(() => {
          var _a2;
          return (_a2 = tree == null ? void 0 : tree.props.icon) != null ? _a2 : caret_right_default;
        });
        const getNodeClass = (node) => {
          const nodeClassFunc = tree == null ? void 0 : tree.props.props.class;
          if (!nodeClassFunc)
            return {};
          let className;
          if (isFunction$4(nodeClassFunc)) {
            const { data } = node;
            className = nodeClassFunc(data, node);
          } else {
            className = nodeClassFunc;
          }
          return isString$3(className) ? { [className]: true } : className;
        };
        const handleClick = (e2) => {
          emit2("click", props2.node, e2);
        };
        const handleDrop = (e2) => {
          emit2("drop", props2.node, e2);
        };
        const handleExpandIconClick = () => {
          emit2("toggle", props2.node);
        };
        const handleCheckChange = (value) => {
          emit2("check", props2.node, value);
        };
        const handleContextMenu = (event) => {
          var _a2, _b2, _c2, _d;
          if ((_c2 = (_b2 = (_a2 = tree == null ? void 0 : tree.instance) == null ? void 0 : _a2.vnode) == null ? void 0 : _b2.props) == null ? void 0 : _c2["onNodeContextmenu"]) {
            event.stopPropagation();
            event.preventDefault();
          }
          tree == null ? void 0 : tree.ctx.emit(NODE_CONTEXTMENU, event, (_d = props2.node) == null ? void 0 : _d.data, props2.node);
        };
        return (_ctx, _cache) => {
          var _a2, _b2, _c2;
          return openBlock(), createElementBlock("div", {
            ref: "node$",
            class: normalizeClass([
              unref(ns).b("node"),
              unref(ns).is("expanded", _ctx.expanded),
              unref(ns).is("current", _ctx.current),
              unref(ns).is("focusable", !_ctx.disabled),
              unref(ns).is("checked", !_ctx.disabled && _ctx.checked),
              getNodeClass(_ctx.node)
            ]),
            role: "treeitem",
            tabindex: "-1",
            "aria-expanded": _ctx.expanded,
            "aria-disabled": _ctx.disabled,
            "aria-checked": _ctx.checked,
            "data-key": (_a2 = _ctx.node) == null ? void 0 : _a2.key,
            onClick: withModifiers(handleClick, ["stop"]),
            onContextmenu: handleContextMenu,
            onDragover: withModifiers(() => {
            }, ["prevent"]),
            onDragenter: withModifiers(() => {
            }, ["prevent"]),
            onDrop: withModifiers(handleDrop, ["stop"])
          }, [
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).be("node", "content")),
              style: normalizeStyle$1({
                paddingLeft: `${(_ctx.node.level - 1) * unref(indent)}px`,
                height: _ctx.itemSize + "px"
              })
            }, [
              unref(icon) ? (openBlock(), createBlock(unref(ElIcon), {
                key: 0,
                class: normalizeClass([
                  unref(ns).is("leaf", !!((_b2 = _ctx.node) == null ? void 0 : _b2.isLeaf)),
                  unref(ns).is("hidden", _ctx.hiddenExpandIcon),
                  {
                    expanded: !((_c2 = _ctx.node) == null ? void 0 : _c2.isLeaf) && _ctx.expanded
                  },
                  unref(ns).be("node", "expand-icon")
                ]),
                onClick: withModifiers(handleExpandIconClick, ["stop"])
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(unref(icon))))
                ]),
                _: 1
              }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true),
              _ctx.showCheckbox ? (openBlock(), createBlock(unref(ElCheckbox), {
                key: 1,
                "model-value": _ctx.checked,
                indeterminate: _ctx.indeterminate,
                disabled: _ctx.disabled,
                onChange: handleCheckChange,
                onClick: withModifiers(() => {
                }, ["stop"])
              }, null, 8, ["model-value", "indeterminate", "disabled", "onClick"])) : createCommentVNode("v-if", true),
              createVNode$1(unref(ElNodeContent), { node: _ctx.node }, null, 8, ["node"])
            ], 6)
          ], 42, ["aria-expanded", "aria-disabled", "aria-checked", "data-key", "onClick", "onDragover", "onDragenter", "onDrop"]);
        };
      }
    });
    var ElTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__file", "tree-node.vue"]]);
    const __default__$g = /* @__PURE__ */ defineComponent({
      name: "ElTreeV2"
    });
    const _sfc_main$p = /* @__PURE__ */ defineComponent({
      ...__default__$g,
      props: treeProps,
      emits: treeEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const slots = useSlots();
        const treeNodeSize = computed(() => props2.itemSize);
        provide(ROOT_TREE_INJECTION_KEY, {
          ctx: {
            emit: emit2,
            slots
          },
          props: props2,
          instance: getCurrentInstance()
        });
        provide(formItemContextKey, void 0);
        const { t } = useLocale();
        const ns = useNamespace("tree");
        const {
          flattenTree,
          isNotEmpty,
          listRef,
          toggleExpand,
          isExpanded,
          isIndeterminate,
          isChecked,
          isDisabled,
          isCurrent,
          isForceHiddenExpandIcon,
          handleNodeClick,
          handleNodeDrop,
          handleNodeCheck,
          toggleCheckbox,
          getCurrentNode,
          getCurrentKey,
          setCurrentKey,
          getCheckedKeys,
          getCheckedNodes,
          getHalfCheckedKeys,
          getHalfCheckedNodes,
          setChecked: setChecked2,
          setCheckedKeys,
          filter: filter2,
          setData,
          getNode,
          expandNode,
          collapseNode,
          setExpandedKeys,
          scrollToNode,
          scrollTo
        } = useTree(props2, emit2);
        expose({
          toggleCheckbox,
          getCurrentNode,
          getCurrentKey,
          setCurrentKey,
          getCheckedKeys,
          getCheckedNodes,
          getHalfCheckedKeys,
          getHalfCheckedNodes,
          setChecked: setChecked2,
          setCheckedKeys,
          filter: filter2,
          setData,
          getNode,
          expandNode,
          collapseNode,
          setExpandedKeys,
          scrollToNode,
          scrollTo
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b(), { [unref(ns).m("highlight-current")]: _ctx.highlightCurrent }]),
            role: "tree"
          }, [
            unref(isNotEmpty) ? (openBlock(), createBlock(unref(FixedSizeList), {
              key: 0,
              ref_key: "listRef",
              ref: listRef,
              "class-name": unref(ns).b("virtual-list"),
              data: unref(flattenTree),
              total: unref(flattenTree).length,
              height: _ctx.height,
              "item-size": unref(treeNodeSize),
              "perf-mode": _ctx.perfMode
            }, {
              default: withCtx(({ data, index, style }) => [
                (openBlock(), createBlock(ElTreeNode, {
                  key: data[index].key,
                  style: normalizeStyle$1(style),
                  node: data[index],
                  expanded: unref(isExpanded)(data[index]),
                  "show-checkbox": _ctx.showCheckbox,
                  checked: unref(isChecked)(data[index]),
                  indeterminate: unref(isIndeterminate)(data[index]),
                  "item-size": unref(treeNodeSize),
                  disabled: unref(isDisabled)(data[index]),
                  current: unref(isCurrent)(data[index]),
                  "hidden-expand-icon": unref(isForceHiddenExpandIcon)(data[index]),
                  onClick: unref(handleNodeClick),
                  onToggle: unref(toggleExpand),
                  onCheck: unref(handleNodeCheck),
                  onDrop: unref(handleNodeDrop)
                }, null, 8, ["style", "node", "expanded", "show-checkbox", "checked", "indeterminate", "item-size", "disabled", "current", "hidden-expand-icon", "onClick", "onToggle", "onCheck", "onDrop"]))
              ]),
              _: 1
            }, 8, ["class-name", "data", "total", "height", "item-size", "perf-mode"])) : (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).e("empty-block"))
            }, [
              renderSlot(_ctx.$slots, "empty", {}, () => {
                var _a2;
                return [
                  createBaseVNode("span", {
                    class: normalizeClass(unref(ns).e("empty-text"))
                  }, toDisplayString((_a2 = _ctx.emptyText) != null ? _a2 : unref(t)("el.tree.emptyText")), 3)
                ];
              })
            ], 2))
          ], 2);
        };
      }
    });
    var TreeV2 = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__file", "tree.vue"]]);
    const ElTreeV2 = withInstall(TreeV2);
    const uploadContextKey = Symbol("uploadContextKey");
    const SCOPE$2 = "ElUpload";
    class UploadAjaxError extends Error {
      constructor(message2, status, method, url) {
        super(message2);
        this.name = "UploadAjaxError";
        this.status = status;
        this.method = method;
        this.url = url;
      }
    }
    function getError(action, option, xhr) {
      let msg;
      if (xhr.response) {
        msg = `${xhr.response.error || xhr.response}`;
      } else if (xhr.responseText) {
        msg = `${xhr.responseText}`;
      } else {
        msg = `fail to ${option.method} ${action} ${xhr.status}`;
      }
      return new UploadAjaxError(msg, xhr.status, option.method, action);
    }
    function getBody(xhr) {
      const text = xhr.responseText || xhr.response;
      if (!text) {
        return text;
      }
      try {
        return JSON.parse(text);
      } catch (e2) {
        return text;
      }
    }
    const ajaxUpload = (option) => {
      if (typeof XMLHttpRequest === "undefined")
        throwError$1(SCOPE$2, "XMLHttpRequest is undefined");
      const xhr = new XMLHttpRequest();
      const action = option.action;
      if (xhr.upload) {
        xhr.upload.addEventListener("progress", (evt) => {
          const progressEvt = evt;
          progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0;
          option.onProgress(progressEvt);
        });
      }
      const formData = new FormData();
      if (option.data) {
        for (const [key, value] of Object.entries(option.data)) {
          if (isArray$5(value) && value.length)
            formData.append(key, ...value);
          else
            formData.append(key, value);
        }
      }
      formData.append(option.filename, option.file, option.file.name);
      xhr.addEventListener("error", () => {
        option.onError(getError(action, option, xhr));
      });
      xhr.addEventListener("load", () => {
        if (xhr.status < 200 || xhr.status >= 300) {
          return option.onError(getError(action, option, xhr));
        }
        option.onSuccess(getBody(xhr));
      });
      xhr.open(option.method, action, true);
      if (option.withCredentials && "withCredentials" in xhr) {
        xhr.withCredentials = true;
      }
      const headers = option.headers || {};
      if (headers instanceof Headers) {
        headers.forEach((value, key) => xhr.setRequestHeader(key, value));
      } else {
        for (const [key, value] of Object.entries(headers)) {
          if (isNil(value))
            continue;
          xhr.setRequestHeader(key, String(value));
        }
      }
      xhr.send(formData);
      return xhr;
    };
    const uploadListTypes = ["text", "picture", "picture-card"];
    let fileId = 1;
    const genFileId = () => Date.now() + fileId++;
    const uploadBaseProps = buildProps({
      action: {
        type: String,
        default: "#"
      },
      headers: {
        type: definePropType(Object)
      },
      method: {
        type: String,
        default: "post"
      },
      data: {
        type: definePropType([Object, Function, Promise]),
        default: () => mutable({})
      },
      multiple: Boolean,
      name: {
        type: String,
        default: "file"
      },
      drag: Boolean,
      withCredentials: Boolean,
      showFileList: {
        type: Boolean,
        default: true
      },
      accept: {
        type: String,
        default: ""
      },
      fileList: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      autoUpload: {
        type: Boolean,
        default: true
      },
      listType: {
        type: String,
        values: uploadListTypes,
        default: "text"
      },
      httpRequest: {
        type: definePropType(Function),
        default: ajaxUpload
      },
      disabled: Boolean,
      limit: Number
    });
    const uploadProps = buildProps({
      ...uploadBaseProps,
      beforeUpload: {
        type: definePropType(Function),
        default: NOOP
      },
      beforeRemove: {
        type: definePropType(Function)
      },
      onRemove: {
        type: definePropType(Function),
        default: NOOP
      },
      onChange: {
        type: definePropType(Function),
        default: NOOP
      },
      onPreview: {
        type: definePropType(Function),
        default: NOOP
      },
      onSuccess: {
        type: definePropType(Function),
        default: NOOP
      },
      onProgress: {
        type: definePropType(Function),
        default: NOOP
      },
      onError: {
        type: definePropType(Function),
        default: NOOP
      },
      onExceed: {
        type: definePropType(Function),
        default: NOOP
      },
      crossorigin: {
        type: definePropType(String)
      }
    });
    const uploadListProps = buildProps({
      files: {
        type: definePropType(Array),
        default: () => mutable([])
      },
      disabled: {
        type: Boolean,
        default: false
      },
      handlePreview: {
        type: definePropType(Function),
        default: NOOP
      },
      listType: {
        type: String,
        values: uploadListTypes,
        default: "text"
      },
      crossorigin: {
        type: definePropType(String)
      }
    });
    const uploadListEmits = {
      remove: (file) => !!file
    };
    const __default__$f = /* @__PURE__ */ defineComponent({
      name: "ElUploadList"
    });
    const _sfc_main$o = /* @__PURE__ */ defineComponent({
      ...__default__$f,
      props: uploadListProps,
      emits: uploadListEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { t } = useLocale();
        const nsUpload = useNamespace("upload");
        const nsIcon = useNamespace("icon");
        const nsList = useNamespace("list");
        const disabled = useFormDisabled();
        const focusing = ref(false);
        const containerKls = computed(() => [
          nsUpload.b("list"),
          nsUpload.bm("list", props2.listType),
          nsUpload.is("disabled", props2.disabled)
        ]);
        const handleRemove = (file) => {
          emit2("remove", file);
        };
        return (_ctx, _cache) => {
          return openBlock(), createBlock(TransitionGroup, {
            tag: "ul",
            class: normalizeClass(unref(containerKls)),
            name: unref(nsList).b()
          }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.files, (file, index) => {
                return openBlock(), createElementBlock("li", {
                  key: file.uid || file.name,
                  class: normalizeClass([
                    unref(nsUpload).be("list", "item"),
                    unref(nsUpload).is(file.status),
                    { focusing: focusing.value }
                  ]),
                  tabindex: "0",
                  onKeydown: withKeys(($event) => !unref(disabled) && handleRemove(file), ["delete"]),
                  onFocus: ($event) => focusing.value = true,
                  onBlur: ($event) => focusing.value = false,
                  onClick: ($event) => focusing.value = false
                }, [
                  renderSlot(_ctx.$slots, "default", {
                    file,
                    index
                  }, () => [
                    _ctx.listType === "picture" || file.status !== "uploading" && _ctx.listType === "picture-card" ? (openBlock(), createElementBlock("img", {
                      key: 0,
                      class: normalizeClass(unref(nsUpload).be("list", "item-thumbnail")),
                      src: file.url,
                      crossorigin: _ctx.crossorigin,
                      alt: ""
                    }, null, 10, ["src", "crossorigin"])) : createCommentVNode("v-if", true),
                    file.status === "uploading" || _ctx.listType !== "picture-card" ? (openBlock(), createElementBlock("div", {
                      key: 1,
                      class: normalizeClass(unref(nsUpload).be("list", "item-info"))
                    }, [
                      createBaseVNode("a", {
                        class: normalizeClass(unref(nsUpload).be("list", "item-name")),
                        onClick: withModifiers(($event) => _ctx.handlePreview(file), ["prevent"])
                      }, [
                        createVNode$1(unref(ElIcon), {
                          class: normalizeClass(unref(nsIcon).m("document"))
                        }, {
                          default: withCtx(() => [
                            createVNode$1(unref(document_default))
                          ]),
                          _: 1
                        }, 8, ["class"]),
                        createBaseVNode("span", {
                          class: normalizeClass(unref(nsUpload).be("list", "item-file-name")),
                          title: file.name
                        }, toDisplayString(file.name), 11, ["title"])
                      ], 10, ["onClick"]),
                      file.status === "uploading" ? (openBlock(), createBlock(unref(ElProgress), {
                        key: 0,
                        type: _ctx.listType === "picture-card" ? "circle" : "line",
                        "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
                        percentage: Number(file.percentage),
                        style: normalizeStyle$1(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
                      }, null, 8, ["type", "stroke-width", "percentage", "style"])) : createCommentVNode("v-if", true)
                    ], 2)) : createCommentVNode("v-if", true),
                    createBaseVNode("label", {
                      class: normalizeClass(unref(nsUpload).be("list", "item-status-label"))
                    }, [
                      _ctx.listType === "text" ? (openBlock(), createBlock(unref(ElIcon), {
                        key: 0,
                        class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("circle-check")])
                      }, {
                        default: withCtx(() => [
                          createVNode$1(unref(circle_check_default))
                        ]),
                        _: 1
                      }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (openBlock(), createBlock(unref(ElIcon), {
                        key: 1,
                        class: normalizeClass([unref(nsIcon).m("upload-success"), unref(nsIcon).m("check")])
                      }, {
                        default: withCtx(() => [
                          createVNode$1(unref(check_default))
                        ]),
                        _: 1
                      }, 8, ["class"])) : createCommentVNode("v-if", true)
                    ], 2),
                    !unref(disabled) ? (openBlock(), createBlock(unref(ElIcon), {
                      key: 2,
                      class: normalizeClass(unref(nsIcon).m("close")),
                      onClick: ($event) => handleRemove(file)
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(close_default))
                      ]),
                      _: 2
                    }, 1032, ["class", "onClick"])) : createCommentVNode("v-if", true),
                    createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
                    createCommentVNode(" This is a bug which needs to be fixed "),
                    createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
                    !unref(disabled) ? (openBlock(), createElementBlock("i", {
                      key: 3,
                      class: normalizeClass(unref(nsIcon).m("close-tip"))
                    }, toDisplayString(unref(t)("el.upload.deleteTip")), 3)) : createCommentVNode("v-if", true),
                    _ctx.listType === "picture-card" ? (openBlock(), createElementBlock("span", {
                      key: 4,
                      class: normalizeClass(unref(nsUpload).be("list", "item-actions"))
                    }, [
                      createBaseVNode("span", {
                        class: normalizeClass(unref(nsUpload).be("list", "item-preview")),
                        onClick: ($event) => _ctx.handlePreview(file)
                      }, [
                        createVNode$1(unref(ElIcon), {
                          class: normalizeClass(unref(nsIcon).m("zoom-in"))
                        }, {
                          default: withCtx(() => [
                            createVNode$1(unref(zoom_in_default))
                          ]),
                          _: 1
                        }, 8, ["class"])
                      ], 10, ["onClick"]),
                      !unref(disabled) ? (openBlock(), createElementBlock("span", {
                        key: 0,
                        class: normalizeClass(unref(nsUpload).be("list", "item-delete")),
                        onClick: ($event) => handleRemove(file)
                      }, [
                        createVNode$1(unref(ElIcon), {
                          class: normalizeClass(unref(nsIcon).m("delete"))
                        }, {
                          default: withCtx(() => [
                            createVNode$1(unref(delete_default))
                          ]),
                          _: 1
                        }, 8, ["class"])
                      ], 10, ["onClick"])) : createCommentVNode("v-if", true)
                    ], 2)) : createCommentVNode("v-if", true)
                  ])
                ], 42, ["onKeydown", "onFocus", "onBlur", "onClick"]);
              }), 128)),
              renderSlot(_ctx.$slots, "append")
            ]),
            _: 3
          }, 8, ["class", "name"]);
        };
      }
    });
    var UploadList = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "upload-list.vue"]]);
    const uploadDraggerProps = buildProps({
      disabled: {
        type: Boolean,
        default: false
      }
    });
    const uploadDraggerEmits = {
      file: (file) => isArray$5(file)
    };
    const COMPONENT_NAME = "ElUploadDrag";
    const __default__$e = /* @__PURE__ */ defineComponent({
      name: COMPONENT_NAME
    });
    const _sfc_main$n = /* @__PURE__ */ defineComponent({
      ...__default__$e,
      props: uploadDraggerProps,
      emits: uploadDraggerEmits,
      setup(__props, { emit: emit2 }) {
        const uploaderContext = inject(uploadContextKey);
        if (!uploaderContext) {
          throwError$1(COMPONENT_NAME, "usage: <el-upload><el-upload-dragger /></el-upload>");
        }
        const ns = useNamespace("upload");
        const dragover = ref(false);
        const disabled = useFormDisabled();
        const onDrop = (e2) => {
          if (disabled.value)
            return;
          dragover.value = false;
          e2.stopPropagation();
          const files = Array.from(e2.dataTransfer.files);
          const items = e2.dataTransfer.items || [];
          files.forEach((file, index) => {
            var _a2;
            const item = items[index];
            const entry = (_a2 = item == null ? void 0 : item.webkitGetAsEntry) == null ? void 0 : _a2.call(item);
            if (entry) {
              file.isDirectory = entry.isDirectory;
            }
          });
          emit2("file", files);
        };
        const onDragover = () => {
          if (!disabled.value)
            dragover.value = true;
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([unref(ns).b("dragger"), unref(ns).is("dragover", dragover.value)]),
            onDrop: withModifiers(onDrop, ["prevent"]),
            onDragover: withModifiers(onDragover, ["prevent"]),
            onDragleave: withModifiers(($event) => dragover.value = false, ["prevent"])
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 42, ["onDrop", "onDragover", "onDragleave"]);
        };
      }
    });
    var UploadDragger = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "upload-dragger.vue"]]);
    const uploadContentProps = buildProps({
      ...uploadBaseProps,
      beforeUpload: {
        type: definePropType(Function),
        default: NOOP
      },
      onRemove: {
        type: definePropType(Function),
        default: NOOP
      },
      onStart: {
        type: definePropType(Function),
        default: NOOP
      },
      onSuccess: {
        type: definePropType(Function),
        default: NOOP
      },
      onProgress: {
        type: definePropType(Function),
        default: NOOP
      },
      onError: {
        type: definePropType(Function),
        default: NOOP
      },
      onExceed: {
        type: definePropType(Function),
        default: NOOP
      }
    });
    const __default__$d = /* @__PURE__ */ defineComponent({
      name: "ElUploadContent",
      inheritAttrs: false
    });
    const _sfc_main$m = /* @__PURE__ */ defineComponent({
      ...__default__$d,
      props: uploadContentProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const ns = useNamespace("upload");
        const disabled = useFormDisabled();
        const requests = shallowRef({});
        const inputRef = shallowRef();
        const uploadFiles = (files) => {
          if (files.length === 0)
            return;
          const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props2;
          if (limit && fileList.length + files.length > limit) {
            onExceed(files, fileList);
            return;
          }
          if (!multiple) {
            files = files.slice(0, 1);
          }
          for (const file of files) {
            const rawFile = file;
            rawFile.uid = genFileId();
            onStart(rawFile);
            if (autoUpload)
              upload(rawFile);
          }
        };
        const upload = async (rawFile) => {
          inputRef.value.value = "";
          if (!props2.beforeUpload) {
            return doUpload(rawFile);
          }
          let hookResult;
          let beforeData = {};
          try {
            const originData = props2.data;
            const beforeUploadPromise = props2.beforeUpload(rawFile);
            beforeData = isPlainObject$2(props2.data) ? cloneDeep(props2.data) : props2.data;
            hookResult = await beforeUploadPromise;
            if (isPlainObject$2(props2.data) && isEqual$1(originData, beforeData)) {
              beforeData = cloneDeep(props2.data);
            }
          } catch (e2) {
            hookResult = false;
          }
          if (hookResult === false) {
            props2.onRemove(rawFile);
            return;
          }
          let file = rawFile;
          if (hookResult instanceof Blob) {
            if (hookResult instanceof File) {
              file = hookResult;
            } else {
              file = new File([hookResult], rawFile.name, {
                type: rawFile.type
              });
            }
          }
          doUpload(Object.assign(file, {
            uid: rawFile.uid
          }), beforeData);
        };
        const resolveData = async (data, rawFile) => {
          if (isFunction$4(data)) {
            return data(rawFile);
          }
          return data;
        };
        const doUpload = async (rawFile, beforeData) => {
          const {
            headers,
            data,
            method,
            withCredentials,
            name: filename,
            action,
            onProgress,
            onSuccess,
            onError,
            httpRequest
          } = props2;
          try {
            beforeData = await resolveData(beforeData != null ? beforeData : data, rawFile);
          } catch (e2) {
            props2.onRemove(rawFile);
            return;
          }
          const { uid: uid2 } = rawFile;
          const options = {
            headers: headers || {},
            withCredentials,
            file: rawFile,
            data: beforeData,
            method,
            filename,
            action,
            onProgress: (evt) => {
              onProgress(evt, rawFile);
            },
            onSuccess: (res) => {
              onSuccess(res, rawFile);
              delete requests.value[uid2];
            },
            onError: (err) => {
              onError(err, rawFile);
              delete requests.value[uid2];
            }
          };
          const request = httpRequest(options);
          requests.value[uid2] = request;
          if (request instanceof Promise) {
            request.then(options.onSuccess, options.onError);
          }
        };
        const handleChange = (e2) => {
          const files = e2.target.files;
          if (!files)
            return;
          uploadFiles(Array.from(files));
        };
        const handleClick = () => {
          if (!disabled.value) {
            inputRef.value.value = "";
            inputRef.value.click();
          }
        };
        const handleKeydown = () => {
          handleClick();
        };
        const abort = (file) => {
          const _reqs = entriesOf(requests.value).filter(file ? ([uid2]) => String(file.uid) === uid2 : () => true);
          _reqs.forEach(([uid2, req]) => {
            if (req instanceof XMLHttpRequest)
              req.abort();
            delete requests.value[uid2];
          });
        };
        expose({
          abort,
          upload
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass([
              unref(ns).b(),
              unref(ns).m(_ctx.listType),
              unref(ns).is("drag", _ctx.drag),
              unref(ns).is("disabled", unref(disabled))
            ]),
            tabindex: unref(disabled) ? "-1" : "0",
            onClick: handleClick,
            onKeydown: withKeys(withModifiers(handleKeydown, ["self"]), ["enter", "space"])
          }, [
            _ctx.drag ? (openBlock(), createBlock(UploadDragger, {
              key: 0,
              disabled: unref(disabled),
              onFile: uploadFiles
            }, {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "default")
              ]),
              _: 3
            }, 8, ["disabled"])) : renderSlot(_ctx.$slots, "default", { key: 1 }),
            createBaseVNode("input", {
              ref_key: "inputRef",
              ref: inputRef,
              class: normalizeClass(unref(ns).e("input")),
              name: _ctx.name,
              disabled: unref(disabled),
              multiple: _ctx.multiple,
              accept: _ctx.accept,
              type: "file",
              onChange: handleChange,
              onClick: withModifiers(() => {
              }, ["stop"])
            }, null, 42, ["name", "disabled", "multiple", "accept", "onClick"])
          ], 42, ["tabindex", "onKeydown"]);
        };
      }
    });
    var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "upload-content.vue"]]);
    const SCOPE$1 = "ElUpload";
    const revokeFileObjectURL = (file) => {
      var _a2;
      if ((_a2 = file.url) == null ? void 0 : _a2.startsWith("blob:")) {
        URL.revokeObjectURL(file.url);
      }
    };
    const useHandlers = (props2, uploadRef) => {
      const uploadFiles = useVModel(props2, "fileList", void 0, { passive: true });
      const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
      function abort(file) {
        var _a2;
        (_a2 = uploadRef.value) == null ? void 0 : _a2.abort(file);
      }
      function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
        uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
      }
      function removeFile(file) {
        uploadFiles.value = uploadFiles.value.filter((uploadFile) => uploadFile.uid !== file.uid);
      }
      const handleError2 = (err, rawFile) => {
        const file = getFile(rawFile);
        if (!file)
          return;
        console.error(err);
        file.status = "fail";
        removeFile(file);
        props2.onError(err, file, uploadFiles.value);
        props2.onChange(file, uploadFiles.value);
      };
      const handleProgress = (evt, rawFile) => {
        const file = getFile(rawFile);
        if (!file)
          return;
        props2.onProgress(evt, file, uploadFiles.value);
        file.status = "uploading";
        file.percentage = Math.round(evt.percent);
      };
      const handleSuccess = (response, rawFile) => {
        const file = getFile(rawFile);
        if (!file)
          return;
        file.status = "success";
        file.response = response;
        props2.onSuccess(response, file, uploadFiles.value);
        props2.onChange(file, uploadFiles.value);
      };
      const handleStart = (file) => {
        if (isNil(file.uid))
          file.uid = genFileId();
        const uploadFile = {
          name: file.name,
          percentage: 0,
          status: "ready",
          size: file.size,
          raw: file,
          uid: file.uid
        };
        if (props2.listType === "picture-card" || props2.listType === "picture") {
          try {
            uploadFile.url = URL.createObjectURL(file);
          } catch (err) {
            debugWarn(SCOPE$1, err.message);
            props2.onError(err, uploadFile, uploadFiles.value);
          }
        }
        uploadFiles.value = [...uploadFiles.value, uploadFile];
        props2.onChange(uploadFile, uploadFiles.value);
      };
      const handleRemove = async (file) => {
        const uploadFile = file instanceof File ? getFile(file) : file;
        if (!uploadFile)
          throwError$1(SCOPE$1, "file to be removed not found");
        const doRemove = (file2) => {
          abort(file2);
          removeFile(file2);
          props2.onRemove(file2, uploadFiles.value);
          revokeFileObjectURL(file2);
        };
        if (props2.beforeRemove) {
          const before = await props2.beforeRemove(uploadFile, uploadFiles.value);
          if (before !== false)
            doRemove(uploadFile);
        } else {
          doRemove(uploadFile);
        }
      };
      function submit() {
        uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => {
          var _a2;
          return raw && ((_a2 = uploadRef.value) == null ? void 0 : _a2.upload(raw));
        });
      }
      watch(() => props2.listType, (val) => {
        if (val !== "picture-card" && val !== "picture") {
          return;
        }
        uploadFiles.value = uploadFiles.value.map((file) => {
          const { raw, url } = file;
          if (!url && raw) {
            try {
              file.url = URL.createObjectURL(raw);
            } catch (err) {
              props2.onError(err, file, uploadFiles.value);
            }
          }
          return file;
        });
      });
      watch(uploadFiles, (files) => {
        for (const file of files) {
          file.uid || (file.uid = genFileId());
          file.status || (file.status = "success");
        }
      }, { immediate: true, deep: true });
      return {
        uploadFiles,
        abort,
        clearFiles,
        handleError: handleError2,
        handleProgress,
        handleStart,
        handleSuccess,
        handleRemove,
        submit,
        revokeFileObjectURL
      };
    };
    const __default__$c = /* @__PURE__ */ defineComponent({
      name: "ElUpload"
    });
    const _sfc_main$l = /* @__PURE__ */ defineComponent({
      ...__default__$c,
      props: uploadProps,
      setup(__props, { expose }) {
        const props2 = __props;
        const disabled = useFormDisabled();
        const uploadRef = shallowRef();
        const {
          abort,
          submit,
          clearFiles,
          uploadFiles,
          handleStart,
          handleError: handleError2,
          handleRemove,
          handleSuccess,
          handleProgress,
          revokeFileObjectURL: revokeFileObjectURL2
        } = useHandlers(props2, uploadRef);
        const isPictureCard = computed(() => props2.listType === "picture-card");
        const uploadContentProps2 = computed(() => ({
          ...props2,
          fileList: uploadFiles.value,
          onStart: handleStart,
          onProgress: handleProgress,
          onSuccess: handleSuccess,
          onError: handleError2,
          onRemove: handleRemove
        }));
        onBeforeUnmount(() => {
          uploadFiles.value.forEach(revokeFileObjectURL2);
        });
        provide(uploadContextKey, {
          accept: toRef(props2, "accept")
        });
        expose({
          abort,
          submit,
          clearFiles,
          handleStart,
          handleRemove
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", null, [
            unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
              key: 0,
              disabled: unref(disabled),
              "list-type": _ctx.listType,
              files: unref(uploadFiles),
              crossorigin: _ctx.crossorigin,
              "handle-preview": _ctx.onPreview,
              onRemove: unref(handleRemove)
            }, createSlots({
              append: withCtx(() => [
                createVNode$1(UploadContent, mergeProps({
                  ref_key: "uploadRef",
                  ref: uploadRef
                }, unref(uploadContentProps2)), {
                  default: withCtx(() => [
                    _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
                    !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
                  ]),
                  _: 3
                }, 16)
              ]),
              _: 2
            }, [
              _ctx.$slots.file ? {
                name: "default",
                fn: withCtx(({ file, index }) => [
                  renderSlot(_ctx.$slots, "file", {
                    file,
                    index
                  })
                ])
              } : void 0
            ]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true),
            !unref(isPictureCard) || unref(isPictureCard) && !_ctx.showFileList ? (openBlock(), createBlock(UploadContent, mergeProps({
              key: 1,
              ref_key: "uploadRef",
              ref: uploadRef
            }, unref(uploadContentProps2)), {
              default: withCtx(() => [
                _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "trigger", { key: 0 }) : createCommentVNode("v-if", true),
                !_ctx.$slots.trigger && _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("v-if", true)
              ]),
              _: 3
            }, 16)) : createCommentVNode("v-if", true),
            _ctx.$slots.trigger ? renderSlot(_ctx.$slots, "default", { key: 2 }) : createCommentVNode("v-if", true),
            renderSlot(_ctx.$slots, "tip"),
            !unref(isPictureCard) && _ctx.showFileList ? (openBlock(), createBlock(UploadList, {
              key: 3,
              disabled: unref(disabled),
              "list-type": _ctx.listType,
              files: unref(uploadFiles),
              crossorigin: _ctx.crossorigin,
              "handle-preview": _ctx.onPreview,
              onRemove: unref(handleRemove)
            }, createSlots({
              _: 2
            }, [
              _ctx.$slots.file ? {
                name: "default",
                fn: withCtx(({ file, index }) => [
                  renderSlot(_ctx.$slots, "file", {
                    file,
                    index
                  })
                ])
              } : void 0
            ]), 1032, ["disabled", "list-type", "files", "crossorigin", "handle-preview", "onRemove"])) : createCommentVNode("v-if", true)
          ]);
        };
      }
    });
    var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "upload.vue"]]);
    const ElUpload = withInstall(Upload);
    const watermarkProps = buildProps({
      zIndex: {
        type: Number,
        default: 9
      },
      rotate: {
        type: Number,
        default: -22
      },
      width: Number,
      height: Number,
      image: String,
      content: {
        type: definePropType([String, Array]),
        default: "Element Plus"
      },
      font: {
        type: definePropType(Object)
      },
      gap: {
        type: definePropType(Array),
        default: () => [100, 100]
      },
      offset: {
        type: definePropType(Array)
      }
    });
    function toLowercaseSeparator(key) {
      return key.replace(/([A-Z])/g, "-$1").toLowerCase();
    }
    function getStyleStr(style) {
      return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
    }
    function getPixelRatio() {
      return window.devicePixelRatio || 1;
    }
    const reRendering = (mutation, watermarkElement) => {
      let flag = false;
      if (mutation.removedNodes.length && watermarkElement) {
        flag = Array.from(mutation.removedNodes).includes(watermarkElement);
      }
      if (mutation.type === "attributes" && mutation.target === watermarkElement) {
        flag = true;
      }
      return flag;
    };
    const FontGap = 3;
    function prepareCanvas(width, height, ratio = 1) {
      const canvas = document.createElement("canvas");
      const ctx = canvas.getContext("2d");
      const realWidth = width * ratio;
      const realHeight = height * ratio;
      canvas.setAttribute("width", `${realWidth}px`);
      canvas.setAttribute("height", `${realHeight}px`);
      ctx.save();
      return [ctx, canvas, realWidth, realHeight];
    }
    function useClips() {
      function getClips(content2, rotate2, ratio, width, height, font, gapX, gapY) {
        const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
        if (content2 instanceof HTMLImageElement) {
          ctx.drawImage(content2, 0, 0, contentWidth, contentHeight);
        } else {
          const {
            color: color2,
            fontSize: fontSize2,
            fontStyle: fontStyle2,
            fontWeight: fontWeight2,
            fontFamily: fontFamily2,
            textAlign: textAlign2,
            textBaseline
          } = font;
          const mergedFontSize = Number(fontSize2) * ratio;
          ctx.font = `${fontStyle2} normal ${fontWeight2} ${mergedFontSize}px/${height}px ${fontFamily2}`;
          ctx.fillStyle = color2;
          ctx.textAlign = textAlign2;
          ctx.textBaseline = textBaseline;
          const contents = isArray$5(content2) ? content2 : [content2];
          contents == null ? void 0 : contents.forEach((item, index) => {
            ctx.fillText(item != null ? item : "", contentWidth / 2, index * (mergedFontSize + FontGap * ratio));
          });
        }
        const angle2 = Math.PI / 180 * Number(rotate2);
        const maxSize = Math.max(width, height);
        const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
        rCtx.translate(realMaxSize / 2, realMaxSize / 2);
        rCtx.rotate(angle2);
        if (contentWidth > 0 && contentHeight > 0) {
          rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
        }
        function getRotatePos(x2, y) {
          const targetX = x2 * Math.cos(angle2) - y * Math.sin(angle2);
          const targetY = x2 * Math.sin(angle2) + y * Math.cos(angle2);
          return [targetX, targetY];
        }
        let left = 0;
        let right = 0;
        let top = 0;
        let bottom = 0;
        const halfWidth = contentWidth / 2;
        const halfHeight = contentHeight / 2;
        const points2 = [
          [0 - halfWidth, 0 - halfHeight],
          [0 + halfWidth, 0 - halfHeight],
          [0 + halfWidth, 0 + halfHeight],
          [0 - halfWidth, 0 + halfHeight]
        ];
        points2.forEach(([x2, y]) => {
          const [targetX, targetY] = getRotatePos(x2, y);
          left = Math.min(left, targetX);
          right = Math.max(right, targetX);
          top = Math.min(top, targetY);
          bottom = Math.max(bottom, targetY);
        });
        const cutLeft = left + realMaxSize / 2;
        const cutTop = top + realMaxSize / 2;
        const cutWidth = right - left;
        const cutHeight = bottom - top;
        const realGapX = gapX * ratio;
        const realGapY = gapY * ratio;
        const filledWidth = (cutWidth + realGapX) * 2;
        const filledHeight = cutHeight + realGapY;
        const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
        function drawImg(targetX = 0, targetY = 0) {
          fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY, cutWidth, cutHeight);
        }
        drawImg();
        drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
        drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
        return [fCanvas.toDataURL(), filledWidth / ratio, filledHeight / ratio];
      }
      return getClips;
    }
    const __default__$b = /* @__PURE__ */ defineComponent({
      name: "ElWatermark"
    });
    const _sfc_main$k = /* @__PURE__ */ defineComponent({
      ...__default__$b,
      props: watermarkProps,
      setup(__props) {
        const props2 = __props;
        const style = {
          position: "relative"
        };
        const color2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.color) != null ? _b2 : "rgba(0,0,0,.15)";
        });
        const fontSize2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.fontSize) != null ? _b2 : 16;
        });
        const fontWeight2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.fontWeight) != null ? _b2 : "normal";
        });
        const fontStyle2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.fontStyle) != null ? _b2 : "normal";
        });
        const fontFamily2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.fontFamily) != null ? _b2 : "sans-serif";
        });
        const textAlign2 = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.textAlign) != null ? _b2 : "center";
        });
        const textBaseline = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.font) == null ? void 0 : _a2.textBaseline) != null ? _b2 : "hanging";
        });
        const gapX = computed(() => props2.gap[0]);
        const gapY = computed(() => props2.gap[1]);
        const gapXCenter = computed(() => gapX.value / 2);
        const gapYCenter = computed(() => gapY.value / 2);
        const offsetLeft = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.offset) == null ? void 0 : _a2[0]) != null ? _b2 : gapXCenter.value;
        });
        const offsetTop = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.offset) == null ? void 0 : _a2[1]) != null ? _b2 : gapYCenter.value;
        });
        const getMarkStyle = () => {
          const markStyle = {
            zIndex: props2.zIndex,
            position: "absolute",
            left: 0,
            top: 0,
            width: "100%",
            height: "100%",
            pointerEvents: "none",
            backgroundRepeat: "repeat"
          };
          let positionLeft = offsetLeft.value - gapXCenter.value;
          let positionTop = offsetTop.value - gapYCenter.value;
          if (positionLeft > 0) {
            markStyle.left = `${positionLeft}px`;
            markStyle.width = `calc(100% - ${positionLeft}px)`;
            positionLeft = 0;
          }
          if (positionTop > 0) {
            markStyle.top = `${positionTop}px`;
            markStyle.height = `calc(100% - ${positionTop}px)`;
            positionTop = 0;
          }
          markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
          return markStyle;
        };
        const containerRef = shallowRef(null);
        const watermarkRef = shallowRef();
        const stopObservation = ref(false);
        const destroyWatermark = () => {
          if (watermarkRef.value) {
            watermarkRef.value.remove();
            watermarkRef.value = void 0;
          }
        };
        const appendWatermark = (base64Url, markWidth) => {
          var _a2;
          if (containerRef.value && watermarkRef.value) {
            stopObservation.value = true;
            watermarkRef.value.setAttribute("style", getStyleStr({
              ...getMarkStyle(),
              backgroundImage: `url('${base64Url}')`,
              backgroundSize: `${Math.floor(markWidth)}px`
            }));
            (_a2 = containerRef.value) == null ? void 0 : _a2.append(watermarkRef.value);
            setTimeout(() => {
              stopObservation.value = false;
            });
          }
        };
        const getMarkSize = (ctx) => {
          let defaultWidth = 120;
          let defaultHeight = 64;
          const { image: image2, content: content2, width, height, rotate: rotate2 } = props2;
          if (!image2 && ctx.measureText) {
            ctx.font = `${Number(fontSize2.value)}px ${fontFamily2.value}`;
            const contents = isArray$5(content2) ? content2 : [content2];
            let maxWidth = 0;
            let maxHeight = 0;
            contents.forEach((item) => {
              const {
                width: width2,
                fontBoundingBoxAscent,
                fontBoundingBoxDescent,
                actualBoundingBoxAscent,
                actualBoundingBoxDescent
              } = ctx.measureText(item);
              const height2 = isUndefined$1(fontBoundingBoxAscent) ? actualBoundingBoxAscent + actualBoundingBoxDescent : fontBoundingBoxAscent + fontBoundingBoxDescent;
              if (width2 > maxWidth)
                maxWidth = Math.ceil(width2);
              if (height2 > maxHeight)
                maxHeight = Math.ceil(height2);
            });
            defaultWidth = maxWidth;
            defaultHeight = maxHeight * contents.length + (contents.length - 1) * FontGap;
            const angle2 = Math.PI / 180 * Number(rotate2);
            const space = Math.ceil(Math.abs(Math.sin(angle2) * defaultHeight) / 2);
            defaultWidth += space;
          }
          return [width != null ? width : defaultWidth, height != null ? height : defaultHeight];
        };
        const getClips = useClips();
        const renderWatermark = () => {
          const canvas = document.createElement("canvas");
          const ctx = canvas.getContext("2d");
          const image2 = props2.image;
          const content2 = props2.content;
          const rotate2 = props2.rotate;
          if (ctx) {
            if (!watermarkRef.value) {
              watermarkRef.value = document.createElement("div");
            }
            const ratio = getPixelRatio();
            const [markWidth, markHeight] = getMarkSize(ctx);
            const drawCanvas = (drawContent) => {
              const [textClips, clipWidth] = getClips(drawContent || "", rotate2, ratio, markWidth, markHeight, {
                color: color2.value,
                fontSize: fontSize2.value,
                fontStyle: fontStyle2.value,
                fontWeight: fontWeight2.value,
                fontFamily: fontFamily2.value,
                textAlign: textAlign2.value,
                textBaseline: textBaseline.value
              }, gapX.value, gapY.value);
              appendWatermark(textClips, clipWidth);
            };
            if (image2) {
              const img = new Image();
              img.onload = () => {
                drawCanvas(img);
              };
              img.onerror = () => {
                drawCanvas(content2);
              };
              img.crossOrigin = "anonymous";
              img.referrerPolicy = "no-referrer";
              img.src = image2;
            } else {
              drawCanvas(content2);
            }
          }
        };
        onMounted(() => {
          renderWatermark();
        });
        watch(() => props2, () => {
          renderWatermark();
        }, {
          deep: true,
          flush: "post"
        });
        onBeforeUnmount(() => {
          destroyWatermark();
        });
        const onMutate = (mutations) => {
          if (stopObservation.value) {
            return;
          }
          mutations.forEach((mutation) => {
            if (reRendering(mutation, watermarkRef.value)) {
              destroyWatermark();
              renderWatermark();
            }
          });
        };
        useMutationObserver(containerRef, onMutate, {
          attributes: true,
          subtree: true,
          childList: true
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "containerRef",
            ref: containerRef,
            style: normalizeStyle$1([style])
          }, [
            renderSlot(_ctx.$slots, "default")
          ], 4);
        };
      }
    });
    var Watermark = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "watermark.vue"]]);
    const ElWatermark = withInstall(Watermark);
    const maskProps = buildProps({
      zIndex: {
        type: Number,
        default: 1001
      },
      visible: Boolean,
      fill: {
        type: String,
        default: "rgba(0,0,0,0.5)"
      },
      pos: {
        type: definePropType(Object)
      },
      targetAreaClickable: {
        type: Boolean,
        default: true
      }
    });
    const useTarget = (target, open2, gap, mergedMask, scrollIntoViewOptions) => {
      const posInfo = ref(null);
      const getTargetEl = () => {
        let targetEl;
        if (isString$3(target.value)) {
          targetEl = document.querySelector(target.value);
        } else if (isFunction$4(target.value)) {
          targetEl = target.value();
        } else {
          targetEl = target.value;
        }
        return targetEl;
      };
      const updatePosInfo = () => {
        const targetEl = getTargetEl();
        if (!targetEl || !open2.value) {
          posInfo.value = null;
          return;
        }
        if (!isInViewPort(targetEl)) {
          targetEl.scrollIntoView(scrollIntoViewOptions.value);
        }
        const { left, top, width, height } = targetEl.getBoundingClientRect();
        posInfo.value = {
          left,
          top,
          width,
          height,
          radius: 0
        };
      };
      onMounted(() => {
        watch([open2, target], () => {
          updatePosInfo();
        }, {
          immediate: true
        });
        window.addEventListener("resize", updatePosInfo);
      });
      onBeforeUnmount(() => {
        window.removeEventListener("resize", updatePosInfo);
      });
      const getGapOffset = (index) => {
        var _a2;
        return (_a2 = isArray$5(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) != null ? _a2 : 6;
      };
      const mergedPosInfo = computed(() => {
        var _a2;
        if (!posInfo.value)
          return posInfo.value;
        const gapOffsetX = getGapOffset(0);
        const gapOffsetY = getGapOffset(1);
        const gapRadius = ((_a2 = gap.value) == null ? void 0 : _a2.radius) || 2;
        return {
          left: posInfo.value.left - gapOffsetX,
          top: posInfo.value.top - gapOffsetY,
          width: posInfo.value.width + gapOffsetX * 2,
          height: posInfo.value.height + gapOffsetY * 2,
          radius: gapRadius
        };
      });
      const triggerTarget = computed(() => {
        const targetEl = getTargetEl();
        if (!mergedMask.value || !targetEl || !window.DOMRect) {
          return targetEl || void 0;
        }
        return {
          getBoundingClientRect() {
            var _a2, _b2, _c2, _d;
            return window.DOMRect.fromRect({
              width: ((_a2 = mergedPosInfo.value) == null ? void 0 : _a2.width) || 0,
              height: ((_b2 = mergedPosInfo.value) == null ? void 0 : _b2.height) || 0,
              x: ((_c2 = mergedPosInfo.value) == null ? void 0 : _c2.left) || 0,
              y: ((_d = mergedPosInfo.value) == null ? void 0 : _d.top) || 0
            });
          }
        };
      });
      return {
        mergedPosInfo,
        triggerTarget
      };
    };
    const tourKey = Symbol("ElTour");
    function isInViewPort(element) {
      const viewWidth = window.innerWidth || document.documentElement.clientWidth;
      const viewHeight = window.innerHeight || document.documentElement.clientHeight;
      const { top, right, bottom, left } = element.getBoundingClientRect();
      return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight;
    }
    const useFloating = (referenceRef, contentRef, arrowRef, placement, strategy, offset$12, zIndex2, showArrow) => {
      const x2 = ref();
      const y = ref();
      const middlewareData = ref({});
      const states = {
        x: x2,
        y,
        placement,
        strategy,
        middlewareData
      };
      const middleware = computed(() => {
        const _middleware = [
          offset(unref(offset$12)),
          flip(),
          shift(),
          overflowMiddleware()
        ];
        if (unref(showArrow) && unref(arrowRef)) {
          _middleware.push(arrow({
            element: unref(arrowRef)
          }));
        }
        return _middleware;
      });
      const update = async () => {
        if (!isClient)
          return;
        const referenceEl = unref(referenceRef);
        const contentEl = unref(contentRef);
        if (!referenceEl || !contentEl)
          return;
        const data = await computePosition(referenceEl, contentEl, {
          placement: unref(placement),
          strategy: unref(strategy),
          middleware: unref(middleware)
        });
        keysOf(states).forEach((key) => {
          states[key].value = data[key];
        });
      };
      const contentStyle = computed(() => {
        if (!unref(referenceRef)) {
          return {
            position: "fixed",
            top: "50%",
            left: "50%",
            transform: "translate3d(-50%, -50%, 0)",
            maxWidth: "100vw",
            zIndex: unref(zIndex2)
          };
        }
        const { overflow: overflow2 } = unref(middlewareData);
        return {
          position: unref(strategy),
          zIndex: unref(zIndex2),
          top: unref(y) != null ? `${unref(y)}px` : "",
          left: unref(x2) != null ? `${unref(x2)}px` : "",
          maxWidth: (overflow2 == null ? void 0 : overflow2.maxWidth) ? `${overflow2 == null ? void 0 : overflow2.maxWidth}px` : ""
        };
      });
      const arrowStyle = computed(() => {
        if (!unref(showArrow))
          return {};
        const { arrow: arrow2 } = unref(middlewareData);
        return {
          left: (arrow2 == null ? void 0 : arrow2.x) != null ? `${arrow2 == null ? void 0 : arrow2.x}px` : "",
          top: (arrow2 == null ? void 0 : arrow2.y) != null ? `${arrow2 == null ? void 0 : arrow2.y}px` : ""
        };
      });
      let cleanup;
      onMounted(() => {
        const referenceEl = unref(referenceRef);
        const contentEl = unref(contentRef);
        if (referenceEl && contentEl) {
          cleanup = autoUpdate(referenceEl, contentEl, update);
        }
        watchEffect(() => {
          update();
        });
      });
      onBeforeUnmount(() => {
        cleanup && cleanup();
      });
      return {
        update,
        contentStyle,
        arrowStyle
      };
    };
    const overflowMiddleware = () => {
      return {
        name: "overflow",
        async fn(state) {
          const overflow2 = await detectOverflow(state);
          let overWidth = 0;
          if (overflow2.left > 0)
            overWidth = overflow2.left;
          if (overflow2.right > 0)
            overWidth = overflow2.right;
          const floatingWidth = state.rects.floating.width;
          return {
            data: {
              maxWidth: floatingWidth - overWidth
            }
          };
        }
      };
    };
    const __default__$a = /* @__PURE__ */ defineComponent({
      name: "ElTourMask",
      inheritAttrs: false
    });
    const _sfc_main$j = /* @__PURE__ */ defineComponent({
      ...__default__$a,
      props: maskProps,
      setup(__props) {
        const props2 = __props;
        const { ns } = inject(tourKey);
        const radius = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.pos) == null ? void 0 : _a2.radius) != null ? _b2 : 2;
        });
        const roundInfo = computed(() => {
          const v4 = radius.value;
          const baseInfo = `a${v4},${v4} 0 0 1`;
          return {
            topRight: `${baseInfo} ${v4},${v4}`,
            bottomRight: `${baseInfo} ${-v4},${v4}`,
            bottomLeft: `${baseInfo} ${-v4},${-v4}`,
            topLeft: `${baseInfo} ${v4},${-v4}`
          };
        });
        const path = computed(() => {
          const width = window.innerWidth;
          const height = window.innerHeight;
          const info = roundInfo.value;
          const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`;
          const _radius = radius.value;
          return props2.pos ? `${_path} M${props2.pos.left + _radius},${props2.pos.top} h${props2.pos.width - _radius * 2} ${info.topRight} v${props2.pos.height - _radius * 2} ${info.bottomRight} h${-props2.pos.width + _radius * 2} ${info.bottomLeft} v${-props2.pos.height + _radius * 2} ${info.topLeft} z` : _path;
        });
        const pathStyle = computed(() => {
          return {
            fill: props2.fill,
            pointerEvents: "auto",
            cursor: "auto"
          };
        });
        useLockscreen(toRef(props2, "visible"), {
          ns
        });
        return (_ctx, _cache) => {
          return _ctx.visible ? (openBlock(), createElementBlock("div", mergeProps({
            key: 0,
            class: unref(ns).e("mask"),
            style: {
              position: "fixed",
              left: 0,
              right: 0,
              top: 0,
              bottom: 0,
              zIndex: _ctx.zIndex,
              pointerEvents: _ctx.pos && _ctx.targetAreaClickable ? "none" : "auto"
            }
          }, _ctx.$attrs), [
            (openBlock(), createElementBlock("svg", { style: {
              width: "100%",
              height: "100%"
            } }, [
              createBaseVNode("path", {
                class: normalizeClass(unref(ns).e("hollow")),
                style: normalizeStyle$1(unref(pathStyle)),
                d: unref(path)
              }, null, 14, ["d"])
            ]))
          ], 16)) : createCommentVNode("v-if", true);
        };
      }
    });
    var ElTourMask = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "mask.vue"]]);
    const tourStrategies = ["absolute", "fixed"];
    const tourPlacements = [
      "top-start",
      "top-end",
      "top",
      "bottom-start",
      "bottom-end",
      "bottom",
      "left-start",
      "left-end",
      "left",
      "right-start",
      "right-end",
      "right"
    ];
    const tourContentProps = buildProps({
      placement: {
        type: definePropType(String),
        values: tourPlacements,
        default: "bottom"
      },
      reference: {
        type: definePropType(Object),
        default: null
      },
      strategy: {
        type: definePropType(String),
        values: tourStrategies,
        default: "absolute"
      },
      offset: {
        type: Number,
        default: 10
      },
      showArrow: Boolean,
      zIndex: {
        type: Number,
        default: 2001
      }
    });
    const tourContentEmits = {
      close: () => true
    };
    const __default__$9 = /* @__PURE__ */ defineComponent({
      name: "ElTourContent"
    });
    const _sfc_main$i = /* @__PURE__ */ defineComponent({
      ...__default__$9,
      props: tourContentProps,
      emits: tourContentEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const placement = ref(props2.placement);
        const strategy = ref(props2.strategy);
        const contentRef = ref(null);
        const arrowRef = ref(null);
        watch(() => props2.placement, () => {
          placement.value = props2.placement;
        });
        const { contentStyle, arrowStyle } = useFloating(toRef(props2, "reference"), contentRef, arrowRef, placement, strategy, toRef(props2, "offset"), toRef(props2, "zIndex"), toRef(props2, "showArrow"));
        const side = computed(() => {
          return placement.value.split("-")[0];
        });
        const { ns } = inject(tourKey);
        const onCloseRequested = () => {
          emit2("close");
        };
        const onFocusoutPrevented = (event) => {
          if (event.detail.focusReason === "pointer") {
            event.preventDefault();
          }
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "contentRef",
            ref: contentRef,
            style: normalizeStyle$1(unref(contentStyle)),
            class: normalizeClass(unref(ns).e("content")),
            "data-side": unref(side),
            tabindex: "-1"
          }, [
            createVNode$1(unref(ElFocusTrap), {
              loop: "",
              trapped: "",
              "focus-start-el": "container",
              "focus-trap-el": contentRef.value || void 0,
              onReleaseRequested: onCloseRequested,
              onFocusoutPrevented
            }, {
              default: withCtx(() => [
                renderSlot(_ctx.$slots, "default")
              ]),
              _: 3
            }, 8, ["focus-trap-el"]),
            _ctx.showArrow ? (openBlock(), createElementBlock("span", {
              key: 0,
              ref_key: "arrowRef",
              ref: arrowRef,
              style: normalizeStyle$1(unref(arrowStyle)),
              class: normalizeClass(unref(ns).e("arrow"))
            }, null, 6)) : createCommentVNode("v-if", true)
          ], 14, ["data-side"]);
        };
      }
    });
    var ElTourContent = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "content.vue"]]);
    var ElTourSteps = /* @__PURE__ */ defineComponent({
      name: "ElTourSteps",
      props: {
        current: {
          type: Number,
          default: 0
        }
      },
      emits: ["update-total"],
      setup(props2, { slots, emit: emit2 }) {
        let cacheTotal = 0;
        return () => {
          var _a2, _b2;
          const children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
          const result = [];
          let total2 = 0;
          function filterSteps(children2) {
            if (!isArray$5(children2))
              return;
            children2.forEach((item) => {
              var _a22;
              const name = (_a22 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a22.name;
              if (name === "ElTourStep") {
                result.push(item);
                total2 += 1;
              }
            });
          }
          if (children.length) {
            filterSteps(flattedChildren((_b2 = children[0]) == null ? void 0 : _b2.children));
          }
          if (cacheTotal !== total2) {
            cacheTotal = total2;
            emit2("update-total", total2);
          }
          if (result.length) {
            return result[props2.current];
          }
          return null;
        };
      }
    });
    const tourProps = buildProps({
      modelValue: Boolean,
      current: {
        type: Number,
        default: 0
      },
      showArrow: {
        type: Boolean,
        default: true
      },
      showClose: {
        type: Boolean,
        default: true
      },
      closeIcon: {
        type: iconPropType
      },
      placement: tourContentProps.placement,
      contentStyle: {
        type: definePropType([Object])
      },
      mask: {
        type: definePropType([Boolean, Object]),
        default: true
      },
      gap: {
        type: definePropType(Object),
        default: () => ({
          offset: 6,
          radius: 2
        })
      },
      zIndex: {
        type: Number
      },
      scrollIntoViewOptions: {
        type: definePropType([Boolean, Object]),
        default: () => ({
          block: "center"
        })
      },
      type: {
        type: definePropType(String)
      },
      appendTo: {
        type: teleportProps.to.type,
        default: "body"
      },
      closeOnPressEscape: {
        type: Boolean,
        default: true
      },
      targetAreaClickable: {
        type: Boolean,
        default: true
      }
    });
    const tourEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isBoolean$1(value),
      ["update:current"]: (current) => isNumber$2(current),
      close: (current) => isNumber$2(current),
      finish: () => true,
      change: (current) => isNumber$2(current)
    };
    const __default__$8 = /* @__PURE__ */ defineComponent({
      name: "ElTour"
    });
    const _sfc_main$h = /* @__PURE__ */ defineComponent({
      ...__default__$8,
      props: tourProps,
      emits: tourEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("tour");
        const total2 = ref(0);
        const currentStep = ref();
        const current = useVModel(props2, "current", emit2, {
          passive: true
        });
        const currentTarget = computed(() => {
          var _a2;
          return (_a2 = currentStep.value) == null ? void 0 : _a2.target;
        });
        const kls = computed(() => [
          ns.b(),
          mergedType.value === "primary" ? ns.m("primary") : ""
        ]);
        const mergedPlacement = computed(() => {
          var _a2;
          return ((_a2 = currentStep.value) == null ? void 0 : _a2.placement) || props2.placement;
        });
        const mergedContentStyle = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = currentStep.value) == null ? void 0 : _a2.contentStyle) != null ? _b2 : props2.contentStyle;
        });
        const mergedMask = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = currentStep.value) == null ? void 0 : _a2.mask) != null ? _b2 : props2.mask;
        });
        const mergedShowMask = computed(() => !!mergedMask.value && props2.modelValue);
        const mergedMaskStyle = computed(() => isBoolean$1(mergedMask.value) ? void 0 : mergedMask.value);
        const mergedShowArrow = computed(() => {
          var _a2, _b2;
          return !!currentTarget.value && ((_b2 = (_a2 = currentStep.value) == null ? void 0 : _a2.showArrow) != null ? _b2 : props2.showArrow);
        });
        const mergedScrollIntoViewOptions = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = currentStep.value) == null ? void 0 : _a2.scrollIntoViewOptions) != null ? _b2 : props2.scrollIntoViewOptions;
        });
        const mergedType = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = currentStep.value) == null ? void 0 : _a2.type) != null ? _b2 : props2.type;
        });
        const { nextZIndex } = useZIndex();
        const nowZIndex = nextZIndex();
        const mergedZIndex = computed(() => {
          var _a2;
          return (_a2 = props2.zIndex) != null ? _a2 : nowZIndex;
        });
        const { mergedPosInfo: pos, triggerTarget } = useTarget(currentTarget, toRef(props2, "modelValue"), toRef(props2, "gap"), mergedMask, mergedScrollIntoViewOptions);
        watch(() => props2.modelValue, (val) => {
          if (!val) {
            current.value = 0;
          }
        });
        const onEscClose = () => {
          if (props2.closeOnPressEscape) {
            emit2(UPDATE_MODEL_EVENT, false);
            emit2("close", current.value);
          }
        };
        const onUpdateTotal = (val) => {
          total2.value = val;
        };
        const slots = useSlots();
        provide(tourKey, {
          currentStep,
          current,
          total: total2,
          showClose: toRef(props2, "showClose"),
          closeIcon: toRef(props2, "closeIcon"),
          mergedType,
          ns,
          slots,
          updateModelValue(modelValue) {
            emit2(UPDATE_MODEL_EVENT, modelValue);
          },
          onClose() {
            emit2("close", current.value);
          },
          onFinish() {
            emit2("finish");
          },
          onChange() {
            emit2(CHANGE_EVENT, current.value);
          }
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock(Fragment, null, [
            createVNode$1(unref(ElTeleport), { to: _ctx.appendTo }, {
              default: withCtx(() => {
                var _a2, _b2;
                return [
                  createBaseVNode("div", mergeProps({ class: unref(kls) }, _ctx.$attrs), [
                    createVNode$1(ElTourMask, {
                      visible: unref(mergedShowMask),
                      fill: (_a2 = unref(mergedMaskStyle)) == null ? void 0 : _a2.color,
                      style: normalizeStyle$1((_b2 = unref(mergedMaskStyle)) == null ? void 0 : _b2.style),
                      pos: unref(pos),
                      "z-index": unref(mergedZIndex),
                      "target-area-clickable": _ctx.targetAreaClickable
                    }, null, 8, ["visible", "fill", "style", "pos", "z-index", "target-area-clickable"]),
                    _ctx.modelValue ? (openBlock(), createBlock(ElTourContent, {
                      key: unref(current),
                      reference: unref(triggerTarget),
                      placement: unref(mergedPlacement),
                      "show-arrow": unref(mergedShowArrow),
                      "z-index": unref(mergedZIndex),
                      style: normalizeStyle$1(unref(mergedContentStyle)),
                      onClose: onEscClose
                    }, {
                      default: withCtx(() => [
                        createVNode$1(unref(ElTourSteps), {
                          current: unref(current),
                          onUpdateTotal
                        }, {
                          default: withCtx(() => [
                            renderSlot(_ctx.$slots, "default")
                          ]),
                          _: 3
                        }, 8, ["current"])
                      ]),
                      _: 3
                    }, 8, ["reference", "placement", "show-arrow", "z-index", "style"])) : createCommentVNode("v-if", true)
                  ], 16)
                ];
              }),
              _: 3
            }, 8, ["to"]),
            createCommentVNode(" just for IDE "),
            createCommentVNode("v-if", true)
          ], 64);
        };
      }
    });
    var Tour = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "tour.vue"]]);
    const tourStepProps = buildProps({
      target: {
        type: definePropType([String, Object, Function])
      },
      title: String,
      description: String,
      showClose: {
        type: Boolean,
        default: void 0
      },
      closeIcon: {
        type: iconPropType
      },
      showArrow: {
        type: Boolean,
        default: void 0
      },
      placement: tourContentProps.placement,
      mask: {
        type: definePropType([Boolean, Object]),
        default: void 0
      },
      contentStyle: {
        type: definePropType([Object])
      },
      prevButtonProps: {
        type: definePropType(Object)
      },
      nextButtonProps: {
        type: definePropType(Object)
      },
      scrollIntoViewOptions: {
        type: definePropType([Boolean, Object]),
        default: void 0
      },
      type: {
        type: definePropType(String)
      }
    });
    const tourStepEmits = {
      close: () => true
    };
    const __default__$7 = /* @__PURE__ */ defineComponent({
      name: "ElTourStep"
    });
    const _sfc_main$g = /* @__PURE__ */ defineComponent({
      ...__default__$7,
      props: tourStepProps,
      emits: tourStepEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const { Close } = CloseComponents;
        const { t } = useLocale();
        const {
          currentStep,
          current,
          total: total2,
          showClose,
          closeIcon,
          mergedType,
          ns,
          slots: tourSlots,
          updateModelValue,
          onClose: tourOnClose,
          onFinish: tourOnFinish,
          onChange
        } = inject(tourKey);
        watch(props2, (val) => {
          currentStep.value = val;
        }, {
          immediate: true
        });
        const mergedShowClose = computed(() => {
          var _a2;
          return (_a2 = props2.showClose) != null ? _a2 : showClose.value;
        });
        const mergedCloseIcon = computed(() => {
          var _a2, _b2;
          return (_b2 = (_a2 = props2.closeIcon) != null ? _a2 : closeIcon.value) != null ? _b2 : Close;
        });
        const filterButtonProps = (btnProps) => {
          if (!btnProps)
            return;
          return omit(btnProps, ["children", "onClick"]);
        };
        const onPrev = () => {
          var _a2, _b2;
          current.value -= 1;
          if ((_a2 = props2.prevButtonProps) == null ? void 0 : _a2.onClick) {
            (_b2 = props2.prevButtonProps) == null ? void 0 : _b2.onClick();
          }
          onChange();
        };
        const onNext = () => {
          var _a2;
          if (current.value >= total2.value - 1) {
            onFinish();
          } else {
            current.value += 1;
          }
          if ((_a2 = props2.nextButtonProps) == null ? void 0 : _a2.onClick) {
            props2.nextButtonProps.onClick();
          }
          onChange();
        };
        const onFinish = () => {
          onClose();
          tourOnFinish();
        };
        const onClose = () => {
          updateModelValue(false);
          tourOnClose();
          emit2("close");
        };
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock(Fragment, null, [
            unref(mergedShowClose) ? (openBlock(), createElementBlock("button", {
              key: 0,
              "aria-label": "Close",
              class: normalizeClass(unref(ns).e("closebtn")),
              type: "button",
              onClick: onClose
            }, [
              createVNode$1(unref(ElIcon), {
                class: normalizeClass(unref(ns).e("close"))
              }, {
                default: withCtx(() => [
                  (openBlock(), createBlock(resolveDynamicComponent(unref(mergedCloseIcon))))
                ]),
                _: 1
              }, 8, ["class"])
            ], 2)) : createCommentVNode("v-if", true),
            createBaseVNode("header", {
              class: normalizeClass([unref(ns).e("header"), { "show-close": unref(showClose) }])
            }, [
              renderSlot(_ctx.$slots, "header", {}, () => [
                createBaseVNode("span", {
                  role: "heading",
                  class: normalizeClass(unref(ns).e("title"))
                }, toDisplayString(_ctx.title), 3)
              ])
            ], 2),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("body"))
            }, [
              renderSlot(_ctx.$slots, "default", {}, () => [
                createBaseVNode("span", null, toDisplayString(_ctx.description), 1)
              ])
            ], 2),
            createBaseVNode("footer", {
              class: normalizeClass(unref(ns).e("footer"))
            }, [
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).b("indicators"))
              }, [
                unref(tourSlots).indicators ? (openBlock(), createBlock(resolveDynamicComponent(unref(tourSlots).indicators), {
                  key: 0,
                  current: unref(current),
                  total: unref(total2)
                }, null, 8, ["current", "total"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(total2), (item, index) => {
                  return openBlock(), createElementBlock("span", {
                    key: item,
                    class: normalizeClass([unref(ns).b("indicator"), index === unref(current) ? "is-active" : ""])
                  }, null, 2);
                }), 128))
              ], 2),
              createBaseVNode("div", {
                class: normalizeClass(unref(ns).b("buttons"))
              }, [
                unref(current) > 0 ? (openBlock(), createBlock(unref(ElButton), mergeProps({
                  key: 0,
                  size: "small",
                  type: unref(mergedType)
                }, filterButtonProps(_ctx.prevButtonProps), { onClick: onPrev }), {
                  default: withCtx(() => {
                    var _a2, _b2;
                    return [
                      createTextVNode(toDisplayString((_b2 = (_a2 = _ctx.prevButtonProps) == null ? void 0 : _a2.children) != null ? _b2 : unref(t)("el.tour.previous")), 1)
                    ];
                  }),
                  _: 1
                }, 16, ["type"])) : createCommentVNode("v-if", true),
                unref(current) <= unref(total2) - 1 ? (openBlock(), createBlock(unref(ElButton), mergeProps({
                  key: 1,
                  size: "small",
                  type: unref(mergedType) === "primary" ? "default" : "primary"
                }, filterButtonProps(_ctx.nextButtonProps), { onClick: onNext }), {
                  default: withCtx(() => {
                    var _a2, _b2;
                    return [
                      createTextVNode(toDisplayString((_b2 = (_a2 = _ctx.nextButtonProps) == null ? void 0 : _a2.children) != null ? _b2 : unref(current) === unref(total2) - 1 ? unref(t)("el.tour.finish") : unref(t)("el.tour.next")), 1)
                    ];
                  }),
                  _: 1
                }, 16, ["type"])) : createCommentVNode("v-if", true)
              ], 2)
            ], 2)
          ], 64);
        };
      }
    });
    var TourStep = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "step.vue"]]);
    const ElTour = withInstall(Tour, {
      TourStep
    });
    const ElTourStep = withNoopInstall(TourStep);
    const anchorProps = buildProps({
      container: {
        type: definePropType([
          String,
          Object
        ])
      },
      offset: {
        type: Number,
        default: 0
      },
      bound: {
        type: Number,
        default: 15
      },
      duration: {
        type: Number,
        default: 300
      },
      marker: {
        type: Boolean,
        default: true
      },
      type: {
        type: definePropType(String),
        default: "default"
      },
      direction: {
        type: definePropType(String),
        default: "vertical"
      },
      selectScrollTop: {
        type: Boolean,
        default: false
      }
    });
    const anchorEmits = {
      change: (href) => isString$3(href),
      click: (e2, href) => e2 instanceof MouseEvent && (isString$3(href) || isUndefined$1(href))
    };
    const anchorKey = Symbol("anchor");
    const getElement = (target) => {
      if (!isClient || target === "")
        return null;
      if (isString$3(target)) {
        try {
          return document.querySelector(target);
        } catch (e2) {
          return null;
        }
      }
      return target;
    };
    function throttleByRaf(cb) {
      let timer = 0;
      const throttle2 = (...args) => {
        if (timer) {
          cAF(timer);
        }
        timer = rAF(() => {
          cb(...args);
          timer = 0;
        });
      };
      throttle2.cancel = () => {
        cAF(timer);
        timer = 0;
      };
      return throttle2;
    }
    const __default__$6 = /* @__PURE__ */ defineComponent({
      name: "ElAnchor"
    });
    const _sfc_main$f = /* @__PURE__ */ defineComponent({
      ...__default__$6,
      props: anchorProps,
      emits: anchorEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const currentAnchor = ref("");
        const anchorRef = ref(null);
        const markerRef = ref(null);
        const containerEl = ref();
        const links = {};
        let isScrolling = false;
        let currentScrollTop = 0;
        const ns = useNamespace("anchor");
        const cls = computed(() => [
          ns.b(),
          props2.type === "underline" ? ns.m("underline") : "",
          ns.m(props2.direction)
        ]);
        const addLink = (state) => {
          links[state.href] = state.el;
        };
        const removeLink = (href) => {
          delete links[href];
        };
        const setCurrentAnchor = (href) => {
          const activeHref = currentAnchor.value;
          if (activeHref !== href) {
            currentAnchor.value = href;
            emit2(CHANGE_EVENT, href);
          }
        };
        let clearAnimate = null;
        const scrollToAnchor = (href) => {
          if (!containerEl.value)
            return;
          const target = getElement(href);
          if (!target)
            return;
          if (clearAnimate)
            clearAnimate();
          isScrolling = true;
          const scrollEle = getScrollElement(target, containerEl.value);
          const distance2 = getOffsetTopDistance(target, scrollEle);
          const max3 = scrollEle.scrollHeight - scrollEle.clientHeight;
          const to = Math.min(distance2 - props2.offset, max3);
          clearAnimate = animateScrollTo(containerEl.value, currentScrollTop, to, props2.duration, () => {
            setTimeout(() => {
              isScrolling = false;
            }, 20);
          });
        };
        const scrollTo = (href) => {
          if (href) {
            setCurrentAnchor(href);
            scrollToAnchor(href);
          }
        };
        const handleClick = (e2, href) => {
          emit2("click", e2, href);
          scrollTo(href);
        };
        const handleScroll2 = throttleByRaf(() => {
          if (containerEl.value) {
            currentScrollTop = getScrollTop(containerEl.value);
          }
          const currentHref = getCurrentHref();
          if (isScrolling || isUndefined$1(currentHref))
            return;
          setCurrentAnchor(currentHref);
        });
        const getCurrentHref = () => {
          if (!containerEl.value)
            return;
          const scrollTop = getScrollTop(containerEl.value);
          const anchorTopList = [];
          for (const href of Object.keys(links)) {
            const target = getElement(href);
            if (!target)
              continue;
            const scrollEle = getScrollElement(target, containerEl.value);
            const distance2 = getOffsetTopDistance(target, scrollEle);
            anchorTopList.push({
              top: distance2 - props2.offset - props2.bound,
              href
            });
          }
          anchorTopList.sort((prev, next) => prev.top - next.top);
          for (let i2 = 0; i2 < anchorTopList.length; i2++) {
            const item = anchorTopList[i2];
            const next = anchorTopList[i2 + 1];
            if (i2 === 0 && scrollTop === 0) {
              return props2.selectScrollTop ? item.href : "";
            }
            if (item.top <= scrollTop && (!next || next.top > scrollTop)) {
              return item.href;
            }
          }
        };
        const getContainer = () => {
          const el = getElement(props2.container);
          if (!el || isWindow(el)) {
            containerEl.value = window;
          } else {
            containerEl.value = el;
          }
        };
        useEventListener(containerEl, "scroll", handleScroll2);
        const markerStyle = computed(() => {
          if (!anchorRef.value || !markerRef.value || !currentAnchor.value)
            return {};
          const currentLinkEl = links[currentAnchor.value];
          if (!currentLinkEl)
            return {};
          const anchorRect = anchorRef.value.getBoundingClientRect();
          const markerRect = markerRef.value.getBoundingClientRect();
          const linkRect = currentLinkEl.getBoundingClientRect();
          if (props2.direction === "horizontal") {
            const left = linkRect.left - anchorRect.left;
            return {
              left: `${left}px`,
              width: `${linkRect.width}px`,
              opacity: 1
            };
          } else {
            const top = linkRect.top - anchorRect.top + (linkRect.height - markerRect.height) / 2;
            return {
              top: `${top}px`,
              opacity: 1
            };
          }
        });
        onMounted(() => {
          getContainer();
          const hash = decodeURIComponent(window.location.hash);
          const target = getElement(hash);
          if (target) {
            scrollTo(hash);
          } else {
            handleScroll2();
          }
        });
        watch(() => props2.container, () => {
          getContainer();
        });
        provide(anchorKey, {
          ns,
          direction: props2.direction,
          currentAnchor,
          addLink,
          removeLink,
          handleClick
        });
        expose({
          scrollTo
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "anchorRef",
            ref: anchorRef,
            class: normalizeClass(unref(cls))
          }, [
            _ctx.marker ? (openBlock(), createElementBlock("div", {
              key: 0,
              ref_key: "markerRef",
              ref: markerRef,
              class: normalizeClass(unref(ns).e("marker")),
              style: normalizeStyle$1(unref(markerStyle))
            }, null, 6)) : createCommentVNode("v-if", true),
            createBaseVNode("div", {
              class: normalizeClass(unref(ns).e("list"))
            }, [
              renderSlot(_ctx.$slots, "default")
            ], 2)
          ], 2);
        };
      }
    });
    var Anchor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "anchor.vue"]]);
    const anchorLinkProps = buildProps({
      title: String,
      href: String
    });
    const __default__$5 = /* @__PURE__ */ defineComponent({
      name: "ElAnchorLink"
    });
    const _sfc_main$e = /* @__PURE__ */ defineComponent({
      ...__default__$5,
      props: anchorLinkProps,
      setup(__props) {
        const props2 = __props;
        const linkRef = ref(null);
        const {
          ns,
          direction: direction2,
          currentAnchor,
          addLink,
          removeLink,
          handleClick: contextHandleClick
        } = inject(anchorKey);
        const cls = computed(() => [
          ns.e("link"),
          ns.is("active", currentAnchor.value === props2.href)
        ]);
        const handleClick = (e2) => {
          contextHandleClick(e2, props2.href);
        };
        watch(() => props2.href, (val, oldVal) => {
          nextTick(() => {
            if (oldVal)
              removeLink(oldVal);
            if (val) {
              addLink({
                href: val,
                el: linkRef.value
              });
            }
          });
        });
        onMounted(() => {
          const { href } = props2;
          if (href) {
            addLink({
              href,
              el: linkRef.value
            });
          }
        });
        onBeforeUnmount(() => {
          const { href } = props2;
          if (href) {
            removeLink(href);
          }
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            class: normalizeClass(unref(ns).e("item"))
          }, [
            createBaseVNode("a", {
              ref_key: "linkRef",
              ref: linkRef,
              class: normalizeClass(unref(cls)),
              href: _ctx.href,
              onClick: handleClick
            }, [
              renderSlot(_ctx.$slots, "default", {}, () => [
                createTextVNode(toDisplayString(_ctx.title), 1)
              ])
            ], 10, ["href"]),
            _ctx.$slots["sub-link"] && unref(direction2) === "vertical" ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).e("list"))
            }, [
              renderSlot(_ctx.$slots, "sub-link")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var AnchorLink = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "anchor-link.vue"]]);
    const ElAnchor = withInstall(Anchor, {
      AnchorLink
    });
    const ElAnchorLink = withNoopInstall(AnchorLink);
    const defaultProps = {
      label: "label",
      value: "value",
      disabled: "disabled"
    };
    const segmentedProps = buildProps({
      direction: {
        type: definePropType(String),
        default: "horizontal"
      },
      options: {
        type: definePropType(Array),
        default: () => []
      },
      modelValue: {
        type: [String, Number, Boolean],
        default: void 0
      },
      props: {
        type: definePropType(Object),
        default: () => defaultProps
      },
      block: Boolean,
      size: useSizeProp,
      disabled: Boolean,
      validateEvent: {
        type: Boolean,
        default: true
      },
      id: String,
      name: String,
      ...useAriaProps(["ariaLabel"])
    });
    const segmentedEmits = {
      [UPDATE_MODEL_EVENT]: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val),
      [CHANGE_EVENT]: (val) => isString$3(val) || isNumber$2(val) || isBoolean$1(val)
    };
    const __default__$4 = /* @__PURE__ */ defineComponent({
      name: "ElSegmented"
    });
    const _sfc_main$d = /* @__PURE__ */ defineComponent({
      ...__default__$4,
      props: segmentedProps,
      emits: segmentedEmits,
      setup(__props, { emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("segmented");
        const segmentedId = useId();
        const segmentedSize = useFormSize();
        const _disabled = useFormDisabled();
        const { formItem } = useFormItem();
        const { inputId, isLabeledByFormItem } = useFormItemInputId(props2, {
          formItemContext: formItem
        });
        const segmentedRef = ref(null);
        const activeElement = useActiveElement();
        const state = reactive({
          isInit: false,
          width: 0,
          height: 0,
          translateX: 0,
          translateY: 0,
          focusVisible: false
        });
        const handleChange = (item) => {
          const value = getValue2(item);
          emit2(UPDATE_MODEL_EVENT, value);
          emit2(CHANGE_EVENT, value);
        };
        const aliasProps = computed(() => ({ ...defaultProps, ...props2.props }));
        const getValue2 = (item) => {
          return isObject$7(item) ? item[aliasProps.value.value] : item;
        };
        const getLabel = (item) => {
          return isObject$7(item) ? item[aliasProps.value.label] : item;
        };
        const getDisabled = (item) => {
          return !!(_disabled.value || (isObject$7(item) ? item[aliasProps.value.disabled] : false));
        };
        const getSelected = (item) => {
          return props2.modelValue === getValue2(item);
        };
        const getOption = (value) => {
          return props2.options.find((item) => getValue2(item) === value);
        };
        const getItemCls = (item) => {
          return [
            ns.e("item"),
            ns.is("selected", getSelected(item)),
            ns.is("disabled", getDisabled(item))
          ];
        };
        const updateSelect = () => {
          if (!segmentedRef.value)
            return;
          const selectedItem = segmentedRef.value.querySelector(".is-selected");
          const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
          if (!selectedItem || !selectedItemInput) {
            state.width = 0;
            state.height = 0;
            state.translateX = 0;
            state.translateY = 0;
            state.focusVisible = false;
            return;
          }
          const rect = selectedItem.getBoundingClientRect();
          state.isInit = true;
          if (props2.direction === "vertical") {
            state.height = rect.height;
            state.translateY = selectedItem.offsetTop;
          } else {
            state.width = rect.width;
            state.translateX = selectedItem.offsetLeft;
          }
          try {
            state.focusVisible = selectedItemInput.matches(":focus-visible");
          } catch (e2) {
          }
        };
        const segmentedCls = computed(() => [
          ns.b(),
          ns.m(segmentedSize.value),
          ns.is("block", props2.block)
        ]);
        const selectedStyle = computed(() => ({
          width: props2.direction === "vertical" ? "100%" : `${state.width}px`,
          height: props2.direction === "vertical" ? `${state.height}px` : "100%",
          transform: props2.direction === "vertical" ? `translateY(${state.translateY}px)` : `translateX(${state.translateX}px)`,
          display: state.isInit ? "block" : "none"
        }));
        const selectedCls = computed(() => [
          ns.e("item-selected"),
          ns.is("disabled", getDisabled(getOption(props2.modelValue))),
          ns.is("focus-visible", state.focusVisible)
        ]);
        const name = computed(() => {
          return props2.name || segmentedId.value;
        });
        useResizeObserver(segmentedRef, updateSelect);
        watch(activeElement, updateSelect);
        watch(() => props2.modelValue, () => {
          var _a2;
          updateSelect();
          if (props2.validateEvent) {
            (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
          }
        }, {
          flush: "post"
        });
        return (_ctx, _cache) => {
          return _ctx.options.length ? (openBlock(), createElementBlock("div", {
            key: 0,
            id: unref(inputId),
            ref_key: "segmentedRef",
            ref: segmentedRef,
            class: normalizeClass(unref(segmentedCls)),
            role: "radiogroup",
            "aria-label": !unref(isLabeledByFormItem) ? _ctx.ariaLabel || "segmented" : void 0,
            "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
          }, [
            createBaseVNode("div", {
              class: normalizeClass([unref(ns).e("group"), unref(ns).m(props2.direction)])
            }, [
              createBaseVNode("div", {
                style: normalizeStyle$1(unref(selectedStyle)),
                class: normalizeClass(unref(selectedCls))
              }, null, 6),
              (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
                return openBlock(), createElementBlock("label", {
                  key: index,
                  class: normalizeClass(getItemCls(item))
                }, [
                  createBaseVNode("input", {
                    class: normalizeClass(unref(ns).e("item-input")),
                    type: "radio",
                    name: unref(name),
                    disabled: getDisabled(item),
                    checked: getSelected(item),
                    onChange: ($event) => handleChange(item)
                  }, null, 42, ["name", "disabled", "checked", "onChange"]),
                  createBaseVNode("div", {
                    class: normalizeClass(unref(ns).e("item-label"))
                  }, [
                    renderSlot(_ctx.$slots, "default", { item }, () => [
                      createTextVNode(toDisplayString(getLabel(item)), 1)
                    ])
                  ], 2)
                ], 2);
              }), 128))
            ], 2)
          ], 10, ["id", "aria-label", "aria-labelledby"])) : createCommentVNode("v-if", true);
        };
      }
    });
    var Segmented = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "segmented.vue"]]);
    const ElSegmented = withInstall(Segmented);
    const filterOption = (pattern, option) => {
      const lowerCase = pattern.toLowerCase();
      const label = option.label || option.value;
      return label.toLowerCase().includes(lowerCase);
    };
    const getMentionCtx = (inputEl, prefix, split2) => {
      const { selectionEnd } = inputEl;
      if (selectionEnd === null)
        return;
      const inputValue = inputEl.value;
      const prefixArray = castArray$1(prefix);
      let splitIndex = -1;
      let mentionCtx;
      for (let i2 = selectionEnd - 1; i2 >= 0; --i2) {
        const char = inputValue[i2];
        if (char === split2 || char === "\n" || char === "\r") {
          splitIndex = i2;
          continue;
        }
        if (prefixArray.includes(char)) {
          const end2 = splitIndex === -1 ? selectionEnd : splitIndex;
          const pattern = inputValue.slice(i2 + 1, end2);
          mentionCtx = {
            pattern,
            start: i2 + 1,
            end: end2,
            prefix: char,
            prefixIndex: i2,
            splitIndex,
            selectionEnd
          };
          break;
        }
      }
      return mentionCtx;
    };
    const getCursorPosition = (element, options = {
      debug: false,
      useSelectionEnd: false
    }) => {
      const selectionStart = element.selectionStart !== null ? element.selectionStart : 0;
      const selectionEnd = element.selectionEnd !== null ? element.selectionEnd : 0;
      const position2 = options.useSelectionEnd ? selectionEnd : selectionStart;
      const properties = [
        "direction",
        "boxSizing",
        "width",
        "height",
        "overflowX",
        "overflowY",
        "borderTopWidth",
        "borderRightWidth",
        "borderBottomWidth",
        "borderLeftWidth",
        "borderStyle",
        "paddingTop",
        "paddingRight",
        "paddingBottom",
        "paddingLeft",
        "fontStyle",
        "fontVariant",
        "fontWeight",
        "fontStretch",
        "fontSize",
        "fontSizeAdjust",
        "lineHeight",
        "fontFamily",
        "textAlign",
        "textTransform",
        "textIndent",
        "textDecoration",
        "letterSpacing",
        "wordSpacing",
        "tabSize",
        "MozTabSize"
      ];
      if (options.debug) {
        const el = document.querySelector("#input-textarea-caret-position-mirror-div");
        if (el == null ? void 0 : el.parentNode)
          el.parentNode.removeChild(el);
      }
      const div = document.createElement("div");
      div.id = "input-textarea-caret-position-mirror-div";
      document.body.appendChild(div);
      const style = div.style;
      const computed2 = window.getComputedStyle(element);
      const isInput = element.nodeName === "INPUT";
      style.whiteSpace = isInput ? "nowrap" : "pre-wrap";
      if (!isInput)
        style.wordWrap = "break-word";
      style.position = "absolute";
      if (!options.debug)
        style.visibility = "hidden";
      properties.forEach((prop) => {
        if (isInput && prop === "lineHeight") {
          if (computed2.boxSizing === "border-box") {
            const height = Number.parseInt(computed2.height);
            const outerHeight = Number.parseInt(computed2.paddingTop) + Number.parseInt(computed2.paddingBottom) + Number.parseInt(computed2.borderTopWidth) + Number.parseInt(computed2.borderBottomWidth);
            const targetHeight = outerHeight + Number.parseInt(computed2.lineHeight);
            if (height > targetHeight) {
              style.lineHeight = `${height - outerHeight}px`;
            } else if (height === targetHeight) {
              style.lineHeight = computed2.lineHeight;
            } else {
              style.lineHeight = "0";
            }
          } else {
            style.lineHeight = computed2.height;
          }
        } else {
          style[prop] = computed2[prop];
        }
      });
      if (isFirefox()) {
        if (element.scrollHeight > Number.parseInt(computed2.height)) {
          style.overflowY = "scroll";
        }
      } else {
        style.overflow = "hidden";
      }
      div.textContent = element.value.slice(0, Math.max(0, position2));
      if (isInput && div.textContent) {
        div.textContent = div.textContent.replace(/\s/g, " ");
      }
      const span = document.createElement("span");
      span.textContent = element.value.slice(Math.max(0, position2)) || ".";
      span.style.position = "relative";
      span.style.left = `${-element.scrollLeft}px`;
      span.style.top = `${-element.scrollTop}px`;
      div.appendChild(span);
      const relativePosition = {
        top: span.offsetTop + Number.parseInt(computed2.borderTopWidth),
        left: span.offsetLeft + Number.parseInt(computed2.borderLeftWidth),
        height: Number.parseInt(computed2.fontSize) * 1.5
      };
      if (options.debug) {
        span.style.backgroundColor = "#aaa";
      } else {
        document.body.removeChild(div);
      }
      if (relativePosition.left >= element.clientWidth) {
        relativePosition.left = element.clientWidth;
      }
      return relativePosition;
    };
    const mentionProps = buildProps({
      ...inputProps,
      options: {
        type: definePropType(Array),
        default: () => []
      },
      prefix: {
        type: definePropType([String, Array]),
        default: "@",
        validator: (val) => {
          if (isString$3(val))
            return val.length === 1;
          return val.every((v4) => isString$3(v4) && v4.length === 1);
        }
      },
      split: {
        type: String,
        default: " ",
        validator: (val) => val.length === 1
      },
      filterOption: {
        type: definePropType([Boolean, Function]),
        default: () => filterOption,
        validator: (val) => {
          if (val === false)
            return true;
          return isFunction$4(val);
        }
      },
      placement: {
        type: definePropType(String),
        default: "bottom"
      },
      showArrow: Boolean,
      offset: {
        type: Number,
        default: 0
      },
      whole: Boolean,
      checkIsWhole: {
        type: definePropType(Function)
      },
      modelValue: String,
      loading: Boolean,
      popperClass: {
        type: String,
        default: ""
      },
      popperOptions: {
        type: definePropType(Object),
        default: () => ({})
      }
    });
    const mentionEmits = {
      [UPDATE_MODEL_EVENT]: (value) => isString$3(value),
      input: (value) => isString$3(value),
      search: (pattern, prefix) => isString$3(pattern) && isString$3(prefix),
      select: (option, prefix) => isString$3(option.value) && isString$3(prefix),
      focus: (evt) => evt instanceof FocusEvent,
      blur: (evt) => evt instanceof FocusEvent
    };
    const mentionDropdownProps = buildProps({
      options: {
        type: definePropType(Array),
        default: () => []
      },
      loading: Boolean,
      disabled: Boolean,
      contentId: String,
      ariaLabel: String
    });
    const mentionDropdownEmits = {
      select: (option) => isString$3(option.value)
    };
    const __default__$3 = /* @__PURE__ */ defineComponent({
      name: "ElMentionDropdown"
    });
    const _sfc_main$c = /* @__PURE__ */ defineComponent({
      ...__default__$3,
      props: mentionDropdownProps,
      emits: mentionDropdownEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const ns = useNamespace("mention");
        const { t } = useLocale();
        const hoveringIndex = ref(-1);
        const scrollbarRef = ref();
        const optionRefs = ref();
        const dropdownRef = ref();
        const optionkls = (item, index) => [
          ns.be("dropdown", "item"),
          ns.is("hovering", hoveringIndex.value === index),
          ns.is("disabled", item.disabled || props2.disabled)
        ];
        const handleSelect = (item) => {
          if (item.disabled || props2.disabled)
            return;
          emit2("select", item);
        };
        const handleMouseEnter = (index) => {
          hoveringIndex.value = index;
        };
        const filteredAllDisabled = computed(() => props2.disabled || props2.options.every((item) => item.disabled));
        const hoverOption = computed(() => props2.options[hoveringIndex.value]);
        const selectHoverOption = () => {
          if (!hoverOption.value)
            return;
          emit2("select", hoverOption.value);
        };
        const navigateOptions = (direction2) => {
          const { options } = props2;
          if (options.length === 0 || filteredAllDisabled.value)
            return;
          if (direction2 === "next") {
            hoveringIndex.value++;
            if (hoveringIndex.value === options.length) {
              hoveringIndex.value = 0;
            }
          } else if (direction2 === "prev") {
            hoveringIndex.value--;
            if (hoveringIndex.value < 0) {
              hoveringIndex.value = options.length - 1;
            }
          }
          const option = options[hoveringIndex.value];
          if (option.disabled) {
            navigateOptions(direction2);
            return;
          }
          nextTick(() => scrollToOption(option));
        };
        const scrollToOption = (option) => {
          var _a2, _b2, _c2, _d;
          const { options } = props2;
          const index = options.findIndex((item) => item.value === option.value);
          const target = (_a2 = optionRefs.value) == null ? void 0 : _a2[index];
          if (target) {
            const menu = (_c2 = (_b2 = dropdownRef.value) == null ? void 0 : _b2.querySelector) == null ? void 0 : _c2.call(_b2, `.${ns.be("dropdown", "wrap")}`);
            if (menu) {
              scrollIntoView(menu, target);
            }
          }
          (_d = scrollbarRef.value) == null ? void 0 : _d.handleScroll();
        };
        const resetHoveringIndex = () => {
          if (filteredAllDisabled.value || props2.options.length === 0) {
            hoveringIndex.value = -1;
          } else {
            hoveringIndex.value = 0;
          }
        };
        watch(() => props2.options, resetHoveringIndex, {
          immediate: true
        });
        expose({
          hoveringIndex,
          navigateOptions,
          selectHoverOption,
          hoverOption
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "dropdownRef",
            ref: dropdownRef,
            class: normalizeClass(unref(ns).b("dropdown"))
          }, [
            _ctx.$slots.header ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: normalizeClass(unref(ns).be("dropdown", "header"))
            }, [
              renderSlot(_ctx.$slots, "header")
            ], 2)) : createCommentVNode("v-if", true),
            withDirectives(createVNode$1(unref(ElScrollbar), {
              id: _ctx.contentId,
              ref_key: "scrollbarRef",
              ref: scrollbarRef,
              tag: "ul",
              "wrap-class": unref(ns).be("dropdown", "wrap"),
              "view-class": unref(ns).be("dropdown", "list"),
              role: "listbox",
              "aria-label": _ctx.ariaLabel,
              "aria-orientation": "vertical"
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (item, index) => {
                  return openBlock(), createElementBlock("li", {
                    id: `${_ctx.contentId}-${index}`,
                    ref_for: true,
                    ref_key: "optionRefs",
                    ref: optionRefs,
                    key: index,
                    class: normalizeClass(optionkls(item, index)),
                    role: "option",
                    "aria-disabled": item.disabled || _ctx.disabled || void 0,
                    "aria-selected": hoveringIndex.value === index,
                    onMousemove: ($event) => handleMouseEnter(index),
                    onClick: withModifiers(($event) => handleSelect(item), ["stop"])
                  }, [
                    renderSlot(_ctx.$slots, "label", {
                      item,
                      index
                    }, () => {
                      var _a2;
                      return [
                        createBaseVNode("span", null, toDisplayString((_a2 = item.label) != null ? _a2 : item.value), 1)
                      ];
                    })
                  ], 42, ["id", "aria-disabled", "aria-selected", "onMousemove", "onClick"]);
                }), 128))
              ]),
              _: 3
            }, 8, ["id", "wrap-class", "view-class", "aria-label"]), [
              [vShow, _ctx.options.length > 0 && !_ctx.loading]
            ]),
            _ctx.loading ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: normalizeClass(unref(ns).be("dropdown", "loading"))
            }, [
              renderSlot(_ctx.$slots, "loading", {}, () => [
                createTextVNode(toDisplayString(unref(t)("el.mention.loading")), 1)
              ])
            ], 2)) : createCommentVNode("v-if", true),
            _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
              key: 2,
              class: normalizeClass(unref(ns).be("dropdown", "footer"))
            }, [
              renderSlot(_ctx.$slots, "footer")
            ], 2)) : createCommentVNode("v-if", true)
          ], 2);
        };
      }
    });
    var ElMentionDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "mention-dropdown.vue"]]);
    const __default__$2 = /* @__PURE__ */ defineComponent({
      name: "ElMention",
      inheritAttrs: false
    });
    const _sfc_main$b = /* @__PURE__ */ defineComponent({
      ...__default__$2,
      props: mentionProps,
      emits: mentionEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const passInputProps = computed(() => pick(props2, Object.keys(inputProps)));
        const ns = useNamespace("mention");
        const disabled = useFormDisabled();
        const contentId = useId();
        const elInputRef = ref();
        const tooltipRef = ref();
        const dropdownRef = ref();
        const visible = ref(false);
        const cursorStyle = ref();
        const mentionCtx = ref();
        const computedPlacement = computed(() => props2.showArrow ? props2.placement : `${props2.placement}-start`);
        const computedFallbackPlacements = computed(() => props2.showArrow ? ["bottom", "top"] : ["bottom-start", "top-start"]);
        const filteredOptions = computed(() => {
          const { filterOption: filterOption2, options } = props2;
          if (!mentionCtx.value || !filterOption2)
            return options;
          return options.filter((option) => filterOption2(mentionCtx.value.pattern, option));
        });
        const dropdownVisible = computed(() => {
          return visible.value && (!!filteredOptions.value.length || props2.loading);
        });
        const hoveringId = computed(() => {
          var _a2;
          return `${contentId.value}-${(_a2 = dropdownRef.value) == null ? void 0 : _a2.hoveringIndex}`;
        });
        const handleInputChange = (value) => {
          emit2(UPDATE_MODEL_EVENT, value);
          emit2(INPUT_EVENT, value);
          syncAfterCursorMove();
        };
        const handleInputKeyDown = (event) => {
          var _a2, _b2, _c2, _d;
          if (!("code" in event) || ((_a2 = elInputRef.value) == null ? void 0 : _a2.isComposing))
            return;
          switch (event.code) {
            case EVENT_CODE.left:
            case EVENT_CODE.right:
              syncAfterCursorMove();
              break;
            case EVENT_CODE.up:
            case EVENT_CODE.down:
              if (!visible.value)
                return;
              event.preventDefault();
              (_b2 = dropdownRef.value) == null ? void 0 : _b2.navigateOptions(event.code === EVENT_CODE.up ? "prev" : "next");
              break;
            case EVENT_CODE.enter:
            case EVENT_CODE.numpadEnter:
              if (!visible.value)
                return;
              event.preventDefault();
              if ((_c2 = dropdownRef.value) == null ? void 0 : _c2.hoverOption) {
                (_d = dropdownRef.value) == null ? void 0 : _d.selectHoverOption();
              } else {
                visible.value = false;
              }
              break;
            case EVENT_CODE.esc:
              if (!visible.value)
                return;
              event.preventDefault();
              visible.value = false;
              break;
            case EVENT_CODE.backspace:
              if (props2.whole && mentionCtx.value) {
                const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } = mentionCtx.value;
                const inputEl = getInputEl();
                if (!inputEl)
                  return;
                const inputValue = inputEl.value;
                const matchOption = props2.options.find((item) => item.value === pattern);
                const isWhole = isFunction$4(props2.checkIsWhole) ? props2.checkIsWhole(pattern, prefix) : matchOption;
                if (isWhole && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {
                  event.preventDefault();
                  const newValue = inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1);
                  emit2(UPDATE_MODEL_EVENT, newValue);
                  emit2(INPUT_EVENT, newValue);
                  const newSelectionEnd = prefixIndex;
                  nextTick(() => {
                    inputEl.selectionStart = newSelectionEnd;
                    inputEl.selectionEnd = newSelectionEnd;
                    syncDropdownVisible();
                  });
                }
              }
          }
        };
        const { wrapperRef } = useFocusController(elInputRef, {
          beforeFocus() {
            return disabled.value;
          },
          afterFocus() {
            syncAfterCursorMove();
          },
          beforeBlur(event) {
            var _a2;
            return (_a2 = tooltipRef.value) == null ? void 0 : _a2.isFocusInsideContent(event);
          },
          afterBlur() {
            visible.value = false;
          }
        });
        const handleInputMouseDown = () => {
          syncAfterCursorMove();
        };
        const handleSelect = (item) => {
          if (!mentionCtx.value)
            return;
          const inputEl = getInputEl();
          if (!inputEl)
            return;
          const inputValue = inputEl.value;
          const { split: split2 } = props2;
          const newEndPart = inputValue.slice(mentionCtx.value.end);
          const alreadySeparated = newEndPart.startsWith(split2);
          const newMiddlePart = `${item.value}${alreadySeparated ? "" : split2}`;
          const newValue = inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart;
          emit2(UPDATE_MODEL_EVENT, newValue);
          emit2(INPUT_EVENT, newValue);
          emit2("select", item, mentionCtx.value.prefix);
          const newSelectionEnd = mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0);
          nextTick(() => {
            inputEl.selectionStart = newSelectionEnd;
            inputEl.selectionEnd = newSelectionEnd;
            inputEl.focus();
            syncDropdownVisible();
          });
        };
        const getInputEl = () => {
          var _a2, _b2;
          return props2.type === "textarea" ? (_a2 = elInputRef.value) == null ? void 0 : _a2.textarea : (_b2 = elInputRef.value) == null ? void 0 : _b2.input;
        };
        const syncAfterCursorMove = () => {
          setTimeout(() => {
            syncCursor();
            syncDropdownVisible();
            nextTick(() => {
              var _a2;
              return (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper();
            });
          }, 0);
        };
        const syncCursor = () => {
          const inputEl = getInputEl();
          if (!inputEl)
            return;
          const caretPosition = getCursorPosition(inputEl);
          const inputRect = inputEl.getBoundingClientRect();
          const elInputRect = elInputRef.value.$el.getBoundingClientRect();
          cursorStyle.value = {
            position: "absolute",
            width: 0,
            height: `${caretPosition.height}px`,
            left: `${caretPosition.left + inputRect.left - elInputRect.left}px`,
            top: `${caretPosition.top + inputRect.top - elInputRect.top}px`
          };
        };
        const syncDropdownVisible = () => {
          const inputEl = getInputEl();
          if (document.activeElement !== inputEl) {
            visible.value = false;
            return;
          }
          const { prefix, split: split2 } = props2;
          mentionCtx.value = getMentionCtx(inputEl, prefix, split2);
          if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {
            visible.value = true;
            emit2("search", mentionCtx.value.pattern, mentionCtx.value.prefix);
            return;
          }
          visible.value = false;
        };
        expose({
          input: elInputRef,
          tooltip: tooltipRef,
          dropdownVisible
        });
        return (_ctx, _cache) => {
          return openBlock(), createElementBlock("div", {
            ref_key: "wrapperRef",
            ref: wrapperRef,
            class: normalizeClass(unref(ns).b())
          }, [
            createVNode$1(unref(ElInput), mergeProps(mergeProps(unref(passInputProps), _ctx.$attrs), {
              ref_key: "elInputRef",
              ref: elInputRef,
              "model-value": _ctx.modelValue,
              disabled: unref(disabled),
              role: unref(dropdownVisible) ? "combobox" : void 0,
              "aria-activedescendant": unref(dropdownVisible) ? unref(hoveringId) || "" : void 0,
              "aria-controls": unref(dropdownVisible) ? unref(contentId) : void 0,
              "aria-expanded": unref(dropdownVisible) || void 0,
              "aria-label": _ctx.ariaLabel,
              "aria-autocomplete": unref(dropdownVisible) ? "none" : void 0,
              "aria-haspopup": unref(dropdownVisible) ? "listbox" : void 0,
              onInput: handleInputChange,
              onKeydown: handleInputKeyDown,
              onMousedown: handleInputMouseDown
            }), createSlots({
              _: 2
            }, [
              renderList(_ctx.$slots, (_2, name) => {
                return {
                  name,
                  fn: withCtx((slotProps) => [
                    renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
                  ])
                };
              })
            ]), 1040, ["model-value", "disabled", "role", "aria-activedescendant", "aria-controls", "aria-expanded", "aria-label", "aria-autocomplete", "aria-haspopup"]),
            createVNode$1(unref(ElTooltip), {
              ref_key: "tooltipRef",
              ref: tooltipRef,
              visible: unref(dropdownVisible),
              "popper-class": [unref(ns).e("popper"), _ctx.popperClass],
              "popper-options": _ctx.popperOptions,
              placement: unref(computedPlacement),
              "fallback-placements": unref(computedFallbackPlacements),
              effect: "light",
              pure: "",
              offset: _ctx.offset,
              "show-arrow": _ctx.showArrow
            }, {
              default: withCtx(() => [
                createBaseVNode("div", {
                  style: normalizeStyle$1(cursorStyle.value)
                }, null, 4)
              ]),
              content: withCtx(() => {
                var _a2;
                return [
                  createVNode$1(ElMentionDropdown, {
                    ref_key: "dropdownRef",
                    ref: dropdownRef,
                    options: unref(filteredOptions),
                    disabled: unref(disabled),
                    loading: _ctx.loading,
                    "content-id": unref(contentId),
                    "aria-label": _ctx.ariaLabel,
                    onSelect: handleSelect,
                    onClick: withModifiers((_a2 = elInputRef.value) == null ? void 0 : _a2.focus, ["stop"])
                  }, createSlots({
                    _: 2
                  }, [
                    renderList(_ctx.$slots, (_2, name) => {
                      return {
                        name,
                        fn: withCtx((slotProps) => [
                          renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(slotProps)))
                        ])
                      };
                    })
                  ]), 1032, ["options", "disabled", "loading", "content-id", "aria-label", "onClick"])
                ];
              }),
              _: 3
            }, 8, ["visible", "popper-class", "popper-options", "placement", "fallback-placements", "offset", "show-arrow"])
          ], 2);
        };
      }
    });
    var Mention = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "mention.vue"]]);
    const ElMention = withInstall(Mention);
    var Components = [
      ElAffix,
      ElAlert,
      ElAutocomplete,
      ElAutoResizer,
      ElAvatar,
      ElBacktop,
      ElBadge,
      ElBreadcrumb,
      ElBreadcrumbItem,
      ElButton,
      ElButtonGroup$1,
      ElCalendar,
      ElCard,
      ElCarousel,
      ElCarouselItem,
      ElCascader,
      ElCascaderPanel,
      ElCheckTag,
      ElCheckbox,
      ElCheckboxButton,
      ElCheckboxGroup$1,
      ElCol,
      ElCollapse,
      ElCollapseItem,
      ElCollapseTransition,
      ElColorPicker,
      ElConfigProvider,
      ElContainer,
      ElAside,
      ElFooter,
      ElHeader,
      ElMain,
      ElDatePicker,
      ElDescriptions,
      ElDescriptionsItem,
      ElDialog,
      ElDivider,
      ElDrawer,
      ElDropdown,
      ElDropdownItem,
      ElDropdownMenu,
      ElEmpty,
      ElForm,
      ElFormItem,
      ElIcon,
      ElImage,
      ElImageViewer,
      ElInput,
      ElInputNumber,
      ElInputTag,
      ElLink,
      ElMenu,
      ElMenuItem,
      ElMenuItemGroup,
      ElSubMenu,
      ElPageHeader,
      ElPagination,
      ElPopconfirm,
      ElPopover,
      ElPopper,
      ElProgress,
      ElRadio,
      ElRadioButton,
      ElRadioGroup,
      ElRate,
      ElResult,
      ElRow,
      ElScrollbar,
      ElSelect,
      ElOption,
      ElOptionGroup,
      ElSelectV2,
      ElSkeleton,
      ElSkeletonItem,
      ElSlider,
      ElSpace,
      ElStatistic,
      ElCountdown,
      ElSteps,
      ElStep,
      ElSwitch,
      ElTable,
      ElTableColumn,
      ElTableV2,
      ElTabs,
      ElTabPane,
      ElTag,
      ElText,
      ElTimePicker,
      ElTimeSelect,
      ElTimeline,
      ElTimelineItem,
      ElTooltip,
      ElTooltipV2,
      ElTransfer,
      ElTree,
      ElTreeSelect,
      ElTreeV2,
      ElUpload,
      ElWatermark,
      ElTour,
      ElTourStep,
      ElAnchor,
      ElAnchorLink,
      ElSegmented,
      ElMention
    ];
    const SCOPE = "ElInfiniteScroll";
    const CHECK_INTERVAL = 50;
    const DEFAULT_DELAY = 200;
    const DEFAULT_DISTANCE = 0;
    const attributes = {
      delay: {
        type: Number,
        default: DEFAULT_DELAY
      },
      distance: {
        type: Number,
        default: DEFAULT_DISTANCE
      },
      disabled: {
        type: Boolean,
        default: false
      },
      immediate: {
        type: Boolean,
        default: true
      }
    };
    const getScrollOptions = (el, instance) => {
      return Object.entries(attributes).reduce((acm, [name, option]) => {
        var _a2, _b2;
        const { type, default: defaultValue } = option;
        const attrVal = el.getAttribute(`infinite-scroll-${name}`);
        let value = (_b2 = (_a2 = instance[attrVal]) != null ? _a2 : attrVal) != null ? _b2 : defaultValue;
        value = value === "false" ? false : value;
        value = type(value);
        acm[name] = Number.isNaN(value) ? defaultValue : value;
        return acm;
      }, {});
    };
    const destroyObserver = (el) => {
      const { observer } = el[SCOPE];
      if (observer) {
        observer.disconnect();
        delete el[SCOPE].observer;
      }
    };
    const handleScroll = (el, cb) => {
      const { container, containerEl, instance, observer, lastScrollTop } = el[SCOPE];
      const { disabled, distance: distance2 } = getScrollOptions(el, instance);
      const { clientHeight, scrollHeight, scrollTop } = containerEl;
      const delta = scrollTop - lastScrollTop;
      el[SCOPE].lastScrollTop = scrollTop;
      if (observer || disabled || delta < 0)
        return;
      let shouldTrigger = false;
      if (container === el) {
        shouldTrigger = scrollHeight - (clientHeight + scrollTop) <= distance2;
      } else {
        const { clientTop, scrollHeight: height } = el;
        const offsetTop = getOffsetTopDistance(el, containerEl);
        shouldTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance2;
      }
      if (shouldTrigger) {
        cb.call(instance);
      }
    };
    function checkFull(el, cb) {
      const { containerEl, instance } = el[SCOPE];
      const { disabled } = getScrollOptions(el, instance);
      if (disabled || containerEl.clientHeight === 0)
        return;
      if (containerEl.scrollHeight <= containerEl.clientHeight) {
        cb.call(instance);
      } else {
        destroyObserver(el);
      }
    }
    const InfiniteScroll = {
      async mounted(el, binding) {
        const { instance, value: cb } = binding;
        if (!isFunction$4(cb)) {
          throwError$1(SCOPE, "'v-infinite-scroll' binding value must be a function");
        }
        await nextTick();
        const { delay, immediate } = getScrollOptions(el, instance);
        const container = getScrollContainer(el, true);
        const containerEl = container === window ? document.documentElement : container;
        const onScroll = throttle$2(handleScroll.bind(null, el, cb), delay);
        if (!container)
          return;
        el[SCOPE] = {
          instance,
          container,
          containerEl,
          delay,
          cb,
          onScroll,
          lastScrollTop: containerEl.scrollTop
        };
        if (immediate) {
          const observer = new MutationObserver(throttle$2(checkFull.bind(null, el, cb), CHECK_INTERVAL));
          el[SCOPE].observer = observer;
          observer.observe(el, { childList: true, subtree: true });
          checkFull(el, cb);
        }
        container.addEventListener("scroll", onScroll);
      },
      unmounted(el) {
        if (!el[SCOPE])
          return;
        const { container, onScroll } = el[SCOPE];
        container == null ? void 0 : container.removeEventListener("scroll", onScroll);
        destroyObserver(el);
      },
      async updated(el) {
        if (!el[SCOPE]) {
          await nextTick();
        } else {
          const { containerEl, cb, observer } = el[SCOPE];
          if (containerEl.clientHeight && observer) {
            checkFull(el, cb);
          }
        }
      }
    };
    const _InfiniteScroll = InfiniteScroll;
    _InfiniteScroll.install = (app2) => {
      app2.directive("InfiniteScroll", _InfiniteScroll);
    };
    const ElInfiniteScroll = _InfiniteScroll;
    function createLoadingComponent(options, appContext) {
      let afterLeaveTimer;
      const afterLeaveFlag = ref(false);
      const data = reactive({
        ...options,
        originalPosition: "",
        originalOverflow: "",
        visible: false
      });
      function setText(text) {
        data.text = text;
      }
      function destroySelf() {
        const target = data.parent;
        const ns = vm.ns;
        if (!target.vLoadingAddClassList) {
          let loadingNumber = target.getAttribute("loading-number");
          loadingNumber = Number.parseInt(loadingNumber) - 1;
          if (!loadingNumber) {
            removeClass(target, ns.bm("parent", "relative"));
            target.removeAttribute("loading-number");
          } else {
            target.setAttribute("loading-number", loadingNumber.toString());
          }
          removeClass(target, ns.bm("parent", "hidden"));
        }
        removeElLoadingChild();
        loadingInstance.unmount();
      }
      function removeElLoadingChild() {
        var _a2, _b2;
        (_b2 = (_a2 = vm.$el) == null ? void 0 : _a2.parentNode) == null ? void 0 : _b2.removeChild(vm.$el);
      }
      function close2() {
        var _a2;
        if (options.beforeClose && !options.beforeClose())
          return;
        afterLeaveFlag.value = true;
        clearTimeout(afterLeaveTimer);
        afterLeaveTimer = setTimeout(handleAfterLeave, 400);
        data.visible = false;
        (_a2 = options.closed) == null ? void 0 : _a2.call(options);
      }
      function handleAfterLeave() {
        if (!afterLeaveFlag.value)
          return;
        const target = data.parent;
        afterLeaveFlag.value = false;
        target.vLoadingAddClassList = void 0;
        destroySelf();
      }
      const elLoadingComponent = /* @__PURE__ */ defineComponent({
        name: "ElLoading",
        setup(_2, { expose }) {
          const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("loading");
          expose({
            ns,
            zIndex: zIndex2
          });
          return () => {
            const svg = data.spinner || data.svg;
            const spinner = h$1("svg", {
              class: "circular",
              viewBox: data.svgViewBox ? data.svgViewBox : "0 0 50 50",
              ...svg ? { innerHTML: svg } : {}
            }, [
              h$1("circle", {
                class: "path",
                cx: "25",
                cy: "25",
                r: "20",
                fill: "none"
              })
            ]);
            const spinnerText = data.text ? h$1("p", { class: ns.b("text") }, [data.text]) : void 0;
            return h$1(Transition, {
              name: ns.b("fade"),
              onAfterLeave: handleAfterLeave
            }, {
              default: withCtx(() => [
                withDirectives(createVNode$1("div", {
                  style: {
                    backgroundColor: data.background || ""
                  },
                  class: [
                    ns.b("mask"),
                    data.customClass,
                    data.fullscreen ? "is-fullscreen" : ""
                  ]
                }, [
                  h$1("div", {
                    class: ns.b("spinner")
                  }, [spinner, spinnerText])
                ]), [[vShow, data.visible]])
              ])
            });
          };
        }
      });
      const loadingInstance = createApp(elLoadingComponent);
      Object.assign(loadingInstance._context, appContext != null ? appContext : {});
      const vm = loadingInstance.mount(document.createElement("div"));
      return {
        ...toRefs(data),
        setText,
        removeElLoadingChild,
        close: close2,
        handleAfterLeave,
        vm,
        get $el() {
          return vm.$el;
        }
      };
    }
    let fullscreenInstance = void 0;
    const Loading = function(options = {}) {
      if (!isClient)
        return void 0;
      const resolved = resolveOptions(options);
      if (resolved.fullscreen && fullscreenInstance) {
        return fullscreenInstance;
      }
      const instance = createLoadingComponent({
        ...resolved,
        closed: () => {
          var _a2;
          (_a2 = resolved.closed) == null ? void 0 : _a2.call(resolved);
          if (resolved.fullscreen)
            fullscreenInstance = void 0;
        }
      }, Loading._context);
      addStyle(resolved, resolved.parent, instance);
      addClassList(resolved, resolved.parent, instance);
      resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance);
      let loadingNumber = resolved.parent.getAttribute("loading-number");
      if (!loadingNumber) {
        loadingNumber = "1";
      } else {
        loadingNumber = `${Number.parseInt(loadingNumber) + 1}`;
      }
      resolved.parent.setAttribute("loading-number", loadingNumber);
      resolved.parent.appendChild(instance.$el);
      nextTick(() => instance.visible.value = resolved.visible);
      if (resolved.fullscreen) {
        fullscreenInstance = instance;
      }
      return instance;
    };
    const resolveOptions = (options) => {
      var _a2, _b2, _c2, _d;
      let target;
      if (isString$3(options.target)) {
        target = (_a2 = document.querySelector(options.target)) != null ? _a2 : document.body;
      } else {
        target = options.target || document.body;
      }
      return {
        parent: target === document.body || options.body ? document.body : target,
        background: options.background || "",
        svg: options.svg || "",
        svgViewBox: options.svgViewBox || "",
        spinner: options.spinner || false,
        text: options.text || "",
        fullscreen: target === document.body && ((_b2 = options.fullscreen) != null ? _b2 : true),
        lock: (_c2 = options.lock) != null ? _c2 : false,
        customClass: options.customClass || "",
        visible: (_d = options.visible) != null ? _d : true,
        beforeClose: options.beforeClose,
        closed: options.closed,
        target
      };
    };
    const addStyle = async (options, parent2, instance) => {
      const { nextZIndex } = instance.vm.zIndex || instance.vm._.exposed.zIndex;
      const maskStyle = {};
      if (options.fullscreen) {
        instance.originalPosition.value = getStyle$1(document.body, "position");
        instance.originalOverflow.value = getStyle$1(document.body, "overflow");
        maskStyle.zIndex = nextZIndex();
      } else if (options.parent === document.body) {
        instance.originalPosition.value = getStyle$1(document.body, "position");
        await nextTick();
        for (const property2 of ["top", "left"]) {
          const scroll = property2 === "top" ? "scrollTop" : "scrollLeft";
          maskStyle[property2] = `${options.target.getBoundingClientRect()[property2] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle$1(document.body, `margin-${property2}`), 10)}px`;
        }
        for (const property2 of ["height", "width"]) {
          maskStyle[property2] = `${options.target.getBoundingClientRect()[property2]}px`;
        }
      } else {
        instance.originalPosition.value = getStyle$1(parent2, "position");
      }
      for (const [key, value] of Object.entries(maskStyle)) {
        instance.$el.style[key] = value;
      }
    };
    const addClassList = (options, parent2, instance) => {
      const ns = instance.vm.ns || instance.vm._.exposed.ns;
      if (!["absolute", "fixed", "sticky"].includes(instance.originalPosition.value)) {
        addClass(parent2, ns.bm("parent", "relative"));
      } else {
        removeClass(parent2, ns.bm("parent", "relative"));
      }
      if (options.fullscreen && options.lock) {
        addClass(parent2, ns.bm("parent", "hidden"));
      } else {
        removeClass(parent2, ns.bm("parent", "hidden"));
      }
    };
    Loading._context = null;
    const INSTANCE_KEY = Symbol("ElLoading");
    const createInstance$1 = (el, binding) => {
      var _a2, _b2, _c2, _d;
      const vm = binding.instance;
      const getBindingProp = (key) => isObject$7(binding.value) ? binding.value[key] : void 0;
      const resolveExpression = (key) => {
        const data = isString$3(key) && (vm == null ? void 0 : vm[key]) || key;
        if (data)
          return ref(data);
        else
          return data;
      };
      const getProp2 = (name) => resolveExpression(getBindingProp(name) || el.getAttribute(`element-loading-${hyphenate(name)}`));
      const fullscreen = (_a2 = getBindingProp("fullscreen")) != null ? _a2 : binding.modifiers.fullscreen;
      const options = {
        text: getProp2("text"),
        svg: getProp2("svg"),
        svgViewBox: getProp2("svgViewBox"),
        spinner: getProp2("spinner"),
        background: getProp2("background"),
        customClass: getProp2("customClass"),
        fullscreen,
        target: (_b2 = getBindingProp("target")) != null ? _b2 : fullscreen ? void 0 : el,
        body: (_c2 = getBindingProp("body")) != null ? _c2 : binding.modifiers.body,
        lock: (_d = getBindingProp("lock")) != null ? _d : binding.modifiers.lock
      };
      const instance = Loading(options);
      instance._context = vLoading._context;
      el[INSTANCE_KEY] = {
        options,
        instance
      };
    };
    const updateOptions = (newOptions, originalOptions) => {
      for (const key of Object.keys(originalOptions)) {
        if (isRef(originalOptions[key]))
          originalOptions[key].value = newOptions[key];
      }
    };
    const vLoading = {
      mounted(el, binding) {
        if (binding.value) {
          createInstance$1(el, binding);
        }
      },
      updated(el, binding) {
        const instance = el[INSTANCE_KEY];
        if (binding.oldValue !== binding.value) {
          if (binding.value && !binding.oldValue) {
            createInstance$1(el, binding);
          } else if (binding.value && binding.oldValue) {
            if (isObject$7(binding.value))
              updateOptions(binding.value, instance.options);
          } else {
            instance == null ? void 0 : instance.instance.close();
          }
        }
      },
      unmounted(el) {
        var _a2;
        (_a2 = el[INSTANCE_KEY]) == null ? void 0 : _a2.instance.close();
        el[INSTANCE_KEY] = null;
      }
    };
    vLoading._context = null;
    const ElLoading = {
      install(app2) {
        Loading._context = app2._context;
        vLoading._context = app2._context;
        app2.directive("loading", vLoading);
        app2.config.globalProperties.$loading = Loading;
      },
      directive: vLoading,
      service: Loading
    };
    const messageTypes = ["success", "info", "warning", "error"];
    const messageDefaults = mutable({
      customClass: "",
      dangerouslyUseHTMLString: false,
      duration: 3e3,
      icon: void 0,
      id: "",
      message: "",
      onClose: void 0,
      showClose: false,
      type: "info",
      plain: false,
      offset: 16,
      zIndex: 0,
      grouping: false,
      repeatNum: 1,
      appendTo: isClient ? document.body : void 0
    });
    const messageProps = buildProps({
      customClass: {
        type: String,
        default: messageDefaults.customClass
      },
      dangerouslyUseHTMLString: {
        type: Boolean,
        default: messageDefaults.dangerouslyUseHTMLString
      },
      duration: {
        type: Number,
        default: messageDefaults.duration
      },
      icon: {
        type: iconPropType,
        default: messageDefaults.icon
      },
      id: {
        type: String,
        default: messageDefaults.id
      },
      message: {
        type: definePropType([
          String,
          Object,
          Function
        ]),
        default: messageDefaults.message
      },
      onClose: {
        type: definePropType(Function),
        default: messageDefaults.onClose
      },
      showClose: {
        type: Boolean,
        default: messageDefaults.showClose
      },
      type: {
        type: String,
        values: messageTypes,
        default: messageDefaults.type
      },
      plain: {
        type: Boolean,
        default: messageDefaults.plain
      },
      offset: {
        type: Number,
        default: messageDefaults.offset
      },
      zIndex: {
        type: Number,
        default: messageDefaults.zIndex
      },
      grouping: {
        type: Boolean,
        default: messageDefaults.grouping
      },
      repeatNum: {
        type: Number,
        default: messageDefaults.repeatNum
      }
    });
    const messageEmits = {
      destroy: () => true
    };
    const instances$2 = shallowReactive([]);
    const getInstance = (id) => {
      const idx = instances$2.findIndex((instance) => instance.id === id);
      const current = instances$2[idx];
      let prev;
      if (idx > 0) {
        prev = instances$2[idx - 1];
      }
      return { current, prev };
    };
    const getLastOffset = (id) => {
      const { prev } = getInstance(id);
      if (!prev)
        return 0;
      return prev.vm.exposed.bottom.value;
    };
    const getOffsetOrSpace = (id, offset2) => {
      const idx = instances$2.findIndex((instance) => instance.id === id);
      return idx > 0 ? 16 : offset2;
    };
    const __default__$1 = /* @__PURE__ */ defineComponent({
      name: "ElMessage"
    });
    const _sfc_main$a = /* @__PURE__ */ defineComponent({
      ...__default__$1,
      props: messageProps,
      emits: messageEmits,
      setup(__props, { expose, emit: emit2 }) {
        const props2 = __props;
        const { Close } = TypeComponents;
        const isStartTransition = ref(false);
        const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("message");
        const { currentZIndex, nextZIndex } = zIndex2;
        const messageRef = ref();
        const visible = ref(false);
        const height = ref(0);
        let stopTimer = void 0;
        const badgeType = computed(() => props2.type ? props2.type === "error" ? "danger" : props2.type : "info");
        const typeClass = computed(() => {
          const type = props2.type;
          return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
        });
        const iconComponent = computed(() => props2.icon || TypeComponentsMap[props2.type] || "");
        const lastOffset = computed(() => getLastOffset(props2.id));
        const offset2 = computed(() => getOffsetOrSpace(props2.id, props2.offset) + lastOffset.value);
        const bottom = computed(() => height.value + offset2.value);
        const customStyle = computed(() => ({
          top: `${offset2.value}px`,
          zIndex: currentZIndex.value
        }));
        function startTimer() {
          if (props2.duration === 0)
            return;
          ({ stop: stopTimer } = useTimeoutFn(() => {
            close2();
          }, props2.duration));
        }
        function clearTimer() {
          stopTimer == null ? void 0 : stopTimer();
        }
        function close2() {
          visible.value = false;
          nextTick(() => {
            var _a2;
            if (!isStartTransition.value) {
              (_a2 = props2.onClose) == null ? void 0 : _a2.call(props2);
              emit2("destroy");
            }
          });
        }
        function keydown({ code }) {
          if (code === EVENT_CODE.esc) {
            close2();
          }
        }
        onMounted(() => {
          startTimer();
          nextZIndex();
          visible.value = true;
        });
        watch(() => props2.repeatNum, () => {
          clearTimer();
          startTimer();
        });
        useEventListener(document, "keydown", keydown);
        useResizeObserver(messageRef, () => {
          height.value = messageRef.value.getBoundingClientRect().height;
        });
        expose({
          visible,
          bottom,
          close: close2
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, {
            name: unref(ns).b("fade"),
            onBeforeEnter: ($event) => isStartTransition.value = true,
            onBeforeLeave: _ctx.onClose,
            onAfterLeave: ($event) => _ctx.$emit("destroy"),
            persisted: ""
          }, {
            default: withCtx(() => [
              withDirectives(createBaseVNode("div", {
                id: _ctx.id,
                ref_key: "messageRef",
                ref: messageRef,
                class: normalizeClass([
                  unref(ns).b(),
                  { [unref(ns).m(_ctx.type)]: _ctx.type },
                  unref(ns).is("closable", _ctx.showClose),
                  unref(ns).is("plain", _ctx.plain),
                  _ctx.customClass
                ]),
                style: normalizeStyle$1(unref(customStyle)),
                role: "alert",
                onMouseenter: clearTimer,
                onMouseleave: startTimer
              }, [
                _ctx.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), {
                  key: 0,
                  value: _ctx.repeatNum,
                  type: unref(badgeType),
                  class: normalizeClass(unref(ns).e("badge"))
                }, null, 8, ["value", "type", "class"])) : createCommentVNode("v-if", true),
                unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 1,
                  class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
                  ]),
                  _: 1
                }, 8, ["class"])) : createCommentVNode("v-if", true),
                renderSlot(_ctx.$slots, "default", {}, () => [
                  !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
                    key: 0,
                    class: normalizeClass(unref(ns).e("content"))
                  }, toDisplayString(_ctx.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                    createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
                    createBaseVNode("p", {
                      class: normalizeClass(unref(ns).e("content")),
                      innerHTML: _ctx.message
                    }, null, 10, ["innerHTML"])
                  ], 2112))
                ]),
                _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 2,
                  class: normalizeClass(unref(ns).e("closeBtn")),
                  onClick: withModifiers(close2, ["stop"])
                }, {
                  default: withCtx(() => [
                    createVNode$1(unref(Close))
                  ]),
                  _: 1
                }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
              ], 46, ["id"]), [
                [vShow, visible.value]
              ])
            ]),
            _: 3
          }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]);
        };
      }
    });
    var MessageConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "message.vue"]]);
    let seed$1 = 1;
    const normalizeOptions = (params) => {
      const options = !params || isString$3(params) || isVNode(params) || isFunction$4(params) ? { message: params } : params;
      const normalized = {
        ...messageDefaults,
        ...options
      };
      if (!normalized.appendTo) {
        normalized.appendTo = document.body;
      } else if (isString$3(normalized.appendTo)) {
        let appendTo = document.querySelector(normalized.appendTo);
        if (!isElement$1(appendTo)) {
          appendTo = document.body;
        }
        normalized.appendTo = appendTo;
      }
      if (isBoolean$1(messageConfig.grouping) && !normalized.grouping) {
        normalized.grouping = messageConfig.grouping;
      }
      if (isNumber$2(messageConfig.duration) && normalized.duration === 3e3) {
        normalized.duration = messageConfig.duration;
      }
      if (isNumber$2(messageConfig.offset) && normalized.offset === 16) {
        normalized.offset = messageConfig.offset;
      }
      if (isBoolean$1(messageConfig.showClose) && !normalized.showClose) {
        normalized.showClose = messageConfig.showClose;
      }
      return normalized;
    };
    const closeMessage = (instance) => {
      const idx = instances$2.indexOf(instance);
      if (idx === -1)
        return;
      instances$2.splice(idx, 1);
      const { handler } = instance;
      handler.close();
    };
    const createMessage = ({ appendTo, ...options }, context) => {
      const id = `message_${seed$1++}`;
      const userOnClose = options.onClose;
      const container = document.createElement("div");
      const props2 = {
        ...options,
        id,
        onClose: () => {
          userOnClose == null ? void 0 : userOnClose();
          closeMessage(instance);
        },
        onDestroy: () => {
          render$1(null, container);
        }
      };
      const vnode = createVNode$1(MessageConstructor, props2, isFunction$4(props2.message) || isVNode(props2.message) ? {
        default: isFunction$4(props2.message) ? props2.message : () => props2.message
      } : null);
      vnode.appContext = context || message._context;
      render$1(vnode, container);
      appendTo.appendChild(container.firstElementChild);
      const vm = vnode.component;
      const handler = {
        close: () => {
          vm.exposed.close();
        }
      };
      const instance = {
        id,
        vnode,
        vm,
        handler,
        props: vnode.component.props
      };
      return instance;
    };
    const message = (options = {}, context) => {
      if (!isClient)
        return { close: () => void 0 };
      const normalized = normalizeOptions(options);
      if (normalized.grouping && instances$2.length) {
        const instance2 = instances$2.find(({ vnode: vm }) => {
          var _a2;
          return ((_a2 = vm.props) == null ? void 0 : _a2.message) === normalized.message;
        });
        if (instance2) {
          instance2.props.repeatNum += 1;
          instance2.props.type = normalized.type;
          return instance2.handler;
        }
      }
      if (isNumber$2(messageConfig.max) && instances$2.length >= messageConfig.max) {
        return { close: () => void 0 };
      }
      const instance = createMessage(normalized, context);
      instances$2.push(instance);
      return instance.handler;
    };
    messageTypes.forEach((type) => {
      message[type] = (options = {}, appContext) => {
        const normalized = normalizeOptions(options);
        return message({ ...normalized, type }, appContext);
      };
    });
    function closeAll$1(type) {
      const instancesToClose = [...instances$2];
      for (const instance of instancesToClose) {
        if (!type || type === instance.props.type) {
          instance.handler.close();
        }
      }
    }
    message.closeAll = closeAll$1;
    message._context = null;
    const ElMessage = withInstallFunction(message, "$message");
    const FOCUSABLE_CHILDREN = "_trap-focus-children";
    const FOCUS_STACK = [];
    const FOCUS_HANDLER = (e2) => {
      if (FOCUS_STACK.length === 0)
        return;
      const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN];
      if (focusableElement.length > 0 && e2.code === EVENT_CODE.tab) {
        if (focusableElement.length === 1) {
          e2.preventDefault();
          if (document.activeElement !== focusableElement[0]) {
            focusableElement[0].focus();
          }
          return;
        }
        const goingBackward = e2.shiftKey;
        const isFirst = e2.target === focusableElement[0];
        const isLast = e2.target === focusableElement[focusableElement.length - 1];
        if (isFirst && goingBackward) {
          e2.preventDefault();
          focusableElement[focusableElement.length - 1].focus();
        }
        if (isLast && !goingBackward) {
          e2.preventDefault();
          focusableElement[0].focus();
        }
      }
    };
    const TrapFocus = {
      beforeMount(el) {
        el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
        FOCUS_STACK.push(el);
        if (FOCUS_STACK.length <= 1) {
          document.addEventListener("keydown", FOCUS_HANDLER);
        }
      },
      updated(el) {
        nextTick(() => {
          el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
        });
      },
      unmounted() {
        FOCUS_STACK.shift();
        if (FOCUS_STACK.length === 0) {
          document.removeEventListener("keydown", FOCUS_HANDLER);
        }
      }
    };
    const _sfc_main$9 = /* @__PURE__ */ defineComponent({
      name: "ElMessageBox",
      directives: {
        TrapFocus
      },
      components: {
        ElButton,
        ElFocusTrap,
        ElInput,
        ElOverlay,
        ElIcon,
        ...TypeComponents
      },
      inheritAttrs: false,
      props: {
        buttonSize: {
          type: String,
          validator: isValidComponentSize
        },
        modal: {
          type: Boolean,
          default: true
        },
        lockScroll: {
          type: Boolean,
          default: true
        },
        showClose: {
          type: Boolean,
          default: true
        },
        closeOnClickModal: {
          type: Boolean,
          default: true
        },
        closeOnPressEscape: {
          type: Boolean,
          default: true
        },
        closeOnHashChange: {
          type: Boolean,
          default: true
        },
        center: Boolean,
        draggable: Boolean,
        overflow: Boolean,
        roundButton: {
          default: false,
          type: Boolean
        },
        container: {
          type: String,
          default: "body"
        },
        boxType: {
          type: String,
          default: ""
        }
      },
      emits: ["vanish", "action"],
      setup(props2, { emit: emit2 }) {
        const {
          locale,
          zIndex: zIndex2,
          ns,
          size: btnSize
        } = useGlobalComponentSettings("message-box", computed(() => props2.buttonSize));
        const { t } = locale;
        const { nextZIndex } = zIndex2;
        const visible = ref(false);
        const state = reactive({
          autofocus: true,
          beforeClose: null,
          callback: null,
          cancelButtonText: "",
          cancelButtonClass: "",
          confirmButtonText: "",
          confirmButtonClass: "",
          customClass: "",
          customStyle: {},
          dangerouslyUseHTMLString: false,
          distinguishCancelAndClose: false,
          icon: "",
          closeIcon: "",
          inputPattern: null,
          inputPlaceholder: "",
          inputType: "text",
          inputValue: "",
          inputValidator: void 0,
          inputErrorMessage: "",
          message: "",
          modalFade: true,
          modalClass: "",
          showCancelButton: false,
          showConfirmButton: true,
          type: "",
          title: void 0,
          showInput: false,
          action: "",
          confirmButtonLoading: false,
          cancelButtonLoading: false,
          confirmButtonLoadingIcon: markRaw(loading_default),
          cancelButtonLoadingIcon: markRaw(loading_default),
          confirmButtonDisabled: false,
          editorErrorMessage: "",
          validateError: false,
          zIndex: nextZIndex()
        });
        const typeClass = computed(() => {
          const type = state.type;
          return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
        });
        const contentId = useId();
        const inputId = useId();
        const iconComponent = computed(() => {
          const type = state.type;
          return state.icon || type && TypeComponentsMap[type] || "";
        });
        const hasMessage = computed(() => !!state.message);
        const rootRef = ref();
        const headerRef = ref();
        const focusStartRef = ref();
        const inputRef = ref();
        const confirmRef = ref();
        const confirmButtonClasses = computed(() => state.confirmButtonClass);
        watch(() => state.inputValue, async (val) => {
          await nextTick();
          if (props2.boxType === "prompt" && val) {
            validate();
          }
        }, { immediate: true });
        watch(() => visible.value, (val) => {
          var _a2, _b2;
          if (val) {
            if (props2.boxType !== "prompt") {
              if (state.autofocus) {
                focusStartRef.value = (_b2 = (_a2 = confirmRef.value) == null ? void 0 : _a2.$el) != null ? _b2 : rootRef.value;
              } else {
                focusStartRef.value = rootRef.value;
              }
            }
            state.zIndex = nextZIndex();
          }
          if (props2.boxType !== "prompt")
            return;
          if (val) {
            nextTick().then(() => {
              var _a22;
              if (inputRef.value && inputRef.value.$el) {
                if (state.autofocus) {
                  focusStartRef.value = (_a22 = getInputElement()) != null ? _a22 : rootRef.value;
                } else {
                  focusStartRef.value = rootRef.value;
                }
              }
            });
          } else {
            state.editorErrorMessage = "";
            state.validateError = false;
          }
        });
        const draggable2 = computed(() => props2.draggable);
        const overflow2 = computed(() => props2.overflow);
        useDraggable(rootRef, headerRef, draggable2, overflow2);
        onMounted(async () => {
          await nextTick();
          if (props2.closeOnHashChange) {
            window.addEventListener("hashchange", doClose);
          }
        });
        onBeforeUnmount(() => {
          if (props2.closeOnHashChange) {
            window.removeEventListener("hashchange", doClose);
          }
        });
        function doClose() {
          if (!visible.value)
            return;
          visible.value = false;
          nextTick(() => {
            if (state.action)
              emit2("action", state.action);
          });
        }
        const handleWrapperClick = () => {
          if (props2.closeOnClickModal) {
            handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
          }
        };
        const overlayEvent = useSameTarget(handleWrapperClick);
        const handleInputEnter = (e2) => {
          if (state.inputType !== "textarea") {
            e2.preventDefault();
            return handleAction("confirm");
          }
        };
        const handleAction = (action) => {
          var _a2;
          if (props2.boxType === "prompt" && action === "confirm" && !validate()) {
            return;
          }
          state.action = action;
          if (state.beforeClose) {
            (_a2 = state.beforeClose) == null ? void 0 : _a2.call(state, action, state, doClose);
          } else {
            doClose();
          }
        };
        const validate = () => {
          if (props2.boxType === "prompt") {
            const inputPattern = state.inputPattern;
            if (inputPattern && !inputPattern.test(state.inputValue || "")) {
              state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
              state.validateError = true;
              return false;
            }
            const inputValidator = state.inputValidator;
            if (isFunction$4(inputValidator)) {
              const validateResult = inputValidator(state.inputValue);
              if (validateResult === false) {
                state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
                state.validateError = true;
                return false;
              }
              if (isString$3(validateResult)) {
                state.editorErrorMessage = validateResult;
                state.validateError = true;
                return false;
              }
            }
          }
          state.editorErrorMessage = "";
          state.validateError = false;
          return true;
        };
        const getInputElement = () => {
          var _a2, _b2;
          const inputRefs = (_a2 = inputRef.value) == null ? void 0 : _a2.$refs;
          return (_b2 = inputRefs == null ? void 0 : inputRefs.input) != null ? _b2 : inputRefs == null ? void 0 : inputRefs.textarea;
        };
        const handleClose = () => {
          handleAction("close");
        };
        const onCloseRequested = () => {
          if (props2.closeOnPressEscape) {
            handleClose();
          }
        };
        if (props2.lockScroll) {
          useLockscreen(visible);
        }
        return {
          ...toRefs(state),
          ns,
          overlayEvent,
          visible,
          hasMessage,
          typeClass,
          contentId,
          inputId,
          btnSize,
          iconComponent,
          confirmButtonClasses,
          rootRef,
          focusStartRef,
          headerRef,
          inputRef,
          confirmRef,
          doClose,
          handleClose,
          onCloseRequested,
          handleWrapperClick,
          handleInputEnter,
          handleAction,
          t
        };
      }
    });
    function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_focus_trap = resolveComponent("el-focus-trap");
      const _component_el_overlay = resolveComponent("el-overlay");
      return openBlock(), createBlock(Transition, {
        name: "fade-in-linear",
        onAfterLeave: ($event) => _ctx.$emit("vanish"),
        persisted: ""
      }, {
        default: withCtx(() => [
          withDirectives(createVNode$1(_component_el_overlay, {
            "z-index": _ctx.zIndex,
            "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
            mask: _ctx.modal
          }, {
            default: withCtx(() => [
              createBaseVNode("div", {
                role: "dialog",
                "aria-label": _ctx.title,
                "aria-modal": "true",
                "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
                class: normalizeClass(`${_ctx.ns.namespace.value}-overlay-message-box`),
                onClick: _ctx.overlayEvent.onClick,
                onMousedown: _ctx.overlayEvent.onMousedown,
                onMouseup: _ctx.overlayEvent.onMouseup
              }, [
                createVNode$1(_component_el_focus_trap, {
                  loop: "",
                  trapped: _ctx.visible,
                  "focus-trap-el": _ctx.rootRef,
                  "focus-start-el": _ctx.focusStartRef,
                  onReleaseRequested: _ctx.onCloseRequested
                }, {
                  default: withCtx(() => [
                    createBaseVNode("div", {
                      ref: "rootRef",
                      class: normalizeClass([
                        _ctx.ns.b(),
                        _ctx.customClass,
                        _ctx.ns.is("draggable", _ctx.draggable),
                        { [_ctx.ns.m("center")]: _ctx.center }
                      ]),
                      style: normalizeStyle$1(_ctx.customStyle),
                      tabindex: "-1",
                      onClick: withModifiers(() => {
                      }, ["stop"])
                    }, [
                      _ctx.title !== null && _ctx.title !== void 0 ? (openBlock(), createElementBlock("div", {
                        key: 0,
                        ref: "headerRef",
                        class: normalizeClass([_ctx.ns.e("header"), { "show-close": _ctx.showClose }])
                      }, [
                        createBaseVNode("div", {
                          class: normalizeClass(_ctx.ns.e("title"))
                        }, [
                          _ctx.iconComponent && _ctx.center ? (openBlock(), createBlock(_component_el_icon, {
                            key: 0,
                            class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
                          }, {
                            default: withCtx(() => [
                              (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
                            ]),
                            _: 1
                          }, 8, ["class"])) : createCommentVNode("v-if", true),
                          createBaseVNode("span", null, toDisplayString(_ctx.title), 1)
                        ], 2),
                        _ctx.showClose ? (openBlock(), createElementBlock("button", {
                          key: 0,
                          type: "button",
                          class: normalizeClass(_ctx.ns.e("headerbtn")),
                          "aria-label": _ctx.t("el.messagebox.close"),
                          onClick: ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"),
                          onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"])
                        }, [
                          createVNode$1(_component_el_icon, {
                            class: normalizeClass(_ctx.ns.e("close"))
                          }, {
                            default: withCtx(() => [
                              (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || "close")))
                            ]),
                            _: 1
                          }, 8, ["class"])
                        ], 42, ["aria-label", "onClick", "onKeydown"])) : createCommentVNode("v-if", true)
                      ], 2)) : createCommentVNode("v-if", true),
                      createBaseVNode("div", {
                        id: _ctx.contentId,
                        class: normalizeClass(_ctx.ns.e("content"))
                      }, [
                        createBaseVNode("div", {
                          class: normalizeClass(_ctx.ns.e("container"))
                        }, [
                          _ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (openBlock(), createBlock(_component_el_icon, {
                            key: 0,
                            class: normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
                          }, {
                            default: withCtx(() => [
                              (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
                            ]),
                            _: 1
                          }, 8, ["class"])) : createCommentVNode("v-if", true),
                          _ctx.hasMessage ? (openBlock(), createElementBlock("div", {
                            key: 1,
                            class: normalizeClass(_ctx.ns.e("message"))
                          }, [
                            renderSlot(_ctx.$slots, "default", {}, () => [
                              !_ctx.dangerouslyUseHTMLString ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
                                key: 0,
                                for: _ctx.showInput ? _ctx.inputId : void 0
                              }, {
                                default: withCtx(() => [
                                  createTextVNode(toDisplayString(!_ctx.dangerouslyUseHTMLString ? _ctx.message : ""), 1)
                                ]),
                                _: 1
                              }, 8, ["for"])) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
                                key: 1,
                                for: _ctx.showInput ? _ctx.inputId : void 0,
                                innerHTML: _ctx.message
                              }, null, 8, ["for", "innerHTML"]))
                            ])
                          ], 2)) : createCommentVNode("v-if", true)
                        ], 2),
                        withDirectives(createBaseVNode("div", {
                          class: normalizeClass(_ctx.ns.e("input"))
                        }, [
                          createVNode$1(_component_el_input, {
                            id: _ctx.inputId,
                            ref: "inputRef",
                            modelValue: _ctx.inputValue,
                            "onUpdate:modelValue": ($event) => _ctx.inputValue = $event,
                            type: _ctx.inputType,
                            placeholder: _ctx.inputPlaceholder,
                            "aria-invalid": _ctx.validateError,
                            class: normalizeClass({ invalid: _ctx.validateError }),
                            onKeydown: withKeys(_ctx.handleInputEnter, ["enter"])
                          }, null, 8, ["id", "modelValue", "onUpdate:modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
                          createBaseVNode("div", {
                            class: normalizeClass(_ctx.ns.e("errormsg")),
                            style: normalizeStyle$1({
                              visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden"
                            })
                          }, toDisplayString(_ctx.editorErrorMessage), 7)
                        ], 2), [
                          [vShow, _ctx.showInput]
                        ])
                      ], 10, ["id"]),
                      createBaseVNode("div", {
                        class: normalizeClass(_ctx.ns.e("btns"))
                      }, [
                        _ctx.showCancelButton ? (openBlock(), createBlock(_component_el_button, {
                          key: 0,
                          loading: _ctx.cancelButtonLoading,
                          "loading-icon": _ctx.cancelButtonLoadingIcon,
                          class: normalizeClass([_ctx.cancelButtonClass]),
                          round: _ctx.roundButton,
                          size: _ctx.btnSize,
                          onClick: ($event) => _ctx.handleAction("cancel"),
                          onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"])
                        }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)
                          ]),
                          _: 1
                        }, 8, ["loading", "loading-icon", "class", "round", "size", "onClick", "onKeydown"])) : createCommentVNode("v-if", true),
                        withDirectives(createVNode$1(_component_el_button, {
                          ref: "confirmRef",
                          type: "primary",
                          loading: _ctx.confirmButtonLoading,
                          "loading-icon": _ctx.confirmButtonLoadingIcon,
                          class: normalizeClass([_ctx.confirmButtonClasses]),
                          round: _ctx.roundButton,
                          disabled: _ctx.confirmButtonDisabled,
                          size: _ctx.btnSize,
                          onClick: ($event) => _ctx.handleAction("confirm"),
                          onKeydown: withKeys(withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"])
                        }, {
                          default: withCtx(() => [
                            createTextVNode(toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)
                          ]),
                          _: 1
                        }, 8, ["loading", "loading-icon", "class", "round", "disabled", "size", "onClick", "onKeydown"]), [
                          [vShow, _ctx.showConfirmButton]
                        ])
                      ], 2)
                    ], 14, ["onClick"])
                  ]),
                  _: 3
                }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
              ], 42, ["aria-label", "aria-describedby", "onClick", "onMousedown", "onMouseup"])
            ]),
            _: 3
          }, 8, ["z-index", "overlay-class", "mask"]), [
            [vShow, _ctx.visible]
          ])
        ]),
        _: 3
      }, 8, ["onAfterLeave"]);
    }
    var MessageBoxConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$6], ["__file", "index.vue"]]);
    const messageInstance = /* @__PURE__ */ new Map();
    const getAppendToElement = (props2) => {
      let appendTo = document.body;
      if (props2.appendTo) {
        if (isString$3(props2.appendTo)) {
          appendTo = document.querySelector(props2.appendTo);
        }
        if (isElement$1(props2.appendTo)) {
          appendTo = props2.appendTo;
        }
        if (!isElement$1(appendTo)) {
          appendTo = document.body;
        }
      }
      return appendTo;
    };
    const initInstance = (props2, container, appContext = null) => {
      const vnode = createVNode$1(MessageBoxConstructor, props2, isFunction$4(props2.message) || isVNode(props2.message) ? {
        default: isFunction$4(props2.message) ? props2.message : () => props2.message
      } : null);
      vnode.appContext = appContext;
      render$1(vnode, container);
      getAppendToElement(props2).appendChild(container.firstElementChild);
      return vnode.component;
    };
    const genContainer = () => {
      return document.createElement("div");
    };
    const showMessage = (options, appContext) => {
      const container = genContainer();
      options.onVanish = () => {
        render$1(null, container);
        messageInstance.delete(vm);
      };
      options.onAction = (action) => {
        const currentMsg = messageInstance.get(vm);
        let resolve2;
        if (options.showInput) {
          resolve2 = { value: vm.inputValue, action };
        } else {
          resolve2 = action;
        }
        if (options.callback) {
          options.callback(resolve2, instance.proxy);
        } else {
          if (action === "cancel" || action === "close") {
            if (options.distinguishCancelAndClose && action !== "cancel") {
              currentMsg.reject("close");
            } else {
              currentMsg.reject("cancel");
            }
          } else {
            currentMsg.resolve(resolve2);
          }
        }
      };
      const instance = initInstance(options, container, appContext);
      const vm = instance.proxy;
      for (const prop in options) {
        if (hasOwn$1(options, prop) && !hasOwn$1(vm.$props, prop)) {
          if (prop === "closeIcon" && isObject$7(options[prop])) {
            vm[prop] = markRaw(options[prop]);
          } else {
            vm[prop] = options[prop];
          }
        }
      }
      vm.visible = true;
      return vm;
    };
    function MessageBox(options, appContext = null) {
      if (!isClient)
        return Promise.reject();
      let callback;
      if (isString$3(options) || isVNode(options)) {
        options = {
          message: options
        };
      } else {
        callback = options.callback;
      }
      return new Promise((resolve2, reject) => {
        const vm = showMessage(options, appContext != null ? appContext : MessageBox._context);
        messageInstance.set(vm, {
          options,
          callback,
          resolve: resolve2,
          reject
        });
      });
    }
    const MESSAGE_BOX_VARIANTS = ["alert", "confirm", "prompt"];
    const MESSAGE_BOX_DEFAULT_OPTS = {
      alert: { closeOnPressEscape: false, closeOnClickModal: false },
      confirm: { showCancelButton: true },
      prompt: { showCancelButton: true, showInput: true }
    };
    MESSAGE_BOX_VARIANTS.forEach((boxType) => {
      MessageBox[boxType] = messageBoxFactory(boxType);
    });
    function messageBoxFactory(boxType) {
      return (message2, title, options, appContext) => {
        let titleOrOpts = "";
        if (isObject$7(title)) {
          options = title;
          titleOrOpts = "";
        } else if (isUndefined$1(title)) {
          titleOrOpts = "";
        } else {
          titleOrOpts = title;
        }
        return MessageBox(Object.assign({
          title: titleOrOpts,
          message: message2,
          type: "",
          ...MESSAGE_BOX_DEFAULT_OPTS[boxType]
        }, options, {
          boxType
        }), appContext);
      };
    }
    MessageBox.close = () => {
      messageInstance.forEach((_2, vm) => {
        vm.doClose();
      });
      messageInstance.clear();
    };
    MessageBox._context = null;
    const _MessageBox = MessageBox;
    _MessageBox.install = (app2) => {
      _MessageBox._context = app2._context;
      app2.config.globalProperties.$msgbox = _MessageBox;
      app2.config.globalProperties.$messageBox = _MessageBox;
      app2.config.globalProperties.$alert = _MessageBox.alert;
      app2.config.globalProperties.$confirm = _MessageBox.confirm;
      app2.config.globalProperties.$prompt = _MessageBox.prompt;
    };
    const ElMessageBox = _MessageBox;
    const notificationTypes = [
      "success",
      "info",
      "warning",
      "error"
    ];
    const notificationProps = buildProps({
      customClass: {
        type: String,
        default: ""
      },
      dangerouslyUseHTMLString: Boolean,
      duration: {
        type: Number,
        default: 4500
      },
      icon: {
        type: iconPropType
      },
      id: {
        type: String,
        default: ""
      },
      message: {
        type: definePropType([
          String,
          Object,
          Function
        ]),
        default: ""
      },
      offset: {
        type: Number,
        default: 0
      },
      onClick: {
        type: definePropType(Function),
        default: () => void 0
      },
      onClose: {
        type: definePropType(Function),
        required: true
      },
      position: {
        type: String,
        values: ["top-right", "top-left", "bottom-right", "bottom-left"],
        default: "top-right"
      },
      showClose: {
        type: Boolean,
        default: true
      },
      title: {
        type: String,
        default: ""
      },
      type: {
        type: String,
        values: [...notificationTypes, ""],
        default: ""
      },
      zIndex: Number,
      closeIcon: {
        type: iconPropType,
        default: close_default
      }
    });
    const notificationEmits = {
      destroy: () => true
    };
    const __default__ = /* @__PURE__ */ defineComponent({
      name: "ElNotification"
    });
    const _sfc_main$8 = /* @__PURE__ */ defineComponent({
      ...__default__,
      props: notificationProps,
      emits: notificationEmits,
      setup(__props, { expose }) {
        const props2 = __props;
        const { ns, zIndex: zIndex2 } = useGlobalComponentSettings("notification");
        const { nextZIndex, currentZIndex } = zIndex2;
        const visible = ref(false);
        let timer = void 0;
        const typeClass = computed(() => {
          const type = props2.type;
          return type && TypeComponentsMap[props2.type] ? ns.m(type) : "";
        });
        const iconComponent = computed(() => {
          if (!props2.type)
            return props2.icon;
          return TypeComponentsMap[props2.type] || props2.icon;
        });
        const horizontalClass = computed(() => props2.position.endsWith("right") ? "right" : "left");
        const verticalProperty = computed(() => props2.position.startsWith("top") ? "top" : "bottom");
        const positionStyle = computed(() => {
          var _a2;
          return {
            [verticalProperty.value]: `${props2.offset}px`,
            zIndex: (_a2 = props2.zIndex) != null ? _a2 : currentZIndex.value
          };
        });
        function startTimer() {
          if (props2.duration > 0) {
            ({ stop: timer } = useTimeoutFn(() => {
              if (visible.value)
                close2();
            }, props2.duration));
          }
        }
        function clearTimer() {
          timer == null ? void 0 : timer();
        }
        function close2() {
          visible.value = false;
        }
        function onKeydown({ code }) {
          if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
            clearTimer();
          } else if (code === EVENT_CODE.esc) {
            if (visible.value) {
              close2();
            }
          } else {
            startTimer();
          }
        }
        onMounted(() => {
          startTimer();
          nextZIndex();
          visible.value = true;
        });
        useEventListener(document, "keydown", onKeydown);
        expose({
          visible,
          close: close2
        });
        return (_ctx, _cache) => {
          return openBlock(), createBlock(Transition, {
            name: unref(ns).b("fade"),
            onBeforeLeave: _ctx.onClose,
            onAfterLeave: ($event) => _ctx.$emit("destroy"),
            persisted: ""
          }, {
            default: withCtx(() => [
              withDirectives(createBaseVNode("div", {
                id: _ctx.id,
                class: normalizeClass([unref(ns).b(), _ctx.customClass, unref(horizontalClass)]),
                style: normalizeStyle$1(unref(positionStyle)),
                role: "alert",
                onMouseenter: clearTimer,
                onMouseleave: startTimer,
                onClick: _ctx.onClick
              }, [
                unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
                  key: 0,
                  class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
                }, {
                  default: withCtx(() => [
                    (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
                  ]),
                  _: 1
                }, 8, ["class"])) : createCommentVNode("v-if", true),
                createBaseVNode("div", {
                  class: normalizeClass(unref(ns).e("group"))
                }, [
                  createBaseVNode("h2", {
                    class: normalizeClass(unref(ns).e("title")),
                    textContent: toDisplayString(_ctx.title)
                  }, null, 10, ["textContent"]),
                  withDirectives(createBaseVNode("div", {
                    class: normalizeClass(unref(ns).e("content")),
                    style: normalizeStyle$1(!!_ctx.title ? void 0 : { margin: 0 })
                  }, [
                    renderSlot(_ctx.$slots, "default", {}, () => [
                      !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", { key: 0 }, toDisplayString(_ctx.message), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                        createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
                        createBaseVNode("p", { innerHTML: _ctx.message }, null, 8, ["innerHTML"])
                      ], 2112))
                    ])
                  ], 6), [
                    [vShow, _ctx.message]
                  ]),
                  _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
                    key: 0,
                    class: normalizeClass(unref(ns).e("closeBtn")),
                    onClick: withModifiers(close2, ["stop"])
                  }, {
                    default: withCtx(() => [
                      (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon)))
                    ]),
                    _: 1
                  }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
                ], 2)
              ], 46, ["id", "onClick"]), [
                [vShow, visible.value]
              ])
            ]),
            _: 3
          }, 8, ["name", "onBeforeLeave", "onAfterLeave"]);
        };
      }
    });
    var NotificationConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "notification.vue"]]);
    const notifications = {
      "top-left": [],
      "top-right": [],
      "bottom-left": [],
      "bottom-right": []
    };
    const GAP_SIZE = 16;
    let seed = 1;
    const notify = function(options = {}, context) {
      if (!isClient)
        return { close: () => void 0 };
      if (isString$3(options) || isVNode(options)) {
        options = { message: options };
      }
      const position2 = options.position || "top-right";
      let verticalOffset = options.offset || 0;
      notifications[position2].forEach(({ vm: vm2 }) => {
        var _a2;
        verticalOffset += (((_a2 = vm2.el) == null ? void 0 : _a2.offsetHeight) || 0) + GAP_SIZE;
      });
      verticalOffset += GAP_SIZE;
      const id = `notification_${seed++}`;
      const userOnClose = options.onClose;
      const props2 = {
        ...options,
        offset: verticalOffset,
        id,
        onClose: () => {
          close(id, position2, userOnClose);
        }
      };
      let appendTo = document.body;
      if (isElement$1(options.appendTo)) {
        appendTo = options.appendTo;
      } else if (isString$3(options.appendTo)) {
        appendTo = document.querySelector(options.appendTo);
      }
      if (!isElement$1(appendTo)) {
        appendTo = document.body;
      }
      const container = document.createElement("div");
      const vm = createVNode$1(NotificationConstructor, props2, isFunction$4(props2.message) ? props2.message : isVNode(props2.message) ? () => props2.message : null);
      vm.appContext = isUndefined$1(context) ? notify._context : context;
      vm.props.onDestroy = () => {
        render$1(null, container);
      };
      render$1(vm, container);
      notifications[position2].push({ vm });
      appendTo.appendChild(container.firstElementChild);
      return {
        close: () => {
          vm.component.exposed.visible.value = false;
        }
      };
    };
    notificationTypes.forEach((type) => {
      notify[type] = (options = {}, appContext) => {
        if (isString$3(options) || isVNode(options)) {
          options = {
            message: options
          };
        }
        return notify({ ...options, type }, appContext);
      };
    });
    function close(id, position2, userOnClose) {
      const orientedNotifications = notifications[position2];
      const idx = orientedNotifications.findIndex(({ vm: vm2 }) => {
        var _a2;
        return ((_a2 = vm2.component) == null ? void 0 : _a2.props.id) === id;
      });
      if (idx === -1)
        return;
      const { vm } = orientedNotifications[idx];
      if (!vm)
        return;
      userOnClose == null ? void 0 : userOnClose(vm);
      const removedHeight = vm.el.offsetHeight;
      const verticalPos = position2.split("-")[0];
      orientedNotifications.splice(idx, 1);
      const len2 = orientedNotifications.length;
      if (len2 < 1)
        return;
      for (let i2 = idx; i2 < len2; i2++) {
        const { el, component: component2 } = orientedNotifications[i2].vm;
        const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
        component2.props.offset = pos;
      }
    }
    function closeAll() {
      for (const orientedNotifications of Object.values(notifications)) {
        orientedNotifications.forEach(({ vm }) => {
          vm.component.exposed.visible.value = false;
        });
      }
    }
    notify.closeAll = closeAll;
    notify._context = null;
    const ElNotification = withInstallFunction(notify, "$notify");
    var Plugins = [
      ElInfiniteScroll,
      ElLoading,
      ElMessage,
      ElMessageBox,
      ElNotification,
      ElPopoverDirective
    ];
    var installer = makeInstaller([...Components, ...Plugins]);
    const _sfc_main$7 = {
      name: "ProgressChart",
      props: {
        progress: {
          type: Number,
          default: 0
        }
      },
      setup(props2) {
        const chartRef = ref(null);
        let resizeObserver = null;
        const circumference = 2 * Math.PI * 45;
        const progressArray = computed(() => `${circumference} ${circumference}`);
        const progressOffset = computed(() => {
          const progressValue = typeof props2.progress === "number" ? props2.progress : 0;
          return circumference - progressValue / 100 * circumference;
        });
        onMounted(() => {
          if (chartRef.value) {
            resizeObserver = new ResizeObserver((entries) => {
              requestAnimationFrame(() => {
                for (const entry of entries) {
                  if (entry.target === chartRef.value) ;
                }
              });
            });
            resizeObserver.observe(chartRef.value);
          }
        });
        onUnmounted(() => {
          if (resizeObserver) {
            resizeObserver.disconnect();
            resizeObserver = null;
          }
        });
        return {
          progressArray,
          progressOffset,
          chartRef
        };
      }
    };
    const _hoisted_1$7 = { class: "progress-chart" };
    const _hoisted_2$6 = { class: "progress-circle" };
    const _hoisted_3$6 = { viewBox: "0 0 100 100" };
    const _hoisted_4$6 = ["stroke-dasharray", "stroke-dashoffset"];
    const _hoisted_5$6 = { class: "progress-text" };
    const _hoisted_6$6 = { class: "value" };
    function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", _hoisted_1$7, [
        createBaseVNode("div", _hoisted_2$6, [
          (openBlock(), createElementBlock("svg", _hoisted_3$6, [
            _cache[0] || (_cache[0] = createBaseVNode("circle", {
              cx: "50",
              cy: "50",
              r: "45",
              fill: "none",
              stroke: "rgba(0, 145, 255, 0.1)",
              "stroke-width": "6"
            }, null, -1)),
            createBaseVNode("circle", {
              cx: "50",
              cy: "50",
              r: "45",
              fill: "none",
              stroke: "url(#progressGradient)",
              "stroke-width": "6",
              "stroke-linecap": "round",
              "stroke-dasharray": $setup.progressArray,
              "stroke-dashoffset": $setup.progressOffset,
              transform: "rotate(-90 50 50)"
            }, null, 8, _hoisted_4$6),
            _cache[1] || (_cache[1] = createBaseVNode("defs", null, [
              createBaseVNode("linearGradient", {
                id: "progressGradient",
                x1: "0%",
                y1: "0%",
                x2: "100%",
                y2: "0%"
              }, [
                createBaseVNode("stop", {
                  offset: "0%",
                  "stop-color": "#00a8ff"
                }),
                createBaseVNode("stop", {
                  offset: "100%",
                  "stop-color": "#0091ff"
                })
              ])
            ], -1))
          ])),
          createBaseVNode("div", _hoisted_5$6, [
            createBaseVNode("span", _hoisted_6$6, toDisplayString(typeof $props.progress === "number" ? Math.round($props.progress) : 0) + "%", 1),
            _cache[2] || (_cache[2] = createBaseVNode("span", { class: "label" }, "实验进度", -1))
          ])
        ])
      ]);
    }
    const ProgressChart = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$5], ["__scopeId", "data-v-34a554b8"]]);
    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation.
    
    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.
    
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
    var extendStatics$1 = function(d2, b2) {
      extendStatics$1 = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
        d3.__proto__ = b3;
      } || function(d3, b3) {
        for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2];
      };
      return extendStatics$1(d2, b2);
    };
    function __extends$1(d2, b2) {
      if (typeof b2 !== "function" && b2 !== null)
        throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
      extendStatics$1(d2, b2);
      function __() {
        this.constructor = d2;
      }
      d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
    }
    var Browser = /* @__PURE__ */ function() {
      function Browser2() {
        this.firefox = false;
        this.ie = false;
        this.edge = false;
        this.newEdge = false;
        this.weChat = false;
      }
      return Browser2;
    }();
    var Env = /* @__PURE__ */ function() {
      function Env2() {
        this.browser = new Browser();
        this.node = false;
        this.wxa = false;
        this.worker = false;
        this.svgSupported = false;
        this.touchEventsSupported = false;
        this.pointerEventsSupported = false;
        this.domSupported = false;
        this.transformSupported = false;
        this.transform3dSupported = false;
        this.hasGlobalWindow = typeof window !== "undefined";
      }
      return Env2;
    }();
    var env = new Env();
    if (typeof wx === "object" && typeof wx.getSystemInfoSync === "function") {
      env.wxa = true;
      env.touchEventsSupported = true;
    } else if (typeof document === "undefined" && typeof self !== "undefined") {
      env.worker = true;
    } else if (!env.hasGlobalWindow || "Deno" in window) {
      env.node = true;
      env.svgSupported = true;
    } else {
      detect(navigator.userAgent, env);
    }
    function detect(ua, env2) {
      var browser = env2.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];
        browser.newEdge = +edge[1].split(".")[0] > 18;
      }
      if (weChat) {
        browser.weChat = true;
      }
      env2.svgSupported = typeof SVGRect !== "undefined";
      env2.touchEventsSupported = "ontouchstart" in window && !browser.ie && !browser.edge;
      env2.pointerEventsSupported = "onpointerdown" in window && (browser.edge || browser.ie && +browser.version >= 11);
      env2.domSupported = typeof document !== "undefined";
      var style = document.documentElement.style;
      env2.transform3dSupported = (browser.ie && "transition" in style || browser.edge || "WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix() || "MozPerspective" in style) && !("OTransition" in style);
      env2.transformSupported = env2.transform3dSupported || browser.ie && +browser.version >= 9;
    }
    var DEFAULT_FONT_SIZE = 12;
    var DEFAULT_FONT_FAMILY = "sans-serif";
    var DEFAULT_FONT = DEFAULT_FONT_SIZE + "px " + DEFAULT_FONT_FAMILY;
    var OFFSET = 20;
    var SCALE = 100;
    var defaultWidthMapStr = "007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";
    function getTextWidthMap(mapStr) {
      var map2 = {};
      if (typeof JSON === "undefined") {
        return map2;
      }
      for (var i2 = 0; i2 < mapStr.length; i2++) {
        var char = String.fromCharCode(i2 + 32);
        var size = (mapStr.charCodeAt(i2) - OFFSET) / SCALE;
        map2[char] = size;
      }
      return map2;
    }
    var DEFAULT_TEXT_WIDTH_MAP = getTextWidthMap(defaultWidthMapStr);
    var platformApi = {
      createCanvas: function() {
        return typeof document !== "undefined" && document.createElement("canvas");
      },
      measureText: /* @__PURE__ */ function() {
        var _ctx;
        var _cachedFont;
        return function(text, font) {
          if (!_ctx) {
            var canvas = platformApi.createCanvas();
            _ctx = canvas && canvas.getContext("2d");
          }
          if (_ctx) {
            if (_cachedFont !== font) {
              _cachedFont = _ctx.font = font || DEFAULT_FONT;
            }
            return _ctx.measureText(text);
          } else {
            text = text || "";
            font = font || DEFAULT_FONT;
            var res = /((?:\d+)?\.?\d*)px/.exec(font);
            var fontSize2 = res && +res[1] || DEFAULT_FONT_SIZE;
            var width = 0;
            if (font.indexOf("mono") >= 0) {
              width = fontSize2 * text.length;
            } else {
              for (var i2 = 0; i2 < text.length; i2++) {
                var preCalcWidth = DEFAULT_TEXT_WIDTH_MAP[text[i2]];
                width += preCalcWidth == null ? fontSize2 : preCalcWidth * fontSize2;
              }
            }
            return { width };
          }
        };
      }(),
      loadImage: function(src, onload, onerror) {
        var image2 = new Image();
        image2.onload = onload;
        image2.onerror = onerror;
        image2.src = src;
        return image2;
      }
    };
    var BUILTIN_OBJECT = reduce([
      "Function",
      "RegExp",
      "Date",
      "Error",
      "CanvasGradient",
      "CanvasPattern",
      "Image",
      "Canvas"
    ], function(obj, val) {
      obj["[object " + val + "]"] = true;
      return obj;
    }, {});
    var TYPED_ARRAY = reduce([
      "Int8",
      "Uint8",
      "Uint8Clamped",
      "Int16",
      "Uint16",
      "Int32",
      "Uint32",
      "Float32",
      "Float64"
    ], function(obj, val) {
      obj["[object " + val + "Array]"] = true;
      return obj;
    }, {});
    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 protoKey = "__proto__";
    var idStart = 2311;
    function guid() {
      return idStart++;
    }
    function logError() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      if (typeof console !== "undefined") {
        console.error.apply(console, args);
      }
    }
    function clone$4(source) {
      if (source == null || typeof source !== "object") {
        return source;
      }
      var result = source;
      var typeStr = objToString.call(source);
      if (typeStr === "[object Array]") {
        if (!isPrimitive(source)) {
          result = [];
          for (var i2 = 0, len2 = source.length; i2 < len2; i2++) {
            result[i2] = clone$4(source[i2]);
          }
        }
      } 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 i2 = 0, len2 = source.length; i2 < len2; i2++) {
              result[i2] = source[i2];
            }
          }
        }
      } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {
        result = {};
        for (var key in source) {
          if (source.hasOwnProperty(key) && key !== protoKey) {
            result[key] = clone$4(source[key]);
          }
        }
      }
      return result;
    }
    function merge$1(target, source, overwrite) {
      if (!isObject$5(source) || !isObject$5(target)) {
        return overwrite ? clone$4(source) : target;
      }
      for (var key in source) {
        if (source.hasOwnProperty(key) && key !== protoKey) {
          var targetProp = target[key];
          var sourceProp = source[key];
          if (isObject$5(sourceProp) && isObject$5(targetProp) && !isArray$2(sourceProp) && !isArray$2(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {
            merge$1(targetProp, sourceProp, overwrite);
          } else if (overwrite || !(key in target)) {
            target[key] = clone$4(source[key]);
          }
        }
      }
      return target;
    }
    function mergeAll(targetAndSources, overwrite) {
      var result = targetAndSources[0];
      for (var i2 = 1, len2 = targetAndSources.length; i2 < len2; i2++) {
        result = merge$1(result, targetAndSources[i2], overwrite);
      }
      return result;
    }
    function extend$1(target, source) {
      if (Object.assign) {
        Object.assign(target, source);
      } else {
        for (var key in source) {
          if (source.hasOwnProperty(key) && key !== protoKey) {
            target[key] = source[key];
          }
        }
      }
      return target;
    }
    function defaults$1(target, source, overlay) {
      var keysArr = keys$1(source);
      for (var i2 = 0, len2 = keysArr.length; i2 < len2; i2++) {
        var key = keysArr[i2];
        if (overlay ? source[key] != null : target[key] == null) {
          target[key] = source[key];
        }
      }
      return target;
    }
    function indexOf(array, value) {
      if (array) {
        if (array.indexOf) {
          return array.indexOf(value);
        }
        for (var i2 = 0, len2 = array.length; i2 < len2; i2++) {
          if (array[i2] === value) {
            return i2;
          }
        }
      }
      return -1;
    }
    function inherits$1(clazz, baseClazz) {
      var clazzPrototype = clazz.prototype;
      function F2() {
      }
      F2.prototype = baseClazz.prototype;
      clazz.prototype = new F2();
      for (var prop in clazzPrototype) {
        if (clazzPrototype.hasOwnProperty(prop)) {
          clazz.prototype[prop] = clazzPrototype[prop];
        }
      }
      clazz.prototype.constructor = clazz;
      clazz.superClass = baseClazz;
    }
    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 i2 = 0; i2 < keyList.length; i2++) {
          var key = keyList[i2];
          if (key !== "constructor") {
            if (override ? source[key] != null : target[key] == null) {
              target[key] = source[key];
            }
          }
        }
      } else {
        defaults$1(target, source, override);
      }
    }
    function isArrayLike(data) {
      if (!data) {
        return false;
      }
      if (typeof data === "string") {
        return false;
      }
      return typeof data.length === "number";
    }
    function each$f(arr, cb, context) {
      if (!(arr && cb)) {
        return;
      }
      if (arr.forEach && arr.forEach === nativeForEach) {
        arr.forEach(cb, context);
      } else if (arr.length === +arr.length) {
        for (var i2 = 0, len2 = arr.length; i2 < len2; i2++) {
          cb.call(context, arr[i2], i2, arr);
        }
      } else {
        for (var key in arr) {
          if (arr.hasOwnProperty(key)) {
            cb.call(context, arr[key], key, arr);
          }
        }
      }
    }
    function map$1(arr, cb, context) {
      if (!arr) {
        return [];
      }
      if (!cb) {
        return slice(arr);
      }
      if (arr.map && arr.map === nativeMap) {
        return arr.map(cb, context);
      } else {
        var result = [];
        for (var i2 = 0, len2 = arr.length; i2 < len2; i2++) {
          result.push(cb.call(context, arr[i2], i2, arr));
        }
        return result;
      }
    }
    function reduce(arr, cb, memo, context) {
      if (!(arr && cb)) {
        return;
      }
      for (var i2 = 0, len2 = arr.length; i2 < len2; i2++) {
        memo = cb.call(context, memo, arr[i2], i2, 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 {
        var result = [];
        for (var i2 = 0, len2 = arr.length; i2 < len2; i2++) {
          if (cb.call(context, arr[i2], i2, arr)) {
            result.push(arr[i2]);
          }
        }
        return result;
      }
    }
    function find(arr, cb, context) {
      if (!(arr && cb)) {
        return;
      }
      for (var i2 = 0, len2 = arr.length; i2 < len2; i2++) {
        if (cb.call(context, arr[i2], i2, arr)) {
          return arr[i2];
        }
      }
    }
    function keys$1(obj) {
      if (!obj) {
        return [];
      }
      if (Object.keys) {
        return Object.keys(obj);
      }
      var keyList = [];
      for (var key in obj) {
        if (obj.hasOwnProperty(key)) {
          keyList.push(key);
        }
      }
      return keyList;
    }
    function bindPolyfill(func, context) {
      var args = [];
      for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
      }
      return function() {
        return func.apply(context, args.concat(nativeSlice.call(arguments)));
      };
    }
    var bind$2 = protoFunction && isFunction$1(protoFunction.bind) ? protoFunction.call.bind(protoFunction.bind) : bindPolyfill;
    function curry$1(func) {
      var args = [];
      for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
      }
      return function() {
        return func.apply(this, args.concat(nativeSlice.call(arguments)));
      };
    }
    function isArray$2(value) {
      if (Array.isArray) {
        return Array.isArray(value);
      }
      return objToString.call(value) === "[object Array]";
    }
    function isFunction$1(value) {
      return typeof value === "function";
    }
    function isString$1(value) {
      return typeof value === "string";
    }
    function isStringSafe(value) {
      return objToString.call(value) === "[object String]";
    }
    function isNumber$1(value) {
      return typeof value === "number";
    }
    function isObject$5(value) {
      var type = typeof value;
      return type === "function" || !!value && type === "object";
    }
    function isBuiltInObject(value) {
      return !!BUILTIN_OBJECT[objToString.call(value)];
    }
    function isTypedArray$1(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 isImagePatternObject(value) {
      return value.image != null;
    }
    function isRegExp$1(value) {
      return objToString.call(value) === "[object RegExp]";
    }
    function eqNaN(value) {
      return value !== value;
    }
    function retrieve() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      for (var i2 = 0, len2 = args.length; i2 < len2; i2++) {
        if (args[i2] != null) {
          return args[i2];
        }
      }
    }
    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) {
      var args = [];
      for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
      }
      return nativeSlice.apply(arr, args);
    }
    function normalizeCssArray$1(val) {
      if (typeof val === "number") {
        return [val, val, val, val];
      }
      var 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, message2) {
      if (!condition) {
        throw new Error(message2);
      }
    }
    function trim$2(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, "");
      }
    }
    var primitiveKey = "__ec_primitive__";
    function setAsPrimitive(obj) {
      obj[primitiveKey] = true;
    }
    function isPrimitive(obj) {
      return obj[primitiveKey];
    }
    var MapPolyfill = function() {
      function MapPolyfill2() {
        this.data = {};
      }
      MapPolyfill2.prototype["delete"] = function(key) {
        var existed = this.has(key);
        if (existed) {
          delete this.data[key];
        }
        return existed;
      };
      MapPolyfill2.prototype.has = function(key) {
        return this.data.hasOwnProperty(key);
      };
      MapPolyfill2.prototype.get = function(key) {
        return this.data[key];
      };
      MapPolyfill2.prototype.set = function(key, value) {
        this.data[key] = value;
        return this;
      };
      MapPolyfill2.prototype.keys = function() {
        return keys$1(this.data);
      };
      MapPolyfill2.prototype.forEach = function(callback) {
        var data = this.data;
        for (var key in data) {
          if (data.hasOwnProperty(key)) {
            callback(data[key], key);
          }
        }
      };
      return MapPolyfill2;
    }();
    var isNativeMapSupported = typeof Map === "function";
    function maybeNativeMap() {
      return isNativeMapSupported ? /* @__PURE__ */ new Map() : new MapPolyfill();
    }
    var HashMap = function() {
      function HashMap2(obj) {
        var isArr = isArray$2(obj);
        this.data = maybeNativeMap();
        var thisMap = this;
        obj instanceof HashMap2 ? obj.each(visit) : obj && each$f(obj, visit);
        function visit(value, key) {
          isArr ? thisMap.set(value, key) : thisMap.set(key, value);
        }
      }
      HashMap2.prototype.hasKey = function(key) {
        return this.data.has(key);
      };
      HashMap2.prototype.get = function(key) {
        return this.data.get(key);
      };
      HashMap2.prototype.set = function(key, value) {
        this.data.set(key, value);
        return value;
      };
      HashMap2.prototype.each = function(cb, context) {
        this.data.forEach(function(value, key) {
          cb.call(context, value, key);
        });
      };
      HashMap2.prototype.keys = function() {
        var keys2 = this.data.keys();
        return isNativeMapSupported ? Array.from(keys2) : keys2;
      };
      HashMap2.prototype.removeKey = function(key) {
        this.data["delete"](key);
      };
      return HashMap2;
    }();
    function createHashMap(obj) {
      return new HashMap(obj);
    }
    function concatArray(a2, b2) {
      var newArray = new a2.constructor(a2.length + b2.length);
      for (var i2 = 0; i2 < a2.length; i2++) {
        newArray[i2] = a2[i2];
      }
      var offset2 = a2.length;
      for (var i2 = 0; i2 < b2.length; i2++) {
        newArray[i2 + offset2] = b2[i2];
      }
      return newArray;
    }
    function createObject(proto2, properties) {
      var obj;
      if (Object.create) {
        obj = Object.create(proto2);
      } else {
        var StyleCtor = function() {
        };
        StyleCtor.prototype = proto2;
        obj = new StyleCtor();
      }
      if (properties) {
        extend$1(obj, properties);
      }
      return obj;
    }
    function disableUserSelect(dom) {
      var domStyle = dom.style;
      domStyle.webkitUserSelect = "none";
      domStyle.userSelect = "none";
      domStyle.webkitTapHighlightColor = "rgba(0,0,0,0)";
      domStyle["-webkit-touch-callout"] = "none";
    }
    function hasOwn(own, prop) {
      return own.hasOwnProperty(prop);
    }
    function noop$1() {
    }
    var RADIAN_TO_DEGREE = 180 / Math.PI;
    function create$2(x2, y) {
      if (x2 == null) {
        x2 = 0;
      }
      if (y == null) {
        y = 0;
      }
      return [x2, y];
    }
    function copy$1(out2, v4) {
      out2[0] = v4[0];
      out2[1] = v4[1];
      return out2;
    }
    function clone$3(v4) {
      return [v4[0], v4[1]];
    }
    function set$1(out2, a2, b2) {
      out2[0] = a2;
      out2[1] = b2;
      return out2;
    }
    function add(out2, v12, v22) {
      out2[0] = v12[0] + v22[0];
      out2[1] = v12[1] + v22[1];
      return out2;
    }
    function scaleAndAdd$1(out2, v12, v22, a2) {
      out2[0] = v12[0] + v22[0] * a2;
      out2[1] = v12[1] + v22[1] * a2;
      return out2;
    }
    function sub(out2, v12, v22) {
      out2[0] = v12[0] - v22[0];
      out2[1] = v12[1] - v22[1];
      return out2;
    }
    function len(v4) {
      return Math.sqrt(lenSquare(v4));
    }
    function lenSquare(v4) {
      return v4[0] * v4[0] + v4[1] * v4[1];
    }
    function scale$2(out2, v4, s2) {
      out2[0] = v4[0] * s2;
      out2[1] = v4[1] * s2;
      return out2;
    }
    function normalize$3(out2, v4) {
      var d2 = len(v4);
      if (d2 === 0) {
        out2[0] = 0;
        out2[1] = 0;
      } else {
        out2[0] = v4[0] / d2;
        out2[1] = v4[1] / d2;
      }
      return out2;
    }
    function distance$1(v12, v22) {
      return Math.sqrt((v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1]));
    }
    var dist$1 = distance$1;
    function distanceSquare(v12, v22) {
      return (v12[0] - v22[0]) * (v12[0] - v22[0]) + (v12[1] - v22[1]) * (v12[1] - v22[1]);
    }
    var distSquare = distanceSquare;
    function lerp$2(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$1(out2, v4, m2) {
      var x2 = v4[0];
      var y = v4[1];
      out2[0] = m2[0] * x2 + m2[2] * y + m2[4];
      out2[1] = m2[1] * x2 + m2[3] * y + m2[5];
      return out2;
    }
    function min$1(out2, v12, v22) {
      out2[0] = Math.min(v12[0], v22[0]);
      out2[1] = Math.min(v12[1], v22[1]);
      return out2;
    }
    function max$1(out2, v12, v22) {
      out2[0] = Math.max(v12[0], v22[0]);
      out2[1] = Math.max(v12[1], v22[1]);
      return out2;
    }
    var Param = /* @__PURE__ */ function() {
      function Param2(target, e2) {
        this.target = target;
        this.topTarget = e2 && e2.topTarget;
      }
      return Param2;
    }();
    var Draggable = function() {
      function Draggable2(handler) {
        this.handler = handler;
        handler.on("mousedown", this._dragStart, this);
        handler.on("mousemove", this._drag, this);
        handler.on("mouseup", this._dragEnd, this);
      }
      Draggable2.prototype._dragStart = function(e2) {
        var draggingTarget = e2.target;
        while (draggingTarget && !draggingTarget.draggable) {
          draggingTarget = draggingTarget.parent || draggingTarget.__hostTarget;
        }
        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);
        }
      };
      Draggable2.prototype._drag = function(e2) {
        var draggingTarget = this._draggingTarget;
        if (draggingTarget) {
          var x2 = e2.offsetX;
          var y = e2.offsetY;
          var dx = x2 - this._x;
          var dy = y - this._y;
          this._x = x2;
          this._y = y;
          draggingTarget.drift(dx, dy, e2);
          this.handler.dispatchToElement(new Param(draggingTarget, e2), "drag", e2.event);
          var dropTarget = this.handler.findHover(x2, y, draggingTarget).target;
          var 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);
            }
          }
        }
      };
      Draggable2.prototype._dragEnd = function(e2) {
        var 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;
      };
      return Draggable2;
    }();
    var Eventful = function() {
      function Eventful2(eventProcessors) {
        if (eventProcessors) {
          this._$eventProcessor = eventProcessors;
        }
      }
      Eventful2.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);
        }
        if (!_h[event]) {
          _h[event] = [];
        }
        for (var i2 = 0; i2 < _h[event].length; i2++) {
          if (_h[event][i2].h === handler) {
            return this;
          }
        }
        var wrap = {
          h: handler,
          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;
      };
      Eventful2.prototype.isSilent = function(eventName) {
        var _h = this._$handlers;
        return !_h || !_h[eventName] || !_h[eventName].length;
      };
      Eventful2.prototype.off = function(eventType, handler) {
        var _h = this._$handlers;
        if (!_h) {
          return this;
        }
        if (!eventType) {
          this._$handlers = {};
          return this;
        }
        if (handler) {
          if (_h[eventType]) {
            var newList = [];
            for (var i2 = 0, l2 = _h[eventType].length; i2 < l2; i2++) {
              if (_h[eventType][i2].h !== handler) {
                newList.push(_h[eventType][i2]);
              }
            }
            _h[eventType] = newList;
          }
          if (_h[eventType] && _h[eventType].length === 0) {
            delete _h[eventType];
          }
        } else {
          delete _h[eventType];
        }
        return this;
      };
      Eventful2.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 len2 = _h.length;
          for (var i2 = 0; i2 < len2; i2++) {
            var hItem = _h[i2];
            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;
            }
          }
        }
        eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(eventType);
        return this;
      };
      Eventful2.prototype.triggerWithContext = function(type) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
          args[_i - 1] = arguments[_i];
        }
        if (!this._$handlers) {
          return this;
        }
        var _h = this._$handlers[type];
        var eventProcessor = this._$eventProcessor;
        if (_h) {
          var argLen = args.length;
          var ctx = args[argLen - 1];
          var len2 = _h.length;
          for (var i2 = 0; i2 < len2; i2++) {
            var hItem = _h[i2];
            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;
      };
      return Eventful2;
    }();
    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 sum2 = 0;
      for (var j = 0, colLocalIdx = 0; j < fullRank; j++) {
        var 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) {
      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]],
        [0, 0, 0, src[6], src[7], 1, -dest[7] * src[6], -dest[7] * src[7]]
      ];
      var detCache = {};
      var det = determinant(mA, 8, 0, 0, 0, detCache);
      if (det === 0) {
        return;
      }
      var vh = [];
      for (var i2 = 0; i2 < 8; i2++) {
        for (var j = 0; j < 8; j++) {
          vh[j] == null && (vh[j] = 0);
          vh[j] += ((i2 + j) % 2 ? -1 : 1) * determinant(mA, 7, i2 === 0 ? 1 : 0, 1 << i2, 1 << j, detCache) / det * dest[i2];
        }
      }
      return function(out2, srcPointX, srcPointY) {
        var 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;
      };
    }
    var EVENT_SAVED_PROP = "___zrEVENTSAVED";
    var _calcOut$1 = [];
    function transformLocalCoord(out2, elFrom, elTarget, inX, inY) {
      return transformCoordWithViewport(_calcOut$1, elFrom, inX, inY, true) && transformCoordWithViewport(out2, elTarget, _calcOut$1[0], _calcOut$1[1]);
    }
    function transformCoordWithViewport(out2, 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(out2, inX, inY);
          return true;
        }
      }
      return false;
    }
    function prepareCoordMarkers(el, saved) {
      var markers = saved.markers;
      if (markers) {
        return markers;
      }
      markers = saved.markers = [];
      var propLR = ["left", "right"];
      var propTB = ["top", "bottom"];
      for (var i2 = 0; i2 < 4; i2++) {
        var marker = document.createElement("div");
        var stl = marker.style;
        var idxLR = i2 % 2;
        var idxTB = (i2 >> 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) {
      var transformerName = inverse ? "invTrans" : "trans";
      var transformer = saved[transformerName];
      var oldSrcCoords = saved.srcCoords;
      var srcCoords = [];
      var destCoords = [];
      var oldCoordTheSame = true;
      for (var i2 = 0; i2 < 4; i2++) {
        var rect = markers[i2].getBoundingClientRect();
        var ii = 2 * i2;
        var x2 = rect.left;
        var y = rect.top;
        srcCoords.push(x2, y);
        oldCoordTheSame = oldCoordTheSame && oldSrcCoords && x2 === oldSrcCoords[ii] && y === oldSrcCoords[ii + 1];
        destCoords.push(markers[i2].offsetLeft, markers[i2].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";
    }
    var replaceReg = /([&<>"'])/g;
    var replaceMap = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    };
    function encodeHTML(source) {
      return source == null ? "" : (source + "").replace(replaceReg, function(str, c2) {
        return replaceMap[c2];
      });
    }
    var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/;
    var _calcOut = [];
    var firefoxNotSupportOffsetXY = env.browser.firefox && +env.browser.version.split(".")[0] < 39;
    function clientToLocal(el, e2, out2, calculate) {
      out2 = out2 || {};
      if (calculate) {
        calculateZrXY(el, e2, out2);
      } else if (firefoxNotSupportOffsetXY && 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.domSupported && el.getBoundingClientRect) {
        var ex = e2.clientX;
        var ey = e2.clientY;
        if (isCanvasEl(el)) {
          var box2 = el.getBoundingClientRect();
          out2.zrX = ex - box2.left;
          out2.zrY = ey - box2.top;
          return;
        } else {
          if (transformCoordWithViewport(_calcOut, el, ex, ey)) {
            out2.zrX = _calcOut[0];
            out2.zrY = _calcOut[1];
            return;
          }
        }
      }
      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;
      }
      var eventType = e2.type;
      var isTouch = eventType && eventType.indexOf("touch") >= 0;
      if (!isTouch) {
        clientToLocal(el, e2, e2, calculate);
        var wheelDelta = getWheelDeltaMayPolyfill(e2);
        e2.zrDelta = wheelDelta ? wheelDelta / 120 : -(e2.detail || 0) / 3;
      } else {
        var touch = eventType !== "touchend" ? e2.targetTouches[0] : e2.changedTouches[0];
        touch && clientToLocal(el, touch, e2, calculate);
      }
      var 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) {
      var rawWheelDelta = e2.wheelDelta;
      if (rawWheelDelta) {
        return rawWheelDelta;
      }
      var deltaX = e2.deltaX;
      var deltaY = e2.deltaY;
      if (deltaX == null || deltaY == null) {
        return rawWheelDelta;
      }
      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;
    }
    function addEventListener(el, name, handler, opt) {
      el.addEventListener(name, handler, opt);
    }
    function removeEventListener(el, name, handler, opt) {
      el.removeEventListener(name, handler, opt);
    }
    var stop = function(e2) {
      e2.preventDefault();
      e2.stopPropagation();
      e2.cancelBubble = true;
    };
    function isMiddleOrRightButtonOnMouseUpDown(e2) {
      return e2.which === 2 || e2.which === 3;
    }
    var GestureMgr = function() {
      function GestureMgr2() {
        this._track = [];
      }
      GestureMgr2.prototype.recognize = function(event, target, root2) {
        this._doTrack(event, target, root2);
        return this._recognize(event);
      };
      GestureMgr2.prototype.clear = function() {
        this._track.length = 0;
        return this;
      };
      GestureMgr2.prototype._doTrack = function(event, target, root2) {
        var touches = event.touches;
        if (!touches) {
          return;
        }
        var trackItem = {
          points: [],
          touches: [],
          target,
          event
        };
        for (var i2 = 0, len2 = touches.length; i2 < len2; i2++) {
          var touch = touches[i2];
          var pos = clientToLocal(root2, touch, {});
          trackItem.points.push([pos.zrX, pos.zrY]);
          trackItem.touches.push(touch);
        }
        this._track.push(trackItem);
      };
      GestureMgr2.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 GestureMgr2;
    }();
    function dist(pointPair) {
      var dx = pointPair[1][0] - pointPair[0][0];
      var dy = pointPair[1][1] - pointPair[0][1];
      return Math.sqrt(dx * dx + dy * dy);
    }
    function center$1(pointPair) {
      return [
        (pointPair[0][0] + pointPair[1][0]) / 2,
        (pointPair[0][1] + pointPair[1][1]) / 2
      ];
    }
    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(pinchEnd) / dist(pinchPre);
          !isFinite(pinchScale) && (pinchScale = 1);
          event.pinchScale = pinchScale;
          var pinchCenter = center$1(pinchEnd);
          event.pinchX = pinchCenter[0];
          event.pinchY = pinchCenter[1];
          return {
            type: "pinch",
            target: tracks[0].target,
            event
          };
        }
      }
    };
    function create$1() {
      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) {
      var out0 = m1[0] * m2[0] + m1[2] * m2[1];
      var out1 = m1[1] * m2[0] + m1[3] * m2[1];
      var out22 = 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];
      out2[0] = out0;
      out2[1] = out1;
      out2[2] = out22;
      out2[3] = out3;
      out2[4] = out4;
      out2[5] = out5;
      return out2;
    }
    function translate(out2, a2, v4) {
      out2[0] = a2[0];
      out2[1] = a2[1];
      out2[2] = a2[2];
      out2[3] = a2[3];
      out2[4] = a2[4] + v4[0];
      out2[5] = a2[5] + v4[1];
      return out2;
    }
    function rotate(out2, a2, rad, pivot) {
      if (pivot === void 0) {
        pivot = [0, 0];
      }
      var aa = a2[0];
      var ac = a2[2];
      var atx = a2[4];
      var ab = a2[1];
      var ad = a2[3];
      var aty = a2[5];
      var st2 = Math.sin(rad);
      var ct2 = Math.cos(rad);
      out2[0] = aa * ct2 + ab * st2;
      out2[1] = -aa * st2 + ab * ct2;
      out2[2] = ac * ct2 + ad * st2;
      out2[3] = -ac * st2 + ct2 * ad;
      out2[4] = ct2 * (atx - pivot[0]) + st2 * (aty - pivot[1]) + pivot[0];
      out2[5] = ct2 * (aty - pivot[1]) - st2 * (atx - pivot[0]) + pivot[1];
      return out2;
    }
    function scale$1(out2, a2, v4) {
      var vx = v4[0];
      var vy = v4[1];
      out2[0] = a2[0] * vx;
      out2[1] = a2[1] * vy;
      out2[2] = a2[2] * vx;
      out2[3] = a2[3] * vy;
      out2[4] = a2[4] * vx;
      out2[5] = a2[5] * vy;
      return out2;
    }
    function invert(out2, a2) {
      var aa = a2[0];
      var ac = a2[2];
      var atx = a2[4];
      var ab = a2[1];
      var ad = a2[3];
      var aty = a2[5];
      var 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$2(a2) {
      var b2 = create$1();
      copy(b2, a2);
      return b2;
    }
    var Point = function() {
      function Point2(x2, y) {
        this.x = x2 || 0;
        this.y = y || 0;
      }
      Point2.prototype.copy = function(other) {
        this.x = other.x;
        this.y = other.y;
        return this;
      };
      Point2.prototype.clone = function() {
        return new Point2(this.x, this.y);
      };
      Point2.prototype.set = function(x2, y) {
        this.x = x2;
        this.y = y;
        return this;
      };
      Point2.prototype.equal = function(other) {
        return other.x === this.x && other.y === this.y;
      };
      Point2.prototype.add = function(other) {
        this.x += other.x;
        this.y += other.y;
        return this;
      };
      Point2.prototype.scale = function(scalar) {
        this.x *= scalar;
        this.y *= scalar;
      };
      Point2.prototype.scaleAndAdd = function(other, scalar) {
        this.x += other.x * scalar;
        this.y += other.y * scalar;
      };
      Point2.prototype.sub = function(other) {
        this.x -= other.x;
        this.y -= other.y;
        return this;
      };
      Point2.prototype.dot = function(other) {
        return this.x * other.x + this.y * other.y;
      };
      Point2.prototype.len = function() {
        return Math.sqrt(this.x * this.x + this.y * this.y);
      };
      Point2.prototype.lenSquare = function() {
        return this.x * this.x + this.y * this.y;
      };
      Point2.prototype.normalize = function() {
        var len2 = this.len();
        this.x /= len2;
        this.y /= len2;
        return this;
      };
      Point2.prototype.distance = function(other) {
        var dx = this.x - other.x;
        var dy = this.y - other.y;
        return Math.sqrt(dx * dx + dy * dy);
      };
      Point2.prototype.distanceSquare = function(other) {
        var dx = this.x - other.x;
        var dy = this.y - other.y;
        return dx * dx + dy * dy;
      };
      Point2.prototype.negate = function() {
        this.x = -this.x;
        this.y = -this.y;
        return this;
      };
      Point2.prototype.transform = function(m2) {
        if (!m2) {
          return;
        }
        var x2 = this.x;
        var y = this.y;
        this.x = m2[0] * x2 + m2[2] * y + m2[4];
        this.y = m2[1] * x2 + m2[3] * y + m2[5];
        return this;
      };
      Point2.prototype.toArray = function(out2) {
        out2[0] = this.x;
        out2[1] = this.y;
        return out2;
      };
      Point2.prototype.fromArray = function(input) {
        this.x = input[0];
        this.y = input[1];
      };
      Point2.set = function(p2, x2, y) {
        p2.x = x2;
        p2.y = y;
      };
      Point2.copy = function(p2, p22) {
        p2.x = p22.x;
        p2.y = p22.y;
      };
      Point2.len = function(p2) {
        return Math.sqrt(p2.x * p2.x + p2.y * p2.y);
      };
      Point2.lenSquare = function(p2) {
        return p2.x * p2.x + p2.y * p2.y;
      };
      Point2.dot = function(p0, p1) {
        return p0.x * p1.x + p0.y * p1.y;
      };
      Point2.add = function(out2, p0, p1) {
        out2.x = p0.x + p1.x;
        out2.y = p0.y + p1.y;
      };
      Point2.sub = function(out2, p0, p1) {
        out2.x = p0.x - p1.x;
        out2.y = p0.y - p1.y;
      };
      Point2.scale = function(out2, p0, scalar) {
        out2.x = p0.x * scalar;
        out2.y = p0.y * scalar;
      };
      Point2.scaleAndAdd = function(out2, p0, p1, scalar) {
        out2.x = p0.x + p1.x * scalar;
        out2.y = p0.y + p1.y * scalar;
      };
      Point2.lerp = function(out2, p0, p1, t) {
        var onet = 1 - t;
        out2.x = onet * p0.x + t * p1.x;
        out2.y = onet * p0.y + t * p1.y;
      };
      return Point2;
    }();
    var mathMin$a = Math.min;
    var mathMax$a = Math.max;
    var lt = new Point();
    var rb = new Point();
    var lb = new Point();
    var rt = new Point();
    var minTv$1 = new Point();
    var maxTv$1 = new Point();
    var BoundingRect = function() {
      function BoundingRect2(x2, y, width, height) {
        if (width < 0) {
          x2 = x2 + width;
          width = -width;
        }
        if (height < 0) {
          y = y + height;
          height = -height;
        }
        this.x = x2;
        this.y = y;
        this.width = width;
        this.height = height;
      }
      BoundingRect2.prototype.union = function(other) {
        var x2 = mathMin$a(other.x, this.x);
        var y = mathMin$a(other.y, this.y);
        if (isFinite(this.x) && isFinite(this.width)) {
          this.width = mathMax$a(other.x + other.width, this.x + this.width) - x2;
        } else {
          this.width = other.width;
        }
        if (isFinite(this.y) && isFinite(this.height)) {
          this.height = mathMax$a(other.y + other.height, this.y + this.height) - y;
        } else {
          this.height = other.height;
        }
        this.x = x2;
        this.y = y;
      };
      BoundingRect2.prototype.applyTransform = function(m2) {
        BoundingRect2.applyTransform(this, this, m2);
      };
      BoundingRect2.prototype.calculateTransform = function(b2) {
        var a2 = this;
        var sx = b2.width / a2.width;
        var sy = b2.height / a2.height;
        var m2 = create$1();
        translate(m2, m2, [-a2.x, -a2.y]);
        scale$1(m2, m2, [sx, sy]);
        translate(m2, m2, [b2.x, b2.y]);
        return m2;
      };
      BoundingRect2.prototype.intersect = function(b2, mtv) {
        if (!b2) {
          return false;
        }
        if (!(b2 instanceof BoundingRect2)) {
          b2 = BoundingRect2.create(b2);
        }
        var a2 = this;
        var ax0 = a2.x;
        var ax1 = a2.x + a2.width;
        var ay0 = a2.y;
        var ay1 = a2.y + a2.height;
        var bx0 = b2.x;
        var bx1 = b2.x + b2.width;
        var by0 = b2.y;
        var by1 = b2.y + b2.height;
        var overlap = !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
        if (mtv) {
          var dMin = Infinity;
          var dMax = 0;
          var d0 = Math.abs(ax1 - bx0);
          var d1 = Math.abs(bx1 - ax0);
          var d2 = Math.abs(ay1 - by0);
          var d3 = Math.abs(by1 - ay0);
          var dx = Math.min(d0, d1);
          var dy = Math.min(d2, d3);
          if (ax1 < bx0 || bx1 < ax0) {
            if (dx > dMax) {
              dMax = dx;
              if (d0 < d1) {
                Point.set(maxTv$1, -d0, 0);
              } else {
                Point.set(maxTv$1, d1, 0);
              }
            }
          } else {
            if (dx < dMin) {
              dMin = dx;
              if (d0 < d1) {
                Point.set(minTv$1, d0, 0);
              } else {
                Point.set(minTv$1, -d1, 0);
              }
            }
          }
          if (ay1 < by0 || by1 < ay0) {
            if (dy > dMax) {
              dMax = dy;
              if (d2 < d3) {
                Point.set(maxTv$1, 0, -d2);
              } else {
                Point.set(maxTv$1, 0, d3);
              }
            }
          } else {
            if (dx < dMin) {
              dMin = dx;
              if (d2 < d3) {
                Point.set(minTv$1, 0, d2);
              } else {
                Point.set(minTv$1, 0, -d3);
              }
            }
          }
        }
        if (mtv) {
          Point.copy(mtv, overlap ? minTv$1 : maxTv$1);
        }
        return overlap;
      };
      BoundingRect2.prototype.contain = function(x2, y) {
        var rect = this;
        return x2 >= rect.x && x2 <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
      };
      BoundingRect2.prototype.clone = function() {
        return new BoundingRect2(this.x, this.y, this.width, this.height);
      };
      BoundingRect2.prototype.copy = function(other) {
        BoundingRect2.copy(this, other);
      };
      BoundingRect2.prototype.plain = function() {
        return {
          x: this.x,
          y: this.y,
          width: this.width,
          height: this.height
        };
      };
      BoundingRect2.prototype.isFinite = function() {
        return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height);
      };
      BoundingRect2.prototype.isZero = function() {
        return this.width === 0 || this.height === 0;
      };
      BoundingRect2.create = function(rect) {
        return new BoundingRect2(rect.x, rect.y, rect.width, rect.height);
      };
      BoundingRect2.copy = function(target, source) {
        target.x = source.x;
        target.y = source.y;
        target.width = source.width;
        target.height = source.height;
      };
      BoundingRect2.applyTransform = function(target, source, m2) {
        if (!m2) {
          if (target !== source) {
            BoundingRect2.copy(target, source);
          }
          return;
        }
        if (m2[1] < 1e-5 && m2[1] > -1e-5 && m2[2] < 1e-5 && m2[2] > -1e-5) {
          var sx = m2[0];
          var sy = m2[3];
          var tx = m2[4];
          var 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;
        }
        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$a(lt.x, rb.x, lb.x, rt.x);
        target.y = mathMin$a(lt.y, rb.y, lb.y, rt.y);
        var maxX = mathMax$a(lt.x, rb.x, lb.x, rt.x);
        var maxY = mathMax$a(lt.y, rb.y, lb.y, rt.y);
        target.width = maxX - target.x;
        target.height = maxY - target.y;
      };
      return BoundingRect2;
    }();
    var SILENT = "silent";
    function makeEventPacket(eveType, targetInfo, event) {
      return {
        type: eveType,
        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$1(EmptyProxy2, _super);
      function EmptyProxy2() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.handler = null;
        return _this;
      }
      EmptyProxy2.prototype.dispose = function() {
      };
      EmptyProxy2.prototype.setCursor = function() {
      };
      return EmptyProxy2;
    }(Eventful);
    var HoveredResult = /* @__PURE__ */ function() {
      function HoveredResult2(x2, y) {
        this.x = x2;
        this.y = y;
      }
      return HoveredResult2;
    }();
    var handlerNames = [
      "click",
      "dblclick",
      "mousewheel",
      "mouseout",
      "mouseup",
      "mousedown",
      "mousemove",
      "contextmenu"
    ];
    var tmpRect$1 = new BoundingRect(0, 0, 0, 0);
    var Handler = function(_super) {
      __extends$1(Handler2, _super);
      function Handler2(storage2, painter, proxy, painterRoot, pointerSize) {
        var _this = _super.call(this) || this;
        _this._hovered = new HoveredResult(0, 0);
        _this.storage = storage2;
        _this.painter = painter;
        _this.painterRoot = painterRoot;
        _this._pointerSize = pointerSize;
        proxy = proxy || new EmptyProxy();
        _this.proxy = null;
        _this.setHandlerProxy(proxy);
        _this._draggingMgr = new Draggable(_this);
        return _this;
      }
      Handler2.prototype.setHandlerProxy = function(proxy) {
        if (this.proxy) {
          this.proxy.dispose();
        }
        if (proxy) {
          each$f(handlerNames, function(name) {
            proxy.on && proxy.on(name, this[name], this);
          }, this);
          proxy.handler = this;
        }
        this.proxy = proxy;
      };
      Handler2.prototype.mousemove = function(event) {
        var x2 = event.zrX;
        var y = event.zrY;
        var isOutside = isOutsideBoundary(this, x2, y);
        var lastHovered = this._hovered;
        var lastHoveredTarget = lastHovered.target;
        if (lastHoveredTarget && !lastHoveredTarget.__zr) {
          lastHovered = this.findHover(lastHovered.x, lastHovered.y);
          lastHoveredTarget = lastHovered.target;
        }
        var hovered = this._hovered = isOutside ? new HoveredResult(x2, y) : this.findHover(x2, 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);
        }
        this.dispatchToElement(hovered, "mousemove", event);
        if (hoveredTarget && hoveredTarget !== lastHoveredTarget) {
          this.dispatchToElement(hovered, "mouseover", event);
        }
      };
      Handler2.prototype.mouseout = function(event) {
        var eventControl = event.zrEventControl;
        if (eventControl !== "only_globalout") {
          this.dispatchToElement(this._hovered, "mouseout", event);
        }
        if (eventControl !== "no_globalout") {
          this.trigger("globalout", { type: "globalout", event });
        }
      };
      Handler2.prototype.resize = function() {
        this._hovered = new HoveredResult(0, 0);
      };
      Handler2.prototype.dispatch = function(eventName, eventArgs) {
        var handler = this[eventName];
        handler && handler.call(this, eventArgs);
      };
      Handler2.prototype.dispose = function() {
        this.proxy.dispose();
        this.storage = null;
        this.proxy = null;
        this.painter = null;
      };
      Handler2.prototype.setCursorStyle = function(cursorStyle) {
        var proxy = this.proxy;
        proxy.setCursor && proxy.setCursor(cursorStyle);
      };
      Handler2.prototype.dispatchToElement = function(targetInfo, eventName, event) {
        targetInfo = targetInfo || {};
        var el = targetInfo.target;
        if (el && el.silent) {
          return;
        }
        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;
          }
        }
        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);
              }
            });
          }
        }
      };
      Handler2.prototype.findHover = function(x2, y, exclude) {
        var list = this.storage.getDisplayList();
        var out2 = new HoveredResult(x2, y);
        setHoverTarget(list, out2, x2, y, exclude);
        if (this._pointerSize && !out2.target) {
          var candidates = [];
          var pointerSize = this._pointerSize;
          var targetSizeHalf = pointerSize / 2;
          var pointerRect = new BoundingRect(x2 - targetSizeHalf, y - targetSizeHalf, pointerSize, pointerSize);
          for (var i2 = list.length - 1; i2 >= 0; i2--) {
            var el = list[i2];
            if (el !== exclude && !el.ignore && !el.ignoreCoarsePointer && (!el.parent || !el.parent.ignoreCoarsePointer)) {
              tmpRect$1.copy(el.getBoundingRect());
              if (el.transform) {
                tmpRect$1.applyTransform(el.transform);
              }
              if (tmpRect$1.intersect(pointerRect)) {
                candidates.push(el);
              }
            }
          }
          if (candidates.length) {
            var rStep = 4;
            var thetaStep = Math.PI / 12;
            var PI22 = Math.PI * 2;
            for (var r = 0; r < targetSizeHalf; r += rStep) {
              for (var theta = 0; theta < PI22; theta += thetaStep) {
                var x1 = x2 + r * Math.cos(theta);
                var y1 = y + r * Math.sin(theta);
                setHoverTarget(candidates, out2, x1, y1, exclude);
                if (out2.target) {
                  return out2;
                }
              }
            }
          }
        }
        return out2;
      };
      Handler2.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 Handler2;
    }(Eventful);
    each$f(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function(name) {
      Handler.prototype[name] = function(event) {
        var x2 = event.zrX;
        var y = event.zrY;
        var isOutside = isOutsideBoundary(this, x2, y);
        var hovered;
        var hoveredTarget;
        if (name !== "mouseup" || !isOutside) {
          hovered = this.findHover(x2, 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$1(this._downPoint, [event.zrX, event.zrY]) > 4) {
            return;
          }
          this._downPoint = null;
        }
        this.dispatchToElement(hovered, name, event);
      };
    });
    function isHover(displayable, x2, y) {
      if (displayable[displayable.rectHover ? "rectContain" : "contain"](x2, 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(x2, y)) {
              return false;
            }
          }
          if (el.silent) {
            isSilent = true;
          }
          var hostEl = el.__hostTarget;
          el = hostEl ? hostEl : el.parent;
        }
        return isSilent ? SILENT : true;
      }
      return false;
    }
    function setHoverTarget(list, out2, x2, y, exclude) {
      for (var i2 = list.length - 1; i2 >= 0; i2--) {
        var el = list[i2];
        var hoverCheckResult = void 0;
        if (el !== exclude && !el.ignore && (hoverCheckResult = isHover(el, x2, y))) {
          !out2.topTarget && (out2.topTarget = el);
          if (hoverCheckResult !== SILENT) {
            out2.target = el;
            break;
          }
        }
      }
    }
    function isOutsideBoundary(handlerInstance, x2, y) {
      var painter = handlerInstance.painter;
      return x2 < 0 || x2 > painter.getWidth() || y < 0 || y > painter.getHeight();
    }
    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;
      }
      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++;
        }
        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;
          }
        }
        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--;
            }
        }
        array[left] = pivot;
      }
    }
    function gallopLeft(value, array, start2, length, hint, compare2) {
      var lastOffset = 0;
      var maxOffset = 0;
      var offset2 = 1;
      if (compare2(value, array[start2 + hint]) > 0) {
        maxOffset = length - hint;
        while (offset2 < maxOffset && compare2(value, array[start2 + hint + offset2]) > 0) {
          lastOffset = offset2;
          offset2 = (offset2 << 1) + 1;
          if (offset2 <= 0) {
            offset2 = maxOffset;
          }
        }
        if (offset2 > maxOffset) {
          offset2 = maxOffset;
        }
        lastOffset += hint;
        offset2 += hint;
      } else {
        maxOffset = hint + 1;
        while (offset2 < maxOffset && compare2(value, array[start2 + hint - offset2]) <= 0) {
          lastOffset = offset2;
          offset2 = (offset2 << 1) + 1;
          if (offset2 <= 0) {
            offset2 = maxOffset;
          }
        }
        if (offset2 > maxOffset) {
          offset2 = maxOffset;
        }
        var tmp = lastOffset;
        lastOffset = hint - offset2;
        offset2 = hint - tmp;
      }
      lastOffset++;
      while (lastOffset < offset2) {
        var m2 = lastOffset + (offset2 - lastOffset >>> 1);
        if (compare2(value, array[start2 + m2]) > 0) {
          lastOffset = m2 + 1;
        } else {
          offset2 = m2;
        }
      }
      return offset2;
    }
    function gallopRight(value, array, start2, length, hint, compare2) {
      var lastOffset = 0;
      var maxOffset = 0;
      var offset2 = 1;
      if (compare2(value, array[start2 + hint]) < 0) {
        maxOffset = hint + 1;
        while (offset2 < maxOffset && compare2(value, array[start2 + hint - offset2]) < 0) {
          lastOffset = offset2;
          offset2 = (offset2 << 1) + 1;
          if (offset2 <= 0) {
            offset2 = maxOffset;
          }
        }
        if (offset2 > maxOffset) {
          offset2 = maxOffset;
        }
        var tmp = lastOffset;
        lastOffset = hint - offset2;
        offset2 = hint - tmp;
      } else {
        maxOffset = length - hint;
        while (offset2 < maxOffset && compare2(value, array[start2 + hint + offset2]) >= 0) {
          lastOffset = offset2;
          offset2 = (offset2 << 1) + 1;
          if (offset2 <= 0) {
            offset2 = maxOffset;
          }
        }
        if (offset2 > maxOffset) {
          offset2 = maxOffset;
        }
        lastOffset += hint;
        offset2 += hint;
      }
      lastOffset++;
      while (lastOffset < offset2) {
        var m2 = lastOffset + (offset2 - lastOffset >>> 1);
        if (compare2(value, array[start2 + m2]) < 0) {
          offset2 = m2;
        } else {
          lastOffset = m2 + 1;
        }
      }
      return offset2;
    }
    function TimSort(array, compare2) {
      var minGallop = DEFAULT_MIN_GALLOPING;
      var runStart;
      var runLength;
      var stackSize = 0;
      var tmp = [];
      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--;
            }
          } else if (runLength[n] > runLength[n + 1]) {
            break;
          }
          mergeAt(n);
        }
      }
      function forceMergeRuns() {
        while (stackSize > 1) {
          var n = stackSize - 2;
          if (n > 0 && runLength[n - 1] < runLength[n + 1]) {
            n--;
          }
          mergeAt(n);
        }
      }
      function mergeAt(i2) {
        var start1 = runStart[i2];
        var length1 = runLength[i2];
        var start2 = runStart[i2 + 1];
        var length2 = runLength[i2 + 1];
        runLength[i2] = length1 + length2;
        if (i2 === stackSize - 3) {
          runStart[i2 + 1] = runStart[i2 + 2];
          runLength[i2 + 1] = runLength[i2 + 2];
        }
        stackSize--;
        var k2 = gallopRight(array[start2], array, start1, length1, 0, compare2);
        start1 += k2;
        length1 -= k2;
        if (length1 === 0) {
          return;
        }
        length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare2);
        if (length2 === 0) {
          return;
        }
        if (length1 <= length2) {
          mergeLow(start1, length1, start2, length2);
        } else {
          mergeHigh(start1, length1, start2, length2);
        }
      }
      function mergeLow(start1, length1, start2, length2) {
        var i2 = 0;
        for (i2 = 0; i2 < length1; i2++) {
          tmp[i2] = array[start1 + i2];
        }
        var cursor1 = 0;
        var cursor2 = start2;
        var dest = start1;
        array[dest++] = array[cursor2++];
        if (--length2 === 0) {
          for (i2 = 0; i2 < length1; i2++) {
            array[dest + i2] = tmp[cursor1 + i2];
          }
          return;
        }
        if (length1 === 1) {
          for (i2 = 0; i2 < length2; i2++) {
            array[dest + i2] = array[cursor2 + i2];
          }
          array[dest + length2] = 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++];
              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, compare2);
            if (count1 !== 0) {
              for (i2 = 0; i2 < count1; i2++) {
                array[dest + i2] = tmp[cursor1 + i2];
              }
              dest += count1;
              cursor1 += count1;
              length1 -= count1;
              if (length1 <= 1) {
                exit = true;
                break;
              }
            }
            array[dest++] = array[cursor2++];
            if (--length2 === 0) {
              exit = true;
              break;
            }
            count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare2);
            if (count2 !== 0) {
              for (i2 = 0; i2 < count2; i2++) {
                array[dest + i2] = array[cursor2 + i2];
              }
              dest += count2;
              cursor2 += count2;
              length2 -= count2;
              if (length2 === 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;
          }
          if (_minGallop < 0) {
            _minGallop = 0;
          }
          _minGallop += 2;
        }
        minGallop = _minGallop;
        minGallop < 1 && (minGallop = 1);
        if (length1 === 1) {
          for (i2 = 0; i2 < length2; i2++) {
            array[dest + i2] = array[cursor2 + i2];
          }
          array[dest + length2] = tmp[cursor1];
        } else if (length1 === 0) {
          throw new Error();
        } else {
          for (i2 = 0; i2 < length1; i2++) {
            array[dest + i2] = tmp[cursor1 + i2];
          }
        }
      }
      function mergeHigh(start1, length1, start2, length2) {
        var i2 = 0;
        for (i2 = 0; i2 < length2; i2++) {
          tmp[i2] = array[start2 + i2];
        }
        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 (i2 = 0; i2 < length2; i2++) {
            array[customCursor + i2] = tmp[i2];
          }
          return;
        }
        if (length2 === 1) {
          dest -= length1;
          cursor1 -= length1;
          customDest = dest + 1;
          customCursor = cursor1 + 1;
          for (i2 = length1 - 1; i2 >= 0; i2--) {
            array[customDest + i2] = array[customCursor + i2];
          }
          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--];
              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, compare2);
            if (count1 !== 0) {
              dest -= count1;
              cursor1 -= count1;
              length1 -= count1;
              customDest = dest + 1;
              customCursor = cursor1 + 1;
              for (i2 = count1 - 1; i2 >= 0; i2--) {
                array[customDest + i2] = array[customCursor + i2];
              }
              if (length1 === 0) {
                exit = true;
                break;
              }
            }
            array[dest--] = tmp[cursor2--];
            if (--length2 === 1) {
              exit = true;
              break;
            }
            count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare2);
            if (count2 !== 0) {
              dest -= count2;
              cursor2 -= count2;
              length2 -= count2;
              customDest = dest + 1;
              customCursor = cursor2 + 1;
              for (i2 = 0; i2 < count2; i2++) {
                array[customDest + i2] = tmp[customCursor + i2];
              }
              if (length2 <= 1) {
                exit = true;
                break;
              }
            }
            array[dest--] = array[cursor1--];
            if (--length1 === 0) {
              exit = true;
              break;
            }
            _minGallop--;
          } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
          if (exit) {
            break;
          }
          if (_minGallop < 0) {
            _minGallop = 0;
          }
          _minGallop += 2;
        }
        minGallop = _minGallop;
        if (minGallop < 1) {
          minGallop = 1;
        }
        if (length2 === 1) {
          dest -= length1;
          cursor1 -= length1;
          customDest = dest + 1;
          customCursor = cursor1 + 1;
          for (i2 = length1 - 1; i2 >= 0; i2--) {
            array[customDest + i2] = array[customCursor + i2];
          }
          array[dest] = tmp[cursor2];
        } else if (length2 === 0) {
          throw new Error();
        } else {
          customCursor = dest - (length2 - 1);
          for (i2 = 0; i2 < length2; i2++) {
            array[customCursor + i2] = tmp[i2];
          }
        }
      }
      return {
        mergeRuns,
        forceMergeRuns,
        pushRun
      };
    }
    function sort$2(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();
    }
    var REDRAW_BIT = 1;
    var STYLE_CHANGED_BIT = 2;
    var SHAPE_CHANGED_BIT = 4;
    var 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(a2, b2) {
      if (a2.zlevel === b2.zlevel) {
        if (a2.z === b2.z) {
          return a2.z2 - b2.z2;
        }
        return a2.z - b2.z;
      }
      return a2.zlevel - b2.zlevel;
    }
    var Storage = function() {
      function Storage2() {
        this._roots = [];
        this._displayList = [];
        this._displayListLen = 0;
        this.displayableSortFunc = shapeCompareFunc;
      }
      Storage2.prototype.traverse = function(cb, context) {
        for (var i2 = 0; i2 < this._roots.length; i2++) {
          this._roots[i2].traverse(cb, context);
        }
      };
      Storage2.prototype.getDisplayList = function(update, includeIgnore) {
        includeIgnore = includeIgnore || false;
        var displayList = this._displayList;
        if (update || !displayList.length) {
          this.updateDisplayList(includeIgnore);
        }
        return displayList;
      };
      Storage2.prototype.updateDisplayList = function(includeIgnore) {
        this._displayListLen = 0;
        var roots2 = this._roots;
        var displayList = this._displayList;
        for (var i2 = 0, len2 = roots2.length; i2 < len2; i2++) {
          this._updateAndAddDisplayable(roots2[i2], null, includeIgnore);
        }
        displayList.length = this._displayListLen;
        sort$2(displayList, shapeCompareFunc);
      };
      Storage2.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 i2 = 0; i2 < children.length; i2++) {
            var child = children[i2];
            if (el.__dirty) {
              child.__dirty |= REDRAW_BIT;
            }
            this._updateAndAddDisplayable(child, clipPaths, includeIgnore);
          }
          el.__dirty = 0;
        } 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 decalEl = el.getDecalElement && el.getDecalElement();
        if (decalEl) {
          this._updateAndAddDisplayable(decalEl, clipPaths, includeIgnore);
        }
        var textGuide = el.getTextGuideLine();
        if (textGuide) {
          this._updateAndAddDisplayable(textGuide, clipPaths, includeIgnore);
        }
        var textEl = el.getTextContent();
        if (textEl) {
          this._updateAndAddDisplayable(textEl, clipPaths, includeIgnore);
        }
      };
      Storage2.prototype.addRoot = function(el) {
        if (el.__zr && el.__zr.storage === this) {
          return;
        }
        this._roots.push(el);
      };
      Storage2.prototype.delRoot = function(el) {
        if (el instanceof Array) {
          for (var i2 = 0, l2 = el.length; i2 < l2; i2++) {
            this.delRoot(el[i2]);
          }
          return;
        }
        var idx = indexOf(this._roots, el);
        if (idx >= 0) {
          this._roots.splice(idx, 1);
        }
      };
      Storage2.prototype.delAllRoots = function() {
        this._roots = [];
        this._displayList = [];
        this._displayListLen = 0;
        return;
      };
      Storage2.prototype.getRoots = function() {
        return this._roots;
      };
      Storage2.prototype.dispose = function() {
        this._displayList = null;
        this._roots = null;
      };
      return Storage2;
    }();
    var requestAnimationFrame$1;
    requestAnimationFrame$1 = env.hasGlobalWindow && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function(func) {
      return setTimeout(func, 16);
    };
    var easingFuncs = {
      linear: function(k2) {
        return k2;
      },
      quadraticIn: function(k2) {
        return k2 * k2;
      },
      quadraticOut: function(k2) {
        return k2 * (2 - k2);
      },
      quadraticInOut: function(k2) {
        if ((k2 *= 2) < 1) {
          return 0.5 * k2 * k2;
        }
        return -0.5 * (--k2 * (k2 - 2) - 1);
      },
      cubicIn: function(k2) {
        return k2 * k2 * k2;
      },
      cubicOut: function(k2) {
        return --k2 * k2 * k2 + 1;
      },
      cubicInOut: function(k2) {
        if ((k2 *= 2) < 1) {
          return 0.5 * k2 * k2 * k2;
        }
        return 0.5 * ((k2 -= 2) * k2 * k2 + 2);
      },
      quarticIn: function(k2) {
        return k2 * k2 * k2 * k2;
      },
      quarticOut: function(k2) {
        return 1 - --k2 * k2 * k2 * k2;
      },
      quarticInOut: function(k2) {
        if ((k2 *= 2) < 1) {
          return 0.5 * k2 * k2 * k2 * k2;
        }
        return -0.5 * ((k2 -= 2) * k2 * k2 * k2 - 2);
      },
      quinticIn: function(k2) {
        return k2 * k2 * k2 * k2 * k2;
      },
      quinticOut: function(k2) {
        return --k2 * k2 * k2 * k2 * k2 + 1;
      },
      quinticInOut: function(k2) {
        if ((k2 *= 2) < 1) {
          return 0.5 * k2 * k2 * k2 * k2 * k2;
        }
        return 0.5 * ((k2 -= 2) * k2 * k2 * k2 * k2 + 2);
      },
      sinusoidalIn: function(k2) {
        return 1 - Math.cos(k2 * Math.PI / 2);
      },
      sinusoidalOut: function(k2) {
        return Math.sin(k2 * Math.PI / 2);
      },
      sinusoidalInOut: function(k2) {
        return 0.5 * (1 - Math.cos(Math.PI * k2));
      },
      exponentialIn: function(k2) {
        return k2 === 0 ? 0 : Math.pow(1024, k2 - 1);
      },
      exponentialOut: function(k2) {
        return k2 === 1 ? 1 : 1 - Math.pow(2, -10 * k2);
      },
      exponentialInOut: function(k2) {
        if (k2 === 0) {
          return 0;
        }
        if (k2 === 1) {
          return 1;
        }
        if ((k2 *= 2) < 1) {
          return 0.5 * Math.pow(1024, k2 - 1);
        }
        return 0.5 * (-Math.pow(2, -10 * (k2 - 1)) + 2);
      },
      circularIn: function(k2) {
        return 1 - Math.sqrt(1 - k2 * k2);
      },
      circularOut: function(k2) {
        return Math.sqrt(1 - --k2 * k2);
      },
      circularInOut: function(k2) {
        if ((k2 *= 2) < 1) {
          return -0.5 * (Math.sqrt(1 - k2 * k2) - 1);
        }
        return 0.5 * (Math.sqrt(1 - (k2 -= 2) * k2) + 1);
      },
      elasticIn: function(k2) {
        var s2;
        var a2 = 0.1;
        var p2 = 0.4;
        if (k2 === 0) {
          return 0;
        }
        if (k2 === 1) {
          return 1;
        }
        if (!a2 || a2 < 1) {
          a2 = 1;
          s2 = p2 / 4;
        } else {
          s2 = p2 * Math.asin(1 / a2) / (2 * Math.PI);
        }
        return -(a2 * Math.pow(2, 10 * (k2 -= 1)) * Math.sin((k2 - s2) * (2 * Math.PI) / p2));
      },
      elasticOut: function(k2) {
        var s2;
        var a2 = 0.1;
        var p2 = 0.4;
        if (k2 === 0) {
          return 0;
        }
        if (k2 === 1) {
          return 1;
        }
        if (!a2 || a2 < 1) {
          a2 = 1;
          s2 = p2 / 4;
        } else {
          s2 = p2 * Math.asin(1 / a2) / (2 * Math.PI);
        }
        return a2 * Math.pow(2, -10 * k2) * Math.sin((k2 - s2) * (2 * Math.PI) / p2) + 1;
      },
      elasticInOut: function(k2) {
        var s2;
        var a2 = 0.1;
        var p2 = 0.4;
        if (k2 === 0) {
          return 0;
        }
        if (k2 === 1) {
          return 1;
        }
        if (!a2 || a2 < 1) {
          a2 = 1;
          s2 = p2 / 4;
        } else {
          s2 = p2 * Math.asin(1 / a2) / (2 * Math.PI);
        }
        if ((k2 *= 2) < 1) {
          return -0.5 * (a2 * Math.pow(2, 10 * (k2 -= 1)) * Math.sin((k2 - s2) * (2 * Math.PI) / p2));
        }
        return a2 * Math.pow(2, -10 * (k2 -= 1)) * Math.sin((k2 - s2) * (2 * Math.PI) / p2) * 0.5 + 1;
      },
      backIn: function(k2) {
        var s2 = 1.70158;
        return k2 * k2 * ((s2 + 1) * k2 - s2);
      },
      backOut: function(k2) {
        var s2 = 1.70158;
        return --k2 * k2 * ((s2 + 1) * k2 + s2) + 1;
      },
      backInOut: function(k2) {
        var s2 = 1.70158 * 1.525;
        if ((k2 *= 2) < 1) {
          return 0.5 * (k2 * k2 * ((s2 + 1) * k2 - s2));
        }
        return 0.5 * ((k2 -= 2) * k2 * ((s2 + 1) * k2 + s2) + 2);
      },
      bounceIn: function(k2) {
        return 1 - easingFuncs.bounceOut(1 - k2);
      },
      bounceOut: function(k2) {
        if (k2 < 1 / 2.75) {
          return 7.5625 * k2 * k2;
        } else if (k2 < 2 / 2.75) {
          return 7.5625 * (k2 -= 1.5 / 2.75) * k2 + 0.75;
        } else if (k2 < 2.5 / 2.75) {
          return 7.5625 * (k2 -= 2.25 / 2.75) * k2 + 0.9375;
        } else {
          return 7.5625 * (k2 -= 2.625 / 2.75) * k2 + 0.984375;
        }
      },
      bounceInOut: function(k2) {
        if (k2 < 0.5) {
          return easingFuncs.bounceIn(k2 * 2) * 0.5;
        }
        return easingFuncs.bounceOut(k2 * 2 - 1) * 0.5 + 0.5;
      }
    };
    var mathPow$2 = Math.pow;
    var mathSqrt$3 = Math.sqrt;
    var EPSILON$4 = 1e-8;
    var EPSILON_NUMERIC = 1e-4;
    var THREE_SQRT = mathSqrt$3(3);
    var ONE_THIRD = 1 / 3;
    var _v0 = create$2();
    var _v1 = create$2();
    var _v2 = create$2();
    function isAroundZero$1(val) {
      return val > -1e-8 && val < EPSILON$4;
    }
    function isNotAroundZero$1(val) {
      return val > EPSILON$4 || val < -1e-8;
    }
    function cubicAt(p0, p1, p2, p3, t) {
      var 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) {
      var 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) {
      var a2 = p3 + 3 * (p1 - p2) - p0;
      var b2 = 3 * (p2 - p1 * 2 + p0);
      var c2 = 3 * (p1 - p0);
      var d2 = p0 - val;
      var A2 = b2 * b2 - 3 * a2 * c2;
      var B3 = b2 * c2 - 9 * a2 * d2;
      var C2 = c2 * c2 - 3 * b2 * d2;
      var n = 0;
      if (isAroundZero$1(A2) && isAroundZero$1(B3)) {
        if (isAroundZero$1(b2)) {
          roots2[0] = 0;
        } else {
          var t1 = -c2 / b2;
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
        }
      } else {
        var disc = B3 * B3 - 4 * A2 * C2;
        if (isAroundZero$1(disc)) {
          var K2 = B3 / A2;
          var t1 = -b2 / a2 + K2;
          var t2 = -K2 / 2;
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
          if (t2 >= 0 && t2 <= 1) {
            roots2[n++] = t2;
          }
        } else if (disc > 0) {
          var discSqrt = mathSqrt$3(disc);
          var Y1 = A2 * b2 + 1.5 * a2 * (-B3 + discSqrt);
          var Y2 = A2 * b2 + 1.5 * a2 * (-B3 - discSqrt);
          if (Y1 < 0) {
            Y1 = -mathPow$2(-Y1, ONE_THIRD);
          } else {
            Y1 = mathPow$2(Y1, ONE_THIRD);
          }
          if (Y2 < 0) {
            Y2 = -mathPow$2(-Y2, ONE_THIRD);
          } else {
            Y2 = mathPow$2(Y2, ONE_THIRD);
          }
          var t1 = (-b2 - (Y1 + Y2)) / (3 * a2);
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
        } else {
          var T2 = (2 * A2 * b2 - 3 * a2 * B3) / (2 * mathSqrt$3(A2 * A2 * A2));
          var theta = Math.acos(T2) / 3;
          var ASqrt = mathSqrt$3(A2);
          var tmp = Math.cos(theta);
          var t1 = (-b2 - 2 * ASqrt * tmp) / (3 * a2);
          var t2 = (-b2 + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a2);
          var t3 = (-b2 + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a2);
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
          if (t2 >= 0 && t2 <= 1) {
            roots2[n++] = t2;
          }
          if (t3 >= 0 && t3 <= 1) {
            roots2[n++] = t3;
          }
        }
      }
      return n;
    }
    function cubicExtrema(p0, p1, p2, p3, extrema2) {
      var b2 = 6 * p2 - 12 * p1 + 6 * p0;
      var a2 = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
      var c2 = 3 * p1 - 3 * p0;
      var n = 0;
      if (isAroundZero$1(a2)) {
        if (isNotAroundZero$1(b2)) {
          var t1 = -c2 / b2;
          if (t1 >= 0 && t1 <= 1) {
            extrema2[n++] = t1;
          }
        }
      } else {
        var disc = b2 * b2 - 4 * a2 * c2;
        if (isAroundZero$1(disc)) {
          extrema2[0] = -b2 / (2 * a2);
        } else if (disc > 0) {
          var discSqrt = mathSqrt$3(disc);
          var t1 = (-b2 + discSqrt) / (2 * a2);
          var t2 = (-b2 - discSqrt) / (2 * a2);
          if (t1 >= 0 && t1 <= 1) {
            extrema2[n++] = t1;
          }
          if (t2 >= 0 && t2 <= 1) {
            extrema2[n++] = t2;
          }
        }
      }
      return n;
    }
    function cubicSubdivide(p0, p1, p2, p3, t, out2) {
      var p01 = (p1 - p0) * t + p0;
      var p12 = (p2 - p1) * t + p1;
      var p23 = (p3 - p2) * t + p2;
      var p012 = (p12 - p01) * t + p01;
      var p123 = (p23 - p12) * t + p12;
      var p0123 = (p123 - p012) * t + p012;
      out2[0] = p0;
      out2[1] = p01;
      out2[2] = p012;
      out2[3] = p0123;
      out2[4] = p0123;
      out2[5] = p123;
      out2[6] = p23;
      out2[7] = p3;
    }
    function cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x4, y, out2) {
      var t;
      var interval = 5e-3;
      var d2 = Infinity;
      var prev;
      var next;
      var d1;
      var d22;
      _v0[0] = x4;
      _v0[1] = y;
      for (var _t2 = 0; _t2 < 1; _t2 += 0.05) {
        _v1[0] = cubicAt(x0, x1, x2, x3, _t2);
        _v1[1] = cubicAt(y0, y1, y2, y3, _t2);
        d1 = distSquare(_v0, _v1);
        if (d1 < d2) {
          t = _t2;
          d2 = d1;
        }
      }
      d2 = Infinity;
      for (var i2 = 0; i2 < 32; i2++) {
        if (interval < EPSILON_NUMERIC) {
          break;
        }
        prev = t - interval;
        next = t + interval;
        _v1[0] = cubicAt(x0, x1, x2, x3, prev);
        _v1[1] = cubicAt(y0, y1, y2, y3, prev);
        d1 = distSquare(_v1, _v0);
        if (prev >= 0 && d1 < d2) {
          t = prev;
          d2 = d1;
        } else {
          _v2[0] = cubicAt(x0, x1, x2, x3, next);
          _v2[1] = cubicAt(y0, y1, y2, y3, next);
          d22 = distSquare(_v2, _v0);
          if (next <= 1 && d22 < d2) {
            t = next;
            d2 = d22;
          } else {
            interval *= 0.5;
          }
        }
      }
      if (out2) {
        out2[0] = cubicAt(x0, x1, x2, x3, t);
        out2[1] = cubicAt(y0, y1, y2, y3, t);
      }
      return mathSqrt$3(d2);
    }
    function cubicLength(x0, y0, x1, y1, x2, y2, x3, y3, iteration) {
      var px = x0;
      var py = y0;
      var d2 = 0;
      var step = 1 / iteration;
      for (var i2 = 1; i2 <= iteration; i2++) {
        var t = i2 * step;
        var x4 = cubicAt(x0, x1, x2, x3, t);
        var y = cubicAt(y0, y1, y2, y3, t);
        var dx = x4 - px;
        var dy = y - py;
        d2 += Math.sqrt(dx * dx + dy * dy);
        px = x4;
        py = y;
      }
      return d2;
    }
    function quadraticAt$1(p0, p1, p2, t) {
      var onet = 1 - t;
      return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
    }
    function quadraticDerivativeAt(p0, p1, p2, t) {
      return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
    }
    function quadraticRootAt(p0, p1, p2, val, roots2) {
      var a2 = p0 - 2 * p1 + p2;
      var b2 = 2 * (p1 - p0);
      var c2 = p0 - val;
      var n = 0;
      if (isAroundZero$1(a2)) {
        if (isNotAroundZero$1(b2)) {
          var t1 = -c2 / b2;
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
        }
      } else {
        var disc = b2 * b2 - 4 * a2 * c2;
        if (isAroundZero$1(disc)) {
          var t1 = -b2 / (2 * a2);
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
        } else if (disc > 0) {
          var discSqrt = mathSqrt$3(disc);
          var t1 = (-b2 + discSqrt) / (2 * a2);
          var t2 = (-b2 - discSqrt) / (2 * a2);
          if (t1 >= 0 && t1 <= 1) {
            roots2[n++] = t1;
          }
          if (t2 >= 0 && t2 <= 1) {
            roots2[n++] = t2;
          }
        }
      }
      return n;
    }
    function quadraticExtremum(p0, p1, p2) {
      var divider = p0 + p2 - 2 * p1;
      if (divider === 0) {
        return 0.5;
      } else {
        return (p0 - p1) / divider;
      }
    }
    function quadraticSubdivide(p0, p1, p2, t, out2) {
      var p01 = (p1 - p0) * t + p0;
      var p12 = (p2 - p1) * t + p1;
      var p012 = (p12 - p01) * t + p01;
      out2[0] = p0;
      out2[1] = p01;
      out2[2] = p012;
      out2[3] = p012;
      out2[4] = p12;
      out2[5] = p2;
    }
    function quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x3, y, out2) {
      var t;
      var interval = 5e-3;
      var d2 = Infinity;
      _v0[0] = x3;
      _v0[1] = y;
      for (var _t2 = 0; _t2 < 1; _t2 += 0.05) {
        _v1[0] = quadraticAt$1(x0, x1, x2, _t2);
        _v1[1] = quadraticAt$1(y0, y1, y2, _t2);
        var d1 = distSquare(_v0, _v1);
        if (d1 < d2) {
          t = _t2;
          d2 = d1;
        }
      }
      d2 = Infinity;
      for (var i2 = 0; i2 < 32; i2++) {
        if (interval < EPSILON_NUMERIC) {
          break;
        }
        var prev = t - interval;
        var next = t + interval;
        _v1[0] = quadraticAt$1(x0, x1, x2, prev);
        _v1[1] = quadraticAt$1(y0, y1, y2, prev);
        var d1 = distSquare(_v1, _v0);
        if (prev >= 0 && d1 < d2) {
          t = prev;
          d2 = d1;
        } else {
          _v2[0] = quadraticAt$1(x0, x1, x2, next);
          _v2[1] = quadraticAt$1(y0, y1, y2, next);
          var d22 = distSquare(_v2, _v0);
          if (next <= 1 && d22 < d2) {
            t = next;
            d2 = d22;
          } else {
            interval *= 0.5;
          }
        }
      }
      if (out2) {
        out2[0] = quadraticAt$1(x0, x1, x2, t);
        out2[1] = quadraticAt$1(y0, y1, y2, t);
      }
      return mathSqrt$3(d2);
    }
    function quadraticLength(x0, y0, x1, y1, x2, y2, iteration) {
      var px = x0;
      var py = y0;
      var d2 = 0;
      var step = 1 / iteration;
      for (var i2 = 1; i2 <= iteration; i2++) {
        var t = i2 * step;
        var x3 = quadraticAt$1(x0, x1, x2, t);
        var y = quadraticAt$1(y0, y1, y2, t);
        var dx = x3 - px;
        var dy = y - py;
        d2 += Math.sqrt(dx * dx + dy * dy);
        px = x3;
        py = y;
      }
      return d2;
    }
    var regexp = /cubic-bezier\(([0-9,\.e ]+)\)/;
    function createCubicEasingFunc(cubicEasingStr) {
      var cubic = cubicEasingStr && regexp.exec(cubicEasingStr);
      if (cubic) {
        var points2 = cubic[1].split(",");
        var a_1 = +trim$2(points2[0]);
        var b_1 = +trim$2(points2[1]);
        var c_1 = +trim$2(points2[2]);
        var d_1 = +trim$2(points2[3]);
        if (isNaN(a_1 + b_1 + c_1 + d_1)) {
          return;
        }
        var roots_1 = [];
        return function(p2) {
          return p2 <= 0 ? 0 : p2 >= 1 ? 1 : cubicRootAt(0, a_1, c_1, 1, p2, roots_1) && cubicAt(0, b_1, d_1, 1, roots_1[0]);
        };
      }
    }
    var Clip = function() {
      function Clip2(opts) {
        this._inited = false;
        this._startTime = 0;
        this._pausedTime = 0;
        this._paused = false;
        this._life = opts.life || 1e3;
        this._delay = opts.delay || 0;
        this.loop = opts.loop || false;
        this.onframe = opts.onframe || noop$1;
        this.ondestroy = opts.ondestroy || noop$1;
        this.onrestart = opts.onrestart || noop$1;
        opts.easing && this.setEasing(opts.easing);
      }
      Clip2.prototype.step = function(globalTime, deltaTime) {
        if (!this._inited) {
          this._startTime = globalTime + this._delay;
          this._inited = true;
        }
        if (this._paused) {
          this._pausedTime += deltaTime;
          return;
        }
        var life = this._life;
        var elapsedTime = globalTime - this._startTime - this._pausedTime;
        var percent = elapsedTime / life;
        if (percent < 0) {
          percent = 0;
        }
        percent = Math.min(percent, 1);
        var easingFunc = this.easingFunc;
        var schedule = easingFunc ? easingFunc(percent) : percent;
        this.onframe(schedule);
        if (percent === 1) {
          if (this.loop) {
            var remainder = elapsedTime % life;
            this._startTime = globalTime - remainder;
            this._pausedTime = 0;
            this.onrestart();
          } else {
            return true;
          }
        }
        return false;
      };
      Clip2.prototype.pause = function() {
        this._paused = true;
      };
      Clip2.prototype.resume = function() {
        this._paused = false;
      };
      Clip2.prototype.setEasing = function(easing) {
        this.easing = easing;
        this.easingFunc = isFunction$1(easing) ? easing : easingFuncs[easing] || createCubicEasingFunc(easing);
      };
      return Clip2;
    }();
    var Entry = /* @__PURE__ */ function() {
      function Entry2(val) {
        this.value = val;
      }
      return Entry2;
    }();
    var LinkedList = function() {
      function LinkedList2() {
        this._len = 0;
      }
      LinkedList2.prototype.insert = function(val) {
        var entry = new Entry(val);
        this.insertEntry(entry);
        return entry;
      };
      LinkedList2.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++;
      };
      LinkedList2.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;
        } else {
          this.tail = prev;
        }
        entry.next = entry.prev = null;
        this._len--;
      };
      LinkedList2.prototype.len = function() {
        return this._len;
      };
      LinkedList2.prototype.clear = function() {
        this.head = this.tail = null;
        this._len = 0;
      };
      return LinkedList2;
    }();
    var LRU = function() {
      function LRU2(maxSize) {
        this._list = new LinkedList();
        this._maxSize = 10;
        this._map = {};
        this._maxSize = maxSize;
      }
      LRU2.prototype.put = function(key, value) {
        var list = this._list;
        var map2 = this._map;
        var removed = null;
        if (map2[key] == null) {
          var len2 = list.len();
          var entry = this._lastRemovedEntry;
          if (len2 >= this._maxSize && len2 > 0) {
            var leastUsedEntry = list.head;
            list.remove(leastUsedEntry);
            delete map2[leastUsedEntry.key];
            removed = leastUsedEntry.value;
            this._lastRemovedEntry = leastUsedEntry;
          }
          if (entry) {
            entry.value = value;
          } else {
            entry = new Entry(value);
          }
          entry.key = key;
          list.insertEntry(entry);
          map2[key] = entry;
        }
        return removed;
      };
      LRU2.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);
          }
          return entry.value;
        }
      };
      LRU2.prototype.clear = function() {
        this._list.clear();
        this._map = {};
      };
      LRU2.prototype.len = function() {
        return this._list.len();
      };
      return LRU2;
    }();
    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(i2) {
      i2 = Math.round(i2);
      return i2 < 0 ? 0 : i2 > 255 ? 255 : i2;
    }
    function clampCssAngle(i2) {
      i2 = Math.round(i2);
      return i2 < 0 ? 0 : i2 > 360 ? 360 : i2;
    }
    function clampCssFloat(f2) {
      return f2 < 0 ? 0 : f2 > 1 ? 1 : f2;
    }
    function parseCssInt(val) {
      var str = val;
      if (str.length && str.charAt(str.length - 1) === "%") {
        return clampCssByte(parseFloat(str) / 100 * 255);
      }
      return clampCssByte(parseInt(str, 10));
    }
    function parseCssFloat(val) {
      var str = val;
      if (str.length && str.charAt(str.length - 1) === "%") {
        return clampCssFloat(parseFloat(str) / 100);
      }
      return clampCssFloat(parseFloat(str));
    }
    function cssHueToRgb(m1, m2, h2) {
      if (h2 < 0) {
        h2 += 1;
      } else if (h2 > 1) {
        h2 -= 1;
      }
      if (h2 * 6 < 1) {
        return m1 + (m2 - m1) * h2 * 6;
      }
      if (h2 * 2 < 1) {
        return m2;
      }
      if (h2 * 3 < 2) {
        return m1 + (m2 - m1) * (2 / 3 - h2) * 6;
      }
      return m1;
    }
    function lerpNumber(a2, b2, p2) {
      return a2 + (b2 - a2) * p2;
    }
    function setRgba(out2, r, g, b2, a2) {
      out2[0] = r;
      out2[1] = g;
      out2[2] = b2;
      out2[3] = a2;
      return out2;
    }
    function copyRgba(out2, a2) {
      out2[0] = a2[0];
      out2[1] = a2[1];
      out2[2] = a2[2];
      out2[3] = a2[3];
      return out2;
    }
    var colorCache = new LRU(20);
    var lastRemovedArr = null;
    function putToCache(colorStr, rgbaArr) {
      if (lastRemovedArr) {
        copyRgba(lastRemovedArr, rgbaArr);
      }
      lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());
    }
    function parse$1(colorStr, rgbaArr) {
      if (!colorStr) {
        return;
      }
      rgbaArr = rgbaArr || [];
      var cached = colorCache.get(colorStr);
      if (cached) {
        return copyRgba(rgbaArr, cached);
      }
      colorStr = colorStr + "";
      var str = colorStr.replace(/ /g, "").toLowerCase();
      if (str in kCSSColorTable) {
        copyRgba(rgbaArr, kCSSColorTable[str]);
        putToCache(colorStr, rgbaArr);
        return rgbaArr;
      }
      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 <= 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) {
          var 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;
      }
      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, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), params.length === 3 ? alpha : parseCssFloat(params[3]));
              putToCache(colorStr, rgbaArr);
              return rgbaArr;
            } else {
              setRgba(rgbaArr, 0, 0, 0, 1);
              return;
            }
          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;
        }
      }
      setRgba(rgbaArr, 0, 0, 0, 1);
      return;
    }
    function hsla2rgba(hsla, rgba) {
      var h2 = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360;
      var s2 = parseCssFloat(hsla[1]);
      var l2 = parseCssFloat(hsla[2]);
      var m2 = l2 <= 0.5 ? l2 * (s2 + 1) : l2 + s2 - l2 * s2;
      var m1 = l2 * 2 - m2;
      rgba = rgba || [];
      setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h2 + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h2) * 255), clampCssByte(cssHueToRgb(m1, m2, h2 - 1 / 3) * 255), 1);
      if (hsla.length === 4) {
        rgba[3] = hsla[3];
      }
      return rgba;
    }
    function rgba2hsla(rgba) {
      if (!rgba) {
        return;
      }
      var R2 = rgba[0] / 255;
      var G2 = rgba[1] / 255;
      var B3 = rgba[2] / 255;
      var vMin = Math.min(R2, G2, B3);
      var vMax = Math.max(R2, G2, B3);
      var delta = vMax - vMin;
      var L2 = (vMax + vMin) / 2;
      var H4;
      var S2;
      if (delta === 0) {
        H4 = 0;
        S2 = 0;
      } else {
        if (L2 < 0.5) {
          S2 = delta / (vMax + vMin);
        } else {
          S2 = delta / (2 - vMax - vMin);
        }
        var deltaR = ((vMax - R2) / 6 + delta / 2) / delta;
        var deltaG = ((vMax - G2) / 6 + delta / 2) / delta;
        var deltaB = ((vMax - B3) / 6 + delta / 2) / delta;
        if (R2 === vMax) {
          H4 = deltaB - deltaG;
        } else if (G2 === vMax) {
          H4 = 1 / 3 + deltaR - deltaB;
        } else if (B3 === vMax) {
          H4 = 2 / 3 + deltaG - deltaR;
        }
        if (H4 < 0) {
          H4 += 1;
        }
        if (H4 > 1) {
          H4 -= 1;
        }
      }
      var hsla = [H4 * 360, S2, L2];
      if (rgba[3] != null) {
        hsla.push(rgba[3]);
      }
      return hsla;
    }
    function lift(color2, level) {
      var colorArr = parse$1(color2);
      if (colorArr) {
        for (var i2 = 0; i2 < 3; i2++) {
          if (level < 0) {
            colorArr[i2] = colorArr[i2] * (1 - level) | 0;
          } else {
            colorArr[i2] = (255 - colorArr[i2]) * level + colorArr[i2] | 0;
          }
          if (colorArr[i2] > 255) {
            colorArr[i2] = 255;
          } else if (colorArr[i2] < 0) {
            colorArr[i2] = 0;
          }
        }
        return stringify(colorArr, colorArr.length === 4 ? "rgba" : "rgb");
      }
    }
    function fastLerp(normalizedValue, colors, out2) {
      if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {
        return;
      }
      out2 = out2 || [];
      var value = normalizedValue * (colors.length - 1);
      var leftIndex = Math.floor(value);
      var rightIndex = Math.ceil(value);
      var leftColor = colors[leftIndex];
      var rightColor = colors[rightIndex];
      var 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;
    }
    function lerp$1(normalizedValue, colors, fullOutput) {
      if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {
        return;
      }
      var value = normalizedValue * (colors.length - 1);
      var leftIndex = Math.floor(value);
      var rightIndex = Math.ceil(value);
      var leftColor = parse$1(colors[leftIndex]);
      var rightColor = parse$1(colors[rightIndex]);
      var dv = value - leftIndex;
      var color2 = 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: color2,
        leftIndex,
        rightIndex,
        value
      } : color2;
    }
    function modifyHSL(color2, h2, s2, l2) {
      var colorArr = parse$1(color2);
      if (color2) {
        colorArr = rgba2hsla(colorArr);
        h2 != null && (colorArr[0] = clampCssAngle(h2));
        s2 != null && (colorArr[1] = parseCssFloat(s2));
        l2 != null && (colorArr[2] = parseCssFloat(l2));
        return stringify(hsla2rgba(colorArr), "rgba");
      }
    }
    function modifyAlpha(color2, alpha) {
      var colorArr = parse$1(color2);
      if (colorArr && alpha != null) {
        colorArr[3] = clampCssFloat(alpha);
        return stringify(colorArr, "rgba");
      }
    }
    function stringify(arrColor, type) {
      if (!arrColor || !arrColor.length) {
        return;
      }
      var colorStr = arrColor[0] + "," + arrColor[1] + "," + arrColor[2];
      if (type === "rgba" || type === "hsva" || type === "hsla") {
        colorStr += "," + arrColor[3];
      }
      return type + "(" + colorStr + ")";
    }
    function lum(color2, backgroundLum) {
      var arr = parse$1(color2);
      return arr ? (0.299 * arr[0] + 0.587 * arr[1] + 0.114 * arr[2]) * arr[3] / 255 + (1 - arr[3]) * backgroundLum : 0;
    }
    var liftedColorCache = new LRU(100);
    function liftColor(color2) {
      if (isString$1(color2)) {
        var liftedColor = liftedColorCache.get(color2);
        if (!liftedColor) {
          liftedColor = lift(color2, -0.1);
          liftedColorCache.put(color2, liftedColor);
        }
        return liftedColor;
      } else if (isGradientObject(color2)) {
        var ret = extend$1({}, color2);
        ret.colorStops = map$1(color2.colorStops, function(stop2) {
          return {
            offset: stop2.offset,
            color: lift(stop2.color, -0.1)
          };
        });
        return ret;
      }
      return color2;
    }
    var mathRound$1 = Math.round;
    function normalizeColor(color2) {
      var opacity2;
      if (!color2 || color2 === "transparent") {
        color2 = "none";
      } else if (typeof color2 === "string" && color2.indexOf("rgba") > -1) {
        var arr = parse$1(color2);
        if (arr) {
          color2 = "rgb(" + arr[0] + "," + arr[1] + "," + arr[2] + ")";
          opacity2 = arr[3];
        }
      }
      return {
        color: color2,
        opacity: opacity2 == null ? 1 : opacity2
      };
    }
    var EPSILON$3 = 1e-4;
    function isAroundZero(transform2) {
      return transform2 < EPSILON$3 && transform2 > -1e-4;
    }
    function round3(transform2) {
      return mathRound$1(transform2 * 1e3) / 1e3;
    }
    function round4(transform2) {
      return mathRound$1(transform2 * 1e4) / 1e4;
    }
    function getMatrixStr(m2) {
      return "matrix(" + round3(m2[0]) + "," + round3(m2[1]) + "," + round3(m2[2]) + "," + round3(m2[3]) + "," + round4(m2[4]) + "," + round4(m2[5]) + ")";
    }
    var TEXT_ALIGN_TO_ANCHOR = {
      left: "start",
      right: "end",
      center: "middle",
      middle: "middle"
    };
    function adjustTextY$1(y, lineHeight2, textBaseline) {
      if (textBaseline === "top") {
        y += lineHeight2 / 2;
      } else if (textBaseline === "bottom") {
        y -= lineHeight2 / 2;
      }
      return y;
    }
    function hasShadow(style) {
      return style && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY);
    }
    function getShadowKey(displayable) {
      var style = displayable.style;
      var globalScale = displayable.getGlobalScale();
      return [
        style.shadowColor,
        (style.shadowBlur || 0).toFixed(2),
        (style.shadowOffsetX || 0).toFixed(2),
        (style.shadowOffsetY || 0).toFixed(2),
        globalScale[0],
        globalScale[1]
      ].join(",");
    }
    function isImagePattern(val) {
      return val && !!val.image;
    }
    function isSVGPattern(val) {
      return val && !!val.svgElement;
    }
    function isPattern(val) {
      return isImagePattern(val) || isSVGPattern(val);
    }
    function isLinearGradient$1(val) {
      return val.type === "linear";
    }
    function isRadialGradient$1(val) {
      return val.type === "radial";
    }
    function isGradient(val) {
      return val && (val.type === "linear" || val.type === "radial");
    }
    function getIdURL(id) {
      return "url(#" + id + ")";
    }
    function getPathPrecision(el) {
      var scale2 = el.getGlobalScale();
      var size = Math.max(scale2[0], scale2[1]);
      return Math.max(Math.ceil(Math.log(size) / Math.log(10)), 1);
    }
    function getSRTTransformString(transform2) {
      var x2 = transform2.x || 0;
      var y = transform2.y || 0;
      var rotation = (transform2.rotation || 0) * RADIAN_TO_DEGREE;
      var scaleX = retrieve2(transform2.scaleX, 1);
      var scaleY = retrieve2(transform2.scaleY, 1);
      var skewX = transform2.skewX || 0;
      var skewY = transform2.skewY || 0;
      var res = [];
      if (x2 || y) {
        res.push("translate(" + x2 + "px," + y + "px)");
      }
      if (rotation) {
        res.push("rotate(" + rotation + ")");
      }
      if (scaleX !== 1 || scaleY !== 1) {
        res.push("scale(" + scaleX + "," + scaleY + ")");
      }
      if (skewX || skewY) {
        res.push("skew(" + mathRound$1(skewX * RADIAN_TO_DEGREE) + "deg, " + mathRound$1(skewY * RADIAN_TO_DEGREE) + "deg)");
      }
      return res.join(" ");
    }
    var encodeBase64 = function() {
      if (env.hasGlobalWindow && isFunction$1(window.btoa)) {
        return function(str) {
          return window.btoa(unescape(encodeURIComponent(str)));
        };
      }
      if (typeof Buffer !== "undefined") {
        return function(str) {
          return Buffer.from(str).toString("base64");
        };
      }
      return function(str) {
        return null;
      };
    }();
    var arraySlice = Array.prototype.slice;
    function interpolateNumber$1(p0, p1, percent) {
      return (p1 - p0) * percent + p0;
    }
    function interpolate1DArray(out2, p0, p1, percent) {
      var len2 = p0.length;
      for (var i2 = 0; i2 < len2; i2++) {
        out2[i2] = interpolateNumber$1(p0[i2], p1[i2], percent);
      }
      return out2;
    }
    function interpolate2DArray(out2, p0, p1, percent) {
      var len2 = p0.length;
      var len22 = len2 && p0[0].length;
      for (var i2 = 0; i2 < len2; i2++) {
        if (!out2[i2]) {
          out2[i2] = [];
        }
        for (var j = 0; j < len22; j++) {
          out2[i2][j] = interpolateNumber$1(p0[i2][j], p1[i2][j], percent);
        }
      }
      return out2;
    }
    function add1DArray(out2, p0, p1, sign) {
      var len2 = p0.length;
      for (var i2 = 0; i2 < len2; i2++) {
        out2[i2] = p0[i2] + p1[i2] * sign;
      }
      return out2;
    }
    function add2DArray(out2, p0, p1, sign) {
      var len2 = p0.length;
      var len22 = len2 && p0[0].length;
      for (var i2 = 0; i2 < len2; i2++) {
        if (!out2[i2]) {
          out2[i2] = [];
        }
        for (var j = 0; j < len22; j++) {
          out2[i2][j] = p0[i2][j] + p1[i2][j] * sign;
        }
      }
      return out2;
    }
    function fillColorStops(val0, val1) {
      var len0 = val0.length;
      var len1 = val1.length;
      var shorterArr = len0 > len1 ? val1 : val0;
      var shorterLen = Math.min(len0, len1);
      var last2 = shorterArr[shorterLen - 1] || { color: [0, 0, 0, 0], offset: 0 };
      for (var i2 = shorterLen; i2 < Math.max(len0, len1); i2++) {
        shorterArr.push({
          offset: last2.offset,
          color: last2.color.slice()
        });
      }
    }
    function fillArray(val0, val1, arrDim) {
      var arr0 = val0;
      var arr1 = val1;
      if (!arr0.push || !arr1.push) {
        return;
      }
      var arr0Len = arr0.length;
      var arr1Len = arr1.length;
      if (arr0Len !== arr1Len) {
        var isPreviousLarger = arr0Len > arr1Len;
        if (isPreviousLarger) {
          arr0.length = arr1Len;
        } else {
          for (var i2 = arr0Len; i2 < arr1Len; i2++) {
            arr0.push(arrDim === 1 ? arr1[i2] : arraySlice.call(arr1[i2]));
          }
        }
      }
      var len2 = arr0[0] && arr0[0].length;
      for (var i2 = 0; i2 < arr0.length; i2++) {
        if (arrDim === 1) {
          if (isNaN(arr0[i2])) {
            arr0[i2] = arr1[i2];
          }
        } else {
          for (var j = 0; j < len2; j++) {
            if (isNaN(arr0[i2][j])) {
              arr0[i2][j] = arr1[i2][j];
            }
          }
        }
      }
    }
    function cloneValue(value) {
      if (isArrayLike(value)) {
        var len2 = value.length;
        if (isArrayLike(value[0])) {
          var ret = [];
          for (var i2 = 0; i2 < len2; i2++) {
            ret.push(arraySlice.call(value[i2]));
          }
          return ret;
        }
        return arraySlice.call(value);
      }
      return value;
    }
    function rgba2String(rgba) {
      rgba[0] = Math.floor(rgba[0]) || 0;
      rgba[1] = Math.floor(rgba[1]) || 0;
      rgba[2] = Math.floor(rgba[2]) || 0;
      rgba[3] = rgba[3] == null ? 1 : rgba[3];
      return "rgba(" + rgba.join(",") + ")";
    }
    function guessArrayDim(value) {
      return isArrayLike(value && value[0]) ? 2 : 1;
    }
    var VALUE_TYPE_NUMBER = 0;
    var VALUE_TYPE_1D_ARRAY = 1;
    var VALUE_TYPE_2D_ARRAY = 2;
    var VALUE_TYPE_COLOR = 3;
    var VALUE_TYPE_LINEAR_GRADIENT = 4;
    var VALUE_TYPE_RADIAL_GRADIENT = 5;
    var VALUE_TYPE_UNKOWN = 6;
    function isGradientValueType(valType) {
      return valType === VALUE_TYPE_LINEAR_GRADIENT || valType === VALUE_TYPE_RADIAL_GRADIENT;
    }
    function isArrayValueType(valType) {
      return valType === VALUE_TYPE_1D_ARRAY || valType === VALUE_TYPE_2D_ARRAY;
    }
    var tmpRgba = [0, 0, 0, 0];
    var Track = function() {
      function Track2(propName) {
        this.keyframes = [];
        this.discrete = false;
        this._invalid = false;
        this._needsSort = false;
        this._lastFr = 0;
        this._lastFrP = 0;
        this.propName = propName;
      }
      Track2.prototype.isFinished = function() {
        return this._finished;
      };
      Track2.prototype.setFinished = function() {
        this._finished = true;
        if (this._additiveTrack) {
          this._additiveTrack.setFinished();
        }
      };
      Track2.prototype.needsAnimate = function() {
        return this.keyframes.length >= 1;
      };
      Track2.prototype.getAdditiveTrack = function() {
        return this._additiveTrack;
      };
      Track2.prototype.addKeyframe = function(time2, rawValue, easing) {
        this._needsSort = true;
        var keyframes = this.keyframes;
        var len2 = keyframes.length;
        var discrete = false;
        var valType = VALUE_TYPE_UNKOWN;
        var value = rawValue;
        if (isArrayLike(rawValue)) {
          var arrayDim = guessArrayDim(rawValue);
          valType = arrayDim;
          if (arrayDim === 1 && !isNumber$1(rawValue[0]) || arrayDim === 2 && !isNumber$1(rawValue[0][0])) {
            discrete = true;
          }
        } else {
          if (isNumber$1(rawValue) && !eqNaN(rawValue)) {
            valType = VALUE_TYPE_NUMBER;
          } else if (isString$1(rawValue)) {
            if (!isNaN(+rawValue)) {
              valType = VALUE_TYPE_NUMBER;
            } else {
              var colorArray = parse$1(rawValue);
              if (colorArray) {
                value = colorArray;
                valType = VALUE_TYPE_COLOR;
              }
            }
          } else if (isGradientObject(rawValue)) {
            var parsedGradient = extend$1({}, value);
            parsedGradient.colorStops = map$1(rawValue.colorStops, function(colorStop) {
              return {
                offset: colorStop.offset,
                color: parse$1(colorStop.color)
              };
            });
            if (isLinearGradient$1(rawValue)) {
              valType = VALUE_TYPE_LINEAR_GRADIENT;
            } else if (isRadialGradient$1(rawValue)) {
              valType = VALUE_TYPE_RADIAL_GRADIENT;
            }
            value = parsedGradient;
          }
        }
        if (len2 === 0) {
          this.valType = valType;
        } else if (valType !== this.valType || valType === VALUE_TYPE_UNKOWN) {
          discrete = true;
        }
        this.discrete = this.discrete || discrete;
        var kf = {
          time: time2,
          value,
          rawValue,
          percent: 0
        };
        if (easing) {
          kf.easing = easing;
          kf.easingFunc = isFunction$1(easing) ? easing : easingFuncs[easing] || createCubicEasingFunc(easing);
        }
        keyframes.push(kf);
        return kf;
      };
      Track2.prototype.prepare = function(maxTime, additiveTrack) {
        var kfs = this.keyframes;
        if (this._needsSort) {
          kfs.sort(function(a2, b2) {
            return a2.time - b2.time;
          });
        }
        var valType = this.valType;
        var kfsLen = kfs.length;
        var lastKf = kfs[kfsLen - 1];
        var isDiscrete = this.discrete;
        var isArr = isArrayValueType(valType);
        var isGradient2 = isGradientValueType(valType);
        for (var i2 = 0; i2 < kfsLen; i2++) {
          var kf = kfs[i2];
          var value = kf.value;
          var lastValue = lastKf.value;
          kf.percent = kf.time / maxTime;
          if (!isDiscrete) {
            if (isArr && i2 !== kfsLen - 1) {
              fillArray(value, lastValue, valType);
            } else if (isGradient2) {
              fillColorStops(value.colorStops, lastValue.colorStops);
            }
          }
        }
        if (!isDiscrete && valType !== VALUE_TYPE_RADIAL_GRADIENT && additiveTrack && this.needsAnimate() && additiveTrack.needsAnimate() && valType === additiveTrack.valType && !additiveTrack._finished) {
          this._additiveTrack = additiveTrack;
          var startValue = kfs[0].value;
          for (var i2 = 0; i2 < kfsLen; i2++) {
            if (valType === VALUE_TYPE_NUMBER) {
              kfs[i2].additiveValue = kfs[i2].value - startValue;
            } else if (valType === VALUE_TYPE_COLOR) {
              kfs[i2].additiveValue = add1DArray([], kfs[i2].value, startValue, -1);
            } else if (isArrayValueType(valType)) {
              kfs[i2].additiveValue = valType === VALUE_TYPE_1D_ARRAY ? add1DArray([], kfs[i2].value, startValue, -1) : add2DArray([], kfs[i2].value, startValue, -1);
            }
          }
        }
      };
      Track2.prototype.step = function(target, percent) {
        if (this._finished) {
          return;
        }
        if (this._additiveTrack && this._additiveTrack._finished) {
          this._additiveTrack = null;
        }
        var isAdditive = this._additiveTrack != null;
        var valueKey = isAdditive ? "additiveValue" : "value";
        var valType = this.valType;
        var keyframes = this.keyframes;
        var kfsNum = keyframes.length;
        var propName = this.propName;
        var isValueColor = valType === VALUE_TYPE_COLOR;
        var frameIdx;
        var lastFrame = this._lastFr;
        var mathMin2 = Math.min;
        var frame;
        var nextFrame2;
        if (kfsNum === 1) {
          frame = nextFrame2 = keyframes[0];
        } else {
          if (percent < 0) {
            frameIdx = 0;
          } else if (percent < this._lastFrP) {
            var start2 = mathMin2(lastFrame + 1, kfsNum - 1);
            for (frameIdx = start2; frameIdx >= 0; frameIdx--) {
              if (keyframes[frameIdx].percent <= percent) {
                break;
              }
            }
            frameIdx = mathMin2(frameIdx, kfsNum - 2);
          } else {
            for (frameIdx = lastFrame; frameIdx < kfsNum; frameIdx++) {
              if (keyframes[frameIdx].percent > percent) {
                break;
              }
            }
            frameIdx = mathMin2(frameIdx - 1, kfsNum - 2);
          }
          nextFrame2 = keyframes[frameIdx + 1];
          frame = keyframes[frameIdx];
        }
        if (!(frame && nextFrame2)) {
          return;
        }
        this._lastFr = frameIdx;
        this._lastFrP = percent;
        var interval = nextFrame2.percent - frame.percent;
        var w2 = interval === 0 ? 1 : mathMin2((percent - frame.percent) / interval, 1);
        if (nextFrame2.easingFunc) {
          w2 = nextFrame2.easingFunc(w2);
        }
        var targetArr = isAdditive ? this._additiveValue : isValueColor ? tmpRgba : target[propName];
        if ((isArrayValueType(valType) || isValueColor) && !targetArr) {
          targetArr = this._additiveValue = [];
        }
        if (this.discrete) {
          target[propName] = w2 < 1 ? frame.rawValue : nextFrame2.rawValue;
        } else if (isArrayValueType(valType)) {
          valType === VALUE_TYPE_1D_ARRAY ? interpolate1DArray(targetArr, frame[valueKey], nextFrame2[valueKey], w2) : interpolate2DArray(targetArr, frame[valueKey], nextFrame2[valueKey], w2);
        } else if (isGradientValueType(valType)) {
          var val = frame[valueKey];
          var nextVal_1 = nextFrame2[valueKey];
          var isLinearGradient_1 = valType === VALUE_TYPE_LINEAR_GRADIENT;
          target[propName] = {
            type: isLinearGradient_1 ? "linear" : "radial",
            x: interpolateNumber$1(val.x, nextVal_1.x, w2),
            y: interpolateNumber$1(val.y, nextVal_1.y, w2),
            colorStops: map$1(val.colorStops, function(colorStop, idx) {
              var nextColorStop = nextVal_1.colorStops[idx];
              return {
                offset: interpolateNumber$1(colorStop.offset, nextColorStop.offset, w2),
                color: rgba2String(interpolate1DArray([], colorStop.color, nextColorStop.color, w2))
              };
            }),
            global: nextVal_1.global
          };
          if (isLinearGradient_1) {
            target[propName].x2 = interpolateNumber$1(val.x2, nextVal_1.x2, w2);
            target[propName].y2 = interpolateNumber$1(val.y2, nextVal_1.y2, w2);
          } else {
            target[propName].r = interpolateNumber$1(val.r, nextVal_1.r, w2);
          }
        } else if (isValueColor) {
          interpolate1DArray(targetArr, frame[valueKey], nextFrame2[valueKey], w2);
          if (!isAdditive) {
            target[propName] = rgba2String(targetArr);
          }
        } else {
          var value = interpolateNumber$1(frame[valueKey], nextFrame2[valueKey], w2);
          if (isAdditive) {
            this._additiveValue = value;
          } else {
            target[propName] = value;
          }
        }
        if (isAdditive) {
          this._addToTarget(target);
        }
      };
      Track2.prototype._addToTarget = function(target) {
        var valType = this.valType;
        var propName = this.propName;
        var additiveValue = this._additiveValue;
        if (valType === VALUE_TYPE_NUMBER) {
          target[propName] = target[propName] + additiveValue;
        } else if (valType === VALUE_TYPE_COLOR) {
          parse$1(target[propName], tmpRgba);
          add1DArray(tmpRgba, tmpRgba, additiveValue, 1);
          target[propName] = rgba2String(tmpRgba);
        } else if (valType === VALUE_TYPE_1D_ARRAY) {
          add1DArray(target[propName], target[propName], additiveValue, 1);
        } else if (valType === VALUE_TYPE_2D_ARRAY) {
          add2DArray(target[propName], target[propName], additiveValue, 1);
        }
      };
      return Track2;
    }();
    var Animator = function() {
      function Animator2(target, loop, allowDiscreteAnimation, additiveTo) {
        this._tracks = {};
        this._trackKeys = [];
        this._maxTime = 0;
        this._started = 0;
        this._clip = null;
        this._target = target;
        this._loop = loop;
        if (loop && additiveTo) {
          logError("Can' use additive animation on looped animation.");
          return;
        }
        this._additiveAnimators = additiveTo;
        this._allowDiscrete = allowDiscreteAnimation;
      }
      Animator2.prototype.getMaxTime = function() {
        return this._maxTime;
      };
      Animator2.prototype.getDelay = function() {
        return this._delay;
      };
      Animator2.prototype.getLoop = function() {
        return this._loop;
      };
      Animator2.prototype.getTarget = function() {
        return this._target;
      };
      Animator2.prototype.changeTarget = function(target) {
        this._target = target;
      };
      Animator2.prototype.when = function(time2, props2, easing) {
        return this.whenWithKeys(time2, props2, keys$1(props2), easing);
      };
      Animator2.prototype.whenWithKeys = function(time2, props2, propNames, easing) {
        var tracks = this._tracks;
        for (var i2 = 0; i2 < propNames.length; i2++) {
          var propName = propNames[i2];
          var track2 = tracks[propName];
          if (!track2) {
            track2 = tracks[propName] = new Track(propName);
            var initialValue = void 0;
            var additiveTrack = this._getAdditiveTrack(propName);
            if (additiveTrack) {
              var addtiveTrackKfs = additiveTrack.keyframes;
              var lastFinalKf = addtiveTrackKfs[addtiveTrackKfs.length - 1];
              initialValue = lastFinalKf && lastFinalKf.value;
              if (additiveTrack.valType === VALUE_TYPE_COLOR && initialValue) {
                initialValue = rgba2String(initialValue);
              }
            } else {
              initialValue = this._target[propName];
            }
            if (initialValue == null) {
              continue;
            }
            if (time2 > 0) {
              track2.addKeyframe(0, cloneValue(initialValue), easing);
            }
            this._trackKeys.push(propName);
          }
          track2.addKeyframe(time2, cloneValue(props2[propName]), easing);
        }
        this._maxTime = Math.max(this._maxTime, time2);
        return this;
      };
      Animator2.prototype.pause = function() {
        this._clip.pause();
        this._paused = true;
      };
      Animator2.prototype.resume = function() {
        this._clip.resume();
        this._paused = false;
      };
      Animator2.prototype.isPaused = function() {
        return !!this._paused;
      };
      Animator2.prototype.duration = function(duration2) {
        this._maxTime = duration2;
        this._force = true;
        return this;
      };
      Animator2.prototype._doneCallback = function() {
        this._setTracksFinished();
        this._clip = null;
        var doneList = this._doneCbs;
        if (doneList) {
          var len2 = doneList.length;
          for (var i2 = 0; i2 < len2; i2++) {
            doneList[i2].call(this);
          }
        }
      };
      Animator2.prototype._abortedCallback = function() {
        this._setTracksFinished();
        var animation = this.animation;
        var abortedList = this._abortedCbs;
        if (animation) {
          animation.removeClip(this._clip);
        }
        this._clip = null;
        if (abortedList) {
          for (var i2 = 0; i2 < abortedList.length; i2++) {
            abortedList[i2].call(this);
          }
        }
      };
      Animator2.prototype._setTracksFinished = function() {
        var tracks = this._tracks;
        var tracksKeys = this._trackKeys;
        for (var i2 = 0; i2 < tracksKeys.length; i2++) {
          tracks[tracksKeys[i2]].setFinished();
        }
      };
      Animator2.prototype._getAdditiveTrack = function(trackName) {
        var additiveTrack;
        var additiveAnimators = this._additiveAnimators;
        if (additiveAnimators) {
          for (var i2 = 0; i2 < additiveAnimators.length; i2++) {
            var track2 = additiveAnimators[i2].getTrack(trackName);
            if (track2) {
              additiveTrack = track2;
            }
          }
        }
        return additiveTrack;
      };
      Animator2.prototype.start = function(easing) {
        if (this._started > 0) {
          return;
        }
        this._started = 1;
        var self2 = this;
        var tracks = [];
        var maxTime = this._maxTime || 0;
        for (var i2 = 0; i2 < this._trackKeys.length; i2++) {
          var propName = this._trackKeys[i2];
          var track2 = this._tracks[propName];
          var additiveTrack = this._getAdditiveTrack(propName);
          var kfs = track2.keyframes;
          var kfsNum = kfs.length;
          track2.prepare(maxTime, additiveTrack);
          if (track2.needsAnimate()) {
            if (!this._allowDiscrete && track2.discrete) {
              var lastKf = kfs[kfsNum - 1];
              if (lastKf) {
                self2._target[track2.propName] = lastKf.rawValue;
              }
              track2.setFinished();
            } else {
              tracks.push(track2);
            }
          }
        }
        if (tracks.length || this._force) {
          var clip2 = new Clip({
            life: maxTime,
            loop: this._loop,
            delay: this._delay || 0,
            onframe: function(percent) {
              self2._started = 2;
              var additiveAnimators = self2._additiveAnimators;
              if (additiveAnimators) {
                var stillHasAdditiveAnimator = false;
                for (var i3 = 0; i3 < additiveAnimators.length; i3++) {
                  if (additiveAnimators[i3]._clip) {
                    stillHasAdditiveAnimator = true;
                    break;
                  }
                }
                if (!stillHasAdditiveAnimator) {
                  self2._additiveAnimators = null;
                }
              }
              for (var i3 = 0; i3 < tracks.length; i3++) {
                tracks[i3].step(self2._target, percent);
              }
              var onframeList = self2._onframeCbs;
              if (onframeList) {
                for (var i3 = 0; i3 < onframeList.length; i3++) {
                  onframeList[i3](self2._target, percent);
                }
              }
            },
            ondestroy: function() {
              self2._doneCallback();
            }
          });
          this._clip = clip2;
          if (this.animation) {
            this.animation.addClip(clip2);
          }
          if (easing) {
            clip2.setEasing(easing);
          }
        } else {
          this._doneCallback();
        }
        return this;
      };
      Animator2.prototype.stop = function(forwardToLast) {
        if (!this._clip) {
          return;
        }
        var clip2 = this._clip;
        if (forwardToLast) {
          clip2.onframe(1);
        }
        this._abortedCallback();
      };
      Animator2.prototype.delay = function(time2) {
        this._delay = time2;
        return this;
      };
      Animator2.prototype.during = function(cb) {
        if (cb) {
          if (!this._onframeCbs) {
            this._onframeCbs = [];
          }
          this._onframeCbs.push(cb);
        }
        return this;
      };
      Animator2.prototype.done = function(cb) {
        if (cb) {
          if (!this._doneCbs) {
            this._doneCbs = [];
          }
          this._doneCbs.push(cb);
        }
        return this;
      };
      Animator2.prototype.aborted = function(cb) {
        if (cb) {
          if (!this._abortedCbs) {
            this._abortedCbs = [];
          }
          this._abortedCbs.push(cb);
        }
        return this;
      };
      Animator2.prototype.getClip = function() {
        return this._clip;
      };
      Animator2.prototype.getTrack = function(propName) {
        return this._tracks[propName];
      };
      Animator2.prototype.getTracks = function() {
        var _this = this;
        return map$1(this._trackKeys, function(key) {
          return _this._tracks[key];
        });
      };
      Animator2.prototype.stopTracks = function(propNames, forwardToLast) {
        if (!propNames.length || !this._clip) {
          return true;
        }
        var tracks = this._tracks;
        var tracksKeys = this._trackKeys;
        for (var i2 = 0; i2 < propNames.length; i2++) {
          var track2 = tracks[propNames[i2]];
          if (track2 && !track2.isFinished()) {
            if (forwardToLast) {
              track2.step(this._target, 1);
            } else if (this._started === 1) {
              track2.step(this._target, 0);
            }
            track2.setFinished();
          }
        }
        var allAborted = true;
        for (var i2 = 0; i2 < tracksKeys.length; i2++) {
          if (!tracks[tracksKeys[i2]].isFinished()) {
            allAborted = false;
            break;
          }
        }
        if (allAborted) {
          this._abortedCallback();
        }
        return allAborted;
      };
      Animator2.prototype.saveTo = function(target, trackKeys, firstOrLast) {
        if (!target) {
          return;
        }
        trackKeys = trackKeys || this._trackKeys;
        for (var i2 = 0; i2 < trackKeys.length; i2++) {
          var propName = trackKeys[i2];
          var track2 = this._tracks[propName];
          if (!track2 || track2.isFinished()) {
            continue;
          }
          var kfs = track2.keyframes;
          var kf = kfs[firstOrLast ? 0 : kfs.length - 1];
          if (kf) {
            target[propName] = cloneValue(kf.rawValue);
          }
        }
      };
      Animator2.prototype.__changeFinalValue = function(finalProps, trackKeys) {
        trackKeys = trackKeys || keys$1(finalProps);
        for (var i2 = 0; i2 < trackKeys.length; i2++) {
          var propName = trackKeys[i2];
          var track2 = this._tracks[propName];
          if (!track2) {
            continue;
          }
          var kfs = track2.keyframes;
          if (kfs.length > 1) {
            var lastKf = kfs.pop();
            track2.addKeyframe(lastKf.time, finalProps[propName]);
            track2.prepare(this._maxTime, track2.getAdditiveTrack());
          }
        }
      };
      return Animator2;
    }();
    function getTime() {
      return (/* @__PURE__ */ new Date()).getTime();
    }
    var Animation = function(_super) {
      __extends$1(Animation2, _super);
      function Animation2(opts) {
        var _this = _super.call(this) || this;
        _this._running = false;
        _this._time = 0;
        _this._pausedTime = 0;
        _this._pauseStart = 0;
        _this._paused = false;
        opts = opts || {};
        _this.stage = opts.stage || {};
        return _this;
      }
      Animation2.prototype.addClip = function(clip2) {
        if (clip2.animation) {
          this.removeClip(clip2);
        }
        if (!this._head) {
          this._head = this._tail = clip2;
        } else {
          this._tail.next = clip2;
          clip2.prev = this._tail;
          clip2.next = null;
          this._tail = clip2;
        }
        clip2.animation = this;
      };
      Animation2.prototype.addAnimator = function(animator) {
        animator.animation = this;
        var clip2 = animator.getClip();
        if (clip2) {
          this.addClip(clip2);
        }
      };
      Animation2.prototype.removeClip = function(clip2) {
        if (!clip2.animation) {
          return;
        }
        var prev = clip2.prev;
        var next = clip2.next;
        if (prev) {
          prev.next = next;
        } else {
          this._head = next;
        }
        if (next) {
          next.prev = prev;
        } else {
          this._tail = prev;
        }
        clip2.next = clip2.prev = clip2.animation = null;
      };
      Animation2.prototype.removeAnimator = function(animator) {
        var clip2 = animator.getClip();
        if (clip2) {
          this.removeClip(clip2);
        }
        animator.animation = null;
      };
      Animation2.prototype.update = function(notTriggerFrameAndStageUpdate) {
        var time2 = getTime() - this._pausedTime;
        var delta = time2 - this._time;
        var clip2 = this._head;
        while (clip2) {
          var nextClip = clip2.next;
          var finished = clip2.step(time2, delta);
          if (finished) {
            clip2.ondestroy();
            this.removeClip(clip2);
            clip2 = nextClip;
          } else {
            clip2 = nextClip;
          }
        }
        this._time = time2;
        if (!notTriggerFrameAndStageUpdate) {
          this.trigger("frame", delta);
          this.stage.update && this.stage.update();
        }
      };
      Animation2.prototype._startLoop = function() {
        var self2 = this;
        this._running = true;
        function step() {
          if (self2._running) {
            requestAnimationFrame$1(step);
            !self2._paused && self2.update();
          }
        }
        requestAnimationFrame$1(step);
      };
      Animation2.prototype.start = function() {
        if (this._running) {
          return;
        }
        this._time = getTime();
        this._pausedTime = 0;
        this._startLoop();
      };
      Animation2.prototype.stop = function() {
        this._running = false;
      };
      Animation2.prototype.pause = function() {
        if (!this._paused) {
          this._pauseStart = getTime();
          this._paused = true;
        }
      };
      Animation2.prototype.resume = function() {
        if (this._paused) {
          this._pausedTime += getTime() - this._pauseStart;
          this._paused = false;
        }
      };
      Animation2.prototype.clear = function() {
        var clip2 = this._head;
        while (clip2) {
          var nextClip = clip2.next;
          clip2.prev = clip2.next = clip2.animation = null;
          clip2 = nextClip;
        }
        this._head = this._tail = null;
      };
      Animation2.prototype.isFinished = function() {
        return this._head == null;
      };
      Animation2.prototype.animate = function(target, options) {
        options = options || {};
        this.start();
        var animator = new Animator(target, options.loop);
        this.addAnimator(animator);
        return animator;
      };
      return Animation2;
    }(Eventful);
    var TOUCH_CLICK_DELAY = 300;
    var globalEventSupported = env.domSupported;
    var localNativeListenerNames = function() {
      var mouseHandlerNames = [
        "click",
        "dblclick",
        "mousewheel",
        "wheel",
        "mouseout",
        "mouseup",
        "mousedown",
        "mousemove",
        "contextmenu"
      ];
      var touchHandlerNames = [
        "touchstart",
        "touchend",
        "touchmove"
      ];
      var pointerEventNameMap = {
        pointerdown: 1,
        pointerup: 1,
        pointermove: 1,
        pointerout: 1
      };
      var pointerHandlerNames = map$1(mouseHandlerNames, function(name) {
        var nm = name.replace("mouse", "pointer");
        return pointerEventNameMap.hasOwnProperty(nm) ? nm : name;
      });
      return {
        mouse: mouseHandlerNames,
        touch: touchHandlerNames,
        pointer: pointerHandlerNames
      };
    }();
    var globalNativeListenerNames = {
      mouse: ["mousemove", "mouseup"],
      pointer: ["pointermove", "pointerup"]
    };
    var wheelEventSupported = false;
    function isPointerFromTouch(event) {
      var pointerType = event.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(event) {
      event && (event.zrByTouch = true);
    }
    function normalizeGlobalEvent(instance, event) {
      return normalizeEvent(instance.dom, new FakeGlobalEvent(instance, event), true);
    }
    function isLocalEl(instance, el) {
      var elTmp = el;
      var isLocal = false;
      while (elTmp && elTmp.nodeType !== 9 && !(isLocal = elTmp.domBelongToZr || elTmp !== el && elTmp === instance.painterRoot)) {
        elTmp = elTmp.parentNode;
      }
      return isLocal;
    }
    var FakeGlobalEvent = /* @__PURE__ */ function() {
      function FakeGlobalEvent2(instance, event) {
        this.stopPropagation = noop$1;
        this.stopImmediatePropagation = noop$1;
        this.preventDefault = noop$1;
        this.type = event.type;
        this.target = this.currentTarget = instance.dom;
        this.pointerType = event.pointerType;
        this.clientX = event.clientX;
        this.clientY = event.clientY;
      }
      return FakeGlobalEvent2;
    }();
    var localDOMHandlers = {
      mousedown: function(event) {
        event = normalizeEvent(this.dom, event);
        this.__mayPointerCapture = [event.zrX, event.zrY];
        this.trigger("mousedown", event);
      },
      mousemove: function(event) {
        event = normalizeEvent(this.dom, event);
        var downPoint = this.__mayPointerCapture;
        if (downPoint && (event.zrX !== downPoint[0] || event.zrY !== downPoint[1])) {
          this.__togglePointerCapture(true);
        }
        this.trigger("mousemove", event);
      },
      mouseup: function(event) {
        event = normalizeEvent(this.dom, event);
        this.__togglePointerCapture(false);
        this.trigger("mouseup", event);
      },
      mouseout: function(event) {
        event = normalizeEvent(this.dom, event);
        var element = event.toElement || event.relatedTarget;
        if (!isLocalEl(this, element)) {
          if (this.__pointerCapturing) {
            event.zrEventControl = "no_globalout";
          }
          this.trigger("mouseout", event);
        }
      },
      wheel: function(event) {
        wheelEventSupported = true;
        event = normalizeEvent(this.dom, event);
        this.trigger("mousewheel", event);
      },
      mousewheel: function(event) {
        if (wheelEventSupported) {
          return;
        }
        event = normalizeEvent(this.dom, event);
        this.trigger("mousewheel", event);
      },
      touchstart: function(event) {
        event = normalizeEvent(this.dom, event);
        markTouch(event);
        this.__lastTouchMoment = /* @__PURE__ */ new Date();
        this.handler.processGesture(event, "start");
        localDOMHandlers.mousemove.call(this, event);
        localDOMHandlers.mousedown.call(this, event);
      },
      touchmove: function(event) {
        event = normalizeEvent(this.dom, event);
        markTouch(event);
        this.handler.processGesture(event, "change");
        localDOMHandlers.mousemove.call(this, event);
      },
      touchend: function(event) {
        event = normalizeEvent(this.dom, event);
        markTouch(event);
        this.handler.processGesture(event, "end");
        localDOMHandlers.mouseup.call(this, event);
        if (+/* @__PURE__ */ new Date() - +this.__lastTouchMoment < TOUCH_CLICK_DELAY) {
          localDOMHandlers.click.call(this, event);
        }
      },
      pointerdown: function(event) {
        localDOMHandlers.mousedown.call(this, event);
      },
      pointermove: function(event) {
        if (!isPointerFromTouch(event)) {
          localDOMHandlers.mousemove.call(this, event);
        }
      },
      pointerup: function(event) {
        localDOMHandlers.mouseup.call(this, event);
      },
      pointerout: function(event) {
        if (!isPointerFromTouch(event)) {
          localDOMHandlers.mouseout.call(this, event);
        }
      }
    };
    each$f(["click", "dblclick", "contextmenu"], function(name) {
      localDOMHandlers[name] = function(event) {
        event = normalizeEvent(this.dom, event);
        this.trigger(name, event);
      };
    });
    var globalDOMHandlers = {
      pointermove: function(event) {
        if (!isPointerFromTouch(event)) {
          globalDOMHandlers.mousemove.call(this, event);
        }
      },
      pointerup: function(event) {
        globalDOMHandlers.mouseup.call(this, event);
      },
      mousemove: function(event) {
        this.trigger("mousemove", event);
      },
      mouseup: function(event) {
        var pointerCaptureReleasing = this.__pointerCapturing;
        this.__togglePointerCapture(false);
        this.trigger("mouseup", event);
        if (pointerCaptureReleasing) {
          event.zrEventControl = "only_globalout";
          this.trigger("mouseout", event);
        }
      }
    };
    function mountLocalDOMEventListeners(instance, scope) {
      var domHandlers = scope.domHandlers;
      if (env.pointerEventsSupported) {
        each$f(localNativeListenerNames.pointer, function(nativeEventName) {
          mountSingleDOMEventListener(scope, nativeEventName, function(event) {
            domHandlers[nativeEventName].call(instance, event);
          });
        });
      } else {
        if (env.touchEventsSupported) {
          each$f(localNativeListenerNames.touch, function(nativeEventName) {
            mountSingleDOMEventListener(scope, nativeEventName, function(event) {
              domHandlers[nativeEventName].call(instance, event);
              setTouchTimer(scope);
            });
          });
        }
        each$f(localNativeListenerNames.mouse, function(nativeEventName) {
          mountSingleDOMEventListener(scope, nativeEventName, function(event) {
            event = getNativeEvent(event);
            if (!scope.touching) {
              domHandlers[nativeEventName].call(instance, event);
            }
          });
        });
      }
    }
    function mountGlobalDOMEventListeners(instance, scope) {
      if (env.pointerEventsSupported) {
        each$f(globalNativeListenerNames.pointer, mount);
      } else if (!env.touchEventsSupported) {
        each$f(globalNativeListenerNames.mouse, mount);
      }
      function mount(nativeEventName) {
        function nativeEventListener(event) {
          event = getNativeEvent(event);
          if (!isLocalEl(instance, event.target)) {
            event = normalizeGlobalEvent(instance, event);
            scope.domHandlers[nativeEventName].call(instance, event);
          }
        }
        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) {
      var mounted = scope.mounted;
      for (var nativeEventName in mounted) {
        if (mounted.hasOwnProperty(nativeEventName)) {
          removeEventListener(scope.domTarget, nativeEventName, mounted[nativeEventName], scope.listenerOpts[nativeEventName]);
        }
      }
      scope.mounted = {};
    }
    var DOMHandlerScope = /* @__PURE__ */ function() {
      function DOMHandlerScope2(domTarget, domHandlers) {
        this.mounted = {};
        this.listenerOpts = {};
        this.touching = false;
        this.domTarget = domTarget;
        this.domHandlers = domHandlers;
      }
      return DOMHandlerScope2;
    }();
    var HandlerDomProxy = function(_super) {
      __extends$1(HandlerDomProxy2, _super);
      function HandlerDomProxy2(dom, painterRoot) {
        var _this = _super.call(this) || this;
        _this.__pointerCapturing = false;
        _this.dom = dom;
        _this.painterRoot = painterRoot;
        _this._localHandlerScope = new DOMHandlerScope(dom, localDOMHandlers);
        if (globalEventSupported) {
          _this._globalHandlerScope = new DOMHandlerScope(document, globalDOMHandlers);
        }
        mountLocalDOMEventListeners(_this, _this._localHandlerScope);
        return _this;
      }
      HandlerDomProxy2.prototype.dispose = function() {
        unmountDOMEventListeners(this._localHandlerScope);
        if (globalEventSupported) {
          unmountDOMEventListeners(this._globalHandlerScope);
        }
      };
      HandlerDomProxy2.prototype.setCursor = function(cursorStyle) {
        this.dom.style && (this.dom.style.cursor = cursorStyle || "default");
      };
      HandlerDomProxy2.prototype.__togglePointerCapture = function(isPointerCapturing) {
        this.__mayPointerCapture = null;
        if (globalEventSupported && +this.__pointerCapturing ^ +isPointerCapturing) {
          this.__pointerCapturing = isPointerCapturing;
          var globalHandlerScope = this._globalHandlerScope;
          isPointerCapturing ? mountGlobalDOMEventListeners(this, globalHandlerScope) : unmountDOMEventListeners(globalHandlerScope);
        }
      };
      return HandlerDomProxy2;
    }(Eventful);
    var dpr = 1;
    if (env.hasGlobalWindow) {
      dpr = Math.max(window.devicePixelRatio || window.screen && window.screen.deviceXDPI / window.screen.logicalXDPI || 1, 1);
    }
    var devicePixelRatio = dpr;
    var DARK_MODE_THRESHOLD = 0.4;
    var DARK_LABEL_COLOR = "#333";
    var LIGHT_LABEL_COLOR = "#ccc";
    var LIGHTER_LABEL_COLOR = "#eee";
    var mIdentity = identity;
    var EPSILON$2 = 5e-5;
    function isNotAroundZero(val) {
      return val > EPSILON$2 || val < -5e-5;
    }
    var scaleTmp = [];
    var tmpTransform = [];
    var originTransform = create$1();
    var abs = Math.abs;
    var Transformable = function() {
      function Transformable2() {
      }
      Transformable2.prototype.getLocalTransform = function(m2) {
        return Transformable2.getLocalTransform(this, m2);
      };
      Transformable2.prototype.setPosition = function(arr) {
        this.x = arr[0];
        this.y = arr[1];
      };
      Transformable2.prototype.setScale = function(arr) {
        this.scaleX = arr[0];
        this.scaleY = arr[1];
      };
      Transformable2.prototype.setSkew = function(arr) {
        this.skewX = arr[0];
        this.skewY = arr[1];
      };
      Transformable2.prototype.setOrigin = function(arr) {
        this.originX = arr[0];
        this.originY = arr[1];
      };
      Transformable2.prototype.needLocalTransform = function() {
        return isNotAroundZero(this.rotation) || isNotAroundZero(this.x) || isNotAroundZero(this.y) || isNotAroundZero(this.scaleX - 1) || isNotAroundZero(this.scaleY - 1) || isNotAroundZero(this.skewX) || isNotAroundZero(this.skewY);
      };
      Transformable2.prototype.updateTransform = function() {
        var parentTransform = this.parent && this.parent.transform;
        var needLocalTransform = this.needLocalTransform();
        var m2 = this.transform;
        if (!(needLocalTransform || parentTransform)) {
          if (m2) {
            mIdentity(m2);
            this.invTransform = null;
          }
          return;
        }
        m2 = m2 || create$1();
        if (needLocalTransform) {
          this.getLocalTransform(m2);
        } else {
          mIdentity(m2);
        }
        if (parentTransform) {
          if (needLocalTransform) {
            mul(m2, parentTransform, m2);
          } else {
            copy(m2, parentTransform);
          }
        }
        this.transform = m2;
        this._resolveGlobalScaleRatio(m2);
      };
      Transformable2.prototype._resolveGlobalScaleRatio = function(m2) {
        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;
          m2[0] *= sx;
          m2[1] *= sx;
          m2[2] *= sy;
          m2[3] *= sy;
        }
        this.invTransform = this.invTransform || create$1();
        invert(this.invTransform, m2);
      };
      Transformable2.prototype.getComputedTransform = function() {
        var transformNode = this;
        var ancestors = [];
        while (transformNode) {
          ancestors.push(transformNode);
          transformNode = transformNode.parent;
        }
        while (transformNode = ancestors.pop()) {
          transformNode.updateTransform();
        }
        return this.transform;
      };
      Transformable2.prototype.setLocalTransform = function(m2) {
        if (!m2) {
          return;
        }
        var sx = m2[0] * m2[0] + m2[1] * m2[1];
        var sy = m2[2] * m2[2] + m2[3] * m2[3];
        var rotation = Math.atan2(m2[1], m2[0]);
        var shearX = Math.PI / 2 + rotation - Math.atan2(m2[3], m2[2]);
        sy = Math.sqrt(sy) * Math.cos(shearX);
        sx = Math.sqrt(sx);
        this.skewX = shearX;
        this.skewY = 0;
        this.rotation = -rotation;
        this.x = +m2[4];
        this.y = +m2[5];
        this.scaleX = sx;
        this.scaleY = sy;
        this.originX = 0;
        this.originY = 0;
      };
      Transformable2.prototype.decomposeTransform = function() {
        if (!this.transform) {
          return;
        }
        var parent2 = this.parent;
        var m2 = this.transform;
        if (parent2 && parent2.transform) {
          parent2.invTransform = parent2.invTransform || create$1();
          mul(tmpTransform, parent2.invTransform, m2);
          m2 = tmpTransform;
        }
        var ox = this.originX;
        var 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);
      };
      Transformable2.prototype.getGlobalScale = function(out2) {
        var 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;
      };
      Transformable2.prototype.transformCoordToLocal = function(x2, y) {
        var v22 = [x2, y];
        var invTransform = this.invTransform;
        if (invTransform) {
          applyTransform$1(v22, v22, invTransform);
        }
        return v22;
      };
      Transformable2.prototype.transformCoordToGlobal = function(x2, y) {
        var v22 = [x2, y];
        var transform2 = this.transform;
        if (transform2) {
          applyTransform$1(v22, v22, transform2);
        }
        return v22;
      };
      Transformable2.prototype.getLineScale = function() {
        var 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;
      };
      Transformable2.prototype.copyTransform = function(source) {
        copyTransform(this, source);
      };
      Transformable2.getLocalTransform = function(target, m2) {
        m2 = m2 || [];
        var ox = target.originX || 0;
        var oy = target.originY || 0;
        var sx = target.scaleX;
        var sy = target.scaleY;
        var ax = target.anchorX;
        var ay = target.anchorY;
        var rotation = target.rotation || 0;
        var x2 = target.x;
        var y = target.y;
        var skewX = target.skewX ? Math.tan(target.skewX) : 0;
        var skewY = target.skewY ? Math.tan(-target.skewY) : 0;
        if (ox || oy || ax || ay) {
          var dx = ox + ax;
          var dy = oy + ay;
          m2[4] = -dx * sx - skewX * dy * sy;
          m2[5] = -dy * sy - skewY * dx * sx;
        } else {
          m2[4] = m2[5] = 0;
        }
        m2[0] = sx;
        m2[3] = sy;
        m2[1] = skewY * sx;
        m2[2] = skewX * sy;
        rotation && rotate(m2, m2, rotation);
        m2[4] += ox + x2;
        m2[5] += oy + y;
        return m2;
      };
      Transformable2.initDefaultProps = function() {
        var proto2 = Transformable2.prototype;
        proto2.scaleX = proto2.scaleY = proto2.globalScaleRatio = 1;
        proto2.x = proto2.y = proto2.originX = proto2.originY = proto2.skewX = proto2.skewY = proto2.rotation = proto2.anchorX = proto2.anchorY = 0;
      }();
      return Transformable2;
    }();
    var TRANSFORMABLE_PROPS = [
      "x",
      "y",
      "originX",
      "originY",
      "anchorX",
      "anchorY",
      "rotation",
      "scaleX",
      "scaleY",
      "skewX",
      "skewY"
    ];
    function copyTransform(target, source) {
      for (var i2 = 0; i2 < TRANSFORMABLE_PROPS.length; i2++) {
        var propName = TRANSFORMABLE_PROPS[i2];
        target[propName] = source[propName];
      }
    }
    var textWidthCache = {};
    function getWidth(text, font) {
      font = font || DEFAULT_FONT;
      var cacheOfFont = textWidthCache[font];
      if (!cacheOfFont) {
        cacheOfFont = textWidthCache[font] = new LRU(500);
      }
      var width = cacheOfFont.get(text);
      if (width == null) {
        width = platformApi.measureText(text, font).width;
        cacheOfFont.put(text, width);
      }
      return width;
    }
    function innerGetBoundingRect(text, font, textAlign2, textBaseline) {
      var width = getWidth(text, font);
      var height = getLineHeight(font);
      var x2 = adjustTextX(0, width, textAlign2);
      var y = adjustTextY(0, height, textBaseline);
      var rect = new BoundingRect(x2, y, width, height);
      return rect;
    }
    function getBoundingRect(text, font, textAlign2, textBaseline) {
      var textLines = ((text || "") + "").split("\n");
      var len2 = textLines.length;
      if (len2 === 1) {
        return innerGetBoundingRect(textLines[0], font, textAlign2, textBaseline);
      } else {
        var uniondRect = new BoundingRect(0, 0, 0, 0);
        for (var i2 = 0; i2 < textLines.length; i2++) {
          var rect = innerGetBoundingRect(textLines[i2], font, textAlign2, textBaseline);
          i2 === 0 ? uniondRect.copy(rect) : uniondRect.union(rect);
        }
        return uniondRect;
      }
    }
    function adjustTextX(x2, width, textAlign2) {
      if (textAlign2 === "right") {
        x2 -= width;
      } else if (textAlign2 === "center") {
        x2 -= width / 2;
      }
      return x2;
    }
    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$1(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) {
      var textPosition = opts.position || "inside";
      var distance2 = opts.distance != null ? opts.distance : 5;
      var height = rect.height;
      var width = rect.width;
      var halfHeight = height / 2;
      var x2 = rect.x;
      var y = rect.y;
      var textAlign2 = "left";
      var textVerticalAlign = "top";
      if (textPosition instanceof Array) {
        x2 += parsePercent$1(textPosition[0], rect.width);
        y += parsePercent$1(textPosition[1], rect.height);
        textAlign2 = null;
        textVerticalAlign = null;
      } else {
        switch (textPosition) {
          case "left":
            x2 -= distance2;
            y += halfHeight;
            textAlign2 = "right";
            textVerticalAlign = "middle";
            break;
          case "right":
            x2 += distance2 + width;
            y += halfHeight;
            textVerticalAlign = "middle";
            break;
          case "top":
            x2 += width / 2;
            y -= distance2;
            textAlign2 = "center";
            textVerticalAlign = "bottom";
            break;
          case "bottom":
            x2 += width / 2;
            y += height + distance2;
            textAlign2 = "center";
            break;
          case "inside":
            x2 += width / 2;
            y += halfHeight;
            textAlign2 = "center";
            textVerticalAlign = "middle";
            break;
          case "insideLeft":
            x2 += distance2;
            y += halfHeight;
            textVerticalAlign = "middle";
            break;
          case "insideRight":
            x2 += width - distance2;
            y += halfHeight;
            textAlign2 = "right";
            textVerticalAlign = "middle";
            break;
          case "insideTop":
            x2 += width / 2;
            y += distance2;
            textAlign2 = "center";
            break;
          case "insideBottom":
            x2 += width / 2;
            y += height - distance2;
            textAlign2 = "center";
            textVerticalAlign = "bottom";
            break;
          case "insideTopLeft":
            x2 += distance2;
            y += distance2;
            break;
          case "insideTopRight":
            x2 += width - distance2;
            y += distance2;
            textAlign2 = "right";
            break;
          case "insideBottomLeft":
            x2 += distance2;
            y += height - distance2;
            textVerticalAlign = "bottom";
            break;
          case "insideBottomRight":
            x2 += width - distance2;
            y += height - distance2;
            textAlign2 = "right";
            textVerticalAlign = "bottom";
            break;
        }
      }
      out2 = out2 || {};
      out2.x = x2;
      out2.y = y;
      out2.align = textAlign2;
      out2.verticalAlign = textVerticalAlign;
      return out2;
    }
    var PRESERVED_NORMAL_STATE = "__zr_normal__";
    var PRIMARY_STATES_KEYS$1 = TRANSFORMABLE_PROPS.concat(["ignore"]);
    var DEFAULT_ANIMATABLE_MAP = reduce(TRANSFORMABLE_PROPS, function(obj, key) {
      obj[key] = true;
      return obj;
    }, { ignore: false });
    var tmpTextPosCalcRes = {};
    var tmpBoundingRect = new BoundingRect(0, 0, 0, 0);
    var Element$1 = function() {
      function Element2(props2) {
        this.id = guid();
        this.animators = [];
        this.currentStates = [];
        this.states = {};
        this._init(props2);
      }
      Element2.prototype._init = function(props2) {
        this.attr(props2);
      };
      Element2.prototype.drift = function(dx, dy, e2) {
        switch (this.draggable) {
          case "horizontal":
            dy = 0;
            break;
          case "vertical":
            dx = 0;
            break;
        }
        var m2 = this.transform;
        if (!m2) {
          m2 = this.transform = [1, 0, 0, 1, 0, 0];
        }
        m2[4] += dx;
        m2[5] += dy;
        this.decomposeTransform();
        this.markRedraw();
      };
      Element2.prototype.beforeUpdate = function() {
      };
      Element2.prototype.afterUpdate = function() {
      };
      Element2.prototype.update = function() {
        this.updateTransform();
        if (this.__dirty) {
          this.updateInnerText();
        }
      };
      Element2.prototype.updateInnerText = function(forceUpdate) {
        var textEl = this._textContent;
        if (textEl && (!textEl.ignore || forceUpdate)) {
          if (!this.textConfig) {
            this.textConfig = {};
          }
          var textConfig = this.textConfig;
          var isLocal = textConfig.local;
          var innerTransformable = textEl.innerTransformable;
          var textAlign2 = void 0;
          var textVerticalAlign = void 0;
          var textStyleChanged = false;
          innerTransformable.parent = isLocal ? this : null;
          var innerOrigin = false;
          innerTransformable.copyTransform(textEl);
          if (textConfig.position != null) {
            var 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);
            }
            innerTransformable.x = tmpTextPosCalcRes.x;
            innerTransformable.y = tmpTextPosCalcRes.y;
            textAlign2 = tmpTextPosCalcRes.align;
            textVerticalAlign = tmpTextPosCalcRes.verticalAlign;
            var textOrigin = textConfig.origin;
            if (textOrigin && textConfig.rotation != null) {
              var relOriginX = void 0;
              var relOriginY = void 0;
              if (textOrigin === "center") {
                relOriginX = layoutRect.width * 0.5;
                relOriginY = layoutRect.height * 0.5;
              } else {
                relOriginX = parsePercent$1(textOrigin[0], layoutRect.width);
                relOriginY = parsePercent$1(textOrigin[1], layoutRect.height);
              }
              innerOrigin = true;
              innerTransformable.originX = -innerTransformable.x + relOriginX + (isLocal ? 0 : layoutRect.x);
              innerTransformable.originY = -innerTransformable.y + relOriginY + (isLocal ? 0 : layoutRect.y);
            }
          }
          if (textConfig.rotation != null) {
            innerTransformable.rotation = textConfig.rotation;
          }
          var textOffset = textConfig.offset;
          if (textOffset) {
            innerTransformable.x += textOffset[0];
            innerTransformable.y += textOffset[1];
            if (!innerOrigin) {
              innerTransformable.originX = -textOffset[0];
              innerTransformable.originY = -textOffset[1];
            }
          }
          var isInside = textConfig.inside == null ? typeof textConfig.position === "string" && textConfig.position.indexOf("inside") >= 0 : textConfig.inside;
          var innerTextDefaultStyle = this._innerTextDefaultStyle || (this._innerTextDefaultStyle = {});
          var textFill = void 0;
          var textStroke = void 0;
          var autoStroke = void 0;
          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 || textAlign2 !== innerTextDefaultStyle.align || textVerticalAlign !== innerTextDefaultStyle.verticalAlign) {
            textStyleChanged = true;
            innerTextDefaultStyle.fill = textFill;
            innerTextDefaultStyle.stroke = textStroke;
            innerTextDefaultStyle.autoStroke = autoStroke;
            innerTextDefaultStyle.align = textAlign2;
            innerTextDefaultStyle.verticalAlign = textVerticalAlign;
            textEl.setDefaultTextStyle(innerTextDefaultStyle);
          }
          textEl.__dirty |= REDRAW_BIT;
          if (textStyleChanged) {
            textEl.dirtyStyle(true);
          }
        }
      };
      Element2.prototype.canBeInsideText = function() {
        return true;
      };
      Element2.prototype.getInsideTextFill = function() {
        return "#fff";
      };
      Element2.prototype.getInsideTextStroke = function(textFill) {
        return "#000";
      };
      Element2.prototype.getOutsideFill = function() {
        return this.__zr && this.__zr.isDarkMode() ? LIGHT_LABEL_COLOR : DARK_LABEL_COLOR;
      };
      Element2.prototype.getOutsideStroke = function(textFill) {
        var backgroundColor2 = this.__zr && this.__zr.getBackgroundColor();
        var colorArr = typeof backgroundColor2 === "string" && parse$1(backgroundColor2);
        if (!colorArr) {
          colorArr = [255, 255, 255, 1];
        }
        var alpha = colorArr[3];
        var isDark = this.__zr.isDarkMode();
        for (var i2 = 0; i2 < 3; i2++) {
          colorArr[i2] = colorArr[i2] * alpha + (isDark ? 0 : 255) * (1 - alpha);
        }
        colorArr[3] = 1;
        return stringify(colorArr, "rgba");
      };
      Element2.prototype.traverse = function(cb, context) {
      };
      Element2.prototype.attrKV = function(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$1(this.extra, value);
        } else {
          this[key] = value;
        }
      };
      Element2.prototype.hide = function() {
        this.ignore = true;
        this.markRedraw();
      };
      Element2.prototype.show = function() {
        this.ignore = false;
        this.markRedraw();
      };
      Element2.prototype.attr = function(keyOrObj, value) {
        if (typeof keyOrObj === "string") {
          this.attrKV(keyOrObj, value);
        } else if (isObject$5(keyOrObj)) {
          var obj = keyOrObj;
          var keysArr = keys$1(obj);
          for (var i2 = 0; i2 < keysArr.length; i2++) {
            var key = keysArr[i2];
            this.attrKV(key, keyOrObj[key]);
          }
        }
        this.markRedraw();
        return this;
      };
      Element2.prototype.saveCurrentToNormalState = function(toState) {
        this._innerSaveToNormal(toState);
        var normalState = this._normalState;
        for (var i2 = 0; i2 < this.animators.length; i2++) {
          var animator = this.animators[i2];
          var fromStateTransition = animator.__fromStateTransition;
          if (animator.getLoop() || fromStateTransition && fromStateTransition !== PRESERVED_NORMAL_STATE) {
            continue;
          }
          var targetName = animator.targetName;
          var target = targetName ? normalState[targetName] : normalState;
          animator.saveTo(target);
        }
      };
      Element2.prototype._innerSaveToNormal = function(toState) {
        var normalState = this._normalState;
        if (!normalState) {
          normalState = this._normalState = {};
        }
        if (toState.textConfig && !normalState.textConfig) {
          normalState.textConfig = this.textConfig;
        }
        this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS$1);
      };
      Element2.prototype._savePrimaryToNormal = function(toState, normalState, primaryKeys) {
        for (var i2 = 0; i2 < primaryKeys.length; i2++) {
          var key = primaryKeys[i2];
          if (toState[key] != null && !(key in normalState)) {
            normalState[key] = this[key];
          }
        }
      };
      Element2.prototype.hasState = function() {
        return this.currentStates.length > 0;
      };
      Element2.prototype.getState = function(name) {
        return this.states[name];
      };
      Element2.prototype.ensureState = function(name) {
        var states = this.states;
        if (!states[name]) {
          states[name] = {};
        }
        return states[name];
      };
      Element2.prototype.clearStates = function(noAnimation) {
        this.useState(PRESERVED_NORMAL_STATE, false, noAnimation);
      };
      Element2.prototype.useState = function(stateName, keepCurrentStates, noAnimation, forceUseHoverLayer) {
        var toNormalState = stateName === PRESERVED_NORMAL_STATE;
        var hasStates = this.hasState();
        if (!hasStates && toNormalState) {
          return;
        }
        var currentStates = this.currentStates;
        var animationCfg = this.stateTransition;
        if (indexOf(currentStates, stateName) >= 0 && (keepCurrentStates || currentStates.length === 1)) {
          return;
        }
        var state;
        if (this.stateProxy && !toNormalState) {
          state = this.stateProxy(stateName);
        }
        if (!state) {
          state = this.states && this.states[stateName];
        }
        if (!state && !toNormalState) {
          logError("State " + stateName + " not exists.");
          return;
        }
        if (!toNormalState) {
          this.saveCurrentToNormalState(state);
        }
        var useHoverLayer = !!(state && state.hoverLayer || forceUseHoverLayer);
        if (useHoverLayer) {
          this._toggleHoverLayerFlag(true);
        }
        this._applyStateObj(stateName, state, this._normalState, keepCurrentStates, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);
        var textContent = this._textContent;
        var textGuide = this._textGuide;
        if (textContent) {
          textContent.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);
        }
        if (textGuide) {
          textGuide.useState(stateName, keepCurrentStates, noAnimation, useHoverLayer);
        }
        if (toNormalState) {
          this.currentStates = [];
          this._normalState = {};
        } else {
          if (!keepCurrentStates) {
            this.currentStates = [stateName];
          } else {
            this.currentStates.push(stateName);
          }
        }
        this._updateAnimationTargets();
        this.markRedraw();
        if (!useHoverLayer && this.__inHover) {
          this._toggleHoverLayerFlag(false);
          this.__dirty &= -2;
        }
        return state;
      };
      Element2.prototype.useStates = function(states, noAnimation, forceUseHoverLayer) {
        if (!states.length) {
          this.clearStates();
        } else {
          var stateObjects = [];
          var currentStates = this.currentStates;
          var len2 = states.length;
          var notChange = len2 === currentStates.length;
          if (notChange) {
            for (var i2 = 0; i2 < len2; i2++) {
              if (states[i2] !== currentStates[i2]) {
                notChange = false;
                break;
              }
            }
          }
          if (notChange) {
            return;
          }
          for (var i2 = 0; i2 < len2; i2++) {
            var stateName = states[i2];
            var stateObj = void 0;
            if (this.stateProxy) {
              stateObj = this.stateProxy(stateName, states);
            }
            if (!stateObj) {
              stateObj = this.states[stateName];
            }
            if (stateObj) {
              stateObjects.push(stateObj);
            }
          }
          var lastStateObj = stateObjects[len2 - 1];
          var useHoverLayer = !!(lastStateObj && lastStateObj.hoverLayer || forceUseHoverLayer);
          if (useHoverLayer) {
            this._toggleHoverLayerFlag(true);
          }
          var mergedState = this._mergeStates(stateObjects);
          var animationCfg = this.stateTransition;
          this.saveCurrentToNormalState(mergedState);
          this._applyStateObj(states.join(","), mergedState, this._normalState, false, !noAnimation && !this.__inHover && animationCfg && animationCfg.duration > 0, animationCfg);
          var textContent = this._textContent;
          var textGuide = this._textGuide;
          if (textContent) {
            textContent.useStates(states, noAnimation, useHoverLayer);
          }
          if (textGuide) {
            textGuide.useStates(states, noAnimation, useHoverLayer);
          }
          this._updateAnimationTargets();
          this.currentStates = states.slice();
          this.markRedraw();
          if (!useHoverLayer && this.__inHover) {
            this._toggleHoverLayerFlag(false);
            this.__dirty &= -2;
          }
        }
      };
      Element2.prototype.isSilent = function() {
        var isSilent = this.silent;
        var ancestor = this.parent;
        while (!isSilent && ancestor) {
          if (ancestor.silent) {
            isSilent = true;
            break;
          }
          ancestor = ancestor.parent;
        }
        return isSilent;
      };
      Element2.prototype._updateAnimationTargets = function() {
        for (var i2 = 0; i2 < this.animators.length; i2++) {
          var animator = this.animators[i2];
          if (animator.targetName) {
            animator.changeTarget(this[animator.targetName]);
          }
        }
      };
      Element2.prototype.removeState = function(state) {
        var idx = indexOf(this.currentStates, state);
        if (idx >= 0) {
          var currentStates = this.currentStates.slice();
          currentStates.splice(idx, 1);
          this.useStates(currentStates);
        }
      };
      Element2.prototype.replaceState = function(oldState, newState, forceAdd) {
        var currentStates = this.currentStates.slice();
        var idx = indexOf(currentStates, oldState);
        var newStateExists = indexOf(currentStates, newState) >= 0;
        if (idx >= 0) {
          if (!newStateExists) {
            currentStates[idx] = newState;
          } else {
            currentStates.splice(idx, 1);
          }
        } else if (forceAdd && !newStateExists) {
          currentStates.push(newState);
        }
        this.useStates(currentStates);
      };
      Element2.prototype.toggleState = function(state, enable) {
        if (enable) {
          this.useState(state, true);
        } else {
          this.removeState(state);
        }
      };
      Element2.prototype._mergeStates = function(states) {
        var mergedState = {};
        var mergedTextConfig;
        for (var i2 = 0; i2 < states.length; i2++) {
          var state = states[i2];
          extend$1(mergedState, state);
          if (state.textConfig) {
            mergedTextConfig = mergedTextConfig || {};
            extend$1(mergedTextConfig, state.textConfig);
          }
        }
        if (mergedTextConfig) {
          mergedState.textConfig = mergedTextConfig;
        }
        return mergedState;
      };
      Element2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
        var needsRestoreToNormal = !(state && keepCurrentStates);
        if (state && state.textConfig) {
          this.textConfig = extend$1({}, keepCurrentStates ? this.textConfig : normalState.textConfig);
          extend$1(this.textConfig, state.textConfig);
        } else if (needsRestoreToNormal) {
          if (normalState.textConfig) {
            this.textConfig = normalState.textConfig;
          }
        }
        var transitionTarget = {};
        var hasTransition = false;
        for (var i2 = 0; i2 < PRIMARY_STATES_KEYS$1.length; i2++) {
          var key = PRIMARY_STATES_KEYS$1[i2];
          var 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];
              }
            }
          }
        }
        if (!transition) {
          for (var i2 = 0; i2 < this.animators.length; i2++) {
            var animator = this.animators[i2];
            var targetName = animator.targetName;
            if (!animator.getLoop()) {
              animator.__changeFinalValue(targetName ? (state || normalState)[targetName] : state || normalState);
            }
          }
        }
        if (hasTransition) {
          this._transitionState(stateName, transitionTarget, animationCfg);
        }
      };
      Element2.prototype._attachComponent = function(componentEl) {
        if (componentEl.__zr && !componentEl.__hostTarget) {
          return;
        }
        if (componentEl === this) {
          return;
        }
        var zr = this.__zr;
        if (zr) {
          componentEl.addSelfToZr(zr);
        }
        componentEl.__zr = zr;
        componentEl.__hostTarget = this;
      };
      Element2.prototype._detachComponent = function(componentEl) {
        if (componentEl.__zr) {
          componentEl.removeSelfFromZr(componentEl.__zr);
        }
        componentEl.__zr = null;
        componentEl.__hostTarget = null;
      };
      Element2.prototype.getClipPath = function() {
        return this._clipPath;
      };
      Element2.prototype.setClipPath = function(clipPath) {
        if (this._clipPath && this._clipPath !== clipPath) {
          this.removeClipPath();
        }
        this._attachComponent(clipPath);
        this._clipPath = clipPath;
        this.markRedraw();
      };
      Element2.prototype.removeClipPath = function() {
        var clipPath = this._clipPath;
        if (clipPath) {
          this._detachComponent(clipPath);
          this._clipPath = null;
          this.markRedraw();
        }
      };
      Element2.prototype.getTextContent = function() {
        return this._textContent;
      };
      Element2.prototype.setTextContent = function(textEl) {
        var previousTextContent = this._textContent;
        if (previousTextContent === textEl) {
          return;
        }
        if (previousTextContent && previousTextContent !== textEl) {
          this.removeTextContent();
        }
        textEl.innerTransformable = new Transformable();
        this._attachComponent(textEl);
        this._textContent = textEl;
        this.markRedraw();
      };
      Element2.prototype.setTextConfig = function(cfg) {
        if (!this.textConfig) {
          this.textConfig = {};
        }
        extend$1(this.textConfig, cfg);
        this.markRedraw();
      };
      Element2.prototype.removeTextConfig = function() {
        this.textConfig = null;
        this.markRedraw();
      };
      Element2.prototype.removeTextContent = function() {
        var textEl = this._textContent;
        if (textEl) {
          textEl.innerTransformable = null;
          this._detachComponent(textEl);
          this._textContent = null;
          this._innerTextDefaultStyle = null;
          this.markRedraw();
        }
      };
      Element2.prototype.getTextGuideLine = function() {
        return this._textGuide;
      };
      Element2.prototype.setTextGuideLine = function(guideLine) {
        if (this._textGuide && this._textGuide !== guideLine) {
          this.removeTextGuideLine();
        }
        this._attachComponent(guideLine);
        this._textGuide = guideLine;
        this.markRedraw();
      };
      Element2.prototype.removeTextGuideLine = function() {
        var textGuide = this._textGuide;
        if (textGuide) {
          this._detachComponent(textGuide);
          this._textGuide = null;
          this.markRedraw();
        }
      };
      Element2.prototype.markRedraw = function() {
        this.__dirty |= REDRAW_BIT;
        var zr = this.__zr;
        if (zr) {
          if (this.__inHover) {
            zr.refreshHover();
          } else {
            zr.refresh();
          }
        }
        if (this.__hostTarget) {
          this.__hostTarget.markRedraw();
        }
      };
      Element2.prototype.dirty = function() {
        this.markRedraw();
      };
      Element2.prototype._toggleHoverLayerFlag = function(inHover) {
        this.__inHover = inHover;
        var textContent = this._textContent;
        var textGuide = this._textGuide;
        if (textContent) {
          textContent.__inHover = inHover;
        }
        if (textGuide) {
          textGuide.__inHover = inHover;
        }
      };
      Element2.prototype.addSelfToZr = function(zr) {
        if (this.__zr === zr) {
          return;
        }
        this.__zr = zr;
        var animators = this.animators;
        if (animators) {
          for (var i2 = 0; i2 < animators.length; i2++) {
            zr.animation.addAnimator(animators[i2]);
          }
        }
        if (this._clipPath) {
          this._clipPath.addSelfToZr(zr);
        }
        if (this._textContent) {
          this._textContent.addSelfToZr(zr);
        }
        if (this._textGuide) {
          this._textGuide.addSelfToZr(zr);
        }
      };
      Element2.prototype.removeSelfFromZr = function(zr) {
        if (!this.__zr) {
          return;
        }
        this.__zr = null;
        var animators = this.animators;
        if (animators) {
          for (var i2 = 0; i2 < animators.length; i2++) {
            zr.animation.removeAnimator(animators[i2]);
          }
        }
        if (this._clipPath) {
          this._clipPath.removeSelfFromZr(zr);
        }
        if (this._textContent) {
          this._textContent.removeSelfFromZr(zr);
        }
        if (this._textGuide) {
          this._textGuide.removeSelfFromZr(zr);
        }
      };
      Element2.prototype.animate = function(key, loop, allowDiscreteAnimation) {
        var target = key ? this[key] : this;
        var animator = new Animator(target, loop, allowDiscreteAnimation);
        key && (animator.targetName = key);
        this.addAnimator(animator, key);
        return animator;
      };
      Element2.prototype.addAnimator = function(animator, key) {
        var zr = this.__zr;
        var el = this;
        animator.during(function() {
          el.updateDuringAnimation(key);
        }).done(function() {
          var animators = el.animators;
          var idx = indexOf(animators, animator);
          if (idx >= 0) {
            animators.splice(idx, 1);
          }
        });
        this.animators.push(animator);
        if (zr) {
          zr.animation.addAnimator(animator);
        }
        zr && zr.wakeUp();
      };
      Element2.prototype.updateDuringAnimation = function(key) {
        this.markRedraw();
      };
      Element2.prototype.stopAnimation = function(scope, forwardToLast) {
        var animators = this.animators;
        var len2 = animators.length;
        var leftAnimators = [];
        for (var i2 = 0; i2 < len2; i2++) {
          var animator = animators[i2];
          if (!scope || scope === animator.scope) {
            animator.stop(forwardToLast);
          } else {
            leftAnimators.push(animator);
          }
        }
        this.animators = leftAnimators;
        return this;
      };
      Element2.prototype.animateTo = function(target, cfg, animationProps) {
        animateTo(this, target, cfg, animationProps);
      };
      Element2.prototype.animateFrom = function(target, cfg, animationProps) {
        animateTo(this, target, cfg, animationProps, true);
      };
      Element2.prototype._transitionState = function(stateName, target, cfg, animationProps) {
        var animators = animateTo(this, target, cfg, animationProps);
        for (var i2 = 0; i2 < animators.length; i2++) {
          animators[i2].__fromStateTransition = stateName;
        }
      };
      Element2.prototype.getBoundingRect = function() {
        return null;
      };
      Element2.prototype.getPaintRect = function() {
        return null;
      };
      Element2.initDefaultProps = function() {
        var elProto = Element2.prototype;
        elProto.type = "element";
        elProto.name = "";
        elProto.ignore = elProto.silent = elProto.isGroup = elProto.draggable = elProto.dragging = elProto.ignoreClip = elProto.__inHover = false;
        elProto.__dirty = REDRAW_BIT;
        function createLegacyProperty(key, privateKey, xKey, yKey) {
          Object.defineProperty(elProto, key, {
            get: function() {
              if (!this[privateKey]) {
                var pos = this[privateKey] = [];
                enhanceArray(this, pos);
              }
              return this[privateKey];
            },
            set: function(pos) {
              this[xKey] = pos[0];
              this[yKey] = pos[1];
              this[privateKey] = pos;
              enhanceArray(this, pos);
            }
          });
          function enhanceArray(self2, pos) {
            Object.defineProperty(pos, 0, {
              get: function() {
                return self2[xKey];
              },
              set: function(val) {
                self2[xKey] = val;
              }
            });
            Object.defineProperty(pos, 1, {
              get: function() {
                return self2[yKey];
              },
              set: function(val) {
                self2[yKey] = val;
              }
            });
          }
        }
        if (Object.defineProperty) {
          createLegacyProperty("position", "_legacyPos", "x", "y");
          createLegacyProperty("scale", "_legacyScale", "scaleX", "scaleY");
          createLegacyProperty("origin", "_legacyOrigin", "originX", "originY");
        }
      }();
      return Element2;
    }();
    mixin(Element$1, Eventful);
    mixin(Element$1, Transformable);
    function animateTo(animatable, target, cfg, animationProps, reverse2) {
      cfg = cfg || {};
      var animators = [];
      animateToShallow(animatable, "", animatable, target, cfg, animationProps, animators, reverse2);
      var finishCount = animators.length;
      var doneHappened = false;
      var cfgDone = cfg.done;
      var cfgAborted = cfg.aborted;
      var doneCb = function() {
        doneHappened = true;
        finishCount--;
        if (finishCount <= 0) {
          doneHappened ? cfgDone && cfgDone() : cfgAborted && cfgAborted();
        }
      };
      var abortedCb = function() {
        finishCount--;
        if (finishCount <= 0) {
          doneHappened ? cfgDone && cfgDone() : cfgAborted && cfgAborted();
        }
      };
      if (!finishCount) {
        cfgDone && cfgDone();
      }
      if (animators.length > 0 && cfg.during) {
        animators[0].during(function(target2, percent) {
          cfg.during(percent);
        });
      }
      for (var i2 = 0; i2 < animators.length; i2++) {
        var animator = animators[i2];
        if (doneCb) {
          animator.done(doneCb);
        }
        if (abortedCb) {
          animator.aborted(abortedCb);
        }
        if (cfg.force) {
          animator.duration(cfg.duration);
        }
        animator.start(cfg.easing);
      }
      return animators;
    }
    function copyArrShallow(source, target, len2) {
      for (var i2 = 0; i2 < len2; i2++) {
        source[i2] = target[i2];
      }
    }
    function is2DArray(value) {
      return isArrayLike(value[0]);
    }
    function copyValue(target, source, key) {
      if (isArrayLike(source[key])) {
        if (!isArrayLike(target[key])) {
          target[key] = [];
        }
        if (isTypedArray$1(source[key])) {
          var len2 = source[key].length;
          if (target[key].length !== len2) {
            target[key] = new source[key].constructor(len2);
            copyArrShallow(target[key], source[key], len2);
          }
        } else {
          var sourceArr = source[key];
          var targetArr = target[key];
          var len0 = sourceArr.length;
          if (is2DArray(sourceArr)) {
            var len1 = sourceArr[0].length;
            for (var i2 = 0; i2 < len0; i2++) {
              if (!targetArr[i2]) {
                targetArr[i2] = Array.prototype.slice.call(sourceArr[i2]);
              } else {
                copyArrShallow(targetArr[i2], sourceArr[i2], len1);
              }
            }
          } else {
            copyArrShallow(targetArr, sourceArr, len0);
          }
          targetArr.length = sourceArr.length;
        }
      } else {
        target[key] = source[key];
      }
    }
    function isValueSame(val1, val2) {
      return val1 === val2 || isArrayLike(val1) && isArrayLike(val2) && is1DArraySame(val1, val2);
    }
    function is1DArraySame(arr0, arr1) {
      var len2 = arr0.length;
      if (len2 !== arr1.length) {
        return false;
      }
      for (var i2 = 0; i2 < len2; i2++) {
        if (arr0[i2] !== arr1[i2]) {
          return false;
        }
      }
      return true;
    }
    function animateToShallow(animatable, topKey, animateObj, target, cfg, animationProps, animators, reverse2) {
      var targetKeys = keys$1(target);
      var duration2 = cfg.duration;
      var delay = cfg.delay;
      var additive = cfg.additive;
      var setToFinal = cfg.setToFinal;
      var animateAll = !isObject$5(animationProps);
      var existsAnimators = animatable.animators;
      var animationKeys = [];
      for (var k2 = 0; k2 < targetKeys.length; k2++) {
        var innerKey = targetKeys[k2];
        var targetVal = target[innerKey];
        if (targetVal != null && animateObj[innerKey] != null && (animateAll || animationProps[innerKey])) {
          if (isObject$5(targetVal) && !isArrayLike(targetVal) && !isGradientObject(targetVal)) {
            if (topKey) {
              if (!reverse2) {
                animateObj[innerKey] = targetVal;
                animatable.updateDuringAnimation(topKey);
              }
              continue;
            }
            animateToShallow(animatable, innerKey, animateObj[innerKey], targetVal, cfg, animationProps && animationProps[innerKey], animators, reverse2);
          } else {
            animationKeys.push(innerKey);
          }
        } else if (!reverse2) {
          animateObj[innerKey] = targetVal;
          animatable.updateDuringAnimation(topKey);
          animationKeys.push(innerKey);
        }
      }
      var keyLen = animationKeys.length;
      if (!additive && keyLen) {
        for (var i2 = 0; i2 < existsAnimators.length; i2++) {
          var animator = existsAnimators[i2];
          if (animator.targetName === topKey) {
            var allAborted = animator.stopTracks(animationKeys);
            if (allAborted) {
              var idx = indexOf(existsAnimators, animator);
              existsAnimators.splice(idx, 1);
            }
          }
        }
      }
      if (!cfg.force) {
        animationKeys = filter(animationKeys, function(key) {
          return !isValueSame(target[key], animateObj[key]);
        });
        keyLen = animationKeys.length;
      }
      if (keyLen > 0 || cfg.force && !animators.length) {
        var revertedSource = void 0;
        var reversedTarget = void 0;
        var sourceClone = void 0;
        if (reverse2) {
          reversedTarget = {};
          if (setToFinal) {
            revertedSource = {};
          }
          for (var i2 = 0; i2 < keyLen; i2++) {
            var innerKey = animationKeys[i2];
            reversedTarget[innerKey] = animateObj[innerKey];
            if (setToFinal) {
              revertedSource[innerKey] = target[innerKey];
            } else {
              animateObj[innerKey] = target[innerKey];
            }
          }
        } else if (setToFinal) {
          sourceClone = {};
          for (var i2 = 0; i2 < keyLen; i2++) {
            var innerKey = animationKeys[i2];
            sourceClone[innerKey] = cloneValue(animateObj[innerKey]);
            copyValue(animateObj, target, innerKey);
          }
        }
        var animator = new Animator(animateObj, false, false, additive ? filter(existsAnimators, function(animator2) {
          return animator2.targetName === topKey;
        }) : null);
        animator.targetName = topKey;
        if (cfg.scope) {
          animator.scope = cfg.scope;
        }
        if (setToFinal && revertedSource) {
          animator.whenWithKeys(0, revertedSource, animationKeys);
        }
        if (sourceClone) {
          animator.whenWithKeys(0, sourceClone, animationKeys);
        }
        animator.whenWithKeys(duration2 == null ? 500 : duration2, reverse2 ? reversedTarget : target, animationKeys).delay(delay || 0);
        animatable.addAnimator(animator, topKey);
        animators.push(animator);
      }
    }
    var Group$3 = function(_super) {
      __extends$1(Group2, _super);
      function Group2(opts) {
        var _this = _super.call(this) || this;
        _this.isGroup = true;
        _this._children = [];
        _this.attr(opts);
        return _this;
      }
      Group2.prototype.childrenRef = function() {
        return this._children;
      };
      Group2.prototype.children = function() {
        return this._children.slice();
      };
      Group2.prototype.childAt = function(idx) {
        return this._children[idx];
      };
      Group2.prototype.childOfName = function(name) {
        var children = this._children;
        for (var i2 = 0; i2 < children.length; i2++) {
          if (children[i2].name === name) {
            return children[i2];
          }
        }
      };
      Group2.prototype.childCount = function() {
        return this._children.length;
      };
      Group2.prototype.add = function(child) {
        if (child) {
          if (child !== this && child.parent !== this) {
            this._children.push(child);
            this._doAdd(child);
          }
        }
        return this;
      };
      Group2.prototype.addBefore = function(child, nextSibling2) {
        if (child && child !== this && child.parent !== this && nextSibling2 && nextSibling2.parent === this) {
          var children = this._children;
          var idx = children.indexOf(nextSibling2);
          if (idx >= 0) {
            children.splice(idx, 0, child);
            this._doAdd(child);
          }
        }
        return this;
      };
      Group2.prototype.replace = function(oldChild, newChild) {
        var idx = indexOf(this._children, oldChild);
        if (idx >= 0) {
          this.replaceAt(newChild, idx);
        }
        return this;
      };
      Group2.prototype.replaceAt = function(child, index) {
        var children = this._children;
        var old = children[index];
        if (child && child !== this && child.parent !== this && child !== old) {
          children[index] = child;
          old.parent = null;
          var zr = this.__zr;
          if (zr) {
            old.removeSelfFromZr(zr);
          }
          this._doAdd(child);
        }
        return this;
      };
      Group2.prototype._doAdd = function(child) {
        if (child.parent) {
          child.parent.remove(child);
        }
        child.parent = this;
        var zr = this.__zr;
        if (zr && zr !== child.__zr) {
          child.addSelfToZr(zr);
        }
        zr && zr.refresh();
      };
      Group2.prototype.remove = function(child) {
        var zr = this.__zr;
        var children = this._children;
        var idx = indexOf(children, child);
        if (idx < 0) {
          return this;
        }
        children.splice(idx, 1);
        child.parent = null;
        if (zr) {
          child.removeSelfFromZr(zr);
        }
        zr && zr.refresh();
        return this;
      };
      Group2.prototype.removeAll = function() {
        var children = this._children;
        var zr = this.__zr;
        for (var i2 = 0; i2 < children.length; i2++) {
          var child = children[i2];
          if (zr) {
            child.removeSelfFromZr(zr);
          }
          child.parent = null;
        }
        children.length = 0;
        return this;
      };
      Group2.prototype.eachChild = function(cb, context) {
        var children = this._children;
        for (var i2 = 0; i2 < children.length; i2++) {
          var child = children[i2];
          cb.call(context, child, i2);
        }
        return this;
      };
      Group2.prototype.traverse = function(cb, context) {
        for (var i2 = 0; i2 < this._children.length; i2++) {
          var child = this._children[i2];
          var stopped = cb.call(context, child);
          if (child.isGroup && !stopped) {
            child.traverse(cb, context);
          }
        }
        return this;
      };
      Group2.prototype.addSelfToZr = function(zr) {
        _super.prototype.addSelfToZr.call(this, zr);
        for (var i2 = 0; i2 < this._children.length; i2++) {
          var child = this._children[i2];
          child.addSelfToZr(zr);
        }
      };
      Group2.prototype.removeSelfFromZr = function(zr) {
        _super.prototype.removeSelfFromZr.call(this, zr);
        for (var i2 = 0; i2 < this._children.length; i2++) {
          var child = this._children[i2];
          child.removeSelfFromZr(zr);
        }
      };
      Group2.prototype.getBoundingRect = function(includeChildren) {
        var tmpRect2 = new BoundingRect(0, 0, 0, 0);
        var children = includeChildren || this._children;
        var tmpMat = [];
        var rect = null;
        for (var i2 = 0; i2 < children.length; i2++) {
          var child = children[i2];
          if (child.ignore || child.invisible) {
            continue;
          }
          var childRect = child.getBoundingRect();
          var transform2 = child.getLocalTransform(tmpMat);
          if (transform2) {
            BoundingRect.applyTransform(tmpRect2, childRect, transform2);
            rect = rect || tmpRect2.clone();
            rect.union(tmpRect2);
          } else {
            rect = rect || childRect.clone();
            rect.union(childRect);
          }
        }
        return rect || tmpRect2;
      };
      return Group2;
    }(Element$1);
    Group$3.prototype.type = "group";
    /*!
    * ZRender, a high performance 2d drawing library.
    *
    * Copyright (c) 2013, Baidu Inc.
    * All rights reserved.
    *
    * LICENSE
    * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
    */
    var painterCtors = {};
    var instances$1 = {};
    function delInstance(id) {
      delete instances$1[id];
    }
    function isDarkMode(backgroundColor2) {
      if (!backgroundColor2) {
        return false;
      }
      if (typeof backgroundColor2 === "string") {
        return lum(backgroundColor2, 1) < DARK_MODE_THRESHOLD;
      } else if (backgroundColor2.colorStops) {
        var colorStops = backgroundColor2.colorStops;
        var totalLum = 0;
        var len2 = colorStops.length;
        for (var i2 = 0; i2 < len2; i2++) {
          totalLum += lum(colorStops[i2].color, 1);
        }
        totalLum /= len2;
        return totalLum < DARK_MODE_THRESHOLD;
      }
      return false;
    }
    var ZRender = function() {
      function ZRender2(id, dom, opts) {
        var _this = this;
        this._sleepAfterStill = 10;
        this._stillFrameAccum = 0;
        this._needsRefresh = true;
        this._needsRefreshHover = true;
        this._darkMode = false;
        opts = opts || {};
        this.dom = dom;
        this.id = id;
        var storage2 = new Storage();
        var rendererType = opts.renderer || "canvas";
        if (!painterCtors[rendererType]) {
          rendererType = keys$1(painterCtors)[0];
        }
        opts.useDirtyRect = opts.useDirtyRect == null ? false : opts.useDirtyRect;
        var painter = new painterCtors[rendererType](dom, storage2, opts, id);
        var ssrMode = opts.ssr || painter.ssrOnly;
        this.storage = storage2;
        this.painter = painter;
        var handlerProxy = !env.node && !env.worker && !ssrMode ? new HandlerDomProxy(painter.getViewportRoot(), painter.root) : null;
        var useCoarsePointer = opts.useCoarsePointer;
        var usePointerSize = useCoarsePointer == null || useCoarsePointer === "auto" ? env.touchEventsSupported : !!useCoarsePointer;
        var defaultPointerSize = 44;
        var pointerSize;
        if (usePointerSize) {
          pointerSize = retrieve2(opts.pointerSize, defaultPointerSize);
        }
        this.handler = new Handler(storage2, painter, handlerProxy, painter.root, pointerSize);
        this.animation = new Animation({
          stage: {
            update: ssrMode ? null : function() {
              return _this._flush(true);
            }
          }
        });
        if (!ssrMode) {
          this.animation.start();
        }
      }
      ZRender2.prototype.add = function(el) {
        if (this._disposed || !el) {
          return;
        }
        this.storage.addRoot(el);
        el.addSelfToZr(this);
        this.refresh();
      };
      ZRender2.prototype.remove = function(el) {
        if (this._disposed || !el) {
          return;
        }
        this.storage.delRoot(el);
        el.removeSelfFromZr(this);
        this.refresh();
      };
      ZRender2.prototype.configLayer = function(zLevel, config) {
        if (this._disposed) {
          return;
        }
        if (this.painter.configLayer) {
          this.painter.configLayer(zLevel, config);
        }
        this.refresh();
      };
      ZRender2.prototype.setBackgroundColor = function(backgroundColor2) {
        if (this._disposed) {
          return;
        }
        if (this.painter.setBackgroundColor) {
          this.painter.setBackgroundColor(backgroundColor2);
        }
        this.refresh();
        this._backgroundColor = backgroundColor2;
        this._darkMode = isDarkMode(backgroundColor2);
      };
      ZRender2.prototype.getBackgroundColor = function() {
        return this._backgroundColor;
      };
      ZRender2.prototype.setDarkMode = function(darkMode) {
        this._darkMode = darkMode;
      };
      ZRender2.prototype.isDarkMode = function() {
        return this._darkMode;
      };
      ZRender2.prototype.refreshImmediately = function(fromInside) {
        if (this._disposed) {
          return;
        }
        if (!fromInside) {
          this.animation.update(true);
        }
        this._needsRefresh = false;
        this.painter.refresh();
        this._needsRefresh = false;
      };
      ZRender2.prototype.refresh = function() {
        if (this._disposed) {
          return;
        }
        this._needsRefresh = true;
        this.animation.start();
      };
      ZRender2.prototype.flush = function() {
        if (this._disposed) {
          return;
        }
        this._flush(false);
      };
      ZRender2.prototype._flush = function(fromInside) {
        var triggerRendered;
        var start2 = getTime();
        if (this._needsRefresh) {
          triggerRendered = true;
          this.refreshImmediately(fromInside);
        }
        if (this._needsRefreshHover) {
          triggerRendered = true;
          this.refreshHoverImmediately();
        }
        var end2 = getTime();
        if (triggerRendered) {
          this._stillFrameAccum = 0;
          this.trigger("rendered", {
            elapsedTime: end2 - start2
          });
        } else if (this._sleepAfterStill > 0) {
          this._stillFrameAccum++;
          if (this._stillFrameAccum > this._sleepAfterStill) {
            this.animation.stop();
          }
        }
      };
      ZRender2.prototype.setSleepAfterStill = function(stillFramesCount) {
        this._sleepAfterStill = stillFramesCount;
      };
      ZRender2.prototype.wakeUp = function() {
        if (this._disposed) {
          return;
        }
        this.animation.start();
        this._stillFrameAccum = 0;
      };
      ZRender2.prototype.refreshHover = function() {
        this._needsRefreshHover = true;
      };
      ZRender2.prototype.refreshHoverImmediately = function() {
        if (this._disposed) {
          return;
        }
        this._needsRefreshHover = false;
        if (this.painter.refreshHover && this.painter.getType() === "canvas") {
          this.painter.refreshHover();
        }
      };
      ZRender2.prototype.resize = function(opts) {
        if (this._disposed) {
          return;
        }
        opts = opts || {};
        this.painter.resize(opts.width, opts.height);
        this.handler.resize();
      };
      ZRender2.prototype.clearAnimation = function() {
        if (this._disposed) {
          return;
        }
        this.animation.clear();
      };
      ZRender2.prototype.getWidth = function() {
        if (this._disposed) {
          return;
        }
        return this.painter.getWidth();
      };
      ZRender2.prototype.getHeight = function() {
        if (this._disposed) {
          return;
        }
        return this.painter.getHeight();
      };
      ZRender2.prototype.setCursorStyle = function(cursorStyle) {
        if (this._disposed) {
          return;
        }
        this.handler.setCursorStyle(cursorStyle);
      };
      ZRender2.prototype.findHover = function(x2, y) {
        if (this._disposed) {
          return;
        }
        return this.handler.findHover(x2, y);
      };
      ZRender2.prototype.on = function(eventName, eventHandler, context) {
        if (!this._disposed) {
          this.handler.on(eventName, eventHandler, context);
        }
        return this;
      };
      ZRender2.prototype.off = function(eventName, eventHandler) {
        if (this._disposed) {
          return;
        }
        this.handler.off(eventName, eventHandler);
      };
      ZRender2.prototype.trigger = function(eventName, event) {
        if (this._disposed) {
          return;
        }
        this.handler.trigger(eventName, event);
      };
      ZRender2.prototype.clear = function() {
        if (this._disposed) {
          return;
        }
        var roots2 = this.storage.getRoots();
        for (var i2 = 0; i2 < roots2.length; i2++) {
          if (roots2[i2] instanceof Group$3) {
            roots2[i2].removeSelfFromZr(this);
          }
        }
        this.storage.delAllRoots();
        this.painter.clear();
      };
      ZRender2.prototype.dispose = function() {
        if (this._disposed) {
          return;
        }
        this.animation.stop();
        this.clear();
        this.storage.dispose();
        this.painter.dispose();
        this.handler.dispose();
        this.animation = this.storage = this.painter = this.handler = null;
        this._disposed = true;
        delInstance(this.id);
      };
      return ZRender2;
    }();
    function init$2(dom, opts) {
      var zr = new ZRender(guid(), dom, opts);
      instances$1[zr.id] = zr;
      return zr;
    }
    function registerPainter(name, Ctor) {
      painterCtors[name] = Ctor;
    }
    var ssrDataGetter;
    function getElementSSRData(el) {
      if (typeof ssrDataGetter === "function") {
        return ssrDataGetter(el);
      }
    }
    function registerSSRDataGetter(getter) {
      ssrDataGetter = getter;
    }
    var RADIAN_EPSILON = 1e-4;
    var ROUND_SUPPORTED_PRECISION_MAX = 20;
    function _trim(str) {
      return str.replace(/^\s+|\s+$/g, "");
    }
    function linearMap$2(val, domain, range2, clamp2) {
      var d0 = domain[0];
      var d1 = domain[1];
      var r0 = range2[0];
      var r1 = range2[1];
      var subDomain = d1 - d0;
      var subRange = r1 - r0;
      if (subDomain === 0) {
        return subRange === 0 ? r0 : (r0 + r1) / 2;
      }
      if (clamp2) {
        if (subDomain > 0) {
          if (val <= d0) {
            return r0;
          } else if (val >= d1) {
            return r1;
          }
        } else {
          if (val >= d0) {
            return r0;
          } else if (val <= d1) {
            return r1;
          }
        }
      } else {
        if (val === d0) {
          return r0;
        }
        if (val === d1) {
          return r1;
        }
      }
      return (val - d0) / subDomain * subRange + r0;
    }
    function parsePercent(percent, all2) {
      switch (percent) {
        case "center":
        case "middle":
          percent = "50%";
          break;
        case "left":
        case "top":
          percent = "0%";
          break;
        case "right":
        case "bottom":
          percent = "100%";
          break;
      }
      if (isString$1(percent)) {
        if (_trim(percent).match(/%$/)) {
          return parseFloat(percent) / 100 * all2;
        }
        return parseFloat(percent);
      }
      return percent == null ? NaN : +percent;
    }
    function round$3(x2, precision, returnStr) {
      if (precision == null) {
        precision = 10;
      }
      precision = Math.min(Math.max(0, precision), ROUND_SUPPORTED_PRECISION_MAX);
      x2 = (+x2).toFixed(precision);
      return returnStr ? x2 : +x2;
    }
    function asc$2(arr) {
      arr.sort(function(a2, b2) {
        return a2 - b2;
      });
      return arr;
    }
    function getPrecision(val) {
      val = +val;
      if (isNaN(val)) {
        return 0;
      }
      if (val > 1e-14) {
        var e2 = 1;
        for (var i2 = 0; i2 < 15; i2++, e2 *= 10) {
          if (Math.round(val * e2) / e2 === val) {
            return i2;
          }
        }
      }
      return getPrecisionSafe(val);
    }
    function getPrecisionSafe(val) {
      var str = val.toString().toLowerCase();
      var eIndex = str.indexOf("e");
      var exp = eIndex > 0 ? +str.slice(eIndex + 1) : 0;
      var significandPartLen = eIndex > 0 ? eIndex : str.length;
      var dotIndex = str.indexOf(".");
      var decimalPartLen = dotIndex < 0 ? 0 : significandPartLen - 1 - dotIndex;
      return Math.max(0, decimalPartLen - exp);
    }
    function getPixelPrecision(dataExtent, pixelExtent) {
      var log = Math.log;
      var LN10 = Math.LN10;
      var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);
      var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);
      var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20);
      return !isFinite(precision) ? 20 : precision;
    }
    function getPercentSeats(valueList, precision) {
      var sum2 = reduce(valueList, function(acc, val) {
        return acc + (isNaN(val) ? 0 : val);
      }, 0);
      if (sum2 === 0) {
        return [];
      }
      var digits = Math.pow(10, precision);
      var votesPerQuota = map$1(valueList, function(val) {
        return (isNaN(val) ? 0 : val) / sum2 * digits * 100;
      });
      var targetSeats = digits * 100;
      var seats = map$1(votesPerQuota, function(votes) {
        return Math.floor(votes);
      });
      var currentSum = reduce(seats, function(acc, val) {
        return acc + val;
      }, 0);
      var remainder = map$1(votesPerQuota, function(votes, idx) {
        return votes - seats[idx];
      });
      while (currentSum < targetSeats) {
        var max3 = Number.NEGATIVE_INFINITY;
        var maxId = null;
        for (var i2 = 0, len2 = remainder.length; i2 < len2; ++i2) {
          if (remainder[i2] > max3) {
            max3 = remainder[i2];
            maxId = i2;
          }
        }
        ++seats[maxId];
        remainder[maxId] = 0;
        ++currentSum;
      }
      return map$1(seats, function(seat) {
        return seat / digits;
      });
    }
    function addSafe(val0, val1) {
      var maxPrecision = Math.max(getPrecision(val0), getPrecision(val1));
      var sum2 = val0 + val1;
      return maxPrecision > ROUND_SUPPORTED_PRECISION_MAX ? sum2 : round$3(sum2, maxPrecision);
    }
    var MAX_SAFE_INTEGER = 9007199254740991;
    function remRadian(radian) {
      var pi2 = Math.PI * 2;
      return (radian % pi2 + pi2) % pi2;
    }
    function isRadianAroundZero(val) {
      return val > -1e-4 && val < RADIAN_EPSILON;
    }
    var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;
    function parseDate$1(value) {
      if (value instanceof Date) {
        return value;
      } else if (isString$1(value)) {
        var match = TIME_REG.exec(value);
        if (!match) {
          return /* @__PURE__ */ new Date(NaN);
        }
        if (!match[8]) {
          return new Date(+match[1], +(match[2] || 1) - 1, +match[3] || 1, +match[4] || 0, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0);
        } else {
          var hour = +match[4] || 0;
          if (match[8].toUpperCase() !== "Z") {
            hour -= +match[8].slice(0, 3);
          }
          return new Date(Date.UTC(+match[1], +(match[2] || 1) - 1, +match[3] || 1, hour, +(match[5] || 0), +match[6] || 0, match[7] ? +match[7].substring(0, 3) : 0));
        }
      } else if (value == null) {
        return /* @__PURE__ */ new Date(NaN);
      }
      return new Date(Math.round(value));
    }
    function quantity(val) {
      return Math.pow(10, quantityExponent(val));
    }
    function quantityExponent(val) {
      if (val === 0) {
        return 0;
      }
      var exp = Math.floor(Math.log(val) / Math.LN10);
      if (val / Math.pow(10, exp) >= 10) {
        exp++;
      }
      return exp;
    }
    function nice(val, round2) {
      var exponent = quantityExponent(val);
      var exp10 = Math.pow(10, exponent);
      var f2 = val / exp10;
      var nf;
      {
        if (f2 < 1.5) {
          nf = 1;
        } else if (f2 < 2.5) {
          nf = 2;
        } else if (f2 < 4) {
          nf = 3;
        } else if (f2 < 7) {
          nf = 5;
        } else {
          nf = 10;
        }
      }
      val = nf * exp10;
      return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val;
    }
    function quantile(ascArr, p2) {
      var H4 = (ascArr.length - 1) * p2 + 1;
      var h2 = Math.floor(H4);
      var v4 = +ascArr[h2 - 1];
      var e2 = H4 - h2;
      return e2 ? v4 + e2 * (ascArr[h2] - v4) : v4;
    }
    function reformIntervals(list) {
      list.sort(function(a2, b2) {
        return littleThan2(a2, b2, 0) ? -1 : 1;
      });
      var curr = -Infinity;
      var currClose = 1;
      for (var i2 = 0; i2 < list.length; ) {
        var interval = list[i2].interval;
        var close_1 = list[i2].close;
        for (var lg = 0; lg < 2; lg++) {
          if (interval[lg] <= curr) {
            interval[lg] = curr;
            close_1[lg] = !lg ? 1 - currClose : 1;
          }
          curr = interval[lg];
          currClose = close_1[lg];
        }
        if (interval[0] === interval[1] && close_1[0] * close_1[1] !== 1) {
          list.splice(i2, 1);
        } else {
          i2++;
        }
      }
      return list;
      function littleThan2(a2, b2, lg2) {
        return a2.interval[lg2] < b2.interval[lg2] || a2.interval[lg2] === b2.interval[lg2] && (a2.close[lg2] - b2.close[lg2] === (!lg2 ? 1 : -1) || !lg2 && littleThan2(a2, b2, 1));
      }
    }
    function numericToNumber(val) {
      var valFloat = parseFloat(val);
      return valFloat == val && (valFloat !== 0 || !isString$1(val) || val.indexOf("x") <= 0) ? valFloat : NaN;
    }
    function isNumeric(val) {
      return !isNaN(numericToNumber(val));
    }
    function getRandomIdBase() {
      return Math.round(Math.random() * 9);
    }
    function getGreatestCommonDividor(a2, b2) {
      if (b2 === 0) {
        return a2;
      }
      return getGreatestCommonDividor(b2, a2 % b2);
    }
    function getLeastCommonMultiple(a2, b2) {
      if (a2 == null) {
        return b2;
      }
      if (b2 == null) {
        return a2;
      }
      return a2 * b2 / getGreatestCommonDividor(a2, b2);
    }
    function throwError(msg) {
      throw new Error(msg);
    }
    function interpolateNumber(p0, p1, percent) {
      return (p1 - p0) * percent + p0;
    }
    var DUMMY_COMPONENT_NAME_PREFIX = "series\0";
    var INTERNAL_COMPONENT_ID_PREFIX = "\0_ec_\0";
    function normalizeToArray(value) {
      return value instanceof Array ? value : value == null ? [] : [value];
    }
    function defaultEmphasis(opt, key, subOpts) {
      if (opt) {
        opt[key] = opt[key] || {};
        opt.emphasis = opt.emphasis || {};
        opt.emphasis[key] = opt.emphasis[key] || {};
        for (var i2 = 0, len2 = subOpts.length; i2 < len2; i2++) {
          var subOptName = subOpts[i2];
          if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {
            opt.emphasis[key][subOptName] = opt[key][subOptName];
          }
        }
      }
    }
    var TEXT_STYLE_OPTIONS = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];
    function getDataItemValue(dataItem) {
      return isObject$5(dataItem) && !isArray$2(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;
    }
    function isDataItemOption(dataItem) {
      return isObject$5(dataItem) && !(dataItem instanceof Array);
    }
    function mappingToExists(existings, newCmptOptions, mode) {
      var isNormalMergeMode = mode === "normalMerge";
      var isReplaceMergeMode = mode === "replaceMerge";
      var isReplaceAllMode = mode === "replaceAll";
      existings = existings || [];
      newCmptOptions = (newCmptOptions || []).slice();
      var existingIdIdxMap = createHashMap();
      each$f(newCmptOptions, function(cmptOption, index) {
        if (!isObject$5(cmptOption)) {
          newCmptOptions[index] = null;
          return;
        }
      });
      var result = prepareResult(existings, existingIdIdxMap, mode);
      if (isNormalMergeMode || isReplaceMergeMode) {
        mappingById(result, existings, existingIdIdxMap, newCmptOptions);
      }
      if (isNormalMergeMode) {
        mappingByName(result, newCmptOptions);
      }
      if (isNormalMergeMode || isReplaceMergeMode) {
        mappingByIndex(result, newCmptOptions, isReplaceMergeMode);
      } else if (isReplaceAllMode) {
        mappingInReplaceAllMode(result, newCmptOptions);
      }
      makeIdAndName(result);
      return result;
    }
    function prepareResult(existings, existingIdIdxMap, mode) {
      var result = [];
      if (mode === "replaceAll") {
        return result;
      }
      for (var index = 0; index < existings.length; index++) {
        var existing = existings[index];
        if (existing && existing.id != null) {
          existingIdIdxMap.set(existing.id, index);
        }
        result.push({
          existing: mode === "replaceMerge" || isComponentIdInternal(existing) ? null : existing,
          newOption: null,
          keyInfo: null,
          brandNew: null
        });
      }
      return result;
    }
    function mappingById(result, existings, existingIdIdxMap, newCmptOptions) {
      each$f(newCmptOptions, function(cmptOption, index) {
        if (!cmptOption || cmptOption.id == null) {
          return;
        }
        var optionId = makeComparableKey(cmptOption.id);
        var existingIdx = existingIdIdxMap.get(optionId);
        if (existingIdx != null) {
          var resultItem = result[existingIdx];
          assert(!resultItem.newOption, 'Duplicated option on id "' + optionId + '".');
          resultItem.newOption = cmptOption;
          resultItem.existing = existings[existingIdx];
          newCmptOptions[index] = null;
        }
      });
    }
    function mappingByName(result, newCmptOptions) {
      each$f(newCmptOptions, function(cmptOption, index) {
        if (!cmptOption || cmptOption.name == null) {
          return;
        }
        for (var i2 = 0; i2 < result.length; i2++) {
          var existing = result[i2].existing;
          if (!result[i2].newOption && existing && (existing.id == null || cmptOption.id == null) && !isComponentIdInternal(cmptOption) && !isComponentIdInternal(existing) && keyExistAndEqual("name", existing, cmptOption)) {
            result[i2].newOption = cmptOption;
            newCmptOptions[index] = null;
            return;
          }
        }
      });
    }
    function mappingByIndex(result, newCmptOptions, brandNew) {
      each$f(newCmptOptions, function(cmptOption) {
        if (!cmptOption) {
          return;
        }
        var resultItem;
        var nextIdx = 0;
        while (
          // Be `!resultItem` only when `nextIdx >= result.length`.
          (resultItem = result[nextIdx]) && (resultItem.newOption || isComponentIdInternal(resultItem.existing) || // In mode "replaceMerge", here no not-mapped-non-internal-existing.
          resultItem.existing && cmptOption.id != null && !keyExistAndEqual("id", cmptOption, resultItem.existing))
        ) {
          nextIdx++;
        }
        if (resultItem) {
          resultItem.newOption = cmptOption;
          resultItem.brandNew = brandNew;
        } else {
          result.push({
            newOption: cmptOption,
            brandNew,
            existing: null,
            keyInfo: null
          });
        }
        nextIdx++;
      });
    }
    function mappingInReplaceAllMode(result, newCmptOptions) {
      each$f(newCmptOptions, function(cmptOption) {
        result.push({
          newOption: cmptOption,
          brandNew: true,
          existing: null,
          keyInfo: null
        });
      });
    }
    function makeIdAndName(mapResult) {
      var idMap = createHashMap();
      each$f(mapResult, function(item) {
        var existing = item.existing;
        existing && idMap.set(existing.id, item);
      });
      each$f(mapResult, function(item) {
        var opt = item.newOption;
        assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, "id duplicates: " + (opt && opt.id));
        opt && opt.id != null && idMap.set(opt.id, item);
        !item.keyInfo && (item.keyInfo = {});
      });
      each$f(mapResult, function(item, index) {
        var existing = item.existing;
        var opt = item.newOption;
        var keyInfo = item.keyInfo;
        if (!isObject$5(opt)) {
          return;
        }
        keyInfo.name = opt.name != null ? makeComparableKey(opt.name) : existing ? existing.name : DUMMY_COMPONENT_NAME_PREFIX + index;
        if (existing) {
          keyInfo.id = makeComparableKey(existing.id);
        } else if (opt.id != null) {
          keyInfo.id = makeComparableKey(opt.id);
        } else {
          var idNum = 0;
          do {
            keyInfo.id = "\0" + keyInfo.name + "\0" + idNum++;
          } while (idMap.get(keyInfo.id));
        }
        idMap.set(keyInfo.id, item);
      });
    }
    function keyExistAndEqual(attr, obj1, obj2) {
      var key1 = convertOptionIdName(obj1[attr], null);
      var key2 = convertOptionIdName(obj2[attr], null);
      return key1 != null && key2 != null && key1 === key2;
    }
    function makeComparableKey(val) {
      return convertOptionIdName(val, "");
    }
    function convertOptionIdName(idOrName, defaultValue) {
      if (idOrName == null) {
        return defaultValue;
      }
      return isString$1(idOrName) ? idOrName : isNumber$1(idOrName) || isStringSafe(idOrName) ? idOrName + "" : defaultValue;
    }
    function isNameSpecified(componentModel) {
      var name = componentModel.name;
      return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));
    }
    function isComponentIdInternal(cmptOption) {
      return cmptOption && cmptOption.id != null && makeComparableKey(cmptOption.id).indexOf(INTERNAL_COMPONENT_ID_PREFIX) === 0;
    }
    function makeInternalComponentId(idSuffix) {
      return INTERNAL_COMPONENT_ID_PREFIX + idSuffix;
    }
    function setComponentTypeToKeyInfo(mappingResult, mainType, componentModelCtor) {
      each$f(mappingResult, function(item) {
        var newOption = item.newOption;
        if (isObject$5(newOption)) {
          item.keyInfo.mainType = mainType;
          item.keyInfo.subType = determineSubType(mainType, newOption, item.existing, componentModelCtor);
        }
      });
    }
    function determineSubType(mainType, newCmptOption, existComponent, componentModelCtor) {
      var subType = newCmptOption.type ? newCmptOption.type : existComponent ? existComponent.subType : componentModelCtor.determineSubType(mainType, newCmptOption);
      return subType;
    }
    function compressBatches(batchA, batchB) {
      var mapA = {};
      var mapB = {};
      makeMap2(batchA || [], mapA);
      makeMap2(batchB || [], mapB, mapA);
      return [mapToArray2(mapA), mapToArray2(mapB)];
      function makeMap2(sourceBatch, map2, otherMap) {
        for (var i2 = 0, len2 = sourceBatch.length; i2 < len2; i2++) {
          var seriesId = convertOptionIdName(sourceBatch[i2].seriesId, null);
          if (seriesId == null) {
            return;
          }
          var dataIndices = normalizeToArray(sourceBatch[i2].dataIndex);
          var otherDataIndices = otherMap && otherMap[seriesId];
          for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {
            var dataIndex = dataIndices[j];
            if (otherDataIndices && otherDataIndices[dataIndex]) {
              otherDataIndices[dataIndex] = null;
            } else {
              (map2[seriesId] || (map2[seriesId] = {}))[dataIndex] = 1;
            }
          }
        }
      }
      function mapToArray2(map2, isData) {
        var result = [];
        for (var i2 in map2) {
          if (map2.hasOwnProperty(i2) && map2[i2] != null) {
            if (isData) {
              result.push(+i2);
            } else {
              var dataIndices = mapToArray2(map2[i2], true);
              dataIndices.length && result.push({
                seriesId: i2,
                dataIndex: dataIndices
              });
            }
          }
        }
        return result;
      }
    }
    function queryDataIndex(data, payload) {
      if (payload.dataIndexInside != null) {
        return payload.dataIndexInside;
      } else if (payload.dataIndex != null) {
        return isArray$2(payload.dataIndex) ? map$1(payload.dataIndex, function(value) {
          return data.indexOfRawIndex(value);
        }) : data.indexOfRawIndex(payload.dataIndex);
      } else if (payload.name != null) {
        return isArray$2(payload.name) ? map$1(payload.name, function(value) {
          return data.indexOfName(value);
        }) : data.indexOfName(payload.name);
      }
    }
    function makeInner() {
      var key = "__ec_inner_" + innerUniqueIndex++;
      return function(hostObj) {
        return hostObj[key] || (hostObj[key] = {});
      };
    }
    var innerUniqueIndex = getRandomIdBase();
    function parseFinder$1(ecModel, finderInput, opt) {
      var _a2 = preParseFinder(finderInput, opt), mainTypeSpecified = _a2.mainTypeSpecified, queryOptionMap = _a2.queryOptionMap, others = _a2.others;
      var result = others;
      var defaultMainType = opt ? opt.defaultMainType : null;
      if (!mainTypeSpecified && defaultMainType) {
        queryOptionMap.set(defaultMainType, {});
      }
      queryOptionMap.each(function(queryOption, mainType) {
        var queryResult = queryReferringComponents(ecModel, mainType, queryOption, {
          useDefault: defaultMainType === mainType,
          enableAll: opt && opt.enableAll != null ? opt.enableAll : true,
          enableNone: opt && opt.enableNone != null ? opt.enableNone : true
        });
        result[mainType + "Models"] = queryResult.models;
        result[mainType + "Model"] = queryResult.models[0];
      });
      return result;
    }
    function preParseFinder(finderInput, opt) {
      var finder;
      if (isString$1(finderInput)) {
        var obj = {};
        obj[finderInput + "Index"] = 0;
        finder = obj;
      } else {
        finder = finderInput;
      }
      var queryOptionMap = createHashMap();
      var others = {};
      var mainTypeSpecified = false;
      each$f(finder, function(value, key) {
        if (key === "dataIndex" || key === "dataIndexInside") {
          others[key] = value;
          return;
        }
        var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || [];
        var mainType = parsedKey[1];
        var queryType = (parsedKey[2] || "").toLowerCase();
        if (!mainType || !queryType || opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) {
          return;
        }
        mainTypeSpecified = mainTypeSpecified || !!mainType;
        var queryOption = queryOptionMap.get(mainType) || queryOptionMap.set(mainType, {});
        queryOption[queryType] = value;
      });
      return {
        mainTypeSpecified,
        queryOptionMap,
        others
      };
    }
    var SINGLE_REFERRING = {
      useDefault: true,
      enableAll: false,
      enableNone: false
    };
    var MULTIPLE_REFERRING = {
      useDefault: false,
      enableAll: true,
      enableNone: true
    };
    function queryReferringComponents(ecModel, mainType, userOption, opt) {
      opt = opt || SINGLE_REFERRING;
      var indexOption = userOption.index;
      var idOption = userOption.id;
      var nameOption = userOption.name;
      var result = {
        models: null,
        specified: indexOption != null || idOption != null || nameOption != null
      };
      if (!result.specified) {
        var firstCmpt = void 0;
        result.models = opt.useDefault && (firstCmpt = ecModel.getComponent(mainType)) ? [firstCmpt] : [];
        return result;
      }
      if (indexOption === "none" || indexOption === false) {
        assert(opt.enableNone, '`"none"` or `false` is not a valid value on index option.');
        result.models = [];
        return result;
      }
      if (indexOption === "all") {
        assert(opt.enableAll, '`"all"` is not a valid value on index option.');
        indexOption = idOption = nameOption = null;
      }
      result.models = ecModel.queryComponents({
        mainType,
        index: indexOption,
        id: idOption,
        name: nameOption
      });
      return result;
    }
    function setAttribute(dom, key, value) {
      dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;
    }
    function getAttribute(dom, key) {
      return dom.getAttribute ? dom.getAttribute(key) : dom[key];
    }
    function getTooltipRenderMode(renderModeOption) {
      if (renderModeOption === "auto") {
        return env.domSupported ? "html" : "richText";
      } else {
        return renderModeOption || "html";
      }
    }
    function groupData(array, getKey2) {
      var buckets = createHashMap();
      var keys2 = [];
      each$f(array, function(item) {
        var key = getKey2(item);
        (buckets.get(key) || (keys2.push(key), buckets.set(key, []))).push(item);
      });
      return {
        keys: keys2,
        buckets
      };
    }
    function interpolateRawValues(data, precision, sourceValue, targetValue, percent) {
      var isAutoPrecision = precision == null || precision === "auto";
      if (targetValue == null) {
        return targetValue;
      }
      if (isNumber$1(targetValue)) {
        var value = interpolateNumber(sourceValue || 0, targetValue, percent);
        return round$3(value, isAutoPrecision ? Math.max(getPrecision(sourceValue || 0), getPrecision(targetValue)) : precision);
      } else if (isString$1(targetValue)) {
        return percent < 1 ? sourceValue : targetValue;
      } else {
        var interpolated = [];
        var leftArr = sourceValue;
        var rightArr = targetValue;
        var length_1 = Math.max(leftArr ? leftArr.length : 0, rightArr.length);
        for (var i2 = 0; i2 < length_1; ++i2) {
          var info = data.getDimensionInfo(i2);
          if (info && info.type === "ordinal") {
            interpolated[i2] = (percent < 1 && leftArr ? leftArr : rightArr)[i2];
          } else {
            var leftVal = leftArr && leftArr[i2] ? leftArr[i2] : 0;
            var rightVal = rightArr[i2];
            var value = interpolateNumber(leftVal, rightVal, percent);
            interpolated[i2] = round$3(value, isAutoPrecision ? Math.max(getPrecision(leftVal), getPrecision(rightVal)) : precision);
          }
        }
        return interpolated;
      }
    }
    var TYPE_DELIMITER = ".";
    var IS_CONTAINER = "___EC__COMPONENT__CONTAINER___";
    var IS_EXTENDED_CLASS = "___EC__EXTENDED_CLASS___";
    function parseClassType(componentType) {
      var ret = {
        main: "",
        sub: ""
      };
      if (componentType) {
        var typeArr = componentType.split(TYPE_DELIMITER);
        ret.main = typeArr[0] || "";
        ret.sub = typeArr[1] || "";
      }
      return ret;
    }
    function checkClassType(componentType) {
      assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType "' + componentType + '" illegal');
    }
    function isExtendedClass(clz) {
      return !!(clz && clz[IS_EXTENDED_CLASS]);
    }
    function enableClassExtend(rootClz, mandatoryMethods) {
      rootClz.$constructor = rootClz;
      rootClz.extend = function(proto2) {
        var superClass = this;
        var ExtendedClass;
        if (isESClass(superClass)) {
          ExtendedClass = /** @class */
          function(_super) {
            __extends$1(class_1, _super);
            function class_1() {
              return _super.apply(this, arguments) || this;
            }
            return class_1;
          }(superClass);
        } else {
          ExtendedClass = function() {
            (proto2.$constructor || superClass).apply(this, arguments);
          };
          inherits$1(ExtendedClass, this);
        }
        extend$1(ExtendedClass.prototype, proto2);
        ExtendedClass[IS_EXTENDED_CLASS] = true;
        ExtendedClass.extend = this.extend;
        ExtendedClass.superCall = superCall;
        ExtendedClass.superApply = superApply;
        ExtendedClass.superClass = superClass;
        return ExtendedClass;
      };
    }
    function isESClass(fn2) {
      return isFunction$1(fn2) && /^class\s/.test(Function.prototype.toString.call(fn2));
    }
    function mountExtend(SubClz, SupperClz) {
      SubClz.extend = SupperClz.extend;
    }
    var classBase = Math.round(Math.random() * 10);
    function enableClassCheck(target) {
      var classAttr = ["__\0is_clz", classBase++].join("_");
      target.prototype[classAttr] = true;
      target.isInstance = function(obj) {
        return !!(obj && obj[classAttr]);
      };
    }
    function superCall(context, methodName) {
      var args = [];
      for (var _i = 2; _i < arguments.length; _i++) {
        args[_i - 2] = arguments[_i];
      }
      return this.superClass.prototype[methodName].apply(context, args);
    }
    function superApply(context, methodName, args) {
      return this.superClass.prototype[methodName].apply(context, args);
    }
    function enableClassManagement(target) {
      var storage2 = {};
      target.registerClass = function(clz) {
        var componentFullType = clz.type || clz.prototype.type;
        if (componentFullType) {
          checkClassType(componentFullType);
          clz.prototype.type = componentFullType;
          var componentTypeInfo = parseClassType(componentFullType);
          if (!componentTypeInfo.sub) {
            storage2[componentTypeInfo.main] = clz;
          } else if (componentTypeInfo.sub !== IS_CONTAINER) {
            var container = makeContainer(componentTypeInfo);
            container[componentTypeInfo.sub] = clz;
          }
        }
        return clz;
      };
      target.getClass = function(mainType, subType, throwWhenNotFound) {
        var clz = storage2[mainType];
        if (clz && clz[IS_CONTAINER]) {
          clz = subType ? clz[subType] : null;
        }
        if (throwWhenNotFound && !clz) {
          throw new Error(!subType ? mainType + ".type should be specified." : "Component " + mainType + "." + (subType || "") + " is used but not imported.");
        }
        return clz;
      };
      target.getClassesByMainType = function(componentType) {
        var componentTypeInfo = parseClassType(componentType);
        var result = [];
        var obj = storage2[componentTypeInfo.main];
        if (obj && obj[IS_CONTAINER]) {
          each$f(obj, function(o2, type) {
            type !== IS_CONTAINER && result.push(o2);
          });
        } else {
          result.push(obj);
        }
        return result;
      };
      target.hasClass = function(componentType) {
        var componentTypeInfo = parseClassType(componentType);
        return !!storage2[componentTypeInfo.main];
      };
      target.getAllClassMainTypes = function() {
        var types2 = [];
        each$f(storage2, function(obj, type) {
          types2.push(type);
        });
        return types2;
      };
      target.hasSubTypes = function(componentType) {
        var componentTypeInfo = parseClassType(componentType);
        var obj = storage2[componentTypeInfo.main];
        return obj && obj[IS_CONTAINER];
      };
      function makeContainer(componentTypeInfo) {
        var container = storage2[componentTypeInfo.main];
        if (!container || !container[IS_CONTAINER]) {
          container = storage2[componentTypeInfo.main] = {};
          container[IS_CONTAINER] = true;
        }
        return container;
      }
    }
    function makeStyleMapper(properties, ignoreParent) {
      for (var i2 = 0; i2 < properties.length; i2++) {
        if (!properties[i2][1]) {
          properties[i2][1] = properties[i2][0];
        }
      }
      ignoreParent = ignoreParent || false;
      return function(model, excludes, includes) {
        var style = {};
        for (var i3 = 0; i3 < properties.length; i3++) {
          var propName = properties[i3][1];
          if (excludes && indexOf(excludes, propName) >= 0 || includes && indexOf(includes, propName) < 0) {
            continue;
          }
          var val = model.getShallow(propName, ignoreParent);
          if (val != null) {
            style[properties[i3][0]] = val;
          }
        }
        return style;
      };
    }
    var AREA_STYLE_KEY_MAP = [
      ["fill", "color"],
      ["shadowBlur"],
      ["shadowOffsetX"],
      ["shadowOffsetY"],
      ["opacity"],
      ["shadowColor"]
      // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
      // So do not transfer decal directly.
    ];
    var getAreaStyle = makeStyleMapper(AREA_STYLE_KEY_MAP);
    var AreaStyleMixin = (
      /** @class */
      function() {
        function AreaStyleMixin2() {
        }
        AreaStyleMixin2.prototype.getAreaStyle = function(excludes, includes) {
          return getAreaStyle(this, excludes, includes);
        };
        return AreaStyleMixin2;
      }()
    );
    var globalImageCache = new LRU(50);
    function findExistImage(newImageOrSrc) {
      if (typeof newImageOrSrc === "string") {
        var cachedImgObj = globalImageCache.get(newImageOrSrc);
        return cachedImgObj && cachedImgObj.image;
      } else {
        return newImageOrSrc;
      }
    }
    function createOrUpdateImage(newImageOrSrc, image2, hostEl, onload, cbPayload) {
      if (!newImageOrSrc) {
        return image2;
      } else if (typeof newImageOrSrc === "string") {
        if (image2 && image2.__zrImageSrc === newImageOrSrc || !hostEl) {
          return image2;
        }
        var cachedImgObj = globalImageCache.get(newImageOrSrc);
        var pendingWrap = { hostEl, cb: onload, cbPayload };
        if (cachedImgObj) {
          image2 = cachedImgObj.image;
          !isImageReady(image2) && cachedImgObj.pending.push(pendingWrap);
        } else {
          image2 = platformApi.loadImage(newImageOrSrc, imageOnLoad, imageOnLoad);
          image2.__zrImageSrc = newImageOrSrc;
          globalImageCache.put(newImageOrSrc, image2.__cachedImgObj = {
            image: image2,
            pending: [pendingWrap]
          });
        }
        return image2;
      } else {
        return newImageOrSrc;
      }
    }
    function imageOnLoad() {
      var cachedImgObj = this.__cachedImgObj;
      this.onload = this.onerror = this.__cachedImgObj = null;
      for (var i2 = 0; i2 < cachedImgObj.pending.length; i2++) {
        var pendingWrap = cachedImgObj.pending[i2];
        var cb = pendingWrap.cb;
        cb && cb(this, pendingWrap.cbPayload);
        pendingWrap.hostEl.dirty();
      }
      cachedImgObj.pending.length = 0;
    }
    function isImageReady(image2) {
      return image2 && image2.width && image2.height;
    }
    var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;
    function truncateText2(out2, text, containerWidth, font, ellipsis, options) {
      if (!containerWidth) {
        out2.text = "";
        out2.isTruncated = false;
        return;
      }
      var textLines = (text + "").split("\n");
      options = prepareTruncateOptions(containerWidth, font, ellipsis, options);
      var isTruncated = false;
      var truncateOut = {};
      for (var i2 = 0, len2 = textLines.length; i2 < len2; i2++) {
        truncateSingleLine(truncateOut, textLines[i2], options);
        textLines[i2] = truncateOut.textLine;
        isTruncated = isTruncated || truncateOut.isTruncated;
      }
      out2.text = textLines.join("\n");
      out2.isTruncated = isTruncated;
    }
    function prepareTruncateOptions(containerWidth, font, ellipsis, options) {
      options = options || {};
      var preparedOpts = extend$1({}, options);
      preparedOpts.font = font;
      ellipsis = retrieve2(ellipsis, "...");
      preparedOpts.maxIterations = retrieve2(options.maxIterations, 2);
      var minChar = preparedOpts.minChar = retrieve2(options.minChar, 0);
      preparedOpts.cnCharWidth = getWidth("国", font);
      var ascCharWidth = preparedOpts.ascCharWidth = getWidth("a", font);
      preparedOpts.placeholder = retrieve2(options.placeholder, "");
      var contentWidth = containerWidth = Math.max(0, containerWidth - 1);
      for (var i2 = 0; i2 < minChar && contentWidth >= ascCharWidth; i2++) {
        contentWidth -= ascCharWidth;
      }
      var ellipsisWidth = getWidth(ellipsis, font);
      if (ellipsisWidth > contentWidth) {
        ellipsis = "";
        ellipsisWidth = 0;
      }
      contentWidth = containerWidth - ellipsisWidth;
      preparedOpts.ellipsis = ellipsis;
      preparedOpts.ellipsisWidth = ellipsisWidth;
      preparedOpts.contentWidth = contentWidth;
      preparedOpts.containerWidth = containerWidth;
      return preparedOpts;
    }
    function truncateSingleLine(out2, textLine, options) {
      var containerWidth = options.containerWidth;
      var font = options.font;
      var contentWidth = options.contentWidth;
      if (!containerWidth) {
        out2.textLine = "";
        out2.isTruncated = false;
        return;
      }
      var lineWidth = getWidth(textLine, font);
      if (lineWidth <= containerWidth) {
        out2.textLine = textLine;
        out2.isTruncated = false;
        return;
      }
      for (var j = 0; ; j++) {
        if (lineWidth <= contentWidth || j >= options.maxIterations) {
          textLine += options.ellipsis;
          break;
        }
        var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0;
        textLine = textLine.substr(0, subLength);
        lineWidth = getWidth(textLine, font);
      }
      if (textLine === "") {
        textLine = options.placeholder;
      }
      out2.textLine = textLine;
      out2.isTruncated = true;
    }
    function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {
      var width = 0;
      var i2 = 0;
      for (var len2 = text.length; i2 < len2 && width < contentWidth; i2++) {
        var charCode = text.charCodeAt(i2);
        width += 0 <= charCode && charCode <= 127 ? ascCharWidth : cnCharWidth;
      }
      return i2;
    }
    function parsePlainText(text, style) {
      text != null && (text += "");
      var overflow2 = style.overflow;
      var padding = style.padding;
      var font = style.font;
      var truncate = overflow2 === "truncate";
      var calculatedLineHeight = getLineHeight(font);
      var lineHeight2 = retrieve2(style.lineHeight, calculatedLineHeight);
      var bgColorDrawn = !!style.backgroundColor;
      var truncateLineOverflow = style.lineOverflow === "truncate";
      var isTruncated = false;
      var width = style.width;
      var lines;
      if (width != null && (overflow2 === "break" || overflow2 === "breakAll")) {
        lines = text ? wrapText(text, style.font, width, overflow2 === "breakAll", 0).lines : [];
      } else {
        lines = text ? text.split("\n") : [];
      }
      var contentHeight = lines.length * lineHeight2;
      var height = retrieve2(style.height, contentHeight);
      if (contentHeight > height && truncateLineOverflow) {
        var lineCount = Math.floor(height / lineHeight2);
        isTruncated = isTruncated || lines.length > lineCount;
        lines = lines.slice(0, lineCount);
      }
      if (text && truncate && width != null) {
        var options = prepareTruncateOptions(width, font, style.ellipsis, {
          minChar: style.truncateMinChar,
          placeholder: style.placeholder
        });
        var singleOut = {};
        for (var i2 = 0; i2 < lines.length; i2++) {
          truncateSingleLine(singleOut, lines[i2], options);
          lines[i2] = singleOut.textLine;
          isTruncated = isTruncated || singleOut.isTruncated;
        }
      }
      var outerHeight = height;
      var contentWidth = 0;
      for (var i2 = 0; i2 < lines.length; i2++) {
        contentWidth = Math.max(getWidth(lines[i2], font), contentWidth);
      }
      if (width == null) {
        width = contentWidth;
      }
      var outerWidth = contentWidth;
      if (padding) {
        outerHeight += padding[0] + padding[2];
        outerWidth += padding[1] + padding[3];
        width += padding[1] + padding[3];
      }
      if (bgColorDrawn) {
        outerWidth = width;
      }
      return {
        lines,
        height,
        outerWidth,
        outerHeight,
        lineHeight: lineHeight2,
        calculatedLineHeight,
        contentWidth,
        contentHeight,
        width,
        isTruncated
      };
    }
    var RichTextToken = /* @__PURE__ */ function() {
      function RichTextToken2() {
      }
      return RichTextToken2;
    }();
    var RichTextLine = /* @__PURE__ */ function() {
      function RichTextLine2(tokens) {
        this.tokens = [];
        if (tokens) {
          this.tokens = tokens;
        }
      }
      return RichTextLine2;
    }();
    var RichTextContentBlock = /* @__PURE__ */ function() {
      function RichTextContentBlock2() {
        this.width = 0;
        this.height = 0;
        this.contentWidth = 0;
        this.contentHeight = 0;
        this.outerWidth = 0;
        this.outerHeight = 0;
        this.lines = [];
        this.isTruncated = false;
      }
      return RichTextContentBlock2;
    }();
    function parseRichText(text, style) {
      var contentBlock = new RichTextContentBlock();
      text != null && (text += "");
      if (!text) {
        return contentBlock;
      }
      var topWidth = style.width;
      var topHeight = style.height;
      var overflow2 = style.overflow;
      var wrapInfo = (overflow2 === "break" || overflow2 === "breakAll") && topWidth != null ? { width: topWidth, accumWidth: 0, breakAll: overflow2 === "breakAll" } : null;
      var lastIndex = STYLE_REG.lastIndex = 0;
      var result;
      while ((result = STYLE_REG.exec(text)) != null) {
        var matchedIndex = result.index;
        if (matchedIndex > lastIndex) {
          pushTokens(contentBlock, text.substring(lastIndex, matchedIndex), style, wrapInfo);
        }
        pushTokens(contentBlock, result[2], style, wrapInfo, result[1]);
        lastIndex = STYLE_REG.lastIndex;
      }
      if (lastIndex < text.length) {
        pushTokens(contentBlock, text.substring(lastIndex, text.length), style, wrapInfo);
      }
      var pendingList = [];
      var calculatedHeight = 0;
      var calculatedWidth = 0;
      var stlPadding = style.padding;
      var truncate = overflow2 === "truncate";
      var truncateLine = style.lineOverflow === "truncate";
      var tmpTruncateOut = {};
      function finishLine(line2, lineWidth2, lineHeight3) {
        line2.width = lineWidth2;
        line2.lineHeight = lineHeight3;
        calculatedHeight += lineHeight3;
        calculatedWidth = Math.max(calculatedWidth, lineWidth2);
      }
      outer: for (var i2 = 0; i2 < contentBlock.lines.length; i2++) {
        var line = contentBlock.lines[i2];
        var lineHeight2 = 0;
        var lineWidth = 0;
        for (var j = 0; j < line.tokens.length; j++) {
          var token = line.tokens[j];
          var tokenStyle = token.styleName && style.rich[token.styleName] || {};
          var textPadding = token.textPadding = tokenStyle.padding;
          var paddingH = textPadding ? textPadding[1] + textPadding[3] : 0;
          var font = token.font = tokenStyle.font || style.font;
          token.contentHeight = getLineHeight(font);
          var tokenHeight = retrieve2(tokenStyle.height, token.contentHeight);
          token.innerHeight = tokenHeight;
          textPadding && (tokenHeight += textPadding[0] + textPadding[2]);
          token.height = tokenHeight;
          token.lineHeight = retrieve3(tokenStyle.lineHeight, style.lineHeight, tokenHeight);
          token.align = tokenStyle && tokenStyle.align || style.align;
          token.verticalAlign = tokenStyle && tokenStyle.verticalAlign || "middle";
          if (truncateLine && topHeight != null && calculatedHeight + token.lineHeight > topHeight) {
            var originalLength = contentBlock.lines.length;
            if (j > 0) {
              line.tokens = line.tokens.slice(0, j);
              finishLine(line, lineWidth, lineHeight2);
              contentBlock.lines = contentBlock.lines.slice(0, i2 + 1);
            } else {
              contentBlock.lines = contentBlock.lines.slice(0, i2);
            }
            contentBlock.isTruncated = contentBlock.isTruncated || contentBlock.lines.length < originalLength;
            break outer;
          }
          var styleTokenWidth = tokenStyle.width;
          var tokenWidthNotSpecified = styleTokenWidth == null || styleTokenWidth === "auto";
          if (typeof styleTokenWidth === "string" && styleTokenWidth.charAt(styleTokenWidth.length - 1) === "%") {
            token.percentWidth = styleTokenWidth;
            pendingList.push(token);
            token.contentWidth = getWidth(token.text, font);
          } else {
            if (tokenWidthNotSpecified) {
              var textBackgroundColor = tokenStyle.backgroundColor;
              var bgImg = textBackgroundColor && textBackgroundColor.image;
              if (bgImg) {
                bgImg = findExistImage(bgImg);
                if (isImageReady(bgImg)) {
                  token.width = Math.max(token.width, bgImg.width * tokenHeight / bgImg.height);
                }
              }
            }
            var remainTruncWidth = truncate && topWidth != null ? topWidth - lineWidth : null;
            if (remainTruncWidth != null && remainTruncWidth < token.width) {
              if (!tokenWidthNotSpecified || remainTruncWidth < paddingH) {
                token.text = "";
                token.width = token.contentWidth = 0;
              } else {
                truncateText2(tmpTruncateOut, token.text, remainTruncWidth - paddingH, font, style.ellipsis, { minChar: style.truncateMinChar });
                token.text = tmpTruncateOut.text;
                contentBlock.isTruncated = contentBlock.isTruncated || tmpTruncateOut.isTruncated;
                token.width = token.contentWidth = getWidth(token.text, font);
              }
            } else {
              token.contentWidth = getWidth(token.text, font);
            }
          }
          token.width += paddingH;
          lineWidth += token.width;
          tokenStyle && (lineHeight2 = Math.max(lineHeight2, token.lineHeight));
        }
        finishLine(line, lineWidth, lineHeight2);
      }
      contentBlock.outerWidth = contentBlock.width = retrieve2(topWidth, calculatedWidth);
      contentBlock.outerHeight = contentBlock.height = retrieve2(topHeight, calculatedHeight);
      contentBlock.contentHeight = calculatedHeight;
      contentBlock.contentWidth = calculatedWidth;
      if (stlPadding) {
        contentBlock.outerWidth += stlPadding[1] + stlPadding[3];
        contentBlock.outerHeight += stlPadding[0] + stlPadding[2];
      }
      for (var i2 = 0; i2 < pendingList.length; i2++) {
        var token = pendingList[i2];
        var percentWidth = token.percentWidth;
        token.width = parseInt(percentWidth, 10) / 100 * contentBlock.width;
      }
      return contentBlock;
    }
    function pushTokens(block, str, style, wrapInfo, styleName) {
      var isEmptyStr = str === "";
      var tokenStyle = styleName && style.rich[styleName] || {};
      var lines = block.lines;
      var font = tokenStyle.font || style.font;
      var newLine = false;
      var strLines;
      var linesWidths;
      if (wrapInfo) {
        var tokenPadding = tokenStyle.padding;
        var tokenPaddingH = tokenPadding ? tokenPadding[1] + tokenPadding[3] : 0;
        if (tokenStyle.width != null && tokenStyle.width !== "auto") {
          var outerWidth_1 = parsePercent$1(tokenStyle.width, wrapInfo.width) + tokenPaddingH;
          if (lines.length > 0) {
            if (outerWidth_1 + wrapInfo.accumWidth > wrapInfo.width) {
              strLines = str.split("\n");
              newLine = true;
            }
          }
          wrapInfo.accumWidth = outerWidth_1;
        } else {
          var res = wrapText(str, font, wrapInfo.width, wrapInfo.breakAll, wrapInfo.accumWidth);
          wrapInfo.accumWidth = res.accumWidth + tokenPaddingH;
          linesWidths = res.linesWidths;
          strLines = res.lines;
        }
      } else {
        strLines = str.split("\n");
      }
      for (var i2 = 0; i2 < strLines.length; i2++) {
        var text = strLines[i2];
        var token = new RichTextToken();
        token.styleName = styleName;
        token.text = text;
        token.isLineHolder = !text && !isEmptyStr;
        if (typeof tokenStyle.width === "number") {
          token.width = tokenStyle.width;
        } else {
          token.width = linesWidths ? linesWidths[i2] : getWidth(text, font);
        }
        if (!i2 && !newLine) {
          var tokens = (lines[lines.length - 1] || (lines[0] = new RichTextLine())).tokens;
          var tokensLen = tokens.length;
          tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : (text || !tokensLen || isEmptyStr) && tokens.push(token);
        } else {
          lines.push(new RichTextLine([token]));
        }
      }
    }
    function isAlphabeticLetter(ch) {
      var code = ch.charCodeAt(0);
      return code >= 32 && code <= 591 || code >= 880 && code <= 4351 || code >= 4608 && code <= 5119 || code >= 7680 && code <= 8303;
    }
    var breakCharMap = reduce(",&?/;] ".split(""), function(obj, ch) {
      obj[ch] = true;
      return obj;
    }, {});
    function isWordBreakChar(ch) {
      if (isAlphabeticLetter(ch)) {
        if (breakCharMap[ch]) {
          return true;
        }
        return false;
      }
      return true;
    }
    function wrapText(text, font, lineWidth, isBreakAll, lastAccumWidth) {
      var lines = [];
      var linesWidths = [];
      var line = "";
      var currentWord = "";
      var currentWordWidth = 0;
      var accumWidth = 0;
      for (var i2 = 0; i2 < text.length; i2++) {
        var ch = text.charAt(i2);
        if (ch === "\n") {
          if (currentWord) {
            line += currentWord;
            accumWidth += currentWordWidth;
          }
          lines.push(line);
          linesWidths.push(accumWidth);
          line = "";
          currentWord = "";
          currentWordWidth = 0;
          accumWidth = 0;
          continue;
        }
        var chWidth = getWidth(ch, font);
        var inWord = isBreakAll ? false : !isWordBreakChar(ch);
        if (!lines.length ? lastAccumWidth + accumWidth + chWidth > lineWidth : accumWidth + chWidth > lineWidth) {
          if (!accumWidth) {
            if (inWord) {
              lines.push(currentWord);
              linesWidths.push(currentWordWidth);
              currentWord = ch;
              currentWordWidth = chWidth;
            } else {
              lines.push(ch);
              linesWidths.push(chWidth);
            }
          } else if (line || currentWord) {
            if (inWord) {
              if (!line) {
                line = currentWord;
                currentWord = "";
                currentWordWidth = 0;
                accumWidth = currentWordWidth;
              }
              lines.push(line);
              linesWidths.push(accumWidth - currentWordWidth);
              currentWord += ch;
              currentWordWidth += chWidth;
              line = "";
              accumWidth = currentWordWidth;
            } else {
              if (currentWord) {
                line += currentWord;
                currentWord = "";
                currentWordWidth = 0;
              }
              lines.push(line);
              linesWidths.push(accumWidth);
              line = ch;
              accumWidth = chWidth;
            }
          }
          continue;
        }
        accumWidth += chWidth;
        if (inWord) {
          currentWord += ch;
          currentWordWidth += chWidth;
        } else {
          if (currentWord) {
            line += currentWord;
            currentWord = "";
            currentWordWidth = 0;
          }
          line += ch;
        }
      }
      if (!lines.length && !line) {
        line = text;
        currentWord = "";
        currentWordWidth = 0;
      }
      if (currentWord) {
        line += currentWord;
      }
      if (line) {
        lines.push(line);
        linesWidths.push(accumWidth);
      }
      if (lines.length === 1) {
        accumWidth += lastAccumWidth;
      }
      return {
        accumWidth,
        lines,
        linesWidths
      };
    }
    var STYLE_MAGIC_KEY = "__zr_style_" + Math.round(Math.random() * 10);
    var DEFAULT_COMMON_STYLE = {
      shadowBlur: 0,
      shadowOffsetX: 0,
      shadowOffsetY: 0,
      shadowColor: "#000",
      opacity: 1,
      blend: "source-over"
    };
    var DEFAULT_COMMON_ANIMATION_PROPS = {
      style: {
        shadowBlur: true,
        shadowOffsetX: true,
        shadowOffsetY: true,
        shadowColor: true,
        opacity: true
      }
    };
    DEFAULT_COMMON_STYLE[STYLE_MAGIC_KEY] = true;
    var PRIMARY_STATES_KEYS = ["z", "z2", "invisible"];
    var PRIMARY_STATES_KEYS_IN_HOVER_LAYER = ["invisible"];
    var Displayable = function(_super) {
      __extends$1(Displayable2, _super);
      function Displayable2(props2) {
        return _super.call(this, props2) || this;
      }
      Displayable2.prototype._init = function(props2) {
        var keysArr = keys$1(props2);
        for (var i2 = 0; i2 < keysArr.length; i2++) {
          var key = keysArr[i2];
          if (key === "style") {
            this.useStyle(props2[key]);
          } else {
            _super.prototype.attrKV.call(this, key, props2[key]);
          }
        }
        if (!this.style) {
          this.useStyle({});
        }
      };
      Displayable2.prototype.beforeBrush = function() {
      };
      Displayable2.prototype.afterBrush = function() {
      };
      Displayable2.prototype.innerBeforeBrush = function() {
      };
      Displayable2.prototype.innerAfterBrush = function() {
      };
      Displayable2.prototype.shouldBePainted = function(viewWidth, viewHeight, considerClipPath, considerAncestors) {
        var 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 (var i2 = 0; i2 < this.__clipPaths.length; ++i2) {
            if (this.__clipPaths[i2].isZeroArea()) {
              return false;
            }
          }
        }
        if (considerAncestors && this.parent) {
          var parent_1 = this.parent;
          while (parent_1) {
            if (parent_1.ignore) {
              return false;
            }
            parent_1 = parent_1.parent;
          }
        }
        return true;
      };
      Displayable2.prototype.contain = function(x2, y) {
        return this.rectContain(x2, y);
      };
      Displayable2.prototype.traverse = function(cb, context) {
        cb.call(context, this);
      };
      Displayable2.prototype.rectContain = function(x2, y) {
        var coord = this.transformCoordToLocal(x2, y);
        var rect = this.getBoundingRect();
        return rect.contain(coord[0], coord[1]);
      };
      Displayable2.prototype.getPaintRect = function() {
        var rect = this._paintRect;
        if (!this._paintRect || this.__dirty) {
          var transform2 = this.transform;
          var elRect = this.getBoundingRect();
          var style = this.style;
          var shadowSize = style.shadowBlur || 0;
          var shadowOffsetX = style.shadowOffsetX || 0;
          var shadowOffsetY = style.shadowOffsetY || 0;
          rect = this._paintRect || (this._paintRect = new BoundingRect(0, 0, 0, 0));
          if (transform2) {
            BoundingRect.applyTransform(rect, elRect, transform2);
          } else {
            rect.copy(elRect);
          }
          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);
          }
          var 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);
          }
        }
        return rect;
      };
      Displayable2.prototype.setPrevPaintRect = function(paintRect) {
        if (paintRect) {
          this._prevPaintRect = this._prevPaintRect || new BoundingRect(0, 0, 0, 0);
          this._prevPaintRect.copy(paintRect);
        } else {
          this._prevPaintRect = null;
        }
      };
      Displayable2.prototype.getPrevPaintRect = function() {
        return this._prevPaintRect;
      };
      Displayable2.prototype.animateStyle = function(loop) {
        return this.animate("style", loop);
      };
      Displayable2.prototype.updateDuringAnimation = function(targetKey) {
        if (targetKey === "style") {
          this.dirtyStyle();
        } else {
          this.markRedraw();
        }
      };
      Displayable2.prototype.attrKV = function(key, value) {
        if (key !== "style") {
          _super.prototype.attrKV.call(this, key, value);
        } else {
          if (!this.style) {
            this.useStyle(value);
          } else {
            this.setStyle(value);
          }
        }
      };
      Displayable2.prototype.setStyle = function(keyOrObj, value) {
        if (typeof keyOrObj === "string") {
          this.style[keyOrObj] = value;
        } else {
          extend$1(this.style, keyOrObj);
        }
        this.dirtyStyle();
        return this;
      };
      Displayable2.prototype.dirtyStyle = function(notRedraw) {
        if (!notRedraw) {
          this.markRedraw();
        }
        this.__dirty |= STYLE_CHANGED_BIT;
        if (this._rect) {
          this._rect = null;
        }
      };
      Displayable2.prototype.dirty = function() {
        this.dirtyStyle();
      };
      Displayable2.prototype.styleChanged = function() {
        return !!(this.__dirty & STYLE_CHANGED_BIT);
      };
      Displayable2.prototype.styleUpdated = function() {
        this.__dirty &= -3;
      };
      Displayable2.prototype.createStyle = function(obj) {
        return createObject(DEFAULT_COMMON_STYLE, obj);
      };
      Displayable2.prototype.useStyle = function(obj) {
        if (!obj[STYLE_MAGIC_KEY]) {
          obj = this.createStyle(obj);
        }
        if (this.__inHover) {
          this.__hoverStyle = obj;
        } else {
          this.style = obj;
        }
        this.dirtyStyle();
      };
      Displayable2.prototype.isStyleObject = function(obj) {
        return obj[STYLE_MAGIC_KEY];
      };
      Displayable2.prototype._innerSaveToNormal = function(toState) {
        _super.prototype._innerSaveToNormal.call(this, toState);
        var normalState = this._normalState;
        if (toState.style && !normalState.style) {
          normalState.style = this._mergeStyle(this.createStyle(), this.style);
        }
        this._savePrimaryToNormal(toState, normalState, PRIMARY_STATES_KEYS);
      };
      Displayable2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
        _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);
        var needsRestoreToNormal = !(state && keepCurrentStates);
        var 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);
            }
          } 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) {
            var sourceStyle = this.style;
            this.style = this.createStyle(needsRestoreToNormal ? {} : sourceStyle);
            if (needsRestoreToNormal) {
              var changedKeys = keys$1(sourceStyle);
              for (var i2 = 0; i2 < changedKeys.length; i2++) {
                var key = changedKeys[i2];
                if (key in targetStyle) {
                  targetStyle[key] = targetStyle[key];
                  this.style[key] = sourceStyle[key];
                }
              }
            }
            var targetKeys = keys$1(targetStyle);
            for (var i2 = 0; i2 < targetKeys.length; i2++) {
              var key = targetKeys[i2];
              this.style[key] = this.style[key];
            }
            this._transitionState(stateName, {
              style: targetStyle
            }, animationCfg, this.getAnimationStyleProps());
          } else {
            this.useStyle(targetStyle);
          }
        }
        var statesKeys = this.__inHover ? PRIMARY_STATES_KEYS_IN_HOVER_LAYER : PRIMARY_STATES_KEYS;
        for (var i2 = 0; i2 < statesKeys.length; i2++) {
          var key = statesKeys[i2];
          if (state && state[key] != null) {
            this[key] = state[key];
          } else if (needsRestoreToNormal) {
            if (normalState[key] != null) {
              this[key] = normalState[key];
            }
          }
        }
      };
      Displayable2.prototype._mergeStates = function(states) {
        var mergedState = _super.prototype._mergeStates.call(this, states);
        var mergedStyle;
        for (var i2 = 0; i2 < states.length; i2++) {
          var state = states[i2];
          if (state.style) {
            mergedStyle = mergedStyle || {};
            this._mergeStyle(mergedStyle, state.style);
          }
        }
        if (mergedStyle) {
          mergedState.style = mergedStyle;
        }
        return mergedState;
      };
      Displayable2.prototype._mergeStyle = function(targetStyle, sourceStyle) {
        extend$1(targetStyle, sourceStyle);
        return targetStyle;
      };
      Displayable2.prototype.getAnimationStyleProps = function() {
        return DEFAULT_COMMON_ANIMATION_PROPS;
      };
      Displayable2.initDefaultProps = function() {
        var dispProto = Displayable2.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 = REDRAW_BIT | STYLE_CHANGED_BIT;
      }();
      return Displayable2;
    }(Element$1);
    var tmpRect = new BoundingRect(0, 0, 0, 0);
    var viewRect = new BoundingRect(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);
    }
    var mathMin$9 = Math.min;
    var mathMax$9 = Math.max;
    var mathSin$4 = Math.sin;
    var mathCos$4 = Math.cos;
    var PI2$8 = Math.PI * 2;
    var start = create$2();
    var end = create$2();
    var extremity = create$2();
    function fromPoints(points2, min3, max3) {
      if (points2.length === 0) {
        return;
      }
      var p2 = points2[0];
      var left = p2[0];
      var right = p2[0];
      var top = p2[1];
      var bottom = p2[1];
      for (var i2 = 1; i2 < points2.length; i2++) {
        p2 = points2[i2];
        left = mathMin$9(left, p2[0]);
        right = mathMax$9(right, p2[0]);
        top = mathMin$9(top, p2[1]);
        bottom = mathMax$9(bottom, p2[1]);
      }
      min3[0] = left;
      min3[1] = top;
      max3[0] = right;
      max3[1] = bottom;
    }
    function fromLine(x0, y0, x1, y1, min3, max3) {
      min3[0] = mathMin$9(x0, x1);
      min3[1] = mathMin$9(y0, y1);
      max3[0] = mathMax$9(x0, x1);
      max3[1] = mathMax$9(y0, y1);
    }
    var xDim = [];
    var yDim = [];
    function fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min3, max3) {
      var cubicExtrema$1 = cubicExtrema;
      var cubicAt$1 = cubicAt;
      var n = cubicExtrema$1(x0, x1, x2, x3, xDim);
      min3[0] = Infinity;
      min3[1] = Infinity;
      max3[0] = -Infinity;
      max3[1] = -Infinity;
      for (var i2 = 0; i2 < n; i2++) {
        var x4 = cubicAt$1(x0, x1, x2, x3, xDim[i2]);
        min3[0] = mathMin$9(x4, min3[0]);
        max3[0] = mathMax$9(x4, max3[0]);
      }
      n = cubicExtrema$1(y0, y1, y2, y3, yDim);
      for (var i2 = 0; i2 < n; i2++) {
        var y = cubicAt$1(y0, y1, y2, y3, yDim[i2]);
        min3[1] = mathMin$9(y, min3[1]);
        max3[1] = mathMax$9(y, max3[1]);
      }
      min3[0] = mathMin$9(x0, min3[0]);
      max3[0] = mathMax$9(x0, max3[0]);
      min3[0] = mathMin$9(x3, min3[0]);
      max3[0] = mathMax$9(x3, max3[0]);
      min3[1] = mathMin$9(y0, min3[1]);
      max3[1] = mathMax$9(y0, max3[1]);
      min3[1] = mathMin$9(y3, min3[1]);
      max3[1] = mathMax$9(y3, max3[1]);
    }
    function fromQuadratic(x0, y0, x1, y1, x2, y2, min3, max3) {
      var quadraticExtremum$1 = quadraticExtremum;
      var quadraticAt2 = quadraticAt$1;
      var tx = mathMax$9(mathMin$9(quadraticExtremum$1(x0, x1, x2), 1), 0);
      var ty = mathMax$9(mathMin$9(quadraticExtremum$1(y0, y1, y2), 1), 0);
      var x3 = quadraticAt2(x0, x1, x2, tx);
      var y = quadraticAt2(y0, y1, y2, ty);
      min3[0] = mathMin$9(x0, x2, x3);
      min3[1] = mathMin$9(y0, y2, y);
      max3[0] = mathMax$9(x0, x2, x3);
      max3[1] = mathMax$9(y0, y2, y);
    }
    function fromArc(x2, y, rx, ry, startAngle, endAngle, anticlockwise, min3, max3) {
      var vec2Min = min$1;
      var vec2Max = max$1;
      var diff = Math.abs(startAngle - endAngle);
      if (diff % PI2$8 < 1e-4 && diff > 1e-4) {
        min3[0] = x2 - rx;
        min3[1] = y - ry;
        max3[0] = x2 + rx;
        max3[1] = y + ry;
        return;
      }
      start[0] = mathCos$4(startAngle) * rx + x2;
      start[1] = mathSin$4(startAngle) * ry + y;
      end[0] = mathCos$4(endAngle) * rx + x2;
      end[1] = mathSin$4(endAngle) * ry + y;
      vec2Min(min3, start, end);
      vec2Max(max3, start, end);
      startAngle = startAngle % PI2$8;
      if (startAngle < 0) {
        startAngle = startAngle + PI2$8;
      }
      endAngle = endAngle % PI2$8;
      if (endAngle < 0) {
        endAngle = endAngle + PI2$8;
      }
      if (startAngle > endAngle && !anticlockwise) {
        endAngle += PI2$8;
      } else if (startAngle < endAngle && anticlockwise) {
        startAngle += PI2$8;
      }
      if (anticlockwise) {
        var tmp = endAngle;
        endAngle = startAngle;
        startAngle = tmp;
      }
      for (var angle2 = 0; angle2 < endAngle; angle2 += Math.PI / 2) {
        if (angle2 > startAngle) {
          extremity[0] = mathCos$4(angle2) * rx + x2;
          extremity[1] = mathSin$4(angle2) * ry + y;
          vec2Min(min3, extremity, min3);
          vec2Max(max3, extremity, max3);
        }
      }
    }
    var CMD$4 = {
      M: 1,
      L: 2,
      C: 3,
      Q: 4,
      A: 5,
      Z: 6,
      R: 7
    };
    var tmpOutX = [];
    var tmpOutY = [];
    var min = [];
    var max = [];
    var min2 = [];
    var max2 = [];
    var mathMin$8 = Math.min;
    var mathMax$8 = Math.max;
    var mathCos$3 = Math.cos;
    var mathSin$3 = Math.sin;
    var mathAbs$2 = Math.abs;
    var PI$8 = Math.PI;
    var PI2$7 = PI$8 * 2;
    var hasTypedArray = typeof Float32Array !== "undefined";
    var tmpAngles = [];
    function modPI2(radian) {
      var n = Math.round(radian / PI$8 * 1e8) / 1e8;
      return n % 2 * PI$8;
    }
    function normalizeArcAngles(angles, anticlockwise) {
      var newStartAngle = modPI2(angles[0]);
      if (newStartAngle < 0) {
        newStartAngle += PI2$7;
      }
      var delta = newStartAngle - angles[0];
      var newEndAngle = angles[1];
      newEndAngle += delta;
      if (!anticlockwise && newEndAngle - newStartAngle >= PI2$7) {
        newEndAngle = newStartAngle + PI2$7;
      } else if (anticlockwise && newStartAngle - newEndAngle >= PI2$7) {
        newEndAngle = newStartAngle - PI2$7;
      } else if (!anticlockwise && newStartAngle > newEndAngle) {
        newEndAngle = newStartAngle + (PI2$7 - modPI2(newStartAngle - newEndAngle));
      } else if (anticlockwise && newStartAngle < newEndAngle) {
        newEndAngle = newStartAngle - (PI2$7 - modPI2(newEndAngle - newStartAngle));
      }
      angles[0] = newStartAngle;
      angles[1] = newEndAngle;
    }
    var PathProxy = function() {
      function PathProxy2(notSaveData) {
        this.dpr = 1;
        this._xi = 0;
        this._yi = 0;
        this._x0 = 0;
        this._y0 = 0;
        this._len = 0;
        if (notSaveData) {
          this._saveData = false;
        }
        if (this._saveData) {
          this.data = [];
        }
      }
      PathProxy2.prototype.increaseVersion = function() {
        this._version++;
      };
      PathProxy2.prototype.getVersion = function() {
        return this._version;
      };
      PathProxy2.prototype.setScale = function(sx, sy, segmentIgnoreThreshold) {
        segmentIgnoreThreshold = segmentIgnoreThreshold || 0;
        if (segmentIgnoreThreshold > 0) {
          this._ux = mathAbs$2(segmentIgnoreThreshold / devicePixelRatio / sx) || 0;
          this._uy = mathAbs$2(segmentIgnoreThreshold / devicePixelRatio / sy) || 0;
        }
      };
      PathProxy2.prototype.setDPR = function(dpr2) {
        this.dpr = dpr2;
      };
      PathProxy2.prototype.setContext = function(ctx) {
        this._ctx = ctx;
      };
      PathProxy2.prototype.getContext = function() {
        return this._ctx;
      };
      PathProxy2.prototype.beginPath = function() {
        this._ctx && this._ctx.beginPath();
        this.reset();
        return this;
      };
      PathProxy2.prototype.reset = function() {
        if (this._saveData) {
          this._len = 0;
        }
        if (this._pathSegLen) {
          this._pathSegLen = null;
          this._pathLen = 0;
        }
        this._version++;
      };
      PathProxy2.prototype.moveTo = function(x2, y) {
        this._drawPendingPt();
        this.addData(CMD$4.M, x2, y);
        this._ctx && this._ctx.moveTo(x2, y);
        this._x0 = x2;
        this._y0 = y;
        this._xi = x2;
        this._yi = y;
        return this;
      };
      PathProxy2.prototype.lineTo = function(x2, y) {
        var dx = mathAbs$2(x2 - this._xi);
        var dy = mathAbs$2(y - this._yi);
        var exceedUnit = dx > this._ux || dy > this._uy;
        this.addData(CMD$4.L, x2, y);
        if (this._ctx && exceedUnit) {
          this._ctx.lineTo(x2, y);
        }
        if (exceedUnit) {
          this._xi = x2;
          this._yi = y;
          this._pendingPtDist = 0;
        } else {
          var d2 = dx * dx + dy * dy;
          if (d2 > this._pendingPtDist) {
            this._pendingPtX = x2;
            this._pendingPtY = y;
            this._pendingPtDist = d2;
          }
        }
        return this;
      };
      PathProxy2.prototype.bezierCurveTo = function(x1, y1, x2, y2, x3, y3) {
        this._drawPendingPt();
        this.addData(CMD$4.C, x1, y1, x2, y2, x3, y3);
        if (this._ctx) {
          this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);
        }
        this._xi = x3;
        this._yi = y3;
        return this;
      };
      PathProxy2.prototype.quadraticCurveTo = function(x1, y1, x2, y2) {
        this._drawPendingPt();
        this.addData(CMD$4.Q, x1, y1, x2, y2);
        if (this._ctx) {
          this._ctx.quadraticCurveTo(x1, y1, x2, y2);
        }
        this._xi = x2;
        this._yi = y2;
        return this;
      };
      PathProxy2.prototype.arc = function(cx, cy, r, startAngle, endAngle, anticlockwise) {
        this._drawPendingPt();
        tmpAngles[0] = startAngle;
        tmpAngles[1] = endAngle;
        normalizeArcAngles(tmpAngles, anticlockwise);
        startAngle = tmpAngles[0];
        endAngle = tmpAngles[1];
        var delta = endAngle - startAngle;
        this.addData(CMD$4.A, cx, cy, r, r, startAngle, delta, 0, anticlockwise ? 0 : 1);
        this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);
        this._xi = mathCos$3(endAngle) * r + cx;
        this._yi = mathSin$3(endAngle) * r + cy;
        return this;
      };
      PathProxy2.prototype.arcTo = function(x1, y1, x2, y2, radius) {
        this._drawPendingPt();
        if (this._ctx) {
          this._ctx.arcTo(x1, y1, x2, y2, radius);
        }
        return this;
      };
      PathProxy2.prototype.rect = function(x2, y, w2, h2) {
        this._drawPendingPt();
        this._ctx && this._ctx.rect(x2, y, w2, h2);
        this.addData(CMD$4.R, x2, y, w2, h2);
        return this;
      };
      PathProxy2.prototype.closePath = function() {
        this._drawPendingPt();
        this.addData(CMD$4.Z);
        var ctx = this._ctx;
        var x0 = this._x0;
        var y0 = this._y0;
        if (ctx) {
          ctx.closePath();
        }
        this._xi = x0;
        this._yi = y0;
        return this;
      };
      PathProxy2.prototype.fill = function(ctx) {
        ctx && ctx.fill();
        this.toStatic();
      };
      PathProxy2.prototype.stroke = function(ctx) {
        ctx && ctx.stroke();
        this.toStatic();
      };
      PathProxy2.prototype.len = function() {
        return this._len;
      };
      PathProxy2.prototype.setData = function(data) {
        var len2 = data.length;
        if (!(this.data && this.data.length === len2) && hasTypedArray) {
          this.data = new Float32Array(len2);
        }
        for (var i2 = 0; i2 < len2; i2++) {
          this.data[i2] = data[i2];
        }
        this._len = len2;
      };
      PathProxy2.prototype.appendPath = function(path) {
        if (!(path instanceof Array)) {
          path = [path];
        }
        var len2 = path.length;
        var appendSize = 0;
        var offset2 = this._len;
        for (var i2 = 0; i2 < len2; i2++) {
          appendSize += path[i2].len();
        }
        if (hasTypedArray && this.data instanceof Float32Array) {
          this.data = new Float32Array(offset2 + appendSize);
        }
        for (var i2 = 0; i2 < len2; i2++) {
          var appendPathData = path[i2].data;
          for (var k2 = 0; k2 < appendPathData.length; k2++) {
            this.data[offset2++] = appendPathData[k2];
          }
        }
        this._len = offset2;
      };
      PathProxy2.prototype.addData = function(cmd, a2, b2, c2, d2, e2, f2, g, h2) {
        if (!this._saveData) {
          return;
        }
        var data = this.data;
        if (this._len + arguments.length > data.length) {
          this._expandData();
          data = this.data;
        }
        for (var i2 = 0; i2 < arguments.length; i2++) {
          data[this._len++] = arguments[i2];
        }
      };
      PathProxy2.prototype._drawPendingPt = function() {
        if (this._pendingPtDist > 0) {
          this._ctx && this._ctx.lineTo(this._pendingPtX, this._pendingPtY);
          this._pendingPtDist = 0;
        }
      };
      PathProxy2.prototype._expandData = function() {
        if (!(this.data instanceof Array)) {
          var newData = [];
          for (var i2 = 0; i2 < this._len; i2++) {
            newData[i2] = this.data[i2];
          }
          this.data = newData;
        }
      };
      PathProxy2.prototype.toStatic = function() {
        if (!this._saveData) {
          return;
        }
        this._drawPendingPt();
        var data = this.data;
        if (data instanceof Array) {
          data.length = this._len;
          if (hasTypedArray && this._len > 11) {
            this.data = new Float32Array(data);
          }
        }
      };
      PathProxy2.prototype.getBoundingRect = function() {
        min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;
        max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;
        var data = this.data;
        var xi = 0;
        var yi = 0;
        var x0 = 0;
        var y0 = 0;
        var i2;
        for (i2 = 0; i2 < this._len; ) {
          var cmd = data[i2++];
          var isFirst = i2 === 1;
          if (isFirst) {
            xi = data[i2];
            yi = data[i2 + 1];
            x0 = xi;
            y0 = yi;
          }
          switch (cmd) {
            case CMD$4.M:
              xi = x0 = data[i2++];
              yi = y0 = data[i2++];
              min2[0] = x0;
              min2[1] = y0;
              max2[0] = x0;
              max2[1] = y0;
              break;
            case CMD$4.L:
              fromLine(xi, yi, data[i2], data[i2 + 1], min2, max2);
              xi = data[i2++];
              yi = data[i2++];
              break;
            case CMD$4.C:
              fromCubic(xi, yi, data[i2++], data[i2++], data[i2++], data[i2++], data[i2], data[i2 + 1], min2, max2);
              xi = data[i2++];
              yi = data[i2++];
              break;
            case CMD$4.Q:
              fromQuadratic(xi, yi, data[i2++], data[i2++], data[i2], data[i2 + 1], min2, max2);
              xi = data[i2++];
              yi = data[i2++];
              break;
            case CMD$4.A:
              var cx = data[i2++];
              var cy = data[i2++];
              var rx = data[i2++];
              var ry = data[i2++];
              var startAngle = data[i2++];
              var endAngle = data[i2++] + startAngle;
              i2 += 1;
              var anticlockwise = !data[i2++];
              if (isFirst) {
                x0 = mathCos$3(startAngle) * rx + cx;
                y0 = mathSin$3(startAngle) * ry + cy;
              }
              fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);
              xi = mathCos$3(endAngle) * rx + cx;
              yi = mathSin$3(endAngle) * ry + cy;
              break;
            case CMD$4.R:
              x0 = xi = data[i2++];
              y0 = yi = data[i2++];
              var width = data[i2++];
              var height = data[i2++];
              fromLine(x0, y0, x0 + width, y0 + height, min2, max2);
              break;
            case CMD$4.Z:
              xi = x0;
              yi = y0;
              break;
          }
          min$1(min, min, min2);
          max$1(max, max, max2);
        }
        if (i2 === 0) {
          min[0] = min[1] = max[0] = max[1] = 0;
        }
        return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);
      };
      PathProxy2.prototype._calculateLength = function() {
        var data = this.data;
        var len2 = this._len;
        var ux = this._ux;
        var uy = this._uy;
        var xi = 0;
        var yi = 0;
        var x0 = 0;
        var y0 = 0;
        if (!this._pathSegLen) {
          this._pathSegLen = [];
        }
        var pathSegLen = this._pathSegLen;
        var pathTotalLen = 0;
        var segCount = 0;
        for (var i2 = 0; i2 < len2; ) {
          var cmd = data[i2++];
          var isFirst = i2 === 1;
          if (isFirst) {
            xi = data[i2];
            yi = data[i2 + 1];
            x0 = xi;
            y0 = yi;
          }
          var l2 = -1;
          switch (cmd) {
            case CMD$4.M:
              xi = x0 = data[i2++];
              yi = y0 = data[i2++];
              break;
            case CMD$4.L: {
              var x2 = data[i2++];
              var y2 = data[i2++];
              var dx = x2 - xi;
              var dy = y2 - yi;
              if (mathAbs$2(dx) > ux || mathAbs$2(dy) > uy || i2 === len2 - 1) {
                l2 = Math.sqrt(dx * dx + dy * dy);
                xi = x2;
                yi = y2;
              }
              break;
            }
            case CMD$4.C: {
              var x1 = data[i2++];
              var y1 = data[i2++];
              var x2 = data[i2++];
              var y2 = data[i2++];
              var x3 = data[i2++];
              var y3 = data[i2++];
              l2 = cubicLength(xi, yi, x1, y1, x2, y2, x3, y3, 10);
              xi = x3;
              yi = y3;
              break;
            }
            case CMD$4.Q: {
              var x1 = data[i2++];
              var y1 = data[i2++];
              var x2 = data[i2++];
              var y2 = data[i2++];
              l2 = quadraticLength(xi, yi, x1, y1, x2, y2, 10);
              xi = x2;
              yi = y2;
              break;
            }
            case CMD$4.A:
              var cx = data[i2++];
              var cy = data[i2++];
              var rx = data[i2++];
              var ry = data[i2++];
              var startAngle = data[i2++];
              var delta = data[i2++];
              var endAngle = delta + startAngle;
              i2 += 1;
              if (isFirst) {
                x0 = mathCos$3(startAngle) * rx + cx;
                y0 = mathSin$3(startAngle) * ry + cy;
              }
              l2 = mathMax$8(rx, ry) * mathMin$8(PI2$7, Math.abs(delta));
              xi = mathCos$3(endAngle) * rx + cx;
              yi = mathSin$3(endAngle) * ry + cy;
              break;
            case CMD$4.R: {
              x0 = xi = data[i2++];
              y0 = yi = data[i2++];
              var width = data[i2++];
              var height = data[i2++];
              l2 = width * 2 + height * 2;
              break;
            }
            case CMD$4.Z: {
              var dx = x0 - xi;
              var dy = y0 - yi;
              l2 = Math.sqrt(dx * dx + dy * dy);
              xi = x0;
              yi = y0;
              break;
            }
          }
          if (l2 >= 0) {
            pathSegLen[segCount++] = l2;
            pathTotalLen += l2;
          }
        }
        this._pathLen = pathTotalLen;
        return pathTotalLen;
      };
      PathProxy2.prototype.rebuildPath = function(ctx, percent) {
        var d2 = this.data;
        var ux = this._ux;
        var uy = this._uy;
        var len2 = this._len;
        var x0;
        var y0;
        var xi;
        var yi;
        var x2;
        var y;
        var drawPart = percent < 1;
        var pathSegLen;
        var pathTotalLen;
        var accumLength = 0;
        var segCount = 0;
        var displayedLength;
        var pendingPtDist = 0;
        var pendingPtX;
        var pendingPtY;
        if (drawPart) {
          if (!this._pathSegLen) {
            this._calculateLength();
          }
          pathSegLen = this._pathSegLen;
          pathTotalLen = this._pathLen;
          displayedLength = percent * pathTotalLen;
          if (!displayedLength) {
            return;
          }
        }
        lo: for (var i2 = 0; i2 < len2; ) {
          var cmd = d2[i2++];
          var isFirst = i2 === 1;
          if (isFirst) {
            xi = d2[i2];
            yi = d2[i2 + 1];
            x0 = xi;
            y0 = yi;
          }
          if (cmd !== CMD$4.L && pendingPtDist > 0) {
            ctx.lineTo(pendingPtX, pendingPtY);
            pendingPtDist = 0;
          }
          switch (cmd) {
            case CMD$4.M:
              x0 = xi = d2[i2++];
              y0 = yi = d2[i2++];
              ctx.moveTo(xi, yi);
              break;
            case CMD$4.L: {
              x2 = d2[i2++];
              y = d2[i2++];
              var dx = mathAbs$2(x2 - xi);
              var dy = mathAbs$2(y - yi);
              if (dx > ux || dy > uy) {
                if (drawPart) {
                  var l2 = pathSegLen[segCount++];
                  if (accumLength + l2 > displayedLength) {
                    var t = (displayedLength - accumLength) / l2;
                    ctx.lineTo(xi * (1 - t) + x2 * t, yi * (1 - t) + y * t);
                    break lo;
                  }
                  accumLength += l2;
                }
                ctx.lineTo(x2, y);
                xi = x2;
                yi = y;
                pendingPtDist = 0;
              } else {
                var d22 = dx * dx + dy * dy;
                if (d22 > pendingPtDist) {
                  pendingPtX = x2;
                  pendingPtY = y;
                  pendingPtDist = d22;
                }
              }
              break;
            }
            case CMD$4.C: {
              var x1 = d2[i2++];
              var y1 = d2[i2++];
              var x22 = d2[i2++];
              var y2 = d2[i2++];
              var x3 = d2[i2++];
              var y3 = d2[i2++];
              if (drawPart) {
                var l2 = pathSegLen[segCount++];
                if (accumLength + l2 > displayedLength) {
                  var t = (displayedLength - accumLength) / l2;
                  cubicSubdivide(xi, x1, x22, x3, t, tmpOutX);
                  cubicSubdivide(yi, y1, y2, y3, t, tmpOutY);
                  ctx.bezierCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2], tmpOutX[3], tmpOutY[3]);
                  break lo;
                }
                accumLength += l2;
              }
              ctx.bezierCurveTo(x1, y1, x22, y2, x3, y3);
              xi = x3;
              yi = y3;
              break;
            }
            case CMD$4.Q: {
              var x1 = d2[i2++];
              var y1 = d2[i2++];
              var x22 = d2[i2++];
              var y2 = d2[i2++];
              if (drawPart) {
                var l2 = pathSegLen[segCount++];
                if (accumLength + l2 > displayedLength) {
                  var t = (displayedLength - accumLength) / l2;
                  quadraticSubdivide(xi, x1, x22, t, tmpOutX);
                  quadraticSubdivide(yi, y1, y2, t, tmpOutY);
                  ctx.quadraticCurveTo(tmpOutX[1], tmpOutY[1], tmpOutX[2], tmpOutY[2]);
                  break lo;
                }
                accumLength += l2;
              }
              ctx.quadraticCurveTo(x1, y1, x22, y2);
              xi = x22;
              yi = y2;
              break;
            }
            case CMD$4.A:
              var cx = d2[i2++];
              var cy = d2[i2++];
              var rx = d2[i2++];
              var ry = d2[i2++];
              var startAngle = d2[i2++];
              var delta = d2[i2++];
              var psi = d2[i2++];
              var anticlockwise = !d2[i2++];
              var r = rx > ry ? rx : ry;
              var isEllipse = mathAbs$2(rx - ry) > 1e-3;
              var endAngle = startAngle + delta;
              var breakBuild = false;
              if (drawPart) {
                var l2 = pathSegLen[segCount++];
                if (accumLength + l2 > displayedLength) {
                  endAngle = startAngle + delta * (displayedLength - accumLength) / l2;
                  breakBuild = true;
                }
                accumLength += l2;
              }
              if (isEllipse && ctx.ellipse) {
                ctx.ellipse(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise);
              } else {
                ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);
              }
              if (breakBuild) {
                break lo;
              }
              if (isFirst) {
                x0 = mathCos$3(startAngle) * rx + cx;
                y0 = mathSin$3(startAngle) * ry + cy;
              }
              xi = mathCos$3(endAngle) * rx + cx;
              yi = mathSin$3(endAngle) * ry + cy;
              break;
            case CMD$4.R:
              x0 = xi = d2[i2];
              y0 = yi = d2[i2 + 1];
              x2 = d2[i2++];
              y = d2[i2++];
              var width = d2[i2++];
              var height = d2[i2++];
              if (drawPart) {
                var l2 = pathSegLen[segCount++];
                if (accumLength + l2 > displayedLength) {
                  var d_1 = displayedLength - accumLength;
                  ctx.moveTo(x2, y);
                  ctx.lineTo(x2 + mathMin$8(d_1, width), y);
                  d_1 -= width;
                  if (d_1 > 0) {
                    ctx.lineTo(x2 + width, y + mathMin$8(d_1, height));
                  }
                  d_1 -= height;
                  if (d_1 > 0) {
                    ctx.lineTo(x2 + mathMax$8(width - d_1, 0), y + height);
                  }
                  d_1 -= width;
                  if (d_1 > 0) {
                    ctx.lineTo(x2, y + mathMax$8(height - d_1, 0));
                  }
                  break lo;
                }
                accumLength += l2;
              }
              ctx.rect(x2, y, width, height);
              break;
            case CMD$4.Z:
              if (drawPart) {
                var l2 = pathSegLen[segCount++];
                if (accumLength + l2 > displayedLength) {
                  var t = (displayedLength - accumLength) / l2;
                  ctx.lineTo(xi * (1 - t) + x0 * t, yi * (1 - t) + y0 * t);
                  break lo;
                }
                accumLength += l2;
              }
              ctx.closePath();
              xi = x0;
              yi = y0;
          }
        }
      };
      PathProxy2.prototype.clone = function() {
        var newProxy = new PathProxy2();
        var data = this.data;
        newProxy.data = data.slice ? data.slice() : Array.prototype.slice.call(data);
        newProxy._len = this._len;
        return newProxy;
      };
      PathProxy2.CMD = CMD$4;
      PathProxy2.initDefaultProps = function() {
        var proto2 = PathProxy2.prototype;
        proto2._saveData = true;
        proto2._ux = 0;
        proto2._uy = 0;
        proto2._pendingPtDist = 0;
        proto2._version = 0;
      }();
      return PathProxy2;
    }();
    function containStroke$4(x0, y0, x1, y1, lineWidth, x2, y) {
      if (lineWidth === 0) {
        return false;
      }
      var _l = lineWidth;
      var _a2 = 0;
      var _b2 = x0;
      if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x2 > x0 + _l && x2 > x1 + _l || x2 < x0 - _l && x2 < x1 - _l) {
        return false;
      }
      if (x0 !== x1) {
        _a2 = (y0 - y1) / (x0 - x1);
        _b2 = (x0 * y1 - x1 * y0) / (x0 - x1);
      } else {
        return Math.abs(x2 - x0) <= _l / 2;
      }
      var tmp = _a2 * x2 - y + _b2;
      var _s = tmp * tmp / (_a2 * _a2 + 1);
      return _s <= _l / 2 * _l / 2;
    }
    function containStroke$3(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x4, y) {
      if (lineWidth === 0) {
        return false;
      }
      var _l = lineWidth;
      if (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l || x4 > x0 + _l && x4 > x1 + _l && x4 > x2 + _l && x4 > x3 + _l || x4 < x0 - _l && x4 < x1 - _l && x4 < x2 - _l && x4 < x3 - _l) {
        return false;
      }
      var d2 = cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x4, y, null);
      return d2 <= _l / 2;
    }
    function containStroke$2(x0, y0, x1, y1, x2, y2, lineWidth, x3, y) {
      if (lineWidth === 0) {
        return false;
      }
      var _l = lineWidth;
      if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x3 > x0 + _l && x3 > x1 + _l && x3 > x2 + _l || x3 < x0 - _l && x3 < x1 - _l && x3 < x2 - _l) {
        return false;
      }
      var d2 = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x3, y, null);
      return d2 <= _l / 2;
    }
    var PI2$6 = Math.PI * 2;
    function normalizeRadian(angle2) {
      angle2 %= PI2$6;
      if (angle2 < 0) {
        angle2 += PI2$6;
      }
      return angle2;
    }
    var PI2$5 = Math.PI * 2;
    function containStroke$1(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x2, y) {
      if (lineWidth === 0) {
        return false;
      }
      var _l = lineWidth;
      x2 -= cx;
      y -= cy;
      var d2 = Math.sqrt(x2 * x2 + y * y);
      if (d2 - _l > r || d2 + _l < r) {
        return false;
      }
      if (Math.abs(startAngle - endAngle) % PI2$5 < 1e-4) {
        return true;
      }
      if (anticlockwise) {
        var tmp = startAngle;
        startAngle = normalizeRadian(endAngle);
        endAngle = normalizeRadian(tmp);
      } else {
        startAngle = normalizeRadian(startAngle);
        endAngle = normalizeRadian(endAngle);
      }
      if (startAngle > endAngle) {
        endAngle += PI2$5;
      }
      var angle2 = Math.atan2(y, x2);
      if (angle2 < 0) {
        angle2 += PI2$5;
      }
      return angle2 >= startAngle && angle2 <= endAngle || angle2 + PI2$5 >= startAngle && angle2 + PI2$5 <= endAngle;
    }
    function windingLine(x0, y0, x1, y1, x2, y) {
      if (y > y0 && y > y1 || y < y0 && y < y1) {
        return 0;
      }
      if (y1 === y0) {
        return 0;
      }
      var t = (y - y0) / (y1 - y0);
      var dir3 = y1 < y0 ? 1 : -1;
      if (t === 1 || t === 0) {
        dir3 = y1 < y0 ? 0.5 : -0.5;
      }
      var x_ = t * (x1 - x0) + x0;
      return x_ === x2 ? Infinity : x_ > x2 ? dir3 : 0;
    }
    var CMD$3 = PathProxy.CMD;
    var PI2$4 = Math.PI * 2;
    var EPSILON$1 = 1e-4;
    function isAroundEqual$1(a2, b2) {
      return Math.abs(a2 - b2) < EPSILON$1;
    }
    var roots = [-1, -1, -1];
    var extrema = [-1, -1];
    function swapExtrema() {
      var tmp = extrema[0];
      extrema[0] = extrema[1];
      extrema[1] = tmp;
    }
    function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x4, y) {
      if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {
        return 0;
      }
      var nRoots = cubicRootAt(y0, y1, y2, y3, y, roots);
      if (nRoots === 0) {
        return 0;
      } else {
        var w2 = 0;
        var nExtrema = -1;
        var y0_ = void 0;
        var y1_ = void 0;
        for (var i2 = 0; i2 < nRoots; i2++) {
          var t = roots[i2];
          var unit2 = t === 0 || t === 1 ? 0.5 : 1;
          var x_ = cubicAt(x0, x1, x2, x3, t);
          if (x_ < x4) {
            continue;
          }
          if (nExtrema < 0) {
            nExtrema = cubicExtrema(y0, y1, y2, y3, extrema);
            if (extrema[1] < extrema[0] && nExtrema > 1) {
              swapExtrema();
            }
            y0_ = cubicAt(y0, y1, y2, y3, extrema[0]);
            if (nExtrema > 1) {
              y1_ = cubicAt(y0, y1, y2, y3, extrema[1]);
            }
          }
          if (nExtrema === 2) {
            if (t < extrema[0]) {
              w2 += y0_ < y0 ? unit2 : -unit2;
            } else if (t < extrema[1]) {
              w2 += y1_ < y0_ ? unit2 : -unit2;
            } else {
              w2 += y3 < y1_ ? unit2 : -unit2;
            }
          } else {
            if (t < extrema[0]) {
              w2 += y0_ < y0 ? unit2 : -unit2;
            } else {
              w2 += y3 < y0_ ? unit2 : -unit2;
            }
          }
        }
        return w2;
      }
    }
    function windingQuadratic(x0, y0, x1, y1, x2, y2, x3, y) {
      if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {
        return 0;
      }
      var nRoots = quadraticRootAt(y0, y1, y2, y, roots);
      if (nRoots === 0) {
        return 0;
      } else {
        var t = quadraticExtremum(y0, y1, y2);
        if (t >= 0 && t <= 1) {
          var w2 = 0;
          var y_ = quadraticAt$1(y0, y1, y2, t);
          for (var i2 = 0; i2 < nRoots; i2++) {
            var unit2 = roots[i2] === 0 || roots[i2] === 1 ? 0.5 : 1;
            var x_ = quadraticAt$1(x0, x1, x2, roots[i2]);
            if (x_ < x3) {
              continue;
            }
            if (roots[i2] < t) {
              w2 += y_ < y0 ? unit2 : -unit2;
            } else {
              w2 += y2 < y_ ? unit2 : -unit2;
            }
          }
          return w2;
        } else {
          var unit2 = roots[0] === 0 || roots[0] === 1 ? 0.5 : 1;
          var x_ = quadraticAt$1(x0, x1, x2, roots[0]);
          if (x_ < x3) {
            return 0;
          }
          return y2 < y0 ? unit2 : -unit2;
        }
      }
    }
    function windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x2, y) {
      y -= cy;
      if (y > r || y < -r) {
        return 0;
      }
      var tmp = Math.sqrt(r * r - y * y);
      roots[0] = -tmp;
      roots[1] = tmp;
      var dTheta = Math.abs(startAngle - endAngle);
      if (dTheta < 1e-4) {
        return 0;
      }
      if (dTheta >= PI2$4 - 1e-4) {
        startAngle = 0;
        endAngle = PI2$4;
        var dir3 = anticlockwise ? 1 : -1;
        if (x2 >= roots[0] + cx && x2 <= roots[1] + cx) {
          return dir3;
        } else {
          return 0;
        }
      }
      if (startAngle > endAngle) {
        var tmp_1 = startAngle;
        startAngle = endAngle;
        endAngle = tmp_1;
      }
      if (startAngle < 0) {
        startAngle += PI2$4;
        endAngle += PI2$4;
      }
      var w2 = 0;
      for (var i2 = 0; i2 < 2; i2++) {
        var x_ = roots[i2];
        if (x_ + cx > x2) {
          var angle2 = Math.atan2(y, x_);
          var dir3 = anticlockwise ? 1 : -1;
          if (angle2 < 0) {
            angle2 = PI2$4 + angle2;
          }
          if (angle2 >= startAngle && angle2 <= endAngle || angle2 + PI2$4 >= startAngle && angle2 + PI2$4 <= endAngle) {
            if (angle2 > Math.PI / 2 && angle2 < Math.PI * 1.5) {
              dir3 = -dir3;
            }
            w2 += dir3;
          }
        }
      }
      return w2;
    }
    function containPath(path, lineWidth, isStroke, x2, y) {
      var data = path.data;
      var len2 = path.len();
      var w2 = 0;
      var xi = 0;
      var yi = 0;
      var x0 = 0;
      var y0 = 0;
      var x1;
      var y1;
      for (var i2 = 0; i2 < len2; ) {
        var cmd = data[i2++];
        var isFirst = i2 === 1;
        if (cmd === CMD$3.M && i2 > 1) {
          if (!isStroke) {
            w2 += windingLine(xi, yi, x0, y0, x2, y);
          }
        }
        if (isFirst) {
          xi = data[i2];
          yi = data[i2 + 1];
          x0 = xi;
          y0 = yi;
        }
        switch (cmd) {
          case CMD$3.M:
            x0 = data[i2++];
            y0 = data[i2++];
            xi = x0;
            yi = y0;
            break;
          case CMD$3.L:
            if (isStroke) {
              if (containStroke$4(xi, yi, data[i2], data[i2 + 1], lineWidth, x2, y)) {
                return true;
              }
            } else {
              w2 += windingLine(xi, yi, data[i2], data[i2 + 1], x2, y) || 0;
            }
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$3.C:
            if (isStroke) {
              if (containStroke$3(xi, yi, data[i2++], data[i2++], data[i2++], data[i2++], data[i2], data[i2 + 1], lineWidth, x2, y)) {
                return true;
              }
            } else {
              w2 += windingCubic(xi, yi, data[i2++], data[i2++], data[i2++], data[i2++], data[i2], data[i2 + 1], x2, y) || 0;
            }
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$3.Q:
            if (isStroke) {
              if (containStroke$2(xi, yi, data[i2++], data[i2++], data[i2], data[i2 + 1], lineWidth, x2, y)) {
                return true;
              }
            } else {
              w2 += windingQuadratic(xi, yi, data[i2++], data[i2++], data[i2], data[i2 + 1], x2, y) || 0;
            }
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$3.A:
            var cx = data[i2++];
            var cy = data[i2++];
            var rx = data[i2++];
            var ry = data[i2++];
            var theta = data[i2++];
            var dTheta = data[i2++];
            i2 += 1;
            var anticlockwise = !!(1 - data[i2++]);
            x1 = Math.cos(theta) * rx + cx;
            y1 = Math.sin(theta) * ry + cy;
            if (!isFirst) {
              w2 += windingLine(xi, yi, x1, y1, x2, y);
            } else {
              x0 = x1;
              y0 = y1;
            }
            var _x = (x2 - cx) * ry / rx + cx;
            if (isStroke) {
              if (containStroke$1(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {
                return true;
              }
            } else {
              w2 += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);
            }
            xi = Math.cos(theta + dTheta) * rx + cx;
            yi = Math.sin(theta + dTheta) * ry + cy;
            break;
          case CMD$3.R:
            x0 = xi = data[i2++];
            y0 = yi = data[i2++];
            var width = data[i2++];
            var height = data[i2++];
            x1 = x0 + width;
            y1 = y0 + height;
            if (isStroke) {
              if (containStroke$4(x0, y0, x1, y0, lineWidth, x2, y) || containStroke$4(x1, y0, x1, y1, lineWidth, x2, y) || containStroke$4(x1, y1, x0, y1, lineWidth, x2, y) || containStroke$4(x0, y1, x0, y0, lineWidth, x2, y)) {
                return true;
              }
            } else {
              w2 += windingLine(x1, y0, x1, y1, x2, y);
              w2 += windingLine(x0, y1, x0, y0, x2, y);
            }
            break;
          case CMD$3.Z:
            if (isStroke) {
              if (containStroke$4(xi, yi, x0, y0, lineWidth, x2, y)) {
                return true;
              }
            } else {
              w2 += windingLine(xi, yi, x0, y0, x2, y);
            }
            xi = x0;
            yi = y0;
            break;
        }
      }
      if (!isStroke && !isAroundEqual$1(yi, y0)) {
        w2 += windingLine(xi, yi, x0, y0, x2, y) || 0;
      }
      return w2 !== 0;
    }
    function contain$2(pathProxy, x2, y) {
      return containPath(pathProxy, 0, false, x2, y);
    }
    function containStroke(pathProxy, lineWidth, x2, y) {
      return containPath(pathProxy, lineWidth, true, x2, y);
    }
    var DEFAULT_PATH_STYLE = defaults$1({
      fill: "#000",
      stroke: null,
      strokePercent: 1,
      fillOpacity: 1,
      strokeOpacity: 1,
      lineDashOffset: 0,
      lineWidth: 1,
      lineCap: "butt",
      miterLimit: 10,
      strokeNoScale: false,
      strokeFirst: false
    }, DEFAULT_COMMON_STYLE);
    var DEFAULT_PATH_ANIMATION_PROPS = {
      style: defaults$1({
        fill: true,
        stroke: true,
        strokePercent: true,
        fillOpacity: true,
        strokeOpacity: true,
        lineDashOffset: true,
        lineWidth: true,
        miterLimit: true
      }, DEFAULT_COMMON_ANIMATION_PROPS.style)
    };
    var pathCopyParams = TRANSFORMABLE_PROPS.concat([
      "invisible",
      "culling",
      "z",
      "z2",
      "zlevel",
      "parent"
    ]);
    var Path = function(_super) {
      __extends$1(Path2, _super);
      function Path2(opts) {
        return _super.call(this, opts) || this;
      }
      Path2.prototype.update = function() {
        var _this = this;
        _super.prototype.update.call(this);
        var style = this.style;
        if (style.decal) {
          var decalEl = this._decalEl = this._decalEl || new Path2();
          if (decalEl.buildPath === Path2.prototype.buildPath) {
            decalEl.buildPath = function(ctx) {
              _this.buildPath(ctx, _this.shape);
            };
          }
          decalEl.silent = true;
          var decalElStyle = decalEl.style;
          for (var key in style) {
            if (decalElStyle[key] !== style[key]) {
              decalElStyle[key] = style[key];
            }
          }
          decalElStyle.fill = style.fill ? style.decal : null;
          decalElStyle.decal = null;
          decalElStyle.shadowColor = null;
          style.strokeFirst && (decalElStyle.stroke = null);
          for (var i2 = 0; i2 < pathCopyParams.length; ++i2) {
            decalEl[pathCopyParams[i2]] = this[pathCopyParams[i2]];
          }
          decalEl.__dirty |= REDRAW_BIT;
        } else if (this._decalEl) {
          this._decalEl = null;
        }
      };
      Path2.prototype.getDecalElement = function() {
        return this._decalEl;
      };
      Path2.prototype._init = function(props2) {
        var keysArr = keys$1(props2);
        this.shape = this.getDefaultShape();
        var defaultStyle = this.getDefaultStyle();
        if (defaultStyle) {
          this.useStyle(defaultStyle);
        }
        for (var i2 = 0; i2 < keysArr.length; i2++) {
          var key = keysArr[i2];
          var value = props2[key];
          if (key === "style") {
            if (!this.style) {
              this.useStyle(value);
            } else {
              extend$1(this.style, value);
            }
          } else if (key === "shape") {
            extend$1(this.shape, value);
          } else {
            _super.prototype.attrKV.call(this, key, value);
          }
        }
        if (!this.style) {
          this.useStyle({});
        }
      };
      Path2.prototype.getDefaultStyle = function() {
        return null;
      };
      Path2.prototype.getDefaultShape = function() {
        return {};
      };
      Path2.prototype.canBeInsideText = function() {
        return this.hasFill();
      };
      Path2.prototype.getInsideTextFill = function() {
        var pathFill = this.style.fill;
        if (pathFill !== "none") {
          if (isString$1(pathFill)) {
            var fillLum = lum(pathFill, 0);
            if (fillLum > 0.5) {
              return DARK_LABEL_COLOR;
            } else if (fillLum > 0.2) {
              return LIGHTER_LABEL_COLOR;
            }
            return LIGHT_LABEL_COLOR;
          } else if (pathFill) {
            return LIGHT_LABEL_COLOR;
          }
        }
        return DARK_LABEL_COLOR;
      };
      Path2.prototype.getInsideTextStroke = function(textFill) {
        var pathFill = this.style.fill;
        if (isString$1(pathFill)) {
          var zr = this.__zr;
          var isDarkMode2 = !!(zr && zr.isDarkMode());
          var isDarkLabel = lum(textFill, 0) < DARK_MODE_THRESHOLD;
          if (isDarkMode2 === isDarkLabel) {
            return pathFill;
          }
        }
      };
      Path2.prototype.buildPath = function(ctx, shapeCfg, inBatch) {
      };
      Path2.prototype.pathUpdated = function() {
        this.__dirty &= -5;
      };
      Path2.prototype.getUpdatedPathProxy = function(inBatch) {
        !this.path && this.createPathProxy();
        this.path.beginPath();
        this.buildPath(this.path, this.shape, inBatch);
        return this.path;
      };
      Path2.prototype.createPathProxy = function() {
        this.path = new PathProxy(false);
      };
      Path2.prototype.hasStroke = function() {
        var style = this.style;
        var stroke = style.stroke;
        return !(stroke == null || stroke === "none" || !(style.lineWidth > 0));
      };
      Path2.prototype.hasFill = function() {
        var style = this.style;
        var fill2 = style.fill;
        return fill2 != null && fill2 !== "none";
      };
      Path2.prototype.getBoundingRect = function() {
        var rect = this._rect;
        var style = this.style;
        var needsUpdateRect = !rect;
        if (needsUpdateRect) {
          var firstInvoke = false;
          if (!this.path) {
            firstInvoke = true;
            this.createPathProxy();
          }
          var path = this.path;
          if (firstInvoke || this.__dirty & SHAPE_CHANGED_BIT) {
            path.beginPath();
            this.buildPath(path, this.shape, false);
            this.pathUpdated();
          }
          rect = path.getBoundingRect();
        }
        this._rect = rect;
        if (this.hasStroke() && this.path && this.path.len() > 0) {
          var rectStroke = this._rectStroke || (this._rectStroke = rect.clone());
          if (this.__dirty || needsUpdateRect) {
            rectStroke.copy(rect);
            var lineScale = style.strokeNoScale ? this.getLineScale() : 1;
            var w2 = style.lineWidth;
            if (!this.hasFill()) {
              var strokeContainThreshold = this.strokeContainThreshold;
              w2 = Math.max(w2, strokeContainThreshold == null ? 4 : strokeContainThreshold);
            }
            if (lineScale > 1e-10) {
              rectStroke.width += w2 / lineScale;
              rectStroke.height += w2 / lineScale;
              rectStroke.x -= w2 / lineScale / 2;
              rectStroke.y -= w2 / lineScale / 2;
            }
          }
          return rectStroke;
        }
        return rect;
      };
      Path2.prototype.contain = function(x2, y) {
        var localPos = this.transformCoordToLocal(x2, y);
        var rect = this.getBoundingRect();
        var style = this.style;
        x2 = localPos[0];
        y = localPos[1];
        if (rect.contain(x2, y)) {
          var pathProxy = this.path;
          if (this.hasStroke()) {
            var lineWidth = style.lineWidth;
            var lineScale = style.strokeNoScale ? this.getLineScale() : 1;
            if (lineScale > 1e-10) {
              if (!this.hasFill()) {
                lineWidth = Math.max(lineWidth, this.strokeContainThreshold);
              }
              if (containStroke(pathProxy, lineWidth / lineScale, x2, y)) {
                return true;
              }
            }
          }
          if (this.hasFill()) {
            return contain$2(pathProxy, x2, y);
          }
        }
        return false;
      };
      Path2.prototype.dirtyShape = function() {
        this.__dirty |= SHAPE_CHANGED_BIT;
        if (this._rect) {
          this._rect = null;
        }
        if (this._decalEl) {
          this._decalEl.dirtyShape();
        }
        this.markRedraw();
      };
      Path2.prototype.dirty = function() {
        this.dirtyStyle();
        this.dirtyShape();
      };
      Path2.prototype.animateShape = function(loop) {
        return this.animate("shape", loop);
      };
      Path2.prototype.updateDuringAnimation = function(targetKey) {
        if (targetKey === "style") {
          this.dirtyStyle();
        } else if (targetKey === "shape") {
          this.dirtyShape();
        } else {
          this.markRedraw();
        }
      };
      Path2.prototype.attrKV = function(key, value) {
        if (key === "shape") {
          this.setShape(value);
        } else {
          _super.prototype.attrKV.call(this, key, value);
        }
      };
      Path2.prototype.setShape = function(keyOrObj, value) {
        var shape = this.shape;
        if (!shape) {
          shape = this.shape = {};
        }
        if (typeof keyOrObj === "string") {
          shape[keyOrObj] = value;
        } else {
          extend$1(shape, keyOrObj);
        }
        this.dirtyShape();
        return this;
      };
      Path2.prototype.shapeChanged = function() {
        return !!(this.__dirty & SHAPE_CHANGED_BIT);
      };
      Path2.prototype.createStyle = function(obj) {
        return createObject(DEFAULT_PATH_STYLE, obj);
      };
      Path2.prototype._innerSaveToNormal = function(toState) {
        _super.prototype._innerSaveToNormal.call(this, toState);
        var normalState = this._normalState;
        if (toState.shape && !normalState.shape) {
          normalState.shape = extend$1({}, this.shape);
        }
      };
      Path2.prototype._applyStateObj = function(stateName, state, normalState, keepCurrentStates, transition, animationCfg) {
        _super.prototype._applyStateObj.call(this, stateName, state, normalState, keepCurrentStates, transition, animationCfg);
        var needsRestoreToNormal = !(state && keepCurrentStates);
        var targetShape;
        if (state && state.shape) {
          if (transition) {
            if (keepCurrentStates) {
              targetShape = state.shape;
            } else {
              targetShape = extend$1({}, normalState.shape);
              extend$1(targetShape, state.shape);
            }
          } else {
            targetShape = extend$1({}, keepCurrentStates ? this.shape : normalState.shape);
            extend$1(targetShape, state.shape);
          }
        } else if (needsRestoreToNormal) {
          targetShape = normalState.shape;
        }
        if (targetShape) {
          if (transition) {
            this.shape = extend$1({}, this.shape);
            var targetShapePrimaryProps = {};
            var shapeKeys = keys$1(targetShape);
            for (var i2 = 0; i2 < shapeKeys.length; i2++) {
              var key = shapeKeys[i2];
              if (typeof targetShape[key] === "object") {
                this.shape[key] = targetShape[key];
              } else {
                targetShapePrimaryProps[key] = targetShape[key];
              }
            }
            this._transitionState(stateName, {
              shape: targetShapePrimaryProps
            }, animationCfg);
          } else {
            this.shape = targetShape;
            this.dirtyShape();
          }
        }
      };
      Path2.prototype._mergeStates = function(states) {
        var mergedState = _super.prototype._mergeStates.call(this, states);
        var mergedShape;
        for (var i2 = 0; i2 < states.length; i2++) {
          var state = states[i2];
          if (state.shape) {
            mergedShape = mergedShape || {};
            this._mergeStyle(mergedShape, state.shape);
          }
        }
        if (mergedShape) {
          mergedState.shape = mergedShape;
        }
        return mergedState;
      };
      Path2.prototype.getAnimationStyleProps = function() {
        return DEFAULT_PATH_ANIMATION_PROPS;
      };
      Path2.prototype.isZeroArea = function() {
        return false;
      };
      Path2.extend = function(defaultProps2) {
        var Sub = function(_super2) {
          __extends$1(Sub2, _super2);
          function Sub2(opts) {
            var _this = _super2.call(this, opts) || this;
            defaultProps2.init && defaultProps2.init.call(_this, opts);
            return _this;
          }
          Sub2.prototype.getDefaultStyle = function() {
            return clone$4(defaultProps2.style);
          };
          Sub2.prototype.getDefaultShape = function() {
            return clone$4(defaultProps2.shape);
          };
          return Sub2;
        }(Path2);
        for (var key in defaultProps2) {
          if (typeof defaultProps2[key] === "function") {
            Sub.prototype[key] = defaultProps2[key];
          }
        }
        return Sub;
      };
      Path2.initDefaultProps = function() {
        var pathProto = Path2.prototype;
        pathProto.type = "path";
        pathProto.strokeContainThreshold = 5;
        pathProto.segmentIgnoreThreshold = 0;
        pathProto.subPixelOptimize = false;
        pathProto.autoBatch = false;
        pathProto.__dirty = REDRAW_BIT | STYLE_CHANGED_BIT | SHAPE_CHANGED_BIT;
      }();
      return Path2;
    }(Displayable);
    var DEFAULT_TSPAN_STYLE = defaults$1({
      strokeFirst: true,
      font: DEFAULT_FONT,
      x: 0,
      y: 0,
      textAlign: "left",
      textBaseline: "top",
      miterLimit: 2
    }, DEFAULT_PATH_STYLE);
    var TSpan = function(_super) {
      __extends$1(TSpan2, _super);
      function TSpan2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      TSpan2.prototype.hasStroke = function() {
        var style = this.style;
        var stroke = style.stroke;
        return stroke != null && stroke !== "none" && style.lineWidth > 0;
      };
      TSpan2.prototype.hasFill = function() {
        var style = this.style;
        var fill2 = style.fill;
        return fill2 != null && fill2 !== "none";
      };
      TSpan2.prototype.createStyle = function(obj) {
        return createObject(DEFAULT_TSPAN_STYLE, obj);
      };
      TSpan2.prototype.setBoundingRect = function(rect) {
        this._rect = rect;
      };
      TSpan2.prototype.getBoundingRect = function() {
        var style = this.style;
        if (!this._rect) {
          var text = style.text;
          text != null ? text += "" : text = "";
          var rect = getBoundingRect(text, style.font, style.textAlign, style.textBaseline);
          rect.x += style.x || 0;
          rect.y += style.y || 0;
          if (this.hasStroke()) {
            var w2 = style.lineWidth;
            rect.x -= w2 / 2;
            rect.y -= w2 / 2;
            rect.width += w2;
            rect.height += w2;
          }
          this._rect = rect;
        }
        return this._rect;
      };
      TSpan2.initDefaultProps = function() {
        var tspanProto = TSpan2.prototype;
        tspanProto.dirtyRectTolerance = 10;
      }();
      return TSpan2;
    }(Displayable);
    TSpan.prototype.type = "tspan";
    var DEFAULT_IMAGE_STYLE = defaults$1({
      x: 0,
      y: 0
    }, DEFAULT_COMMON_STYLE);
    var DEFAULT_IMAGE_ANIMATION_PROPS = {
      style: defaults$1({
        x: true,
        y: true,
        width: true,
        height: true,
        sx: true,
        sy: true,
        sWidth: true,
        sHeight: true
      }, DEFAULT_COMMON_ANIMATION_PROPS.style)
    };
    function isImageLike$1(source) {
      return !!(source && typeof source !== "string" && source.width && source.height);
    }
    var ZRImage = function(_super) {
      __extends$1(ZRImage2, _super);
      function ZRImage2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      ZRImage2.prototype.createStyle = function(obj) {
        return createObject(DEFAULT_IMAGE_STYLE, obj);
      };
      ZRImage2.prototype._getSize = function(dim) {
        var style = this.style;
        var size = style[dim];
        if (size != null) {
          return size;
        }
        var imageSource = isImageLike$1(style.image) ? style.image : this.__image;
        if (!imageSource) {
          return 0;
        }
        var otherDim = dim === "width" ? "height" : "width";
        var otherDimSize = style[otherDim];
        if (otherDimSize == null) {
          return imageSource[dim];
        } else {
          return imageSource[dim] / imageSource[otherDim] * otherDimSize;
        }
      };
      ZRImage2.prototype.getWidth = function() {
        return this._getSize("width");
      };
      ZRImage2.prototype.getHeight = function() {
        return this._getSize("height");
      };
      ZRImage2.prototype.getAnimationStyleProps = function() {
        return DEFAULT_IMAGE_ANIMATION_PROPS;
      };
      ZRImage2.prototype.getBoundingRect = function() {
        var style = this.style;
        if (!this._rect) {
          this._rect = new BoundingRect(style.x || 0, style.y || 0, this.getWidth(), this.getHeight());
        }
        return this._rect;
      };
      return ZRImage2;
    }(Displayable);
    ZRImage.prototype.type = "image";
    function buildPath$2(ctx, shape) {
      var x2 = shape.x;
      var y = shape.y;
      var width = shape.width;
      var height = shape.height;
      var r = shape.r;
      var r1;
      var r2;
      var r3;
      var r4;
      if (width < 0) {
        x2 = x2 + width;
        width = -width;
      }
      if (height < 0) {
        y = y + height;
        height = -height;
      }
      if (typeof r === "number") {
        r1 = r2 = r3 = r4 = r;
      } else if (r instanceof Array) {
        if (r.length === 1) {
          r1 = r2 = r3 = r4 = r[0];
        } else if (r.length === 2) {
          r1 = r3 = r[0];
          r2 = r4 = r[1];
        } else if (r.length === 3) {
          r1 = r[0];
          r2 = r4 = r[1];
          r3 = r[2];
        } else {
          r1 = r[0];
          r2 = r[1];
          r3 = r[2];
          r4 = r[3];
        }
      } else {
        r1 = r2 = r3 = r4 = 0;
      }
      var total2;
      if (r1 + r2 > width) {
        total2 = r1 + r2;
        r1 *= width / total2;
        r2 *= width / total2;
      }
      if (r3 + r4 > width) {
        total2 = r3 + r4;
        r3 *= width / total2;
        r4 *= width / total2;
      }
      if (r2 + r3 > height) {
        total2 = r2 + r3;
        r2 *= height / total2;
        r3 *= height / total2;
      }
      if (r1 + r4 > height) {
        total2 = r1 + r4;
        r1 *= height / total2;
        r4 *= height / total2;
      }
      ctx.moveTo(x2 + r1, y);
      ctx.lineTo(x2 + width - r2, y);
      r2 !== 0 && ctx.arc(x2 + width - r2, y + r2, r2, -Math.PI / 2, 0);
      ctx.lineTo(x2 + width, y + height - r3);
      r3 !== 0 && ctx.arc(x2 + width - r3, y + height - r3, r3, 0, Math.PI / 2);
      ctx.lineTo(x2 + r4, y + height);
      r4 !== 0 && ctx.arc(x2 + r4, y + height - r4, r4, Math.PI / 2, Math.PI);
      ctx.lineTo(x2, y + r1);
      r1 !== 0 && ctx.arc(x2 + r1, y + r1, r1, Math.PI, Math.PI * 1.5);
    }
    var round$2 = Math.round;
    function subPixelOptimizeLine$1(outputShape, inputShape, style) {
      if (!inputShape) {
        return;
      }
      var x1 = inputShape.x1;
      var x2 = inputShape.x2;
      var y1 = inputShape.y1;
      var y2 = inputShape.y2;
      outputShape.x1 = x1;
      outputShape.x2 = x2;
      outputShape.y1 = y1;
      outputShape.y2 = y2;
      var lineWidth = style && style.lineWidth;
      if (!lineWidth) {
        return outputShape;
      }
      if (round$2(x1 * 2) === round$2(x2 * 2)) {
        outputShape.x1 = outputShape.x2 = subPixelOptimize$1(x1, lineWidth, true);
      }
      if (round$2(y1 * 2) === round$2(y2 * 2)) {
        outputShape.y1 = outputShape.y2 = subPixelOptimize$1(y1, lineWidth, true);
      }
      return outputShape;
    }
    function subPixelOptimizeRect$1(outputShape, inputShape, style) {
      if (!inputShape) {
        return;
      }
      var originX = inputShape.x;
      var originY = inputShape.y;
      var originWidth = inputShape.width;
      var originHeight = inputShape.height;
      outputShape.x = originX;
      outputShape.y = originY;
      outputShape.width = originWidth;
      outputShape.height = originHeight;
      var lineWidth = style && style.lineWidth;
      if (!lineWidth) {
        return outputShape;
      }
      outputShape.x = subPixelOptimize$1(originX, lineWidth, true);
      outputShape.y = subPixelOptimize$1(originY, lineWidth, true);
      outputShape.width = Math.max(subPixelOptimize$1(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);
      outputShape.height = Math.max(subPixelOptimize$1(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);
      return outputShape;
    }
    function subPixelOptimize$1(position2, lineWidth, positiveOrNegative) {
      if (!lineWidth) {
        return position2;
      }
      var doubledPosition = round$2(position2 * 2);
      return (doubledPosition + round$2(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
    }
    var RectShape = /* @__PURE__ */ function() {
      function RectShape2() {
        this.x = 0;
        this.y = 0;
        this.width = 0;
        this.height = 0;
      }
      return RectShape2;
    }();
    var subPixelOptimizeOutputShape$1 = {};
    var Rect$2 = function(_super) {
      __extends$1(Rect2, _super);
      function Rect2(opts) {
        return _super.call(this, opts) || this;
      }
      Rect2.prototype.getDefaultShape = function() {
        return new RectShape();
      };
      Rect2.prototype.buildPath = function(ctx, shape) {
        var x2;
        var y;
        var width;
        var height;
        if (this.subPixelOptimize) {
          var optimizedShape = subPixelOptimizeRect$1(subPixelOptimizeOutputShape$1, shape, this.style);
          x2 = optimizedShape.x;
          y = optimizedShape.y;
          width = optimizedShape.width;
          height = optimizedShape.height;
          optimizedShape.r = shape.r;
          shape = optimizedShape;
        } else {
          x2 = shape.x;
          y = shape.y;
          width = shape.width;
          height = shape.height;
        }
        if (!shape.r) {
          ctx.rect(x2, y, width, height);
        } else {
          buildPath$2(ctx, shape);
        }
      };
      Rect2.prototype.isZeroArea = function() {
        return !this.shape.width || !this.shape.height;
      };
      return Rect2;
    }(Path);
    Rect$2.prototype.type = "rect";
    var DEFAULT_RICH_TEXT_COLOR = {
      fill: "#000"
    };
    var DEFAULT_STROKE_LINE_WIDTH = 2;
    var DEFAULT_TEXT_ANIMATION_PROPS = {
      style: defaults$1({
        fill: true,
        stroke: true,
        fillOpacity: true,
        strokeOpacity: true,
        lineWidth: true,
        fontSize: true,
        lineHeight: true,
        width: true,
        height: true,
        textShadowColor: true,
        textShadowBlur: true,
        textShadowOffsetX: true,
        textShadowOffsetY: true,
        backgroundColor: true,
        padding: true,
        borderColor: true,
        borderWidth: true,
        borderRadius: true
      }, DEFAULT_COMMON_ANIMATION_PROPS.style)
    };
    var ZRText = function(_super) {
      __extends$1(ZRText2, _super);
      function ZRText2(opts) {
        var _this = _super.call(this) || this;
        _this.type = "text";
        _this._children = [];
        _this._defaultStyle = DEFAULT_RICH_TEXT_COLOR;
        _this.attr(opts);
        return _this;
      }
      ZRText2.prototype.childrenRef = function() {
        return this._children;
      };
      ZRText2.prototype.update = function() {
        _super.prototype.update.call(this);
        if (this.styleChanged()) {
          this._updateSubTexts();
        }
        for (var i2 = 0; i2 < this._children.length; i2++) {
          var child = this._children[i2];
          child.zlevel = this.zlevel;
          child.z = this.z;
          child.z2 = this.z2;
          child.culling = this.culling;
          child.cursor = this.cursor;
          child.invisible = this.invisible;
        }
      };
      ZRText2.prototype.updateTransform = function() {
        var innerTransformable = this.innerTransformable;
        if (innerTransformable) {
          innerTransformable.updateTransform();
          if (innerTransformable.transform) {
            this.transform = innerTransformable.transform;
          }
        } else {
          _super.prototype.updateTransform.call(this);
        }
      };
      ZRText2.prototype.getLocalTransform = function(m2) {
        var innerTransformable = this.innerTransformable;
        return innerTransformable ? innerTransformable.getLocalTransform(m2) : _super.prototype.getLocalTransform.call(this, m2);
      };
      ZRText2.prototype.getComputedTransform = function() {
        if (this.__hostTarget) {
          this.__hostTarget.getComputedTransform();
          this.__hostTarget.updateInnerText(true);
        }
        return _super.prototype.getComputedTransform.call(this);
      };
      ZRText2.prototype._updateSubTexts = function() {
        this._childCursor = 0;
        normalizeTextStyle(this.style);
        this.style.rich ? this._updateRichTexts() : this._updatePlainTexts();
        this._children.length = this._childCursor;
        this.styleUpdated();
      };
      ZRText2.prototype.addSelfToZr = function(zr) {
        _super.prototype.addSelfToZr.call(this, zr);
        for (var i2 = 0; i2 < this._children.length; i2++) {
          this._children[i2].__zr = zr;
        }
      };
      ZRText2.prototype.removeSelfFromZr = function(zr) {
        _super.prototype.removeSelfFromZr.call(this, zr);
        for (var i2 = 0; i2 < this._children.length; i2++) {
          this._children[i2].__zr = null;
        }
      };
      ZRText2.prototype.getBoundingRect = function() {
        if (this.styleChanged()) {
          this._updateSubTexts();
        }
        if (!this._rect) {
          var tmpRect2 = new BoundingRect(0, 0, 0, 0);
          var children = this._children;
          var tmpMat = [];
          var rect = null;
          for (var i2 = 0; i2 < children.length; i2++) {
            var child = children[i2];
            var childRect = child.getBoundingRect();
            var transform2 = child.getLocalTransform(tmpMat);
            if (transform2) {
              tmpRect2.copy(childRect);
              tmpRect2.applyTransform(transform2);
              rect = rect || tmpRect2.clone();
              rect.union(tmpRect2);
            } else {
              rect = rect || childRect.clone();
              rect.union(childRect);
            }
          }
          this._rect = rect || tmpRect2;
        }
        return this._rect;
      };
      ZRText2.prototype.setDefaultTextStyle = function(defaultTextStyle) {
        this._defaultStyle = defaultTextStyle || DEFAULT_RICH_TEXT_COLOR;
      };
      ZRText2.prototype.setTextContent = function(textContent) {
      };
      ZRText2.prototype._mergeStyle = function(targetStyle, sourceStyle) {
        if (!sourceStyle) {
          return targetStyle;
        }
        var sourceRich = sourceStyle.rich;
        var targetRich = targetStyle.rich || sourceRich && {};
        extend$1(targetStyle, sourceStyle);
        if (sourceRich && targetRich) {
          this._mergeRich(targetRich, sourceRich);
          targetStyle.rich = targetRich;
        } else if (targetRich) {
          targetStyle.rich = targetRich;
        }
        return targetStyle;
      };
      ZRText2.prototype._mergeRich = function(targetRich, sourceRich) {
        var richNames = keys$1(sourceRich);
        for (var i2 = 0; i2 < richNames.length; i2++) {
          var richName = richNames[i2];
          targetRich[richName] = targetRich[richName] || {};
          extend$1(targetRich[richName], sourceRich[richName]);
        }
      };
      ZRText2.prototype.getAnimationStyleProps = function() {
        return DEFAULT_TEXT_ANIMATION_PROPS;
      };
      ZRText2.prototype._getOrCreateChild = function(Ctor) {
        var child = this._children[this._childCursor];
        if (!child || !(child instanceof Ctor)) {
          child = new Ctor();
        }
        this._children[this._childCursor++] = child;
        child.__zr = this.__zr;
        child.parent = this;
        return child;
      };
      ZRText2.prototype._updatePlainTexts = function() {
        var style = this.style;
        var textFont = style.font || DEFAULT_FONT;
        var textPadding = style.padding;
        var text = getStyleText(style);
        var contentBlock = parsePlainText(text, style);
        var needDrawBg = needDrawBackground(style);
        var bgColorDrawn = !!style.backgroundColor;
        var outerHeight = contentBlock.outerHeight;
        var outerWidth = contentBlock.outerWidth;
        var contentWidth = contentBlock.contentWidth;
        var textLines = contentBlock.lines;
        var lineHeight2 = contentBlock.lineHeight;
        var defaultStyle = this._defaultStyle;
        this.isTruncated = !!contentBlock.isTruncated;
        var baseX = style.x || 0;
        var baseY = style.y || 0;
        var textAlign2 = style.align || defaultStyle.align || "left";
        var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign || "top";
        var textX = baseX;
        var textY = adjustTextY(baseY, contentBlock.contentHeight, verticalAlign);
        if (needDrawBg || textPadding) {
          var boxX = adjustTextX(baseX, outerWidth, textAlign2);
          var boxY = adjustTextY(baseY, outerHeight, verticalAlign);
          needDrawBg && this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);
        }
        textY += lineHeight2 / 2;
        if (textPadding) {
          textX = getTextXForPadding(baseX, textAlign2, textPadding);
          if (verticalAlign === "top") {
            textY += textPadding[0];
          } else if (verticalAlign === "bottom") {
            textY -= textPadding[2];
          }
        }
        var defaultLineWidth = 0;
        var useDefaultFill = false;
        var textFill = getFill("fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill));
        var textStroke = getStroke("stroke" in style ? style.stroke : !bgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null);
        var hasShadow2 = style.textShadowBlur > 0;
        var fixedBoundingRect = style.width != null && (style.overflow === "truncate" || style.overflow === "break" || style.overflow === "breakAll");
        var calculatedLineHeight = contentBlock.calculatedLineHeight;
        for (var i2 = 0; i2 < textLines.length; i2++) {
          var el = this._getOrCreateChild(TSpan);
          var subElStyle = el.createStyle();
          el.useStyle(subElStyle);
          subElStyle.text = textLines[i2];
          subElStyle.x = textX;
          subElStyle.y = textY;
          {
            subElStyle.textAlign = textAlign2;
          }
          subElStyle.textBaseline = "middle";
          subElStyle.opacity = style.opacity;
          subElStyle.strokeFirst = true;
          if (hasShadow2) {
            subElStyle.shadowBlur = style.textShadowBlur || 0;
            subElStyle.shadowColor = style.textShadowColor || "transparent";
            subElStyle.shadowOffsetX = style.textShadowOffsetX || 0;
            subElStyle.shadowOffsetY = style.textShadowOffsetY || 0;
          }
          subElStyle.stroke = textStroke;
          subElStyle.fill = textFill;
          if (textStroke) {
            subElStyle.lineWidth = style.lineWidth || defaultLineWidth;
            subElStyle.lineDash = style.lineDash;
            subElStyle.lineDashOffset = style.lineDashOffset || 0;
          }
          subElStyle.font = textFont;
          setSeparateFont(subElStyle, style);
          textY += lineHeight2;
          if (fixedBoundingRect) {
            el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, contentWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, calculatedLineHeight, subElStyle.textBaseline), contentWidth, calculatedLineHeight));
          }
        }
      };
      ZRText2.prototype._updateRichTexts = function() {
        var style = this.style;
        var text = getStyleText(style);
        var contentBlock = parseRichText(text, style);
        var contentWidth = contentBlock.width;
        var outerWidth = contentBlock.outerWidth;
        var outerHeight = contentBlock.outerHeight;
        var textPadding = style.padding;
        var baseX = style.x || 0;
        var baseY = style.y || 0;
        var defaultStyle = this._defaultStyle;
        var textAlign2 = style.align || defaultStyle.align;
        var verticalAlign = style.verticalAlign || defaultStyle.verticalAlign;
        this.isTruncated = !!contentBlock.isTruncated;
        var boxX = adjustTextX(baseX, outerWidth, textAlign2);
        var boxY = adjustTextY(baseY, outerHeight, verticalAlign);
        var xLeft = boxX;
        var lineTop = boxY;
        if (textPadding) {
          xLeft += textPadding[3];
          lineTop += textPadding[0];
        }
        var xRight = xLeft + contentWidth;
        if (needDrawBackground(style)) {
          this._renderBackground(style, style, boxX, boxY, outerWidth, outerHeight);
        }
        var bgColorDrawn = !!style.backgroundColor;
        for (var i2 = 0; i2 < contentBlock.lines.length; i2++) {
          var line = contentBlock.lines[i2];
          var tokens = line.tokens;
          var tokenCount = tokens.length;
          var lineHeight2 = line.lineHeight;
          var remainedWidth = line.width;
          var leftIndex = 0;
          var lineXLeft = xLeft;
          var lineXRight = xRight;
          var rightIndex = tokenCount - 1;
          var token = void 0;
          while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.align || token.align === "left")) {
            this._placeToken(token, style, lineHeight2, lineTop, lineXLeft, "left", bgColorDrawn);
            remainedWidth -= token.width;
            lineXLeft += token.width;
            leftIndex++;
          }
          while (rightIndex >= 0 && (token = tokens[rightIndex], token.align === "right")) {
            this._placeToken(token, style, lineHeight2, lineTop, lineXRight, "right", bgColorDrawn);
            remainedWidth -= token.width;
            lineXRight -= token.width;
            rightIndex--;
          }
          lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - remainedWidth) / 2;
          while (leftIndex <= rightIndex) {
            token = tokens[leftIndex];
            this._placeToken(token, style, lineHeight2, lineTop, lineXLeft + token.width / 2, "center", bgColorDrawn);
            lineXLeft += token.width;
            leftIndex++;
          }
          lineTop += lineHeight2;
        }
      };
      ZRText2.prototype._placeToken = function(token, style, lineHeight2, lineTop, x2, textAlign2, parentBgColorDrawn) {
        var tokenStyle = style.rich[token.styleName] || {};
        tokenStyle.text = token.text;
        var verticalAlign = token.verticalAlign;
        var y = lineTop + lineHeight2 / 2;
        if (verticalAlign === "top") {
          y = lineTop + token.height / 2;
        } else if (verticalAlign === "bottom") {
          y = lineTop + lineHeight2 - token.height / 2;
        }
        var needDrawBg = !token.isLineHolder && needDrawBackground(tokenStyle);
        needDrawBg && this._renderBackground(tokenStyle, style, textAlign2 === "right" ? x2 - token.width : textAlign2 === "center" ? x2 - token.width / 2 : x2, y - token.height / 2, token.width, token.height);
        var bgColorDrawn = !!tokenStyle.backgroundColor;
        var textPadding = token.textPadding;
        if (textPadding) {
          x2 = getTextXForPadding(x2, textAlign2, textPadding);
          y -= token.height / 2 - textPadding[0] - token.innerHeight / 2;
        }
        var el = this._getOrCreateChild(TSpan);
        var subElStyle = el.createStyle();
        el.useStyle(subElStyle);
        var defaultStyle = this._defaultStyle;
        var useDefaultFill = false;
        var defaultLineWidth = 0;
        var textFill = getFill("fill" in tokenStyle ? tokenStyle.fill : "fill" in style ? style.fill : (useDefaultFill = true, defaultStyle.fill));
        var textStroke = getStroke("stroke" in tokenStyle ? tokenStyle.stroke : "stroke" in style ? style.stroke : !bgColorDrawn && !parentBgColorDrawn && (!defaultStyle.autoStroke || useDefaultFill) ? (defaultLineWidth = DEFAULT_STROKE_LINE_WIDTH, defaultStyle.stroke) : null);
        var hasShadow2 = tokenStyle.textShadowBlur > 0 || style.textShadowBlur > 0;
        subElStyle.text = token.text;
        subElStyle.x = x2;
        subElStyle.y = y;
        if (hasShadow2) {
          subElStyle.shadowBlur = tokenStyle.textShadowBlur || style.textShadowBlur || 0;
          subElStyle.shadowColor = tokenStyle.textShadowColor || style.textShadowColor || "transparent";
          subElStyle.shadowOffsetX = tokenStyle.textShadowOffsetX || style.textShadowOffsetX || 0;
          subElStyle.shadowOffsetY = tokenStyle.textShadowOffsetY || style.textShadowOffsetY || 0;
        }
        subElStyle.textAlign = textAlign2;
        subElStyle.textBaseline = "middle";
        subElStyle.font = token.font || DEFAULT_FONT;
        subElStyle.opacity = retrieve3(tokenStyle.opacity, style.opacity, 1);
        setSeparateFont(subElStyle, tokenStyle);
        if (textStroke) {
          subElStyle.lineWidth = retrieve3(tokenStyle.lineWidth, style.lineWidth, defaultLineWidth);
          subElStyle.lineDash = retrieve2(tokenStyle.lineDash, style.lineDash);
          subElStyle.lineDashOffset = style.lineDashOffset || 0;
          subElStyle.stroke = textStroke;
        }
        if (textFill) {
          subElStyle.fill = textFill;
        }
        var textWidth = token.contentWidth;
        var textHeight = token.contentHeight;
        el.setBoundingRect(new BoundingRect(adjustTextX(subElStyle.x, textWidth, subElStyle.textAlign), adjustTextY(subElStyle.y, textHeight, subElStyle.textBaseline), textWidth, textHeight));
      };
      ZRText2.prototype._renderBackground = function(style, topStyle, x2, y, width, height) {
        var textBackgroundColor = style.backgroundColor;
        var textBorderWidth = style.borderWidth;
        var textBorderColor = style.borderColor;
        var isImageBg = textBackgroundColor && textBackgroundColor.image;
        var isPlainOrGradientBg = textBackgroundColor && !isImageBg;
        var textBorderRadius = style.borderRadius;
        var self2 = this;
        var rectEl;
        var imgEl;
        if (isPlainOrGradientBg || style.lineHeight || textBorderWidth && textBorderColor) {
          rectEl = this._getOrCreateChild(Rect$2);
          rectEl.useStyle(rectEl.createStyle());
          rectEl.style.fill = null;
          var rectShape = rectEl.shape;
          rectShape.x = x2;
          rectShape.y = y;
          rectShape.width = width;
          rectShape.height = height;
          rectShape.r = textBorderRadius;
          rectEl.dirtyShape();
        }
        if (isPlainOrGradientBg) {
          var rectStyle = rectEl.style;
          rectStyle.fill = textBackgroundColor || null;
          rectStyle.fillOpacity = retrieve2(style.fillOpacity, 1);
        } else if (isImageBg) {
          imgEl = this._getOrCreateChild(ZRImage);
          imgEl.onload = function() {
            self2.dirtyStyle();
          };
          var imgStyle = imgEl.style;
          imgStyle.image = textBackgroundColor.image;
          imgStyle.x = x2;
          imgStyle.y = y;
          imgStyle.width = width;
          imgStyle.height = height;
        }
        if (textBorderWidth && textBorderColor) {
          var rectStyle = rectEl.style;
          rectStyle.lineWidth = textBorderWidth;
          rectStyle.stroke = textBorderColor;
          rectStyle.strokeOpacity = retrieve2(style.strokeOpacity, 1);
          rectStyle.lineDash = style.borderDash;
          rectStyle.lineDashOffset = style.borderDashOffset || 0;
          rectEl.strokeContainThreshold = 0;
          if (rectEl.hasFill() && rectEl.hasStroke()) {
            rectStyle.strokeFirst = true;
            rectStyle.lineWidth *= 2;
          }
        }
        var commonStyle = (rectEl || imgEl).style;
        commonStyle.shadowBlur = style.shadowBlur || 0;
        commonStyle.shadowColor = style.shadowColor || "transparent";
        commonStyle.shadowOffsetX = style.shadowOffsetX || 0;
        commonStyle.shadowOffsetY = style.shadowOffsetY || 0;
        commonStyle.opacity = retrieve3(style.opacity, topStyle.opacity, 1);
      };
      ZRText2.makeFont = function(style) {
        var font = "";
        if (hasSeparateFont(style)) {
          font = [
            style.fontStyle,
            style.fontWeight,
            parseFontSize(style.fontSize),
            style.fontFamily || "sans-serif"
          ].join(" ");
        }
        return font && trim$2(font) || style.textFont || style.font;
      };
      return ZRText2;
    }(Displayable);
    var VALID_TEXT_ALIGN = { left: true, right: 1, center: 1 };
    var VALID_TEXT_VERTICAL_ALIGN = { top: 1, bottom: 1, middle: 1 };
    var FONT_PARTS = ["fontStyle", "fontWeight", "fontSize", "fontFamily"];
    function parseFontSize(fontSize2) {
      if (typeof fontSize2 === "string" && (fontSize2.indexOf("px") !== -1 || fontSize2.indexOf("rem") !== -1 || fontSize2.indexOf("em") !== -1)) {
        return fontSize2;
      } else if (!isNaN(+fontSize2)) {
        return fontSize2 + "px";
      } else {
        return DEFAULT_FONT_SIZE + "px";
      }
    }
    function setSeparateFont(targetStyle, sourceStyle) {
      for (var i2 = 0; i2 < FONT_PARTS.length; i2++) {
        var fontProp = FONT_PARTS[i2];
        var val = sourceStyle[fontProp];
        if (val != null) {
          targetStyle[fontProp] = val;
        }
      }
    }
    function hasSeparateFont(style) {
      return style.fontSize != null || style.fontFamily || style.fontWeight;
    }
    function normalizeTextStyle(style) {
      normalizeStyle(style);
      each$f(style.rich, normalizeStyle);
      return style;
    }
    function normalizeStyle(style) {
      if (style) {
        style.font = ZRText.makeFont(style);
        var textAlign2 = style.align;
        textAlign2 === "middle" && (textAlign2 = "center");
        style.align = textAlign2 == null || VALID_TEXT_ALIGN[textAlign2] ? textAlign2 : "left";
        var verticalAlign = style.verticalAlign;
        verticalAlign === "center" && (verticalAlign = "middle");
        style.verticalAlign = verticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[verticalAlign] ? verticalAlign : "top";
        var textPadding = style.padding;
        if (textPadding) {
          style.padding = normalizeCssArray$1(style.padding);
        }
      }
    }
    function getStroke(stroke, lineWidth) {
      return stroke == null || lineWidth <= 0 || stroke === "transparent" || stroke === "none" ? null : stroke.image || stroke.colorStops ? "#000" : stroke;
    }
    function getFill(fill2) {
      return fill2 == null || fill2 === "none" ? null : fill2.image || fill2.colorStops ? "#000" : fill2;
    }
    function getTextXForPadding(x2, textAlign2, textPadding) {
      return textAlign2 === "right" ? x2 - textPadding[1] : textAlign2 === "center" ? x2 + textPadding[3] / 2 - textPadding[1] / 2 : x2 + textPadding[3];
    }
    function getStyleText(style) {
      var text = style.text;
      text != null && (text += "");
      return text;
    }
    function needDrawBackground(style) {
      return !!(style.backgroundColor || style.lineHeight || style.borderWidth && style.borderColor);
    }
    var getECData = makeInner();
    var setCommonECData = function(seriesIndex, dataType2, dataIdx, el) {
      if (el) {
        var ecData = getECData(el);
        ecData.dataIndex = dataIdx;
        ecData.dataType = dataType2;
        ecData.seriesIndex = seriesIndex;
        ecData.ssrType = "chart";
        if (el.type === "group") {
          el.traverse(function(child) {
            var childECData = getECData(child);
            childECData.seriesIndex = seriesIndex;
            childECData.dataIndex = dataIdx;
            childECData.dataType = dataType2;
            childECData.ssrType = "chart";
          });
        }
      }
    };
    var _highlightNextDigit = 1;
    var _highlightKeyMap = {};
    var getSavedStates = makeInner();
    var getComponentStates = makeInner();
    var HOVER_STATE_NORMAL = 0;
    var HOVER_STATE_BLUR = 1;
    var HOVER_STATE_EMPHASIS = 2;
    var SPECIAL_STATES = ["emphasis", "blur", "select"];
    var DISPLAY_STATES = ["normal", "emphasis", "blur", "select"];
    var Z2_EMPHASIS_LIFT = 10;
    var Z2_SELECT_LIFT = 9;
    var HIGHLIGHT_ACTION_TYPE = "highlight";
    var DOWNPLAY_ACTION_TYPE = "downplay";
    var SELECT_ACTION_TYPE = "select";
    var UNSELECT_ACTION_TYPE = "unselect";
    var TOGGLE_SELECT_ACTION_TYPE = "toggleSelect";
    function hasFillOrStroke(fillOrStroke) {
      return fillOrStroke != null && fillOrStroke !== "none";
    }
    function doChangeHoverState(el, stateName, hoverStateEnum) {
      if (el.onHoverStateChange && (el.hoverState || 0) !== hoverStateEnum) {
        el.onHoverStateChange(stateName);
      }
      el.hoverState = hoverStateEnum;
    }
    function singleEnterEmphasis(el) {
      doChangeHoverState(el, "emphasis", HOVER_STATE_EMPHASIS);
    }
    function singleLeaveEmphasis(el) {
      if (el.hoverState === HOVER_STATE_EMPHASIS) {
        doChangeHoverState(el, "normal", HOVER_STATE_NORMAL);
      }
    }
    function singleEnterBlur(el) {
      doChangeHoverState(el, "blur", HOVER_STATE_BLUR);
    }
    function singleLeaveBlur(el) {
      if (el.hoverState === HOVER_STATE_BLUR) {
        doChangeHoverState(el, "normal", HOVER_STATE_NORMAL);
      }
    }
    function singleEnterSelect(el) {
      el.selected = true;
    }
    function singleLeaveSelect(el) {
      el.selected = false;
    }
    function updateElementState(el, updater, commonParam) {
      updater(el, commonParam);
    }
    function traverseUpdateState(el, updater, commonParam) {
      updateElementState(el, updater, commonParam);
      el.isGroup && el.traverse(function(child) {
        updateElementState(child, updater, commonParam);
      });
    }
    function setStatesFlag(el, stateName) {
      switch (stateName) {
        case "emphasis":
          el.hoverState = HOVER_STATE_EMPHASIS;
          break;
        case "normal":
          el.hoverState = HOVER_STATE_NORMAL;
          break;
        case "blur":
          el.hoverState = HOVER_STATE_BLUR;
          break;
        case "select":
          el.selected = true;
      }
    }
    function getFromStateStyle(el, props2, toStateName, defaultValue) {
      var style = el.style;
      var fromState = {};
      for (var i2 = 0; i2 < props2.length; i2++) {
        var propName = props2[i2];
        var val = style[propName];
        fromState[propName] = val == null ? defaultValue && defaultValue[propName] : val;
      }
      for (var i2 = 0; i2 < el.animators.length; i2++) {
        var animator = el.animators[i2];
        if (animator.__fromStateTransition && animator.__fromStateTransition.indexOf(toStateName) < 0 && animator.targetName === "style") {
          animator.saveTo(fromState, props2);
        }
      }
      return fromState;
    }
    function createEmphasisDefaultState(el, stateName, targetStates, state) {
      var hasSelect = targetStates && indexOf(targetStates, "select") >= 0;
      var cloned = false;
      if (el instanceof Path) {
        var store2 = getSavedStates(el);
        var fromFill = hasSelect ? store2.selectFill || store2.normalFill : store2.normalFill;
        var fromStroke = hasSelect ? store2.selectStroke || store2.normalStroke : store2.normalStroke;
        if (hasFillOrStroke(fromFill) || hasFillOrStroke(fromStroke)) {
          state = state || {};
          var emphasisStyle = state.style || {};
          if (emphasisStyle.fill === "inherit") {
            cloned = true;
            state = extend$1({}, state);
            emphasisStyle = extend$1({}, emphasisStyle);
            emphasisStyle.fill = fromFill;
          } else if (!hasFillOrStroke(emphasisStyle.fill) && hasFillOrStroke(fromFill)) {
            cloned = true;
            state = extend$1({}, state);
            emphasisStyle = extend$1({}, emphasisStyle);
            emphasisStyle.fill = liftColor(fromFill);
          } else if (!hasFillOrStroke(emphasisStyle.stroke) && hasFillOrStroke(fromStroke)) {
            if (!cloned) {
              state = extend$1({}, state);
              emphasisStyle = extend$1({}, emphasisStyle);
            }
            emphasisStyle.stroke = liftColor(fromStroke);
          }
          state.style = emphasisStyle;
        }
      }
      if (state) {
        if (state.z2 == null) {
          if (!cloned) {
            state = extend$1({}, state);
          }
          var z2EmphasisLift = el.z2EmphasisLift;
          state.z2 = el.z2 + (z2EmphasisLift != null ? z2EmphasisLift : Z2_EMPHASIS_LIFT);
        }
      }
      return state;
    }
    function createSelectDefaultState(el, stateName, state) {
      if (state) {
        if (state.z2 == null) {
          state = extend$1({}, state);
          var z2SelectLift = el.z2SelectLift;
          state.z2 = el.z2 + (z2SelectLift != null ? z2SelectLift : Z2_SELECT_LIFT);
        }
      }
      return state;
    }
    function createBlurDefaultState(el, stateName, state) {
      var hasBlur = indexOf(el.currentStates, stateName) >= 0;
      var currentOpacity = el.style.opacity;
      var fromState = !hasBlur ? getFromStateStyle(el, ["opacity"], stateName, {
        opacity: 1
      }) : null;
      state = state || {};
      var blurStyle = state.style || {};
      if (blurStyle.opacity == null) {
        state = extend$1({}, state);
        blurStyle = extend$1({
          // Already being applied 'emphasis'. DON'T mul opacity multiple times.
          opacity: hasBlur ? currentOpacity : fromState.opacity * 0.1
        }, blurStyle);
        state.style = blurStyle;
      }
      return state;
    }
    function elementStateProxy(stateName, targetStates) {
      var state = this.states[stateName];
      if (this.style) {
        if (stateName === "emphasis") {
          return createEmphasisDefaultState(this, stateName, targetStates, state);
        } else if (stateName === "blur") {
          return createBlurDefaultState(this, stateName, state);
        } else if (stateName === "select") {
          return createSelectDefaultState(this, stateName, state);
        }
      }
      return state;
    }
    function setDefaultStateProxy(el) {
      el.stateProxy = elementStateProxy;
      var textContent = el.getTextContent();
      var textGuide = el.getTextGuideLine();
      if (textContent) {
        textContent.stateProxy = elementStateProxy;
      }
      if (textGuide) {
        textGuide.stateProxy = elementStateProxy;
      }
    }
    function enterEmphasisWhenMouseOver(el, e2) {
      !shouldSilent(el, e2) && !el.__highByOuter && traverseUpdateState(el, singleEnterEmphasis);
    }
    function leaveEmphasisWhenMouseOut(el, e2) {
      !shouldSilent(el, e2) && !el.__highByOuter && traverseUpdateState(el, singleLeaveEmphasis);
    }
    function enterEmphasis(el, highlightDigit) {
      el.__highByOuter |= 1 << (highlightDigit || 0);
      traverseUpdateState(el, singleEnterEmphasis);
    }
    function leaveEmphasis(el, highlightDigit) {
      !(el.__highByOuter &= ~(1 << (highlightDigit || 0))) && traverseUpdateState(el, singleLeaveEmphasis);
    }
    function enterBlur(el) {
      traverseUpdateState(el, singleEnterBlur);
    }
    function leaveBlur(el) {
      traverseUpdateState(el, singleLeaveBlur);
    }
    function enterSelect(el) {
      traverseUpdateState(el, singleEnterSelect);
    }
    function leaveSelect(el) {
      traverseUpdateState(el, singleLeaveSelect);
    }
    function shouldSilent(el, e2) {
      return el.__highDownSilentOnTouch && e2.zrByTouch;
    }
    function allLeaveBlur(api2) {
      var model = api2.getModel();
      var leaveBlurredSeries = [];
      var allComponentViews = [];
      model.eachComponent(function(componentType, componentModel) {
        var componentStates = getComponentStates(componentModel);
        var isSeries2 = componentType === "series";
        var view = isSeries2 ? api2.getViewOfSeriesModel(componentModel) : api2.getViewOfComponentModel(componentModel);
        !isSeries2 && allComponentViews.push(view);
        if (componentStates.isBlured) {
          view.group.traverse(function(child) {
            singleLeaveBlur(child);
          });
          isSeries2 && leaveBlurredSeries.push(componentModel);
        }
        componentStates.isBlured = false;
      });
      each$f(allComponentViews, function(view) {
        if (view && view.toggleBlurSeries) {
          view.toggleBlurSeries(leaveBlurredSeries, false, model);
        }
      });
    }
    function blurSeries(targetSeriesIndex, focus, blurScope, api2) {
      var ecModel = api2.getModel();
      blurScope = blurScope || "coordinateSystem";
      function leaveBlurOfIndices(data, dataIndices) {
        for (var i2 = 0; i2 < dataIndices.length; i2++) {
          var itemEl = data.getItemGraphicEl(dataIndices[i2]);
          itemEl && leaveBlur(itemEl);
        }
      }
      if (targetSeriesIndex == null) {
        return;
      }
      if (!focus || focus === "none") {
        return;
      }
      var targetSeriesModel = ecModel.getSeriesByIndex(targetSeriesIndex);
      var targetCoordSys = targetSeriesModel.coordinateSystem;
      if (targetCoordSys && targetCoordSys.master) {
        targetCoordSys = targetCoordSys.master;
      }
      var blurredSeries = [];
      ecModel.eachSeries(function(seriesModel) {
        var sameSeries = targetSeriesModel === seriesModel;
        var coordSys = seriesModel.coordinateSystem;
        if (coordSys && coordSys.master) {
          coordSys = coordSys.master;
        }
        var sameCoordSys = coordSys && targetCoordSys ? coordSys === targetCoordSys : sameSeries;
        if (!// Not blur other series if blurScope series
        (blurScope === "series" && !sameSeries || blurScope === "coordinateSystem" && !sameCoordSys || focus === "series" && sameSeries)) {
          var view = api2.getViewOfSeriesModel(seriesModel);
          view.group.traverse(function(child) {
            if (child.__highByOuter && sameSeries && focus === "self") {
              return;
            }
            singleEnterBlur(child);
          });
          if (isArrayLike(focus)) {
            leaveBlurOfIndices(seriesModel.getData(), focus);
          } else if (isObject$5(focus)) {
            var dataTypes = keys$1(focus);
            for (var d2 = 0; d2 < dataTypes.length; d2++) {
              leaveBlurOfIndices(seriesModel.getData(dataTypes[d2]), focus[dataTypes[d2]]);
            }
          }
          blurredSeries.push(seriesModel);
          getComponentStates(seriesModel).isBlured = true;
        }
      });
      ecModel.eachComponent(function(componentType, componentModel) {
        if (componentType === "series") {
          return;
        }
        var view = api2.getViewOfComponentModel(componentModel);
        if (view && view.toggleBlurSeries) {
          view.toggleBlurSeries(blurredSeries, true, ecModel);
        }
      });
    }
    function blurComponent(componentMainType, componentIndex, api2) {
      if (componentMainType == null || componentIndex == null) {
        return;
      }
      var componentModel = api2.getModel().getComponent(componentMainType, componentIndex);
      if (!componentModel) {
        return;
      }
      getComponentStates(componentModel).isBlured = true;
      var view = api2.getViewOfComponentModel(componentModel);
      if (!view || !view.focusBlurEnabled) {
        return;
      }
      view.group.traverse(function(child) {
        singleEnterBlur(child);
      });
    }
    function blurSeriesFromHighlightPayload(seriesModel, payload, api2) {
      var seriesIndex = seriesModel.seriesIndex;
      var data = seriesModel.getData(payload.dataType);
      if (!data) {
        return;
      }
      var dataIndex = queryDataIndex(data, payload);
      dataIndex = (isArray$2(dataIndex) ? dataIndex[0] : dataIndex) || 0;
      var el = data.getItemGraphicEl(dataIndex);
      if (!el) {
        var count2 = data.count();
        var current = 0;
        while (!el && current < count2) {
          el = data.getItemGraphicEl(current++);
        }
      }
      if (el) {
        var ecData = getECData(el);
        blurSeries(seriesIndex, ecData.focus, ecData.blurScope, api2);
      } else {
        var focus_1 = seriesModel.get(["emphasis", "focus"]);
        var blurScope = seriesModel.get(["emphasis", "blurScope"]);
        if (focus_1 != null) {
          blurSeries(seriesIndex, focus_1, blurScope, api2);
        }
      }
    }
    function findComponentHighDownDispatchers(componentMainType, componentIndex, name, api2) {
      var ret = {
        focusSelf: false,
        dispatchers: null
      };
      if (componentMainType == null || componentMainType === "series" || componentIndex == null || name == null) {
        return ret;
      }
      var componentModel = api2.getModel().getComponent(componentMainType, componentIndex);
      if (!componentModel) {
        return ret;
      }
      var view = api2.getViewOfComponentModel(componentModel);
      if (!view || !view.findHighDownDispatchers) {
        return ret;
      }
      var dispatchers = view.findHighDownDispatchers(name);
      var focusSelf;
      for (var i2 = 0; i2 < dispatchers.length; i2++) {
        if (getECData(dispatchers[i2]).focus === "self") {
          focusSelf = true;
          break;
        }
      }
      return {
        focusSelf,
        dispatchers
      };
    }
    function handleGlobalMouseOverForHighDown(dispatcher, e2, api2) {
      var ecData = getECData(dispatcher);
      var _a2 = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api2), dispatchers = _a2.dispatchers, focusSelf = _a2.focusSelf;
      if (dispatchers) {
        if (focusSelf) {
          blurComponent(ecData.componentMainType, ecData.componentIndex, api2);
        }
        each$f(dispatchers, function(dispatcher2) {
          return enterEmphasisWhenMouseOver(dispatcher2, e2);
        });
      } else {
        blurSeries(ecData.seriesIndex, ecData.focus, ecData.blurScope, api2);
        if (ecData.focus === "self") {
          blurComponent(ecData.componentMainType, ecData.componentIndex, api2);
        }
        enterEmphasisWhenMouseOver(dispatcher, e2);
      }
    }
    function handleGlobalMouseOutForHighDown(dispatcher, e2, api2) {
      allLeaveBlur(api2);
      var ecData = getECData(dispatcher);
      var dispatchers = findComponentHighDownDispatchers(ecData.componentMainType, ecData.componentIndex, ecData.componentHighDownName, api2).dispatchers;
      if (dispatchers) {
        each$f(dispatchers, function(dispatcher2) {
          return leaveEmphasisWhenMouseOut(dispatcher2, e2);
        });
      } else {
        leaveEmphasisWhenMouseOut(dispatcher, e2);
      }
    }
    function toggleSelectionFromPayload(seriesModel, payload, api2) {
      if (!isSelectChangePayload(payload)) {
        return;
      }
      var dataType2 = payload.dataType;
      var data = seriesModel.getData(dataType2);
      var dataIndex = queryDataIndex(data, payload);
      if (!isArray$2(dataIndex)) {
        dataIndex = [dataIndex];
      }
      seriesModel[payload.type === TOGGLE_SELECT_ACTION_TYPE ? "toggleSelect" : payload.type === SELECT_ACTION_TYPE ? "select" : "unselect"](dataIndex, dataType2);
    }
    function updateSeriesElementSelection(seriesModel) {
      var allData = seriesModel.getAllData();
      each$f(allData, function(_a2) {
        var data = _a2.data, type = _a2.type;
        data.eachItemGraphicEl(function(el, idx) {
          seriesModel.isSelected(idx, type) ? enterSelect(el) : leaveSelect(el);
        });
      });
    }
    function getAllSelectedIndices(ecModel) {
      var ret = [];
      ecModel.eachSeries(function(seriesModel) {
        var allData = seriesModel.getAllData();
        each$f(allData, function(_a2) {
          _a2.data;
          var type = _a2.type;
          var dataIndices = seriesModel.getSelectedDataIndices();
          if (dataIndices.length > 0) {
            var item = {
              dataIndex: dataIndices,
              seriesIndex: seriesModel.seriesIndex
            };
            if (type != null) {
              item.dataType = type;
            }
            ret.push(item);
          }
        });
      });
      return ret;
    }
    function enableHoverEmphasis(el, focus, blurScope) {
      setAsHighDownDispatcher(el, true);
      traverseUpdateState(el, setDefaultStateProxy);
      enableHoverFocus(el, focus, blurScope);
    }
    function disableHoverEmphasis(el) {
      setAsHighDownDispatcher(el, false);
    }
    function toggleHoverEmphasis(el, focus, blurScope, isDisabled) {
      isDisabled ? disableHoverEmphasis(el) : enableHoverEmphasis(el, focus, blurScope);
    }
    function enableHoverFocus(el, focus, blurScope) {
      var ecData = getECData(el);
      if (focus != null) {
        ecData.focus = focus;
        ecData.blurScope = blurScope;
      } else if (ecData.focus) {
        ecData.focus = null;
      }
    }
    var OTHER_STATES = ["emphasis", "blur", "select"];
    var defaultStyleGetterMap = {
      itemStyle: "getItemStyle",
      lineStyle: "getLineStyle",
      areaStyle: "getAreaStyle"
    };
    function setStatesStylesFromModel(el, itemModel, styleType2, getter) {
      styleType2 = styleType2 || "itemStyle";
      for (var i2 = 0; i2 < OTHER_STATES.length; i2++) {
        var stateName = OTHER_STATES[i2];
        var model = itemModel.getModel([stateName, styleType2]);
        var state = el.ensureState(stateName);
        state.style = getter ? getter(model) : model[defaultStyleGetterMap[styleType2]]();
      }
    }
    function setAsHighDownDispatcher(el, asDispatcher) {
      var disable = asDispatcher === false;
      var extendedEl = el;
      if (el.highDownSilentOnTouch) {
        extendedEl.__highDownSilentOnTouch = el.highDownSilentOnTouch;
      }
      if (!disable || extendedEl.__highDownDispatcher) {
        extendedEl.__highByOuter = extendedEl.__highByOuter || 0;
        extendedEl.__highDownDispatcher = !disable;
      }
    }
    function isHighDownDispatcher(el) {
      return !!(el && el.__highDownDispatcher);
    }
    function enableComponentHighDownFeatures(el, componentModel, componentHighDownName) {
      var ecData = getECData(el);
      ecData.componentMainType = componentModel.mainType;
      ecData.componentIndex = componentModel.componentIndex;
      ecData.componentHighDownName = componentHighDownName;
    }
    function getHighlightDigit(highlightKey) {
      var highlightDigit = _highlightKeyMap[highlightKey];
      if (highlightDigit == null && _highlightNextDigit <= 32) {
        highlightDigit = _highlightKeyMap[highlightKey] = _highlightNextDigit++;
      }
      return highlightDigit;
    }
    function isSelectChangePayload(payload) {
      var payloadType = payload.type;
      return payloadType === SELECT_ACTION_TYPE || payloadType === UNSELECT_ACTION_TYPE || payloadType === TOGGLE_SELECT_ACTION_TYPE;
    }
    function isHighDownPayload(payload) {
      var payloadType = payload.type;
      return payloadType === HIGHLIGHT_ACTION_TYPE || payloadType === DOWNPLAY_ACTION_TYPE;
    }
    function savePathStates(el) {
      var store2 = getSavedStates(el);
      store2.normalFill = el.style.fill;
      store2.normalStroke = el.style.stroke;
      var selectState = el.states.select || {};
      store2.selectFill = selectState.style && selectState.style.fill || null;
      store2.selectStroke = selectState.style && selectState.style.stroke || null;
    }
    var CMD$2 = PathProxy.CMD;
    var points$2 = [[], [], []];
    var mathSqrt$2 = Math.sqrt;
    var mathAtan2 = Math.atan2;
    function transformPath$1(path, m2) {
      if (!m2) {
        return;
      }
      var data = path.data;
      var len2 = path.len();
      var cmd;
      var nPoint;
      var i2;
      var j;
      var k2;
      var p2;
      var M2 = CMD$2.M;
      var C2 = CMD$2.C;
      var L2 = CMD$2.L;
      var R2 = CMD$2.R;
      var A2 = CMD$2.A;
      var Q2 = CMD$2.Q;
      for (i2 = 0, j = 0; i2 < len2; ) {
        cmd = data[i2++];
        j = i2;
        nPoint = 0;
        switch (cmd) {
          case M2:
            nPoint = 1;
            break;
          case L2:
            nPoint = 1;
            break;
          case C2:
            nPoint = 3;
            break;
          case Q2:
            nPoint = 2;
            break;
          case A2:
            var x2 = m2[4];
            var y = m2[5];
            var sx = mathSqrt$2(m2[0] * m2[0] + m2[1] * m2[1]);
            var sy = mathSqrt$2(m2[2] * m2[2] + m2[3] * m2[3]);
            var angle2 = mathAtan2(-m2[1] / sy, m2[0] / sx);
            data[i2] *= sx;
            data[i2++] += x2;
            data[i2] *= sy;
            data[i2++] += y;
            data[i2++] *= sx;
            data[i2++] *= sy;
            data[i2++] += angle2;
            data[i2++] += angle2;
            i2 += 2;
            j = i2;
            break;
          case R2:
            p2[0] = data[i2++];
            p2[1] = data[i2++];
            applyTransform$1(p2, p2, m2);
            data[j++] = p2[0];
            data[j++] = p2[1];
            p2[0] += data[i2++];
            p2[1] += data[i2++];
            applyTransform$1(p2, p2, m2);
            data[j++] = p2[0];
            data[j++] = p2[1];
        }
        for (k2 = 0; k2 < nPoint; k2++) {
          var p_1 = points$2[k2];
          p_1[0] = data[i2++];
          p_1[1] = data[i2++];
          applyTransform$1(p_1, p_1, m2);
          data[j++] = p_1[0];
          data[j++] = p_1[1];
        }
      }
      path.increaseVersion();
    }
    var mathSqrt$1 = Math.sqrt;
    var mathSin$2 = Math.sin;
    var mathCos$2 = Math.cos;
    var PI$7 = Math.PI;
    function vMag(v4) {
      return Math.sqrt(v4[0] * v4[0] + v4[1] * v4[1]);
    }
    function vRatio(u2, v4) {
      return (u2[0] * v4[0] + u2[1] * v4[1]) / (vMag(u2) * vMag(v4));
    }
    function vAngle(u2, v4) {
      return (u2[0] * v4[1] < u2[1] * v4[0] ? -1 : 1) * Math.acos(vRatio(u2, v4));
    }
    function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {
      var psi = psiDeg * (PI$7 / 180);
      var xp = mathCos$2(psi) * (x1 - x2) / 2 + mathSin$2(psi) * (y1 - y2) / 2;
      var yp = -1 * mathSin$2(psi) * (x1 - x2) / 2 + mathCos$2(psi) * (y1 - y2) / 2;
      var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);
      if (lambda > 1) {
        rx *= mathSqrt$1(lambda);
        ry *= mathSqrt$1(lambda);
      }
      var f2 = (fa === fs ? -1 : 1) * mathSqrt$1((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))) || 0;
      var cxp = f2 * rx * yp / ry;
      var cyp = f2 * -ry * xp / rx;
      var cx = (x1 + x2) / 2 + mathCos$2(psi) * cxp - mathSin$2(psi) * cyp;
      var cy = (y1 + y2) / 2 + mathSin$2(psi) * cxp + mathCos$2(psi) * cyp;
      var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);
      var u2 = [(xp - cxp) / rx, (yp - cyp) / ry];
      var v4 = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];
      var dTheta = vAngle(u2, v4);
      if (vRatio(u2, v4) <= -1) {
        dTheta = PI$7;
      }
      if (vRatio(u2, v4) >= 1) {
        dTheta = 0;
      }
      if (dTheta < 0) {
        var n = Math.round(dTheta / PI$7 * 1e6) / 1e6;
        dTheta = PI$7 * 2 + n % 2 * PI$7;
      }
      path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);
    }
    var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig;
    var numberReg$1 = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
    function createPathProxyFromString(data) {
      var path = new PathProxy();
      if (!data) {
        return path;
      }
      var cpx = 0;
      var cpy = 0;
      var subpathX = cpx;
      var subpathY = cpy;
      var prevCmd;
      var CMD2 = PathProxy.CMD;
      var cmdList = data.match(commandReg);
      if (!cmdList) {
        return path;
      }
      for (var l2 = 0; l2 < cmdList.length; l2++) {
        var cmdText = cmdList[l2];
        var cmdStr = cmdText.charAt(0);
        var cmd = void 0;
        var p2 = cmdText.match(numberReg$1) || [];
        var pLen = p2.length;
        for (var i2 = 0; i2 < pLen; i2++) {
          p2[i2] = parseFloat(p2[i2]);
        }
        var off = 0;
        while (off < pLen) {
          var ctlPtx = void 0;
          var ctlPty = void 0;
          var rx = void 0;
          var ry = void 0;
          var psi = void 0;
          var fa = void 0;
          var fs = void 0;
          var x1 = cpx;
          var y1 = cpy;
          var len2 = void 0;
          var pathData = void 0;
          switch (cmdStr) {
            case "l":
              cpx += p2[off++];
              cpy += p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "L":
              cpx = p2[off++];
              cpy = p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "m":
              cpx += p2[off++];
              cpy += p2[off++];
              cmd = CMD2.M;
              path.addData(cmd, cpx, cpy);
              subpathX = cpx;
              subpathY = cpy;
              cmdStr = "l";
              break;
            case "M":
              cpx = p2[off++];
              cpy = p2[off++];
              cmd = CMD2.M;
              path.addData(cmd, cpx, cpy);
              subpathX = cpx;
              subpathY = cpy;
              cmdStr = "L";
              break;
            case "h":
              cpx += p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "H":
              cpx = p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "v":
              cpy += p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "V":
              cpy = p2[off++];
              cmd = CMD2.L;
              path.addData(cmd, cpx, cpy);
              break;
            case "C":
              cmd = CMD2.C;
              path.addData(cmd, p2[off++], p2[off++], p2[off++], p2[off++], p2[off++], p2[off++]);
              cpx = p2[off - 2];
              cpy = p2[off - 1];
              break;
            case "c":
              cmd = CMD2.C;
              path.addData(cmd, p2[off++] + cpx, p2[off++] + cpy, p2[off++] + cpx, p2[off++] + cpy, p2[off++] + cpx, p2[off++] + cpy);
              cpx += p2[off - 2];
              cpy += p2[off - 1];
              break;
            case "S":
              ctlPtx = cpx;
              ctlPty = cpy;
              len2 = path.len();
              pathData = path.data;
              if (prevCmd === CMD2.C) {
                ctlPtx += cpx - pathData[len2 - 4];
                ctlPty += cpy - pathData[len2 - 3];
              }
              cmd = CMD2.C;
              x1 = p2[off++];
              y1 = p2[off++];
              cpx = p2[off++];
              cpy = p2[off++];
              path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
              break;
            case "s":
              ctlPtx = cpx;
              ctlPty = cpy;
              len2 = path.len();
              pathData = path.data;
              if (prevCmd === CMD2.C) {
                ctlPtx += cpx - pathData[len2 - 4];
                ctlPty += cpy - pathData[len2 - 3];
              }
              cmd = CMD2.C;
              x1 = cpx + p2[off++];
              y1 = cpy + p2[off++];
              cpx += p2[off++];
              cpy += p2[off++];
              path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
              break;
            case "Q":
              x1 = p2[off++];
              y1 = p2[off++];
              cpx = p2[off++];
              cpy = p2[off++];
              cmd = CMD2.Q;
              path.addData(cmd, x1, y1, cpx, cpy);
              break;
            case "q":
              x1 = p2[off++] + cpx;
              y1 = p2[off++] + cpy;
              cpx += p2[off++];
              cpy += p2[off++];
              cmd = CMD2.Q;
              path.addData(cmd, x1, y1, cpx, cpy);
              break;
            case "T":
              ctlPtx = cpx;
              ctlPty = cpy;
              len2 = path.len();
              pathData = path.data;
              if (prevCmd === CMD2.Q) {
                ctlPtx += cpx - pathData[len2 - 4];
                ctlPty += cpy - pathData[len2 - 3];
              }
              cpx = p2[off++];
              cpy = p2[off++];
              cmd = CMD2.Q;
              path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
              break;
            case "t":
              ctlPtx = cpx;
              ctlPty = cpy;
              len2 = path.len();
              pathData = path.data;
              if (prevCmd === CMD2.Q) {
                ctlPtx += cpx - pathData[len2 - 4];
                ctlPty += cpy - pathData[len2 - 3];
              }
              cpx += p2[off++];
              cpy += p2[off++];
              cmd = CMD2.Q;
              path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
              break;
            case "A":
              rx = p2[off++];
              ry = p2[off++];
              psi = p2[off++];
              fa = p2[off++];
              fs = p2[off++];
              x1 = cpx, y1 = cpy;
              cpx = p2[off++];
              cpy = p2[off++];
              cmd = CMD2.A;
              processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);
              break;
            case "a":
              rx = p2[off++];
              ry = p2[off++];
              psi = p2[off++];
              fa = p2[off++];
              fs = p2[off++];
              x1 = cpx, y1 = cpy;
              cpx += p2[off++];
              cpy += p2[off++];
              cmd = CMD2.A;
              processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);
              break;
          }
        }
        if (cmdStr === "z" || cmdStr === "Z") {
          cmd = CMD2.Z;
          path.addData(cmd);
          cpx = subpathX;
          cpy = subpathY;
        }
        prevCmd = cmd;
      }
      path.toStatic();
      return path;
    }
    var SVGPath = function(_super) {
      __extends$1(SVGPath2, _super);
      function SVGPath2() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      SVGPath2.prototype.applyTransform = function(m2) {
      };
      return SVGPath2;
    }(Path);
    function isPathProxy(path) {
      return path.setData != null;
    }
    function createPathOptions(str, opts) {
      var pathProxy = createPathProxyFromString(str);
      var innerOpts = extend$1({}, opts);
      innerOpts.buildPath = function(path) {
        if (isPathProxy(path)) {
          path.setData(pathProxy.data);
          var ctx = path.getContext();
          if (ctx) {
            path.rebuildPath(ctx, 1);
          }
        } else {
          var ctx = path;
          pathProxy.rebuildPath(ctx, 1);
        }
      };
      innerOpts.applyTransform = function(m2) {
        transformPath$1(pathProxy, m2);
        this.dirtyShape();
      };
      return innerOpts;
    }
    function createFromString(str, opts) {
      return new SVGPath(createPathOptions(str, opts));
    }
    function extendFromString(str, defaultOpts) {
      var innerOpts = createPathOptions(str, defaultOpts);
      var Sub = function(_super) {
        __extends$1(Sub2, _super);
        function Sub2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.applyTransform = innerOpts.applyTransform;
          _this.buildPath = innerOpts.buildPath;
          return _this;
        }
        return Sub2;
      }(SVGPath);
      return Sub;
    }
    function mergePath$1(pathEls, opts) {
      var pathList = [];
      var len2 = pathEls.length;
      for (var i2 = 0; i2 < len2; i2++) {
        var pathEl = pathEls[i2];
        pathList.push(pathEl.getUpdatedPathProxy(true));
      }
      var pathBundle = new Path(opts);
      pathBundle.createPathProxy();
      pathBundle.buildPath = function(path) {
        if (isPathProxy(path)) {
          path.appendPath(pathList);
          var ctx = path.getContext();
          if (ctx) {
            path.rebuildPath(ctx, 1);
          }
        }
      };
      return pathBundle;
    }
    function clonePath(sourcePath, opts) {
      opts = opts || {};
      var path = new Path();
      if (sourcePath.shape) {
        path.setShape(sourcePath.shape);
      }
      path.setStyle(sourcePath.style);
      if (opts.bakeTransform) {
        transformPath$1(path.path, sourcePath.getComputedTransform());
      } else {
        if (opts.toLocal) {
          path.setLocalTransform(sourcePath.getComputedTransform());
        } else {
          path.copyTransform(sourcePath);
        }
      }
      path.buildPath = sourcePath.buildPath;
      path.applyTransform = path.applyTransform;
      path.z = sourcePath.z;
      path.z2 = sourcePath.z2;
      path.zlevel = sourcePath.zlevel;
      return path;
    }
    var CircleShape = /* @__PURE__ */ function() {
      function CircleShape2() {
        this.cx = 0;
        this.cy = 0;
        this.r = 0;
      }
      return CircleShape2;
    }();
    var Circle = function(_super) {
      __extends$1(Circle2, _super);
      function Circle2(opts) {
        return _super.call(this, opts) || this;
      }
      Circle2.prototype.getDefaultShape = function() {
        return new CircleShape();
      };
      Circle2.prototype.buildPath = function(ctx, shape) {
        ctx.moveTo(shape.cx + shape.r, shape.cy);
        ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);
      };
      return Circle2;
    }(Path);
    Circle.prototype.type = "circle";
    var EllipseShape = /* @__PURE__ */ function() {
      function EllipseShape2() {
        this.cx = 0;
        this.cy = 0;
        this.rx = 0;
        this.ry = 0;
      }
      return EllipseShape2;
    }();
    var Ellipse = function(_super) {
      __extends$1(Ellipse2, _super);
      function Ellipse2(opts) {
        return _super.call(this, opts) || this;
      }
      Ellipse2.prototype.getDefaultShape = function() {
        return new EllipseShape();
      };
      Ellipse2.prototype.buildPath = function(ctx, shape) {
        var k2 = 0.5522848;
        var x2 = shape.cx;
        var y = shape.cy;
        var a2 = shape.rx;
        var b2 = shape.ry;
        var ox = a2 * k2;
        var oy = b2 * k2;
        ctx.moveTo(x2 - a2, y);
        ctx.bezierCurveTo(x2 - a2, y - oy, x2 - ox, y - b2, x2, y - b2);
        ctx.bezierCurveTo(x2 + ox, y - b2, x2 + a2, y - oy, x2 + a2, y);
        ctx.bezierCurveTo(x2 + a2, y + oy, x2 + ox, y + b2, x2, y + b2);
        ctx.bezierCurveTo(x2 - ox, y + b2, x2 - a2, y + oy, x2 - a2, y);
        ctx.closePath();
      };
      return Ellipse2;
    }(Path);
    Ellipse.prototype.type = "ellipse";
    var PI$6 = Math.PI;
    var PI2$3 = PI$6 * 2;
    var mathSin$1 = Math.sin;
    var mathCos$1 = Math.cos;
    var mathACos = Math.acos;
    var mathATan2 = Math.atan2;
    var mathAbs$1 = Math.abs;
    var mathSqrt = Math.sqrt;
    var mathMax$7 = Math.max;
    var mathMin$7 = Math.min;
    var e$1 = 1e-4;
    function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
      var dx10 = x1 - x0;
      var dy10 = y1 - y0;
      var dx32 = x3 - x2;
      var dy32 = y3 - y2;
      var t = dy32 * dx10 - dx32 * dy10;
      if (t * t < e$1) {
        return;
      }
      t = (dx32 * (y0 - y2) - dy32 * (x0 - x2)) / t;
      return [x0 + t * dx10, y0 + t * dy10];
    }
    function computeCornerTangents(x0, y0, x1, y1, radius, cr, clockwise) {
      var x01 = x0 - x1;
      var y01 = y0 - y1;
      var lo = (clockwise ? cr : -cr) / mathSqrt(x01 * x01 + y01 * y01);
      var ox = lo * y01;
      var oy = -lo * x01;
      var x11 = x0 + ox;
      var y11 = y0 + oy;
      var x10 = x1 + ox;
      var y10 = y1 + oy;
      var x00 = (x11 + x10) / 2;
      var y00 = (y11 + y10) / 2;
      var dx = x10 - x11;
      var dy = y10 - y11;
      var d2 = dx * dx + dy * dy;
      var r = radius - cr;
      var s2 = x11 * y10 - x10 * y11;
      var d3 = (dy < 0 ? -1 : 1) * mathSqrt(mathMax$7(0, r * r * d2 - s2 * s2));
      var cx0 = (s2 * dy - dx * d3) / d2;
      var cy0 = (-s2 * dx - dy * d3) / d2;
      var cx1 = (s2 * dy + dx * d3) / d2;
      var cy1 = (-s2 * dx + dy * d3) / d2;
      var dx0 = cx0 - x00;
      var dy0 = cy0 - y00;
      var dx1 = cx1 - x00;
      var dy1 = cy1 - y00;
      if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {
        cx0 = cx1;
        cy0 = cy1;
      }
      return {
        cx: cx0,
        cy: cy0,
        x0: -ox,
        y0: -oy,
        x1: cx0 * (radius / r - 1),
        y1: cy0 * (radius / r - 1)
      };
    }
    function normalizeCornerRadius(cr) {
      var arr;
      if (isArray$2(cr)) {
        var len2 = cr.length;
        if (!len2) {
          return cr;
        }
        if (len2 === 1) {
          arr = [cr[0], cr[0], 0, 0];
        } else if (len2 === 2) {
          arr = [cr[0], cr[0], cr[1], cr[1]];
        } else if (len2 === 3) {
          arr = cr.concat(cr[2]);
        } else {
          arr = cr;
        }
      } else {
        arr = [cr, cr, cr, cr];
      }
      return arr;
    }
    function buildPath$1(ctx, shape) {
      var _a2;
      var radius = mathMax$7(shape.r, 0);
      var innerRadius = mathMax$7(shape.r0 || 0, 0);
      var hasRadius = radius > 0;
      var hasInnerRadius = innerRadius > 0;
      if (!hasRadius && !hasInnerRadius) {
        return;
      }
      if (!hasRadius) {
        radius = innerRadius;
        innerRadius = 0;
      }
      if (innerRadius > radius) {
        var tmp = radius;
        radius = innerRadius;
        innerRadius = tmp;
      }
      var startAngle = shape.startAngle, endAngle = shape.endAngle;
      if (isNaN(startAngle) || isNaN(endAngle)) {
        return;
      }
      var cx = shape.cx, cy = shape.cy;
      var clockwise = !!shape.clockwise;
      var arc = mathAbs$1(endAngle - startAngle);
      var mod = arc > PI2$3 && arc % PI2$3;
      mod > e$1 && (arc = mod);
      if (!(radius > e$1)) {
        ctx.moveTo(cx, cy);
      } else if (arc > PI2$3 - e$1) {
        ctx.moveTo(cx + radius * mathCos$1(startAngle), cy + radius * mathSin$1(startAngle));
        ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);
        if (innerRadius > e$1) {
          ctx.moveTo(cx + innerRadius * mathCos$1(endAngle), cy + innerRadius * mathSin$1(endAngle));
          ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);
        }
      } else {
        var icrStart = void 0;
        var icrEnd = void 0;
        var ocrStart = void 0;
        var ocrEnd = void 0;
        var ocrs = void 0;
        var ocre = void 0;
        var icrs = void 0;
        var icre = void 0;
        var ocrMax = void 0;
        var icrMax = void 0;
        var limitedOcrMax = void 0;
        var limitedIcrMax = void 0;
        var xre = void 0;
        var yre = void 0;
        var xirs = void 0;
        var yirs = void 0;
        var xrs = radius * mathCos$1(startAngle);
        var yrs = radius * mathSin$1(startAngle);
        var xire = innerRadius * mathCos$1(endAngle);
        var yire = innerRadius * mathSin$1(endAngle);
        var hasArc = arc > e$1;
        if (hasArc) {
          var cornerRadius = shape.cornerRadius;
          if (cornerRadius) {
            _a2 = normalizeCornerRadius(cornerRadius), icrStart = _a2[0], icrEnd = _a2[1], ocrStart = _a2[2], ocrEnd = _a2[3];
          }
          var halfRd = mathAbs$1(radius - innerRadius) / 2;
          ocrs = mathMin$7(halfRd, ocrStart);
          ocre = mathMin$7(halfRd, ocrEnd);
          icrs = mathMin$7(halfRd, icrStart);
          icre = mathMin$7(halfRd, icrEnd);
          limitedOcrMax = ocrMax = mathMax$7(ocrs, ocre);
          limitedIcrMax = icrMax = mathMax$7(icrs, icre);
          if (ocrMax > e$1 || icrMax > e$1) {
            xre = radius * mathCos$1(endAngle);
            yre = radius * mathSin$1(endAngle);
            xirs = innerRadius * mathCos$1(startAngle);
            yirs = innerRadius * mathSin$1(startAngle);
            if (arc < PI$6) {
              var it_1 = intersect(xrs, yrs, xirs, yirs, xre, yre, xire, yire);
              if (it_1) {
                var x0 = xrs - it_1[0];
                var y0 = yrs - it_1[1];
                var x1 = xre - it_1[0];
                var y1 = yre - it_1[1];
                var a2 = 1 / mathSin$1(mathACos((x0 * x1 + y0 * y1) / (mathSqrt(x0 * x0 + y0 * y0) * mathSqrt(x1 * x1 + y1 * y1))) / 2);
                var b2 = mathSqrt(it_1[0] * it_1[0] + it_1[1] * it_1[1]);
                limitedOcrMax = mathMin$7(ocrMax, (radius - b2) / (a2 + 1));
                limitedIcrMax = mathMin$7(icrMax, (innerRadius - b2) / (a2 - 1));
              }
            }
          }
        }
        if (!hasArc) {
          ctx.moveTo(cx + xrs, cy + yrs);
        } else if (limitedOcrMax > e$1) {
          var crStart = mathMin$7(ocrStart, limitedOcrMax);
          var crEnd = mathMin$7(ocrEnd, limitedOcrMax);
          var ct0 = computeCornerTangents(xirs, yirs, xrs, yrs, radius, crStart, clockwise);
          var ct1 = computeCornerTangents(xre, yre, xire, yire, radius, crEnd, clockwise);
          ctx.moveTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);
          if (limitedOcrMax < ocrMax && crStart === crEnd) {
            ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedOcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);
          } else {
            crStart > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crStart, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);
            ctx.arc(cx, cy, radius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), !clockwise);
            crEnd > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crEnd, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);
          }
        } else {
          ctx.moveTo(cx + xrs, cy + yrs);
          ctx.arc(cx, cy, radius, startAngle, endAngle, !clockwise);
        }
        if (!(innerRadius > e$1) || !hasArc) {
          ctx.lineTo(cx + xire, cy + yire);
        } else if (limitedIcrMax > e$1) {
          var crStart = mathMin$7(icrStart, limitedIcrMax);
          var crEnd = mathMin$7(icrEnd, limitedIcrMax);
          var ct0 = computeCornerTangents(xire, yire, xre, yre, innerRadius, -crEnd, clockwise);
          var ct1 = computeCornerTangents(xrs, yrs, xirs, yirs, innerRadius, -crStart, clockwise);
          ctx.lineTo(cx + ct0.cx + ct0.x0, cy + ct0.cy + ct0.y0);
          if (limitedIcrMax < icrMax && crStart === crEnd) {
            ctx.arc(cx + ct0.cx, cy + ct0.cy, limitedIcrMax, mathATan2(ct0.y0, ct0.x0), mathATan2(ct1.y0, ct1.x0), !clockwise);
          } else {
            crEnd > 0 && ctx.arc(cx + ct0.cx, cy + ct0.cy, crEnd, mathATan2(ct0.y0, ct0.x0), mathATan2(ct0.y1, ct0.x1), !clockwise);
            ctx.arc(cx, cy, innerRadius, mathATan2(ct0.cy + ct0.y1, ct0.cx + ct0.x1), mathATan2(ct1.cy + ct1.y1, ct1.cx + ct1.x1), clockwise);
            crStart > 0 && ctx.arc(cx + ct1.cx, cy + ct1.cy, crStart, mathATan2(ct1.y1, ct1.x1), mathATan2(ct1.y0, ct1.x0), !clockwise);
          }
        } else {
          ctx.lineTo(cx + xire, cy + yire);
          ctx.arc(cx, cy, innerRadius, endAngle, startAngle, clockwise);
        }
      }
      ctx.closePath();
    }
    var SectorShape = /* @__PURE__ */ function() {
      function SectorShape2() {
        this.cx = 0;
        this.cy = 0;
        this.r0 = 0;
        this.r = 0;
        this.startAngle = 0;
        this.endAngle = Math.PI * 2;
        this.clockwise = true;
        this.cornerRadius = 0;
      }
      return SectorShape2;
    }();
    var Sector = function(_super) {
      __extends$1(Sector2, _super);
      function Sector2(opts) {
        return _super.call(this, opts) || this;
      }
      Sector2.prototype.getDefaultShape = function() {
        return new SectorShape();
      };
      Sector2.prototype.buildPath = function(ctx, shape) {
        buildPath$1(ctx, shape);
      };
      Sector2.prototype.isZeroArea = function() {
        return this.shape.startAngle === this.shape.endAngle || this.shape.r === this.shape.r0;
      };
      return Sector2;
    }(Path);
    Sector.prototype.type = "sector";
    var RingShape = /* @__PURE__ */ function() {
      function RingShape2() {
        this.cx = 0;
        this.cy = 0;
        this.r = 0;
        this.r0 = 0;
      }
      return RingShape2;
    }();
    var Ring = function(_super) {
      __extends$1(Ring2, _super);
      function Ring2(opts) {
        return _super.call(this, opts) || this;
      }
      Ring2.prototype.getDefaultShape = function() {
        return new RingShape();
      };
      Ring2.prototype.buildPath = function(ctx, shape) {
        var x2 = shape.cx;
        var y = shape.cy;
        var PI22 = Math.PI * 2;
        ctx.moveTo(x2 + shape.r, y);
        ctx.arc(x2, y, shape.r, 0, PI22, false);
        ctx.moveTo(x2 + shape.r0, y);
        ctx.arc(x2, y, shape.r0, 0, PI22, true);
      };
      return Ring2;
    }(Path);
    Ring.prototype.type = "ring";
    function smoothBezier(points2, smooth, isLoop, constraint) {
      var cps = [];
      var v4 = [];
      var v12 = [];
      var v22 = [];
      var prevPoint;
      var nextPoint;
      var min3;
      var max3;
      if (constraint) {
        min3 = [Infinity, Infinity];
        max3 = [-Infinity, -Infinity];
        for (var i2 = 0, len2 = points2.length; i2 < len2; i2++) {
          min$1(min3, min3, points2[i2]);
          max$1(max3, max3, points2[i2]);
        }
        min$1(min3, min3, constraint[0]);
        max$1(max3, max3, constraint[1]);
      }
      for (var i2 = 0, len2 = points2.length; i2 < len2; i2++) {
        var point = points2[i2];
        if (isLoop) {
          prevPoint = points2[i2 ? i2 - 1 : len2 - 1];
          nextPoint = points2[(i2 + 1) % len2];
        } else {
          if (i2 === 0 || i2 === len2 - 1) {
            cps.push(clone$3(points2[i2]));
            continue;
          } else {
            prevPoint = points2[i2 - 1];
            nextPoint = points2[i2 + 1];
          }
        }
        sub(v4, nextPoint, prevPoint);
        scale$2(v4, v4, smooth);
        var d0 = distance$1(point, prevPoint);
        var d1 = distance$1(point, nextPoint);
        var sum2 = d0 + d1;
        if (sum2 !== 0) {
          d0 /= sum2;
          d1 /= sum2;
        }
        scale$2(v12, v4, -d0);
        scale$2(v22, v4, d1);
        var cp0 = add([], point, v12);
        var cp1 = add([], point, v22);
        if (constraint) {
          max$1(cp0, cp0, min3);
          min$1(cp0, cp0, max3);
          max$1(cp1, cp1, min3);
          min$1(cp1, cp1, max3);
        }
        cps.push(cp0);
        cps.push(cp1);
      }
      if (isLoop) {
        cps.push(cps.shift());
      }
      return cps;
    }
    function buildPath(ctx, shape, closePath) {
      var smooth = shape.smooth;
      var points2 = shape.points;
      if (points2 && points2.length >= 2) {
        if (smooth) {
          var controlPoints = smoothBezier(points2, smooth, closePath, shape.smoothConstraint);
          ctx.moveTo(points2[0][0], points2[0][1]);
          var len2 = points2.length;
          for (var i2 = 0; i2 < (closePath ? len2 : len2 - 1); i2++) {
            var cp1 = controlPoints[i2 * 2];
            var cp2 = controlPoints[i2 * 2 + 1];
            var p2 = points2[(i2 + 1) % len2];
            ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p2[0], p2[1]);
          }
        } else {
          ctx.moveTo(points2[0][0], points2[0][1]);
          for (var i2 = 1, l2 = points2.length; i2 < l2; i2++) {
            ctx.lineTo(points2[i2][0], points2[i2][1]);
          }
        }
        closePath && ctx.closePath();
      }
    }
    var PolygonShape = /* @__PURE__ */ function() {
      function PolygonShape2() {
        this.points = null;
        this.smooth = 0;
        this.smoothConstraint = null;
      }
      return PolygonShape2;
    }();
    var Polygon = function(_super) {
      __extends$1(Polygon2, _super);
      function Polygon2(opts) {
        return _super.call(this, opts) || this;
      }
      Polygon2.prototype.getDefaultShape = function() {
        return new PolygonShape();
      };
      Polygon2.prototype.buildPath = function(ctx, shape) {
        buildPath(ctx, shape, true);
      };
      return Polygon2;
    }(Path);
    Polygon.prototype.type = "polygon";
    var PolylineShape = /* @__PURE__ */ function() {
      function PolylineShape2() {
        this.points = null;
        this.percent = 1;
        this.smooth = 0;
        this.smoothConstraint = null;
      }
      return PolylineShape2;
    }();
    var Polyline$1 = function(_super) {
      __extends$1(Polyline2, _super);
      function Polyline2(opts) {
        return _super.call(this, opts) || this;
      }
      Polyline2.prototype.getDefaultStyle = function() {
        return {
          stroke: "#000",
          fill: null
        };
      };
      Polyline2.prototype.getDefaultShape = function() {
        return new PolylineShape();
      };
      Polyline2.prototype.buildPath = function(ctx, shape) {
        buildPath(ctx, shape, false);
      };
      return Polyline2;
    }(Path);
    Polyline$1.prototype.type = "polyline";
    var subPixelOptimizeOutputShape = {};
    var LineShape = /* @__PURE__ */ function() {
      function LineShape2() {
        this.x1 = 0;
        this.y1 = 0;
        this.x2 = 0;
        this.y2 = 0;
        this.percent = 1;
      }
      return LineShape2;
    }();
    var Line$1 = function(_super) {
      __extends$1(Line2, _super);
      function Line2(opts) {
        return _super.call(this, opts) || this;
      }
      Line2.prototype.getDefaultStyle = function() {
        return {
          stroke: "#000",
          fill: null
        };
      };
      Line2.prototype.getDefaultShape = function() {
        return new LineShape();
      };
      Line2.prototype.buildPath = function(ctx, shape) {
        var x1;
        var y1;
        var x2;
        var y2;
        if (this.subPixelOptimize) {
          var optimizedShape = subPixelOptimizeLine$1(subPixelOptimizeOutputShape, shape, this.style);
          x1 = optimizedShape.x1;
          y1 = optimizedShape.y1;
          x2 = optimizedShape.x2;
          y2 = optimizedShape.y2;
        } else {
          x1 = shape.x1;
          y1 = shape.y1;
          x2 = shape.x2;
          y2 = shape.y2;
        }
        var percent = shape.percent;
        if (percent === 0) {
          return;
        }
        ctx.moveTo(x1, y1);
        if (percent < 1) {
          x2 = x1 * (1 - percent) + x2 * percent;
          y2 = y1 * (1 - percent) + y2 * percent;
        }
        ctx.lineTo(x2, y2);
      };
      Line2.prototype.pointAt = function(p2) {
        var shape = this.shape;
        return [
          shape.x1 * (1 - p2) + shape.x2 * p2,
          shape.y1 * (1 - p2) + shape.y2 * p2
        ];
      };
      return Line2;
    }(Path);
    Line$1.prototype.type = "line";
    var out = [];
    var BezierCurveShape = /* @__PURE__ */ function() {
      function BezierCurveShape2() {
        this.x1 = 0;
        this.y1 = 0;
        this.x2 = 0;
        this.y2 = 0;
        this.cpx1 = 0;
        this.cpy1 = 0;
        this.percent = 1;
      }
      return BezierCurveShape2;
    }();
    function someVectorAt(shape, t, isTangent) {
      var cpx2 = shape.cpx2;
      var cpy2 = shape.cpy2;
      if (cpx2 != null || cpy2 != null) {
        return [
          (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t),
          (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)
        ];
      } else {
        return [
          (isTangent ? quadraticDerivativeAt : quadraticAt$1)(shape.x1, shape.cpx1, shape.x2, t),
          (isTangent ? quadraticDerivativeAt : quadraticAt$1)(shape.y1, shape.cpy1, shape.y2, t)
        ];
      }
    }
    var BezierCurve$1 = function(_super) {
      __extends$1(BezierCurve2, _super);
      function BezierCurve2(opts) {
        return _super.call(this, opts) || this;
      }
      BezierCurve2.prototype.getDefaultStyle = function() {
        return {
          stroke: "#000",
          fill: null
        };
      };
      BezierCurve2.prototype.getDefaultShape = function() {
        return new BezierCurveShape();
      };
      BezierCurve2.prototype.buildPath = function(ctx, shape) {
        var x1 = shape.x1;
        var y1 = shape.y1;
        var x2 = shape.x2;
        var y2 = shape.y2;
        var cpx1 = shape.cpx1;
        var cpy1 = shape.cpy1;
        var cpx2 = shape.cpx2;
        var cpy2 = shape.cpy2;
        var percent = shape.percent;
        if (percent === 0) {
          return;
        }
        ctx.moveTo(x1, y1);
        if (cpx2 == null || cpy2 == null) {
          if (percent < 1) {
            quadraticSubdivide(x1, cpx1, x2, percent, out);
            cpx1 = out[1];
            x2 = out[2];
            quadraticSubdivide(y1, cpy1, y2, percent, out);
            cpy1 = out[1];
            y2 = out[2];
          }
          ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);
        } else {
          if (percent < 1) {
            cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);
            cpx1 = out[1];
            cpx2 = out[2];
            x2 = out[3];
            cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);
            cpy1 = out[1];
            cpy2 = out[2];
            y2 = out[3];
          }
          ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);
        }
      };
      BezierCurve2.prototype.pointAt = function(t) {
        return someVectorAt(this.shape, t, false);
      };
      BezierCurve2.prototype.tangentAt = function(t) {
        var p2 = someVectorAt(this.shape, t, true);
        return normalize$3(p2, p2);
      };
      return BezierCurve2;
    }(Path);
    BezierCurve$1.prototype.type = "bezier-curve";
    var ArcShape = /* @__PURE__ */ function() {
      function ArcShape2() {
        this.cx = 0;
        this.cy = 0;
        this.r = 0;
        this.startAngle = 0;
        this.endAngle = Math.PI * 2;
        this.clockwise = true;
      }
      return ArcShape2;
    }();
    var Arc = function(_super) {
      __extends$1(Arc2, _super);
      function Arc2(opts) {
        return _super.call(this, opts) || this;
      }
      Arc2.prototype.getDefaultStyle = function() {
        return {
          stroke: "#000",
          fill: null
        };
      };
      Arc2.prototype.getDefaultShape = function() {
        return new ArcShape();
      };
      Arc2.prototype.buildPath = function(ctx, shape) {
        var x2 = shape.cx;
        var y = shape.cy;
        var r = Math.max(shape.r, 0);
        var startAngle = shape.startAngle;
        var endAngle = shape.endAngle;
        var clockwise = shape.clockwise;
        var unitX = Math.cos(startAngle);
        var unitY = Math.sin(startAngle);
        ctx.moveTo(unitX * r + x2, unitY * r + y);
        ctx.arc(x2, y, r, startAngle, endAngle, !clockwise);
      };
      return Arc2;
    }(Path);
    Arc.prototype.type = "arc";
    var CompoundPath = function(_super) {
      __extends$1(CompoundPath2, _super);
      function CompoundPath2() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.type = "compound";
        return _this;
      }
      CompoundPath2.prototype._updatePathDirty = function() {
        var paths = this.shape.paths;
        var dirtyPath = this.shapeChanged();
        for (var i2 = 0; i2 < paths.length; i2++) {
          dirtyPath = dirtyPath || paths[i2].shapeChanged();
        }
        if (dirtyPath) {
          this.dirtyShape();
        }
      };
      CompoundPath2.prototype.beforeBrush = function() {
        this._updatePathDirty();
        var paths = this.shape.paths || [];
        var scale2 = this.getGlobalScale();
        for (var i2 = 0; i2 < paths.length; i2++) {
          if (!paths[i2].path) {
            paths[i2].createPathProxy();
          }
          paths[i2].path.setScale(scale2[0], scale2[1], paths[i2].segmentIgnoreThreshold);
        }
      };
      CompoundPath2.prototype.buildPath = function(ctx, shape) {
        var paths = shape.paths || [];
        for (var i2 = 0; i2 < paths.length; i2++) {
          paths[i2].buildPath(ctx, paths[i2].shape, true);
        }
      };
      CompoundPath2.prototype.afterBrush = function() {
        var paths = this.shape.paths || [];
        for (var i2 = 0; i2 < paths.length; i2++) {
          paths[i2].pathUpdated();
        }
      };
      CompoundPath2.prototype.getBoundingRect = function() {
        this._updatePathDirty.call(this);
        return Path.prototype.getBoundingRect.call(this);
      };
      return CompoundPath2;
    }(Path);
    var Gradient = function() {
      function Gradient2(colorStops) {
        this.colorStops = colorStops || [];
      }
      Gradient2.prototype.addColorStop = function(offset2, color2) {
        this.colorStops.push({
          offset: offset2,
          color: color2
        });
      };
      return Gradient2;
    }();
    var LinearGradient = function(_super) {
      __extends$1(LinearGradient2, _super);
      function LinearGradient2(x2, y, x22, y2, colorStops, globalCoord) {
        var _this = _super.call(this, colorStops) || this;
        _this.x = x2 == null ? 0 : x2;
        _this.y = y == null ? 0 : y;
        _this.x2 = x22 == null ? 1 : x22;
        _this.y2 = y2 == null ? 0 : y2;
        _this.type = "linear";
        _this.global = globalCoord || false;
        return _this;
      }
      return LinearGradient2;
    }(Gradient);
    var RadialGradient = function(_super) {
      __extends$1(RadialGradient2, _super);
      function RadialGradient2(x2, y, r, colorStops, globalCoord) {
        var _this = _super.call(this, colorStops) || this;
        _this.x = x2 == null ? 0.5 : x2;
        _this.y = y == null ? 0.5 : y;
        _this.r = r == null ? 0.5 : r;
        _this.type = "radial";
        _this.global = globalCoord || false;
        return _this;
      }
      return RadialGradient2;
    }(Gradient);
    var extent = [0, 0];
    var extent2 = [0, 0];
    var minTv = new Point();
    var maxTv = new Point();
    var OrientedBoundingRect = function() {
      function OrientedBoundingRect2(rect, transform2) {
        this._corners = [];
        this._axes = [];
        this._origin = [0, 0];
        for (var i2 = 0; i2 < 4; i2++) {
          this._corners[i2] = new Point();
        }
        for (var i2 = 0; i2 < 2; i2++) {
          this._axes[i2] = new Point();
        }
        if (rect) {
          this.fromBoundingRect(rect, transform2);
        }
      }
      OrientedBoundingRect2.prototype.fromBoundingRect = function(rect, transform2) {
        var corners = this._corners;
        var axes = this._axes;
        var x2 = rect.x;
        var y = rect.y;
        var x22 = x2 + rect.width;
        var y2 = y + rect.height;
        corners[0].set(x2, y);
        corners[1].set(x22, y);
        corners[2].set(x22, y2);
        corners[3].set(x2, y2);
        if (transform2) {
          for (var i2 = 0; i2 < 4; i2++) {
            corners[i2].transform(transform2);
          }
        }
        Point.sub(axes[0], corners[1], corners[0]);
        Point.sub(axes[1], corners[3], corners[0]);
        axes[0].normalize();
        axes[1].normalize();
        for (var i2 = 0; i2 < 2; i2++) {
          this._origin[i2] = axes[i2].dot(corners[0]);
        }
      };
      OrientedBoundingRect2.prototype.intersect = function(other, mtv) {
        var overlapped = true;
        var noMtv = !mtv;
        minTv.set(Infinity, Infinity);
        maxTv.set(0, 0);
        if (!this._intersectCheckOneSide(this, other, minTv, maxTv, noMtv, 1)) {
          overlapped = false;
          if (noMtv) {
            return overlapped;
          }
        }
        if (!this._intersectCheckOneSide(other, this, minTv, maxTv, noMtv, -1)) {
          overlapped = false;
          if (noMtv) {
            return overlapped;
          }
        }
        if (!noMtv) {
          Point.copy(mtv, overlapped ? minTv : maxTv);
        }
        return overlapped;
      };
      OrientedBoundingRect2.prototype._intersectCheckOneSide = function(self2, other, minTv2, maxTv2, noMtv, inverse) {
        var overlapped = true;
        for (var i2 = 0; i2 < 2; i2++) {
          var axis = this._axes[i2];
          this._getProjMinMaxOnAxis(i2, self2._corners, extent);
          this._getProjMinMaxOnAxis(i2, other._corners, extent2);
          if (extent[1] < extent2[0] || extent[0] > extent2[1]) {
            overlapped = false;
            if (noMtv) {
              return overlapped;
            }
            var dist0 = Math.abs(extent2[0] - extent[1]);
            var dist1 = Math.abs(extent[0] - extent2[1]);
            if (Math.min(dist0, dist1) > maxTv2.len()) {
              if (dist0 < dist1) {
                Point.scale(maxTv2, axis, -dist0 * inverse);
              } else {
                Point.scale(maxTv2, axis, dist1 * inverse);
              }
            }
          } else if (minTv2) {
            var dist0 = Math.abs(extent2[0] - extent[1]);
            var dist1 = Math.abs(extent[0] - extent2[1]);
            if (Math.min(dist0, dist1) < minTv2.len()) {
              if (dist0 < dist1) {
                Point.scale(minTv2, axis, dist0 * inverse);
              } else {
                Point.scale(minTv2, axis, -dist1 * inverse);
              }
            }
          }
        }
        return overlapped;
      };
      OrientedBoundingRect2.prototype._getProjMinMaxOnAxis = function(dim, corners, out2) {
        var axis = this._axes[dim];
        var origin2 = this._origin;
        var proj = corners[0].dot(axis) + origin2[dim];
        var min3 = proj;
        var max3 = proj;
        for (var i2 = 1; i2 < corners.length; i2++) {
          var proj_1 = corners[i2].dot(axis) + origin2[dim];
          min3 = Math.min(proj_1, min3);
          max3 = Math.max(proj_1, max3);
        }
        out2[0] = min3;
        out2[1] = max3;
      };
      return OrientedBoundingRect2;
    }();
    var m = [];
    var IncrementalDisplayable = function(_super) {
      __extends$1(IncrementalDisplayable2, _super);
      function IncrementalDisplayable2() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.notClear = true;
        _this.incremental = true;
        _this._displayables = [];
        _this._temporaryDisplayables = [];
        _this._cursor = 0;
        return _this;
      }
      IncrementalDisplayable2.prototype.traverse = function(cb, context) {
        cb.call(context, this);
      };
      IncrementalDisplayable2.prototype.useStyle = function() {
        this.style = {};
      };
      IncrementalDisplayable2.prototype.getCursor = function() {
        return this._cursor;
      };
      IncrementalDisplayable2.prototype.innerAfterBrush = function() {
        this._cursor = this._displayables.length;
      };
      IncrementalDisplayable2.prototype.clearDisplaybles = function() {
        this._displayables = [];
        this._temporaryDisplayables = [];
        this._cursor = 0;
        this.markRedraw();
        this.notClear = false;
      };
      IncrementalDisplayable2.prototype.clearTemporalDisplayables = function() {
        this._temporaryDisplayables = [];
      };
      IncrementalDisplayable2.prototype.addDisplayable = function(displayable, notPersistent) {
        if (notPersistent) {
          this._temporaryDisplayables.push(displayable);
        } else {
          this._displayables.push(displayable);
        }
        this.markRedraw();
      };
      IncrementalDisplayable2.prototype.addDisplayables = function(displayables, notPersistent) {
        notPersistent = notPersistent || false;
        for (var i2 = 0; i2 < displayables.length; i2++) {
          this.addDisplayable(displayables[i2], notPersistent);
        }
      };
      IncrementalDisplayable2.prototype.getDisplayables = function() {
        return this._displayables;
      };
      IncrementalDisplayable2.prototype.getTemporalDisplayables = function() {
        return this._temporaryDisplayables;
      };
      IncrementalDisplayable2.prototype.eachPendingDisplayable = function(cb) {
        for (var i2 = this._cursor; i2 < this._displayables.length; i2++) {
          cb && cb(this._displayables[i2]);
        }
        for (var i2 = 0; i2 < this._temporaryDisplayables.length; i2++) {
          cb && cb(this._temporaryDisplayables[i2]);
        }
      };
      IncrementalDisplayable2.prototype.update = function() {
        this.updateTransform();
        for (var i2 = this._cursor; i2 < this._displayables.length; i2++) {
          var displayable = this._displayables[i2];
          displayable.parent = this;
          displayable.update();
          displayable.parent = null;
        }
        for (var i2 = 0; i2 < this._temporaryDisplayables.length; i2++) {
          var displayable = this._temporaryDisplayables[i2];
          displayable.parent = this;
          displayable.update();
          displayable.parent = null;
        }
      };
      IncrementalDisplayable2.prototype.getBoundingRect = function() {
        if (!this._rect) {
          var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);
          for (var i2 = 0; i2 < this._displayables.length; i2++) {
            var displayable = this._displayables[i2];
            var childRect = displayable.getBoundingRect().clone();
            if (displayable.needLocalTransform()) {
              childRect.applyTransform(displayable.getLocalTransform(m));
            }
            rect.union(childRect);
          }
          this._rect = rect;
        }
        return this._rect;
      };
      IncrementalDisplayable2.prototype.contain = function(x2, y) {
        var localPos = this.transformCoordToLocal(x2, y);
        var rect = this.getBoundingRect();
        if (rect.contain(localPos[0], localPos[1])) {
          for (var i2 = 0; i2 < this._displayables.length; i2++) {
            var displayable = this._displayables[i2];
            if (displayable.contain(x2, y)) {
              return true;
            }
          }
        }
        return false;
      };
      return IncrementalDisplayable2;
    }(Displayable);
    var transitionStore = makeInner();
    function getAnimationConfig(animationType, animatableModel, dataIndex, extraOpts, extraDelayParams) {
      var animationPayload;
      if (animatableModel && animatableModel.ecModel) {
        var updatePayload = animatableModel.ecModel.getUpdatePayload();
        animationPayload = updatePayload && updatePayload.animation;
      }
      var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();
      var isUpdate = animationType === "update";
      if (animationEnabled) {
        var duration2 = void 0;
        var easing = void 0;
        var delay = void 0;
        if (extraOpts) {
          duration2 = retrieve2(extraOpts.duration, 200);
          easing = retrieve2(extraOpts.easing, "cubicOut");
          delay = 0;
        } else {
          duration2 = animatableModel.getShallow(isUpdate ? "animationDurationUpdate" : "animationDuration");
          easing = animatableModel.getShallow(isUpdate ? "animationEasingUpdate" : "animationEasing");
          delay = animatableModel.getShallow(isUpdate ? "animationDelayUpdate" : "animationDelay");
        }
        if (animationPayload) {
          animationPayload.duration != null && (duration2 = animationPayload.duration);
          animationPayload.easing != null && (easing = animationPayload.easing);
          animationPayload.delay != null && (delay = animationPayload.delay);
        }
        if (isFunction$1(delay)) {
          delay = delay(dataIndex, extraDelayParams);
        }
        if (isFunction$1(duration2)) {
          duration2 = duration2(dataIndex);
        }
        var config = {
          duration: duration2 || 0,
          delay,
          easing
        };
        return config;
      } else {
        return null;
      }
    }
    function animateOrSetProps(animationType, el, props2, animatableModel, dataIndex, cb, during) {
      var isFrom = false;
      var removeOpt;
      if (isFunction$1(dataIndex)) {
        during = cb;
        cb = dataIndex;
        dataIndex = null;
      } else if (isObject$5(dataIndex)) {
        cb = dataIndex.cb;
        during = dataIndex.during;
        isFrom = dataIndex.isFrom;
        removeOpt = dataIndex.removeOpt;
        dataIndex = dataIndex.dataIndex;
      }
      var isRemove = animationType === "leave";
      if (!isRemove) {
        el.stopAnimation("leave");
      }
      var animationConfig = getAnimationConfig(animationType, animatableModel, dataIndex, isRemove ? removeOpt || {} : null, animatableModel && animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);
      if (animationConfig && animationConfig.duration > 0) {
        var duration2 = animationConfig.duration;
        var animationDelay = animationConfig.delay;
        var animationEasing = animationConfig.easing;
        var animateConfig = {
          duration: duration2,
          delay: animationDelay || 0,
          easing: animationEasing,
          done: cb,
          force: !!cb || !!during,
          // Set to final state in update/init animation.
          // So the post processing based on the path shape can be done correctly.
          setToFinal: !isRemove,
          scope: animationType,
          during
        };
        isFrom ? el.animateFrom(props2, animateConfig) : el.animateTo(props2, animateConfig);
      } else {
        el.stopAnimation();
        !isFrom && el.attr(props2);
        during && during(1);
        cb && cb();
      }
    }
    function updateProps$1(el, props2, animatableModel, dataIndex, cb, during) {
      animateOrSetProps("update", el, props2, animatableModel, dataIndex, cb, during);
    }
    function initProps(el, props2, animatableModel, dataIndex, cb, during) {
      animateOrSetProps("enter", el, props2, animatableModel, dataIndex, cb, during);
    }
    function isElementRemoved(el) {
      if (!el.__zr) {
        return true;
      }
      for (var i2 = 0; i2 < el.animators.length; i2++) {
        var animator = el.animators[i2];
        if (animator.scope === "leave") {
          return true;
        }
      }
      return false;
    }
    function removeElement(el, props2, animatableModel, dataIndex, cb, during) {
      if (isElementRemoved(el)) {
        return;
      }
      animateOrSetProps("leave", el, props2, animatableModel, dataIndex, cb, during);
    }
    function fadeOutDisplayable(el, animatableModel, dataIndex, done) {
      el.removeTextContent();
      el.removeTextGuideLine();
      removeElement(el, {
        style: {
          opacity: 0
        }
      }, animatableModel, dataIndex, done);
    }
    function removeElementWithFadeOut(el, animatableModel, dataIndex) {
      function doRemove() {
        el.parent && el.parent.remove(el);
      }
      if (!el.isGroup) {
        fadeOutDisplayable(el, animatableModel, dataIndex, doRemove);
      } else {
        el.traverse(function(disp) {
          if (!disp.isGroup) {
            fadeOutDisplayable(disp, animatableModel, dataIndex, doRemove);
          }
        });
      }
    }
    function saveOldStyle(el) {
      transitionStore(el).oldStyle = el.style;
    }
    function getOldStyle(el) {
      return transitionStore(el).oldStyle;
    }
    var mathMax$6 = Math.max;
    var mathMin$6 = Math.min;
    var _customShapeMap = {};
    function extendShape(opts) {
      return Path.extend(opts);
    }
    var extendPathFromString = extendFromString;
    function extendPath(pathData, opts) {
      return extendPathFromString(pathData, opts);
    }
    function registerShape(name, ShapeClass) {
      _customShapeMap[name] = ShapeClass;
    }
    function getShapeClass(name) {
      if (_customShapeMap.hasOwnProperty(name)) {
        return _customShapeMap[name];
      }
    }
    function makePath(pathData, opts, rect, layout2) {
      var path = createFromString(pathData, opts);
      if (rect) {
        if (layout2 === "center") {
          rect = centerGraphic(rect, path.getBoundingRect());
        }
        resizePath(path, rect);
      }
      return path;
    }
    function makeImage(imageUrl, rect, layout2) {
      var zrImg = new ZRImage({
        style: {
          image: imageUrl,
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height
        },
        onload: function(img) {
          if (layout2 === "center") {
            var boundingRect = {
              width: img.width,
              height: img.height
            };
            zrImg.setStyle(centerGraphic(rect, boundingRect));
          }
        }
      });
      return zrImg;
    }
    function centerGraphic(rect, boundingRect) {
      var aspect = boundingRect.width / boundingRect.height;
      var width = rect.height * aspect;
      var height;
      if (width <= rect.width) {
        height = rect.height;
      } else {
        width = rect.width;
        height = width / aspect;
      }
      var cx = rect.x + rect.width / 2;
      var cy = rect.y + rect.height / 2;
      return {
        x: cx - width / 2,
        y: cy - height / 2,
        width,
        height
      };
    }
    var mergePath = mergePath$1;
    function resizePath(path, rect) {
      if (!path.applyTransform) {
        return;
      }
      var pathRect = path.getBoundingRect();
      var m2 = pathRect.calculateTransform(rect);
      path.applyTransform(m2);
    }
    function subPixelOptimizeLine(shape, lineWidth) {
      subPixelOptimizeLine$1(shape, shape, {
        lineWidth
      });
      return shape;
    }
    function subPixelOptimizeRect(param) {
      subPixelOptimizeRect$1(param.shape, param.shape, param.style);
      return param;
    }
    var subPixelOptimize = subPixelOptimize$1;
    function getTransform$1(target, ancestor) {
      var mat = identity([]);
      while (target && target !== ancestor) {
        mul(mat, target.getLocalTransform(), mat);
        target = target.parent;
      }
      return mat;
    }
    function applyTransform(target, transform2, invert$1) {
      if (transform2 && !isArrayLike(transform2)) {
        transform2 = Transformable.getLocalTransform(transform2);
      }
      if (invert$1) {
        transform2 = invert([], transform2);
      }
      return applyTransform$1([], target, transform2);
    }
    function transformDirection(direction2, transform2, invert2) {
      var hBase = transform2[4] === 0 || transform2[5] === 0 || transform2[0] === 0 ? 1 : Math.abs(2 * transform2[4] / transform2[0]);
      var vBase = transform2[4] === 0 || transform2[5] === 0 || transform2[2] === 0 ? 1 : Math.abs(2 * transform2[4] / transform2[2]);
      var vertex = [direction2 === "left" ? -hBase : direction2 === "right" ? hBase : 0, direction2 === "top" ? -vBase : direction2 === "bottom" ? vBase : 0];
      vertex = applyTransform(vertex, transform2, invert2);
      return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? "right" : "left" : vertex[1] > 0 ? "bottom" : "top";
    }
    function isNotGroup(el) {
      return !el.isGroup;
    }
    function isPath$1(el) {
      return el.shape != null;
    }
    function groupTransition(g1, g2, animatableModel) {
      if (!g1 || !g2) {
        return;
      }
      function getElMap(g) {
        var elMap = {};
        g.traverse(function(el) {
          if (isNotGroup(el) && el.anid) {
            elMap[el.anid] = el;
          }
        });
        return elMap;
      }
      function getAnimatableProps(el) {
        var obj = {
          x: el.x,
          y: el.y,
          rotation: el.rotation
        };
        if (isPath$1(el)) {
          obj.shape = extend$1({}, el.shape);
        }
        return obj;
      }
      var elMap1 = getElMap(g1);
      g2.traverse(function(el) {
        if (isNotGroup(el) && el.anid) {
          var oldEl = elMap1[el.anid];
          if (oldEl) {
            var newProp = getAnimatableProps(el);
            el.attr(getAnimatableProps(oldEl));
            updateProps$1(el, newProp, animatableModel, getECData(el).dataIndex);
          }
        }
      });
    }
    function clipPointsByRect(points2, rect) {
      return map$1(points2, function(point) {
        var x2 = point[0];
        x2 = mathMax$6(x2, rect.x);
        x2 = mathMin$6(x2, rect.x + rect.width);
        var y = point[1];
        y = mathMax$6(y, rect.y);
        y = mathMin$6(y, rect.y + rect.height);
        return [x2, y];
      });
    }
    function clipRectByRect(targetRect, rect) {
      var x2 = mathMax$6(targetRect.x, rect.x);
      var x22 = mathMin$6(targetRect.x + targetRect.width, rect.x + rect.width);
      var y = mathMax$6(targetRect.y, rect.y);
      var y2 = mathMin$6(targetRect.y + targetRect.height, rect.y + rect.height);
      if (x22 >= x2 && y2 >= y) {
        return {
          x: x2,
          y,
          width: x22 - x2,
          height: y2 - y
        };
      }
    }
    function createIcon(iconStr, opt, rect) {
      var innerOpts = extend$1({
        rectHover: true
      }, opt);
      var style = innerOpts.style = {
        strokeNoScale: true
      };
      rect = rect || {
        x: -1,
        y: -1,
        width: 2,
        height: 2
      };
      if (iconStr) {
        return iconStr.indexOf("image://") === 0 ? (style.image = iconStr.slice(8), defaults$1(style, rect), new ZRImage(innerOpts)) : makePath(iconStr.replace("path://", ""), innerOpts, rect, "center");
      }
    }
    function linePolygonIntersect(a1x, a1y, a2x, a2y, points2) {
      for (var i2 = 0, p2 = points2[points2.length - 1]; i2 < points2.length; i2++) {
        var p3 = points2[i2];
        if (lineLineIntersect$1(a1x, a1y, a2x, a2y, p3[0], p3[1], p2[0], p2[1])) {
          return true;
        }
        p2 = p3;
      }
    }
    function lineLineIntersect$1(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {
      var mx = a2x - a1x;
      var my = a2y - a1y;
      var nx = b2x - b1x;
      var ny = b2y - b1y;
      var nmCrossProduct = crossProduct2d$1(nx, ny, mx, my);
      if (nearZero(nmCrossProduct)) {
        return false;
      }
      var b1a1x = a1x - b1x;
      var b1a1y = a1y - b1y;
      var q2 = crossProduct2d$1(b1a1x, b1a1y, mx, my) / nmCrossProduct;
      if (q2 < 0 || q2 > 1) {
        return false;
      }
      var p2 = crossProduct2d$1(b1a1x, b1a1y, nx, ny) / nmCrossProduct;
      if (p2 < 0 || p2 > 1) {
        return false;
      }
      return true;
    }
    function crossProduct2d$1(x1, y1, x2, y2) {
      return x1 * y2 - x2 * y1;
    }
    function nearZero(val) {
      return val <= 1e-6 && val >= -1e-6;
    }
    function setTooltipConfig(opt) {
      var itemTooltipOption = opt.itemTooltipOption;
      var componentModel = opt.componentModel;
      var itemName = opt.itemName;
      var itemTooltipOptionObj = isString$1(itemTooltipOption) ? {
        formatter: itemTooltipOption
      } : itemTooltipOption;
      var mainType = componentModel.mainType;
      var componentIndex = componentModel.componentIndex;
      var formatterParams = {
        componentType: mainType,
        name: itemName,
        $vars: ["name"]
      };
      formatterParams[mainType + "Index"] = componentIndex;
      var formatterParamsExtra = opt.formatterParamsExtra;
      if (formatterParamsExtra) {
        each$f(keys$1(formatterParamsExtra), function(key) {
          if (!hasOwn(formatterParams, key)) {
            formatterParams[key] = formatterParamsExtra[key];
            formatterParams.$vars.push(key);
          }
        });
      }
      var ecData = getECData(opt.el);
      ecData.componentMainType = mainType;
      ecData.componentIndex = componentIndex;
      ecData.tooltipConfig = {
        name: itemName,
        option: defaults$1({
          content: itemName,
          encodeHTMLContent: true,
          formatterParams
        }, itemTooltipOptionObj)
      };
    }
    function traverseElement(el, cb) {
      var stopped;
      if (el.isGroup) {
        stopped = cb(el);
      }
      if (!stopped) {
        el.traverse(cb);
      }
    }
    function traverseElements(els, cb) {
      if (els) {
        if (isArray$2(els)) {
          for (var i2 = 0; i2 < els.length; i2++) {
            traverseElement(els[i2], cb);
          }
        } else {
          traverseElement(els, cb);
        }
      }
    }
    registerShape("circle", Circle);
    registerShape("ellipse", Ellipse);
    registerShape("sector", Sector);
    registerShape("ring", Ring);
    registerShape("polygon", Polygon);
    registerShape("polyline", Polyline$1);
    registerShape("rect", Rect$2);
    registerShape("line", Line$1);
    registerShape("bezierCurve", BezierCurve$1);
    registerShape("arc", Arc);
    const graphic = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      Arc,
      BezierCurve: BezierCurve$1,
      BoundingRect,
      Circle,
      CompoundPath,
      Ellipse,
      Group: Group$3,
      Image: ZRImage,
      IncrementalDisplayable,
      Line: Line$1,
      LinearGradient,
      OrientedBoundingRect,
      Path,
      Point,
      Polygon,
      Polyline: Polyline$1,
      RadialGradient,
      Rect: Rect$2,
      Ring,
      Sector,
      Text: ZRText,
      applyTransform,
      clipPointsByRect,
      clipRectByRect,
      createIcon,
      extendPath,
      extendShape,
      getShapeClass,
      getTransform: getTransform$1,
      groupTransition,
      initProps,
      isElementRemoved,
      lineLineIntersect: lineLineIntersect$1,
      linePolygonIntersect,
      makeImage,
      makePath,
      mergePath,
      registerShape,
      removeElement,
      removeElementWithFadeOut,
      resizePath,
      setTooltipConfig,
      subPixelOptimize,
      subPixelOptimizeLine,
      subPixelOptimizeRect,
      transformDirection,
      traverseElements,
      updateProps: updateProps$1
    }, Symbol.toStringTag, { value: "Module" }));
    var EMPTY_OBJ = {};
    function setLabelText(label, labelTexts) {
      for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
        var stateName = SPECIAL_STATES[i2];
        var text = labelTexts[stateName];
        var state = label.ensureState(stateName);
        state.style = state.style || {};
        state.style.text = text;
      }
      var oldStates = label.currentStates.slice();
      label.clearStates(true);
      label.setStyle({
        text: labelTexts.normal
      });
      label.useStates(oldStates, true);
    }
    function getLabelText(opt, stateModels, interpolatedValue) {
      var labelFetcher = opt.labelFetcher;
      var labelDataIndex = opt.labelDataIndex;
      var labelDimIndex = opt.labelDimIndex;
      var normalModel = stateModels.normal;
      var baseText;
      if (labelFetcher) {
        baseText = labelFetcher.getFormattedLabel(labelDataIndex, "normal", null, labelDimIndex, normalModel && normalModel.get("formatter"), interpolatedValue != null ? {
          interpolatedValue
        } : null);
      }
      if (baseText == null) {
        baseText = isFunction$1(opt.defaultText) ? opt.defaultText(labelDataIndex, opt, interpolatedValue) : opt.defaultText;
      }
      var statesText = {
        normal: baseText
      };
      for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
        var stateName = SPECIAL_STATES[i2];
        var stateModel = stateModels[stateName];
        statesText[stateName] = retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, stateName, null, labelDimIndex, stateModel && stateModel.get("formatter")) : null, baseText);
      }
      return statesText;
    }
    function setLabelStyle(targetEl, labelStatesModels, opt, stateSpecified) {
      opt = opt || EMPTY_OBJ;
      var isSetOnText = targetEl instanceof ZRText;
      var needsCreateText = false;
      for (var i2 = 0; i2 < DISPLAY_STATES.length; i2++) {
        var stateModel = labelStatesModels[DISPLAY_STATES[i2]];
        if (stateModel && stateModel.getShallow("show")) {
          needsCreateText = true;
          break;
        }
      }
      var textContent = isSetOnText ? targetEl : targetEl.getTextContent();
      if (needsCreateText) {
        if (!isSetOnText) {
          if (!textContent) {
            textContent = new ZRText();
            targetEl.setTextContent(textContent);
          }
          if (targetEl.stateProxy) {
            textContent.stateProxy = targetEl.stateProxy;
          }
        }
        var labelStatesTexts = getLabelText(opt, labelStatesModels);
        var normalModel = labelStatesModels.normal;
        var showNormal = !!normalModel.getShallow("show");
        var normalStyle = createTextStyle(normalModel, stateSpecified && stateSpecified.normal, opt, false, !isSetOnText);
        normalStyle.text = labelStatesTexts.normal;
        if (!isSetOnText) {
          targetEl.setTextConfig(createTextConfig(normalModel, opt, false));
        }
        for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
          var stateName = SPECIAL_STATES[i2];
          var stateModel = labelStatesModels[stateName];
          if (stateModel) {
            var stateObj = textContent.ensureState(stateName);
            var stateShow = !!retrieve2(stateModel.getShallow("show"), showNormal);
            if (stateShow !== showNormal) {
              stateObj.ignore = !stateShow;
            }
            stateObj.style = createTextStyle(stateModel, stateSpecified && stateSpecified[stateName], opt, true, !isSetOnText);
            stateObj.style.text = labelStatesTexts[stateName];
            if (!isSetOnText) {
              var targetElEmphasisState = targetEl.ensureState(stateName);
              targetElEmphasisState.textConfig = createTextConfig(stateModel, opt, true);
            }
          }
        }
        textContent.silent = !!normalModel.getShallow("silent");
        if (textContent.style.x != null) {
          normalStyle.x = textContent.style.x;
        }
        if (textContent.style.y != null) {
          normalStyle.y = textContent.style.y;
        }
        textContent.ignore = !showNormal;
        textContent.useStyle(normalStyle);
        textContent.dirty();
        if (opt.enableTextSetter) {
          labelInner(textContent).setLabelText = function(interpolatedValue) {
            var labelStatesTexts2 = getLabelText(opt, labelStatesModels, interpolatedValue);
            setLabelText(textContent, labelStatesTexts2);
          };
        }
      } else if (textContent) {
        textContent.ignore = true;
      }
      targetEl.dirty();
    }
    function getLabelStatesModels(itemModel, labelName) {
      labelName = labelName || "label";
      var statesModels = {
        normal: itemModel.getModel(labelName)
      };
      for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
        var stateName = SPECIAL_STATES[i2];
        statesModels[stateName] = itemModel.getModel([stateName, labelName]);
      }
      return statesModels;
    }
    function createTextStyle(textStyleModel, specifiedTextStyle, opt, isNotNormal, isAttached) {
      var textStyle = {};
      setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached);
      specifiedTextStyle && extend$1(textStyle, specifiedTextStyle);
      return textStyle;
    }
    function createTextConfig(textStyleModel, opt, isNotNormal) {
      opt = opt || {};
      var textConfig = {};
      var labelPosition;
      var labelRotate = textStyleModel.getShallow("rotate");
      var labelDistance = retrieve2(textStyleModel.getShallow("distance"), isNotNormal ? null : 5);
      var labelOffset = textStyleModel.getShallow("offset");
      labelPosition = textStyleModel.getShallow("position") || (isNotNormal ? null : "inside");
      labelPosition === "outside" && (labelPosition = opt.defaultOutsidePosition || "top");
      if (labelPosition != null) {
        textConfig.position = labelPosition;
      }
      if (labelOffset != null) {
        textConfig.offset = labelOffset;
      }
      if (labelRotate != null) {
        labelRotate *= Math.PI / 180;
        textConfig.rotation = labelRotate;
      }
      if (labelDistance != null) {
        textConfig.distance = labelDistance;
      }
      textConfig.outsideFill = textStyleModel.get("color") === "inherit" ? opt.inheritColor || null : "auto";
      return textConfig;
    }
    function setTextStyleCommon(textStyle, textStyleModel, opt, isNotNormal, isAttached) {
      opt = opt || EMPTY_OBJ;
      var ecModel = textStyleModel.ecModel;
      var globalTextStyle = ecModel && ecModel.option.textStyle;
      var richItemNames = getRichItemNames(textStyleModel);
      var richResult;
      if (richItemNames) {
        richResult = {};
        for (var name_1 in richItemNames) {
          if (richItemNames.hasOwnProperty(name_1)) {
            var richTextStyle = textStyleModel.getModel(["rich", name_1]);
            setTokenTextStyle(richResult[name_1] = {}, richTextStyle, globalTextStyle, opt, isNotNormal, isAttached, false, true);
          }
        }
      }
      if (richResult) {
        textStyle.rich = richResult;
      }
      var overflow2 = textStyleModel.get("overflow");
      if (overflow2) {
        textStyle.overflow = overflow2;
      }
      var margin = textStyleModel.get("minMargin");
      if (margin != null) {
        textStyle.margin = margin;
      }
      setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, true, false);
    }
    function getRichItemNames(textStyleModel) {
      var richItemNameMap;
      while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {
        var rich = (textStyleModel.option || EMPTY_OBJ).rich;
        if (rich) {
          richItemNameMap = richItemNameMap || {};
          var richKeys = keys$1(rich);
          for (var i2 = 0; i2 < richKeys.length; i2++) {
            var richKey = richKeys[i2];
            richItemNameMap[richKey] = 1;
          }
        }
        textStyleModel = textStyleModel.parentModel;
      }
      return richItemNameMap;
    }
    var TEXT_PROPS_WITH_GLOBAL = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"];
    var TEXT_PROPS_SELF = ["align", "lineHeight", "width", "height", "tag", "verticalAlign", "ellipsis"];
    var TEXT_PROPS_BOX = ["padding", "borderWidth", "borderRadius", "borderDashOffset", "backgroundColor", "borderColor", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"];
    function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isNotNormal, isAttached, isBlock, inRich) {
      globalTextStyle = !isNotNormal && globalTextStyle || EMPTY_OBJ;
      var inheritColor = opt && opt.inheritColor;
      var fillColor = textStyleModel.getShallow("color");
      var strokeColor = textStyleModel.getShallow("textBorderColor");
      var opacity2 = retrieve2(textStyleModel.getShallow("opacity"), globalTextStyle.opacity);
      if (fillColor === "inherit" || fillColor === "auto") {
        if (inheritColor) {
          fillColor = inheritColor;
        } else {
          fillColor = null;
        }
      }
      if (strokeColor === "inherit" || strokeColor === "auto") {
        if (inheritColor) {
          strokeColor = inheritColor;
        } else {
          strokeColor = null;
        }
      }
      if (!isAttached) {
        fillColor = fillColor || globalTextStyle.color;
        strokeColor = strokeColor || globalTextStyle.textBorderColor;
      }
      if (fillColor != null) {
        textStyle.fill = fillColor;
      }
      if (strokeColor != null) {
        textStyle.stroke = strokeColor;
      }
      var textBorderWidth = retrieve2(textStyleModel.getShallow("textBorderWidth"), globalTextStyle.textBorderWidth);
      if (textBorderWidth != null) {
        textStyle.lineWidth = textBorderWidth;
      }
      var textBorderType = retrieve2(textStyleModel.getShallow("textBorderType"), globalTextStyle.textBorderType);
      if (textBorderType != null) {
        textStyle.lineDash = textBorderType;
      }
      var textBorderDashOffset = retrieve2(textStyleModel.getShallow("textBorderDashOffset"), globalTextStyle.textBorderDashOffset);
      if (textBorderDashOffset != null) {
        textStyle.lineDashOffset = textBorderDashOffset;
      }
      if (!isNotNormal && opacity2 == null && !inRich) {
        opacity2 = opt && opt.defaultOpacity;
      }
      if (opacity2 != null) {
        textStyle.opacity = opacity2;
      }
      if (!isNotNormal && !isAttached) {
        if (textStyle.fill == null && opt.inheritColor) {
          textStyle.fill = opt.inheritColor;
        }
      }
      for (var i2 = 0; i2 < TEXT_PROPS_WITH_GLOBAL.length; i2++) {
        var key = TEXT_PROPS_WITH_GLOBAL[i2];
        var val = retrieve2(textStyleModel.getShallow(key), globalTextStyle[key]);
        if (val != null) {
          textStyle[key] = val;
        }
      }
      for (var i2 = 0; i2 < TEXT_PROPS_SELF.length; i2++) {
        var key = TEXT_PROPS_SELF[i2];
        var val = textStyleModel.getShallow(key);
        if (val != null) {
          textStyle[key] = val;
        }
      }
      if (textStyle.verticalAlign == null) {
        var baseline = textStyleModel.getShallow("baseline");
        if (baseline != null) {
          textStyle.verticalAlign = baseline;
        }
      }
      if (!isBlock || !opt.disableBox) {
        for (var i2 = 0; i2 < TEXT_PROPS_BOX.length; i2++) {
          var key = TEXT_PROPS_BOX[i2];
          var val = textStyleModel.getShallow(key);
          if (val != null) {
            textStyle[key] = val;
          }
        }
        var borderType = textStyleModel.getShallow("borderType");
        if (borderType != null) {
          textStyle.borderDash = borderType;
        }
        if ((textStyle.backgroundColor === "auto" || textStyle.backgroundColor === "inherit") && inheritColor) {
          textStyle.backgroundColor = inheritColor;
        }
        if ((textStyle.borderColor === "auto" || textStyle.borderColor === "inherit") && inheritColor) {
          textStyle.borderColor = inheritColor;
        }
      }
    }
    function getFont(opt, ecModel) {
      var gTextStyleModel = ecModel && ecModel.getModel("textStyle");
      return trim$2([
        // FIXME in node-canvas fontWeight is before fontStyle
        opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow("fontStyle") || "",
        opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow("fontWeight") || "",
        (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow("fontSize") || 12) + "px",
        opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow("fontFamily") || "sans-serif"
      ].join(" "));
    }
    var labelInner = makeInner();
    function setLabelValueAnimation(label, labelStatesModels, value, getDefaultText) {
      if (!label) {
        return;
      }
      var obj = labelInner(label);
      obj.prevValue = obj.value;
      obj.value = value;
      var normalLabelModel = labelStatesModels.normal;
      obj.valueAnimation = normalLabelModel.get("valueAnimation");
      if (obj.valueAnimation) {
        obj.precision = normalLabelModel.get("precision");
        obj.defaultInterpolatedText = getDefaultText;
        obj.statesModels = labelStatesModels;
      }
    }
    function animateLabelValue(textEl, dataIndex, data, animatableModel, labelFetcher) {
      var labelInnerStore = labelInner(textEl);
      if (!labelInnerStore.valueAnimation || labelInnerStore.prevValue === labelInnerStore.value) {
        return;
      }
      var defaultInterpolatedText = labelInnerStore.defaultInterpolatedText;
      var currValue = retrieve2(labelInnerStore.interpolatedValue, labelInnerStore.prevValue);
      var targetValue = labelInnerStore.value;
      function during(percent) {
        var interpolated = interpolateRawValues(data, labelInnerStore.precision, currValue, targetValue, percent);
        labelInnerStore.interpolatedValue = percent === 1 ? null : interpolated;
        var labelText = getLabelText({
          labelDataIndex: dataIndex,
          labelFetcher,
          defaultText: defaultInterpolatedText ? defaultInterpolatedText(interpolated) : interpolated + ""
        }, labelInnerStore.statesModels, interpolated);
        setLabelText(textEl, labelText);
      }
      textEl.percent = 0;
      (labelInnerStore.prevValue == null ? initProps : updateProps$1)(textEl, {
        // percent is used to prevent animation from being aborted #15916
        percent: 1
      }, animatableModel, dataIndex, null, during);
    }
    var PATH_COLOR = ["textStyle", "color"];
    var textStyleParams = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "padding", "lineHeight", "rich", "width", "height", "overflow"];
    var tmpText = new ZRText();
    var TextStyleMixin = (
      /** @class */
      function() {
        function TextStyleMixin2() {
        }
        TextStyleMixin2.prototype.getTextColor = function(isEmphasis) {
          var ecModel = this.ecModel;
          return this.getShallow("color") || (!isEmphasis && ecModel ? ecModel.get(PATH_COLOR) : null);
        };
        TextStyleMixin2.prototype.getFont = function() {
          return getFont({
            fontStyle: this.getShallow("fontStyle"),
            fontWeight: this.getShallow("fontWeight"),
            fontSize: this.getShallow("fontSize"),
            fontFamily: this.getShallow("fontFamily")
          }, this.ecModel);
        };
        TextStyleMixin2.prototype.getTextRect = function(text) {
          var style = {
            text,
            verticalAlign: this.getShallow("verticalAlign") || this.getShallow("baseline")
          };
          for (var i2 = 0; i2 < textStyleParams.length; i2++) {
            style[textStyleParams[i2]] = this.getShallow(textStyleParams[i2]);
          }
          tmpText.useStyle(style);
          tmpText.update();
          return tmpText.getBoundingRect();
        };
        return TextStyleMixin2;
      }()
    );
    var LINE_STYLE_KEY_MAP = [
      ["lineWidth", "width"],
      ["stroke", "color"],
      ["opacity"],
      ["shadowBlur"],
      ["shadowOffsetX"],
      ["shadowOffsetY"],
      ["shadowColor"],
      ["lineDash", "type"],
      ["lineDashOffset", "dashOffset"],
      ["lineCap", "cap"],
      ["lineJoin", "join"],
      ["miterLimit"]
      // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
      // So do not transfer decal directly.
    ];
    var getLineStyle = makeStyleMapper(LINE_STYLE_KEY_MAP);
    var LineStyleMixin = (
      /** @class */
      function() {
        function LineStyleMixin2() {
        }
        LineStyleMixin2.prototype.getLineStyle = function(excludes) {
          return getLineStyle(this, excludes);
        };
        return LineStyleMixin2;
      }()
    );
    var ITEM_STYLE_KEY_MAP = [
      ["fill", "color"],
      ["stroke", "borderColor"],
      ["lineWidth", "borderWidth"],
      ["opacity"],
      ["shadowBlur"],
      ["shadowOffsetX"],
      ["shadowOffsetY"],
      ["shadowColor"],
      ["lineDash", "borderType"],
      ["lineDashOffset", "borderDashOffset"],
      ["lineCap", "borderCap"],
      ["lineJoin", "borderJoin"],
      ["miterLimit", "borderMiterLimit"]
      // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
      // So do not transfer decal directly.
    ];
    var getItemStyle = makeStyleMapper(ITEM_STYLE_KEY_MAP);
    var ItemStyleMixin = (
      /** @class */
      function() {
        function ItemStyleMixin2() {
        }
        ItemStyleMixin2.prototype.getItemStyle = function(excludes, includes) {
          return getItemStyle(this, excludes, includes);
        };
        return ItemStyleMixin2;
      }()
    );
    var Model = (
      /** @class */
      function() {
        function Model2(option, parentModel, ecModel) {
          this.parentModel = parentModel;
          this.ecModel = ecModel;
          this.option = option;
        }
        Model2.prototype.init = function(option, parentModel, ecModel) {
        };
        Model2.prototype.mergeOption = function(option, ecModel) {
          merge$1(this.option, option, true);
        };
        Model2.prototype.get = function(path, ignoreParent) {
          if (path == null) {
            return this.option;
          }
          return this._doGet(this.parsePath(path), !ignoreParent && this.parentModel);
        };
        Model2.prototype.getShallow = function(key, ignoreParent) {
          var option = this.option;
          var val = option == null ? option : option[key];
          if (val == null && !ignoreParent) {
            var parentModel = this.parentModel;
            if (parentModel) {
              val = parentModel.getShallow(key);
            }
          }
          return val;
        };
        Model2.prototype.getModel = function(path, parentModel) {
          var hasPath2 = path != null;
          var pathFinal = hasPath2 ? this.parsePath(path) : null;
          var obj = hasPath2 ? this._doGet(pathFinal) : this.option;
          parentModel = parentModel || this.parentModel && this.parentModel.getModel(this.resolveParentPath(pathFinal));
          return new Model2(obj, parentModel, this.ecModel);
        };
        Model2.prototype.isEmpty = function() {
          return this.option == null;
        };
        Model2.prototype.restoreData = function() {
        };
        Model2.prototype.clone = function() {
          var Ctor = this.constructor;
          return new Ctor(clone$4(this.option));
        };
        Model2.prototype.parsePath = function(path) {
          if (typeof path === "string") {
            return path.split(".");
          }
          return path;
        };
        Model2.prototype.resolveParentPath = function(path) {
          return path;
        };
        Model2.prototype.isAnimationEnabled = function() {
          if (!env.node && this.option) {
            if (this.option.animation != null) {
              return !!this.option.animation;
            } else if (this.parentModel) {
              return this.parentModel.isAnimationEnabled();
            }
          }
        };
        Model2.prototype._doGet = function(pathArr, parentModel) {
          var obj = this.option;
          if (!pathArr) {
            return obj;
          }
          for (var i2 = 0; i2 < pathArr.length; i2++) {
            if (!pathArr[i2]) {
              continue;
            }
            obj = obj && typeof obj === "object" ? obj[pathArr[i2]] : null;
            if (obj == null) {
              break;
            }
          }
          if (obj == null && parentModel) {
            obj = parentModel._doGet(this.resolveParentPath(pathArr), parentModel.parentModel);
          }
          return obj;
        };
        return Model2;
      }()
    );
    enableClassExtend(Model);
    enableClassCheck(Model);
    mixin(Model, LineStyleMixin);
    mixin(Model, ItemStyleMixin);
    mixin(Model, AreaStyleMixin);
    mixin(Model, TextStyleMixin);
    var base = Math.round(Math.random() * 10);
    function getUID(type) {
      return [type || "", base++].join("_");
    }
    function enableSubTypeDefaulter(target) {
      var subTypeDefaulters = {};
      target.registerSubTypeDefaulter = function(componentType, defaulter) {
        var componentTypeInfo = parseClassType(componentType);
        subTypeDefaulters[componentTypeInfo.main] = defaulter;
      };
      target.determineSubType = function(componentType, option) {
        var type = option.type;
        if (!type) {
          var componentTypeMain = parseClassType(componentType).main;
          if (target.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {
            type = subTypeDefaulters[componentTypeMain](option);
          }
        }
        return type;
      };
    }
    function enableTopologicalTravel(entity, dependencyGetter) {
      entity.topologicalTravel = function(targetNameList, fullNameList, callback, context) {
        if (!targetNameList.length) {
          return;
        }
        var result = makeDepndencyGraph(fullNameList);
        var graph = result.graph;
        var noEntryList = result.noEntryList;
        var targetNameSet = {};
        each$f(targetNameList, function(name) {
          targetNameSet[name] = true;
        });
        while (noEntryList.length) {
          var currComponentType = noEntryList.pop();
          var currVertex = graph[currComponentType];
          var isInTargetNameSet = !!targetNameSet[currComponentType];
          if (isInTargetNameSet) {
            callback.call(context, currComponentType, currVertex.originalDeps.slice());
            delete targetNameSet[currComponentType];
          }
          each$f(currVertex.successor, isInTargetNameSet ? removeEdgeAndAdd : removeEdge);
        }
        each$f(targetNameSet, function() {
          var errMsg = "";
          throw new Error(errMsg);
        });
        function removeEdge(succComponentType) {
          graph[succComponentType].entryCount--;
          if (graph[succComponentType].entryCount === 0) {
            noEntryList.push(succComponentType);
          }
        }
        function removeEdgeAndAdd(succComponentType) {
          targetNameSet[succComponentType] = true;
          removeEdge(succComponentType);
        }
      };
      function makeDepndencyGraph(fullNameList) {
        var graph = {};
        var noEntryList = [];
        each$f(fullNameList, function(name) {
          var thisItem = createDependencyGraphItem(graph, name);
          var originalDeps = thisItem.originalDeps = dependencyGetter(name);
          var availableDeps = getAvailableDependencies(originalDeps, fullNameList);
          thisItem.entryCount = availableDeps.length;
          if (thisItem.entryCount === 0) {
            noEntryList.push(name);
          }
          each$f(availableDeps, function(dependentName) {
            if (indexOf(thisItem.predecessor, dependentName) < 0) {
              thisItem.predecessor.push(dependentName);
            }
            var thatItem = createDependencyGraphItem(graph, dependentName);
            if (indexOf(thatItem.successor, dependentName) < 0) {
              thatItem.successor.push(name);
            }
          });
        });
        return {
          graph,
          noEntryList
        };
      }
      function createDependencyGraphItem(graph, name) {
        if (!graph[name]) {
          graph[name] = {
            predecessor: [],
            successor: []
          };
        }
        return graph[name];
      }
      function getAvailableDependencies(originalDeps, fullNameList) {
        var availableDeps = [];
        each$f(originalDeps, function(dep) {
          indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);
        });
        return availableDeps;
      }
    }
    function inheritDefaultOption(superOption, subOption) {
      return merge$1(merge$1({}, superOption, true), subOption, true);
    }
    const langEN = {
      time: {
        month: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
        monthAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
        dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
        dayOfWeekAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
      },
      legend: {
        selector: {
          all: "All",
          inverse: "Inv"
        }
      },
      toolbox: {
        brush: {
          title: {
            rect: "Box Select",
            polygon: "Lasso Select",
            lineX: "Horizontally Select",
            lineY: "Vertically Select",
            keep: "Keep Selections",
            clear: "Clear Selections"
          }
        },
        dataView: {
          title: "Data View",
          lang: ["Data View", "Close", "Refresh"]
        },
        dataZoom: {
          title: {
            zoom: "Zoom",
            back: "Zoom Reset"
          }
        },
        magicType: {
          title: {
            line: "Switch to Line Chart",
            bar: "Switch to Bar Chart",
            stack: "Stack",
            tiled: "Tile"
          }
        },
        restore: {
          title: "Restore"
        },
        saveAsImage: {
          title: "Save as Image",
          lang: ["Right Click to Save Image"]
        }
      },
      series: {
        typeNames: {
          pie: "Pie chart",
          bar: "Bar chart",
          line: "Line chart",
          scatter: "Scatter plot",
          effectScatter: "Ripple scatter plot",
          radar: "Radar chart",
          tree: "Tree",
          treemap: "Treemap",
          boxplot: "Boxplot",
          candlestick: "Candlestick",
          k: "K line chart",
          heatmap: "Heat map",
          map: "Map",
          parallel: "Parallel coordinate map",
          lines: "Line graph",
          graph: "Relationship graph",
          sankey: "Sankey diagram",
          funnel: "Funnel chart",
          gauge: "Gauge",
          pictorialBar: "Pictorial bar",
          themeRiver: "Theme River Map",
          sunburst: "Sunburst",
          custom: "Custom chart",
          chart: "Chart"
        }
      },
      aria: {
        general: {
          withTitle: 'This is a chart about "{title}"',
          withoutTitle: "This is a chart"
        },
        series: {
          single: {
            prefix: "",
            withName: " with type {seriesType} named {seriesName}.",
            withoutName: " with type {seriesType}."
          },
          multiple: {
            prefix: ". It consists of {seriesCount} series count.",
            withName: " The {seriesId} series is a {seriesType} representing {seriesName}.",
            withoutName: " The {seriesId} series is a {seriesType}.",
            separator: {
              middle: "",
              end: ""
            }
          }
        },
        data: {
          allData: "The data is as follows: ",
          partialData: "The first {displayCnt} items are: ",
          withName: "the data for {name} is {value}",
          withoutName: "{value}",
          separator: {
            middle: ", ",
            end: ". "
          }
        }
      }
    };
    const langZH = {
      time: {
        month: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
        monthAbbr: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
        dayOfWeekAbbr: ["日", "一", "二", "三", "四", "五", "六"]
      },
      legend: {
        selector: {
          all: "全选",
          inverse: "反选"
        }
      },
      toolbox: {
        brush: {
          title: {
            rect: "矩形选择",
            polygon: "圈选",
            lineX: "横向选择",
            lineY: "纵向选择",
            keep: "保持选择",
            clear: "清除选择"
          }
        },
        dataView: {
          title: "数据视图",
          lang: ["数据视图", "关闭", "刷新"]
        },
        dataZoom: {
          title: {
            zoom: "区域缩放",
            back: "区域缩放还原"
          }
        },
        magicType: {
          title: {
            line: "切换为折线图",
            bar: "切换为柱状图",
            stack: "切换为堆叠",
            tiled: "切换为平铺"
          }
        },
        restore: {
          title: "还原"
        },
        saveAsImage: {
          title: "保存为图片",
          lang: ["右键另存为图片"]
        }
      },
      series: {
        typeNames: {
          pie: "饼图",
          bar: "柱状图",
          line: "折线图",
          scatter: "散点图",
          effectScatter: "涟漪散点图",
          radar: "雷达图",
          tree: "树图",
          treemap: "矩形树图",
          boxplot: "箱型图",
          candlestick: "K线图",
          k: "K线图",
          heatmap: "热力图",
          map: "地图",
          parallel: "平行坐标图",
          lines: "线图",
          graph: "关系图",
          sankey: "桑基图",
          funnel: "漏斗图",
          gauge: "仪表盘图",
          pictorialBar: "象形柱图",
          themeRiver: "主题河流图",
          sunburst: "旭日图",
          custom: "自定义图表",
          chart: "图表"
        }
      },
      aria: {
        general: {
          withTitle: "这是一个关于“{title}”的图表。",
          withoutTitle: "这是一个图表，"
        },
        series: {
          single: {
            prefix: "",
            withName: "图表类型是{seriesType}，表示{seriesName}。",
            withoutName: "图表类型是{seriesType}。"
          },
          multiple: {
            prefix: "它由{seriesCount}个图表系列组成。",
            withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType}，",
            withoutName: "第{seriesId}个系列是一个{seriesType}，",
            separator: {
              middle: "；",
              end: "。"
            }
          }
        },
        data: {
          allData: "其数据是——",
          partialData: "其中，前{displayCnt}项是——",
          withName: "{name}的数据是{value}",
          withoutName: "{value}",
          separator: {
            middle: "，",
            end: ""
          }
        }
      }
    };
    var LOCALE_ZH = "ZH";
    var LOCALE_EN = "EN";
    var DEFAULT_LOCALE = LOCALE_EN;
    var localeStorage = {};
    var localeModels = {};
    var SYSTEM_LANG = !env.domSupported ? DEFAULT_LOCALE : function() {
      var langStr = (
        /* eslint-disable-next-line */
        (document.documentElement.lang || navigator.language || navigator.browserLanguage || DEFAULT_LOCALE).toUpperCase()
      );
      return langStr.indexOf(LOCALE_ZH) > -1 ? LOCALE_ZH : DEFAULT_LOCALE;
    }();
    function registerLocale(locale, localeObj) {
      locale = locale.toUpperCase();
      localeModels[locale] = new Model(localeObj);
      localeStorage[locale] = localeObj;
    }
    function createLocaleObject(locale) {
      if (isString$1(locale)) {
        var localeObj = localeStorage[locale.toUpperCase()] || {};
        if (locale === LOCALE_ZH || locale === LOCALE_EN) {
          return clone$4(localeObj);
        } else {
          return merge$1(clone$4(localeObj), clone$4(localeStorage[DEFAULT_LOCALE]), false);
        }
      } else {
        return merge$1(clone$4(locale), clone$4(localeStorage[DEFAULT_LOCALE]), false);
      }
    }
    function getLocaleModel(lang) {
      return localeModels[lang];
    }
    function getDefaultLocaleModel() {
      return localeModels[DEFAULT_LOCALE];
    }
    registerLocale(LOCALE_EN, langEN);
    registerLocale(LOCALE_ZH, langZH);
    var ONE_SECOND = 1e3;
    var ONE_MINUTE = ONE_SECOND * 60;
    var ONE_HOUR = ONE_MINUTE * 60;
    var ONE_DAY = ONE_HOUR * 24;
    var ONE_YEAR = ONE_DAY * 365;
    var defaultLeveledFormatter = {
      year: "{yyyy}",
      month: "{MMM}",
      day: "{d}",
      hour: "{HH}:{mm}",
      minute: "{HH}:{mm}",
      second: "{HH}:{mm}:{ss}",
      millisecond: "{HH}:{mm}:{ss} {SSS}",
      none: "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"
    };
    var fullDayFormatter = "{yyyy}-{MM}-{dd}";
    var fullLeveledFormatter = {
      year: "{yyyy}",
      month: "{yyyy}-{MM}",
      day: fullDayFormatter,
      hour: fullDayFormatter + " " + defaultLeveledFormatter.hour,
      minute: fullDayFormatter + " " + defaultLeveledFormatter.minute,
      second: fullDayFormatter + " " + defaultLeveledFormatter.second,
      millisecond: defaultLeveledFormatter.none
    };
    var primaryTimeUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"];
    var timeUnits = ["year", "half-year", "quarter", "month", "week", "half-week", "day", "half-day", "quarter-day", "hour", "minute", "second", "millisecond"];
    function pad(str, len2) {
      str += "";
      return "0000".substr(0, len2 - str.length) + str;
    }
    function getPrimaryTimeUnit(timeUnit) {
      switch (timeUnit) {
        case "half-year":
        case "quarter":
          return "month";
        case "week":
        case "half-week":
          return "day";
        case "half-day":
        case "quarter-day":
          return "hour";
        default:
          return timeUnit;
      }
    }
    function isPrimaryTimeUnit(timeUnit) {
      return timeUnit === getPrimaryTimeUnit(timeUnit);
    }
    function getDefaultFormatPrecisionOfInterval(timeUnit) {
      switch (timeUnit) {
        case "year":
        case "month":
          return "day";
        case "millisecond":
          return "millisecond";
        default:
          return "second";
      }
    }
    function format(time2, template, isUTC, lang) {
      var date = parseDate$1(time2);
      var y = date[fullYearGetterName(isUTC)]();
      var M2 = date[monthGetterName(isUTC)]() + 1;
      var q2 = Math.floor((M2 - 1) / 3) + 1;
      var d2 = date[dateGetterName(isUTC)]();
      var e2 = date["get" + (isUTC ? "UTC" : "") + "Day"]();
      var H4 = date[hoursGetterName(isUTC)]();
      var h2 = (H4 - 1) % 12 + 1;
      var m2 = date[minutesGetterName(isUTC)]();
      var s2 = date[secondsGetterName(isUTC)]();
      var S2 = date[millisecondsGetterName(isUTC)]();
      var a2 = H4 >= 12 ? "pm" : "am";
      var A2 = a2.toUpperCase();
      var localeModel = lang instanceof Model ? lang : getLocaleModel(lang || SYSTEM_LANG) || getDefaultLocaleModel();
      var timeModel = localeModel.getModel("time");
      var month = timeModel.get("month");
      var monthAbbr = timeModel.get("monthAbbr");
      var dayOfWeek = timeModel.get("dayOfWeek");
      var dayOfWeekAbbr = timeModel.get("dayOfWeekAbbr");
      return (template || "").replace(/{a}/g, a2 + "").replace(/{A}/g, A2 + "").replace(/{yyyy}/g, y + "").replace(/{yy}/g, pad(y % 100 + "", 2)).replace(/{Q}/g, q2 + "").replace(/{MMMM}/g, month[M2 - 1]).replace(/{MMM}/g, monthAbbr[M2 - 1]).replace(/{MM}/g, pad(M2, 2)).replace(/{M}/g, M2 + "").replace(/{dd}/g, pad(d2, 2)).replace(/{d}/g, d2 + "").replace(/{eeee}/g, dayOfWeek[e2]).replace(/{ee}/g, dayOfWeekAbbr[e2]).replace(/{e}/g, e2 + "").replace(/{HH}/g, pad(H4, 2)).replace(/{H}/g, H4 + "").replace(/{hh}/g, pad(h2 + "", 2)).replace(/{h}/g, h2 + "").replace(/{mm}/g, pad(m2, 2)).replace(/{m}/g, m2 + "").replace(/{ss}/g, pad(s2, 2)).replace(/{s}/g, s2 + "").replace(/{SSS}/g, pad(S2, 3)).replace(/{S}/g, S2 + "");
    }
    function leveledFormat(tick, idx, formatter2, lang, isUTC) {
      var template = null;
      if (isString$1(formatter2)) {
        template = formatter2;
      } else if (isFunction$1(formatter2)) {
        template = formatter2(tick.value, idx, {
          level: tick.level
        });
      } else {
        var defaults2 = extend$1({}, defaultLeveledFormatter);
        if (tick.level > 0) {
          for (var i2 = 0; i2 < primaryTimeUnits.length; ++i2) {
            defaults2[primaryTimeUnits[i2]] = "{primary|" + defaults2[primaryTimeUnits[i2]] + "}";
          }
        }
        var mergedFormatter = formatter2 ? formatter2.inherit === false ? formatter2 : defaults$1(formatter2, defaults2) : defaults2;
        var unit2 = getUnitFromValue(tick.value, isUTC);
        if (mergedFormatter[unit2]) {
          template = mergedFormatter[unit2];
        } else if (mergedFormatter.inherit) {
          var targetId = timeUnits.indexOf(unit2);
          for (var i2 = targetId - 1; i2 >= 0; --i2) {
            if (mergedFormatter[unit2]) {
              template = mergedFormatter[unit2];
              break;
            }
          }
          template = template || defaults2.none;
        }
        if (isArray$2(template)) {
          var levelId = tick.level == null ? 0 : tick.level >= 0 ? tick.level : template.length + tick.level;
          levelId = Math.min(levelId, template.length - 1);
          template = template[levelId];
        }
      }
      return format(new Date(tick.value), template, isUTC, lang);
    }
    function getUnitFromValue(value, isUTC) {
      var date = parseDate$1(value);
      var M2 = date[monthGetterName(isUTC)]() + 1;
      var d2 = date[dateGetterName(isUTC)]();
      var h2 = date[hoursGetterName(isUTC)]();
      var m2 = date[minutesGetterName(isUTC)]();
      var s2 = date[secondsGetterName(isUTC)]();
      var S2 = date[millisecondsGetterName(isUTC)]();
      var isSecond = S2 === 0;
      var isMinute = isSecond && s2 === 0;
      var isHour = isMinute && m2 === 0;
      var isDay = isHour && h2 === 0;
      var isMonth = isDay && d2 === 1;
      var isYear = isMonth && M2 === 1;
      if (isYear) {
        return "year";
      } else if (isMonth) {
        return "month";
      } else if (isDay) {
        return "day";
      } else if (isHour) {
        return "hour";
      } else if (isMinute) {
        return "minute";
      } else if (isSecond) {
        return "second";
      } else {
        return "millisecond";
      }
    }
    function getUnitValue(value, unit2, isUTC) {
      var date = isNumber$1(value) ? parseDate$1(value) : value;
      unit2 = unit2 || getUnitFromValue(value, isUTC);
      switch (unit2) {
        case "year":
          return date[fullYearGetterName(isUTC)]();
        case "half-year":
          return date[monthGetterName(isUTC)]() >= 6 ? 1 : 0;
        case "quarter":
          return Math.floor((date[monthGetterName(isUTC)]() + 1) / 4);
        case "month":
          return date[monthGetterName(isUTC)]();
        case "day":
          return date[dateGetterName(isUTC)]();
        case "half-day":
          return date[hoursGetterName(isUTC)]() / 24;
        case "hour":
          return date[hoursGetterName(isUTC)]();
        case "minute":
          return date[minutesGetterName(isUTC)]();
        case "second":
          return date[secondsGetterName(isUTC)]();
        case "millisecond":
          return date[millisecondsGetterName(isUTC)]();
      }
    }
    function fullYearGetterName(isUTC) {
      return isUTC ? "getUTCFullYear" : "getFullYear";
    }
    function monthGetterName(isUTC) {
      return isUTC ? "getUTCMonth" : "getMonth";
    }
    function dateGetterName(isUTC) {
      return isUTC ? "getUTCDate" : "getDate";
    }
    function hoursGetterName(isUTC) {
      return isUTC ? "getUTCHours" : "getHours";
    }
    function minutesGetterName(isUTC) {
      return isUTC ? "getUTCMinutes" : "getMinutes";
    }
    function secondsGetterName(isUTC) {
      return isUTC ? "getUTCSeconds" : "getSeconds";
    }
    function millisecondsGetterName(isUTC) {
      return isUTC ? "getUTCMilliseconds" : "getMilliseconds";
    }
    function fullYearSetterName(isUTC) {
      return isUTC ? "setUTCFullYear" : "setFullYear";
    }
    function monthSetterName(isUTC) {
      return isUTC ? "setUTCMonth" : "setMonth";
    }
    function dateSetterName(isUTC) {
      return isUTC ? "setUTCDate" : "setDate";
    }
    function hoursSetterName(isUTC) {
      return isUTC ? "setUTCHours" : "setHours";
    }
    function minutesSetterName(isUTC) {
      return isUTC ? "setUTCMinutes" : "setMinutes";
    }
    function secondsSetterName(isUTC) {
      return isUTC ? "setUTCSeconds" : "setSeconds";
    }
    function millisecondsSetterName(isUTC) {
      return isUTC ? "setUTCMilliseconds" : "setMilliseconds";
    }
    function addCommas(x2) {
      if (!isNumeric(x2)) {
        return isString$1(x2) ? x2 : "-";
      }
      var parts = (x2 + "").split(".");
      return parts[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (parts.length > 1 ? "." + parts[1] : "");
    }
    function toCamelCase$1(str, upperCaseFirst) {
      str = (str || "").toLowerCase().replace(/-(.)/g, function(match, group1) {
        return group1.toUpperCase();
      });
      if (upperCaseFirst && str) {
        str = str.charAt(0).toUpperCase() + str.slice(1);
      }
      return str;
    }
    var normalizeCssArray = normalizeCssArray$1;
    function makeValueReadable(value, valueType, useUTC) {
      var USER_READABLE_DEFUALT_TIME_PATTERN = "{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";
      function stringToUserReadable(str) {
        return str && trim$2(str) ? str : "-";
      }
      function isNumberUserReadable(num) {
        return !!(num != null && !isNaN(num) && isFinite(num));
      }
      var isTypeTime = valueType === "time";
      var isValueDate = value instanceof Date;
      if (isTypeTime || isValueDate) {
        var date = isTypeTime ? parseDate$1(value) : value;
        if (!isNaN(+date)) {
          return format(date, USER_READABLE_DEFUALT_TIME_PATTERN, useUTC);
        } else if (isValueDate) {
          return "-";
        }
      }
      if (valueType === "ordinal") {
        return isStringSafe(value) ? stringToUserReadable(value) : isNumber$1(value) ? isNumberUserReadable(value) ? value + "" : "-" : "-";
      }
      var numericResult = numericToNumber(value);
      return isNumberUserReadable(numericResult) ? addCommas(numericResult) : isStringSafe(value) ? stringToUserReadable(value) : typeof value === "boolean" ? value + "" : "-";
    }
    var TPL_VAR_ALIAS = ["a", "b", "c", "d", "e", "f", "g"];
    var wrapVar = function(varName, seriesIdx) {
      return "{" + varName + (seriesIdx == null ? "" : seriesIdx) + "}";
    };
    function formatTpl(tpl, paramsList, encode2) {
      if (!isArray$2(paramsList)) {
        paramsList = [paramsList];
      }
      var seriesLen = paramsList.length;
      if (!seriesLen) {
        return "";
      }
      var $vars = paramsList[0].$vars || [];
      for (var i2 = 0; i2 < $vars.length; i2++) {
        var alias = TPL_VAR_ALIAS[i2];
        tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));
      }
      for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {
        for (var k2 = 0; k2 < $vars.length; k2++) {
          var val = paramsList[seriesIdx][$vars[k2]];
          tpl = tpl.replace(wrapVar(TPL_VAR_ALIAS[k2], seriesIdx), encode2 ? encodeHTML(val) : val);
        }
      }
      return tpl;
    }
    function formatTplSimple(tpl, param, encode2) {
      each$f(param, function(value, key) {
        tpl = tpl.replace("{" + key + "}", value);
      });
      return tpl;
    }
    function getTooltipMarker(inOpt, extraCssText) {
      var opt = isString$1(inOpt) ? {
        color: inOpt,
        extraCssText
      } : inOpt || {};
      var color2 = opt.color;
      var type = opt.type;
      extraCssText = opt.extraCssText;
      var renderMode = opt.renderMode || "html";
      if (!color2) {
        return "";
      }
      if (renderMode === "html") {
        return type === "subItem" ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + encodeHTML(color2) + ";" + (extraCssText || "") + '"></span>' : '<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:' + encodeHTML(color2) + ";" + (extraCssText || "") + '"></span>';
      } else {
        var markerId = opt.markerId || "markerX";
        return {
          renderMode,
          content: "{" + markerId + "|}  ",
          style: type === "subItem" ? {
            width: 4,
            height: 4,
            borderRadius: 2,
            backgroundColor: color2
          } : {
            width: 10,
            height: 10,
            borderRadius: 5,
            backgroundColor: color2
          }
        };
      }
    }
    function convertToColorString(color2, defaultColor) {
      defaultColor = defaultColor || "transparent";
      return isString$1(color2) ? color2 : isObject$5(color2) ? color2.colorStops && (color2.colorStops[0] || {}).color || defaultColor : defaultColor;
    }
    function windowOpen(link, target) {
      if (target === "_blank" || target === "blank") {
        var blank = window.open();
        blank.opener = null;
        blank.location.href = link;
      } else {
        window.open(link, target);
      }
    }
    var each$e = each$f;
    var LOCATION_PARAMS = ["left", "right", "top", "bottom", "width", "height"];
    var HV_NAMES = [["width", "left", "right"], ["height", "top", "bottom"]];
    function boxLayout(orient, group, gap, maxWidth, maxHeight) {
      var x2 = 0;
      var y = 0;
      if (maxWidth == null) {
        maxWidth = Infinity;
      }
      if (maxHeight == null) {
        maxHeight = Infinity;
      }
      var currentLineMaxSize = 0;
      group.eachChild(function(child, idx) {
        var rect = child.getBoundingRect();
        var nextChild = group.childAt(idx + 1);
        var nextChildRect = nextChild && nextChild.getBoundingRect();
        var nextX;
        var nextY;
        if (orient === "horizontal") {
          var moveX = rect.width + (nextChildRect ? -nextChildRect.x + rect.x : 0);
          nextX = x2 + moveX;
          if (nextX > maxWidth || child.newline) {
            x2 = 0;
            nextX = moveX;
            y += currentLineMaxSize + gap;
            currentLineMaxSize = rect.height;
          } else {
            currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);
          }
        } else {
          var moveY = rect.height + (nextChildRect ? -nextChildRect.y + rect.y : 0);
          nextY = y + moveY;
          if (nextY > maxHeight || child.newline) {
            x2 += currentLineMaxSize + gap;
            y = 0;
            nextY = moveY;
            currentLineMaxSize = rect.width;
          } else {
            currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);
          }
        }
        if (child.newline) {
          return;
        }
        child.x = x2;
        child.y = y;
        child.markRedraw();
        orient === "horizontal" ? x2 = nextX + gap : y = nextY + gap;
      });
    }
    var box = boxLayout;
    curry$1(boxLayout, "vertical");
    curry$1(boxLayout, "horizontal");
    function getAvailableSize(positionInfo, containerRect, margin) {
      var containerWidth = containerRect.width;
      var containerHeight = containerRect.height;
      var x2 = parsePercent(positionInfo.left, containerWidth);
      var y = parsePercent(positionInfo.top, containerHeight);
      var x22 = parsePercent(positionInfo.right, containerWidth);
      var y2 = parsePercent(positionInfo.bottom, containerHeight);
      (isNaN(x2) || isNaN(parseFloat(positionInfo.left))) && (x2 = 0);
      (isNaN(x22) || isNaN(parseFloat(positionInfo.right))) && (x22 = containerWidth);
      (isNaN(y) || isNaN(parseFloat(positionInfo.top))) && (y = 0);
      (isNaN(y2) || isNaN(parseFloat(positionInfo.bottom))) && (y2 = containerHeight);
      margin = normalizeCssArray(margin || 0);
      return {
        width: Math.max(x22 - x2 - margin[1] - margin[3], 0),
        height: Math.max(y2 - y - margin[0] - margin[2], 0)
      };
    }
    function getLayoutRect(positionInfo, containerRect, margin) {
      margin = normalizeCssArray(margin || 0);
      var containerWidth = containerRect.width;
      var containerHeight = containerRect.height;
      var left = parsePercent(positionInfo.left, containerWidth);
      var top = parsePercent(positionInfo.top, containerHeight);
      var right = parsePercent(positionInfo.right, containerWidth);
      var bottom = parsePercent(positionInfo.bottom, containerHeight);
      var width = parsePercent(positionInfo.width, containerWidth);
      var height = parsePercent(positionInfo.height, containerHeight);
      var verticalMargin = margin[2] + margin[0];
      var horizontalMargin = margin[1] + margin[3];
      var aspect = positionInfo.aspect;
      if (isNaN(width)) {
        width = containerWidth - right - horizontalMargin - left;
      }
      if (isNaN(height)) {
        height = containerHeight - bottom - verticalMargin - top;
      }
      if (aspect != null) {
        if (isNaN(width) && isNaN(height)) {
          if (aspect > containerWidth / containerHeight) {
            width = containerWidth * 0.8;
          } else {
            height = containerHeight * 0.8;
          }
        }
        if (isNaN(width)) {
          width = aspect * height;
        }
        if (isNaN(height)) {
          height = width / aspect;
        }
      }
      if (isNaN(left)) {
        left = containerWidth - right - width - horizontalMargin;
      }
      if (isNaN(top)) {
        top = containerHeight - bottom - height - verticalMargin;
      }
      switch (positionInfo.left || positionInfo.right) {
        case "center":
          left = containerWidth / 2 - width / 2 - margin[3];
          break;
        case "right":
          left = containerWidth - width - horizontalMargin;
          break;
      }
      switch (positionInfo.top || positionInfo.bottom) {
        case "middle":
        case "center":
          top = containerHeight / 2 - height / 2 - margin[0];
          break;
        case "bottom":
          top = containerHeight - height - verticalMargin;
          break;
      }
      left = left || 0;
      top = top || 0;
      if (isNaN(width)) {
        width = containerWidth - horizontalMargin - left - (right || 0);
      }
      if (isNaN(height)) {
        height = containerHeight - verticalMargin - top - (bottom || 0);
      }
      var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);
      rect.margin = margin;
      return rect;
    }
    function positionElement(el, positionInfo, containerRect, margin, opt, out2) {
      var h2 = !opt || !opt.hv || opt.hv[0];
      var v4 = !opt || !opt.hv || opt.hv[1];
      var boundingMode = opt && opt.boundingMode || "all";
      out2 = out2 || el;
      out2.x = el.x;
      out2.y = el.y;
      if (!h2 && !v4) {
        return false;
      }
      var rect;
      if (boundingMode === "raw") {
        rect = el.type === "group" ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) : el.getBoundingRect();
      } else {
        rect = el.getBoundingRect();
        if (el.needLocalTransform()) {
          var transform2 = el.getLocalTransform();
          rect = rect.clone();
          rect.applyTransform(transform2);
        }
      }
      var layoutRect = getLayoutRect(defaults$1({
        width: rect.width,
        height: rect.height
      }, positionInfo), containerRect, margin);
      var dx = h2 ? layoutRect.x - rect.x : 0;
      var dy = v4 ? layoutRect.y - rect.y : 0;
      if (boundingMode === "raw") {
        out2.x = dx;
        out2.y = dy;
      } else {
        out2.x += dx;
        out2.y += dy;
      }
      if (out2 === el) {
        el.markRedraw();
      }
      return true;
    }
    function sizeCalculable(option, hvIdx) {
      return option[HV_NAMES[hvIdx][0]] != null || option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null;
    }
    function fetchLayoutMode(ins) {
      var layoutMode = ins.layoutMode || ins.constructor.layoutMode;
      return isObject$5(layoutMode) ? layoutMode : layoutMode ? {
        type: layoutMode
      } : null;
    }
    function mergeLayoutParam(targetOption, newOption, opt) {
      var ignoreSize = opt && opt.ignoreSize;
      !isArray$2(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]);
      var hResult = merge2(HV_NAMES[0], 0);
      var vResult = merge2(HV_NAMES[1], 1);
      copy2(HV_NAMES[0], targetOption, hResult);
      copy2(HV_NAMES[1], targetOption, vResult);
      function merge2(names2, hvIdx) {
        var newParams = {};
        var newValueCount = 0;
        var merged = {};
        var mergedValueCount = 0;
        var enoughParamNumber = 2;
        each$e(names2, function(name) {
          merged[name] = targetOption[name];
        });
        each$e(names2, function(name) {
          hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
          hasValue(newParams, name) && newValueCount++;
          hasValue(merged, name) && mergedValueCount++;
        });
        if (ignoreSize[hvIdx]) {
          if (hasValue(newOption, names2[1])) {
            merged[names2[2]] = null;
          } else if (hasValue(newOption, names2[2])) {
            merged[names2[1]] = null;
          }
          return merged;
        }
        if (mergedValueCount === enoughParamNumber || !newValueCount) {
          return merged;
        } else if (newValueCount >= enoughParamNumber) {
          return newParams;
        } else {
          for (var i2 = 0; i2 < names2.length; i2++) {
            var name_1 = names2[i2];
            if (!hasProp(newParams, name_1) && hasProp(targetOption, name_1)) {
              newParams[name_1] = targetOption[name_1];
              break;
            }
          }
          return newParams;
        }
      }
      function hasProp(obj, name) {
        return obj.hasOwnProperty(name);
      }
      function hasValue(obj, name) {
        return obj[name] != null && obj[name] !== "auto";
      }
      function copy2(names2, target, source) {
        each$e(names2, function(name) {
          target[name] = source[name];
        });
      }
    }
    function getLayoutParams(source) {
      return copyLayoutParams({}, source);
    }
    function copyLayoutParams(target, source) {
      source && target && each$e(LOCATION_PARAMS, function(name) {
        source.hasOwnProperty(name) && (target[name] = source[name]);
      });
      return target;
    }
    var inner$l = makeInner();
    var ComponentModel = (
      /** @class */
      function(_super) {
        __extends$1(ComponentModel2, _super);
        function ComponentModel2(option, parentModel, ecModel) {
          var _this = _super.call(this, option, parentModel, ecModel) || this;
          _this.uid = getUID("ec_cpt_model");
          return _this;
        }
        ComponentModel2.prototype.init = function(option, parentModel, ecModel) {
          this.mergeDefaultAndTheme(option, ecModel);
        };
        ComponentModel2.prototype.mergeDefaultAndTheme = function(option, ecModel) {
          var layoutMode = fetchLayoutMode(this);
          var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
          var themeModel = ecModel.getTheme();
          merge$1(option, themeModel.get(this.mainType));
          merge$1(option, this.getDefaultOption());
          if (layoutMode) {
            mergeLayoutParam(option, inputPositionParams, layoutMode);
          }
        };
        ComponentModel2.prototype.mergeOption = function(option, ecModel) {
          merge$1(this.option, option, true);
          var layoutMode = fetchLayoutMode(this);
          if (layoutMode) {
            mergeLayoutParam(this.option, option, layoutMode);
          }
        };
        ComponentModel2.prototype.optionUpdated = function(newCptOption, isInit) {
        };
        ComponentModel2.prototype.getDefaultOption = function() {
          var ctor = this.constructor;
          if (!isExtendedClass(ctor)) {
            return ctor.defaultOption;
          }
          var fields = inner$l(this);
          if (!fields.defaultOption) {
            var optList = [];
            var clz = ctor;
            while (clz) {
              var opt = clz.prototype.defaultOption;
              opt && optList.push(opt);
              clz = clz.superClass;
            }
            var defaultOption2 = {};
            for (var i2 = optList.length - 1; i2 >= 0; i2--) {
              defaultOption2 = merge$1(defaultOption2, optList[i2], true);
            }
            fields.defaultOption = defaultOption2;
          }
          return fields.defaultOption;
        };
        ComponentModel2.prototype.getReferringComponents = function(mainType, opt) {
          var indexKey = mainType + "Index";
          var idKey = mainType + "Id";
          return queryReferringComponents(this.ecModel, mainType, {
            index: this.get(indexKey, true),
            id: this.get(idKey, true)
          }, opt);
        };
        ComponentModel2.prototype.getBoxLayoutParams = function() {
          var boxLayoutModel = this;
          return {
            left: boxLayoutModel.get("left"),
            top: boxLayoutModel.get("top"),
            right: boxLayoutModel.get("right"),
            bottom: boxLayoutModel.get("bottom"),
            width: boxLayoutModel.get("width"),
            height: boxLayoutModel.get("height")
          };
        };
        ComponentModel2.prototype.getZLevelKey = function() {
          return "";
        };
        ComponentModel2.prototype.setZLevel = function(zlevel) {
          this.option.zlevel = zlevel;
        };
        ComponentModel2.protoInitialize = function() {
          var proto2 = ComponentModel2.prototype;
          proto2.type = "component";
          proto2.id = "";
          proto2.name = "";
          proto2.mainType = "";
          proto2.subType = "";
          proto2.componentIndex = 0;
        }();
        return ComponentModel2;
      }(Model)
    );
    mountExtend(ComponentModel, Model);
    enableClassManagement(ComponentModel);
    enableSubTypeDefaulter(ComponentModel);
    enableTopologicalTravel(ComponentModel, getDependencies);
    function getDependencies(componentType) {
      var deps = [];
      each$f(ComponentModel.getClassesByMainType(componentType), function(clz) {
        deps = deps.concat(clz.dependencies || clz.prototype.dependencies || []);
      });
      deps = map$1(deps, function(type) {
        return parseClassType(type).main;
      });
      if (componentType !== "dataset" && indexOf(deps, "dataset") <= 0) {
        deps.unshift("dataset");
      }
      return deps;
    }
    var platform$2 = "";
    if (typeof navigator !== "undefined") {
      platform$2 = navigator.platform || "";
    }
    var decalColor = "rgba(0, 0, 0, 0.2)";
    const globalDefault = {
      darkMode: "auto",
      // backgroundColor: 'rgba(0,0,0,0)',
      colorBy: "series",
      color: ["#5470c6", "#91cc75", "#fac858", "#ee6666", "#73c0de", "#3ba272", "#fc8452", "#9a60b4", "#ea7ccc"],
      gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
      aria: {
        decal: {
          decals: [{
            color: decalColor,
            dashArrayX: [1, 0],
            dashArrayY: [2, 5],
            symbolSize: 1,
            rotation: Math.PI / 6
          }, {
            color: decalColor,
            symbol: "circle",
            dashArrayX: [[8, 8], [0, 8, 8, 0]],
            dashArrayY: [6, 0],
            symbolSize: 0.8
          }, {
            color: decalColor,
            dashArrayX: [1, 0],
            dashArrayY: [4, 3],
            rotation: -Math.PI / 4
          }, {
            color: decalColor,
            dashArrayX: [[6, 6], [0, 6, 6, 0]],
            dashArrayY: [6, 0]
          }, {
            color: decalColor,
            dashArrayX: [[1, 0], [1, 6]],
            dashArrayY: [1, 0, 6, 0],
            rotation: Math.PI / 4
          }, {
            color: decalColor,
            symbol: "triangle",
            dashArrayX: [[9, 9], [0, 9, 9, 0]],
            dashArrayY: [7, 2],
            symbolSize: 0.75
          }]
        }
      },
      // If xAxis and yAxis declared, grid is created by default.
      // grid: {},
      textStyle: {
        // color: '#000',
        // decoration: 'none',
        // PENDING
        fontFamily: platform$2.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
        // fontFamily: 'Arial, Verdana, sans-serif',
        fontSize: 12,
        fontStyle: "normal",
        fontWeight: "normal"
      },
      // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/
      // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
      // Default is source-over
      blendMode: null,
      stateAnimation: {
        duration: 300,
        easing: "cubicOut"
      },
      animation: "auto",
      animationDuration: 1e3,
      animationDurationUpdate: 500,
      animationEasing: "cubicInOut",
      animationEasingUpdate: "cubicInOut",
      animationThreshold: 2e3,
      // Configuration for progressive/incremental rendering
      progressiveThreshold: 3e3,
      progressive: 400,
      // Threshold of if use single hover layer to optimize.
      // It is recommended that `hoverLayerThreshold` is equivalent to or less than
      // `progressiveThreshold`, otherwise hover will cause restart of progressive,
      // which is unexpected.
      // see example <echarts/test/heatmap-large.html>.
      hoverLayerThreshold: 3e3,
      // See: module:echarts/scale/Time
      useUTC: false
    };
    var VISUAL_DIMENSIONS = createHashMap(["tooltip", "label", "itemName", "itemId", "itemGroupId", "itemChildGroupId", "seriesName"]);
    var SOURCE_FORMAT_ORIGINAL = "original";
    var SOURCE_FORMAT_ARRAY_ROWS = "arrayRows";
    var SOURCE_FORMAT_OBJECT_ROWS = "objectRows";
    var SOURCE_FORMAT_KEYED_COLUMNS = "keyedColumns";
    var SOURCE_FORMAT_TYPED_ARRAY = "typedArray";
    var SOURCE_FORMAT_UNKNOWN = "unknown";
    var SERIES_LAYOUT_BY_COLUMN = "column";
    var SERIES_LAYOUT_BY_ROW = "row";
    var BE_ORDINAL = {
      Must: 1,
      Might: 2,
      Not: 3
      // Other cases
    };
    var innerGlobalModel = makeInner();
    function resetSourceDefaulter(ecModel) {
      innerGlobalModel(ecModel).datasetMap = createHashMap();
    }
    function makeSeriesEncodeForAxisCoordSys(coordDimensions, seriesModel, source) {
      var encode2 = {};
      var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);
      if (!datasetModel || !coordDimensions) {
        return encode2;
      }
      var encodeItemName = [];
      var encodeSeriesName = [];
      var ecModel = seriesModel.ecModel;
      var datasetMap = innerGlobalModel(ecModel).datasetMap;
      var key = datasetModel.uid + "_" + source.seriesLayoutBy;
      var baseCategoryDimIndex;
      var categoryWayValueDimStart;
      coordDimensions = coordDimensions.slice();
      each$f(coordDimensions, function(coordDimInfoLoose, coordDimIdx) {
        var coordDimInfo = isObject$5(coordDimInfoLoose) ? coordDimInfoLoose : coordDimensions[coordDimIdx] = {
          name: coordDimInfoLoose
        };
        if (coordDimInfo.type === "ordinal" && baseCategoryDimIndex == null) {
          baseCategoryDimIndex = coordDimIdx;
          categoryWayValueDimStart = getDataDimCountOnCoordDim(coordDimInfo);
        }
        encode2[coordDimInfo.name] = [];
      });
      var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {
        categoryWayDim: categoryWayValueDimStart,
        valueWayDim: 0
      });
      each$f(coordDimensions, function(coordDimInfo, coordDimIdx) {
        var coordDimName = coordDimInfo.name;
        var count2 = getDataDimCountOnCoordDim(coordDimInfo);
        if (baseCategoryDimIndex == null) {
          var start2 = datasetRecord.valueWayDim;
          pushDim(encode2[coordDimName], start2, count2);
          pushDim(encodeSeriesName, start2, count2);
          datasetRecord.valueWayDim += count2;
        } else if (baseCategoryDimIndex === coordDimIdx) {
          pushDim(encode2[coordDimName], 0, count2);
          pushDim(encodeItemName, 0, count2);
        } else {
          var start2 = datasetRecord.categoryWayDim;
          pushDim(encode2[coordDimName], start2, count2);
          pushDim(encodeSeriesName, start2, count2);
          datasetRecord.categoryWayDim += count2;
        }
      });
      function pushDim(dimIdxArr, idxFrom, idxCount) {
        for (var i2 = 0; i2 < idxCount; i2++) {
          dimIdxArr.push(idxFrom + i2);
        }
      }
      function getDataDimCountOnCoordDim(coordDimInfo) {
        var dimsDef = coordDimInfo.dimsDef;
        return dimsDef ? dimsDef.length : 1;
      }
      encodeItemName.length && (encode2.itemName = encodeItemName);
      encodeSeriesName.length && (encode2.seriesName = encodeSeriesName);
      return encode2;
    }
    function makeSeriesEncodeForNameBased(seriesModel, source, dimCount) {
      var encode2 = {};
      var datasetModel = querySeriesUpstreamDatasetModel(seriesModel);
      if (!datasetModel) {
        return encode2;
      }
      var sourceFormat = source.sourceFormat;
      var dimensionsDefine = source.dimensionsDefine;
      var potentialNameDimIndex;
      if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {
        each$f(dimensionsDefine, function(dim, idx) {
          if ((isObject$5(dim) ? dim.name : dim) === "name") {
            potentialNameDimIndex = idx;
          }
        });
      }
      var idxResult = function() {
        var idxRes0 = {};
        var idxRes1 = {};
        var guessRecords = [];
        for (var i2 = 0, len2 = Math.min(5, dimCount); i2 < len2; i2++) {
          var guessResult = doGuessOrdinal(source.data, sourceFormat, source.seriesLayoutBy, dimensionsDefine, source.startIndex, i2);
          guessRecords.push(guessResult);
          var isPureNumber = guessResult === BE_ORDINAL.Not;
          if (isPureNumber && idxRes0.v == null && i2 !== potentialNameDimIndex) {
            idxRes0.v = i2;
          }
          if (idxRes0.n == null || idxRes0.n === idxRes0.v || !isPureNumber && guessRecords[idxRes0.n] === BE_ORDINAL.Not) {
            idxRes0.n = i2;
          }
          if (fulfilled(idxRes0) && guessRecords[idxRes0.n] !== BE_ORDINAL.Not) {
            return idxRes0;
          }
          if (!isPureNumber) {
            if (guessResult === BE_ORDINAL.Might && idxRes1.v == null && i2 !== potentialNameDimIndex) {
              idxRes1.v = i2;
            }
            if (idxRes1.n == null || idxRes1.n === idxRes1.v) {
              idxRes1.n = i2;
            }
          }
        }
        function fulfilled(idxResult2) {
          return idxResult2.v != null && idxResult2.n != null;
        }
        return fulfilled(idxRes0) ? idxRes0 : fulfilled(idxRes1) ? idxRes1 : null;
      }();
      if (idxResult) {
        encode2.value = [idxResult.v];
        var nameDimIndex = potentialNameDimIndex != null ? potentialNameDimIndex : idxResult.n;
        encode2.itemName = [nameDimIndex];
        encode2.seriesName = [nameDimIndex];
      }
      return encode2;
    }
    function querySeriesUpstreamDatasetModel(seriesModel) {
      var thisData = seriesModel.get("data", true);
      if (!thisData) {
        return queryReferringComponents(seriesModel.ecModel, "dataset", {
          index: seriesModel.get("datasetIndex", true),
          id: seriesModel.get("datasetId", true)
        }, SINGLE_REFERRING).models[0];
      }
    }
    function queryDatasetUpstreamDatasetModels(datasetModel) {
      if (!datasetModel.get("transform", true) && !datasetModel.get("fromTransformResult", true)) {
        return [];
      }
      return queryReferringComponents(datasetModel.ecModel, "dataset", {
        index: datasetModel.get("fromDatasetIndex", true),
        id: datasetModel.get("fromDatasetId", true)
      }, SINGLE_REFERRING).models;
    }
    function guessOrdinal(source, dimIndex) {
      return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);
    }
    function doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {
      var result;
      var maxLoop = 5;
      if (isTypedArray$1(data)) {
        return BE_ORDINAL.Not;
      }
      var dimName;
      var dimType;
      if (dimensionsDefine) {
        var dimDefItem = dimensionsDefine[dimIndex];
        if (isObject$5(dimDefItem)) {
          dimName = dimDefItem.name;
          dimType = dimDefItem.type;
        } else if (isString$1(dimDefItem)) {
          dimName = dimDefItem;
        }
      }
      if (dimType != null) {
        return dimType === "ordinal" ? BE_ORDINAL.Must : BE_ORDINAL.Not;
      }
      if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {
        var dataArrayRows = data;
        if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {
          var sample = dataArrayRows[dimIndex];
          for (var i2 = 0; i2 < (sample || []).length && i2 < maxLoop; i2++) {
            if ((result = detectValue(sample[startIndex + i2])) != null) {
              return result;
            }
          }
        } else {
          for (var i2 = 0; i2 < dataArrayRows.length && i2 < maxLoop; i2++) {
            var row = dataArrayRows[startIndex + i2];
            if (row && (result = detectValue(row[dimIndex])) != null) {
              return result;
            }
          }
        }
      } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {
        var dataObjectRows = data;
        if (!dimName) {
          return BE_ORDINAL.Not;
        }
        for (var i2 = 0; i2 < dataObjectRows.length && i2 < maxLoop; i2++) {
          var item = dataObjectRows[i2];
          if (item && (result = detectValue(item[dimName])) != null) {
            return result;
          }
        }
      } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {
        var dataKeyedColumns = data;
        if (!dimName) {
          return BE_ORDINAL.Not;
        }
        var sample = dataKeyedColumns[dimName];
        if (!sample || isTypedArray$1(sample)) {
          return BE_ORDINAL.Not;
        }
        for (var i2 = 0; i2 < sample.length && i2 < maxLoop; i2++) {
          if ((result = detectValue(sample[i2])) != null) {
            return result;
          }
        }
      } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {
        var dataOriginal = data;
        for (var i2 = 0; i2 < dataOriginal.length && i2 < maxLoop; i2++) {
          var item = dataOriginal[i2];
          var val = getDataItemValue(item);
          if (!isArray$2(val)) {
            return BE_ORDINAL.Not;
          }
          if ((result = detectValue(val[dimIndex])) != null) {
            return result;
          }
        }
      }
      function detectValue(val2) {
        var beStr = isString$1(val2);
        if (val2 != null && Number.isFinite(Number(val2)) && val2 !== "") {
          return beStr ? BE_ORDINAL.Might : BE_ORDINAL.Not;
        } else if (beStr && val2 !== "-") {
          return BE_ORDINAL.Must;
        }
      }
      return BE_ORDINAL.Not;
    }
    var internalOptionCreatorMap = createHashMap();
    function registerInternalOptionCreator(mainType, creator) {
      assert(internalOptionCreatorMap.get(mainType) == null && creator);
      internalOptionCreatorMap.set(mainType, creator);
    }
    function concatInternalOptions(ecModel, mainType, newCmptOptionList) {
      var internalOptionCreator = internalOptionCreatorMap.get(mainType);
      if (!internalOptionCreator) {
        return newCmptOptionList;
      }
      var internalOptions = internalOptionCreator(ecModel);
      if (!internalOptions) {
        return newCmptOptionList;
      }
      return newCmptOptionList.concat(internalOptions);
    }
    var innerColor = makeInner();
    var innerDecal = makeInner();
    var PaletteMixin = (
      /** @class */
      function() {
        function PaletteMixin2() {
        }
        PaletteMixin2.prototype.getColorFromPalette = function(name, scope, requestNum) {
          var defaultPalette = normalizeToArray(this.get("color", true));
          var layeredPalette = this.get("colorLayer", true);
          return getFromPalette(this, innerColor, defaultPalette, layeredPalette, name, scope, requestNum);
        };
        PaletteMixin2.prototype.clearColorPalette = function() {
          clearPalette(this, innerColor);
        };
        return PaletteMixin2;
      }()
    );
    function getDecalFromPalette(ecModel, name, scope, requestNum) {
      var defaultDecals = normalizeToArray(ecModel.get(["aria", "decal", "decals"]));
      return getFromPalette(ecModel, innerDecal, defaultDecals, null, name, scope, requestNum);
    }
    function getNearestPalette(palettes, requestColorNum) {
      var paletteNum = palettes.length;
      for (var i2 = 0; i2 < paletteNum; i2++) {
        if (palettes[i2].length > requestColorNum) {
          return palettes[i2];
        }
      }
      return palettes[paletteNum - 1];
    }
    function getFromPalette(that, inner2, defaultPalette, layeredPalette, name, scope, requestNum) {
      scope = scope || that;
      var scopeFields = inner2(scope);
      var paletteIdx = scopeFields.paletteIdx || 0;
      var paletteNameMap = scopeFields.paletteNameMap = scopeFields.paletteNameMap || {};
      if (paletteNameMap.hasOwnProperty(name)) {
        return paletteNameMap[name];
      }
      var palette = requestNum == null || !layeredPalette ? defaultPalette : getNearestPalette(layeredPalette, requestNum);
      palette = palette || defaultPalette;
      if (!palette || !palette.length) {
        return;
      }
      var pickedPaletteItem = palette[paletteIdx];
      if (name) {
        paletteNameMap[name] = pickedPaletteItem;
      }
      scopeFields.paletteIdx = (paletteIdx + 1) % palette.length;
      return pickedPaletteItem;
    }
    function clearPalette(that, inner2) {
      inner2(that).paletteIdx = 0;
      inner2(that).paletteNameMap = {};
    }
    var reCreateSeriesIndices;
    var assertSeriesInitialized;
    var initBase;
    var OPTION_INNER_KEY = "\0_ec_inner";
    var OPTION_INNER_VALUE = 1;
    var GlobalModel = (
      /** @class */
      function(_super) {
        __extends$1(GlobalModel2, _super);
        function GlobalModel2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        GlobalModel2.prototype.init = function(option, parentModel, ecModel, theme2, locale, optionManager) {
          theme2 = theme2 || {};
          this.option = null;
          this._theme = new Model(theme2);
          this._locale = new Model(locale);
          this._optionManager = optionManager;
        };
        GlobalModel2.prototype.setOption = function(option, opts, optionPreprocessorFuncs2) {
          var innerOpt = normalizeSetOptionInput(opts);
          this._optionManager.setOption(option, optionPreprocessorFuncs2, innerOpt);
          this._resetOption(null, innerOpt);
        };
        GlobalModel2.prototype.resetOption = function(type, opt) {
          return this._resetOption(type, normalizeSetOptionInput(opt));
        };
        GlobalModel2.prototype._resetOption = function(type, opt) {
          var optionChanged = false;
          var optionManager = this._optionManager;
          if (!type || type === "recreate") {
            var baseOption = optionManager.mountOption(type === "recreate");
            if (!this.option || type === "recreate") {
              initBase(this, baseOption);
            } else {
              this.restoreData();
              this._mergeOption(baseOption, opt);
            }
            optionChanged = true;
          }
          if (type === "timeline" || type === "media") {
            this.restoreData();
          }
          if (!type || type === "recreate" || type === "timeline") {
            var timelineOption = optionManager.getTimelineOption(this);
            if (timelineOption) {
              optionChanged = true;
              this._mergeOption(timelineOption, opt);
            }
          }
          if (!type || type === "recreate" || type === "media") {
            var mediaOptions = optionManager.getMediaOption(this);
            if (mediaOptions.length) {
              each$f(mediaOptions, function(mediaOption) {
                optionChanged = true;
                this._mergeOption(mediaOption, opt);
              }, this);
            }
          }
          return optionChanged;
        };
        GlobalModel2.prototype.mergeOption = function(option) {
          this._mergeOption(option, null);
        };
        GlobalModel2.prototype._mergeOption = function(newOption, opt) {
          var option = this.option;
          var componentsMap = this._componentsMap;
          var componentsCount = this._componentsCount;
          var newCmptTypes = [];
          var newCmptTypeMap = createHashMap();
          var replaceMergeMainTypeMap = opt && opt.replaceMergeMainTypeMap;
          resetSourceDefaulter(this);
          each$f(newOption, function(componentOption, mainType) {
            if (componentOption == null) {
              return;
            }
            if (!ComponentModel.hasClass(mainType)) {
              option[mainType] = option[mainType] == null ? clone$4(componentOption) : merge$1(option[mainType], componentOption, true);
            } else if (mainType) {
              newCmptTypes.push(mainType);
              newCmptTypeMap.set(mainType, true);
            }
          });
          if (replaceMergeMainTypeMap) {
            replaceMergeMainTypeMap.each(function(val, mainTypeInReplaceMerge) {
              if (ComponentModel.hasClass(mainTypeInReplaceMerge) && !newCmptTypeMap.get(mainTypeInReplaceMerge)) {
                newCmptTypes.push(mainTypeInReplaceMerge);
                newCmptTypeMap.set(mainTypeInReplaceMerge, true);
              }
            });
          }
          ComponentModel.topologicalTravel(newCmptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);
          function visitComponent(mainType) {
            var newCmptOptionList = concatInternalOptions(this, mainType, normalizeToArray(newOption[mainType]));
            var oldCmptList = componentsMap.get(mainType);
            var mergeMode = (
              // `!oldCmptList` means init. See the comment in `mappingToExists`
              !oldCmptList ? "replaceAll" : replaceMergeMainTypeMap && replaceMergeMainTypeMap.get(mainType) ? "replaceMerge" : "normalMerge"
            );
            var mappingResult = mappingToExists(oldCmptList, newCmptOptionList, mergeMode);
            setComponentTypeToKeyInfo(mappingResult, mainType, ComponentModel);
            option[mainType] = null;
            componentsMap.set(mainType, null);
            componentsCount.set(mainType, 0);
            var optionsByMainType = [];
            var cmptsByMainType = [];
            var cmptsCountByMainType = 0;
            var tooltipExists;
            each$f(mappingResult, function(resultItem, index) {
              var componentModel = resultItem.existing;
              var newCmptOption = resultItem.newOption;
              if (!newCmptOption) {
                if (componentModel) {
                  componentModel.mergeOption({}, this);
                  componentModel.optionUpdated({}, false);
                }
              } else {
                var isSeriesType = mainType === "series";
                var ComponentModelClass = ComponentModel.getClass(
                  mainType,
                  resultItem.keyInfo.subType,
                  !isSeriesType
                  // Give a more detailed warn later if series don't exists
                );
                if (!ComponentModelClass) {
                  return;
                }
                if (mainType === "tooltip") {
                  if (tooltipExists) {
                    return;
                  }
                  tooltipExists = true;
                }
                if (componentModel && componentModel.constructor === ComponentModelClass) {
                  componentModel.name = resultItem.keyInfo.name;
                  componentModel.mergeOption(newCmptOption, this);
                  componentModel.optionUpdated(newCmptOption, false);
                } else {
                  var extraOpt = extend$1({
                    componentIndex: index
                  }, resultItem.keyInfo);
                  componentModel = new ComponentModelClass(newCmptOption, this, this, extraOpt);
                  extend$1(componentModel, extraOpt);
                  if (resultItem.brandNew) {
                    componentModel.__requireNewView = true;
                  }
                  componentModel.init(newCmptOption, this, this);
                  componentModel.optionUpdated(null, true);
                }
              }
              if (componentModel) {
                optionsByMainType.push(componentModel.option);
                cmptsByMainType.push(componentModel);
                cmptsCountByMainType++;
              } else {
                optionsByMainType.push(void 0);
                cmptsByMainType.push(void 0);
              }
            }, this);
            option[mainType] = optionsByMainType;
            componentsMap.set(mainType, cmptsByMainType);
            componentsCount.set(mainType, cmptsCountByMainType);
            if (mainType === "series") {
              reCreateSeriesIndices(this);
            }
          }
          if (!this._seriesIndices) {
            reCreateSeriesIndices(this);
          }
        };
        GlobalModel2.prototype.getOption = function() {
          var option = clone$4(this.option);
          each$f(option, function(optInMainType, mainType) {
            if (ComponentModel.hasClass(mainType)) {
              var opts = normalizeToArray(optInMainType);
              var realLen = opts.length;
              var metNonInner = false;
              for (var i2 = realLen - 1; i2 >= 0; i2--) {
                if (opts[i2] && !isComponentIdInternal(opts[i2])) {
                  metNonInner = true;
                } else {
                  opts[i2] = null;
                  !metNonInner && realLen--;
                }
              }
              opts.length = realLen;
              option[mainType] = opts;
            }
          });
          delete option[OPTION_INNER_KEY];
          return option;
        };
        GlobalModel2.prototype.getTheme = function() {
          return this._theme;
        };
        GlobalModel2.prototype.getLocaleModel = function() {
          return this._locale;
        };
        GlobalModel2.prototype.setUpdatePayload = function(payload) {
          this._payload = payload;
        };
        GlobalModel2.prototype.getUpdatePayload = function() {
          return this._payload;
        };
        GlobalModel2.prototype.getComponent = function(mainType, idx) {
          var list = this._componentsMap.get(mainType);
          if (list) {
            var cmpt = list[idx || 0];
            if (cmpt) {
              return cmpt;
            } else if (idx == null) {
              for (var i2 = 0; i2 < list.length; i2++) {
                if (list[i2]) {
                  return list[i2];
                }
              }
            }
          }
        };
        GlobalModel2.prototype.queryComponents = function(condition) {
          var mainType = condition.mainType;
          if (!mainType) {
            return [];
          }
          var index = condition.index;
          var id = condition.id;
          var name = condition.name;
          var cmpts = this._componentsMap.get(mainType);
          if (!cmpts || !cmpts.length) {
            return [];
          }
          var result;
          if (index != null) {
            result = [];
            each$f(normalizeToArray(index), function(idx) {
              cmpts[idx] && result.push(cmpts[idx]);
            });
          } else if (id != null) {
            result = queryByIdOrName("id", id, cmpts);
          } else if (name != null) {
            result = queryByIdOrName("name", name, cmpts);
          } else {
            result = filter(cmpts, function(cmpt) {
              return !!cmpt;
            });
          }
          return filterBySubType(result, condition);
        };
        GlobalModel2.prototype.findComponents = function(condition) {
          var query = condition.query;
          var mainType = condition.mainType;
          var queryCond = getQueryCond(query);
          var result = queryCond ? this.queryComponents(queryCond) : filter(this._componentsMap.get(mainType), function(cmpt) {
            return !!cmpt;
          });
          return doFilter(filterBySubType(result, condition));
          function getQueryCond(q2) {
            var indexAttr = mainType + "Index";
            var idAttr = mainType + "Id";
            var nameAttr = mainType + "Name";
            return q2 && (q2[indexAttr] != null || q2[idAttr] != null || q2[nameAttr] != null) ? {
              mainType,
              // subType will be filtered finally.
              index: q2[indexAttr],
              id: q2[idAttr],
              name: q2[nameAttr]
            } : null;
          }
          function doFilter(res) {
            return condition.filter ? filter(res, condition.filter) : res;
          }
        };
        GlobalModel2.prototype.eachComponent = function(mainType, cb, context) {
          var componentsMap = this._componentsMap;
          if (isFunction$1(mainType)) {
            var ctxForAll_1 = cb;
            var cbForAll_1 = mainType;
            componentsMap.each(function(cmpts2, componentType) {
              for (var i22 = 0; cmpts2 && i22 < cmpts2.length; i22++) {
                var cmpt2 = cmpts2[i22];
                cmpt2 && cbForAll_1.call(ctxForAll_1, componentType, cmpt2, cmpt2.componentIndex);
              }
            });
          } else {
            var cmpts = isString$1(mainType) ? componentsMap.get(mainType) : isObject$5(mainType) ? this.findComponents(mainType) : null;
            for (var i2 = 0; cmpts && i2 < cmpts.length; i2++) {
              var cmpt = cmpts[i2];
              cmpt && cb.call(context, cmpt, cmpt.componentIndex);
            }
          }
        };
        GlobalModel2.prototype.getSeriesByName = function(name) {
          var nameStr = convertOptionIdName(name, null);
          return filter(this._componentsMap.get("series"), function(oneSeries) {
            return !!oneSeries && nameStr != null && oneSeries.name === nameStr;
          });
        };
        GlobalModel2.prototype.getSeriesByIndex = function(seriesIndex) {
          return this._componentsMap.get("series")[seriesIndex];
        };
        GlobalModel2.prototype.getSeriesByType = function(subType) {
          return filter(this._componentsMap.get("series"), function(oneSeries) {
            return !!oneSeries && oneSeries.subType === subType;
          });
        };
        GlobalModel2.prototype.getSeries = function() {
          return filter(this._componentsMap.get("series"), function(oneSeries) {
            return !!oneSeries;
          });
        };
        GlobalModel2.prototype.getSeriesCount = function() {
          return this._componentsCount.get("series");
        };
        GlobalModel2.prototype.eachSeries = function(cb, context) {
          assertSeriesInitialized(this);
          each$f(this._seriesIndices, function(rawSeriesIndex) {
            var series = this._componentsMap.get("series")[rawSeriesIndex];
            cb.call(context, series, rawSeriesIndex);
          }, this);
        };
        GlobalModel2.prototype.eachRawSeries = function(cb, context) {
          each$f(this._componentsMap.get("series"), function(series) {
            series && cb.call(context, series, series.componentIndex);
          });
        };
        GlobalModel2.prototype.eachSeriesByType = function(subType, cb, context) {
          assertSeriesInitialized(this);
          each$f(this._seriesIndices, function(rawSeriesIndex) {
            var series = this._componentsMap.get("series")[rawSeriesIndex];
            if (series.subType === subType) {
              cb.call(context, series, rawSeriesIndex);
            }
          }, this);
        };
        GlobalModel2.prototype.eachRawSeriesByType = function(subType, cb, context) {
          return each$f(this.getSeriesByType(subType), cb, context);
        };
        GlobalModel2.prototype.isSeriesFiltered = function(seriesModel) {
          assertSeriesInitialized(this);
          return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;
        };
        GlobalModel2.prototype.getCurrentSeriesIndices = function() {
          return (this._seriesIndices || []).slice();
        };
        GlobalModel2.prototype.filterSeries = function(cb, context) {
          assertSeriesInitialized(this);
          var newSeriesIndices = [];
          each$f(this._seriesIndices, function(seriesRawIdx) {
            var series = this._componentsMap.get("series")[seriesRawIdx];
            cb.call(context, series, seriesRawIdx) && newSeriesIndices.push(seriesRawIdx);
          }, this);
          this._seriesIndices = newSeriesIndices;
          this._seriesIndicesMap = createHashMap(newSeriesIndices);
        };
        GlobalModel2.prototype.restoreData = function(payload) {
          reCreateSeriesIndices(this);
          var componentsMap = this._componentsMap;
          var componentTypes = [];
          componentsMap.each(function(components, componentType) {
            if (ComponentModel.hasClass(componentType)) {
              componentTypes.push(componentType);
            }
          });
          ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function(componentType) {
            each$f(componentsMap.get(componentType), function(component2) {
              if (component2 && (componentType !== "series" || !isNotTargetSeries(component2, payload))) {
                component2.restoreData();
              }
            });
          });
        };
        GlobalModel2.internalField = function() {
          reCreateSeriesIndices = function(ecModel) {
            var seriesIndices = ecModel._seriesIndices = [];
            each$f(ecModel._componentsMap.get("series"), function(series) {
              series && seriesIndices.push(series.componentIndex);
            });
            ecModel._seriesIndicesMap = createHashMap(seriesIndices);
          };
          assertSeriesInitialized = function(ecModel) {
          };
          initBase = function(ecModel, baseOption) {
            ecModel.option = {};
            ecModel.option[OPTION_INNER_KEY] = OPTION_INNER_VALUE;
            ecModel._componentsMap = createHashMap({
              series: []
            });
            ecModel._componentsCount = createHashMap();
            var airaOption = baseOption.aria;
            if (isObject$5(airaOption) && airaOption.enabled == null) {
              airaOption.enabled = true;
            }
            mergeTheme(baseOption, ecModel._theme.option);
            merge$1(baseOption, globalDefault, false);
            ecModel._mergeOption(baseOption, null);
          };
        }();
        return GlobalModel2;
      }(Model)
    );
    function isNotTargetSeries(seriesModel, payload) {
      if (payload) {
        var index = payload.seriesIndex;
        var id = payload.seriesId;
        var name_1 = payload.seriesName;
        return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name_1 != null && seriesModel.name !== name_1;
      }
    }
    function mergeTheme(option, theme2) {
      var notMergeColorLayer = option.color && !option.colorLayer;
      each$f(theme2, function(themeItem, name) {
        if (name === "colorLayer" && notMergeColorLayer) {
          return;
        }
        if (!ComponentModel.hasClass(name)) {
          if (typeof themeItem === "object") {
            option[name] = !option[name] ? clone$4(themeItem) : merge$1(option[name], themeItem, false);
          } else {
            if (option[name] == null) {
              option[name] = themeItem;
            }
          }
        }
      });
    }
    function queryByIdOrName(attr, idOrName, cmpts) {
      if (isArray$2(idOrName)) {
        var keyMap_1 = createHashMap();
        each$f(idOrName, function(idOrNameItem) {
          if (idOrNameItem != null) {
            var idName = convertOptionIdName(idOrNameItem, null);
            idName != null && keyMap_1.set(idOrNameItem, true);
          }
        });
        return filter(cmpts, function(cmpt) {
          return cmpt && keyMap_1.get(cmpt[attr]);
        });
      } else {
        var idName_1 = convertOptionIdName(idOrName, null);
        return filter(cmpts, function(cmpt) {
          return cmpt && idName_1 != null && cmpt[attr] === idName_1;
        });
      }
    }
    function filterBySubType(components, condition) {
      return condition.hasOwnProperty("subType") ? filter(components, function(cmpt) {
        return cmpt && cmpt.subType === condition.subType;
      }) : components;
    }
    function normalizeSetOptionInput(opts) {
      var replaceMergeMainTypeMap = createHashMap();
      opts && each$f(normalizeToArray(opts.replaceMerge), function(mainType) {
        replaceMergeMainTypeMap.set(mainType, true);
      });
      return {
        replaceMergeMainTypeMap
      };
    }
    mixin(GlobalModel, PaletteMixin);
    var availableMethods = [
      "getDom",
      "getZr",
      "getWidth",
      "getHeight",
      "getDevicePixelRatio",
      "dispatchAction",
      "isSSR",
      "isDisposed",
      "on",
      "off",
      "getDataURL",
      "getConnectedDataURL",
      // 'getModel',
      "getOption",
      // 'getViewOfComponentModel',
      // 'getViewOfSeriesModel',
      "getId",
      "updateLabelLayout"
    ];
    var ExtensionAPI = (
      /** @class */
      /* @__PURE__ */ function() {
        function ExtensionAPI2(ecInstance) {
          each$f(availableMethods, function(methodName) {
            this[methodName] = bind$2(ecInstance[methodName], ecInstance);
          }, this);
        }
        return ExtensionAPI2;
      }()
    );
    var coordinateSystemCreators = {};
    var CoordinateSystemManager = (
      /** @class */
      function() {
        function CoordinateSystemManager2() {
          this._coordinateSystems = [];
        }
        CoordinateSystemManager2.prototype.create = function(ecModel, api2) {
          var coordinateSystems = [];
          each$f(coordinateSystemCreators, function(creator, type) {
            var list = creator.create(ecModel, api2);
            coordinateSystems = coordinateSystems.concat(list || []);
          });
          this._coordinateSystems = coordinateSystems;
        };
        CoordinateSystemManager2.prototype.update = function(ecModel, api2) {
          each$f(this._coordinateSystems, function(coordSys) {
            coordSys.update && coordSys.update(ecModel, api2);
          });
        };
        CoordinateSystemManager2.prototype.getCoordinateSystems = function() {
          return this._coordinateSystems.slice();
        };
        CoordinateSystemManager2.register = function(type, creator) {
          coordinateSystemCreators[type] = creator;
        };
        CoordinateSystemManager2.get = function(type) {
          return coordinateSystemCreators[type];
        };
        return CoordinateSystemManager2;
      }()
    );
    var QUERY_REG = /^(min|max)?(.+)$/;
    var OptionManager = (
      /** @class */
      function() {
        function OptionManager2(api2) {
          this._timelineOptions = [];
          this._mediaList = [];
          this._currentMediaIndices = [];
          this._api = api2;
        }
        OptionManager2.prototype.setOption = function(rawOption, optionPreprocessorFuncs2, opt) {
          if (rawOption) {
            each$f(normalizeToArray(rawOption.series), function(series) {
              series && series.data && isTypedArray$1(series.data) && setAsPrimitive(series.data);
            });
            each$f(normalizeToArray(rawOption.dataset), function(dataset) {
              dataset && dataset.source && isTypedArray$1(dataset.source) && setAsPrimitive(dataset.source);
            });
          }
          rawOption = clone$4(rawOption);
          var optionBackup = this._optionBackup;
          var newParsedOption = parseRawOption(rawOption, optionPreprocessorFuncs2, !optionBackup);
          this._newBaseOption = newParsedOption.baseOption;
          if (optionBackup) {
            if (newParsedOption.timelineOptions.length) {
              optionBackup.timelineOptions = newParsedOption.timelineOptions;
            }
            if (newParsedOption.mediaList.length) {
              optionBackup.mediaList = newParsedOption.mediaList;
            }
            if (newParsedOption.mediaDefault) {
              optionBackup.mediaDefault = newParsedOption.mediaDefault;
            }
          } else {
            this._optionBackup = newParsedOption;
          }
        };
        OptionManager2.prototype.mountOption = function(isRecreate) {
          var optionBackup = this._optionBackup;
          this._timelineOptions = optionBackup.timelineOptions;
          this._mediaList = optionBackup.mediaList;
          this._mediaDefault = optionBackup.mediaDefault;
          this._currentMediaIndices = [];
          return clone$4(isRecreate ? optionBackup.baseOption : this._newBaseOption);
        };
        OptionManager2.prototype.getTimelineOption = function(ecModel) {
          var option;
          var timelineOptions = this._timelineOptions;
          if (timelineOptions.length) {
            var timelineModel = ecModel.getComponent("timeline");
            if (timelineModel) {
              option = clone$4(
                // FIXME:TS as TimelineModel or quivlant interface
                timelineOptions[timelineModel.getCurrentIndex()]
              );
            }
          }
          return option;
        };
        OptionManager2.prototype.getMediaOption = function(ecModel) {
          var ecWidth = this._api.getWidth();
          var ecHeight = this._api.getHeight();
          var mediaList = this._mediaList;
          var mediaDefault = this._mediaDefault;
          var indices = [];
          var result = [];
          if (!mediaList.length && !mediaDefault) {
            return result;
          }
          for (var i2 = 0, len2 = mediaList.length; i2 < len2; i2++) {
            if (applyMediaQuery(mediaList[i2].query, ecWidth, ecHeight)) {
              indices.push(i2);
            }
          }
          if (!indices.length && mediaDefault) {
            indices = [-1];
          }
          if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {
            result = map$1(indices, function(index) {
              return clone$4(index === -1 ? mediaDefault.option : mediaList[index].option);
            });
          }
          this._currentMediaIndices = indices;
          return result;
        };
        return OptionManager2;
      }()
    );
    function parseRawOption(rawOption, optionPreprocessorFuncs2, isNew) {
      var mediaList = [];
      var mediaDefault;
      var baseOption;
      var declaredBaseOption = rawOption.baseOption;
      var timelineOnRoot = rawOption.timeline;
      var timelineOptionsOnRoot = rawOption.options;
      var mediaOnRoot = rawOption.media;
      var hasMedia = !!rawOption.media;
      var hasTimeline = !!(timelineOptionsOnRoot || timelineOnRoot || declaredBaseOption && declaredBaseOption.timeline);
      if (declaredBaseOption) {
        baseOption = declaredBaseOption;
        if (!baseOption.timeline) {
          baseOption.timeline = timelineOnRoot;
        }
      } else {
        if (hasTimeline || hasMedia) {
          rawOption.options = rawOption.media = null;
        }
        baseOption = rawOption;
      }
      if (hasMedia) {
        if (isArray$2(mediaOnRoot)) {
          each$f(mediaOnRoot, function(singleMedia) {
            if (singleMedia && singleMedia.option) {
              if (singleMedia.query) {
                mediaList.push(singleMedia);
              } else if (!mediaDefault) {
                mediaDefault = singleMedia;
              }
            }
          });
        }
      }
      doPreprocess(baseOption);
      each$f(timelineOptionsOnRoot, function(option) {
        return doPreprocess(option);
      });
      each$f(mediaList, function(media) {
        return doPreprocess(media.option);
      });
      function doPreprocess(option) {
        each$f(optionPreprocessorFuncs2, function(preProcess) {
          preProcess(option, isNew);
        });
      }
      return {
        baseOption,
        timelineOptions: timelineOptionsOnRoot || [],
        mediaDefault,
        mediaList
      };
    }
    function applyMediaQuery(query, ecWidth, ecHeight) {
      var realMap = {
        width: ecWidth,
        height: ecHeight,
        aspectratio: ecWidth / ecHeight
        // lower case for convenience.
      };
      var applicable = true;
      each$f(query, function(value, attr) {
        var matched = attr.match(QUERY_REG);
        if (!matched || !matched[1] || !matched[2]) {
          return;
        }
        var operator = matched[1];
        var realAttr = matched[2].toLowerCase();
        if (!compare(realMap[realAttr], value, operator)) {
          applicable = false;
        }
      });
      return applicable;
    }
    function compare(real, expect, operator) {
      if (operator === "min") {
        return real >= expect;
      } else if (operator === "max") {
        return real <= expect;
      } else {
        return real === expect;
      }
    }
    function indicesEquals(indices1, indices2) {
      return indices1.join(",") === indices2.join(",");
    }
    var each$d = each$f;
    var isObject$4 = isObject$5;
    var POSSIBLE_STYLES = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];
    function compatEC2ItemStyle(opt) {
      var itemStyleOpt = opt && opt.itemStyle;
      if (!itemStyleOpt) {
        return;
      }
      for (var i2 = 0, len2 = POSSIBLE_STYLES.length; i2 < len2; i2++) {
        var styleName = POSSIBLE_STYLES[i2];
        var normalItemStyleOpt = itemStyleOpt.normal;
        var emphasisItemStyleOpt = itemStyleOpt.emphasis;
        if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {
          opt[styleName] = opt[styleName] || {};
          if (!opt[styleName].normal) {
            opt[styleName].normal = normalItemStyleOpt[styleName];
          } else {
            merge$1(opt[styleName].normal, normalItemStyleOpt[styleName]);
          }
          normalItemStyleOpt[styleName] = null;
        }
        if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {
          opt[styleName] = opt[styleName] || {};
          if (!opt[styleName].emphasis) {
            opt[styleName].emphasis = emphasisItemStyleOpt[styleName];
          } else {
            merge$1(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
          }
          emphasisItemStyleOpt[styleName] = null;
        }
      }
    }
    function convertNormalEmphasis(opt, optType, useExtend) {
      if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) {
        var normalOpt = opt[optType].normal;
        var emphasisOpt = opt[optType].emphasis;
        if (normalOpt) {
          if (useExtend) {
            opt[optType].normal = opt[optType].emphasis = null;
            defaults$1(opt[optType], normalOpt);
          } else {
            opt[optType] = normalOpt;
          }
        }
        if (emphasisOpt) {
          opt.emphasis = opt.emphasis || {};
          opt.emphasis[optType] = emphasisOpt;
          if (emphasisOpt.focus) {
            opt.emphasis.focus = emphasisOpt.focus;
          }
          if (emphasisOpt.blurScope) {
            opt.emphasis.blurScope = emphasisOpt.blurScope;
          }
        }
      }
    }
    function removeEC3NormalStatus(opt) {
      convertNormalEmphasis(opt, "itemStyle");
      convertNormalEmphasis(opt, "lineStyle");
      convertNormalEmphasis(opt, "areaStyle");
      convertNormalEmphasis(opt, "label");
      convertNormalEmphasis(opt, "labelLine");
      convertNormalEmphasis(opt, "upperLabel");
      convertNormalEmphasis(opt, "edgeLabel");
    }
    function compatTextStyle(opt, propName) {
      var labelOptSingle = isObject$4(opt) && opt[propName];
      var textStyle = isObject$4(labelOptSingle) && labelOptSingle.textStyle;
      if (textStyle) {
        for (var i2 = 0, len2 = TEXT_STYLE_OPTIONS.length; i2 < len2; i2++) {
          var textPropName = TEXT_STYLE_OPTIONS[i2];
          if (textStyle.hasOwnProperty(textPropName)) {
            labelOptSingle[textPropName] = textStyle[textPropName];
          }
        }
      }
    }
    function compatEC3CommonStyles(opt) {
      if (opt) {
        removeEC3NormalStatus(opt);
        compatTextStyle(opt, "label");
        opt.emphasis && compatTextStyle(opt.emphasis, "label");
      }
    }
    function processSeries(seriesOpt) {
      if (!isObject$4(seriesOpt)) {
        return;
      }
      compatEC2ItemStyle(seriesOpt);
      removeEC3NormalStatus(seriesOpt);
      compatTextStyle(seriesOpt, "label");
      compatTextStyle(seriesOpt, "upperLabel");
      compatTextStyle(seriesOpt, "edgeLabel");
      if (seriesOpt.emphasis) {
        compatTextStyle(seriesOpt.emphasis, "label");
        compatTextStyle(seriesOpt.emphasis, "upperLabel");
        compatTextStyle(seriesOpt.emphasis, "edgeLabel");
      }
      var markPoint = seriesOpt.markPoint;
      if (markPoint) {
        compatEC2ItemStyle(markPoint);
        compatEC3CommonStyles(markPoint);
      }
      var markLine = seriesOpt.markLine;
      if (markLine) {
        compatEC2ItemStyle(markLine);
        compatEC3CommonStyles(markLine);
      }
      var markArea = seriesOpt.markArea;
      if (markArea) {
        compatEC3CommonStyles(markArea);
      }
      var data = seriesOpt.data;
      if (seriesOpt.type === "graph") {
        data = data || seriesOpt.nodes;
        var edgeData = seriesOpt.links || seriesOpt.edges;
        if (edgeData && !isTypedArray$1(edgeData)) {
          for (var i2 = 0; i2 < edgeData.length; i2++) {
            compatEC3CommonStyles(edgeData[i2]);
          }
        }
        each$f(seriesOpt.categories, function(opt) {
          removeEC3NormalStatus(opt);
        });
      }
      if (data && !isTypedArray$1(data)) {
        for (var i2 = 0; i2 < data.length; i2++) {
          compatEC3CommonStyles(data[i2]);
        }
      }
      markPoint = seriesOpt.markPoint;
      if (markPoint && markPoint.data) {
        var mpData = markPoint.data;
        for (var i2 = 0; i2 < mpData.length; i2++) {
          compatEC3CommonStyles(mpData[i2]);
        }
      }
      markLine = seriesOpt.markLine;
      if (markLine && markLine.data) {
        var mlData = markLine.data;
        for (var i2 = 0; i2 < mlData.length; i2++) {
          if (isArray$2(mlData[i2])) {
            compatEC3CommonStyles(mlData[i2][0]);
            compatEC3CommonStyles(mlData[i2][1]);
          } else {
            compatEC3CommonStyles(mlData[i2]);
          }
        }
      }
      if (seriesOpt.type === "gauge") {
        compatTextStyle(seriesOpt, "axisLabel");
        compatTextStyle(seriesOpt, "title");
        compatTextStyle(seriesOpt, "detail");
      } else if (seriesOpt.type === "treemap") {
        convertNormalEmphasis(seriesOpt.breadcrumb, "itemStyle");
        each$f(seriesOpt.levels, function(opt) {
          removeEC3NormalStatus(opt);
        });
      } else if (seriesOpt.type === "tree") {
        removeEC3NormalStatus(seriesOpt.leaves);
      }
    }
    function toArr(o2) {
      return isArray$2(o2) ? o2 : o2 ? [o2] : [];
    }
    function toObj(o2) {
      return (isArray$2(o2) ? o2[0] : o2) || {};
    }
    function globalCompatStyle(option, isTheme) {
      each$d(toArr(option.series), function(seriesOpt) {
        isObject$4(seriesOpt) && processSeries(seriesOpt);
      });
      var axes = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
      isTheme && axes.push("valueAxis", "categoryAxis", "logAxis", "timeAxis");
      each$d(axes, function(axisName) {
        each$d(toArr(option[axisName]), function(axisOpt) {
          if (axisOpt) {
            compatTextStyle(axisOpt, "axisLabel");
            compatTextStyle(axisOpt.axisPointer, "label");
          }
        });
      });
      each$d(toArr(option.parallel), function(parallelOpt) {
        var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault;
        compatTextStyle(parallelAxisDefault, "axisLabel");
        compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, "label");
      });
      each$d(toArr(option.calendar), function(calendarOpt) {
        convertNormalEmphasis(calendarOpt, "itemStyle");
        compatTextStyle(calendarOpt, "dayLabel");
        compatTextStyle(calendarOpt, "monthLabel");
        compatTextStyle(calendarOpt, "yearLabel");
      });
      each$d(toArr(option.radar), function(radarOpt) {
        compatTextStyle(radarOpt, "name");
        if (radarOpt.name && radarOpt.axisName == null) {
          radarOpt.axisName = radarOpt.name;
          delete radarOpt.name;
        }
        if (radarOpt.nameGap != null && radarOpt.axisNameGap == null) {
          radarOpt.axisNameGap = radarOpt.nameGap;
          delete radarOpt.nameGap;
        }
      });
      each$d(toArr(option.geo), function(geoOpt) {
        if (isObject$4(geoOpt)) {
          compatEC3CommonStyles(geoOpt);
          each$d(toArr(geoOpt.regions), function(regionObj) {
            compatEC3CommonStyles(regionObj);
          });
        }
      });
      each$d(toArr(option.timeline), function(timelineOpt) {
        compatEC3CommonStyles(timelineOpt);
        convertNormalEmphasis(timelineOpt, "label");
        convertNormalEmphasis(timelineOpt, "itemStyle");
        convertNormalEmphasis(timelineOpt, "controlStyle", true);
        var data = timelineOpt.data;
        isArray$2(data) && each$f(data, function(item) {
          if (isObject$5(item)) {
            convertNormalEmphasis(item, "label");
            convertNormalEmphasis(item, "itemStyle");
          }
        });
      });
      each$d(toArr(option.toolbox), function(toolboxOpt) {
        convertNormalEmphasis(toolboxOpt, "iconStyle");
        each$d(toolboxOpt.feature, function(featureOpt) {
          convertNormalEmphasis(featureOpt, "iconStyle");
        });
      });
      compatTextStyle(toObj(option.axisPointer), "label");
      compatTextStyle(toObj(option.tooltip).axisPointer, "label");
    }
    function get(opt, path) {
      var pathArr = path.split(",");
      var obj = opt;
      for (var i2 = 0; i2 < pathArr.length; i2++) {
        obj = obj && obj[pathArr[i2]];
        if (obj == null) {
          break;
        }
      }
      return obj;
    }
    function set(opt, path, val, overwrite) {
      var pathArr = path.split(",");
      var obj = opt;
      var key;
      var i2 = 0;
      for (; i2 < pathArr.length - 1; i2++) {
        key = pathArr[i2];
        if (obj[key] == null) {
          obj[key] = {};
        }
        obj = obj[key];
      }
      if (obj[pathArr[i2]] == null) {
        obj[pathArr[i2]] = val;
      }
    }
    function compatLayoutProperties(option) {
      option && each$f(LAYOUT_PROPERTIES, function(prop) {
        if (prop[0] in option && !(prop[1] in option)) {
          option[prop[1]] = option[prop[0]];
        }
      });
    }
    var LAYOUT_PROPERTIES = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]];
    var COMPATITABLE_COMPONENTS = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"];
    var BAR_ITEM_STYLE_MAP = [["borderRadius", "barBorderRadius"], ["borderColor", "barBorderColor"], ["borderWidth", "barBorderWidth"]];
    function compatBarItemStyle(option) {
      var itemStyle = option && option.itemStyle;
      if (itemStyle) {
        for (var i2 = 0; i2 < BAR_ITEM_STYLE_MAP.length; i2++) {
          var oldName = BAR_ITEM_STYLE_MAP[i2][1];
          var newName = BAR_ITEM_STYLE_MAP[i2][0];
          if (itemStyle[oldName] != null) {
            itemStyle[newName] = itemStyle[oldName];
          }
        }
      }
    }
    function compatPieLabel(option) {
      if (!option) {
        return;
      }
      if (option.alignTo === "edge" && option.margin != null && option.edgeDistance == null) {
        option.edgeDistance = option.margin;
      }
    }
    function compatSunburstState(option) {
      if (!option) {
        return;
      }
      if (option.downplay && !option.blur) {
        option.blur = option.downplay;
      }
    }
    function compatGraphFocus(option) {
      if (!option) {
        return;
      }
      if (option.focusNodeAdjacency != null) {
        option.emphasis = option.emphasis || {};
        if (option.emphasis.focus == null) {
          option.emphasis.focus = "adjacency";
        }
      }
    }
    function traverseTree(data, cb) {
      if (data) {
        for (var i2 = 0; i2 < data.length; i2++) {
          cb(data[i2]);
          data[i2] && traverseTree(data[i2].children, cb);
        }
      }
    }
    function globalBackwardCompat(option, isTheme) {
      globalCompatStyle(option, isTheme);
      option.series = normalizeToArray(option.series);
      each$f(option.series, function(seriesOpt) {
        if (!isObject$5(seriesOpt)) {
          return;
        }
        var seriesType2 = seriesOpt.type;
        if (seriesType2 === "line") {
          if (seriesOpt.clipOverflow != null) {
            seriesOpt.clip = seriesOpt.clipOverflow;
          }
        } else if (seriesType2 === "pie" || seriesType2 === "gauge") {
          if (seriesOpt.clockWise != null) {
            seriesOpt.clockwise = seriesOpt.clockWise;
          }
          compatPieLabel(seriesOpt.label);
          var data = seriesOpt.data;
          if (data && !isTypedArray$1(data)) {
            for (var i2 = 0; i2 < data.length; i2++) {
              compatPieLabel(data[i2]);
            }
          }
          if (seriesOpt.hoverOffset != null) {
            seriesOpt.emphasis = seriesOpt.emphasis || {};
            if (seriesOpt.emphasis.scaleSize = null) {
              seriesOpt.emphasis.scaleSize = seriesOpt.hoverOffset;
            }
          }
        } else if (seriesType2 === "gauge") {
          var pointerColor = get(seriesOpt, "pointer.color");
          pointerColor != null && set(seriesOpt, "itemStyle.color", pointerColor);
        } else if (seriesType2 === "bar") {
          compatBarItemStyle(seriesOpt);
          compatBarItemStyle(seriesOpt.backgroundStyle);
          compatBarItemStyle(seriesOpt.emphasis);
          var data = seriesOpt.data;
          if (data && !isTypedArray$1(data)) {
            for (var i2 = 0; i2 < data.length; i2++) {
              if (typeof data[i2] === "object") {
                compatBarItemStyle(data[i2]);
                compatBarItemStyle(data[i2] && data[i2].emphasis);
              }
            }
          }
        } else if (seriesType2 === "sunburst") {
          var highlightPolicy = seriesOpt.highlightPolicy;
          if (highlightPolicy) {
            seriesOpt.emphasis = seriesOpt.emphasis || {};
            if (!seriesOpt.emphasis.focus) {
              seriesOpt.emphasis.focus = highlightPolicy;
            }
          }
          compatSunburstState(seriesOpt);
          traverseTree(seriesOpt.data, compatSunburstState);
        } else if (seriesType2 === "graph" || seriesType2 === "sankey") {
          compatGraphFocus(seriesOpt);
        } else if (seriesType2 === "map") {
          if (seriesOpt.mapType && !seriesOpt.map) {
            seriesOpt.map = seriesOpt.mapType;
          }
          if (seriesOpt.mapLocation) {
            defaults$1(seriesOpt, seriesOpt.mapLocation);
          }
        }
        if (seriesOpt.hoverAnimation != null) {
          seriesOpt.emphasis = seriesOpt.emphasis || {};
          if (seriesOpt.emphasis && seriesOpt.emphasis.scale == null) {
            seriesOpt.emphasis.scale = seriesOpt.hoverAnimation;
          }
        }
        compatLayoutProperties(seriesOpt);
      });
      if (option.dataRange) {
        option.visualMap = option.dataRange;
      }
      each$f(COMPATITABLE_COMPONENTS, function(componentName2) {
        var options = option[componentName2];
        if (options) {
          if (!isArray$2(options)) {
            options = [options];
          }
          each$f(options, function(option2) {
            compatLayoutProperties(option2);
          });
        }
      });
    }
    function dataStack(ecModel) {
      var stackInfoMap = createHashMap();
      ecModel.eachSeries(function(seriesModel) {
        var stack2 = seriesModel.get("stack");
        if (stack2) {
          var stackInfoList = stackInfoMap.get(stack2) || stackInfoMap.set(stack2, []);
          var data = seriesModel.getData();
          var stackInfo = {
            // Used for calculate axis extent automatically.
            // TODO: Type getCalculationInfo return more specific type?
            stackResultDimension: data.getCalculationInfo("stackResultDimension"),
            stackedOverDimension: data.getCalculationInfo("stackedOverDimension"),
            stackedDimension: data.getCalculationInfo("stackedDimension"),
            stackedByDimension: data.getCalculationInfo("stackedByDimension"),
            isStackedByIndex: data.getCalculationInfo("isStackedByIndex"),
            data,
            seriesModel
          };
          if (!stackInfo.stackedDimension || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension)) {
            return;
          }
          stackInfoList.length && data.setCalculationInfo("stackedOnSeries", stackInfoList[stackInfoList.length - 1].seriesModel);
          stackInfoList.push(stackInfo);
        }
      });
      stackInfoMap.each(calculateStack);
    }
    function calculateStack(stackInfoList) {
      each$f(stackInfoList, function(targetStackInfo, idxInStack) {
        var resultVal = [];
        var resultNaN = [NaN, NaN];
        var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension];
        var targetData = targetStackInfo.data;
        var isStackedByIndex = targetStackInfo.isStackedByIndex;
        var stackStrategy = targetStackInfo.seriesModel.get("stackStrategy") || "samesign";
        targetData.modify(dims, function(v0, v12, dataIndex) {
          var sum2 = targetData.get(targetStackInfo.stackedDimension, dataIndex);
          if (isNaN(sum2)) {
            return resultNaN;
          }
          var byValue;
          var stackedDataRawIndex;
          if (isStackedByIndex) {
            stackedDataRawIndex = targetData.getRawIndex(dataIndex);
          } else {
            byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex);
          }
          var stackedOver = NaN;
          for (var j = idxInStack - 1; j >= 0; j--) {
            var stackInfo = stackInfoList[j];
            if (!isStackedByIndex) {
              stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue);
            }
            if (stackedDataRawIndex >= 0) {
              var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex);
              if (stackStrategy === "all" || stackStrategy === "positive" && val > 0 || stackStrategy === "negative" && val < 0 || stackStrategy === "samesign" && sum2 >= 0 && val > 0 || stackStrategy === "samesign" && sum2 <= 0 && val < 0) {
                sum2 = addSafe(sum2, val);
                stackedOver = val;
                break;
              }
            }
          }
          resultVal[0] = sum2;
          resultVal[1] = stackedOver;
          return resultVal;
        });
      });
    }
    var SourceImpl = (
      /** @class */
      /* @__PURE__ */ function() {
        function SourceImpl2(fields) {
          this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);
          this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;
          this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;
          this.startIndex = fields.startIndex || 0;
          this.dimensionsDetectedCount = fields.dimensionsDetectedCount;
          this.metaRawOption = fields.metaRawOption;
          var dimensionsDefine = this.dimensionsDefine = fields.dimensionsDefine;
          if (dimensionsDefine) {
            for (var i2 = 0; i2 < dimensionsDefine.length; i2++) {
              var dim = dimensionsDefine[i2];
              if (dim.type == null) {
                if (guessOrdinal(this, i2) === BE_ORDINAL.Must) {
                  dim.type = "ordinal";
                }
              }
            }
          }
        }
        return SourceImpl2;
      }()
    );
    function isSourceInstance(val) {
      return val instanceof SourceImpl;
    }
    function createSource(sourceData, thisMetaRawOption, sourceFormat) {
      sourceFormat = sourceFormat || detectSourceFormat(sourceData);
      var seriesLayoutBy = thisMetaRawOption.seriesLayoutBy;
      var determined = determineSourceDimensions(sourceData, sourceFormat, seriesLayoutBy, thisMetaRawOption.sourceHeader, thisMetaRawOption.dimensions);
      var source = new SourceImpl({
        data: sourceData,
        sourceFormat,
        seriesLayoutBy,
        dimensionsDefine: determined.dimensionsDefine,
        startIndex: determined.startIndex,
        dimensionsDetectedCount: determined.dimensionsDetectedCount,
        metaRawOption: clone$4(thisMetaRawOption)
      });
      return source;
    }
    function createSourceFromSeriesDataOption(data) {
      return new SourceImpl({
        data,
        sourceFormat: isTypedArray$1(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL
      });
    }
    function cloneSourceShallow(source) {
      return new SourceImpl({
        data: source.data,
        sourceFormat: source.sourceFormat,
        seriesLayoutBy: source.seriesLayoutBy,
        dimensionsDefine: clone$4(source.dimensionsDefine),
        startIndex: source.startIndex,
        dimensionsDetectedCount: source.dimensionsDetectedCount
      });
    }
    function detectSourceFormat(data) {
      var sourceFormat = SOURCE_FORMAT_UNKNOWN;
      if (isTypedArray$1(data)) {
        sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;
      } else if (isArray$2(data)) {
        if (data.length === 0) {
          sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;
        }
        for (var i2 = 0, len2 = data.length; i2 < len2; i2++) {
          var item = data[i2];
          if (item == null) {
            continue;
          } else if (isArray$2(item) || isTypedArray$1(item)) {
            sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;
            break;
          } else if (isObject$5(item)) {
            sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;
            break;
          }
        }
      } else if (isObject$5(data)) {
        for (var key in data) {
          if (hasOwn(data, key) && isArrayLike(data[key])) {
            sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;
            break;
          }
        }
      }
      return sourceFormat;
    }
    function determineSourceDimensions(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {
      var dimensionsDetectedCount;
      var startIndex;
      if (!data) {
        return {
          dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),
          startIndex,
          dimensionsDetectedCount
        };
      }
      if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {
        var dataArrayRows = data;
        if (sourceHeader === "auto" || sourceHeader == null) {
          arrayRowsTravelFirst(function(val) {
            if (val != null && val !== "-") {
              if (isString$1(val)) {
                startIndex == null && (startIndex = 1);
              } else {
                startIndex = 0;
              }
            }
          }, seriesLayoutBy, dataArrayRows, 10);
        } else {
          startIndex = isNumber$1(sourceHeader) ? sourceHeader : sourceHeader ? 1 : 0;
        }
        if (!dimensionsDefine && startIndex === 1) {
          dimensionsDefine = [];
          arrayRowsTravelFirst(function(val, index) {
            dimensionsDefine[index] = val != null ? val + "" : "";
          }, seriesLayoutBy, dataArrayRows, Infinity);
        }
        dimensionsDetectedCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? dataArrayRows.length : dataArrayRows[0] ? dataArrayRows[0].length : null;
      } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {
        if (!dimensionsDefine) {
          dimensionsDefine = objectRowsCollectDimensions(data);
        }
      } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {
        if (!dimensionsDefine) {
          dimensionsDefine = [];
          each$f(data, function(colArr, key) {
            dimensionsDefine.push(key);
          });
        }
      } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {
        var value0 = getDataItemValue(data[0]);
        dimensionsDetectedCount = isArray$2(value0) && value0.length || 1;
      } else ;
      return {
        startIndex,
        dimensionsDefine: normalizeDimensionsOption(dimensionsDefine),
        dimensionsDetectedCount
      };
    }
    function objectRowsCollectDimensions(data) {
      var firstIndex = 0;
      var obj;
      while (firstIndex < data.length && !(obj = data[firstIndex++])) {
      }
      if (obj) {
        return keys$1(obj);
      }
    }
    function normalizeDimensionsOption(dimensionsDefine) {
      if (!dimensionsDefine) {
        return;
      }
      var nameMap = createHashMap();
      return map$1(dimensionsDefine, function(rawItem, index) {
        rawItem = isObject$5(rawItem) ? rawItem : {
          name: rawItem
        };
        var item = {
          name: rawItem.name,
          displayName: rawItem.displayName,
          type: rawItem.type
        };
        if (item.name == null) {
          return item;
        }
        item.name += "";
        if (item.displayName == null) {
          item.displayName = item.name;
        }
        var exist = nameMap.get(item.name);
        if (!exist) {
          nameMap.set(item.name, {
            count: 1
          });
        } else {
          item.name += "-" + exist.count++;
        }
        return item;
      });
    }
    function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {
      if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {
        for (var i2 = 0; i2 < data.length && i2 < maxLoop; i2++) {
          cb(data[i2] ? data[i2][0] : null, i2);
        }
      } else {
        var value0 = data[0] || [];
        for (var i2 = 0; i2 < value0.length && i2 < maxLoop; i2++) {
          cb(value0[i2], i2);
        }
      }
    }
    function shouldRetrieveDataByName(source) {
      var sourceFormat = source.sourceFormat;
      return sourceFormat === SOURCE_FORMAT_OBJECT_ROWS || sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS;
    }
    var _a, _b, _c;
    var providerMethods;
    var mountMethods;
    var DefaultDataProvider = (
      /** @class */
      function() {
        function DefaultDataProvider2(sourceParam, dimSize) {
          var source = !isSourceInstance(sourceParam) ? createSourceFromSeriesDataOption(sourceParam) : sourceParam;
          this._source = source;
          var data = this._data = source.data;
          if (source.sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {
            this._offset = 0;
            this._dimSize = dimSize;
            this._data = data;
          }
          mountMethods(this, data, source);
        }
        DefaultDataProvider2.prototype.getSource = function() {
          return this._source;
        };
        DefaultDataProvider2.prototype.count = function() {
          return 0;
        };
        DefaultDataProvider2.prototype.getItem = function(idx, out2) {
          return;
        };
        DefaultDataProvider2.prototype.appendData = function(newData) {
        };
        DefaultDataProvider2.prototype.clean = function() {
        };
        DefaultDataProvider2.protoInitialize = function() {
          var proto2 = DefaultDataProvider2.prototype;
          proto2.pure = false;
          proto2.persistent = true;
        }();
        DefaultDataProvider2.internalField = function() {
          var _a2;
          mountMethods = function(provider, data, source) {
            var sourceFormat = source.sourceFormat;
            var seriesLayoutBy = source.seriesLayoutBy;
            var startIndex = source.startIndex;
            var dimsDef = source.dimensionsDefine;
            var methods = providerMethods[getMethodMapKey(sourceFormat, seriesLayoutBy)];
            extend$1(provider, methods);
            if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {
              provider.getItem = getItemForTypedArray;
              provider.count = countForTypedArray;
              provider.fillStorage = fillStorageForTypedArray;
            } else {
              var rawItemGetter = getRawSourceItemGetter(sourceFormat, seriesLayoutBy);
              provider.getItem = bind$2(rawItemGetter, null, data, startIndex, dimsDef);
              var rawCounter = getRawSourceDataCounter(sourceFormat, seriesLayoutBy);
              provider.count = bind$2(rawCounter, null, data, startIndex, dimsDef);
            }
          };
          var getItemForTypedArray = function(idx, out2) {
            idx = idx - this._offset;
            out2 = out2 || [];
            var data = this._data;
            var dimSize = this._dimSize;
            var offset2 = dimSize * idx;
            for (var i2 = 0; i2 < dimSize; i2++) {
              out2[i2] = data[offset2 + i2];
            }
            return out2;
          };
          var fillStorageForTypedArray = function(start2, end2, storage2, extent3) {
            var data = this._data;
            var dimSize = this._dimSize;
            for (var dim = 0; dim < dimSize; dim++) {
              var dimExtent = extent3[dim];
              var min3 = dimExtent[0] == null ? Infinity : dimExtent[0];
              var max3 = dimExtent[1] == null ? -Infinity : dimExtent[1];
              var count2 = end2 - start2;
              var arr = storage2[dim];
              for (var i2 = 0; i2 < count2; i2++) {
                var val = data[i2 * dimSize + dim];
                arr[start2 + i2] = val;
                val < min3 && (min3 = val);
                val > max3 && (max3 = val);
              }
              dimExtent[0] = min3;
              dimExtent[1] = max3;
            }
          };
          var countForTypedArray = function() {
            return this._data ? this._data.length / this._dimSize : 0;
          };
          providerMethods = (_a2 = {}, _a2[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN] = {
            pure: true,
            appendData: appendDataSimply
          }, _a2[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW] = {
            pure: true,
            appendData: function() {
              throw new Error('Do not support appendData when set seriesLayoutBy: "row".');
            }
          }, _a2[SOURCE_FORMAT_OBJECT_ROWS] = {
            pure: true,
            appendData: appendDataSimply
          }, _a2[SOURCE_FORMAT_KEYED_COLUMNS] = {
            pure: true,
            appendData: function(newData) {
              var data = this._data;
              each$f(newData, function(newCol, key) {
                var oldCol = data[key] || (data[key] = []);
                for (var i2 = 0; i2 < (newCol || []).length; i2++) {
                  oldCol.push(newCol[i2]);
                }
              });
            }
          }, _a2[SOURCE_FORMAT_ORIGINAL] = {
            appendData: appendDataSimply
          }, _a2[SOURCE_FORMAT_TYPED_ARRAY] = {
            persistent: false,
            pure: true,
            appendData: function(newData) {
              this._data = newData;
            },
            // Clean self if data is already used.
            clean: function() {
              this._offset += this.count();
              this._data = null;
            }
          }, _a2);
          function appendDataSimply(newData) {
            for (var i2 = 0; i2 < newData.length; i2++) {
              this._data.push(newData[i2]);
            }
          }
        }();
        return DefaultDataProvider2;
      }()
    );
    var getItemSimply = function(rawData, startIndex, dimsDef, idx) {
      return rawData[idx];
    };
    var rawSourceItemGetterMap = (_a = {}, _a[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN] = function(rawData, startIndex, dimsDef, idx) {
      return rawData[idx + startIndex];
    }, _a[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW] = function(rawData, startIndex, dimsDef, idx, out2) {
      idx += startIndex;
      var item = out2 || [];
      var data = rawData;
      for (var i2 = 0; i2 < data.length; i2++) {
        var row = data[i2];
        item[i2] = row ? row[idx] : null;
      }
      return item;
    }, _a[SOURCE_FORMAT_OBJECT_ROWS] = getItemSimply, _a[SOURCE_FORMAT_KEYED_COLUMNS] = function(rawData, startIndex, dimsDef, idx, out2) {
      var item = out2 || [];
      for (var i2 = 0; i2 < dimsDef.length; i2++) {
        var dimName = dimsDef[i2].name;
        var col = rawData[dimName];
        item[i2] = col ? col[idx] : null;
      }
      return item;
    }, _a[SOURCE_FORMAT_ORIGINAL] = getItemSimply, _a);
    function getRawSourceItemGetter(sourceFormat, seriesLayoutBy) {
      var method = rawSourceItemGetterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];
      return method;
    }
    var countSimply = function(rawData, startIndex, dimsDef) {
      return rawData.length;
    };
    var rawSourceDataCounterMap = (_b = {}, _b[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_COLUMN] = function(rawData, startIndex, dimsDef) {
      return Math.max(0, rawData.length - startIndex);
    }, _b[SOURCE_FORMAT_ARRAY_ROWS + "_" + SERIES_LAYOUT_BY_ROW] = function(rawData, startIndex, dimsDef) {
      var row = rawData[0];
      return row ? Math.max(0, row.length - startIndex) : 0;
    }, _b[SOURCE_FORMAT_OBJECT_ROWS] = countSimply, _b[SOURCE_FORMAT_KEYED_COLUMNS] = function(rawData, startIndex, dimsDef) {
      var dimName = dimsDef[0].name;
      var col = rawData[dimName];
      return col ? col.length : 0;
    }, _b[SOURCE_FORMAT_ORIGINAL] = countSimply, _b);
    function getRawSourceDataCounter(sourceFormat, seriesLayoutBy) {
      var method = rawSourceDataCounterMap[getMethodMapKey(sourceFormat, seriesLayoutBy)];
      return method;
    }
    var getRawValueSimply = function(dataItem, dimIndex, property2) {
      return dataItem[dimIndex];
    };
    var rawSourceValueGetterMap = (_c = {}, _c[SOURCE_FORMAT_ARRAY_ROWS] = getRawValueSimply, _c[SOURCE_FORMAT_OBJECT_ROWS] = function(dataItem, dimIndex, property2) {
      return dataItem[property2];
    }, _c[SOURCE_FORMAT_KEYED_COLUMNS] = getRawValueSimply, _c[SOURCE_FORMAT_ORIGINAL] = function(dataItem, dimIndex, property2) {
      var value = getDataItemValue(dataItem);
      return !(value instanceof Array) ? value : value[dimIndex];
    }, _c[SOURCE_FORMAT_TYPED_ARRAY] = getRawValueSimply, _c);
    function getRawSourceValueGetter(sourceFormat) {
      var method = rawSourceValueGetterMap[sourceFormat];
      return method;
    }
    function getMethodMapKey(sourceFormat, seriesLayoutBy) {
      return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS ? sourceFormat + "_" + seriesLayoutBy : sourceFormat;
    }
    function retrieveRawValue(data, dataIndex, dim) {
      if (!data) {
        return;
      }
      var dataItem = data.getRawDataItem(dataIndex);
      if (dataItem == null) {
        return;
      }
      var store2 = data.getStore();
      var sourceFormat = store2.getSource().sourceFormat;
      if (dim != null) {
        var dimIndex = data.getDimensionIndex(dim);
        var property2 = store2.getDimensionProperty(dimIndex);
        return getRawSourceValueGetter(sourceFormat)(dataItem, dimIndex, property2);
      } else {
        var result = dataItem;
        if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {
          result = getDataItemValue(dataItem);
        }
        return result;
      }
    }
    var DIMENSION_LABEL_REG = /\{@(.+?)\}/g;
    var DataFormatMixin = (
      /** @class */
      function() {
        function DataFormatMixin2() {
        }
        DataFormatMixin2.prototype.getDataParams = function(dataIndex, dataType2) {
          var data = this.getData(dataType2);
          var rawValue = this.getRawValue(dataIndex, dataType2);
          var rawDataIndex = data.getRawIndex(dataIndex);
          var name = data.getName(dataIndex);
          var itemOpt = data.getRawDataItem(dataIndex);
          var style = data.getItemVisual(dataIndex, "style");
          var color2 = style && style[data.getItemVisual(dataIndex, "drawType") || "fill"];
          var borderColor = style && style.stroke;
          var mainType = this.mainType;
          var isSeries2 = mainType === "series";
          var userOutput = data.userOutput && data.userOutput.get();
          return {
            componentType: mainType,
            componentSubType: this.subType,
            componentIndex: this.componentIndex,
            seriesType: isSeries2 ? this.subType : null,
            seriesIndex: this.seriesIndex,
            seriesId: isSeries2 ? this.id : null,
            seriesName: isSeries2 ? this.name : null,
            name,
            dataIndex: rawDataIndex,
            data: itemOpt,
            dataType: dataType2,
            value: rawValue,
            color: color2,
            borderColor,
            dimensionNames: userOutput ? userOutput.fullDimensions : null,
            encode: userOutput ? userOutput.encode : null,
            // Param name list for mapping `a`, `b`, `c`, `d`, `e`
            $vars: ["seriesName", "name", "value"]
          };
        };
        DataFormatMixin2.prototype.getFormattedLabel = function(dataIndex, status, dataType2, labelDimIndex, formatter2, extendParams) {
          status = status || "normal";
          var data = this.getData(dataType2);
          var params = this.getDataParams(dataIndex, dataType2);
          if (extendParams) {
            params.value = extendParams.interpolatedValue;
          }
          if (labelDimIndex != null && isArray$2(params.value)) {
            params.value = params.value[labelDimIndex];
          }
          if (!formatter2) {
            var itemModel = data.getItemModel(dataIndex);
            formatter2 = itemModel.get(status === "normal" ? ["label", "formatter"] : [status, "label", "formatter"]);
          }
          if (isFunction$1(formatter2)) {
            params.status = status;
            params.dimensionIndex = labelDimIndex;
            return formatter2(params);
          } else if (isString$1(formatter2)) {
            var str = formatTpl(formatter2, params);
            return str.replace(DIMENSION_LABEL_REG, function(origin2, dimStr) {
              var len2 = dimStr.length;
              var dimLoose = dimStr;
              if (dimLoose.charAt(0) === "[" && dimLoose.charAt(len2 - 1) === "]") {
                dimLoose = +dimLoose.slice(1, len2 - 1);
              }
              var val = retrieveRawValue(data, dataIndex, dimLoose);
              if (extendParams && isArray$2(extendParams.interpolatedValue)) {
                var dimIndex = data.getDimensionIndex(dimLoose);
                if (dimIndex >= 0) {
                  val = extendParams.interpolatedValue[dimIndex];
                }
              }
              return val != null ? val + "" : "";
            });
          }
        };
        DataFormatMixin2.prototype.getRawValue = function(idx, dataType2) {
          return retrieveRawValue(this.getData(dataType2), idx);
        };
        DataFormatMixin2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          return;
        };
        return DataFormatMixin2;
      }()
    );
    function normalizeTooltipFormatResult(result) {
      var markupText;
      var markupFragment;
      if (isObject$5(result)) {
        if (result.type) {
          markupFragment = result;
        }
      } else {
        markupText = result;
      }
      return {
        text: markupText,
        // markers: markers || markersExisting,
        frag: markupFragment
      };
    }
    function createTask(define) {
      return new Task(define);
    }
    var Task = (
      /** @class */
      function() {
        function Task2(define) {
          define = define || {};
          this._reset = define.reset;
          this._plan = define.plan;
          this._count = define.count;
          this._onDirty = define.onDirty;
          this._dirty = true;
        }
        Task2.prototype.perform = function(performArgs) {
          var upTask = this._upstream;
          var skip = performArgs && performArgs.skip;
          if (this._dirty && upTask) {
            var context = this.context;
            context.data = context.outputData = upTask.context.outputData;
          }
          if (this.__pipeline) {
            this.__pipeline.currentTask = this;
          }
          var planResult;
          if (this._plan && !skip) {
            planResult = this._plan(this.context);
          }
          var lastModBy = normalizeModBy(this._modBy);
          var lastModDataCount = this._modDataCount || 0;
          var modBy = normalizeModBy(performArgs && performArgs.modBy);
          var modDataCount = performArgs && performArgs.modDataCount || 0;
          if (lastModBy !== modBy || lastModDataCount !== modDataCount) {
            planResult = "reset";
          }
          function normalizeModBy(val) {
            !(val >= 1) && (val = 1);
            return val;
          }
          var forceFirstProgress;
          if (this._dirty || planResult === "reset") {
            this._dirty = false;
            forceFirstProgress = this._doReset(skip);
          }
          this._modBy = modBy;
          this._modDataCount = modDataCount;
          var step = performArgs && performArgs.step;
          if (upTask) {
            this._dueEnd = upTask._outputDueEnd;
          } else {
            this._dueEnd = this._count ? this._count(this.context) : Infinity;
          }
          if (this._progress) {
            var start2 = this._dueIndex;
            var end2 = Math.min(step != null ? this._dueIndex + step : Infinity, this._dueEnd);
            if (!skip && (forceFirstProgress || start2 < end2)) {
              var progress = this._progress;
              if (isArray$2(progress)) {
                for (var i2 = 0; i2 < progress.length; i2++) {
                  this._doProgress(progress[i2], start2, end2, modBy, modDataCount);
                }
              } else {
                this._doProgress(progress, start2, end2, modBy, modDataCount);
              }
            }
            this._dueIndex = end2;
            var outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : end2;
            this._outputDueEnd = outputDueEnd;
          } else {
            this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null ? this._settedOutputEnd : this._dueEnd;
          }
          return this.unfinished();
        };
        Task2.prototype.dirty = function() {
          this._dirty = true;
          this._onDirty && this._onDirty(this.context);
        };
        Task2.prototype._doProgress = function(progress, start2, end2, modBy, modDataCount) {
          iterator$1.reset(start2, end2, modBy, modDataCount);
          this._callingProgress = progress;
          this._callingProgress({
            start: start2,
            end: end2,
            count: end2 - start2,
            next: iterator$1.next
          }, this.context);
        };
        Task2.prototype._doReset = function(skip) {
          this._dueIndex = this._outputDueEnd = this._dueEnd = 0;
          this._settedOutputEnd = null;
          var progress;
          var forceFirstProgress;
          if (!skip && this._reset) {
            progress = this._reset(this.context);
            if (progress && progress.progress) {
              forceFirstProgress = progress.forceFirstProgress;
              progress = progress.progress;
            }
            if (isArray$2(progress) && !progress.length) {
              progress = null;
            }
          }
          this._progress = progress;
          this._modBy = this._modDataCount = null;
          var downstream = this._downstream;
          downstream && downstream.dirty();
          return forceFirstProgress;
        };
        Task2.prototype.unfinished = function() {
          return this._progress && this._dueIndex < this._dueEnd;
        };
        Task2.prototype.pipe = function(downTask) {
          if (this._downstream !== downTask || this._dirty) {
            this._downstream = downTask;
            downTask._upstream = this;
            downTask.dirty();
          }
        };
        Task2.prototype.dispose = function() {
          if (this._disposed) {
            return;
          }
          this._upstream && (this._upstream._downstream = null);
          this._downstream && (this._downstream._upstream = null);
          this._dirty = false;
          this._disposed = true;
        };
        Task2.prototype.getUpstream = function() {
          return this._upstream;
        };
        Task2.prototype.getDownstream = function() {
          return this._downstream;
        };
        Task2.prototype.setOutputEnd = function(end2) {
          this._outputDueEnd = this._settedOutputEnd = end2;
        };
        return Task2;
      }()
    );
    var iterator$1 = /* @__PURE__ */ function() {
      var end2;
      var current;
      var modBy;
      var modDataCount;
      var winCount;
      var it2 = {
        reset: function(s2, e2, sStep, sCount) {
          current = s2;
          end2 = e2;
          modBy = sStep;
          modDataCount = sCount;
          winCount = Math.ceil(modDataCount / modBy);
          it2.next = modBy > 1 && modDataCount > 0 ? modNext : sequentialNext;
        }
      };
      return it2;
      function sequentialNext() {
        return current < end2 ? current++ : null;
      }
      function modNext() {
        var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);
        var result = current >= end2 ? null : dataIndex < modDataCount ? dataIndex : current;
        current++;
        return result;
      }
    }();
    function parseDataValue(value, opt) {
      var dimType = opt && opt.type;
      if (dimType === "ordinal") {
        return value;
      }
      if (dimType === "time" && !isNumber$1(value) && value != null && value !== "-") {
        value = +parseDate$1(value);
      }
      return value == null || value === "" ? NaN : Number(value);
    }
    var valueParserMap = createHashMap({
      "number": function(val) {
        return parseFloat(val);
      },
      "time": function(val) {
        return +parseDate$1(val);
      },
      "trim": function(val) {
        return isString$1(val) ? trim$2(val) : val;
      }
    });
    function getRawValueParser(type) {
      return valueParserMap.get(type);
    }
    var ORDER_COMPARISON_OP_MAP = {
      lt: function(lval, rval) {
        return lval < rval;
      },
      lte: function(lval, rval) {
        return lval <= rval;
      },
      gt: function(lval, rval) {
        return lval > rval;
      },
      gte: function(lval, rval) {
        return lval >= rval;
      }
    };
    var FilterOrderComparator = (
      /** @class */
      function() {
        function FilterOrderComparator2(op, rval) {
          if (!isNumber$1(rval)) {
            var errMsg = "";
            throwError(errMsg);
          }
          this._opFn = ORDER_COMPARISON_OP_MAP[op];
          this._rvalFloat = numericToNumber(rval);
        }
        FilterOrderComparator2.prototype.evaluate = function(lval) {
          return isNumber$1(lval) ? this._opFn(lval, this._rvalFloat) : this._opFn(numericToNumber(lval), this._rvalFloat);
        };
        return FilterOrderComparator2;
      }()
    );
    var SortOrderComparator = (
      /** @class */
      function() {
        function SortOrderComparator2(order, incomparable) {
          var isDesc = order === "desc";
          this._resultLT = isDesc ? 1 : -1;
          if (incomparable == null) {
            incomparable = isDesc ? "min" : "max";
          }
          this._incomparable = incomparable === "min" ? -Infinity : Infinity;
        }
        SortOrderComparator2.prototype.evaluate = function(lval, rval) {
          var lvalFloat = isNumber$1(lval) ? lval : numericToNumber(lval);
          var rvalFloat = isNumber$1(rval) ? rval : numericToNumber(rval);
          var lvalNotNumeric = isNaN(lvalFloat);
          var rvalNotNumeric = isNaN(rvalFloat);
          if (lvalNotNumeric) {
            lvalFloat = this._incomparable;
          }
          if (rvalNotNumeric) {
            rvalFloat = this._incomparable;
          }
          if (lvalNotNumeric && rvalNotNumeric) {
            var lvalIsStr = isString$1(lval);
            var rvalIsStr = isString$1(rval);
            if (lvalIsStr) {
              lvalFloat = rvalIsStr ? lval : 0;
            }
            if (rvalIsStr) {
              rvalFloat = lvalIsStr ? rval : 0;
            }
          }
          return lvalFloat < rvalFloat ? this._resultLT : lvalFloat > rvalFloat ? -this._resultLT : 0;
        };
        return SortOrderComparator2;
      }()
    );
    var FilterEqualityComparator = (
      /** @class */
      function() {
        function FilterEqualityComparator2(isEq, rval) {
          this._rval = rval;
          this._isEQ = isEq;
          this._rvalTypeof = typeof rval;
          this._rvalFloat = numericToNumber(rval);
        }
        FilterEqualityComparator2.prototype.evaluate = function(lval) {
          var eqResult = lval === this._rval;
          if (!eqResult) {
            var lvalTypeof = typeof lval;
            if (lvalTypeof !== this._rvalTypeof && (lvalTypeof === "number" || this._rvalTypeof === "number")) {
              eqResult = numericToNumber(lval) === this._rvalFloat;
            }
          }
          return this._isEQ ? eqResult : !eqResult;
        };
        return FilterEqualityComparator2;
      }()
    );
    function createFilterComparator(op, rval) {
      return op === "eq" || op === "ne" ? new FilterEqualityComparator(op === "eq", rval) : hasOwn(ORDER_COMPARISON_OP_MAP, op) ? new FilterOrderComparator(op, rval) : null;
    }
    var ExternalSource = (
      /** @class */
      function() {
        function ExternalSource2() {
        }
        ExternalSource2.prototype.getRawData = function() {
          throw new Error("not supported");
        };
        ExternalSource2.prototype.getRawDataItem = function(dataIndex) {
          throw new Error("not supported");
        };
        ExternalSource2.prototype.cloneRawData = function() {
          return;
        };
        ExternalSource2.prototype.getDimensionInfo = function(dim) {
          return;
        };
        ExternalSource2.prototype.cloneAllDimensionInfo = function() {
          return;
        };
        ExternalSource2.prototype.count = function() {
          return;
        };
        ExternalSource2.prototype.retrieveValue = function(dataIndex, dimIndex) {
          return;
        };
        ExternalSource2.prototype.retrieveValueFromItem = function(dataItem, dimIndex) {
          return;
        };
        ExternalSource2.prototype.convertValue = function(rawVal, dimInfo) {
          return parseDataValue(rawVal, dimInfo);
        };
        return ExternalSource2;
      }()
    );
    function createExternalSource(internalSource, externalTransform) {
      var extSource = new ExternalSource();
      var data = internalSource.data;
      var sourceFormat = extSource.sourceFormat = internalSource.sourceFormat;
      var sourceHeaderCount = internalSource.startIndex;
      var errMsg = "";
      if (internalSource.seriesLayoutBy !== SERIES_LAYOUT_BY_COLUMN) {
        throwError(errMsg);
      }
      var dimensions = [];
      var dimsByName = {};
      var dimsDef = internalSource.dimensionsDefine;
      if (dimsDef) {
        each$f(dimsDef, function(dimDef, idx) {
          var name = dimDef.name;
          var dimDefExt = {
            index: idx,
            name,
            displayName: dimDef.displayName
          };
          dimensions.push(dimDefExt);
          if (name != null) {
            var errMsg_1 = "";
            if (hasOwn(dimsByName, name)) {
              throwError(errMsg_1);
            }
            dimsByName[name] = dimDefExt;
          }
        });
      } else {
        for (var i2 = 0; i2 < internalSource.dimensionsDetectedCount || 0; i2++) {
          dimensions.push({
            index: i2
          });
        }
      }
      var rawItemGetter = getRawSourceItemGetter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);
      if (externalTransform.__isBuiltIn) {
        extSource.getRawDataItem = function(dataIndex) {
          return rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);
        };
        extSource.getRawData = bind$2(getRawData, null, internalSource);
      }
      extSource.cloneRawData = bind$2(cloneRawData, null, internalSource);
      var rawCounter = getRawSourceDataCounter(sourceFormat, SERIES_LAYOUT_BY_COLUMN);
      extSource.count = bind$2(rawCounter, null, data, sourceHeaderCount, dimensions);
      var rawValueGetter = getRawSourceValueGetter(sourceFormat);
      extSource.retrieveValue = function(dataIndex, dimIndex) {
        var rawItem = rawItemGetter(data, sourceHeaderCount, dimensions, dataIndex);
        return retrieveValueFromItem(rawItem, dimIndex);
      };
      var retrieveValueFromItem = extSource.retrieveValueFromItem = function(dataItem, dimIndex) {
        if (dataItem == null) {
          return;
        }
        var dimDef = dimensions[dimIndex];
        if (dimDef) {
          return rawValueGetter(dataItem, dimIndex, dimDef.name);
        }
      };
      extSource.getDimensionInfo = bind$2(getDimensionInfo, null, dimensions, dimsByName);
      extSource.cloneAllDimensionInfo = bind$2(cloneAllDimensionInfo, null, dimensions);
      return extSource;
    }
    function getRawData(upstream) {
      var sourceFormat = upstream.sourceFormat;
      if (!isSupportedSourceFormat(sourceFormat)) {
        var errMsg = "";
        throwError(errMsg);
      }
      return upstream.data;
    }
    function cloneRawData(upstream) {
      var sourceFormat = upstream.sourceFormat;
      var data = upstream.data;
      if (!isSupportedSourceFormat(sourceFormat)) {
        var errMsg = "";
        throwError(errMsg);
      }
      if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {
        var result = [];
        for (var i2 = 0, len2 = data.length; i2 < len2; i2++) {
          result.push(data[i2].slice());
        }
        return result;
      } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {
        var result = [];
        for (var i2 = 0, len2 = data.length; i2 < len2; i2++) {
          result.push(extend$1({}, data[i2]));
        }
        return result;
      }
    }
    function getDimensionInfo(dimensions, dimsByName, dim) {
      if (dim == null) {
        return;
      }
      if (isNumber$1(dim) || !isNaN(dim) && !hasOwn(dimsByName, dim)) {
        return dimensions[dim];
      } else if (hasOwn(dimsByName, dim)) {
        return dimsByName[dim];
      }
    }
    function cloneAllDimensionInfo(dimensions) {
      return clone$4(dimensions);
    }
    var externalTransformMap = createHashMap();
    function registerExternalTransform(externalTransform) {
      externalTransform = clone$4(externalTransform);
      var type = externalTransform.type;
      var errMsg = "";
      if (!type) {
        throwError(errMsg);
      }
      var typeParsed = type.split(":");
      if (typeParsed.length !== 2) {
        throwError(errMsg);
      }
      var isBuiltIn = false;
      if (typeParsed[0] === "echarts") {
        type = typeParsed[1];
        isBuiltIn = true;
      }
      externalTransform.__isBuiltIn = isBuiltIn;
      externalTransformMap.set(type, externalTransform);
    }
    function applyDataTransform(rawTransOption, sourceList, infoForPrint) {
      var pipedTransOption = normalizeToArray(rawTransOption);
      var pipeLen = pipedTransOption.length;
      var errMsg = "";
      if (!pipeLen) {
        throwError(errMsg);
      }
      for (var i2 = 0, len2 = pipeLen; i2 < len2; i2++) {
        var transOption = pipedTransOption[i2];
        sourceList = applySingleDataTransform(transOption, sourceList);
        if (i2 !== len2 - 1) {
          sourceList.length = Math.max(sourceList.length, 1);
        }
      }
      return sourceList;
    }
    function applySingleDataTransform(transOption, upSourceList, infoForPrint, pipeIndex) {
      var errMsg = "";
      if (!upSourceList.length) {
        throwError(errMsg);
      }
      if (!isObject$5(transOption)) {
        throwError(errMsg);
      }
      var transType = transOption.type;
      var externalTransform = externalTransformMap.get(transType);
      if (!externalTransform) {
        throwError(errMsg);
      }
      var extUpSourceList = map$1(upSourceList, function(upSource) {
        return createExternalSource(upSource, externalTransform);
      });
      var resultList = normalizeToArray(externalTransform.transform({
        upstream: extUpSourceList[0],
        upstreamList: extUpSourceList,
        config: clone$4(transOption.config)
      }));
      return map$1(resultList, function(result, resultIndex) {
        var errMsg2 = "";
        if (!isObject$5(result)) {
          throwError(errMsg2);
        }
        if (!result.data) {
          throwError(errMsg2);
        }
        var sourceFormat = detectSourceFormat(result.data);
        if (!isSupportedSourceFormat(sourceFormat)) {
          throwError(errMsg2);
        }
        var resultMetaRawOption;
        var firstUpSource = upSourceList[0];
        if (firstUpSource && resultIndex === 0 && !result.dimensions) {
          var startIndex = firstUpSource.startIndex;
          if (startIndex) {
            result.data = firstUpSource.data.slice(0, startIndex).concat(result.data);
          }
          resultMetaRawOption = {
            seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,
            sourceHeader: startIndex,
            dimensions: firstUpSource.metaRawOption.dimensions
          };
        } else {
          resultMetaRawOption = {
            seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,
            sourceHeader: 0,
            dimensions: result.dimensions
          };
        }
        return createSource(result.data, resultMetaRawOption, null);
      });
    }
    function isSupportedSourceFormat(sourceFormat) {
      return sourceFormat === SOURCE_FORMAT_ARRAY_ROWS || sourceFormat === SOURCE_FORMAT_OBJECT_ROWS;
    }
    var UNDEFINED = "undefined";
    var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array;
    var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array;
    var CtorInt32Array$1 = typeof Int32Array === UNDEFINED ? Array : Int32Array;
    var CtorFloat64Array = typeof Float64Array === UNDEFINED ? Array : Float64Array;
    var dataCtors = {
      "float": CtorFloat64Array,
      "int": CtorInt32Array$1,
      // Ordinal data type can be string or int
      "ordinal": Array,
      "number": Array,
      "time": CtorFloat64Array
    };
    var defaultDimValueGetters;
    function getIndicesCtor(rawCount) {
      return rawCount > 65535 ? CtorUint32Array : CtorUint16Array;
    }
    function getInitialExtent() {
      return [Infinity, -Infinity];
    }
    function cloneChunk(originalChunk) {
      var Ctor = originalChunk.constructor;
      return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk);
    }
    function prepareStore(store2, dimIdx, dimType, end2, append) {
      var DataCtor = dataCtors[dimType || "float"];
      if (append) {
        var oldStore = store2[dimIdx];
        var oldLen = oldStore && oldStore.length;
        if (!(oldLen === end2)) {
          var newStore = new DataCtor(end2);
          for (var j = 0; j < oldLen; j++) {
            newStore[j] = oldStore[j];
          }
          store2[dimIdx] = newStore;
        }
      } else {
        store2[dimIdx] = new DataCtor(end2);
      }
    }
    var DataStore = (
      /** @class */
      function() {
        function DataStore2() {
          this._chunks = [];
          this._rawExtent = [];
          this._extent = [];
          this._count = 0;
          this._rawCount = 0;
          this._calcDimNameToIdx = createHashMap();
        }
        DataStore2.prototype.initData = function(provider, inputDimensions, dimValueGetter) {
          this._provider = provider;
          this._chunks = [];
          this._indices = null;
          this.getRawIndex = this._getRawIdxIdentity;
          var source = provider.getSource();
          var defaultGetter = this.defaultDimValueGetter = defaultDimValueGetters[source.sourceFormat];
          this._dimValueGetter = dimValueGetter || defaultGetter;
          this._rawExtent = [];
          shouldRetrieveDataByName(source);
          this._dimensions = map$1(inputDimensions, function(dim) {
            return {
              // Only pick these two props. Not leak other properties like orderMeta.
              type: dim.type,
              property: dim.property
            };
          });
          this._initDataFromProvider(0, provider.count());
        };
        DataStore2.prototype.getProvider = function() {
          return this._provider;
        };
        DataStore2.prototype.getSource = function() {
          return this._provider.getSource();
        };
        DataStore2.prototype.ensureCalculationDimension = function(dimName, type) {
          var calcDimNameToIdx = this._calcDimNameToIdx;
          var dimensions = this._dimensions;
          var calcDimIdx = calcDimNameToIdx.get(dimName);
          if (calcDimIdx != null) {
            if (dimensions[calcDimIdx].type === type) {
              return calcDimIdx;
            }
          } else {
            calcDimIdx = dimensions.length;
          }
          dimensions[calcDimIdx] = {
            type
          };
          calcDimNameToIdx.set(dimName, calcDimIdx);
          this._chunks[calcDimIdx] = new dataCtors[type || "float"](this._rawCount);
          this._rawExtent[calcDimIdx] = getInitialExtent();
          return calcDimIdx;
        };
        DataStore2.prototype.collectOrdinalMeta = function(dimIdx, ordinalMeta) {
          var chunk = this._chunks[dimIdx];
          var dim = this._dimensions[dimIdx];
          var rawExtents = this._rawExtent;
          var offset2 = dim.ordinalOffset || 0;
          var len2 = chunk.length;
          if (offset2 === 0) {
            rawExtents[dimIdx] = getInitialExtent();
          }
          var dimRawExtent = rawExtents[dimIdx];
          for (var i2 = offset2; i2 < len2; i2++) {
            var val = chunk[i2] = ordinalMeta.parseAndCollect(chunk[i2]);
            if (!isNaN(val)) {
              dimRawExtent[0] = Math.min(val, dimRawExtent[0]);
              dimRawExtent[1] = Math.max(val, dimRawExtent[1]);
            }
          }
          dim.ordinalMeta = ordinalMeta;
          dim.ordinalOffset = len2;
          dim.type = "ordinal";
        };
        DataStore2.prototype.getOrdinalMeta = function(dimIdx) {
          var dimInfo = this._dimensions[dimIdx];
          var ordinalMeta = dimInfo.ordinalMeta;
          return ordinalMeta;
        };
        DataStore2.prototype.getDimensionProperty = function(dimIndex) {
          var item = this._dimensions[dimIndex];
          return item && item.property;
        };
        DataStore2.prototype.appendData = function(data) {
          var provider = this._provider;
          var start2 = this.count();
          provider.appendData(data);
          var end2 = provider.count();
          if (!provider.persistent) {
            end2 += start2;
          }
          if (start2 < end2) {
            this._initDataFromProvider(start2, end2, true);
          }
          return [start2, end2];
        };
        DataStore2.prototype.appendValues = function(values, minFillLen) {
          var chunks = this._chunks;
          var dimensions = this._dimensions;
          var dimLen = dimensions.length;
          var rawExtent = this._rawExtent;
          var start2 = this.count();
          var end2 = start2 + Math.max(values.length, minFillLen || 0);
          for (var i2 = 0; i2 < dimLen; i2++) {
            var dim = dimensions[i2];
            prepareStore(chunks, i2, dim.type, end2, true);
          }
          var emptyDataItem = [];
          for (var idx = start2; idx < end2; idx++) {
            var sourceIdx = idx - start2;
            for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {
              var dim = dimensions[dimIdx];
              var val = defaultDimValueGetters.arrayRows.call(this, values[sourceIdx] || emptyDataItem, dim.property, sourceIdx, dimIdx);
              chunks[dimIdx][idx] = val;
              var dimRawExtent = rawExtent[dimIdx];
              val < dimRawExtent[0] && (dimRawExtent[0] = val);
              val > dimRawExtent[1] && (dimRawExtent[1] = val);
            }
          }
          this._rawCount = this._count = end2;
          return {
            start: start2,
            end: end2
          };
        };
        DataStore2.prototype._initDataFromProvider = function(start2, end2, append) {
          var provider = this._provider;
          var chunks = this._chunks;
          var dimensions = this._dimensions;
          var dimLen = dimensions.length;
          var rawExtent = this._rawExtent;
          var dimNames = map$1(dimensions, function(dim2) {
            return dim2.property;
          });
          for (var i2 = 0; i2 < dimLen; i2++) {
            var dim = dimensions[i2];
            if (!rawExtent[i2]) {
              rawExtent[i2] = getInitialExtent();
            }
            prepareStore(chunks, i2, dim.type, end2, append);
          }
          if (provider.fillStorage) {
            provider.fillStorage(start2, end2, chunks, rawExtent);
          } else {
            var dataItem = [];
            for (var idx = start2; idx < end2; idx++) {
              dataItem = provider.getItem(idx, dataItem);
              for (var dimIdx = 0; dimIdx < dimLen; dimIdx++) {
                var dimStorage = chunks[dimIdx];
                var val = this._dimValueGetter(dataItem, dimNames[dimIdx], idx, dimIdx);
                dimStorage[idx] = val;
                var dimRawExtent = rawExtent[dimIdx];
                val < dimRawExtent[0] && (dimRawExtent[0] = val);
                val > dimRawExtent[1] && (dimRawExtent[1] = val);
              }
            }
          }
          if (!provider.persistent && provider.clean) {
            provider.clean();
          }
          this._rawCount = this._count = end2;
          this._extent = [];
        };
        DataStore2.prototype.count = function() {
          return this._count;
        };
        DataStore2.prototype.get = function(dim, idx) {
          if (!(idx >= 0 && idx < this._count)) {
            return NaN;
          }
          var dimStore = this._chunks[dim];
          return dimStore ? dimStore[this.getRawIndex(idx)] : NaN;
        };
        DataStore2.prototype.getValues = function(dimensions, idx) {
          var values = [];
          var dimArr = [];
          if (idx == null) {
            idx = dimensions;
            dimensions = [];
            for (var i2 = 0; i2 < this._dimensions.length; i2++) {
              dimArr.push(i2);
            }
          } else {
            dimArr = dimensions;
          }
          for (var i2 = 0, len2 = dimArr.length; i2 < len2; i2++) {
            values.push(this.get(dimArr[i2], idx));
          }
          return values;
        };
        DataStore2.prototype.getByRawIndex = function(dim, rawIdx) {
          if (!(rawIdx >= 0 && rawIdx < this._rawCount)) {
            return NaN;
          }
          var dimStore = this._chunks[dim];
          return dimStore ? dimStore[rawIdx] : NaN;
        };
        DataStore2.prototype.getSum = function(dim) {
          var dimData = this._chunks[dim];
          var sum2 = 0;
          if (dimData) {
            for (var i2 = 0, len2 = this.count(); i2 < len2; i2++) {
              var value = this.get(dim, i2);
              if (!isNaN(value)) {
                sum2 += value;
              }
            }
          }
          return sum2;
        };
        DataStore2.prototype.getMedian = function(dim) {
          var dimDataArray = [];
          this.each([dim], function(val) {
            if (!isNaN(val)) {
              dimDataArray.push(val);
            }
          });
          var sortedDimDataArray = dimDataArray.sort(function(a2, b2) {
            return a2 - b2;
          });
          var len2 = this.count();
          return len2 === 0 ? 0 : len2 % 2 === 1 ? sortedDimDataArray[(len2 - 1) / 2] : (sortedDimDataArray[len2 / 2] + sortedDimDataArray[len2 / 2 - 1]) / 2;
        };
        DataStore2.prototype.indexOfRawIndex = function(rawIndex) {
          if (rawIndex >= this._rawCount || rawIndex < 0) {
            return -1;
          }
          if (!this._indices) {
            return rawIndex;
          }
          var indices = this._indices;
          var rawDataIndex = indices[rawIndex];
          if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {
            return rawIndex;
          }
          var left = 0;
          var right = this._count - 1;
          while (left <= right) {
            var mid = (left + right) / 2 | 0;
            if (indices[mid] < rawIndex) {
              left = mid + 1;
            } else if (indices[mid] > rawIndex) {
              right = mid - 1;
            } else {
              return mid;
            }
          }
          return -1;
        };
        DataStore2.prototype.indicesOfNearest = function(dim, value, maxDistance) {
          var chunks = this._chunks;
          var dimData = chunks[dim];
          var nearestIndices = [];
          if (!dimData) {
            return nearestIndices;
          }
          if (maxDistance == null) {
            maxDistance = Infinity;
          }
          var minDist = Infinity;
          var minDiff = -1;
          var nearestIndicesLen = 0;
          for (var i2 = 0, len2 = this.count(); i2 < len2; i2++) {
            var dataIndex = this.getRawIndex(i2);
            var diff = value - dimData[dataIndex];
            var dist2 = Math.abs(diff);
            if (dist2 <= maxDistance) {
              if (dist2 < minDist || dist2 === minDist && diff >= 0 && minDiff < 0) {
                minDist = dist2;
                minDiff = diff;
                nearestIndicesLen = 0;
              }
              if (diff === minDiff) {
                nearestIndices[nearestIndicesLen++] = i2;
              }
            }
          }
          nearestIndices.length = nearestIndicesLen;
          return nearestIndices;
        };
        DataStore2.prototype.getIndices = function() {
          var newIndices;
          var indices = this._indices;
          if (indices) {
            var Ctor = indices.constructor;
            var thisCount = this._count;
            if (Ctor === Array) {
              newIndices = new Ctor(thisCount);
              for (var i2 = 0; i2 < thisCount; i2++) {
                newIndices[i2] = indices[i2];
              }
            } else {
              newIndices = new Ctor(indices.buffer, 0, thisCount);
            }
          } else {
            var Ctor = getIndicesCtor(this._rawCount);
            newIndices = new Ctor(this.count());
            for (var i2 = 0; i2 < newIndices.length; i2++) {
              newIndices[i2] = i2;
            }
          }
          return newIndices;
        };
        DataStore2.prototype.filter = function(dims, cb) {
          if (!this._count) {
            return this;
          }
          var newStore = this.clone();
          var count2 = newStore.count();
          var Ctor = getIndicesCtor(newStore._rawCount);
          var newIndices = new Ctor(count2);
          var value = [];
          var dimSize = dims.length;
          var offset2 = 0;
          var dim0 = dims[0];
          var chunks = newStore._chunks;
          for (var i2 = 0; i2 < count2; i2++) {
            var keep = void 0;
            var rawIdx = newStore.getRawIndex(i2);
            if (dimSize === 0) {
              keep = cb(i2);
            } else if (dimSize === 1) {
              var val = chunks[dim0][rawIdx];
              keep = cb(val, i2);
            } else {
              var k2 = 0;
              for (; k2 < dimSize; k2++) {
                value[k2] = chunks[dims[k2]][rawIdx];
              }
              value[k2] = i2;
              keep = cb.apply(null, value);
            }
            if (keep) {
              newIndices[offset2++] = rawIdx;
            }
          }
          if (offset2 < count2) {
            newStore._indices = newIndices;
          }
          newStore._count = offset2;
          newStore._extent = [];
          newStore._updateGetRawIdx();
          return newStore;
        };
        DataStore2.prototype.selectRange = function(range2) {
          var newStore = this.clone();
          var len2 = newStore._count;
          if (!len2) {
            return this;
          }
          var dims = keys$1(range2);
          var dimSize = dims.length;
          if (!dimSize) {
            return this;
          }
          var originalCount = newStore.count();
          var Ctor = getIndicesCtor(newStore._rawCount);
          var newIndices = new Ctor(originalCount);
          var offset2 = 0;
          var dim0 = dims[0];
          var min3 = range2[dim0][0];
          var max3 = range2[dim0][1];
          var storeArr = newStore._chunks;
          var quickFinished = false;
          if (!newStore._indices) {
            var idx = 0;
            if (dimSize === 1) {
              var dimStorage = storeArr[dims[0]];
              for (var i2 = 0; i2 < len2; i2++) {
                var val = dimStorage[i2];
                if (val >= min3 && val <= max3 || isNaN(val)) {
                  newIndices[offset2++] = idx;
                }
                idx++;
              }
              quickFinished = true;
            } else if (dimSize === 2) {
              var dimStorage = storeArr[dims[0]];
              var dimStorage2 = storeArr[dims[1]];
              var min22 = range2[dims[1]][0];
              var max22 = range2[dims[1]][1];
              for (var i2 = 0; i2 < len2; i2++) {
                var val = dimStorage[i2];
                var val2 = dimStorage2[i2];
                if ((val >= min3 && val <= max3 || isNaN(val)) && (val2 >= min22 && val2 <= max22 || isNaN(val2))) {
                  newIndices[offset2++] = idx;
                }
                idx++;
              }
              quickFinished = true;
            }
          }
          if (!quickFinished) {
            if (dimSize === 1) {
              for (var i2 = 0; i2 < originalCount; i2++) {
                var rawIndex = newStore.getRawIndex(i2);
                var val = storeArr[dims[0]][rawIndex];
                if (val >= min3 && val <= max3 || isNaN(val)) {
                  newIndices[offset2++] = rawIndex;
                }
              }
            } else {
              for (var i2 = 0; i2 < originalCount; i2++) {
                var keep = true;
                var rawIndex = newStore.getRawIndex(i2);
                for (var k2 = 0; k2 < dimSize; k2++) {
                  var dimk = dims[k2];
                  var val = storeArr[dimk][rawIndex];
                  if (val < range2[dimk][0] || val > range2[dimk][1]) {
                    keep = false;
                  }
                }
                if (keep) {
                  newIndices[offset2++] = newStore.getRawIndex(i2);
                }
              }
            }
          }
          if (offset2 < originalCount) {
            newStore._indices = newIndices;
          }
          newStore._count = offset2;
          newStore._extent = [];
          newStore._updateGetRawIdx();
          return newStore;
        };
        DataStore2.prototype.map = function(dims, cb) {
          var target = this.clone(dims);
          this._updateDims(target, dims, cb);
          return target;
        };
        DataStore2.prototype.modify = function(dims, cb) {
          this._updateDims(this, dims, cb);
        };
        DataStore2.prototype._updateDims = function(target, dims, cb) {
          var targetChunks = target._chunks;
          var tmpRetValue = [];
          var dimSize = dims.length;
          var dataCount = target.count();
          var values = [];
          var rawExtent = target._rawExtent;
          for (var i2 = 0; i2 < dims.length; i2++) {
            rawExtent[dims[i2]] = getInitialExtent();
          }
          for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) {
            var rawIndex = target.getRawIndex(dataIndex);
            for (var k2 = 0; k2 < dimSize; k2++) {
              values[k2] = targetChunks[dims[k2]][rawIndex];
            }
            values[dimSize] = dataIndex;
            var retValue = cb && cb.apply(null, values);
            if (retValue != null) {
              if (typeof retValue !== "object") {
                tmpRetValue[0] = retValue;
                retValue = tmpRetValue;
              }
              for (var i2 = 0; i2 < retValue.length; i2++) {
                var dim = dims[i2];
                var val = retValue[i2];
                var rawExtentOnDim = rawExtent[dim];
                var dimStore = targetChunks[dim];
                if (dimStore) {
                  dimStore[rawIndex] = val;
                }
                if (val < rawExtentOnDim[0]) {
                  rawExtentOnDim[0] = val;
                }
                if (val > rawExtentOnDim[1]) {
                  rawExtentOnDim[1] = val;
                }
              }
            }
          }
        };
        DataStore2.prototype.lttbDownSample = function(valueDimension, rate) {
          var target = this.clone([valueDimension], true);
          var targetStorage = target._chunks;
          var dimStore = targetStorage[valueDimension];
          var len2 = this.count();
          var sampledIndex = 0;
          var frameSize = Math.floor(1 / rate);
          var currentRawIndex = this.getRawIndex(0);
          var maxArea;
          var area;
          var nextRawIndex;
          var newIndices = new (getIndicesCtor(this._rawCount))(Math.min((Math.ceil(len2 / frameSize) + 2) * 2, len2));
          newIndices[sampledIndex++] = currentRawIndex;
          for (var i2 = 1; i2 < len2 - 1; i2 += frameSize) {
            var nextFrameStart = Math.min(i2 + frameSize, len2 - 1);
            var nextFrameEnd = Math.min(i2 + frameSize * 2, len2);
            var avgX = (nextFrameEnd + nextFrameStart) / 2;
            var avgY = 0;
            for (var idx = nextFrameStart; idx < nextFrameEnd; idx++) {
              var rawIndex = this.getRawIndex(idx);
              var y = dimStore[rawIndex];
              if (isNaN(y)) {
                continue;
              }
              avgY += y;
            }
            avgY /= nextFrameEnd - nextFrameStart;
            var frameStart = i2;
            var frameEnd = Math.min(i2 + frameSize, len2);
            var pointAX = i2 - 1;
            var pointAY = dimStore[currentRawIndex];
            maxArea = -1;
            nextRawIndex = frameStart;
            var firstNaNIndex = -1;
            var countNaN = 0;
            for (var idx = frameStart; idx < frameEnd; idx++) {
              var rawIndex = this.getRawIndex(idx);
              var y = dimStore[rawIndex];
              if (isNaN(y)) {
                countNaN++;
                if (firstNaNIndex < 0) {
                  firstNaNIndex = rawIndex;
                }
                continue;
              }
              area = Math.abs((pointAX - avgX) * (y - pointAY) - (pointAX - idx) * (avgY - pointAY));
              if (area > maxArea) {
                maxArea = area;
                nextRawIndex = rawIndex;
              }
            }
            if (countNaN > 0 && countNaN < frameEnd - frameStart) {
              newIndices[sampledIndex++] = Math.min(firstNaNIndex, nextRawIndex);
              nextRawIndex = Math.max(firstNaNIndex, nextRawIndex);
            }
            newIndices[sampledIndex++] = nextRawIndex;
            currentRawIndex = nextRawIndex;
          }
          newIndices[sampledIndex++] = this.getRawIndex(len2 - 1);
          target._count = sampledIndex;
          target._indices = newIndices;
          target.getRawIndex = this._getRawIdx;
          return target;
        };
        DataStore2.prototype.minmaxDownSample = function(valueDimension, rate) {
          var target = this.clone([valueDimension], true);
          var targetStorage = target._chunks;
          var frameSize = Math.floor(1 / rate);
          var dimStore = targetStorage[valueDimension];
          var len2 = this.count();
          var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len2 / frameSize) * 2);
          var offset2 = 0;
          for (var i2 = 0; i2 < len2; i2 += frameSize) {
            var minIndex = i2;
            var minValue = dimStore[this.getRawIndex(minIndex)];
            var maxIndex = i2;
            var maxValue = dimStore[this.getRawIndex(maxIndex)];
            var thisFrameSize = frameSize;
            if (i2 + frameSize > len2) {
              thisFrameSize = len2 - i2;
            }
            for (var k2 = 0; k2 < thisFrameSize; k2++) {
              var rawIndex = this.getRawIndex(i2 + k2);
              var value = dimStore[rawIndex];
              if (value < minValue) {
                minValue = value;
                minIndex = i2 + k2;
              }
              if (value > maxValue) {
                maxValue = value;
                maxIndex = i2 + k2;
              }
            }
            var rawMinIndex = this.getRawIndex(minIndex);
            var rawMaxIndex = this.getRawIndex(maxIndex);
            if (minIndex < maxIndex) {
              newIndices[offset2++] = rawMinIndex;
              newIndices[offset2++] = rawMaxIndex;
            } else {
              newIndices[offset2++] = rawMaxIndex;
              newIndices[offset2++] = rawMinIndex;
            }
          }
          target._count = offset2;
          target._indices = newIndices;
          target._updateGetRawIdx();
          return target;
        };
        DataStore2.prototype.downSample = function(dimension, rate, sampleValue, sampleIndex) {
          var target = this.clone([dimension], true);
          var targetStorage = target._chunks;
          var frameValues = [];
          var frameSize = Math.floor(1 / rate);
          var dimStore = targetStorage[dimension];
          var len2 = this.count();
          var rawExtentOnDim = target._rawExtent[dimension] = getInitialExtent();
          var newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len2 / frameSize));
          var offset2 = 0;
          for (var i2 = 0; i2 < len2; i2 += frameSize) {
            if (frameSize > len2 - i2) {
              frameSize = len2 - i2;
              frameValues.length = frameSize;
            }
            for (var k2 = 0; k2 < frameSize; k2++) {
              var dataIdx = this.getRawIndex(i2 + k2);
              frameValues[k2] = dimStore[dataIdx];
            }
            var value = sampleValue(frameValues);
            var sampleFrameIdx = this.getRawIndex(Math.min(i2 + sampleIndex(frameValues, value) || 0, len2 - 1));
            dimStore[sampleFrameIdx] = value;
            if (value < rawExtentOnDim[0]) {
              rawExtentOnDim[0] = value;
            }
            if (value > rawExtentOnDim[1]) {
              rawExtentOnDim[1] = value;
            }
            newIndices[offset2++] = sampleFrameIdx;
          }
          target._count = offset2;
          target._indices = newIndices;
          target._updateGetRawIdx();
          return target;
        };
        DataStore2.prototype.each = function(dims, cb) {
          if (!this._count) {
            return;
          }
          var dimSize = dims.length;
          var chunks = this._chunks;
          for (var i2 = 0, len2 = this.count(); i2 < len2; i2++) {
            var rawIdx = this.getRawIndex(i2);
            switch (dimSize) {
              case 0:
                cb(i2);
                break;
              case 1:
                cb(chunks[dims[0]][rawIdx], i2);
                break;
              case 2:
                cb(chunks[dims[0]][rawIdx], chunks[dims[1]][rawIdx], i2);
                break;
              default:
                var k2 = 0;
                var value = [];
                for (; k2 < dimSize; k2++) {
                  value[k2] = chunks[dims[k2]][rawIdx];
                }
                value[k2] = i2;
                cb.apply(null, value);
            }
          }
        };
        DataStore2.prototype.getDataExtent = function(dim) {
          var dimData = this._chunks[dim];
          var initialExtent = getInitialExtent();
          if (!dimData) {
            return initialExtent;
          }
          var currEnd = this.count();
          var useRaw = !this._indices;
          var dimExtent;
          if (useRaw) {
            return this._rawExtent[dim].slice();
          }
          dimExtent = this._extent[dim];
          if (dimExtent) {
            return dimExtent.slice();
          }
          dimExtent = initialExtent;
          var min3 = dimExtent[0];
          var max3 = dimExtent[1];
          for (var i2 = 0; i2 < currEnd; i2++) {
            var rawIdx = this.getRawIndex(i2);
            var value = dimData[rawIdx];
            value < min3 && (min3 = value);
            value > max3 && (max3 = value);
          }
          dimExtent = [min3, max3];
          this._extent[dim] = dimExtent;
          return dimExtent;
        };
        DataStore2.prototype.getRawDataItem = function(idx) {
          var rawIdx = this.getRawIndex(idx);
          if (!this._provider.persistent) {
            var val = [];
            var chunks = this._chunks;
            for (var i2 = 0; i2 < chunks.length; i2++) {
              val.push(chunks[i2][rawIdx]);
            }
            return val;
          } else {
            return this._provider.getItem(rawIdx);
          }
        };
        DataStore2.prototype.clone = function(clonedDims, ignoreIndices) {
          var target = new DataStore2();
          var chunks = this._chunks;
          var clonedDimsMap = clonedDims && reduce(clonedDims, function(obj, dimIdx) {
            obj[dimIdx] = true;
            return obj;
          }, {});
          if (clonedDimsMap) {
            for (var i2 = 0; i2 < chunks.length; i2++) {
              target._chunks[i2] = !clonedDimsMap[i2] ? chunks[i2] : cloneChunk(chunks[i2]);
            }
          } else {
            target._chunks = chunks;
          }
          this._copyCommonProps(target);
          if (!ignoreIndices) {
            target._indices = this._cloneIndices();
          }
          target._updateGetRawIdx();
          return target;
        };
        DataStore2.prototype._copyCommonProps = function(target) {
          target._count = this._count;
          target._rawCount = this._rawCount;
          target._provider = this._provider;
          target._dimensions = this._dimensions;
          target._extent = clone$4(this._extent);
          target._rawExtent = clone$4(this._rawExtent);
        };
        DataStore2.prototype._cloneIndices = function() {
          if (this._indices) {
            var Ctor = this._indices.constructor;
            var indices = void 0;
            if (Ctor === Array) {
              var thisCount = this._indices.length;
              indices = new Ctor(thisCount);
              for (var i2 = 0; i2 < thisCount; i2++) {
                indices[i2] = this._indices[i2];
              }
            } else {
              indices = new Ctor(this._indices);
            }
            return indices;
          }
          return null;
        };
        DataStore2.prototype._getRawIdxIdentity = function(idx) {
          return idx;
        };
        DataStore2.prototype._getRawIdx = function(idx) {
          if (idx < this._count && idx >= 0) {
            return this._indices[idx];
          }
          return -1;
        };
        DataStore2.prototype._updateGetRawIdx = function() {
          this.getRawIndex = this._indices ? this._getRawIdx : this._getRawIdxIdentity;
        };
        DataStore2.internalField = function() {
          function getDimValueSimply(dataItem, property2, dataIndex, dimIndex) {
            return parseDataValue(dataItem[dimIndex], this._dimensions[dimIndex]);
          }
          defaultDimValueGetters = {
            arrayRows: getDimValueSimply,
            objectRows: function(dataItem, property2, dataIndex, dimIndex) {
              return parseDataValue(dataItem[property2], this._dimensions[dimIndex]);
            },
            keyedColumns: getDimValueSimply,
            original: function(dataItem, property2, dataIndex, dimIndex) {
              var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value);
              return parseDataValue(value instanceof Array ? value[dimIndex] : value, this._dimensions[dimIndex]);
            },
            typedArray: function(dataItem, property2, dataIndex, dimIndex) {
              return dataItem[dimIndex];
            }
          };
        }();
        return DataStore2;
      }()
    );
    var SourceManager = (
      /** @class */
      function() {
        function SourceManager2(sourceHost) {
          this._sourceList = [];
          this._storeList = [];
          this._upstreamSignList = [];
          this._versionSignBase = 0;
          this._dirty = true;
          this._sourceHost = sourceHost;
        }
        SourceManager2.prototype.dirty = function() {
          this._setLocalSource([], []);
          this._storeList = [];
          this._dirty = true;
        };
        SourceManager2.prototype._setLocalSource = function(sourceList, upstreamSignList) {
          this._sourceList = sourceList;
          this._upstreamSignList = upstreamSignList;
          this._versionSignBase++;
          if (this._versionSignBase > 9e10) {
            this._versionSignBase = 0;
          }
        };
        SourceManager2.prototype._getVersionSign = function() {
          return this._sourceHost.uid + "_" + this._versionSignBase;
        };
        SourceManager2.prototype.prepareSource = function() {
          if (this._isDirty()) {
            this._createSource();
            this._dirty = false;
          }
        };
        SourceManager2.prototype._createSource = function() {
          this._setLocalSource([], []);
          var sourceHost = this._sourceHost;
          var upSourceMgrList = this._getUpstreamSourceManagers();
          var hasUpstream = !!upSourceMgrList.length;
          var resultSourceList;
          var upstreamSignList;
          if (isSeries(sourceHost)) {
            var seriesModel = sourceHost;
            var data = void 0;
            var sourceFormat = void 0;
            var upSource = void 0;
            if (hasUpstream) {
              var upSourceMgr = upSourceMgrList[0];
              upSourceMgr.prepareSource();
              upSource = upSourceMgr.getSource();
              data = upSource.data;
              sourceFormat = upSource.sourceFormat;
              upstreamSignList = [upSourceMgr._getVersionSign()];
            } else {
              data = seriesModel.get("data", true);
              sourceFormat = isTypedArray$1(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;
              upstreamSignList = [];
            }
            var newMetaRawOption = this._getSourceMetaRawOption() || {};
            var upMetaRawOption = upSource && upSource.metaRawOption || {};
            var seriesLayoutBy = retrieve2(newMetaRawOption.seriesLayoutBy, upMetaRawOption.seriesLayoutBy) || null;
            var sourceHeader = retrieve2(newMetaRawOption.sourceHeader, upMetaRawOption.sourceHeader);
            var dimensions = retrieve2(newMetaRawOption.dimensions, upMetaRawOption.dimensions);
            var needsCreateSource = seriesLayoutBy !== upMetaRawOption.seriesLayoutBy || !!sourceHeader !== !!upMetaRawOption.sourceHeader || dimensions;
            resultSourceList = needsCreateSource ? [createSource(data, {
              seriesLayoutBy,
              sourceHeader,
              dimensions
            }, sourceFormat)] : [];
          } else {
            var datasetModel = sourceHost;
            if (hasUpstream) {
              var result = this._applyTransform(upSourceMgrList);
              resultSourceList = result.sourceList;
              upstreamSignList = result.upstreamSignList;
            } else {
              var sourceData = datasetModel.get("source", true);
              resultSourceList = [createSource(sourceData, this._getSourceMetaRawOption(), null)];
              upstreamSignList = [];
            }
          }
          this._setLocalSource(resultSourceList, upstreamSignList);
        };
        SourceManager2.prototype._applyTransform = function(upMgrList) {
          var datasetModel = this._sourceHost;
          var transformOption = datasetModel.get("transform", true);
          var fromTransformResult = datasetModel.get("fromTransformResult", true);
          if (fromTransformResult != null) {
            var errMsg = "";
            if (upMgrList.length !== 1) {
              doThrow(errMsg);
            }
          }
          var sourceList;
          var upSourceList = [];
          var upstreamSignList = [];
          each$f(upMgrList, function(upMgr) {
            upMgr.prepareSource();
            var upSource = upMgr.getSource(fromTransformResult || 0);
            var errMsg2 = "";
            if (fromTransformResult != null && !upSource) {
              doThrow(errMsg2);
            }
            upSourceList.push(upSource);
            upstreamSignList.push(upMgr._getVersionSign());
          });
          if (transformOption) {
            sourceList = applyDataTransform(transformOption, upSourceList, {
              datasetIndex: datasetModel.componentIndex
            });
          } else if (fromTransformResult != null) {
            sourceList = [cloneSourceShallow(upSourceList[0])];
          }
          return {
            sourceList,
            upstreamSignList
          };
        };
        SourceManager2.prototype._isDirty = function() {
          if (this._dirty) {
            return true;
          }
          var upSourceMgrList = this._getUpstreamSourceManagers();
          for (var i2 = 0; i2 < upSourceMgrList.length; i2++) {
            var upSrcMgr = upSourceMgrList[i2];
            if (
              // Consider the case that there is ancestor diry, call it recursively.
              // The performance is probably not an issue because usually the chain is not long.
              upSrcMgr._isDirty() || this._upstreamSignList[i2] !== upSrcMgr._getVersionSign()
            ) {
              return true;
            }
          }
        };
        SourceManager2.prototype.getSource = function(sourceIndex) {
          sourceIndex = sourceIndex || 0;
          var source = this._sourceList[sourceIndex];
          if (!source) {
            var upSourceMgrList = this._getUpstreamSourceManagers();
            return upSourceMgrList[0] && upSourceMgrList[0].getSource(sourceIndex);
          }
          return source;
        };
        SourceManager2.prototype.getSharedDataStore = function(seriesDimRequest) {
          var schema = seriesDimRequest.makeStoreSchema();
          return this._innerGetDataStore(schema.dimensions, seriesDimRequest.source, schema.hash);
        };
        SourceManager2.prototype._innerGetDataStore = function(storeDims, seriesSource, sourceReadKey) {
          var sourceIndex = 0;
          var storeList = this._storeList;
          var cachedStoreMap = storeList[sourceIndex];
          if (!cachedStoreMap) {
            cachedStoreMap = storeList[sourceIndex] = {};
          }
          var cachedStore = cachedStoreMap[sourceReadKey];
          if (!cachedStore) {
            var upSourceMgr = this._getUpstreamSourceManagers()[0];
            if (isSeries(this._sourceHost) && upSourceMgr) {
              cachedStore = upSourceMgr._innerGetDataStore(storeDims, seriesSource, sourceReadKey);
            } else {
              cachedStore = new DataStore();
              cachedStore.initData(new DefaultDataProvider(seriesSource, storeDims.length), storeDims);
            }
            cachedStoreMap[sourceReadKey] = cachedStore;
          }
          return cachedStore;
        };
        SourceManager2.prototype._getUpstreamSourceManagers = function() {
          var sourceHost = this._sourceHost;
          if (isSeries(sourceHost)) {
            var datasetModel = querySeriesUpstreamDatasetModel(sourceHost);
            return !datasetModel ? [] : [datasetModel.getSourceManager()];
          } else {
            return map$1(queryDatasetUpstreamDatasetModels(sourceHost), function(datasetModel2) {
              return datasetModel2.getSourceManager();
            });
          }
        };
        SourceManager2.prototype._getSourceMetaRawOption = function() {
          var sourceHost = this._sourceHost;
          var seriesLayoutBy;
          var sourceHeader;
          var dimensions;
          if (isSeries(sourceHost)) {
            seriesLayoutBy = sourceHost.get("seriesLayoutBy", true);
            sourceHeader = sourceHost.get("sourceHeader", true);
            dimensions = sourceHost.get("dimensions", true);
          } else if (!this._getUpstreamSourceManagers().length) {
            var model = sourceHost;
            seriesLayoutBy = model.get("seriesLayoutBy", true);
            sourceHeader = model.get("sourceHeader", true);
            dimensions = model.get("dimensions", true);
          }
          return {
            seriesLayoutBy,
            sourceHeader,
            dimensions
          };
        };
        return SourceManager2;
      }()
    );
    function disableTransformOptionMerge(datasetModel) {
      var transformOption = datasetModel.option.transform;
      transformOption && setAsPrimitive(datasetModel.option.transform);
    }
    function isSeries(sourceHost) {
      return sourceHost.mainType === "series";
    }
    function doThrow(errMsg) {
      throw new Error(errMsg);
    }
    var TOOLTIP_LINE_HEIGHT_CSS = "line-height:1";
    function getTooltipLineHeight(textStyle) {
      var lineHeight2 = textStyle.lineHeight;
      if (lineHeight2 == null) {
        return TOOLTIP_LINE_HEIGHT_CSS;
      } else {
        return "line-height:" + encodeHTML(lineHeight2 + "") + "px";
      }
    }
    function getTooltipTextStyle(textStyle, renderMode) {
      var nameFontColor = textStyle.color || "#6e7079";
      var nameFontSize = textStyle.fontSize || 12;
      var nameFontWeight = textStyle.fontWeight || "400";
      var valueFontColor = textStyle.color || "#464646";
      var valueFontSize = textStyle.fontSize || 14;
      var valueFontWeight = textStyle.fontWeight || "900";
      if (renderMode === "html") {
        return {
          // eslint-disable-next-line max-len
          nameStyle: "font-size:" + encodeHTML(nameFontSize + "") + "px;color:" + encodeHTML(nameFontColor) + ";font-weight:" + encodeHTML(nameFontWeight + ""),
          // eslint-disable-next-line max-len
          valueStyle: "font-size:" + encodeHTML(valueFontSize + "") + "px;color:" + encodeHTML(valueFontColor) + ";font-weight:" + encodeHTML(valueFontWeight + "")
        };
      } else {
        return {
          nameStyle: {
            fontSize: nameFontSize,
            fill: nameFontColor,
            fontWeight: nameFontWeight
          },
          valueStyle: {
            fontSize: valueFontSize,
            fill: valueFontColor,
            fontWeight: valueFontWeight
          }
        };
      }
    }
    var HTML_GAPS = [0, 10, 20, 30];
    var RICH_TEXT_GAPS = ["", "\n", "\n\n", "\n\n\n"];
    function createTooltipMarkup(type, option) {
      option.type = type;
      return option;
    }
    function isSectionFragment(frag) {
      return frag.type === "section";
    }
    function getBuilder(frag) {
      return isSectionFragment(frag) ? buildSection : buildNameValue;
    }
    function getBlockGapLevel(frag) {
      if (isSectionFragment(frag)) {
        var gapLevel_1 = 0;
        var subBlockLen = frag.blocks.length;
        var hasInnerGap_1 = subBlockLen > 1 || subBlockLen > 0 && !frag.noHeader;
        each$f(frag.blocks, function(subBlock) {
          var subGapLevel = getBlockGapLevel(subBlock);
          if (subGapLevel >= gapLevel_1) {
            gapLevel_1 = subGapLevel + +(hasInnerGap_1 && // 0 always can not be readable gap level.
            (!subGapLevel || isSectionFragment(subBlock) && !subBlock.noHeader));
          }
        });
        return gapLevel_1;
      }
      return 0;
    }
    function buildSection(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {
      var noHeader = fragment.noHeader;
      var gaps = getGap(getBlockGapLevel(fragment));
      var subMarkupTextList = [];
      var subBlocks = fragment.blocks || [];
      assert(!subBlocks || isArray$2(subBlocks));
      subBlocks = subBlocks || [];
      var orderMode = ctx.orderMode;
      if (fragment.sortBlocks && orderMode) {
        subBlocks = subBlocks.slice();
        var orderMap = {
          valueAsc: "asc",
          valueDesc: "desc"
        };
        if (hasOwn(orderMap, orderMode)) {
          var comparator_1 = new SortOrderComparator(orderMap[orderMode], null);
          subBlocks.sort(function(a2, b2) {
            return comparator_1.evaluate(a2.sortParam, b2.sortParam);
          });
        } else if (orderMode === "seriesDesc") {
          subBlocks.reverse();
        }
      }
      each$f(subBlocks, function(subBlock, idx) {
        var valueFormatter = fragment.valueFormatter;
        var subMarkupText2 = getBuilder(subBlock)(
          // Inherit valueFormatter
          valueFormatter ? extend$1(extend$1({}, ctx), {
            valueFormatter
          }) : ctx,
          subBlock,
          idx > 0 ? gaps.html : 0,
          toolTipTextStyle
        );
        subMarkupText2 != null && subMarkupTextList.push(subMarkupText2);
      });
      var subMarkupText = ctx.renderMode === "richText" ? subMarkupTextList.join(gaps.richText) : wrapBlockHTML(toolTipTextStyle, subMarkupTextList.join(""), noHeader ? topMarginForOuterGap : gaps.html);
      if (noHeader) {
        return subMarkupText;
      }
      var displayableHeader = makeValueReadable(fragment.header, "ordinal", ctx.useUTC);
      var nameStyle = getTooltipTextStyle(toolTipTextStyle, ctx.renderMode).nameStyle;
      var tooltipLineHeight = getTooltipLineHeight(toolTipTextStyle);
      if (ctx.renderMode === "richText") {
        return wrapInlineNameRichText(ctx, displayableHeader, nameStyle) + gaps.richText + subMarkupText;
      } else {
        return wrapBlockHTML(toolTipTextStyle, '<div style="' + nameStyle + ";" + tooltipLineHeight + ';">' + encodeHTML(displayableHeader) + "</div>" + subMarkupText, topMarginForOuterGap);
      }
    }
    function buildNameValue(ctx, fragment, topMarginForOuterGap, toolTipTextStyle) {
      var renderMode = ctx.renderMode;
      var noName = fragment.noName;
      var noValue = fragment.noValue;
      var noMarker = !fragment.markerType;
      var name = fragment.name;
      var useUTC = ctx.useUTC;
      var valueFormatter = fragment.valueFormatter || ctx.valueFormatter || function(value) {
        value = isArray$2(value) ? value : [value];
        return map$1(value, function(val, idx) {
          return makeValueReadable(val, isArray$2(valueTypeOption) ? valueTypeOption[idx] : valueTypeOption, useUTC);
        });
      };
      if (noName && noValue) {
        return;
      }
      var markerStr = noMarker ? "" : ctx.markupStyleCreator.makeTooltipMarker(fragment.markerType, fragment.markerColor || "#333", renderMode);
      var readableName = noName ? "" : makeValueReadable(name, "ordinal", useUTC);
      var valueTypeOption = fragment.valueType;
      var readableValueList = noValue ? [] : valueFormatter(fragment.value, fragment.dataIndex);
      var valueAlignRight = !noMarker || !noName;
      var valueCloseToMarker = !noMarker && noName;
      var _a2 = getTooltipTextStyle(toolTipTextStyle, renderMode), nameStyle = _a2.nameStyle, valueStyle = _a2.valueStyle;
      return renderMode === "richText" ? (noMarker ? "" : markerStr) + (noName ? "" : wrapInlineNameRichText(ctx, readableName, nameStyle)) + (noValue ? "" : wrapInlineValueRichText(ctx, readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)) : wrapBlockHTML(toolTipTextStyle, (noMarker ? "" : markerStr) + (noName ? "" : wrapInlineNameHTML(readableName, !noMarker, nameStyle)) + (noValue ? "" : wrapInlineValueHTML(readableValueList, valueAlignRight, valueCloseToMarker, valueStyle)), topMarginForOuterGap);
    }
    function buildTooltipMarkup(fragment, markupStyleCreator, renderMode, orderMode, useUTC, toolTipTextStyle) {
      if (!fragment) {
        return;
      }
      var builder = getBuilder(fragment);
      var ctx = {
        useUTC,
        renderMode,
        orderMode,
        markupStyleCreator,
        valueFormatter: fragment.valueFormatter
      };
      return builder(ctx, fragment, 0, toolTipTextStyle);
    }
    function getGap(gapLevel) {
      return {
        html: HTML_GAPS[gapLevel],
        richText: RICH_TEXT_GAPS[gapLevel]
      };
    }
    function wrapBlockHTML(textStyle, encodedContent, topGap) {
      var clearfix = '<div style="clear:both"></div>';
      var marginCSS = "margin: " + topGap + "px 0 0";
      var tooltipLineHeight = getTooltipLineHeight(textStyle);
      return '<div style="' + marginCSS + ";" + tooltipLineHeight + ';">' + encodedContent + clearfix + "</div>";
    }
    function wrapInlineNameHTML(name, leftHasMarker, style) {
      var marginCss = leftHasMarker ? "margin-left:2px" : "";
      return '<span style="' + style + ";" + marginCss + '">' + encodeHTML(name) + "</span>";
    }
    function wrapInlineValueHTML(valueList, alignRight, valueCloseToMarker, style) {
      var paddingStr = valueCloseToMarker ? "10px" : "20px";
      var alignCSS = alignRight ? "float:right;margin-left:" + paddingStr : "";
      valueList = isArray$2(valueList) ? valueList : [valueList];
      return '<span style="' + alignCSS + ";" + style + '">' + map$1(valueList, function(value) {
        return encodeHTML(value);
      }).join("&nbsp;&nbsp;") + "</span>";
    }
    function wrapInlineNameRichText(ctx, name, style) {
      return ctx.markupStyleCreator.wrapRichTextStyle(name, style);
    }
    function wrapInlineValueRichText(ctx, values, alignRight, valueCloseToMarker, style) {
      var styles = [style];
      var paddingLeft2 = valueCloseToMarker ? 10 : 20;
      alignRight && styles.push({
        padding: [0, 0, 0, paddingLeft2],
        align: "right"
      });
      return ctx.markupStyleCreator.wrapRichTextStyle(isArray$2(values) ? values.join("  ") : values, styles);
    }
    function retrieveVisualColorForTooltipMarker(series, dataIndex) {
      var style = series.getData().getItemVisual(dataIndex, "style");
      var color2 = style[series.visualDrawType];
      return convertToColorString(color2);
    }
    function getPaddingFromTooltipModel(model, renderMode) {
      var padding = model.get("padding");
      return padding != null ? padding : renderMode === "richText" ? [8, 10] : 10;
    }
    var TooltipMarkupStyleCreator = (
      /** @class */
      function() {
        function TooltipMarkupStyleCreator2() {
          this.richTextStyles = {};
          this._nextStyleNameId = getRandomIdBase();
        }
        TooltipMarkupStyleCreator2.prototype._generateStyleName = function() {
          return "__EC_aUTo_" + this._nextStyleNameId++;
        };
        TooltipMarkupStyleCreator2.prototype.makeTooltipMarker = function(markerType, colorStr, renderMode) {
          var markerId = renderMode === "richText" ? this._generateStyleName() : null;
          var marker = getTooltipMarker({
            color: colorStr,
            type: markerType,
            renderMode,
            markerId
          });
          if (isString$1(marker)) {
            return marker;
          } else {
            this.richTextStyles[markerId] = marker.style;
            return marker.content;
          }
        };
        TooltipMarkupStyleCreator2.prototype.wrapRichTextStyle = function(text, styles) {
          var finalStl = {};
          if (isArray$2(styles)) {
            each$f(styles, function(stl) {
              return extend$1(finalStl, stl);
            });
          } else {
            extend$1(finalStl, styles);
          }
          var styleName = this._generateStyleName();
          this.richTextStyles[styleName] = finalStl;
          return "{" + styleName + "|" + text + "}";
        };
        return TooltipMarkupStyleCreator2;
      }()
    );
    function defaultSeriesFormatTooltip(opt) {
      var series = opt.series;
      var dataIndex = opt.dataIndex;
      var multipleSeries = opt.multipleSeries;
      var data = series.getData();
      var tooltipDims = data.mapDimensionsAll("defaultedTooltip");
      var tooltipDimLen = tooltipDims.length;
      var value = series.getRawValue(dataIndex);
      var isValueArr = isArray$2(value);
      var markerColor = retrieveVisualColorForTooltipMarker(series, dataIndex);
      var inlineValue;
      var inlineValueType;
      var subBlocks;
      var sortParam;
      if (tooltipDimLen > 1 || isValueArr && !tooltipDimLen) {
        var formatArrResult = formatTooltipArrayValue(value, series, dataIndex, tooltipDims, markerColor);
        inlineValue = formatArrResult.inlineValues;
        inlineValueType = formatArrResult.inlineValueTypes;
        subBlocks = formatArrResult.blocks;
        sortParam = formatArrResult.inlineValues[0];
      } else if (tooltipDimLen) {
        var dimInfo = data.getDimensionInfo(tooltipDims[0]);
        sortParam = inlineValue = retrieveRawValue(data, dataIndex, tooltipDims[0]);
        inlineValueType = dimInfo.type;
      } else {
        sortParam = inlineValue = isValueArr ? value[0] : value;
      }
      var seriesNameSpecified = isNameSpecified(series);
      var seriesName = seriesNameSpecified && series.name || "";
      var itemName = data.getName(dataIndex);
      var inlineName = multipleSeries ? seriesName : itemName;
      return createTooltipMarkup("section", {
        header: seriesName,
        // When series name is not specified, do not show a header line with only '-'.
        // This case always happens in tooltip.trigger: 'item'.
        noHeader: multipleSeries || !seriesNameSpecified,
        sortParam,
        blocks: [createTooltipMarkup("nameValue", {
          markerType: "item",
          markerColor,
          // Do not mix display seriesName and itemName in one tooltip,
          // which might confuses users.
          name: inlineName,
          // name dimension might be auto assigned, where the name might
          // be not readable. So we check trim here.
          noName: !trim$2(inlineName),
          value: inlineValue,
          valueType: inlineValueType,
          dataIndex
        })].concat(subBlocks || [])
      });
    }
    function formatTooltipArrayValue(value, series, dataIndex, tooltipDims, colorStr) {
      var data = series.getData();
      var isValueMultipleLine = reduce(value, function(isValueMultipleLine2, val, idx) {
        var dimItem = data.getDimensionInfo(idx);
        return isValueMultipleLine2 = isValueMultipleLine2 || dimItem && dimItem.tooltip !== false && dimItem.displayName != null;
      }, false);
      var inlineValues = [];
      var inlineValueTypes = [];
      var blocks = [];
      tooltipDims.length ? each$f(tooltipDims, function(dim) {
        setEachItem(retrieveRawValue(data, dataIndex, dim), dim);
      }) : each$f(value, setEachItem);
      function setEachItem(val, dim) {
        var dimInfo = data.getDimensionInfo(dim);
        if (!dimInfo || dimInfo.otherDims.tooltip === false) {
          return;
        }
        if (isValueMultipleLine) {
          blocks.push(createTooltipMarkup("nameValue", {
            markerType: "subItem",
            markerColor: colorStr,
            name: dimInfo.displayName,
            value: val,
            valueType: dimInfo.type
          }));
        } else {
          inlineValues.push(val);
          inlineValueTypes.push(dimInfo.type);
        }
      }
      return {
        inlineValues,
        inlineValueTypes,
        blocks
      };
    }
    var inner$k = makeInner();
    function getSelectionKey(data, dataIndex) {
      return data.getName(dataIndex) || data.getId(dataIndex);
    }
    var SERIES_UNIVERSAL_TRANSITION_PROP = "__universalTransitionEnabled";
    var SeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(SeriesModel2, _super);
        function SeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this._selectedDataIndicesMap = {};
          return _this;
        }
        SeriesModel2.prototype.init = function(option, parentModel, ecModel) {
          this.seriesIndex = this.componentIndex;
          this.dataTask = createTask({
            count: dataTaskCount,
            reset: dataTaskReset
          });
          this.dataTask.context = {
            model: this
          };
          this.mergeDefaultAndTheme(option, ecModel);
          var sourceManager = inner$k(this).sourceManager = new SourceManager(this);
          sourceManager.prepareSource();
          var data = this.getInitialData(option, ecModel);
          wrapData(data, this);
          this.dataTask.context.data = data;
          inner$k(this).dataBeforeProcessed = data;
          autoSeriesName(this);
          this._initSelectedMapFromData(data);
        };
        SeriesModel2.prototype.mergeDefaultAndTheme = function(option, ecModel) {
          var layoutMode = fetchLayoutMode(this);
          var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
          var themeSubType = this.subType;
          if (ComponentModel.hasClass(themeSubType)) {
            themeSubType += "Series";
          }
          merge$1(option, ecModel.getTheme().get(this.subType));
          merge$1(option, this.getDefaultOption());
          defaultEmphasis(option, "label", ["show"]);
          this.fillDataTextStyle(option.data);
          if (layoutMode) {
            mergeLayoutParam(option, inputPositionParams, layoutMode);
          }
        };
        SeriesModel2.prototype.mergeOption = function(newSeriesOption, ecModel) {
          newSeriesOption = merge$1(this.option, newSeriesOption, true);
          this.fillDataTextStyle(newSeriesOption.data);
          var layoutMode = fetchLayoutMode(this);
          if (layoutMode) {
            mergeLayoutParam(this.option, newSeriesOption, layoutMode);
          }
          var sourceManager = inner$k(this).sourceManager;
          sourceManager.dirty();
          sourceManager.prepareSource();
          var data = this.getInitialData(newSeriesOption, ecModel);
          wrapData(data, this);
          this.dataTask.dirty();
          this.dataTask.context.data = data;
          inner$k(this).dataBeforeProcessed = data;
          autoSeriesName(this);
          this._initSelectedMapFromData(data);
        };
        SeriesModel2.prototype.fillDataTextStyle = function(data) {
          if (data && !isTypedArray$1(data)) {
            var props2 = ["show"];
            for (var i2 = 0; i2 < data.length; i2++) {
              if (data[i2] && data[i2].label) {
                defaultEmphasis(data[i2], "label", props2);
              }
            }
          }
        };
        SeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return;
        };
        SeriesModel2.prototype.appendData = function(params) {
          var data = this.getRawData();
          data.appendData(params.data);
        };
        SeriesModel2.prototype.getData = function(dataType2) {
          var task = getCurrentTask(this);
          if (task) {
            var data = task.context.data;
            return dataType2 == null || !data.getLinkedData ? data : data.getLinkedData(dataType2);
          } else {
            return inner$k(this).data;
          }
        };
        SeriesModel2.prototype.getAllData = function() {
          var mainData = this.getData();
          return mainData && mainData.getLinkedDataAll ? mainData.getLinkedDataAll() : [{
            data: mainData
          }];
        };
        SeriesModel2.prototype.setData = function(data) {
          var task = getCurrentTask(this);
          if (task) {
            var context = task.context;
            context.outputData = data;
            if (task !== this.dataTask) {
              context.data = data;
            }
          }
          inner$k(this).data = data;
        };
        SeriesModel2.prototype.getEncode = function() {
          var encode2 = this.get("encode", true);
          if (encode2) {
            return createHashMap(encode2);
          }
        };
        SeriesModel2.prototype.getSourceManager = function() {
          return inner$k(this).sourceManager;
        };
        SeriesModel2.prototype.getSource = function() {
          return this.getSourceManager().getSource();
        };
        SeriesModel2.prototype.getRawData = function() {
          return inner$k(this).dataBeforeProcessed;
        };
        SeriesModel2.prototype.getColorBy = function() {
          var colorBy = this.get("colorBy");
          return colorBy || "series";
        };
        SeriesModel2.prototype.isColorBySeries = function() {
          return this.getColorBy() === "series";
        };
        SeriesModel2.prototype.getBaseAxis = function() {
          var coordSys = this.coordinateSystem;
          return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();
        };
        SeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          return defaultSeriesFormatTooltip({
            series: this,
            dataIndex,
            multipleSeries
          });
        };
        SeriesModel2.prototype.isAnimationEnabled = function() {
          var ecModel = this.ecModel;
          if (env.node && !(ecModel && ecModel.ssr)) {
            return false;
          }
          var animationEnabled = this.getShallow("animation");
          if (animationEnabled) {
            if (this.getData().count() > this.getShallow("animationThreshold")) {
              animationEnabled = false;
            }
          }
          return !!animationEnabled;
        };
        SeriesModel2.prototype.restoreData = function() {
          this.dataTask.dirty();
        };
        SeriesModel2.prototype.getColorFromPalette = function(name, scope, requestColorNum) {
          var ecModel = this.ecModel;
          var color2 = PaletteMixin.prototype.getColorFromPalette.call(this, name, scope, requestColorNum);
          if (!color2) {
            color2 = ecModel.getColorFromPalette(name, scope, requestColorNum);
          }
          return color2;
        };
        SeriesModel2.prototype.coordDimToDataDim = function(coordDim) {
          return this.getRawData().mapDimensionsAll(coordDim);
        };
        SeriesModel2.prototype.getProgressive = function() {
          return this.get("progressive");
        };
        SeriesModel2.prototype.getProgressiveThreshold = function() {
          return this.get("progressiveThreshold");
        };
        SeriesModel2.prototype.select = function(innerDataIndices, dataType2) {
          this._innerSelect(this.getData(dataType2), innerDataIndices);
        };
        SeriesModel2.prototype.unselect = function(innerDataIndices, dataType2) {
          var selectedMap = this.option.selectedMap;
          if (!selectedMap) {
            return;
          }
          var selectedMode = this.option.selectedMode;
          var data = this.getData(dataType2);
          if (selectedMode === "series" || selectedMap === "all") {
            this.option.selectedMap = {};
            this._selectedDataIndicesMap = {};
            return;
          }
          for (var i2 = 0; i2 < innerDataIndices.length; i2++) {
            var dataIndex = innerDataIndices[i2];
            var nameOrId = getSelectionKey(data, dataIndex);
            selectedMap[nameOrId] = false;
            this._selectedDataIndicesMap[nameOrId] = -1;
          }
        };
        SeriesModel2.prototype.toggleSelect = function(innerDataIndices, dataType2) {
          var tmpArr2 = [];
          for (var i2 = 0; i2 < innerDataIndices.length; i2++) {
            tmpArr2[0] = innerDataIndices[i2];
            this.isSelected(innerDataIndices[i2], dataType2) ? this.unselect(tmpArr2, dataType2) : this.select(tmpArr2, dataType2);
          }
        };
        SeriesModel2.prototype.getSelectedDataIndices = function() {
          if (this.option.selectedMap === "all") {
            return [].slice.call(this.getData().getIndices());
          }
          var selectedDataIndicesMap = this._selectedDataIndicesMap;
          var nameOrIds = keys$1(selectedDataIndicesMap);
          var dataIndices = [];
          for (var i2 = 0; i2 < nameOrIds.length; i2++) {
            var dataIndex = selectedDataIndicesMap[nameOrIds[i2]];
            if (dataIndex >= 0) {
              dataIndices.push(dataIndex);
            }
          }
          return dataIndices;
        };
        SeriesModel2.prototype.isSelected = function(dataIndex, dataType2) {
          var selectedMap = this.option.selectedMap;
          if (!selectedMap) {
            return false;
          }
          var data = this.getData(dataType2);
          return (selectedMap === "all" || selectedMap[getSelectionKey(data, dataIndex)]) && !data.getItemModel(dataIndex).get(["select", "disabled"]);
        };
        SeriesModel2.prototype.isUniversalTransitionEnabled = function() {
          if (this[SERIES_UNIVERSAL_TRANSITION_PROP]) {
            return true;
          }
          var universalTransitionOpt = this.option.universalTransition;
          if (!universalTransitionOpt) {
            return false;
          }
          if (universalTransitionOpt === true) {
            return true;
          }
          return universalTransitionOpt && universalTransitionOpt.enabled;
        };
        SeriesModel2.prototype._innerSelect = function(data, innerDataIndices) {
          var _a2, _b2;
          var option = this.option;
          var selectedMode = option.selectedMode;
          var len2 = innerDataIndices.length;
          if (!selectedMode || !len2) {
            return;
          }
          if (selectedMode === "series") {
            option.selectedMap = "all";
          } else if (selectedMode === "multiple") {
            if (!isObject$5(option.selectedMap)) {
              option.selectedMap = {};
            }
            var selectedMap = option.selectedMap;
            for (var i2 = 0; i2 < len2; i2++) {
              var dataIndex = innerDataIndices[i2];
              var nameOrId = getSelectionKey(data, dataIndex);
              selectedMap[nameOrId] = true;
              this._selectedDataIndicesMap[nameOrId] = data.getRawIndex(dataIndex);
            }
          } else if (selectedMode === "single" || selectedMode === true) {
            var lastDataIndex = innerDataIndices[len2 - 1];
            var nameOrId = getSelectionKey(data, lastDataIndex);
            option.selectedMap = (_a2 = {}, _a2[nameOrId] = true, _a2);
            this._selectedDataIndicesMap = (_b2 = {}, _b2[nameOrId] = data.getRawIndex(lastDataIndex), _b2);
          }
        };
        SeriesModel2.prototype._initSelectedMapFromData = function(data) {
          if (this.option.selectedMap) {
            return;
          }
          var dataIndices = [];
          if (data.hasItemOption) {
            data.each(function(idx) {
              var rawItem = data.getRawDataItem(idx);
              if (rawItem && rawItem.selected) {
                dataIndices.push(idx);
              }
            });
          }
          if (dataIndices.length > 0) {
            this._innerSelect(data, dataIndices);
          }
        };
        SeriesModel2.registerClass = function(clz) {
          return ComponentModel.registerClass(clz);
        };
        SeriesModel2.protoInitialize = function() {
          var proto2 = SeriesModel2.prototype;
          proto2.type = "series.__base__";
          proto2.seriesIndex = 0;
          proto2.ignoreStyleOnData = false;
          proto2.hasSymbolVisual = false;
          proto2.defaultSymbol = "circle";
          proto2.visualStyleAccessPath = "itemStyle";
          proto2.visualDrawType = "fill";
        }();
        return SeriesModel2;
      }(ComponentModel)
    );
    mixin(SeriesModel, DataFormatMixin);
    mixin(SeriesModel, PaletteMixin);
    mountExtend(SeriesModel, ComponentModel);
    function autoSeriesName(seriesModel) {
      var name = seriesModel.name;
      if (!isNameSpecified(seriesModel)) {
        seriesModel.name = getSeriesAutoName(seriesModel) || name;
      }
    }
    function getSeriesAutoName(seriesModel) {
      var data = seriesModel.getRawData();
      var dataDims = data.mapDimensionsAll("seriesName");
      var nameArr = [];
      each$f(dataDims, function(dataDim) {
        var dimInfo = data.getDimensionInfo(dataDim);
        dimInfo.displayName && nameArr.push(dimInfo.displayName);
      });
      return nameArr.join(" ");
    }
    function dataTaskCount(context) {
      return context.model.getRawData().count();
    }
    function dataTaskReset(context) {
      var seriesModel = context.model;
      seriesModel.setData(seriesModel.getRawData().cloneShallow());
      return dataTaskProgress;
    }
    function dataTaskProgress(param, context) {
      if (context.outputData && param.end > context.outputData.count()) {
        context.model.getRawData().cloneShallow(context.outputData);
      }
    }
    function wrapData(data, seriesModel) {
      each$f(concatArray(data.CHANGABLE_METHODS, data.DOWNSAMPLE_METHODS), function(methodName) {
        data.wrapMethod(methodName, curry$1(onDataChange, seriesModel));
      });
    }
    function onDataChange(seriesModel, newList) {
      var task = getCurrentTask(seriesModel);
      if (task) {
        task.setOutputEnd((newList || this).count());
      }
      return newList;
    }
    function getCurrentTask(seriesModel) {
      var scheduler = (seriesModel.ecModel || {}).scheduler;
      var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid);
      if (pipeline) {
        var task = pipeline.currentTask;
        if (task) {
          var agentStubMap = task.agentStubMap;
          if (agentStubMap) {
            task = agentStubMap.get(seriesModel.uid);
          }
        }
        return task;
      }
    }
    var ComponentView = (
      /** @class */
      function() {
        function ComponentView2() {
          this.group = new Group$3();
          this.uid = getUID("viewComponent");
        }
        ComponentView2.prototype.init = function(ecModel, api2) {
        };
        ComponentView2.prototype.render = function(model, ecModel, api2, payload) {
        };
        ComponentView2.prototype.dispose = function(ecModel, api2) {
        };
        ComponentView2.prototype.updateView = function(model, ecModel, api2, payload) {
        };
        ComponentView2.prototype.updateLayout = function(model, ecModel, api2, payload) {
        };
        ComponentView2.prototype.updateVisual = function(model, ecModel, api2, payload) {
        };
        ComponentView2.prototype.toggleBlurSeries = function(seriesModels, isBlur, ecModel) {
        };
        ComponentView2.prototype.eachRendered = function(cb) {
          var group = this.group;
          if (group) {
            group.traverse(cb);
          }
        };
        return ComponentView2;
      }()
    );
    enableClassExtend(ComponentView);
    enableClassManagement(ComponentView);
    function createRenderPlanner() {
      var inner2 = makeInner();
      return function(seriesModel) {
        var fields = inner2(seriesModel);
        var pipelineContext = seriesModel.pipelineContext;
        var originalLarge = !!fields.large;
        var originalProgressive = !!fields.progressiveRender;
        var large = fields.large = !!(pipelineContext && pipelineContext.large);
        var progressive = fields.progressiveRender = !!(pipelineContext && pipelineContext.progressiveRender);
        return !!(originalLarge !== large || originalProgressive !== progressive) && "reset";
      };
    }
    var inner$j = makeInner();
    var renderPlanner = createRenderPlanner();
    var ChartView = (
      /** @class */
      function() {
        function ChartView2() {
          this.group = new Group$3();
          this.uid = getUID("viewChart");
          this.renderTask = createTask({
            plan: renderTaskPlan,
            reset: renderTaskReset
          });
          this.renderTask.context = {
            view: this
          };
        }
        ChartView2.prototype.init = function(ecModel, api2) {
        };
        ChartView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
        };
        ChartView2.prototype.highlight = function(seriesModel, ecModel, api2, payload) {
          var data = seriesModel.getData(payload && payload.dataType);
          if (!data) {
            return;
          }
          toggleHighlight(data, payload, "emphasis");
        };
        ChartView2.prototype.downplay = function(seriesModel, ecModel, api2, payload) {
          var data = seriesModel.getData(payload && payload.dataType);
          if (!data) {
            return;
          }
          toggleHighlight(data, payload, "normal");
        };
        ChartView2.prototype.remove = function(ecModel, api2) {
          this.group.removeAll();
        };
        ChartView2.prototype.dispose = function(ecModel, api2) {
        };
        ChartView2.prototype.updateView = function(seriesModel, ecModel, api2, payload) {
          this.render(seriesModel, ecModel, api2, payload);
        };
        ChartView2.prototype.updateLayout = function(seriesModel, ecModel, api2, payload) {
          this.render(seriesModel, ecModel, api2, payload);
        };
        ChartView2.prototype.updateVisual = function(seriesModel, ecModel, api2, payload) {
          this.render(seriesModel, ecModel, api2, payload);
        };
        ChartView2.prototype.eachRendered = function(cb) {
          traverseElements(this.group, cb);
        };
        ChartView2.markUpdateMethod = function(payload, methodName) {
          inner$j(payload).updateMethod = methodName;
        };
        ChartView2.protoInitialize = function() {
          var proto2 = ChartView2.prototype;
          proto2.type = "chart";
        }();
        return ChartView2;
      }()
    );
    function elSetState(el, state, highlightDigit) {
      if (el && isHighDownDispatcher(el)) {
        (state === "emphasis" ? enterEmphasis : leaveEmphasis)(el, highlightDigit);
      }
    }
    function toggleHighlight(data, payload, state) {
      var dataIndex = queryDataIndex(data, payload);
      var highlightDigit = payload && payload.highlightKey != null ? getHighlightDigit(payload.highlightKey) : null;
      if (dataIndex != null) {
        each$f(normalizeToArray(dataIndex), function(dataIdx) {
          elSetState(data.getItemGraphicEl(dataIdx), state, highlightDigit);
        });
      } else {
        data.eachItemGraphicEl(function(el) {
          elSetState(el, state, highlightDigit);
        });
      }
    }
    enableClassExtend(ChartView);
    enableClassManagement(ChartView);
    function renderTaskPlan(context) {
      return renderPlanner(context.model);
    }
    function renderTaskReset(context) {
      var seriesModel = context.model;
      var ecModel = context.ecModel;
      var api2 = context.api;
      var payload = context.payload;
      var progressiveRender = seriesModel.pipelineContext.progressiveRender;
      var view = context.view;
      var updateMethod = payload && inner$j(payload).updateMethod;
      var methodName = progressiveRender ? "incrementalPrepareRender" : updateMethod && view[updateMethod] ? updateMethod : "render";
      if (methodName !== "render") {
        view[methodName](seriesModel, ecModel, api2, payload);
      }
      return progressMethodMap[methodName];
    }
    var progressMethodMap = {
      incrementalPrepareRender: {
        progress: function(params, context) {
          context.view.incrementalRender(params, context.model, context.ecModel, context.api, context.payload);
        }
      },
      render: {
        // Put view.render in `progress` to support appendData. But in this case
        // view.render should not be called in reset, otherwise it will be called
        // twise. Use `forceFirstProgress` to make sure that view.render is called
        // in any cases.
        forceFirstProgress: true,
        progress: function(params, context) {
          context.view.render(context.model, context.ecModel, context.api, context.payload);
        }
      }
    };
    var ORIGIN_METHOD = "\0__throttleOriginMethod";
    var RATE = "\0__throttleRate";
    var THROTTLE_TYPE = "\0__throttleType";
    function throttle$1(fn2, delay, debounce2) {
      var currCall;
      var lastCall = 0;
      var lastExec = 0;
      var timer = null;
      var diff;
      var scope;
      var args;
      var debounceNextCall;
      delay = delay || 0;
      function exec() {
        lastExec = (/* @__PURE__ */ new Date()).getTime();
        timer = null;
        fn2.apply(scope, args || []);
      }
      var cb = function() {
        var cbArgs = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          cbArgs[_i] = arguments[_i];
        }
        currCall = (/* @__PURE__ */ new Date()).getTime();
        scope = this;
        args = cbArgs;
        var thisDelay = debounceNextCall || delay;
        var thisDebounce = debounceNextCall || debounce2;
        debounceNextCall = null;
        diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay;
        clearTimeout(timer);
        if (thisDebounce) {
          timer = setTimeout(exec, thisDelay);
        } else {
          if (diff >= 0) {
            exec();
          } else {
            timer = setTimeout(exec, -diff);
          }
        }
        lastCall = currCall;
      };
      cb.clear = function() {
        if (timer) {
          clearTimeout(timer);
          timer = null;
        }
      };
      cb.debounceNextCall = function(debounceDelay) {
        debounceNextCall = debounceDelay;
      };
      return cb;
    }
    function createOrUpdate(obj, fnAttr, rate, throttleType) {
      var fn2 = obj[fnAttr];
      if (!fn2) {
        return;
      }
      var originFn = fn2[ORIGIN_METHOD] || fn2;
      var lastThrottleType = fn2[THROTTLE_TYPE];
      var lastRate = fn2[RATE];
      if (lastRate !== rate || lastThrottleType !== throttleType) {
        if (rate == null || !throttleType) {
          return obj[fnAttr] = originFn;
        }
        fn2 = obj[fnAttr] = throttle$1(originFn, rate, throttleType === "debounce");
        fn2[ORIGIN_METHOD] = originFn;
        fn2[THROTTLE_TYPE] = throttleType;
        fn2[RATE] = rate;
      }
      return fn2;
    }
    function clear$1(obj, fnAttr) {
      var fn2 = obj[fnAttr];
      if (fn2 && fn2[ORIGIN_METHOD]) {
        fn2.clear && fn2.clear();
        obj[fnAttr] = fn2[ORIGIN_METHOD];
      }
    }
    var inner$i = makeInner();
    var defaultStyleMappers = {
      itemStyle: makeStyleMapper(ITEM_STYLE_KEY_MAP, true),
      lineStyle: makeStyleMapper(LINE_STYLE_KEY_MAP, true)
    };
    var defaultColorKey = {
      lineStyle: "stroke",
      itemStyle: "fill"
    };
    function getStyleMapper(seriesModel, stylePath) {
      var styleMapper = seriesModel.visualStyleMapper || defaultStyleMappers[stylePath];
      if (!styleMapper) {
        console.warn("Unknown style type '" + stylePath + "'.");
        return defaultStyleMappers.itemStyle;
      }
      return styleMapper;
    }
    function getDefaultColorKey(seriesModel, stylePath) {
      var colorKey = seriesModel.visualDrawType || defaultColorKey[stylePath];
      if (!colorKey) {
        console.warn("Unknown style type '" + stylePath + "'.");
        return "fill";
      }
      return colorKey;
    }
    var seriesStyleTask = {
      createOnAllSeries: true,
      performRawSeries: true,
      reset: function(seriesModel, ecModel) {
        var data = seriesModel.getData();
        var stylePath = seriesModel.visualStyleAccessPath || "itemStyle";
        var styleModel = seriesModel.getModel(stylePath);
        var getStyle2 = getStyleMapper(seriesModel, stylePath);
        var globalStyle = getStyle2(styleModel);
        var decalOption = styleModel.getShallow("decal");
        if (decalOption) {
          data.setVisual("decal", decalOption);
          decalOption.dirty = true;
        }
        var colorKey = getDefaultColorKey(seriesModel, stylePath);
        var color2 = globalStyle[colorKey];
        var colorCallback = isFunction$1(color2) ? color2 : null;
        var hasAutoColor = globalStyle.fill === "auto" || globalStyle.stroke === "auto";
        if (!globalStyle[colorKey] || colorCallback || hasAutoColor) {
          var colorPalette2 = seriesModel.getColorFromPalette(
            // TODO series count changed.
            seriesModel.name,
            null,
            ecModel.getSeriesCount()
          );
          if (!globalStyle[colorKey]) {
            globalStyle[colorKey] = colorPalette2;
            data.setVisual("colorFromPalette", true);
          }
          globalStyle.fill = globalStyle.fill === "auto" || isFunction$1(globalStyle.fill) ? colorPalette2 : globalStyle.fill;
          globalStyle.stroke = globalStyle.stroke === "auto" || isFunction$1(globalStyle.stroke) ? colorPalette2 : globalStyle.stroke;
        }
        data.setVisual("style", globalStyle);
        data.setVisual("drawType", colorKey);
        if (!ecModel.isSeriesFiltered(seriesModel) && colorCallback) {
          data.setVisual("colorFromPalette", false);
          return {
            dataEach: function(data2, idx) {
              var dataParams = seriesModel.getDataParams(idx);
              var itemStyle = extend$1({}, globalStyle);
              itemStyle[colorKey] = colorCallback(dataParams);
              data2.setItemVisual(idx, "style", itemStyle);
            }
          };
        }
      }
    };
    var sharedModel = new Model();
    var dataStyleTask = {
      createOnAllSeries: true,
      performRawSeries: true,
      reset: function(seriesModel, ecModel) {
        if (seriesModel.ignoreStyleOnData || ecModel.isSeriesFiltered(seriesModel)) {
          return;
        }
        var data = seriesModel.getData();
        var stylePath = seriesModel.visualStyleAccessPath || "itemStyle";
        var getStyle2 = getStyleMapper(seriesModel, stylePath);
        var colorKey = data.getVisual("drawType");
        return {
          dataEach: data.hasItemOption ? function(data2, idx) {
            var rawItem = data2.getRawDataItem(idx);
            if (rawItem && rawItem[stylePath]) {
              sharedModel.option = rawItem[stylePath];
              var style = getStyle2(sharedModel);
              var existsStyle = data2.ensureUniqueItemVisual(idx, "style");
              extend$1(existsStyle, style);
              if (sharedModel.option.decal) {
                data2.setItemVisual(idx, "decal", sharedModel.option.decal);
                sharedModel.option.decal.dirty = true;
              }
              if (colorKey in style) {
                data2.setItemVisual(idx, "colorFromPalette", false);
              }
            }
          } : null
        };
      }
    };
    var dataColorPaletteTask = {
      performRawSeries: true,
      overallReset: function(ecModel) {
        var paletteScopeGroupByType = createHashMap();
        ecModel.eachSeries(function(seriesModel) {
          var colorBy = seriesModel.getColorBy();
          if (seriesModel.isColorBySeries()) {
            return;
          }
          var key = seriesModel.type + "-" + colorBy;
          var colorScope = paletteScopeGroupByType.get(key);
          if (!colorScope) {
            colorScope = {};
            paletteScopeGroupByType.set(key, colorScope);
          }
          inner$i(seriesModel).scope = colorScope;
        });
        ecModel.eachSeries(function(seriesModel) {
          if (seriesModel.isColorBySeries() || ecModel.isSeriesFiltered(seriesModel)) {
            return;
          }
          var dataAll = seriesModel.getRawData();
          var idxMap = {};
          var data = seriesModel.getData();
          var colorScope = inner$i(seriesModel).scope;
          var stylePath = seriesModel.visualStyleAccessPath || "itemStyle";
          var colorKey = getDefaultColorKey(seriesModel, stylePath);
          data.each(function(idx) {
            var rawIdx = data.getRawIndex(idx);
            idxMap[rawIdx] = idx;
          });
          dataAll.each(function(rawIdx) {
            var idx = idxMap[rawIdx];
            var fromPalette = data.getItemVisual(idx, "colorFromPalette");
            if (fromPalette) {
              var itemStyle = data.ensureUniqueItemVisual(idx, "style");
              var name_1 = dataAll.getName(rawIdx) || rawIdx + "";
              var dataCount = dataAll.count();
              itemStyle[colorKey] = seriesModel.getColorFromPalette(name_1, colorScope, dataCount);
            }
          });
        });
      }
    };
    var PI$5 = Math.PI;
    function defaultLoading(api2, opts) {
      opts = opts || {};
      defaults$1(opts, {
        text: "loading",
        textColor: "#000",
        fontSize: 12,
        fontWeight: "normal",
        fontStyle: "normal",
        fontFamily: "sans-serif",
        maskColor: "rgba(255, 255, 255, 0.8)",
        showSpinner: true,
        color: "#5470c6",
        spinnerRadius: 10,
        lineWidth: 5,
        zlevel: 0
      });
      var group = new Group$3();
      var mask = new Rect$2({
        style: {
          fill: opts.maskColor
        },
        zlevel: opts.zlevel,
        z: 1e4
      });
      group.add(mask);
      var textContent = new ZRText({
        style: {
          text: opts.text,
          fill: opts.textColor,
          fontSize: opts.fontSize,
          fontWeight: opts.fontWeight,
          fontStyle: opts.fontStyle,
          fontFamily: opts.fontFamily
        },
        zlevel: opts.zlevel,
        z: 10001
      });
      var labelRect = new Rect$2({
        style: {
          fill: "none"
        },
        textContent,
        textConfig: {
          position: "right",
          distance: 10
        },
        zlevel: opts.zlevel,
        z: 10001
      });
      group.add(labelRect);
      var arc;
      if (opts.showSpinner) {
        arc = new Arc({
          shape: {
            startAngle: -PI$5 / 2,
            endAngle: -PI$5 / 2 + 0.1,
            r: opts.spinnerRadius
          },
          style: {
            stroke: opts.color,
            lineCap: "round",
            lineWidth: opts.lineWidth
          },
          zlevel: opts.zlevel,
          z: 10001
        });
        arc.animateShape(true).when(1e3, {
          endAngle: PI$5 * 3 / 2
        }).start("circularInOut");
        arc.animateShape(true).when(1e3, {
          startAngle: PI$5 * 3 / 2
        }).delay(300).start("circularInOut");
        group.add(arc);
      }
      group.resize = function() {
        var textWidth = textContent.getBoundingRect().width;
        var r = opts.showSpinner ? opts.spinnerRadius : 0;
        var cx = (api2.getWidth() - r * 2 - (opts.showSpinner && textWidth ? 10 : 0) - textWidth) / 2 - (opts.showSpinner && textWidth ? 0 : 5 + textWidth / 2) + (opts.showSpinner ? 0 : textWidth / 2) + (textWidth ? 0 : r);
        var cy = api2.getHeight() / 2;
        opts.showSpinner && arc.setShape({
          cx,
          cy
        });
        labelRect.setShape({
          x: cx - r,
          y: cy - r,
          width: r * 2,
          height: r * 2
        });
        mask.setShape({
          x: 0,
          y: 0,
          width: api2.getWidth(),
          height: api2.getHeight()
        });
      };
      group.resize();
      return group;
    }
    var Scheduler = (
      /** @class */
      function() {
        function Scheduler2(ecInstance, api2, dataProcessorHandlers, visualHandlers) {
          this._stageTaskMap = createHashMap();
          this.ecInstance = ecInstance;
          this.api = api2;
          dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice();
          visualHandlers = this._visualHandlers = visualHandlers.slice();
          this._allHandlers = dataProcessorHandlers.concat(visualHandlers);
        }
        Scheduler2.prototype.restoreData = function(ecModel, payload) {
          ecModel.restoreData(payload);
          this._stageTaskMap.each(function(taskRecord) {
            var overallTask = taskRecord.overallTask;
            overallTask && overallTask.dirty();
          });
        };
        Scheduler2.prototype.getPerformArgs = function(task, isBlock) {
          if (!task.__pipeline) {
            return;
          }
          var pipeline = this._pipelineMap.get(task.__pipeline.id);
          var pCtx = pipeline.context;
          var incremental = !isBlock && pipeline.progressiveEnabled && (!pCtx || pCtx.progressiveRender) && task.__idxInPipeline > pipeline.blockIndex;
          var step = incremental ? pipeline.step : null;
          var modDataCount = pCtx && pCtx.modDataCount;
          var modBy = modDataCount != null ? Math.ceil(modDataCount / step) : null;
          return {
            step,
            modBy,
            modDataCount
          };
        };
        Scheduler2.prototype.getPipeline = function(pipelineId) {
          return this._pipelineMap.get(pipelineId);
        };
        Scheduler2.prototype.updateStreamModes = function(seriesModel, view) {
          var pipeline = this._pipelineMap.get(seriesModel.uid);
          var data = seriesModel.getData();
          var dataLen = data.count();
          var progressiveRender = pipeline.progressiveEnabled && view.incrementalPrepareRender && dataLen >= pipeline.threshold;
          var large = seriesModel.get("large") && dataLen >= seriesModel.get("largeThreshold");
          var modDataCount = seriesModel.get("progressiveChunkMode") === "mod" ? dataLen : null;
          seriesModel.pipelineContext = pipeline.context = {
            progressiveRender,
            modDataCount,
            large
          };
        };
        Scheduler2.prototype.restorePipelines = function(ecModel) {
          var scheduler = this;
          var pipelineMap = scheduler._pipelineMap = createHashMap();
          ecModel.eachSeries(function(seriesModel) {
            var progressive = seriesModel.getProgressive();
            var pipelineId = seriesModel.uid;
            pipelineMap.set(pipelineId, {
              id: pipelineId,
              head: null,
              tail: null,
              threshold: seriesModel.getProgressiveThreshold(),
              progressiveEnabled: progressive && !(seriesModel.preventIncremental && seriesModel.preventIncremental()),
              blockIndex: -1,
              step: Math.round(progressive || 700),
              count: 0
            });
            scheduler._pipe(seriesModel, seriesModel.dataTask);
          });
        };
        Scheduler2.prototype.prepareStageTasks = function() {
          var stageTaskMap = this._stageTaskMap;
          var ecModel = this.api.getModel();
          var api2 = this.api;
          each$f(this._allHandlers, function(handler) {
            var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, {});
            var errMsg = "";
            assert(!(handler.reset && handler.overallReset), errMsg);
            handler.reset && this._createSeriesStageTask(handler, record, ecModel, api2);
            handler.overallReset && this._createOverallStageTask(handler, record, ecModel, api2);
          }, this);
        };
        Scheduler2.prototype.prepareView = function(view, model, ecModel, api2) {
          var renderTask = view.renderTask;
          var context = renderTask.context;
          context.model = model;
          context.ecModel = ecModel;
          context.api = api2;
          renderTask.__block = !view.incrementalPrepareRender;
          this._pipe(model, renderTask);
        };
        Scheduler2.prototype.performDataProcessorTasks = function(ecModel, payload) {
          this._performStageTasks(this._dataProcessorHandlers, ecModel, payload, {
            block: true
          });
        };
        Scheduler2.prototype.performVisualTasks = function(ecModel, payload, opt) {
          this._performStageTasks(this._visualHandlers, ecModel, payload, opt);
        };
        Scheduler2.prototype._performStageTasks = function(stageHandlers, ecModel, payload, opt) {
          opt = opt || {};
          var unfinished = false;
          var scheduler = this;
          each$f(stageHandlers, function(stageHandler, idx) {
            if (opt.visualType && opt.visualType !== stageHandler.visualType) {
              return;
            }
            var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid);
            var seriesTaskMap = stageHandlerRecord.seriesTaskMap;
            var overallTask = stageHandlerRecord.overallTask;
            if (overallTask) {
              var overallNeedDirty_1;
              var agentStubMap = overallTask.agentStubMap;
              agentStubMap.each(function(stub) {
                if (needSetDirty(opt, stub)) {
                  stub.dirty();
                  overallNeedDirty_1 = true;
                }
              });
              overallNeedDirty_1 && overallTask.dirty();
              scheduler.updatePayload(overallTask, payload);
              var performArgs_1 = scheduler.getPerformArgs(overallTask, opt.block);
              agentStubMap.each(function(stub) {
                stub.perform(performArgs_1);
              });
              if (overallTask.perform(performArgs_1)) {
                unfinished = true;
              }
            } else if (seriesTaskMap) {
              seriesTaskMap.each(function(task, pipelineId) {
                if (needSetDirty(opt, task)) {
                  task.dirty();
                }
                var performArgs = scheduler.getPerformArgs(task, opt.block);
                performArgs.skip = !stageHandler.performRawSeries && ecModel.isSeriesFiltered(task.context.model);
                scheduler.updatePayload(task, payload);
                if (task.perform(performArgs)) {
                  unfinished = true;
                }
              });
            }
          });
          function needSetDirty(opt2, task) {
            return opt2.setDirty && (!opt2.dirtyMap || opt2.dirtyMap.get(task.__pipeline.id));
          }
          this.unfinished = unfinished || this.unfinished;
        };
        Scheduler2.prototype.performSeriesTasks = function(ecModel) {
          var unfinished;
          ecModel.eachSeries(function(seriesModel) {
            unfinished = seriesModel.dataTask.perform() || unfinished;
          });
          this.unfinished = unfinished || this.unfinished;
        };
        Scheduler2.prototype.plan = function() {
          this._pipelineMap.each(function(pipeline) {
            var task = pipeline.tail;
            do {
              if (task.__block) {
                pipeline.blockIndex = task.__idxInPipeline;
                break;
              }
              task = task.getUpstream();
            } while (task);
          });
        };
        Scheduler2.prototype.updatePayload = function(task, payload) {
          payload !== "remain" && (task.context.payload = payload);
        };
        Scheduler2.prototype._createSeriesStageTask = function(stageHandler, stageHandlerRecord, ecModel, api2) {
          var scheduler = this;
          var oldSeriesTaskMap = stageHandlerRecord.seriesTaskMap;
          var newSeriesTaskMap = stageHandlerRecord.seriesTaskMap = createHashMap();
          var seriesType2 = stageHandler.seriesType;
          var getTargetSeries = stageHandler.getTargetSeries;
          if (stageHandler.createOnAllSeries) {
            ecModel.eachRawSeries(create2);
          } else if (seriesType2) {
            ecModel.eachRawSeriesByType(seriesType2, create2);
          } else if (getTargetSeries) {
            getTargetSeries(ecModel, api2).each(create2);
          }
          function create2(seriesModel) {
            var pipelineId = seriesModel.uid;
            var task = newSeriesTaskMap.set(pipelineId, oldSeriesTaskMap && oldSeriesTaskMap.get(pipelineId) || createTask({
              plan: seriesTaskPlan,
              reset: seriesTaskReset,
              count: seriesTaskCount
            }));
            task.context = {
              model: seriesModel,
              ecModel,
              api: api2,
              // PENDING: `useClearVisual` not used?
              useClearVisual: stageHandler.isVisual && !stageHandler.isLayout,
              plan: stageHandler.plan,
              reset: stageHandler.reset,
              scheduler
            };
            scheduler._pipe(seriesModel, task);
          }
        };
        Scheduler2.prototype._createOverallStageTask = function(stageHandler, stageHandlerRecord, ecModel, api2) {
          var scheduler = this;
          var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask || createTask({
            reset: overallTaskReset
          });
          overallTask.context = {
            ecModel,
            api: api2,
            overallReset: stageHandler.overallReset,
            scheduler
          };
          var oldAgentStubMap = overallTask.agentStubMap;
          var newAgentStubMap = overallTask.agentStubMap = createHashMap();
          var seriesType2 = stageHandler.seriesType;
          var getTargetSeries = stageHandler.getTargetSeries;
          var overallProgress = true;
          var shouldOverallTaskDirty = false;
          var errMsg = "";
          assert(!stageHandler.createOnAllSeries, errMsg);
          if (seriesType2) {
            ecModel.eachRawSeriesByType(seriesType2, createStub);
          } else if (getTargetSeries) {
            getTargetSeries(ecModel, api2).each(createStub);
          } else {
            overallProgress = false;
            each$f(ecModel.getSeries(), createStub);
          }
          function createStub(seriesModel) {
            var pipelineId = seriesModel.uid;
            var stub = newAgentStubMap.set(pipelineId, oldAgentStubMap && oldAgentStubMap.get(pipelineId) || // When the result of `getTargetSeries` changed, the overallTask
            // should be set as dirty and re-performed.
            (shouldOverallTaskDirty = true, createTask({
              reset: stubReset,
              onDirty: stubOnDirty
            })));
            stub.context = {
              model: seriesModel,
              overallProgress
              // FIXME:TS never used, so comment it
              // modifyOutputEnd: modifyOutputEnd
            };
            stub.agent = overallTask;
            stub.__block = overallProgress;
            scheduler._pipe(seriesModel, stub);
          }
          if (shouldOverallTaskDirty) {
            overallTask.dirty();
          }
        };
        Scheduler2.prototype._pipe = function(seriesModel, task) {
          var pipelineId = seriesModel.uid;
          var pipeline = this._pipelineMap.get(pipelineId);
          !pipeline.head && (pipeline.head = task);
          pipeline.tail && pipeline.tail.pipe(task);
          pipeline.tail = task;
          task.__idxInPipeline = pipeline.count++;
          task.__pipeline = pipeline;
        };
        Scheduler2.wrapStageHandler = function(stageHandler, visualType) {
          if (isFunction$1(stageHandler)) {
            stageHandler = {
              overallReset: stageHandler,
              seriesType: detectSeriseType(stageHandler)
            };
          }
          stageHandler.uid = getUID("stageHandler");
          visualType && (stageHandler.visualType = visualType);
          return stageHandler;
        };
        return Scheduler2;
      }()
    );
    function overallTaskReset(context) {
      context.overallReset(context.ecModel, context.api, context.payload);
    }
    function stubReset(context) {
      return context.overallProgress && stubProgress;
    }
    function stubProgress() {
      this.agent.dirty();
      this.getDownstream().dirty();
    }
    function stubOnDirty() {
      this.agent && this.agent.dirty();
    }
    function seriesTaskPlan(context) {
      return context.plan ? context.plan(context.model, context.ecModel, context.api, context.payload) : null;
    }
    function seriesTaskReset(context) {
      if (context.useClearVisual) {
        context.data.clearAllVisual();
      }
      var resetDefines = context.resetDefines = normalizeToArray(context.reset(context.model, context.ecModel, context.api, context.payload));
      return resetDefines.length > 1 ? map$1(resetDefines, function(v4, idx) {
        return makeSeriesTaskProgress(idx);
      }) : singleSeriesTaskProgress;
    }
    var singleSeriesTaskProgress = makeSeriesTaskProgress(0);
    function makeSeriesTaskProgress(resetDefineIdx) {
      return function(params, context) {
        var data = context.data;
        var resetDefine = context.resetDefines[resetDefineIdx];
        if (resetDefine && resetDefine.dataEach) {
          for (var i2 = params.start; i2 < params.end; i2++) {
            resetDefine.dataEach(data, i2);
          }
        } else if (resetDefine && resetDefine.progress) {
          resetDefine.progress(params, data);
        }
      };
    }
    function seriesTaskCount(context) {
      return context.data.count();
    }
    function detectSeriseType(legacyFunc) {
      seriesType = null;
      try {
        legacyFunc(ecModelMock, apiMock);
      } catch (e2) {
      }
      return seriesType;
    }
    var ecModelMock = {};
    var apiMock = {};
    var seriesType;
    mockMethods(ecModelMock, GlobalModel);
    mockMethods(apiMock, ExtensionAPI);
    ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function(type) {
      seriesType = type;
    };
    ecModelMock.eachComponent = function(cond) {
      if (cond.mainType === "series" && cond.subType) {
        seriesType = cond.subType;
      }
    };
    function mockMethods(target, Clz) {
      for (var name_1 in Clz.prototype) {
        target[name_1] = noop$1;
      }
    }
    var colorAll = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"];
    const lightTheme = {
      color: colorAll,
      colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], colorAll]
    };
    var contrastColor = "#B9B8CE";
    var backgroundColor$1 = "#100C2A";
    var axisCommon = function() {
      return {
        axisLine: {
          lineStyle: {
            color: contrastColor
          }
        },
        splitLine: {
          lineStyle: {
            color: "#484753"
          }
        },
        splitArea: {
          areaStyle: {
            color: ["rgba(255,255,255,0.02)", "rgba(255,255,255,0.05)"]
          }
        },
        minorSplitLine: {
          lineStyle: {
            color: "#20203B"
          }
        }
      };
    };
    var colorPalette = ["#4992ff", "#7cffb2", "#fddd60", "#ff6e76", "#58d9f9", "#05c091", "#ff8a45", "#8d48e3", "#dd79ff"];
    var theme = {
      darkMode: true,
      color: colorPalette,
      backgroundColor: backgroundColor$1,
      axisPointer: {
        lineStyle: {
          color: "#817f91"
        },
        crossStyle: {
          color: "#817f91"
        },
        label: {
          // TODO Contrast of label backgorundColor
          color: "#fff"
        }
      },
      legend: {
        textStyle: {
          color: contrastColor
        },
        pageTextStyle: {
          color: contrastColor
        }
      },
      textStyle: {
        color: contrastColor
      },
      title: {
        textStyle: {
          color: "#EEF1FA"
        },
        subtextStyle: {
          color: "#B9B8CE"
        }
      },
      toolbox: {
        iconStyle: {
          borderColor: contrastColor
        }
      },
      dataZoom: {
        borderColor: "#71708A",
        textStyle: {
          color: contrastColor
        },
        brushStyle: {
          color: "rgba(135,163,206,0.3)"
        },
        handleStyle: {
          color: "#353450",
          borderColor: "#C5CBE3"
        },
        moveHandleStyle: {
          color: "#B0B6C3",
          opacity: 0.3
        },
        fillerColor: "rgba(135,163,206,0.2)",
        emphasis: {
          handleStyle: {
            borderColor: "#91B7F2",
            color: "#4D587D"
          },
          moveHandleStyle: {
            color: "#636D9A",
            opacity: 0.7
          }
        },
        dataBackground: {
          lineStyle: {
            color: "#71708A",
            width: 1
          },
          areaStyle: {
            color: "#71708A"
          }
        },
        selectedDataBackground: {
          lineStyle: {
            color: "#87A3CE"
          },
          areaStyle: {
            color: "#87A3CE"
          }
        }
      },
      visualMap: {
        textStyle: {
          color: contrastColor
        }
      },
      timeline: {
        lineStyle: {
          color: contrastColor
        },
        label: {
          color: contrastColor
        },
        controlStyle: {
          color: contrastColor,
          borderColor: contrastColor
        }
      },
      calendar: {
        itemStyle: {
          color: backgroundColor$1
        },
        dayLabel: {
          color: contrastColor
        },
        monthLabel: {
          color: contrastColor
        },
        yearLabel: {
          color: contrastColor
        }
      },
      timeAxis: axisCommon(),
      logAxis: axisCommon(),
      valueAxis: axisCommon(),
      categoryAxis: axisCommon(),
      line: {
        symbol: "circle"
      },
      graph: {
        color: colorPalette
      },
      gauge: {
        title: {
          color: contrastColor
        },
        axisLine: {
          lineStyle: {
            color: [[1, "rgba(207,212,219,0.2)"]]
          }
        },
        axisLabel: {
          color: contrastColor
        },
        detail: {
          color: "#EEF1FA"
        }
      },
      candlestick: {
        itemStyle: {
          color: "#f64e56",
          color0: "#54ea92",
          borderColor: "#f64e56",
          borderColor0: "#54ea92"
          // borderColor: '#ca2824',
          // borderColor0: '#09a443'
        }
      }
    };
    theme.categoryAxis.splitLine.show = false;
    var ECEventProcessor = (
      /** @class */
      function() {
        function ECEventProcessor2() {
        }
        ECEventProcessor2.prototype.normalizeQuery = function(query) {
          var cptQuery = {};
          var dataQuery = {};
          var otherQuery = {};
          if (isString$1(query)) {
            var condCptType = parseClassType(query);
            cptQuery.mainType = condCptType.main || null;
            cptQuery.subType = condCptType.sub || null;
          } else {
            var suffixes_1 = ["Index", "Name", "Id"];
            var dataKeys_1 = {
              name: 1,
              dataIndex: 1,
              dataType: 1
            };
            each$f(query, function(val, key) {
              var reserved = false;
              for (var i2 = 0; i2 < suffixes_1.length; i2++) {
                var propSuffix = suffixes_1[i2];
                var suffixPos = key.lastIndexOf(propSuffix);
                if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) {
                  var mainType = key.slice(0, suffixPos);
                  if (mainType !== "data") {
                    cptQuery.mainType = mainType;
                    cptQuery[propSuffix.toLowerCase()] = val;
                    reserved = true;
                  }
                }
              }
              if (dataKeys_1.hasOwnProperty(key)) {
                dataQuery[key] = val;
                reserved = true;
              }
              if (!reserved) {
                otherQuery[key] = val;
              }
            });
          }
          return {
            cptQuery,
            dataQuery,
            otherQuery
          };
        };
        ECEventProcessor2.prototype.filter = function(eventType, query) {
          var eventInfo = this.eventInfo;
          if (!eventInfo) {
            return true;
          }
          var targetEl = eventInfo.targetEl;
          var packedEvent = eventInfo.packedEvent;
          var model = eventInfo.model;
          var view = eventInfo.view;
          if (!model || !view) {
            return true;
          }
          var cptQuery = query.cptQuery;
          var dataQuery = query.dataQuery;
          return check(cptQuery, model, "mainType") && check(cptQuery, model, "subType") && check(cptQuery, model, "index", "componentIndex") && check(cptQuery, model, "name") && check(cptQuery, model, "id") && check(dataQuery, packedEvent, "name") && check(dataQuery, packedEvent, "dataIndex") && check(dataQuery, packedEvent, "dataType") && (!view.filterForExposedEvent || view.filterForExposedEvent(eventType, query.otherQuery, targetEl, packedEvent));
          function check(query2, host, prop, propOnHost) {
            return query2[prop] == null || host[propOnHost || prop] === query2[prop];
          }
        };
        ECEventProcessor2.prototype.afterTrigger = function() {
          this.eventInfo = null;
        };
        return ECEventProcessor2;
      }()
    );
    var SYMBOL_PROPS_WITH_CB = ["symbol", "symbolSize", "symbolRotate", "symbolOffset"];
    var SYMBOL_PROPS = SYMBOL_PROPS_WITH_CB.concat(["symbolKeepAspect"]);
    var seriesSymbolTask = {
      createOnAllSeries: true,
      // For legend.
      performRawSeries: true,
      reset: function(seriesModel, ecModel) {
        var data = seriesModel.getData();
        if (seriesModel.legendIcon) {
          data.setVisual("legendIcon", seriesModel.legendIcon);
        }
        if (!seriesModel.hasSymbolVisual) {
          return;
        }
        var symbolOptions = {};
        var symbolOptionsCb = {};
        var hasCallback = false;
        for (var i2 = 0; i2 < SYMBOL_PROPS_WITH_CB.length; i2++) {
          var symbolPropName = SYMBOL_PROPS_WITH_CB[i2];
          var val = seriesModel.get(symbolPropName);
          if (isFunction$1(val)) {
            hasCallback = true;
            symbolOptionsCb[symbolPropName] = val;
          } else {
            symbolOptions[symbolPropName] = val;
          }
        }
        symbolOptions.symbol = symbolOptions.symbol || seriesModel.defaultSymbol;
        data.setVisual(extend$1({
          legendIcon: seriesModel.legendIcon || symbolOptions.symbol,
          symbolKeepAspect: seriesModel.get("symbolKeepAspect")
        }, symbolOptions));
        if (ecModel.isSeriesFiltered(seriesModel)) {
          return;
        }
        var symbolPropsCb = keys$1(symbolOptionsCb);
        function dataEach(data2, idx) {
          var rawValue = seriesModel.getRawValue(idx);
          var params = seriesModel.getDataParams(idx);
          for (var i3 = 0; i3 < symbolPropsCb.length; i3++) {
            var symbolPropName2 = symbolPropsCb[i3];
            data2.setItemVisual(idx, symbolPropName2, symbolOptionsCb[symbolPropName2](rawValue, params));
          }
        }
        return {
          dataEach: hasCallback ? dataEach : null
        };
      }
    };
    var dataSymbolTask = {
      createOnAllSeries: true,
      // For legend.
      performRawSeries: true,
      reset: function(seriesModel, ecModel) {
        if (!seriesModel.hasSymbolVisual) {
          return;
        }
        if (ecModel.isSeriesFiltered(seriesModel)) {
          return;
        }
        var data = seriesModel.getData();
        function dataEach(data2, idx) {
          var itemModel = data2.getItemModel(idx);
          for (var i2 = 0; i2 < SYMBOL_PROPS.length; i2++) {
            var symbolPropName = SYMBOL_PROPS[i2];
            var val = itemModel.getShallow(symbolPropName, true);
            if (val != null) {
              data2.setItemVisual(idx, symbolPropName, val);
            }
          }
        }
        return {
          dataEach: data.hasItemOption ? dataEach : null
        };
      }
    };
    function getItemVisualFromData(data, dataIndex, key) {
      switch (key) {
        case "color":
          var style = data.getItemVisual(dataIndex, "style");
          return style[data.getVisual("drawType")];
        case "opacity":
          return data.getItemVisual(dataIndex, "style").opacity;
        case "symbol":
        case "symbolSize":
        case "liftZ":
          return data.getItemVisual(dataIndex, key);
      }
    }
    function getVisualFromData(data, key) {
      switch (key) {
        case "color":
          var style = data.getVisual("style");
          return style[data.getVisual("drawType")];
        case "opacity":
          return data.getVisual("style").opacity;
        case "symbol":
        case "symbolSize":
        case "liftZ":
          return data.getVisual(key);
      }
    }
    function setItemVisualFromData(data, dataIndex, key, value) {
      switch (key) {
        case "color":
          var style = data.ensureUniqueItemVisual(dataIndex, "style");
          style[data.getVisual("drawType")] = value;
          data.setItemVisual(dataIndex, "colorFromPalette", false);
          break;
        case "opacity":
          data.ensureUniqueItemVisual(dataIndex, "style").opacity = value;
          break;
        case "symbol":
        case "symbolSize":
        case "liftZ":
          data.setItemVisual(dataIndex, key, value);
          break;
      }
    }
    function createLegacyDataSelectAction(seriesType2, ecRegisterAction) {
      function getSeriesIndices(ecModel, payload) {
        var seriesIndices = [];
        ecModel.eachComponent({
          mainType: "series",
          subType: seriesType2,
          query: payload
        }, function(seriesModel) {
          seriesIndices.push(seriesModel.seriesIndex);
        });
        return seriesIndices;
      }
      each$f([[seriesType2 + "ToggleSelect", "toggleSelect"], [seriesType2 + "Select", "select"], [seriesType2 + "UnSelect", "unselect"]], function(eventsMap) {
        ecRegisterAction(eventsMap[0], function(payload, ecModel, api2) {
          payload = extend$1({}, payload);
          api2.dispatchAction(extend$1(payload, {
            type: eventsMap[1],
            seriesIndex: getSeriesIndices(ecModel, payload)
          }));
        });
      });
    }
    function handleSeriesLegacySelectEvents(type, eventPostfix, ecIns, ecModel, payload) {
      var legacyEventName = type + eventPostfix;
      if (!ecIns.isSilent(legacyEventName)) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "pie"
        }, function(seriesModel) {
          var seriesIndex = seriesModel.seriesIndex;
          var selectedMap = seriesModel.option.selectedMap;
          var selected = payload.selected;
          for (var i2 = 0; i2 < selected.length; i2++) {
            if (selected[i2].seriesIndex === seriesIndex) {
              var data = seriesModel.getData();
              var dataIndex = queryDataIndex(data, payload.fromActionPayload);
              ecIns.trigger(legacyEventName, {
                type: legacyEventName,
                seriesId: seriesModel.id,
                name: isArray$2(dataIndex) ? data.getName(dataIndex[0]) : data.getName(dataIndex),
                selected: isString$1(selectedMap) ? selectedMap : extend$1({}, selectedMap)
              });
            }
          }
        });
      }
    }
    function handleLegacySelectEvents(messageCenter, ecIns, api2) {
      messageCenter.on("selectchanged", function(params) {
        var ecModel = api2.getModel();
        if (params.isFromClick) {
          handleSeriesLegacySelectEvents("map", "selectchanged", ecIns, ecModel, params);
          handleSeriesLegacySelectEvents("pie", "selectchanged", ecIns, ecModel, params);
        } else if (params.fromAction === "select") {
          handleSeriesLegacySelectEvents("map", "selected", ecIns, ecModel, params);
          handleSeriesLegacySelectEvents("pie", "selected", ecIns, ecModel, params);
        } else if (params.fromAction === "unselect") {
          handleSeriesLegacySelectEvents("map", "unselected", ecIns, ecModel, params);
          handleSeriesLegacySelectEvents("pie", "unselected", ecIns, ecModel, params);
        }
      });
    }
    function findEventDispatcher(target, det, returnFirstMatch) {
      var found;
      while (target) {
        if (det(target)) {
          found = target;
          if (returnFirstMatch) {
            break;
          }
        }
        target = target.__hostTarget || target.parent;
      }
      return found;
    }
    var wmUniqueIndex = Math.round(Math.random() * 9);
    var supportDefineProperty = typeof Object.defineProperty === "function";
    var WeakMap$1 = function() {
      function WeakMap2() {
        this._id = "__ec_inner_" + wmUniqueIndex++;
      }
      WeakMap2.prototype.get = function(key) {
        return this._guard(key)[this._id];
      };
      WeakMap2.prototype.set = function(key, value) {
        var target = this._guard(key);
        if (supportDefineProperty) {
          Object.defineProperty(target, this._id, {
            value,
            enumerable: false,
            configurable: true
          });
        } else {
          target[this._id] = value;
        }
        return this;
      };
      WeakMap2.prototype["delete"] = function(key) {
        if (this.has(key)) {
          delete this._guard(key)[this._id];
          return true;
        }
        return false;
      };
      WeakMap2.prototype.has = function(key) {
        return !!this._guard(key)[this._id];
      };
      WeakMap2.prototype._guard = function(key) {
        if (key !== Object(key)) {
          throw TypeError("Value of WeakMap is not a non-null object.");
        }
        return key;
      };
      return WeakMap2;
    }();
    var Triangle = Path.extend({
      type: "triangle",
      shape: {
        cx: 0,
        cy: 0,
        width: 0,
        height: 0
      },
      buildPath: function(path, shape) {
        var cx = shape.cx;
        var cy = shape.cy;
        var width = shape.width / 2;
        var height = shape.height / 2;
        path.moveTo(cx, cy - height);
        path.lineTo(cx + width, cy + height);
        path.lineTo(cx - width, cy + height);
        path.closePath();
      }
    });
    var Diamond = Path.extend({
      type: "diamond",
      shape: {
        cx: 0,
        cy: 0,
        width: 0,
        height: 0
      },
      buildPath: function(path, shape) {
        var cx = shape.cx;
        var cy = shape.cy;
        var width = shape.width / 2;
        var height = shape.height / 2;
        path.moveTo(cx, cy - height);
        path.lineTo(cx + width, cy);
        path.lineTo(cx, cy + height);
        path.lineTo(cx - width, cy);
        path.closePath();
      }
    });
    var Pin = Path.extend({
      type: "pin",
      shape: {
        // x, y on the cusp
        x: 0,
        y: 0,
        width: 0,
        height: 0
      },
      buildPath: function(path, shape) {
        var x2 = shape.x;
        var y = shape.y;
        var w2 = shape.width / 5 * 3;
        var h2 = Math.max(w2, shape.height);
        var r = w2 / 2;
        var dy = r * r / (h2 - r);
        var cy = y - h2 + r + dy;
        var angle2 = Math.asin(dy / r);
        var dx = Math.cos(angle2) * r;
        var tanX = Math.sin(angle2);
        var tanY = Math.cos(angle2);
        var cpLen = r * 0.6;
        var cpLen2 = r * 0.7;
        path.moveTo(x2 - dx, cy + dy);
        path.arc(x2, cy, r, Math.PI - angle2, Math.PI * 2 + angle2);
        path.bezierCurveTo(x2 + dx - tanX * cpLen, cy + dy + tanY * cpLen, x2, y - cpLen2, x2, y);
        path.bezierCurveTo(x2, y - cpLen2, x2 - dx + tanX * cpLen, cy + dy + tanY * cpLen, x2 - dx, cy + dy);
        path.closePath();
      }
    });
    var Arrow = Path.extend({
      type: "arrow",
      shape: {
        x: 0,
        y: 0,
        width: 0,
        height: 0
      },
      buildPath: function(ctx, shape) {
        var height = shape.height;
        var width = shape.width;
        var x2 = shape.x;
        var y = shape.y;
        var dx = width / 3 * 2;
        ctx.moveTo(x2, y);
        ctx.lineTo(x2 + dx, y + height);
        ctx.lineTo(x2, y + height / 4 * 3);
        ctx.lineTo(x2 - dx, y + height);
        ctx.lineTo(x2, y);
        ctx.closePath();
      }
    });
    var symbolCtors = {
      line: Line$1,
      rect: Rect$2,
      roundRect: Rect$2,
      square: Rect$2,
      circle: Circle,
      diamond: Diamond,
      pin: Pin,
      arrow: Arrow,
      triangle: Triangle
    };
    var symbolShapeMakers = {
      line: function(x2, y, w2, h2, shape) {
        shape.x1 = x2;
        shape.y1 = y + h2 / 2;
        shape.x2 = x2 + w2;
        shape.y2 = y + h2 / 2;
      },
      rect: function(x2, y, w2, h2, shape) {
        shape.x = x2;
        shape.y = y;
        shape.width = w2;
        shape.height = h2;
      },
      roundRect: function(x2, y, w2, h2, shape) {
        shape.x = x2;
        shape.y = y;
        shape.width = w2;
        shape.height = h2;
        shape.r = Math.min(w2, h2) / 4;
      },
      square: function(x2, y, w2, h2, shape) {
        var size = Math.min(w2, h2);
        shape.x = x2;
        shape.y = y;
        shape.width = size;
        shape.height = size;
      },
      circle: function(x2, y, w2, h2, shape) {
        shape.cx = x2 + w2 / 2;
        shape.cy = y + h2 / 2;
        shape.r = Math.min(w2, h2) / 2;
      },
      diamond: function(x2, y, w2, h2, shape) {
        shape.cx = x2 + w2 / 2;
        shape.cy = y + h2 / 2;
        shape.width = w2;
        shape.height = h2;
      },
      pin: function(x2, y, w2, h2, shape) {
        shape.x = x2 + w2 / 2;
        shape.y = y + h2 / 2;
        shape.width = w2;
        shape.height = h2;
      },
      arrow: function(x2, y, w2, h2, shape) {
        shape.x = x2 + w2 / 2;
        shape.y = y + h2 / 2;
        shape.width = w2;
        shape.height = h2;
      },
      triangle: function(x2, y, w2, h2, shape) {
        shape.cx = x2 + w2 / 2;
        shape.cy = y + h2 / 2;
        shape.width = w2;
        shape.height = h2;
      }
    };
    var symbolBuildProxies = {};
    each$f(symbolCtors, function(Ctor, name) {
      symbolBuildProxies[name] = new Ctor();
    });
    var SymbolClz = Path.extend({
      type: "symbol",
      shape: {
        symbolType: "",
        x: 0,
        y: 0,
        width: 0,
        height: 0
      },
      calculateTextPosition: function(out2, config, rect) {
        var res = calculateTextPosition(out2, config, rect);
        var shape = this.shape;
        if (shape && shape.symbolType === "pin" && config.position === "inside") {
          res.y = rect.y + rect.height * 0.4;
        }
        return res;
      },
      buildPath: function(ctx, shape, inBundle) {
        var symbolType = shape.symbolType;
        if (symbolType !== "none") {
          var proxySymbol = symbolBuildProxies[symbolType];
          if (!proxySymbol) {
            symbolType = "rect";
            proxySymbol = symbolBuildProxies[symbolType];
          }
          symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);
          proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);
        }
      }
    });
    function symbolPathSetColor(color2, innerColor2) {
      if (this.type !== "image") {
        var symbolStyle = this.style;
        if (this.__isEmptyBrush) {
          symbolStyle.stroke = color2;
          symbolStyle.fill = innerColor2 || "#fff";
          symbolStyle.lineWidth = 2;
        } else if (this.shape.symbolType === "line") {
          symbolStyle.stroke = color2;
        } else {
          symbolStyle.fill = color2;
        }
        this.markRedraw();
      }
    }
    function createSymbol$1(symbolType, x2, y, w2, h2, color2, keepAspect) {
      var isEmpty2 = symbolType.indexOf("empty") === 0;
      if (isEmpty2) {
        symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);
      }
      var symbolPath;
      if (symbolType.indexOf("image://") === 0) {
        symbolPath = makeImage(symbolType.slice(8), new BoundingRect(x2, y, w2, h2), keepAspect ? "center" : "cover");
      } else if (symbolType.indexOf("path://") === 0) {
        symbolPath = makePath(symbolType.slice(7), {}, new BoundingRect(x2, y, w2, h2), keepAspect ? "center" : "cover");
      } else {
        symbolPath = new SymbolClz({
          shape: {
            symbolType,
            x: x2,
            y,
            width: w2,
            height: h2
          }
        });
      }
      symbolPath.__isEmptyBrush = isEmpty2;
      symbolPath.setColor = symbolPathSetColor;
      if (color2) {
        symbolPath.setColor(color2);
      }
      return symbolPath;
    }
    function normalizeSymbolSize(symbolSize) {
      if (!isArray$2(symbolSize)) {
        symbolSize = [+symbolSize, +symbolSize];
      }
      return [symbolSize[0] || 0, symbolSize[1] || 0];
    }
    function normalizeSymbolOffset(symbolOffset, symbolSize) {
      if (symbolOffset == null) {
        return;
      }
      if (!isArray$2(symbolOffset)) {
        symbolOffset = [symbolOffset, symbolOffset];
      }
      return [parsePercent(symbolOffset[0], symbolSize[0]) || 0, parsePercent(retrieve2(symbolOffset[1], symbolOffset[0]), symbolSize[1]) || 0];
    }
    function isSafeNum(num) {
      return isFinite(num);
    }
    function createLinearGradient(ctx, obj, rect) {
      var x2 = obj.x == null ? 0 : obj.x;
      var x22 = obj.x2 == null ? 1 : obj.x2;
      var y = obj.y == null ? 0 : obj.y;
      var y2 = obj.y2 == null ? 0 : obj.y2;
      if (!obj.global) {
        x2 = x2 * rect.width + rect.x;
        x22 = x22 * rect.width + rect.x;
        y = y * rect.height + rect.y;
        y2 = y2 * rect.height + rect.y;
      }
      x2 = isSafeNum(x2) ? x2 : 0;
      x22 = isSafeNum(x22) ? x22 : 1;
      y = isSafeNum(y) ? y : 0;
      y2 = isSafeNum(y2) ? y2 : 0;
      var canvasGradient = ctx.createLinearGradient(x2, y, x22, y2);
      return canvasGradient;
    }
    function createRadialGradient(ctx, obj, rect) {
      var width = rect.width;
      var height = rect.height;
      var min3 = Math.min(width, height);
      var x2 = obj.x == null ? 0.5 : obj.x;
      var y = obj.y == null ? 0.5 : obj.y;
      var r = obj.r == null ? 0.5 : obj.r;
      if (!obj.global) {
        x2 = x2 * width + rect.x;
        y = y * height + rect.y;
        r = r * min3;
      }
      x2 = isSafeNum(x2) ? x2 : 0.5;
      y = isSafeNum(y) ? y : 0.5;
      r = r >= 0 && isSafeNum(r) ? r : 0.5;
      var canvasGradient = ctx.createRadialGradient(x2, y, 0, x2, y, r);
      return canvasGradient;
    }
    function getCanvasGradient(ctx, obj, rect) {
      var canvasGradient = obj.type === "radial" ? createRadialGradient(ctx, obj, rect) : createLinearGradient(ctx, obj, rect);
      var colorStops = obj.colorStops;
      for (var i2 = 0; i2 < colorStops.length; i2++) {
        canvasGradient.addColorStop(colorStops[i2].offset, colorStops[i2].color);
      }
      return canvasGradient;
    }
    function isClipPathChanged(clipPaths, prevClipPaths) {
      if (clipPaths === prevClipPaths || !clipPaths && !prevClipPaths) {
        return false;
      }
      if (!clipPaths || !prevClipPaths || clipPaths.length !== prevClipPaths.length) {
        return true;
      }
      for (var i2 = 0; i2 < clipPaths.length; i2++) {
        if (clipPaths[i2] !== prevClipPaths[i2]) {
          return true;
        }
      }
      return false;
    }
    function parseInt10(val) {
      return parseInt(val, 10);
    }
    function getSize$1(root2, whIdx, opts) {
      var wh = ["width", "height"][whIdx];
      var cwh = ["clientWidth", "clientHeight"][whIdx];
      var plt = ["paddingLeft", "paddingTop"][whIdx];
      var prb = ["paddingRight", "paddingBottom"][whIdx];
      if (opts[wh] != null && opts[wh] !== "auto") {
        return parseFloat(opts[wh]);
      }
      var stl = document.defaultView.getComputedStyle(root2);
      return (root2[cwh] || parseInt10(stl[wh]) || parseInt10(root2.style[wh])) - (parseInt10(stl[plt]) || 0) - (parseInt10(stl[prb]) || 0) | 0;
    }
    function normalizeLineDash(lineType, lineWidth) {
      if (!lineType || lineType === "solid" || !(lineWidth > 0)) {
        return null;
      }
      return lineType === "dashed" ? [4 * lineWidth, 2 * lineWidth] : lineType === "dotted" ? [lineWidth] : isNumber$1(lineType) ? [lineType] : isArray$2(lineType) ? lineType : null;
    }
    function getLineDash(el) {
      var style = el.style;
      var lineDash = style.lineDash && style.lineWidth > 0 && normalizeLineDash(style.lineDash, style.lineWidth);
      var lineDashOffset = style.lineDashOffset;
      if (lineDash) {
        var lineScale_1 = style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1;
        if (lineScale_1 && lineScale_1 !== 1) {
          lineDash = map$1(lineDash, function(rawVal) {
            return rawVal / lineScale_1;
          });
          lineDashOffset /= lineScale_1;
        }
      }
      return [lineDash, lineDashOffset];
    }
    var pathProxyForDraw = new PathProxy(true);
    function styleHasStroke(style) {
      var stroke = style.stroke;
      return !(stroke == null || stroke === "none" || !(style.lineWidth > 0));
    }
    function isValidStrokeFillStyle(strokeOrFill) {
      return typeof strokeOrFill === "string" && strokeOrFill !== "none";
    }
    function styleHasFill(style) {
      var fill2 = style.fill;
      return fill2 != null && fill2 !== "none";
    }
    function doFillPath(ctx, style) {
      if (style.fillOpacity != null && style.fillOpacity !== 1) {
        var originalGlobalAlpha = ctx.globalAlpha;
        ctx.globalAlpha = style.fillOpacity * style.opacity;
        ctx.fill();
        ctx.globalAlpha = originalGlobalAlpha;
      } else {
        ctx.fill();
      }
    }
    function doStrokePath(ctx, style) {
      if (style.strokeOpacity != null && style.strokeOpacity !== 1) {
        var originalGlobalAlpha = ctx.globalAlpha;
        ctx.globalAlpha = style.strokeOpacity * style.opacity;
        ctx.stroke();
        ctx.globalAlpha = originalGlobalAlpha;
      } else {
        ctx.stroke();
      }
    }
    function createCanvasPattern(ctx, pattern, el) {
      var image2 = createOrUpdateImage(pattern.image, pattern.__image, el);
      if (isImageReady(image2)) {
        var canvasPattern = ctx.createPattern(image2, pattern.repeat || "repeat");
        if (typeof DOMMatrix === "function" && canvasPattern && canvasPattern.setTransform) {
          var matrix2 = new DOMMatrix();
          matrix2.translateSelf(pattern.x || 0, pattern.y || 0);
          matrix2.rotateSelf(0, 0, (pattern.rotation || 0) * RADIAN_TO_DEGREE);
          matrix2.scaleSelf(pattern.scaleX || 1, pattern.scaleY || 1);
          canvasPattern.setTransform(matrix2);
        }
        return canvasPattern;
      }
    }
    function brushPath(ctx, el, style, inBatch) {
      var _a2;
      var hasStroke = styleHasStroke(style);
      var hasFill = styleHasFill(style);
      var strokePercent = style.strokePercent;
      var strokePart = strokePercent < 1;
      var firstDraw = !el.path;
      if ((!el.silent || strokePart) && firstDraw) {
        el.createPathProxy();
      }
      var path = el.path || pathProxyForDraw;
      var dirtyFlag = el.__dirty;
      if (!inBatch) {
        var fill2 = style.fill;
        var stroke = style.stroke;
        var hasFillGradient = hasFill && !!fill2.colorStops;
        var hasStrokeGradient = hasStroke && !!stroke.colorStops;
        var hasFillPattern = hasFill && !!fill2.image;
        var hasStrokePattern = hasStroke && !!stroke.image;
        var fillGradient = void 0;
        var strokeGradient = void 0;
        var fillPattern = void 0;
        var strokePattern = void 0;
        var rect = void 0;
        if (hasFillGradient || hasStrokeGradient) {
          rect = el.getBoundingRect();
        }
        if (hasFillGradient) {
          fillGradient = dirtyFlag ? getCanvasGradient(ctx, fill2, rect) : el.__canvasFillGradient;
          el.__canvasFillGradient = fillGradient;
        }
        if (hasStrokeGradient) {
          strokeGradient = dirtyFlag ? getCanvasGradient(ctx, stroke, rect) : el.__canvasStrokeGradient;
          el.__canvasStrokeGradient = strokeGradient;
        }
        if (hasFillPattern) {
          fillPattern = dirtyFlag || !el.__canvasFillPattern ? createCanvasPattern(ctx, fill2, el) : el.__canvasFillPattern;
          el.__canvasFillPattern = fillPattern;
        }
        if (hasStrokePattern) {
          strokePattern = dirtyFlag || !el.__canvasStrokePattern ? createCanvasPattern(ctx, stroke, el) : el.__canvasStrokePattern;
          el.__canvasStrokePattern = fillPattern;
        }
        if (hasFillGradient) {
          ctx.fillStyle = fillGradient;
        } else if (hasFillPattern) {
          if (fillPattern) {
            ctx.fillStyle = fillPattern;
          } else {
            hasFill = false;
          }
        }
        if (hasStrokeGradient) {
          ctx.strokeStyle = strokeGradient;
        } else if (hasStrokePattern) {
          if (strokePattern) {
            ctx.strokeStyle = strokePattern;
          } else {
            hasStroke = false;
          }
        }
      }
      var scale2 = el.getGlobalScale();
      path.setScale(scale2[0], scale2[1], el.segmentIgnoreThreshold);
      var lineDash;
      var lineDashOffset;
      if (ctx.setLineDash && style.lineDash) {
        _a2 = getLineDash(el), lineDash = _a2[0], lineDashOffset = _a2[1];
      }
      var needsRebuild = true;
      if (firstDraw || dirtyFlag & SHAPE_CHANGED_BIT) {
        path.setDPR(ctx.dpr);
        if (strokePart) {
          path.setContext(null);
        } else {
          path.setContext(ctx);
          needsRebuild = false;
        }
        path.reset();
        el.buildPath(path, el.shape, inBatch);
        path.toStatic();
        el.pathUpdated();
      }
      if (needsRebuild) {
        path.rebuildPath(ctx, strokePart ? strokePercent : 1);
      }
      if (lineDash) {
        ctx.setLineDash(lineDash);
        ctx.lineDashOffset = lineDashOffset;
      }
      if (!inBatch) {
        if (style.strokeFirst) {
          if (hasStroke) {
            doStrokePath(ctx, style);
          }
          if (hasFill) {
            doFillPath(ctx, style);
          }
        } else {
          if (hasFill) {
            doFillPath(ctx, style);
          }
          if (hasStroke) {
            doStrokePath(ctx, style);
          }
        }
      }
      if (lineDash) {
        ctx.setLineDash([]);
      }
    }
    function brushImage(ctx, el, style) {
      var image2 = el.__image = createOrUpdateImage(style.image, el.__image, el, el.onload);
      if (!image2 || !isImageReady(image2)) {
        return;
      }
      var x2 = style.x || 0;
      var y = style.y || 0;
      var width = el.getWidth();
      var height = el.getHeight();
      var aspect = image2.width / image2.height;
      if (width == null && height != null) {
        width = height * aspect;
      } else if (height == null && width != null) {
        height = width / aspect;
      } else if (width == null && height == null) {
        width = image2.width;
        height = image2.height;
      }
      if (style.sWidth && style.sHeight) {
        var sx = style.sx || 0;
        var sy = style.sy || 0;
        ctx.drawImage(image2, sx, sy, style.sWidth, style.sHeight, x2, y, width, height);
      } else if (style.sx && style.sy) {
        var sx = style.sx;
        var sy = style.sy;
        var sWidth = width - sx;
        var sHeight = height - sy;
        ctx.drawImage(image2, sx, sy, sWidth, sHeight, x2, y, width, height);
      } else {
        ctx.drawImage(image2, x2, y, width, height);
      }
    }
    function brushText(ctx, el, style) {
      var _a2;
      var text = style.text;
      text != null && (text += "");
      if (text) {
        ctx.font = style.font || DEFAULT_FONT;
        ctx.textAlign = style.textAlign;
        ctx.textBaseline = style.textBaseline;
        var lineDash = void 0;
        var lineDashOffset = void 0;
        if (ctx.setLineDash && style.lineDash) {
          _a2 = getLineDash(el), lineDash = _a2[0], lineDashOffset = _a2[1];
        }
        if (lineDash) {
          ctx.setLineDash(lineDash);
          ctx.lineDashOffset = lineDashOffset;
        }
        if (style.strokeFirst) {
          if (styleHasStroke(style)) {
            ctx.strokeText(text, style.x, style.y);
          }
          if (styleHasFill(style)) {
            ctx.fillText(text, style.x, style.y);
          }
        } else {
          if (styleHasFill(style)) {
            ctx.fillText(text, style.x, style.y);
          }
          if (styleHasStroke(style)) {
            ctx.strokeText(text, style.x, style.y);
          }
        }
        if (lineDash) {
          ctx.setLineDash([]);
        }
      }
    }
    var SHADOW_NUMBER_PROPS = ["shadowBlur", "shadowOffsetX", "shadowOffsetY"];
    var STROKE_PROPS = [
      ["lineCap", "butt"],
      ["lineJoin", "miter"],
      ["miterLimit", 10]
    ];
    function bindCommonProps(ctx, style, prevStyle, forceSetAll, scope) {
      var styleChanged = false;
      if (!forceSetAll) {
        prevStyle = prevStyle || {};
        if (style === prevStyle) {
          return false;
        }
      }
      if (forceSetAll || style.opacity !== prevStyle.opacity) {
        flushPathDrawn(ctx, scope);
        styleChanged = true;
        var opacity2 = Math.max(Math.min(style.opacity, 1), 0);
        ctx.globalAlpha = isNaN(opacity2) ? DEFAULT_COMMON_STYLE.opacity : opacity2;
      }
      if (forceSetAll || style.blend !== prevStyle.blend) {
        if (!styleChanged) {
          flushPathDrawn(ctx, scope);
          styleChanged = true;
        }
        ctx.globalCompositeOperation = style.blend || DEFAULT_COMMON_STYLE.blend;
      }
      for (var i2 = 0; i2 < SHADOW_NUMBER_PROPS.length; i2++) {
        var propName = SHADOW_NUMBER_PROPS[i2];
        if (forceSetAll || style[propName] !== prevStyle[propName]) {
          if (!styleChanged) {
            flushPathDrawn(ctx, scope);
            styleChanged = true;
          }
          ctx[propName] = ctx.dpr * (style[propName] || 0);
        }
      }
      if (forceSetAll || style.shadowColor !== prevStyle.shadowColor) {
        if (!styleChanged) {
          flushPathDrawn(ctx, scope);
          styleChanged = true;
        }
        ctx.shadowColor = style.shadowColor || DEFAULT_COMMON_STYLE.shadowColor;
      }
      return styleChanged;
    }
    function bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetAll, scope) {
      var style = getStyle(el, scope.inHover);
      var prevStyle = forceSetAll ? null : prevEl && getStyle(prevEl, scope.inHover) || {};
      if (style === prevStyle) {
        return false;
      }
      var styleChanged = bindCommonProps(ctx, style, prevStyle, forceSetAll, scope);
      if (forceSetAll || style.fill !== prevStyle.fill) {
        if (!styleChanged) {
          flushPathDrawn(ctx, scope);
          styleChanged = true;
        }
        isValidStrokeFillStyle(style.fill) && (ctx.fillStyle = style.fill);
      }
      if (forceSetAll || style.stroke !== prevStyle.stroke) {
        if (!styleChanged) {
          flushPathDrawn(ctx, scope);
          styleChanged = true;
        }
        isValidStrokeFillStyle(style.stroke) && (ctx.strokeStyle = style.stroke);
      }
      if (forceSetAll || style.opacity !== prevStyle.opacity) {
        if (!styleChanged) {
          flushPathDrawn(ctx, scope);
          styleChanged = true;
        }
        ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;
      }
      if (el.hasStroke()) {
        var lineWidth = style.lineWidth;
        var newLineWidth = lineWidth / (style.strokeNoScale && el.getLineScale ? el.getLineScale() : 1);
        if (ctx.lineWidth !== newLineWidth) {
          if (!styleChanged) {
            flushPathDrawn(ctx, scope);
            styleChanged = true;
          }
          ctx.lineWidth = newLineWidth;
        }
      }
      for (var i2 = 0; i2 < STROKE_PROPS.length; i2++) {
        var prop = STROKE_PROPS[i2];
        var propName = prop[0];
        if (forceSetAll || style[propName] !== prevStyle[propName]) {
          if (!styleChanged) {
            flushPathDrawn(ctx, scope);
            styleChanged = true;
          }
          ctx[propName] = style[propName] || prop[1];
        }
      }
      return styleChanged;
    }
    function bindImageStyle(ctx, el, prevEl, forceSetAll, scope) {
      return bindCommonProps(ctx, getStyle(el, scope.inHover), prevEl && getStyle(prevEl, scope.inHover), forceSetAll, scope);
    }
    function setContextTransform(ctx, el) {
      var m2 = el.transform;
      var dpr2 = ctx.dpr || 1;
      if (m2) {
        ctx.setTransform(dpr2 * m2[0], dpr2 * m2[1], dpr2 * m2[2], dpr2 * m2[3], dpr2 * m2[4], dpr2 * m2[5]);
      } else {
        ctx.setTransform(dpr2, 0, 0, dpr2, 0, 0);
      }
    }
    function updateClipStatus(clipPaths, ctx, scope) {
      var allClipped = false;
      for (var i2 = 0; i2 < clipPaths.length; i2++) {
        var clipPath = clipPaths[i2];
        allClipped = allClipped || clipPath.isZeroArea();
        setContextTransform(ctx, clipPath);
        ctx.beginPath();
        clipPath.buildPath(ctx, clipPath.shape);
        ctx.clip();
      }
      scope.allClipped = allClipped;
    }
    function isTransformChanged(m0, m1) {
      if (m0 && m1) {
        return m0[0] !== m1[0] || m0[1] !== m1[1] || m0[2] !== m1[2] || m0[3] !== m1[3] || m0[4] !== m1[4] || m0[5] !== m1[5];
      } else if (!m0 && !m1) {
        return false;
      }
      return true;
    }
    var DRAW_TYPE_PATH = 1;
    var DRAW_TYPE_IMAGE = 2;
    var DRAW_TYPE_TEXT = 3;
    var DRAW_TYPE_INCREMENTAL = 4;
    function canPathBatch(style) {
      var hasFill = styleHasFill(style);
      var hasStroke = styleHasStroke(style);
      return !(style.lineDash || !(+hasFill ^ +hasStroke) || hasFill && typeof style.fill !== "string" || hasStroke && typeof style.stroke !== "string" || style.strokePercent < 1 || style.strokeOpacity < 1 || style.fillOpacity < 1);
    }
    function flushPathDrawn(ctx, scope) {
      scope.batchFill && ctx.fill();
      scope.batchStroke && ctx.stroke();
      scope.batchFill = "";
      scope.batchStroke = "";
    }
    function getStyle(el, inHover) {
      return inHover ? el.__hoverStyle || el.style : el.style;
    }
    function brushSingle(ctx, el) {
      brush$1(ctx, el, { inHover: false, viewWidth: 0, viewHeight: 0 }, true);
    }
    function brush$1(ctx, el, scope, isLast) {
      var m2 = el.transform;
      if (!el.shouldBePainted(scope.viewWidth, scope.viewHeight, false, false)) {
        el.__dirty &= -2;
        el.__isRendered = false;
        return;
      }
      var clipPaths = el.__clipPaths;
      var prevElClipPaths = scope.prevElClipPaths;
      var forceSetTransform = false;
      var forceSetStyle = false;
      if (!prevElClipPaths || isClipPathChanged(clipPaths, prevElClipPaths)) {
        if (prevElClipPaths && prevElClipPaths.length) {
          flushPathDrawn(ctx, scope);
          ctx.restore();
          forceSetStyle = forceSetTransform = true;
          scope.prevElClipPaths = null;
          scope.allClipped = false;
          scope.prevEl = null;
        }
        if (clipPaths && clipPaths.length) {
          flushPathDrawn(ctx, scope);
          ctx.save();
          updateClipStatus(clipPaths, ctx, scope);
          forceSetTransform = true;
        }
        scope.prevElClipPaths = clipPaths;
      }
      if (scope.allClipped) {
        el.__isRendered = false;
        return;
      }
      el.beforeBrush && el.beforeBrush();
      el.innerBeforeBrush();
      var prevEl = scope.prevEl;
      if (!prevEl) {
        forceSetStyle = forceSetTransform = true;
      }
      var canBatchPath = el instanceof Path && el.autoBatch && canPathBatch(el.style);
      if (forceSetTransform || isTransformChanged(m2, prevEl.transform)) {
        flushPathDrawn(ctx, scope);
        setContextTransform(ctx, el);
      } else if (!canBatchPath) {
        flushPathDrawn(ctx, scope);
      }
      var style = getStyle(el, scope.inHover);
      if (el instanceof Path) {
        if (scope.lastDrawType !== DRAW_TYPE_PATH) {
          forceSetStyle = true;
          scope.lastDrawType = DRAW_TYPE_PATH;
        }
        bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);
        if (!canBatchPath || !scope.batchFill && !scope.batchStroke) {
          ctx.beginPath();
        }
        brushPath(ctx, el, style, canBatchPath);
        if (canBatchPath) {
          scope.batchFill = style.fill || "";
          scope.batchStroke = style.stroke || "";
        }
      } else {
        if (el instanceof TSpan) {
          if (scope.lastDrawType !== DRAW_TYPE_TEXT) {
            forceSetStyle = true;
            scope.lastDrawType = DRAW_TYPE_TEXT;
          }
          bindPathAndTextCommonStyle(ctx, el, prevEl, forceSetStyle, scope);
          brushText(ctx, el, style);
        } else if (el instanceof ZRImage) {
          if (scope.lastDrawType !== DRAW_TYPE_IMAGE) {
            forceSetStyle = true;
            scope.lastDrawType = DRAW_TYPE_IMAGE;
          }
          bindImageStyle(ctx, el, prevEl, forceSetStyle, scope);
          brushImage(ctx, el, style);
        } else if (el.getTemporalDisplayables) {
          if (scope.lastDrawType !== DRAW_TYPE_INCREMENTAL) {
            forceSetStyle = true;
            scope.lastDrawType = DRAW_TYPE_INCREMENTAL;
          }
          brushIncremental(ctx, el, scope);
        }
      }
      if (canBatchPath && isLast) {
        flushPathDrawn(ctx, scope);
      }
      el.innerAfterBrush();
      el.afterBrush && el.afterBrush();
      scope.prevEl = el;
      el.__dirty = 0;
      el.__isRendered = true;
    }
    function brushIncremental(ctx, el, scope) {
      var displayables = el.getDisplayables();
      var temporalDisplayables = el.getTemporalDisplayables();
      ctx.save();
      var innerScope = {
        prevElClipPaths: null,
        prevEl: null,
        allClipped: false,
        viewWidth: scope.viewWidth,
        viewHeight: scope.viewHeight,
        inHover: scope.inHover
      };
      var i2;
      var len2;
      for (i2 = el.getCursor(), len2 = displayables.length; i2 < len2; i2++) {
        var displayable = displayables[i2];
        displayable.beforeBrush && displayable.beforeBrush();
        displayable.innerBeforeBrush();
        brush$1(ctx, displayable, innerScope, i2 === len2 - 1);
        displayable.innerAfterBrush();
        displayable.afterBrush && displayable.afterBrush();
        innerScope.prevEl = displayable;
      }
      for (var i_1 = 0, len_1 = temporalDisplayables.length; i_1 < len_1; i_1++) {
        var displayable = temporalDisplayables[i_1];
        displayable.beforeBrush && displayable.beforeBrush();
        displayable.innerBeforeBrush();
        brush$1(ctx, displayable, innerScope, i_1 === len_1 - 1);
        displayable.innerAfterBrush();
        displayable.afterBrush && displayable.afterBrush();
        innerScope.prevEl = displayable;
      }
      el.clearTemporalDisplayables();
      el.notClear = true;
      ctx.restore();
    }
    var decalMap = new WeakMap$1();
    var decalCache = new LRU(100);
    var decalKeys = ["symbol", "symbolSize", "symbolKeepAspect", "color", "backgroundColor", "dashArrayX", "dashArrayY", "maxTileWidth", "maxTileHeight"];
    function createOrUpdatePatternFromDecal(decalObject, api2) {
      if (decalObject === "none") {
        return null;
      }
      var dpr2 = api2.getDevicePixelRatio();
      var zr = api2.getZr();
      var isSVG2 = zr.painter.type === "svg";
      if (decalObject.dirty) {
        decalMap["delete"](decalObject);
      }
      var oldPattern = decalMap.get(decalObject);
      if (oldPattern) {
        return oldPattern;
      }
      var decalOpt = defaults$1(decalObject, {
        symbol: "rect",
        symbolSize: 1,
        symbolKeepAspect: true,
        color: "rgba(0, 0, 0, 0.2)",
        backgroundColor: null,
        dashArrayX: 5,
        dashArrayY: 5,
        rotation: 0,
        maxTileWidth: 512,
        maxTileHeight: 512
      });
      if (decalOpt.backgroundColor === "none") {
        decalOpt.backgroundColor = null;
      }
      var pattern = {
        repeat: "repeat"
      };
      setPatternnSource(pattern);
      pattern.rotation = decalOpt.rotation;
      pattern.scaleX = pattern.scaleY = isSVG2 ? 1 : 1 / dpr2;
      decalMap.set(decalObject, pattern);
      decalObject.dirty = false;
      return pattern;
      function setPatternnSource(pattern22) {
        var keys2 = [dpr2];
        var isValidKey = true;
        for (var i2 = 0; i2 < decalKeys.length; ++i2) {
          var value = decalOpt[decalKeys[i2]];
          if (value != null && !isArray$2(value) && !isString$1(value) && !isNumber$1(value) && typeof value !== "boolean") {
            isValidKey = false;
            break;
          }
          keys2.push(value);
        }
        var cacheKey;
        if (isValidKey) {
          cacheKey = keys2.join(",") + (isSVG2 ? "-svg" : "");
          var cache2 = decalCache.get(cacheKey);
          if (cache2) {
            isSVG2 ? pattern22.svgElement = cache2 : pattern22.image = cache2;
          }
        }
        var dashArrayX = normalizeDashArrayX(decalOpt.dashArrayX);
        var dashArrayY = normalizeDashArrayY(decalOpt.dashArrayY);
        var symbolArray = normalizeSymbolArray(decalOpt.symbol);
        var lineBlockLengthsX = getLineBlockLengthX(dashArrayX);
        var lineBlockLengthY = getLineBlockLengthY(dashArrayY);
        var canvas = !isSVG2 && platformApi.createCanvas();
        var svgRoot = isSVG2 && {
          tag: "g",
          attrs: {},
          key: "dcl",
          children: []
        };
        var pSize = getPatternSize();
        var ctx;
        if (canvas) {
          canvas.width = pSize.width * dpr2;
          canvas.height = pSize.height * dpr2;
          ctx = canvas.getContext("2d");
        }
        brushDecal();
        if (isValidKey) {
          decalCache.put(cacheKey, canvas || svgRoot);
        }
        pattern22.image = canvas;
        pattern22.svgElement = svgRoot;
        pattern22.svgWidth = pSize.width;
        pattern22.svgHeight = pSize.height;
        function getPatternSize() {
          var width = 1;
          for (var i22 = 0, xlen = lineBlockLengthsX.length; i22 < xlen; ++i22) {
            width = getLeastCommonMultiple(width, lineBlockLengthsX[i22]);
          }
          var symbolRepeats = 1;
          for (var i22 = 0, xlen = symbolArray.length; i22 < xlen; ++i22) {
            symbolRepeats = getLeastCommonMultiple(symbolRepeats, symbolArray[i22].length);
          }
          width *= symbolRepeats;
          var height = lineBlockLengthY * lineBlockLengthsX.length * symbolArray.length;
          return {
            width: Math.max(1, Math.min(width, decalOpt.maxTileWidth)),
            height: Math.max(1, Math.min(height, decalOpt.maxTileHeight))
          };
        }
        function brushDecal() {
          if (ctx) {
            ctx.clearRect(0, 0, canvas.width, canvas.height);
            if (decalOpt.backgroundColor) {
              ctx.fillStyle = decalOpt.backgroundColor;
              ctx.fillRect(0, 0, canvas.width, canvas.height);
            }
          }
          var ySum = 0;
          for (var i22 = 0; i22 < dashArrayY.length; ++i22) {
            ySum += dashArrayY[i22];
          }
          if (ySum <= 0) {
            return;
          }
          var y = -lineBlockLengthY;
          var yId = 0;
          var yIdTotal = 0;
          var xId0 = 0;
          while (y < pSize.height) {
            if (yId % 2 === 0) {
              var symbolYId = yIdTotal / 2 % symbolArray.length;
              var x2 = 0;
              var xId1 = 0;
              var xId1Total = 0;
              while (x2 < pSize.width * 2) {
                var xSum = 0;
                for (var i22 = 0; i22 < dashArrayX[xId0].length; ++i22) {
                  xSum += dashArrayX[xId0][i22];
                }
                if (xSum <= 0) {
                  break;
                }
                if (xId1 % 2 === 0) {
                  var size = (1 - decalOpt.symbolSize) * 0.5;
                  var left = x2 + dashArrayX[xId0][xId1] * size;
                  var top_1 = y + dashArrayY[yId] * size;
                  var width = dashArrayX[xId0][xId1] * decalOpt.symbolSize;
                  var height = dashArrayY[yId] * decalOpt.symbolSize;
                  var symbolXId = xId1Total / 2 % symbolArray[symbolYId].length;
                  brushSymbol(left, top_1, width, height, symbolArray[symbolYId][symbolXId]);
                }
                x2 += dashArrayX[xId0][xId1];
                ++xId1Total;
                ++xId1;
                if (xId1 === dashArrayX[xId0].length) {
                  xId1 = 0;
                }
              }
              ++xId0;
              if (xId0 === dashArrayX.length) {
                xId0 = 0;
              }
            }
            y += dashArrayY[yId];
            ++yIdTotal;
            ++yId;
            if (yId === dashArrayY.length) {
              yId = 0;
            }
          }
          function brushSymbol(x22, y2, width2, height2, symbolType) {
            var scale2 = isSVG2 ? 1 : dpr2;
            var symbol = createSymbol$1(symbolType, x22 * scale2, y2 * scale2, width2 * scale2, height2 * scale2, decalOpt.color, decalOpt.symbolKeepAspect);
            if (isSVG2) {
              var symbolVNode = zr.painter.renderOneToVNode(symbol);
              if (symbolVNode) {
                svgRoot.children.push(symbolVNode);
              }
            } else {
              brushSingle(ctx, symbol);
            }
          }
        }
      }
    }
    function normalizeSymbolArray(symbol) {
      if (!symbol || symbol.length === 0) {
        return [["rect"]];
      }
      if (isString$1(symbol)) {
        return [[symbol]];
      }
      var isAllString = true;
      for (var i2 = 0; i2 < symbol.length; ++i2) {
        if (!isString$1(symbol[i2])) {
          isAllString = false;
          break;
        }
      }
      if (isAllString) {
        return normalizeSymbolArray([symbol]);
      }
      var result = [];
      for (var i2 = 0; i2 < symbol.length; ++i2) {
        if (isString$1(symbol[i2])) {
          result.push([symbol[i2]]);
        } else {
          result.push(symbol[i2]);
        }
      }
      return result;
    }
    function normalizeDashArrayX(dash) {
      if (!dash || dash.length === 0) {
        return [[0, 0]];
      }
      if (isNumber$1(dash)) {
        var dashValue = Math.ceil(dash);
        return [[dashValue, dashValue]];
      }
      var isAllNumber = true;
      for (var i2 = 0; i2 < dash.length; ++i2) {
        if (!isNumber$1(dash[i2])) {
          isAllNumber = false;
          break;
        }
      }
      if (isAllNumber) {
        return normalizeDashArrayX([dash]);
      }
      var result = [];
      for (var i2 = 0; i2 < dash.length; ++i2) {
        if (isNumber$1(dash[i2])) {
          var dashValue = Math.ceil(dash[i2]);
          result.push([dashValue, dashValue]);
        } else {
          var dashValue = map$1(dash[i2], function(n) {
            return Math.ceil(n);
          });
          if (dashValue.length % 2 === 1) {
            result.push(dashValue.concat(dashValue));
          } else {
            result.push(dashValue);
          }
        }
      }
      return result;
    }
    function normalizeDashArrayY(dash) {
      if (!dash || typeof dash === "object" && dash.length === 0) {
        return [0, 0];
      }
      if (isNumber$1(dash)) {
        var dashValue_1 = Math.ceil(dash);
        return [dashValue_1, dashValue_1];
      }
      var dashValue = map$1(dash, function(n) {
        return Math.ceil(n);
      });
      return dash.length % 2 ? dashValue.concat(dashValue) : dashValue;
    }
    function getLineBlockLengthX(dash) {
      return map$1(dash, function(line) {
        return getLineBlockLengthY(line);
      });
    }
    function getLineBlockLengthY(dash) {
      var blockLength = 0;
      for (var i2 = 0; i2 < dash.length; ++i2) {
        blockLength += dash[i2];
      }
      if (dash.length % 2 === 1) {
        return blockLength * 2;
      }
      return blockLength;
    }
    function decalVisual(ecModel, api2) {
      ecModel.eachRawSeries(function(seriesModel) {
        if (ecModel.isSeriesFiltered(seriesModel)) {
          return;
        }
        var data = seriesModel.getData();
        if (data.hasItemVisual()) {
          data.each(function(idx) {
            var decal2 = data.getItemVisual(idx, "decal");
            if (decal2) {
              var itemStyle = data.ensureUniqueItemVisual(idx, "style");
              itemStyle.decal = createOrUpdatePatternFromDecal(decal2, api2);
            }
          });
        }
        var decal = data.getVisual("decal");
        if (decal) {
          var style = data.getVisual("style");
          style.decal = createOrUpdatePatternFromDecal(decal, api2);
        }
      });
    }
    var lifecycle = new Eventful();
    var implsStore = {};
    function registerImpl(name, impl) {
      implsStore[name] = impl;
    }
    function getImpl(name) {
      return implsStore[name];
    }
    var TEST_FRAME_REMAIN_TIME = 1;
    var PRIORITY_PROCESSOR_SERIES_FILTER = 800;
    var PRIORITY_PROCESSOR_DATASTACK = 900;
    var PRIORITY_PROCESSOR_FILTER = 1e3;
    var PRIORITY_PROCESSOR_DEFAULT = 2e3;
    var PRIORITY_PROCESSOR_STATISTIC = 5e3;
    var PRIORITY_VISUAL_LAYOUT = 1e3;
    var PRIORITY_VISUAL_PROGRESSIVE_LAYOUT = 1100;
    var PRIORITY_VISUAL_GLOBAL = 2e3;
    var PRIORITY_VISUAL_CHART = 3e3;
    var PRIORITY_VISUAL_COMPONENT = 4e3;
    var PRIORITY_VISUAL_CHART_DATA_CUSTOM = 4500;
    var PRIORITY_VISUAL_POST_CHART_LAYOUT = 4600;
    var PRIORITY_VISUAL_BRUSH = 5e3;
    var PRIORITY_VISUAL_ARIA = 6e3;
    var PRIORITY_VISUAL_DECAL = 7e3;
    var PRIORITY = {
      PROCESSOR: {
        FILTER: PRIORITY_PROCESSOR_FILTER,
        SERIES_FILTER: PRIORITY_PROCESSOR_SERIES_FILTER,
        STATISTIC: PRIORITY_PROCESSOR_STATISTIC
      },
      VISUAL: {
        LAYOUT: PRIORITY_VISUAL_LAYOUT,
        PROGRESSIVE_LAYOUT: PRIORITY_VISUAL_PROGRESSIVE_LAYOUT,
        GLOBAL: PRIORITY_VISUAL_GLOBAL,
        CHART: PRIORITY_VISUAL_CHART,
        POST_CHART_LAYOUT: PRIORITY_VISUAL_POST_CHART_LAYOUT,
        COMPONENT: PRIORITY_VISUAL_COMPONENT,
        BRUSH: PRIORITY_VISUAL_BRUSH,
        CHART_ITEM: PRIORITY_VISUAL_CHART_DATA_CUSTOM,
        ARIA: PRIORITY_VISUAL_ARIA,
        DECAL: PRIORITY_VISUAL_DECAL
      }
    };
    var IN_MAIN_PROCESS_KEY = "__flagInMainProcess";
    var PENDING_UPDATE = "__pendingUpdate";
    var STATUS_NEEDS_UPDATE_KEY = "__needsUpdateStatus";
    var ACTION_REG = /^[a-zA-Z0-9_]+$/;
    var CONNECT_STATUS_KEY = "__connectUpdateStatus";
    var CONNECT_STATUS_PENDING = 0;
    var CONNECT_STATUS_UPDATING = 1;
    var CONNECT_STATUS_UPDATED = 2;
    function createRegisterEventWithLowercaseECharts(method) {
      return function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        if (this.isDisposed()) {
          disposedWarning(this.id);
          return;
        }
        return toLowercaseNameAndCallEventful(this, method, args);
      };
    }
    function createRegisterEventWithLowercaseMessageCenter(method) {
      return function() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        return toLowercaseNameAndCallEventful(this, method, args);
      };
    }
    function toLowercaseNameAndCallEventful(host, method, args) {
      args[0] = args[0] && args[0].toLowerCase();
      return Eventful.prototype[method].apply(host, args);
    }
    var MessageCenter = (
      /** @class */
      function(_super) {
        __extends$1(MessageCenter2, _super);
        function MessageCenter2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return MessageCenter2;
      }(Eventful)
    );
    var messageCenterProto = MessageCenter.prototype;
    messageCenterProto.on = createRegisterEventWithLowercaseMessageCenter("on");
    messageCenterProto.off = createRegisterEventWithLowercaseMessageCenter("off");
    var prepare;
    var prepareView;
    var updateDirectly;
    var updateMethods;
    var doConvertPixel;
    var updateStreamModes;
    var doDispatchAction;
    var flushPendingActions;
    var triggerUpdatedEvent;
    var bindRenderedEvent;
    var bindMouseEvent;
    var render;
    var renderComponents;
    var renderSeries;
    var createExtensionAPI;
    var enableConnect;
    var markStatusToUpdate;
    var applyChangedStates;
    var ECharts = (
      /** @class */
      function(_super) {
        __extends$1(ECharts2, _super);
        function ECharts2(dom, theme2, opts) {
          var _this = _super.call(this, new ECEventProcessor()) || this;
          _this._chartsViews = [];
          _this._chartsMap = {};
          _this._componentsViews = [];
          _this._componentsMap = {};
          _this._pendingActions = [];
          opts = opts || {};
          if (isString$1(theme2)) {
            theme2 = themeStorage[theme2];
          }
          _this._dom = dom;
          var defaultRenderer = "canvas";
          var defaultCoarsePointer = "auto";
          var defaultUseDirtyRect = false;
          if (opts.ssr) {
            registerSSRDataGetter(function(el) {
              var ecData = getECData(el);
              var dataIndex = ecData.dataIndex;
              if (dataIndex == null) {
                return;
              }
              var hashMap = createHashMap();
              hashMap.set("series_index", ecData.seriesIndex);
              hashMap.set("data_index", dataIndex);
              ecData.ssrType && hashMap.set("ssr_type", ecData.ssrType);
              return hashMap;
            });
          }
          var zr = _this._zr = init$2(dom, {
            renderer: opts.renderer || defaultRenderer,
            devicePixelRatio: opts.devicePixelRatio,
            width: opts.width,
            height: opts.height,
            ssr: opts.ssr,
            useDirtyRect: retrieve2(opts.useDirtyRect, defaultUseDirtyRect),
            useCoarsePointer: retrieve2(opts.useCoarsePointer, defaultCoarsePointer),
            pointerSize: opts.pointerSize
          });
          _this._ssr = opts.ssr;
          _this._throttledZrFlush = throttle$1(bind$2(zr.flush, zr), 17);
          theme2 = clone$4(theme2);
          theme2 && globalBackwardCompat(theme2, true);
          _this._theme = theme2;
          _this._locale = createLocaleObject(opts.locale || SYSTEM_LANG);
          _this._coordSysMgr = new CoordinateSystemManager();
          var api2 = _this._api = createExtensionAPI(_this);
          function prioritySortFunc(a2, b2) {
            return a2.__prio - b2.__prio;
          }
          sort$2(visualFuncs, prioritySortFunc);
          sort$2(dataProcessorFuncs, prioritySortFunc);
          _this._scheduler = new Scheduler(_this, api2, dataProcessorFuncs, visualFuncs);
          _this._messageCenter = new MessageCenter();
          _this._initEvents();
          _this.resize = bind$2(_this.resize, _this);
          zr.animation.on("frame", _this._onframe, _this);
          bindRenderedEvent(zr, _this);
          bindMouseEvent(zr, _this);
          setAsPrimitive(_this);
          return _this;
        }
        ECharts2.prototype._onframe = function() {
          if (this._disposed) {
            return;
          }
          applyChangedStates(this);
          var scheduler = this._scheduler;
          if (this[PENDING_UPDATE]) {
            var silent = this[PENDING_UPDATE].silent;
            this[IN_MAIN_PROCESS_KEY] = true;
            try {
              prepare(this);
              updateMethods.update.call(this, null, this[PENDING_UPDATE].updateParams);
            } catch (e2) {
              this[IN_MAIN_PROCESS_KEY] = false;
              this[PENDING_UPDATE] = null;
              throw e2;
            }
            this._zr.flush();
            this[IN_MAIN_PROCESS_KEY] = false;
            this[PENDING_UPDATE] = null;
            flushPendingActions.call(this, silent);
            triggerUpdatedEvent.call(this, silent);
          } else if (scheduler.unfinished) {
            var remainTime = TEST_FRAME_REMAIN_TIME;
            var ecModel = this._model;
            var api2 = this._api;
            scheduler.unfinished = false;
            do {
              var startTime = +/* @__PURE__ */ new Date();
              scheduler.performSeriesTasks(ecModel);
              scheduler.performDataProcessorTasks(ecModel);
              updateStreamModes(this, ecModel);
              scheduler.performVisualTasks(ecModel);
              renderSeries(this, this._model, api2, "remain", {});
              remainTime -= +/* @__PURE__ */ new Date() - startTime;
            } while (remainTime > 0 && scheduler.unfinished);
            if (!scheduler.unfinished) {
              this._zr.flush();
            }
          }
        };
        ECharts2.prototype.getDom = function() {
          return this._dom;
        };
        ECharts2.prototype.getId = function() {
          return this.id;
        };
        ECharts2.prototype.getZr = function() {
          return this._zr;
        };
        ECharts2.prototype.isSSR = function() {
          return this._ssr;
        };
        ECharts2.prototype.setOption = function(option, notMerge, lazyUpdate) {
          if (this[IN_MAIN_PROCESS_KEY]) {
            return;
          }
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          var silent;
          var replaceMerge;
          var transitionOpt;
          if (isObject$5(notMerge)) {
            lazyUpdate = notMerge.lazyUpdate;
            silent = notMerge.silent;
            replaceMerge = notMerge.replaceMerge;
            transitionOpt = notMerge.transition;
            notMerge = notMerge.notMerge;
          }
          this[IN_MAIN_PROCESS_KEY] = true;
          if (!this._model || notMerge) {
            var optionManager = new OptionManager(this._api);
            var theme2 = this._theme;
            var ecModel = this._model = new GlobalModel();
            ecModel.scheduler = this._scheduler;
            ecModel.ssr = this._ssr;
            ecModel.init(null, null, null, theme2, this._locale, optionManager);
          }
          this._model.setOption(option, {
            replaceMerge
          }, optionPreprocessorFuncs);
          var updateParams = {
            seriesTransition: transitionOpt,
            optionChanged: true
          };
          if (lazyUpdate) {
            this[PENDING_UPDATE] = {
              silent,
              updateParams
            };
            this[IN_MAIN_PROCESS_KEY] = false;
            this.getZr().wakeUp();
          } else {
            try {
              prepare(this);
              updateMethods.update.call(this, null, updateParams);
            } catch (e2) {
              this[PENDING_UPDATE] = null;
              this[IN_MAIN_PROCESS_KEY] = false;
              throw e2;
            }
            if (!this._ssr) {
              this._zr.flush();
            }
            this[PENDING_UPDATE] = null;
            this[IN_MAIN_PROCESS_KEY] = false;
            flushPendingActions.call(this, silent);
            triggerUpdatedEvent.call(this, silent);
          }
        };
        ECharts2.prototype.setTheme = function() {
        };
        ECharts2.prototype.getModel = function() {
          return this._model;
        };
        ECharts2.prototype.getOption = function() {
          return this._model && this._model.getOption();
        };
        ECharts2.prototype.getWidth = function() {
          return this._zr.getWidth();
        };
        ECharts2.prototype.getHeight = function() {
          return this._zr.getHeight();
        };
        ECharts2.prototype.getDevicePixelRatio = function() {
          return this._zr.painter.dpr || env.hasGlobalWindow && window.devicePixelRatio || 1;
        };
        ECharts2.prototype.getRenderedCanvas = function(opts) {
          return this.renderToCanvas(opts);
        };
        ECharts2.prototype.renderToCanvas = function(opts) {
          opts = opts || {};
          var painter = this._zr.painter;
          return painter.getRenderedCanvas({
            backgroundColor: opts.backgroundColor || this._model.get("backgroundColor"),
            pixelRatio: opts.pixelRatio || this.getDevicePixelRatio()
          });
        };
        ECharts2.prototype.renderToSVGString = function(opts) {
          opts = opts || {};
          var painter = this._zr.painter;
          return painter.renderToString({
            useViewBox: opts.useViewBox
          });
        };
        ECharts2.prototype.getSvgDataURL = function() {
          if (!env.svgSupported) {
            return;
          }
          var zr = this._zr;
          var list = zr.storage.getDisplayList();
          each$f(list, function(el) {
            el.stopAnimation(null, true);
          });
          return zr.painter.toDataURL();
        };
        ECharts2.prototype.getDataURL = function(opts) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          opts = opts || {};
          var excludeComponents = opts.excludeComponents;
          var ecModel = this._model;
          var excludesComponentViews = [];
          var self2 = this;
          each$f(excludeComponents, function(componentType) {
            ecModel.eachComponent({
              mainType: componentType
            }, function(component2) {
              var view = self2._componentsMap[component2.__viewId];
              if (!view.group.ignore) {
                excludesComponentViews.push(view);
                view.group.ignore = true;
              }
            });
          });
          var url = this._zr.painter.getType() === "svg" ? this.getSvgDataURL() : this.renderToCanvas(opts).toDataURL("image/" + (opts && opts.type || "png"));
          each$f(excludesComponentViews, function(view) {
            view.group.ignore = false;
          });
          return url;
        };
        ECharts2.prototype.getConnectedDataURL = function(opts) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          var isSvg = opts.type === "svg";
          var groupId = this.group;
          var mathMin2 = Math.min;
          var mathMax2 = Math.max;
          var MAX_NUMBER = Infinity;
          if (connectedGroups[groupId]) {
            var left_1 = MAX_NUMBER;
            var top_1 = MAX_NUMBER;
            var right_1 = -MAX_NUMBER;
            var bottom_1 = -MAX_NUMBER;
            var canvasList_1 = [];
            var dpr_1 = opts && opts.pixelRatio || this.getDevicePixelRatio();
            each$f(instances, function(chart, id) {
              if (chart.group === groupId) {
                var canvas = isSvg ? chart.getZr().painter.getSvgDom().innerHTML : chart.renderToCanvas(clone$4(opts));
                var boundingRect = chart.getDom().getBoundingClientRect();
                left_1 = mathMin2(boundingRect.left, left_1);
                top_1 = mathMin2(boundingRect.top, top_1);
                right_1 = mathMax2(boundingRect.right, right_1);
                bottom_1 = mathMax2(boundingRect.bottom, bottom_1);
                canvasList_1.push({
                  dom: canvas,
                  left: boundingRect.left,
                  top: boundingRect.top
                });
              }
            });
            left_1 *= dpr_1;
            top_1 *= dpr_1;
            right_1 *= dpr_1;
            bottom_1 *= dpr_1;
            var width = right_1 - left_1;
            var height = bottom_1 - top_1;
            var targetCanvas = platformApi.createCanvas();
            var zr_1 = init$2(targetCanvas, {
              renderer: isSvg ? "svg" : "canvas"
            });
            zr_1.resize({
              width,
              height
            });
            if (isSvg) {
              var content_1 = "";
              each$f(canvasList_1, function(item) {
                var x2 = item.left - left_1;
                var y = item.top - top_1;
                content_1 += '<g transform="translate(' + x2 + "," + y + ')">' + item.dom + "</g>";
              });
              zr_1.painter.getSvgRoot().innerHTML = content_1;
              if (opts.connectedBackgroundColor) {
                zr_1.painter.setBackgroundColor(opts.connectedBackgroundColor);
              }
              zr_1.refreshImmediately();
              return zr_1.painter.toDataURL();
            } else {
              if (opts.connectedBackgroundColor) {
                zr_1.add(new Rect$2({
                  shape: {
                    x: 0,
                    y: 0,
                    width,
                    height
                  },
                  style: {
                    fill: opts.connectedBackgroundColor
                  }
                }));
              }
              each$f(canvasList_1, function(item) {
                var img = new ZRImage({
                  style: {
                    x: item.left * dpr_1 - left_1,
                    y: item.top * dpr_1 - top_1,
                    image: item.dom
                  }
                });
                zr_1.add(img);
              });
              zr_1.refreshImmediately();
              return targetCanvas.toDataURL("image/" + (opts && opts.type || "png"));
            }
          } else {
            return this.getDataURL(opts);
          }
        };
        ECharts2.prototype.convertToPixel = function(finder, value) {
          return doConvertPixel(this, "convertToPixel", finder, value);
        };
        ECharts2.prototype.convertFromPixel = function(finder, value) {
          return doConvertPixel(this, "convertFromPixel", finder, value);
        };
        ECharts2.prototype.containPixel = function(finder, value) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          var ecModel = this._model;
          var result;
          var findResult = parseFinder$1(ecModel, finder);
          each$f(findResult, function(models, key) {
            key.indexOf("Models") >= 0 && each$f(models, function(model) {
              var coordSys = model.coordinateSystem;
              if (coordSys && coordSys.containPoint) {
                result = result || !!coordSys.containPoint(value);
              } else if (key === "seriesModels") {
                var view = this._chartsMap[model.__viewId];
                if (view && view.containPoint) {
                  result = result || view.containPoint(value, model);
                }
              } else ;
            }, this);
          }, this);
          return !!result;
        };
        ECharts2.prototype.getVisual = function(finder, visualType) {
          var ecModel = this._model;
          var parsedFinder = parseFinder$1(ecModel, finder, {
            defaultMainType: "series"
          });
          var seriesModel = parsedFinder.seriesModel;
          var data = seriesModel.getData();
          var dataIndexInside = parsedFinder.hasOwnProperty("dataIndexInside") ? parsedFinder.dataIndexInside : parsedFinder.hasOwnProperty("dataIndex") ? data.indexOfRawIndex(parsedFinder.dataIndex) : null;
          return dataIndexInside != null ? getItemVisualFromData(data, dataIndexInside, visualType) : getVisualFromData(data, visualType);
        };
        ECharts2.prototype.getViewOfComponentModel = function(componentModel) {
          return this._componentsMap[componentModel.__viewId];
        };
        ECharts2.prototype.getViewOfSeriesModel = function(seriesModel) {
          return this._chartsMap[seriesModel.__viewId];
        };
        ECharts2.prototype._initEvents = function() {
          var _this = this;
          each$f(MOUSE_EVENT_NAMES, function(eveName) {
            var handler = function(e2) {
              var ecModel = _this.getModel();
              var el = e2.target;
              var params;
              var isGlobalOut = eveName === "globalout";
              if (isGlobalOut) {
                params = {};
              } else {
                el && findEventDispatcher(el, function(parent2) {
                  var ecData = getECData(parent2);
                  if (ecData && ecData.dataIndex != null) {
                    var dataModel = ecData.dataModel || ecModel.getSeriesByIndex(ecData.seriesIndex);
                    params = dataModel && dataModel.getDataParams(ecData.dataIndex, ecData.dataType, el) || {};
                    return true;
                  } else if (ecData.eventData) {
                    params = extend$1({}, ecData.eventData);
                    return true;
                  }
                }, true);
              }
              if (params) {
                var componentType = params.componentType;
                var componentIndex = params.componentIndex;
                if (componentType === "markLine" || componentType === "markPoint" || componentType === "markArea") {
                  componentType = "series";
                  componentIndex = params.seriesIndex;
                }
                var model = componentType && componentIndex != null && ecModel.getComponent(componentType, componentIndex);
                var view = model && _this[model.mainType === "series" ? "_chartsMap" : "_componentsMap"][model.__viewId];
                params.event = e2;
                params.type = eveName;
                _this._$eventProcessor.eventInfo = {
                  targetEl: el,
                  packedEvent: params,
                  model,
                  view
                };
                _this.trigger(eveName, params);
              }
            };
            handler.zrEventfulCallAtLast = true;
            _this._zr.on(eveName, handler, _this);
          });
          each$f(eventActionMap, function(actionType, eventType) {
            _this._messageCenter.on(eventType, function(event) {
              this.trigger(eventType, event);
            }, _this);
          });
          each$f(["selectchanged"], function(eventType) {
            _this._messageCenter.on(eventType, function(event) {
              this.trigger(eventType, event);
            }, _this);
          });
          handleLegacySelectEvents(this._messageCenter, this, this._api);
        };
        ECharts2.prototype.isDisposed = function() {
          return this._disposed;
        };
        ECharts2.prototype.clear = function() {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          this.setOption({
            series: []
          }, true);
        };
        ECharts2.prototype.dispose = function() {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          this._disposed = true;
          var dom = this.getDom();
          if (dom) {
            setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, "");
          }
          var chart = this;
          var api2 = chart._api;
          var ecModel = chart._model;
          each$f(chart._componentsViews, function(component2) {
            component2.dispose(ecModel, api2);
          });
          each$f(chart._chartsViews, function(chart2) {
            chart2.dispose(ecModel, api2);
          });
          chart._zr.dispose();
          chart._dom = chart._model = chart._chartsMap = chart._componentsMap = chart._chartsViews = chart._componentsViews = chart._scheduler = chart._api = chart._zr = chart._throttledZrFlush = chart._theme = chart._coordSysMgr = chart._messageCenter = null;
          delete instances[chart.id];
        };
        ECharts2.prototype.resize = function(opts) {
          if (this[IN_MAIN_PROCESS_KEY]) {
            return;
          }
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          this._zr.resize(opts);
          var ecModel = this._model;
          this._loadingFX && this._loadingFX.resize();
          if (!ecModel) {
            return;
          }
          var needPrepare = ecModel.resetOption("media");
          var silent = opts && opts.silent;
          if (this[PENDING_UPDATE]) {
            if (silent == null) {
              silent = this[PENDING_UPDATE].silent;
            }
            needPrepare = true;
            this[PENDING_UPDATE] = null;
          }
          this[IN_MAIN_PROCESS_KEY] = true;
          try {
            needPrepare && prepare(this);
            updateMethods.update.call(this, {
              type: "resize",
              animation: extend$1({
                // Disable animation
                duration: 0
              }, opts && opts.animation)
            });
          } catch (e2) {
            this[IN_MAIN_PROCESS_KEY] = false;
            throw e2;
          }
          this[IN_MAIN_PROCESS_KEY] = false;
          flushPendingActions.call(this, silent);
          triggerUpdatedEvent.call(this, silent);
        };
        ECharts2.prototype.showLoading = function(name, cfg) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          if (isObject$5(name)) {
            cfg = name;
            name = "";
          }
          name = name || "default";
          this.hideLoading();
          if (!loadingEffects[name]) {
            return;
          }
          var el = loadingEffects[name](this._api, cfg);
          var zr = this._zr;
          this._loadingFX = el;
          zr.add(el);
        };
        ECharts2.prototype.hideLoading = function() {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          this._loadingFX && this._zr.remove(this._loadingFX);
          this._loadingFX = null;
        };
        ECharts2.prototype.makeActionFromEvent = function(eventObj) {
          var payload = extend$1({}, eventObj);
          payload.type = eventActionMap[eventObj.type];
          return payload;
        };
        ECharts2.prototype.dispatchAction = function(payload, opt) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          if (!isObject$5(opt)) {
            opt = {
              silent: !!opt
            };
          }
          if (!actions[payload.type]) {
            return;
          }
          if (!this._model) {
            return;
          }
          if (this[IN_MAIN_PROCESS_KEY]) {
            this._pendingActions.push(payload);
            return;
          }
          var silent = opt.silent;
          doDispatchAction.call(this, payload, silent);
          var flush = opt.flush;
          if (flush) {
            this._zr.flush();
          } else if (flush !== false && env.browser.weChat) {
            this._throttledZrFlush();
          }
          flushPendingActions.call(this, silent);
          triggerUpdatedEvent.call(this, silent);
        };
        ECharts2.prototype.updateLabelLayout = function() {
          lifecycle.trigger("series:layoutlabels", this._model, this._api, {
            // Not adding series labels.
            // TODO
            updatedSeries: []
          });
        };
        ECharts2.prototype.appendData = function(params) {
          if (this._disposed) {
            disposedWarning(this.id);
            return;
          }
          var seriesIndex = params.seriesIndex;
          var ecModel = this.getModel();
          var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
          seriesModel.appendData(params);
          this._scheduler.unfinished = true;
          this.getZr().wakeUp();
        };
        ECharts2.internalField = function() {
          prepare = function(ecIns) {
            var scheduler = ecIns._scheduler;
            scheduler.restorePipelines(ecIns._model);
            scheduler.prepareStageTasks();
            prepareView(ecIns, true);
            prepareView(ecIns, false);
            scheduler.plan();
          };
          prepareView = function(ecIns, isComponent) {
            var ecModel = ecIns._model;
            var scheduler = ecIns._scheduler;
            var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews;
            var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap;
            var zr = ecIns._zr;
            var api2 = ecIns._api;
            for (var i2 = 0; i2 < viewList.length; i2++) {
              viewList[i2].__alive = false;
            }
            isComponent ? ecModel.eachComponent(function(componentType, model) {
              componentType !== "series" && doPrepare(model);
            }) : ecModel.eachSeries(doPrepare);
            function doPrepare(model) {
              var requireNewView = model.__requireNewView;
              model.__requireNewView = false;
              var viewId = "_ec_" + model.id + "_" + model.type;
              var view2 = !requireNewView && viewMap[viewId];
              if (!view2) {
                var classType2 = parseClassType(model.type);
                var Clazz = isComponent ? ComponentView.getClass(classType2.main, classType2.sub) : (
                  // FIXME:TS
                  // (ChartView as ChartViewConstructor).getClass('series', classType.sub)
                  // For backward compat, still support a chart type declared as only subType
                  // like "liquidfill", but recommend "series.liquidfill"
                  // But need a base class to make a type series.
                  ChartView.getClass(classType2.sub)
                );
                view2 = new Clazz();
                view2.init(ecModel, api2);
                viewMap[viewId] = view2;
                viewList.push(view2);
                zr.add(view2.group);
              }
              model.__viewId = view2.__id = viewId;
              view2.__alive = true;
              view2.__model = model;
              view2.group.__ecComponentInfo = {
                mainType: model.mainType,
                index: model.componentIndex
              };
              !isComponent && scheduler.prepareView(view2, model, ecModel, api2);
            }
            for (var i2 = 0; i2 < viewList.length; ) {
              var view = viewList[i2];
              if (!view.__alive) {
                !isComponent && view.renderTask.dispose();
                zr.remove(view.group);
                view.dispose(ecModel, api2);
                viewList.splice(i2, 1);
                if (viewMap[view.__id] === view) {
                  delete viewMap[view.__id];
                }
                view.__id = view.group.__ecComponentInfo = null;
              } else {
                i2++;
              }
            }
          };
          updateDirectly = function(ecIns, method, payload, mainType, subType) {
            var ecModel = ecIns._model;
            ecModel.setUpdatePayload(payload);
            if (!mainType) {
              each$f([].concat(ecIns._componentsViews).concat(ecIns._chartsViews), callView);
              return;
            }
            var query = {};
            query[mainType + "Id"] = payload[mainType + "Id"];
            query[mainType + "Index"] = payload[mainType + "Index"];
            query[mainType + "Name"] = payload[mainType + "Name"];
            var condition = {
              mainType,
              query
            };
            subType && (condition.subType = subType);
            var excludeSeriesId = payload.excludeSeriesId;
            var excludeSeriesIdMap;
            if (excludeSeriesId != null) {
              excludeSeriesIdMap = createHashMap();
              each$f(normalizeToArray(excludeSeriesId), function(id) {
                var modelId = convertOptionIdName(id, null);
                if (modelId != null) {
                  excludeSeriesIdMap.set(modelId, true);
                }
              });
            }
            ecModel && ecModel.eachComponent(condition, function(model) {
              var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;
              if (isExcluded) {
                return;
              }
              if (isHighDownPayload(payload)) {
                if (model instanceof SeriesModel) {
                  if (payload.type === HIGHLIGHT_ACTION_TYPE && !payload.notBlur && !model.get(["emphasis", "disabled"])) {
                    blurSeriesFromHighlightPayload(model, payload, ecIns._api);
                  }
                } else {
                  var _a2 = findComponentHighDownDispatchers(model.mainType, model.componentIndex, payload.name, ecIns._api), focusSelf = _a2.focusSelf, dispatchers = _a2.dispatchers;
                  if (payload.type === HIGHLIGHT_ACTION_TYPE && focusSelf && !payload.notBlur) {
                    blurComponent(model.mainType, model.componentIndex, ecIns._api);
                  }
                  if (dispatchers) {
                    each$f(dispatchers, function(dispatcher) {
                      payload.type === HIGHLIGHT_ACTION_TYPE ? enterEmphasis(dispatcher) : leaveEmphasis(dispatcher);
                    });
                  }
                }
              } else if (isSelectChangePayload(payload)) {
                if (model instanceof SeriesModel) {
                  toggleSelectionFromPayload(model, payload, ecIns._api);
                  updateSeriesElementSelection(model);
                  markStatusToUpdate(ecIns);
                }
              }
            }, ecIns);
            ecModel && ecModel.eachComponent(condition, function(model) {
              var isExcluded = excludeSeriesIdMap && excludeSeriesIdMap.get(model.id) != null;
              if (isExcluded) {
                return;
              }
              callView(ecIns[mainType === "series" ? "_chartsMap" : "_componentsMap"][model.__viewId]);
            }, ecIns);
            function callView(view) {
              view && view.__alive && view[method] && view[method](view.__model, ecModel, ecIns._api, payload);
            }
          };
          updateMethods = {
            prepareAndUpdate: function(payload) {
              prepare(this);
              updateMethods.update.call(this, payload, {
                // Needs to mark option changed if newOption is given.
                // It's from MagicType.
                // TODO If use a separate flag optionChanged in payload?
                optionChanged: payload.newOption != null
              });
            },
            update: function(payload, updateParams) {
              var ecModel = this._model;
              var api2 = this._api;
              var zr = this._zr;
              var coordSysMgr = this._coordSysMgr;
              var scheduler = this._scheduler;
              if (!ecModel) {
                return;
              }
              ecModel.setUpdatePayload(payload);
              scheduler.restoreData(ecModel, payload);
              scheduler.performSeriesTasks(ecModel);
              coordSysMgr.create(ecModel, api2);
              scheduler.performDataProcessorTasks(ecModel, payload);
              updateStreamModes(this, ecModel);
              coordSysMgr.update(ecModel, api2);
              clearColorPalette(ecModel);
              scheduler.performVisualTasks(ecModel, payload);
              render(this, ecModel, api2, payload, updateParams);
              var backgroundColor2 = ecModel.get("backgroundColor") || "transparent";
              var darkMode = ecModel.get("darkMode");
              zr.setBackgroundColor(backgroundColor2);
              if (darkMode != null && darkMode !== "auto") {
                zr.setDarkMode(darkMode);
              }
              lifecycle.trigger("afterupdate", ecModel, api2);
            },
            updateTransform: function(payload) {
              var _this = this;
              var ecModel = this._model;
              var api2 = this._api;
              if (!ecModel) {
                return;
              }
              ecModel.setUpdatePayload(payload);
              var componentDirtyList = [];
              ecModel.eachComponent(function(componentType, componentModel) {
                if (componentType === "series") {
                  return;
                }
                var componentView = _this.getViewOfComponentModel(componentModel);
                if (componentView && componentView.__alive) {
                  if (componentView.updateTransform) {
                    var result = componentView.updateTransform(componentModel, ecModel, api2, payload);
                    result && result.update && componentDirtyList.push(componentView);
                  } else {
                    componentDirtyList.push(componentView);
                  }
                }
              });
              var seriesDirtyMap = createHashMap();
              ecModel.eachSeries(function(seriesModel) {
                var chartView = _this._chartsMap[seriesModel.__viewId];
                if (chartView.updateTransform) {
                  var result = chartView.updateTransform(seriesModel, ecModel, api2, payload);
                  result && result.update && seriesDirtyMap.set(seriesModel.uid, 1);
                } else {
                  seriesDirtyMap.set(seriesModel.uid, 1);
                }
              });
              clearColorPalette(ecModel);
              this._scheduler.performVisualTasks(ecModel, payload, {
                setDirty: true,
                dirtyMap: seriesDirtyMap
              });
              renderSeries(this, ecModel, api2, payload, {}, seriesDirtyMap);
              lifecycle.trigger("afterupdate", ecModel, api2);
            },
            updateView: function(payload) {
              var ecModel = this._model;
              if (!ecModel) {
                return;
              }
              ecModel.setUpdatePayload(payload);
              ChartView.markUpdateMethod(payload, "updateView");
              clearColorPalette(ecModel);
              this._scheduler.performVisualTasks(ecModel, payload, {
                setDirty: true
              });
              render(this, ecModel, this._api, payload, {});
              lifecycle.trigger("afterupdate", ecModel, this._api);
            },
            updateVisual: function(payload) {
              var _this = this;
              var ecModel = this._model;
              if (!ecModel) {
                return;
              }
              ecModel.setUpdatePayload(payload);
              ecModel.eachSeries(function(seriesModel) {
                seriesModel.getData().clearAllVisual();
              });
              ChartView.markUpdateMethod(payload, "updateVisual");
              clearColorPalette(ecModel);
              this._scheduler.performVisualTasks(ecModel, payload, {
                visualType: "visual",
                setDirty: true
              });
              ecModel.eachComponent(function(componentType, componentModel) {
                if (componentType !== "series") {
                  var componentView = _this.getViewOfComponentModel(componentModel);
                  componentView && componentView.__alive && componentView.updateVisual(componentModel, ecModel, _this._api, payload);
                }
              });
              ecModel.eachSeries(function(seriesModel) {
                var chartView = _this._chartsMap[seriesModel.__viewId];
                chartView.updateVisual(seriesModel, ecModel, _this._api, payload);
              });
              lifecycle.trigger("afterupdate", ecModel, this._api);
            },
            updateLayout: function(payload) {
              updateMethods.update.call(this, payload);
            }
          };
          doConvertPixel = function(ecIns, methodName, finder, value) {
            if (ecIns._disposed) {
              disposedWarning(ecIns.id);
              return;
            }
            var ecModel = ecIns._model;
            var coordSysList = ecIns._coordSysMgr.getCoordinateSystems();
            var result;
            var parsedFinder = parseFinder$1(ecModel, finder);
            for (var i2 = 0; i2 < coordSysList.length; i2++) {
              var coordSys = coordSysList[i2];
              if (coordSys[methodName] && (result = coordSys[methodName](ecModel, parsedFinder, value)) != null) {
                return result;
              }
            }
          };
          updateStreamModes = function(ecIns, ecModel) {
            var chartsMap = ecIns._chartsMap;
            var scheduler = ecIns._scheduler;
            ecModel.eachSeries(function(seriesModel) {
              scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]);
            });
          };
          doDispatchAction = function(payload, silent) {
            var _this = this;
            var ecModel = this.getModel();
            var payloadType = payload.type;
            var escapeConnect = payload.escapeConnect;
            var actionWrap = actions[payloadType];
            var actionInfo2 = actionWrap.actionInfo;
            var cptTypeTmp = (actionInfo2.update || "update").split(":");
            var updateMethod = cptTypeTmp.pop();
            var cptType = cptTypeTmp[0] != null && parseClassType(cptTypeTmp[0]);
            this[IN_MAIN_PROCESS_KEY] = true;
            var payloads = [payload];
            var batched = false;
            if (payload.batch) {
              batched = true;
              payloads = map$1(payload.batch, function(item) {
                item = defaults$1(extend$1({}, item), payload);
                item.batch = null;
                return item;
              });
            }
            var eventObjBatch = [];
            var eventObj;
            var isSelectChange = isSelectChangePayload(payload);
            var isHighDown = isHighDownPayload(payload);
            if (isHighDown) {
              allLeaveBlur(this._api);
            }
            each$f(payloads, function(batchItem) {
              eventObj = actionWrap.action(batchItem, _this._model, _this._api);
              eventObj = eventObj || extend$1({}, batchItem);
              eventObj.type = actionInfo2.event || eventObj.type;
              eventObjBatch.push(eventObj);
              if (isHighDown) {
                var _a2 = preParseFinder(payload), queryOptionMap = _a2.queryOptionMap, mainTypeSpecified = _a2.mainTypeSpecified;
                var componentMainType = mainTypeSpecified ? queryOptionMap.keys()[0] : "series";
                updateDirectly(_this, updateMethod, batchItem, componentMainType);
                markStatusToUpdate(_this);
              } else if (isSelectChange) {
                updateDirectly(_this, updateMethod, batchItem, "series");
                markStatusToUpdate(_this);
              } else if (cptType) {
                updateDirectly(_this, updateMethod, batchItem, cptType.main, cptType.sub);
              }
            });
            if (updateMethod !== "none" && !isHighDown && !isSelectChange && !cptType) {
              try {
                if (this[PENDING_UPDATE]) {
                  prepare(this);
                  updateMethods.update.call(this, payload);
                  this[PENDING_UPDATE] = null;
                } else {
                  updateMethods[updateMethod].call(this, payload);
                }
              } catch (e2) {
                this[IN_MAIN_PROCESS_KEY] = false;
                throw e2;
              }
            }
            if (batched) {
              eventObj = {
                type: actionInfo2.event || payloadType,
                escapeConnect,
                batch: eventObjBatch
              };
            } else {
              eventObj = eventObjBatch[0];
            }
            this[IN_MAIN_PROCESS_KEY] = false;
            if (!silent) {
              var messageCenter = this._messageCenter;
              messageCenter.trigger(eventObj.type, eventObj);
              if (isSelectChange) {
                var newObj = {
                  type: "selectchanged",
                  escapeConnect,
                  selected: getAllSelectedIndices(ecModel),
                  isFromClick: payload.isFromClick || false,
                  fromAction: payload.type,
                  fromActionPayload: payload
                };
                messageCenter.trigger(newObj.type, newObj);
              }
            }
          };
          flushPendingActions = function(silent) {
            var pendingActions = this._pendingActions;
            while (pendingActions.length) {
              var payload = pendingActions.shift();
              doDispatchAction.call(this, payload, silent);
            }
          };
          triggerUpdatedEvent = function(silent) {
            !silent && this.trigger("updated");
          };
          bindRenderedEvent = function(zr, ecIns) {
            zr.on("rendered", function(params) {
              ecIns.trigger("rendered", params);
              if (
                // Although zr is dirty if initial animation is not finished
                // and this checking is called on frame, we also check
                // animation finished for robustness.
                zr.animation.isFinished() && !ecIns[PENDING_UPDATE] && !ecIns._scheduler.unfinished && !ecIns._pendingActions.length
              ) {
                ecIns.trigger("finished");
              }
            });
          };
          bindMouseEvent = function(zr, ecIns) {
            zr.on("mouseover", function(e2) {
              var el = e2.target;
              var dispatcher = findEventDispatcher(el, isHighDownDispatcher);
              if (dispatcher) {
                handleGlobalMouseOverForHighDown(dispatcher, e2, ecIns._api);
                markStatusToUpdate(ecIns);
              }
            }).on("mouseout", function(e2) {
              var el = e2.target;
              var dispatcher = findEventDispatcher(el, isHighDownDispatcher);
              if (dispatcher) {
                handleGlobalMouseOutForHighDown(dispatcher, e2, ecIns._api);
                markStatusToUpdate(ecIns);
              }
            }).on("click", function(e2) {
              var el = e2.target;
              var dispatcher = findEventDispatcher(el, function(target) {
                return getECData(target).dataIndex != null;
              }, true);
              if (dispatcher) {
                var actionType = dispatcher.selected ? "unselect" : "select";
                var ecData = getECData(dispatcher);
                ecIns._api.dispatchAction({
                  type: actionType,
                  dataType: ecData.dataType,
                  dataIndexInside: ecData.dataIndex,
                  seriesIndex: ecData.seriesIndex,
                  isFromClick: true
                });
              }
            });
          };
          function clearColorPalette(ecModel) {
            ecModel.clearColorPalette();
            ecModel.eachSeries(function(seriesModel) {
              seriesModel.clearColorPalette();
            });
          }
          function allocateZlevels(ecModel) {
            var componentZLevels = [];
            var seriesZLevels = [];
            var hasSeparateZLevel = false;
            ecModel.eachComponent(function(componentType, componentModel) {
              var zlevel = componentModel.get("zlevel") || 0;
              var z2 = componentModel.get("z") || 0;
              var zlevelKey = componentModel.getZLevelKey();
              hasSeparateZLevel = hasSeparateZLevel || !!zlevelKey;
              (componentType === "series" ? seriesZLevels : componentZLevels).push({
                zlevel,
                z: z2,
                idx: componentModel.componentIndex,
                type: componentType,
                key: zlevelKey
              });
            });
            if (hasSeparateZLevel) {
              var zLevels = componentZLevels.concat(seriesZLevels);
              var lastSeriesZLevel_1;
              var lastSeriesKey_1;
              sort$2(zLevels, function(a2, b2) {
                if (a2.zlevel === b2.zlevel) {
                  return a2.z - b2.z;
                }
                return a2.zlevel - b2.zlevel;
              });
              each$f(zLevels, function(item) {
                var componentModel = ecModel.getComponent(item.type, item.idx);
                var zlevel = item.zlevel;
                var key = item.key;
                if (lastSeriesZLevel_1 != null) {
                  zlevel = Math.max(lastSeriesZLevel_1, zlevel);
                }
                if (key) {
                  if (zlevel === lastSeriesZLevel_1 && key !== lastSeriesKey_1) {
                    zlevel++;
                  }
                  lastSeriesKey_1 = key;
                } else if (lastSeriesKey_1) {
                  if (zlevel === lastSeriesZLevel_1) {
                    zlevel++;
                  }
                  lastSeriesKey_1 = "";
                }
                lastSeriesZLevel_1 = zlevel;
                componentModel.setZLevel(zlevel);
              });
            }
          }
          render = function(ecIns, ecModel, api2, payload, updateParams) {
            allocateZlevels(ecModel);
            renderComponents(ecIns, ecModel, api2, payload, updateParams);
            each$f(ecIns._chartsViews, function(chart) {
              chart.__alive = false;
            });
            renderSeries(ecIns, ecModel, api2, payload, updateParams);
            each$f(ecIns._chartsViews, function(chart) {
              if (!chart.__alive) {
                chart.remove(ecModel, api2);
              }
            });
          };
          renderComponents = function(ecIns, ecModel, api2, payload, updateParams, dirtyList) {
            each$f(dirtyList || ecIns._componentsViews, function(componentView) {
              var componentModel = componentView.__model;
              clearStates(componentModel, componentView);
              componentView.render(componentModel, ecModel, api2, payload);
              updateZ2(componentModel, componentView);
              updateStates(componentModel, componentView);
            });
          };
          renderSeries = function(ecIns, ecModel, api2, payload, updateParams, dirtyMap) {
            var scheduler = ecIns._scheduler;
            updateParams = extend$1(updateParams || {}, {
              updatedSeries: ecModel.getSeries()
            });
            lifecycle.trigger("series:beforeupdate", ecModel, api2, updateParams);
            var unfinished = false;
            ecModel.eachSeries(function(seriesModel) {
              var chartView = ecIns._chartsMap[seriesModel.__viewId];
              chartView.__alive = true;
              var renderTask = chartView.renderTask;
              scheduler.updatePayload(renderTask, payload);
              clearStates(seriesModel, chartView);
              if (dirtyMap && dirtyMap.get(seriesModel.uid)) {
                renderTask.dirty();
              }
              if (renderTask.perform(scheduler.getPerformArgs(renderTask))) {
                unfinished = true;
              }
              chartView.group.silent = !!seriesModel.get("silent");
              updateBlend(seriesModel, chartView);
              updateSeriesElementSelection(seriesModel);
            });
            scheduler.unfinished = unfinished || scheduler.unfinished;
            lifecycle.trigger("series:layoutlabels", ecModel, api2, updateParams);
            lifecycle.trigger("series:transition", ecModel, api2, updateParams);
            ecModel.eachSeries(function(seriesModel) {
              var chartView = ecIns._chartsMap[seriesModel.__viewId];
              updateZ2(seriesModel, chartView);
              updateStates(seriesModel, chartView);
            });
            updateHoverLayerStatus(ecIns, ecModel);
            lifecycle.trigger("series:afterupdate", ecModel, api2, updateParams);
          };
          markStatusToUpdate = function(ecIns) {
            ecIns[STATUS_NEEDS_UPDATE_KEY] = true;
            ecIns.getZr().wakeUp();
          };
          applyChangedStates = function(ecIns) {
            if (!ecIns[STATUS_NEEDS_UPDATE_KEY]) {
              return;
            }
            ecIns.getZr().storage.traverse(function(el) {
              if (isElementRemoved(el)) {
                return;
              }
              applyElementStates(el);
            });
            ecIns[STATUS_NEEDS_UPDATE_KEY] = false;
          };
          function applyElementStates(el) {
            var newStates = [];
            var oldStates = el.currentStates;
            for (var i2 = 0; i2 < oldStates.length; i2++) {
              var stateName = oldStates[i2];
              if (!(stateName === "emphasis" || stateName === "blur" || stateName === "select")) {
                newStates.push(stateName);
              }
            }
            if (el.selected && el.states.select) {
              newStates.push("select");
            }
            if (el.hoverState === HOVER_STATE_EMPHASIS && el.states.emphasis) {
              newStates.push("emphasis");
            } else if (el.hoverState === HOVER_STATE_BLUR && el.states.blur) {
              newStates.push("blur");
            }
            el.useStates(newStates);
          }
          function updateHoverLayerStatus(ecIns, ecModel) {
            var zr = ecIns._zr;
            var storage2 = zr.storage;
            var elCount = 0;
            storage2.traverse(function(el) {
              if (!el.isGroup) {
                elCount++;
              }
            });
            if (elCount > ecModel.get("hoverLayerThreshold") && !env.node && !env.worker) {
              ecModel.eachSeries(function(seriesModel) {
                if (seriesModel.preventUsingHoverLayer) {
                  return;
                }
                var chartView = ecIns._chartsMap[seriesModel.__viewId];
                if (chartView.__alive) {
                  chartView.eachRendered(function(el) {
                    if (el.states.emphasis) {
                      el.states.emphasis.hoverLayer = true;
                    }
                  });
                }
              });
            }
          }
          function updateBlend(seriesModel, chartView) {
            var blendMode = seriesModel.get("blendMode") || null;
            chartView.eachRendered(function(el) {
              if (!el.isGroup) {
                el.style.blend = blendMode;
              }
            });
          }
          function updateZ2(model, view) {
            if (model.preventAutoZ) {
              return;
            }
            var z2 = model.get("z") || 0;
            var zlevel = model.get("zlevel") || 0;
            view.eachRendered(function(el) {
              doUpdateZ(el, z2, zlevel, -Infinity);
              return true;
            });
          }
          function doUpdateZ(el, z2, zlevel, maxZ2) {
            var label = el.getTextContent();
            var labelLine = el.getTextGuideLine();
            var isGroup = el.isGroup;
            if (isGroup) {
              var children = el.childrenRef();
              for (var i2 = 0; i2 < children.length; i2++) {
                maxZ2 = Math.max(doUpdateZ(children[i2], z2, zlevel, maxZ2), maxZ2);
              }
            } else {
              el.z = z2;
              el.zlevel = zlevel;
              maxZ2 = Math.max(el.z2, maxZ2);
            }
            if (label) {
              label.z = z2;
              label.zlevel = zlevel;
              isFinite(maxZ2) && (label.z2 = maxZ2 + 2);
            }
            if (labelLine) {
              var textGuideLineConfig = el.textGuideLineConfig;
              labelLine.z = z2;
              labelLine.zlevel = zlevel;
              isFinite(maxZ2) && (labelLine.z2 = maxZ2 + (textGuideLineConfig && textGuideLineConfig.showAbove ? 1 : -1));
            }
            return maxZ2;
          }
          function clearStates(model, view) {
            view.eachRendered(function(el) {
              if (isElementRemoved(el)) {
                return;
              }
              var textContent = el.getTextContent();
              var textGuide = el.getTextGuideLine();
              if (el.stateTransition) {
                el.stateTransition = null;
              }
              if (textContent && textContent.stateTransition) {
                textContent.stateTransition = null;
              }
              if (textGuide && textGuide.stateTransition) {
                textGuide.stateTransition = null;
              }
              if (el.hasState()) {
                el.prevStates = el.currentStates;
                el.clearStates();
              } else if (el.prevStates) {
                el.prevStates = null;
              }
            });
          }
          function updateStates(model, view) {
            var stateAnimationModel = model.getModel("stateAnimation");
            var enableAnimation = model.isAnimationEnabled();
            var duration2 = stateAnimationModel.get("duration");
            var stateTransition = duration2 > 0 ? {
              duration: duration2,
              delay: stateAnimationModel.get("delay"),
              easing: stateAnimationModel.get("easing")
              // additive: stateAnimationModel.get('additive')
            } : null;
            view.eachRendered(function(el) {
              if (el.states && el.states.emphasis) {
                if (isElementRemoved(el)) {
                  return;
                }
                if (el instanceof Path) {
                  savePathStates(el);
                }
                if (el.__dirty) {
                  var prevStates = el.prevStates;
                  if (prevStates) {
                    el.useStates(prevStates);
                  }
                }
                if (enableAnimation) {
                  el.stateTransition = stateTransition;
                  var textContent = el.getTextContent();
                  var textGuide = el.getTextGuideLine();
                  if (textContent) {
                    textContent.stateTransition = stateTransition;
                  }
                  if (textGuide) {
                    textGuide.stateTransition = stateTransition;
                  }
                }
                if (el.__dirty) {
                  applyElementStates(el);
                }
              }
            });
          }
          createExtensionAPI = function(ecIns) {
            return new /** @class */
            (function(_super2) {
              __extends$1(class_1, _super2);
              function class_1() {
                return _super2 !== null && _super2.apply(this, arguments) || this;
              }
              class_1.prototype.getCoordinateSystems = function() {
                return ecIns._coordSysMgr.getCoordinateSystems();
              };
              class_1.prototype.getComponentByElement = function(el) {
                while (el) {
                  var modelInfo = el.__ecComponentInfo;
                  if (modelInfo != null) {
                    return ecIns._model.getComponent(modelInfo.mainType, modelInfo.index);
                  }
                  el = el.parent;
                }
              };
              class_1.prototype.enterEmphasis = function(el, highlightDigit) {
                enterEmphasis(el, highlightDigit);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.leaveEmphasis = function(el, highlightDigit) {
                leaveEmphasis(el, highlightDigit);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.enterBlur = function(el) {
                enterBlur(el);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.leaveBlur = function(el) {
                leaveBlur(el);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.enterSelect = function(el) {
                enterSelect(el);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.leaveSelect = function(el) {
                leaveSelect(el);
                markStatusToUpdate(ecIns);
              };
              class_1.prototype.getModel = function() {
                return ecIns.getModel();
              };
              class_1.prototype.getViewOfComponentModel = function(componentModel) {
                return ecIns.getViewOfComponentModel(componentModel);
              };
              class_1.prototype.getViewOfSeriesModel = function(seriesModel) {
                return ecIns.getViewOfSeriesModel(seriesModel);
              };
              return class_1;
            }(ExtensionAPI))(ecIns);
          };
          enableConnect = function(chart) {
            function updateConnectedChartsStatus(charts, status) {
              for (var i2 = 0; i2 < charts.length; i2++) {
                var otherChart = charts[i2];
                otherChart[CONNECT_STATUS_KEY] = status;
              }
            }
            each$f(eventActionMap, function(actionType, eventType) {
              chart._messageCenter.on(eventType, function(event) {
                if (connectedGroups[chart.group] && chart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_PENDING) {
                  if (event && event.escapeConnect) {
                    return;
                  }
                  var action_1 = chart.makeActionFromEvent(event);
                  var otherCharts_1 = [];
                  each$f(instances, function(otherChart) {
                    if (otherChart !== chart && otherChart.group === chart.group) {
                      otherCharts_1.push(otherChart);
                    }
                  });
                  updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_PENDING);
                  each$f(otherCharts_1, function(otherChart) {
                    if (otherChart[CONNECT_STATUS_KEY] !== CONNECT_STATUS_UPDATING) {
                      otherChart.dispatchAction(action_1);
                    }
                  });
                  updateConnectedChartsStatus(otherCharts_1, CONNECT_STATUS_UPDATED);
                }
              });
            });
          };
        }();
        return ECharts2;
      }(Eventful)
    );
    var echartsProto = ECharts.prototype;
    echartsProto.on = createRegisterEventWithLowercaseECharts("on");
    echartsProto.off = createRegisterEventWithLowercaseECharts("off");
    echartsProto.one = function(eventName, cb, ctx) {
      var self2 = this;
      function wrapped() {
        var args2 = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args2[_i] = arguments[_i];
        }
        cb && cb.apply && cb.apply(this, args2);
        self2.off(eventName, wrapped);
      }
      this.on.call(this, eventName, wrapped, ctx);
    };
    var MOUSE_EVENT_NAMES = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];
    function disposedWarning(id) {
    }
    var actions = {};
    var eventActionMap = {};
    var dataProcessorFuncs = [];
    var optionPreprocessorFuncs = [];
    var visualFuncs = [];
    var themeStorage = {};
    var loadingEffects = {};
    var instances = {};
    var connectedGroups = {};
    var idBase = +/* @__PURE__ */ new Date() - 0;
    var DOM_ATTRIBUTE_KEY = "_echarts_instance_";
    function init$1(dom, theme2, opts) {
      var isClient2 = !(opts && opts.ssr);
      if (isClient2) {
        var existInstance = getInstanceByDom(dom);
        if (existInstance) {
          return existInstance;
        }
      }
      var chart = new ECharts(dom, theme2, opts);
      chart.id = "ec_" + idBase++;
      instances[chart.id] = chart;
      isClient2 && setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id);
      enableConnect(chart);
      lifecycle.trigger("afterinit", chart);
      return chart;
    }
    function getInstanceByDom(dom) {
      return instances[getAttribute(dom, DOM_ATTRIBUTE_KEY)];
    }
    function registerTheme(name, theme2) {
      themeStorage[name] = theme2;
    }
    function registerPreprocessor(preprocessorFunc) {
      if (indexOf(optionPreprocessorFuncs, preprocessorFunc) < 0) {
        optionPreprocessorFuncs.push(preprocessorFunc);
      }
    }
    function registerProcessor(priority, processor) {
      normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_DEFAULT);
    }
    function registerPostInit(postInitFunc) {
      registerUpdateLifecycle("afterinit", postInitFunc);
    }
    function registerPostUpdate(postUpdateFunc) {
      registerUpdateLifecycle("afterupdate", postUpdateFunc);
    }
    function registerUpdateLifecycle(name, cb) {
      lifecycle.on(name, cb);
    }
    function registerAction$1(actionInfo2, eventName, action) {
      if (isFunction$1(eventName)) {
        action = eventName;
        eventName = "";
      }
      var actionType = isObject$5(actionInfo2) ? actionInfo2.type : [actionInfo2, actionInfo2 = {
        event: eventName
      }][0];
      actionInfo2.event = (actionInfo2.event || actionType).toLowerCase();
      eventName = actionInfo2.event;
      if (eventActionMap[eventName]) {
        return;
      }
      assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));
      if (!actions[actionType]) {
        actions[actionType] = {
          action,
          actionInfo: actionInfo2
        };
      }
      eventActionMap[eventName] = actionType;
    }
    function registerCoordinateSystem(type, coordSysCreator) {
      CoordinateSystemManager.register(type, coordSysCreator);
    }
    function registerLayout(priority, layoutTask) {
      normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, "layout");
    }
    function registerVisual(priority, visualTask) {
      normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, "visual");
    }
    var registeredTasks = [];
    function normalizeRegister(targetList, priority, fn2, defaultPriority, visualType) {
      if (isFunction$1(priority) || isObject$5(priority)) {
        fn2 = priority;
        priority = defaultPriority;
      }
      if (indexOf(registeredTasks, fn2) >= 0) {
        return;
      }
      registeredTasks.push(fn2);
      var stageHandler = Scheduler.wrapStageHandler(fn2, visualType);
      stageHandler.__prio = priority;
      stageHandler.__raw = fn2;
      targetList.push(stageHandler);
    }
    function registerLoading(name, loadingFx) {
      loadingEffects[name] = loadingFx;
    }
    function registerMap$1(mapName, geoJson, specialAreas) {
      var registerMap2 = getImpl("registerMap");
      registerMap2 && registerMap2(mapName, geoJson, specialAreas);
    }
    var registerTransform = registerExternalTransform;
    registerVisual(PRIORITY_VISUAL_GLOBAL, seriesStyleTask);
    registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataStyleTask);
    registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataColorPaletteTask);
    registerVisual(PRIORITY_VISUAL_GLOBAL, seriesSymbolTask);
    registerVisual(PRIORITY_VISUAL_CHART_DATA_CUSTOM, dataSymbolTask);
    registerVisual(PRIORITY_VISUAL_DECAL, decalVisual);
    registerPreprocessor(globalBackwardCompat);
    registerProcessor(PRIORITY_PROCESSOR_DATASTACK, dataStack);
    registerLoading("default", defaultLoading);
    registerAction$1({
      type: HIGHLIGHT_ACTION_TYPE,
      event: HIGHLIGHT_ACTION_TYPE,
      update: HIGHLIGHT_ACTION_TYPE
    }, noop$1);
    registerAction$1({
      type: DOWNPLAY_ACTION_TYPE,
      event: DOWNPLAY_ACTION_TYPE,
      update: DOWNPLAY_ACTION_TYPE
    }, noop$1);
    registerAction$1({
      type: SELECT_ACTION_TYPE,
      event: SELECT_ACTION_TYPE,
      update: SELECT_ACTION_TYPE
    }, noop$1);
    registerAction$1({
      type: UNSELECT_ACTION_TYPE,
      event: UNSELECT_ACTION_TYPE,
      update: UNSELECT_ACTION_TYPE
    }, noop$1);
    registerAction$1({
      type: TOGGLE_SELECT_ACTION_TYPE,
      event: TOGGLE_SELECT_ACTION_TYPE,
      update: TOGGLE_SELECT_ACTION_TYPE
    }, noop$1);
    registerTheme("light", lightTheme);
    registerTheme("dark", theme);
    var extensions = [];
    var extensionRegisters = {
      registerPreprocessor,
      registerProcessor,
      registerPostInit,
      registerPostUpdate,
      registerUpdateLifecycle,
      registerAction: registerAction$1,
      registerCoordinateSystem,
      registerLayout,
      registerVisual,
      registerTransform,
      registerLoading,
      registerMap: registerMap$1,
      registerImpl,
      PRIORITY,
      ComponentModel,
      ComponentView,
      SeriesModel,
      ChartView,
      // TODO Use ComponentModel and SeriesModel instead of Constructor
      registerComponentModel: function(ComponentModelClass) {
        ComponentModel.registerClass(ComponentModelClass);
      },
      registerComponentView: function(ComponentViewClass) {
        ComponentView.registerClass(ComponentViewClass);
      },
      registerSeriesModel: function(SeriesModelClass) {
        SeriesModel.registerClass(SeriesModelClass);
      },
      registerChartView: function(ChartViewClass) {
        ChartView.registerClass(ChartViewClass);
      },
      registerSubTypeDefaulter: function(componentType, defaulter) {
        ComponentModel.registerSubTypeDefaulter(componentType, defaulter);
      },
      registerPainter: function(painterType, PainterCtor) {
        registerPainter(painterType, PainterCtor);
      }
    };
    function use(ext) {
      if (isArray$2(ext)) {
        each$f(ext, function(singleExt) {
          use(singleExt);
        });
        return;
      }
      if (indexOf(extensions, ext) >= 0) {
        return;
      }
      extensions.push(ext);
      if (isFunction$1(ext)) {
        ext = {
          install: ext
        };
      }
      ext.install(extensionRegisters);
    }
    function dataIndexMapValueLength(valNumOrArrLengthMoreThan2) {
      return valNumOrArrLengthMoreThan2 == null ? 0 : valNumOrArrLengthMoreThan2.length || 1;
    }
    function defaultKeyGetter(item) {
      return item;
    }
    var DataDiffer = (
      /** @class */
      function() {
        function DataDiffer2(oldArr, newArr, oldKeyGetter, newKeyGetter, context, diffMode) {
          this._old = oldArr;
          this._new = newArr;
          this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;
          this._newKeyGetter = newKeyGetter || defaultKeyGetter;
          this.context = context;
          this._diffModeMultiple = diffMode === "multiple";
        }
        DataDiffer2.prototype.add = function(func) {
          this._add = func;
          return this;
        };
        DataDiffer2.prototype.update = function(func) {
          this._update = func;
          return this;
        };
        DataDiffer2.prototype.updateManyToOne = function(func) {
          this._updateManyToOne = func;
          return this;
        };
        DataDiffer2.prototype.updateOneToMany = function(func) {
          this._updateOneToMany = func;
          return this;
        };
        DataDiffer2.prototype.updateManyToMany = function(func) {
          this._updateManyToMany = func;
          return this;
        };
        DataDiffer2.prototype.remove = function(func) {
          this._remove = func;
          return this;
        };
        DataDiffer2.prototype.execute = function() {
          this[this._diffModeMultiple ? "_executeMultiple" : "_executeOneToOne"]();
        };
        DataDiffer2.prototype._executeOneToOne = function() {
          var oldArr = this._old;
          var newArr = this._new;
          var newDataIndexMap = {};
          var oldDataKeyArr = new Array(oldArr.length);
          var newDataKeyArr = new Array(newArr.length);
          this._initIndexMap(oldArr, null, oldDataKeyArr, "_oldKeyGetter");
          this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, "_newKeyGetter");
          for (var i2 = 0; i2 < oldArr.length; i2++) {
            var oldKey = oldDataKeyArr[i2];
            var newIdxMapVal = newDataIndexMap[oldKey];
            var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);
            if (newIdxMapValLen > 1) {
              var newIdx = newIdxMapVal.shift();
              if (newIdxMapVal.length === 1) {
                newDataIndexMap[oldKey] = newIdxMapVal[0];
              }
              this._update && this._update(newIdx, i2);
            } else if (newIdxMapValLen === 1) {
              newDataIndexMap[oldKey] = null;
              this._update && this._update(newIdxMapVal, i2);
            } else {
              this._remove && this._remove(i2);
            }
          }
          this._performRestAdd(newDataKeyArr, newDataIndexMap);
        };
        DataDiffer2.prototype._executeMultiple = function() {
          var oldArr = this._old;
          var newArr = this._new;
          var oldDataIndexMap = {};
          var newDataIndexMap = {};
          var oldDataKeyArr = [];
          var newDataKeyArr = [];
          this._initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, "_oldKeyGetter");
          this._initIndexMap(newArr, newDataIndexMap, newDataKeyArr, "_newKeyGetter");
          for (var i2 = 0; i2 < oldDataKeyArr.length; i2++) {
            var oldKey = oldDataKeyArr[i2];
            var oldIdxMapVal = oldDataIndexMap[oldKey];
            var newIdxMapVal = newDataIndexMap[oldKey];
            var oldIdxMapValLen = dataIndexMapValueLength(oldIdxMapVal);
            var newIdxMapValLen = dataIndexMapValueLength(newIdxMapVal);
            if (oldIdxMapValLen > 1 && newIdxMapValLen === 1) {
              this._updateManyToOne && this._updateManyToOne(newIdxMapVal, oldIdxMapVal);
              newDataIndexMap[oldKey] = null;
            } else if (oldIdxMapValLen === 1 && newIdxMapValLen > 1) {
              this._updateOneToMany && this._updateOneToMany(newIdxMapVal, oldIdxMapVal);
              newDataIndexMap[oldKey] = null;
            } else if (oldIdxMapValLen === 1 && newIdxMapValLen === 1) {
              this._update && this._update(newIdxMapVal, oldIdxMapVal);
              newDataIndexMap[oldKey] = null;
            } else if (oldIdxMapValLen > 1 && newIdxMapValLen > 1) {
              this._updateManyToMany && this._updateManyToMany(newIdxMapVal, oldIdxMapVal);
              newDataIndexMap[oldKey] = null;
            } else if (oldIdxMapValLen > 1) {
              for (var i_1 = 0; i_1 < oldIdxMapValLen; i_1++) {
                this._remove && this._remove(oldIdxMapVal[i_1]);
              }
            } else {
              this._remove && this._remove(oldIdxMapVal);
            }
          }
          this._performRestAdd(newDataKeyArr, newDataIndexMap);
        };
        DataDiffer2.prototype._performRestAdd = function(newDataKeyArr, newDataIndexMap) {
          for (var i2 = 0; i2 < newDataKeyArr.length; i2++) {
            var newKey = newDataKeyArr[i2];
            var newIdxMapVal = newDataIndexMap[newKey];
            var idxMapValLen = dataIndexMapValueLength(newIdxMapVal);
            if (idxMapValLen > 1) {
              for (var j = 0; j < idxMapValLen; j++) {
                this._add && this._add(newIdxMapVal[j]);
              }
            } else if (idxMapValLen === 1) {
              this._add && this._add(newIdxMapVal);
            }
            newDataIndexMap[newKey] = null;
          }
        };
        DataDiffer2.prototype._initIndexMap = function(arr, map2, keyArr, keyGetterName) {
          var cbModeMultiple = this._diffModeMultiple;
          for (var i2 = 0; i2 < arr.length; i2++) {
            var key = "_ec_" + this[keyGetterName](arr[i2], i2);
            if (!cbModeMultiple) {
              keyArr[i2] = key;
            }
            if (!map2) {
              continue;
            }
            var idxMapVal = map2[key];
            var idxMapValLen = dataIndexMapValueLength(idxMapVal);
            if (idxMapValLen === 0) {
              map2[key] = i2;
              if (cbModeMultiple) {
                keyArr.push(key);
              }
            } else if (idxMapValLen === 1) {
              map2[key] = [idxMapVal, i2];
            } else {
              idxMapVal.push(i2);
            }
          }
        };
        return DataDiffer2;
      }()
    );
    var DimensionUserOuput = (
      /** @class */
      function() {
        function DimensionUserOuput2(encode2, dimRequest) {
          this._encode = encode2;
          this._schema = dimRequest;
        }
        DimensionUserOuput2.prototype.get = function() {
          return {
            // Do not generate full dimension name until fist used.
            fullDimensions: this._getFullDimensionNames(),
            encode: this._encode
          };
        };
        DimensionUserOuput2.prototype._getFullDimensionNames = function() {
          if (!this._cachedDimNames) {
            this._cachedDimNames = this._schema ? this._schema.makeOutputDimensionNames() : [];
          }
          return this._cachedDimNames;
        };
        return DimensionUserOuput2;
      }()
    );
    function summarizeDimensions(data, schema) {
      var summary = {};
      var encode2 = summary.encode = {};
      var notExtraCoordDimMap = createHashMap();
      var defaultedLabel = [];
      var defaultedTooltip = [];
      var userOutputEncode = {};
      each$f(data.dimensions, function(dimName) {
        var dimItem = data.getDimensionInfo(dimName);
        var coordDim = dimItem.coordDim;
        if (coordDim) {
          var coordDimIndex = dimItem.coordDimIndex;
          getOrCreateEncodeArr(encode2, coordDim)[coordDimIndex] = dimName;
          if (!dimItem.isExtraCoord) {
            notExtraCoordDimMap.set(coordDim, 1);
            if (mayLabelDimType(dimItem.type)) {
              defaultedLabel[0] = dimName;
            }
            getOrCreateEncodeArr(userOutputEncode, coordDim)[coordDimIndex] = data.getDimensionIndex(dimItem.name);
          }
          if (dimItem.defaultTooltip) {
            defaultedTooltip.push(dimName);
          }
        }
        VISUAL_DIMENSIONS.each(function(v4, otherDim) {
          var encodeArr = getOrCreateEncodeArr(encode2, otherDim);
          var dimIndex = dimItem.otherDims[otherDim];
          if (dimIndex != null && dimIndex !== false) {
            encodeArr[dimIndex] = dimItem.name;
          }
        });
      });
      var dataDimsOnCoord = [];
      var encodeFirstDimNotExtra = {};
      notExtraCoordDimMap.each(function(v4, coordDim) {
        var dimArr = encode2[coordDim];
        encodeFirstDimNotExtra[coordDim] = dimArr[0];
        dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);
      });
      summary.dataDimsOnCoord = dataDimsOnCoord;
      summary.dataDimIndicesOnCoord = map$1(dataDimsOnCoord, function(dimName) {
        return data.getDimensionInfo(dimName).storeDimIndex;
      });
      summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;
      var encodeLabel = encode2.label;
      if (encodeLabel && encodeLabel.length) {
        defaultedLabel = encodeLabel.slice();
      }
      var encodeTooltip = encode2.tooltip;
      if (encodeTooltip && encodeTooltip.length) {
        defaultedTooltip = encodeTooltip.slice();
      } else if (!defaultedTooltip.length) {
        defaultedTooltip = defaultedLabel.slice();
      }
      encode2.defaultedLabel = defaultedLabel;
      encode2.defaultedTooltip = defaultedTooltip;
      summary.userOutput = new DimensionUserOuput(userOutputEncode, schema);
      return summary;
    }
    function getOrCreateEncodeArr(encode2, dim) {
      if (!encode2.hasOwnProperty(dim)) {
        encode2[dim] = [];
      }
      return encode2[dim];
    }
    function getDimensionTypeByAxis(axisType) {
      return axisType === "category" ? "ordinal" : axisType === "time" ? "time" : "float";
    }
    function mayLabelDimType(dimType) {
      return !(dimType === "ordinal" || dimType === "time");
    }
    var SeriesDimensionDefine = (
      /** @class */
      /* @__PURE__ */ function() {
        function SeriesDimensionDefine2(opt) {
          this.otherDims = {};
          if (opt != null) {
            extend$1(this, opt);
          }
        }
        return SeriesDimensionDefine2;
      }()
    );
    var inner$h = makeInner();
    var dimTypeShort = {
      float: "f",
      int: "i",
      ordinal: "o",
      number: "n",
      time: "t"
    };
    var SeriesDataSchema = (
      /** @class */
      function() {
        function SeriesDataSchema2(opt) {
          this.dimensions = opt.dimensions;
          this._dimOmitted = opt.dimensionOmitted;
          this.source = opt.source;
          this._fullDimCount = opt.fullDimensionCount;
          this._updateDimOmitted(opt.dimensionOmitted);
        }
        SeriesDataSchema2.prototype.isDimensionOmitted = function() {
          return this._dimOmitted;
        };
        SeriesDataSchema2.prototype._updateDimOmitted = function(dimensionOmitted) {
          this._dimOmitted = dimensionOmitted;
          if (!dimensionOmitted) {
            return;
          }
          if (!this._dimNameMap) {
            this._dimNameMap = ensureSourceDimNameMap(this.source);
          }
        };
        SeriesDataSchema2.prototype.getSourceDimensionIndex = function(dimName) {
          return retrieve2(this._dimNameMap.get(dimName), -1);
        };
        SeriesDataSchema2.prototype.getSourceDimension = function(dimIndex) {
          var dimensionsDefine = this.source.dimensionsDefine;
          if (dimensionsDefine) {
            return dimensionsDefine[dimIndex];
          }
        };
        SeriesDataSchema2.prototype.makeStoreSchema = function() {
          var dimCount = this._fullDimCount;
          var willRetrieveDataByName = shouldRetrieveDataByName(this.source);
          var makeHashStrict = !shouldOmitUnusedDimensions(dimCount);
          var dimHash = "";
          var dims = [];
          for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < dimCount; fullDimIdx++) {
            var property2 = void 0;
            var type = void 0;
            var ordinalMeta = void 0;
            var seriesDimDef = this.dimensions[seriesDimIdx];
            if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {
              property2 = willRetrieveDataByName ? seriesDimDef.name : null;
              type = seriesDimDef.type;
              ordinalMeta = seriesDimDef.ordinalMeta;
              seriesDimIdx++;
            } else {
              var sourceDimDef = this.getSourceDimension(fullDimIdx);
              if (sourceDimDef) {
                property2 = willRetrieveDataByName ? sourceDimDef.name : null;
                type = sourceDimDef.type;
              }
            }
            dims.push({
              property: property2,
              type,
              ordinalMeta
            });
            if (willRetrieveDataByName && property2 != null && (!seriesDimDef || !seriesDimDef.isCalculationCoord)) {
              dimHash += makeHashStrict ? property2.replace(/\`/g, "`1").replace(/\$/g, "`2") : property2;
            }
            dimHash += "$";
            dimHash += dimTypeShort[type] || "f";
            if (ordinalMeta) {
              dimHash += ordinalMeta.uid;
            }
            dimHash += "$";
          }
          var source = this.source;
          var hash = [source.seriesLayoutBy, source.startIndex, dimHash].join("$$");
          return {
            dimensions: dims,
            hash
          };
        };
        SeriesDataSchema2.prototype.makeOutputDimensionNames = function() {
          var result = [];
          for (var fullDimIdx = 0, seriesDimIdx = 0; fullDimIdx < this._fullDimCount; fullDimIdx++) {
            var name_1 = void 0;
            var seriesDimDef = this.dimensions[seriesDimIdx];
            if (seriesDimDef && seriesDimDef.storeDimIndex === fullDimIdx) {
              if (!seriesDimDef.isCalculationCoord) {
                name_1 = seriesDimDef.name;
              }
              seriesDimIdx++;
            } else {
              var sourceDimDef = this.getSourceDimension(fullDimIdx);
              if (sourceDimDef) {
                name_1 = sourceDimDef.name;
              }
            }
            result.push(name_1);
          }
          return result;
        };
        SeriesDataSchema2.prototype.appendCalculationDimension = function(dimDef) {
          this.dimensions.push(dimDef);
          dimDef.isCalculationCoord = true;
          this._fullDimCount++;
          this._updateDimOmitted(true);
        };
        return SeriesDataSchema2;
      }()
    );
    function isSeriesDataSchema(schema) {
      return schema instanceof SeriesDataSchema;
    }
    function createDimNameMap(dimsDef) {
      var dataDimNameMap = createHashMap();
      for (var i2 = 0; i2 < (dimsDef || []).length; i2++) {
        var dimDefItemRaw = dimsDef[i2];
        var userDimName = isObject$5(dimDefItemRaw) ? dimDefItemRaw.name : dimDefItemRaw;
        if (userDimName != null && dataDimNameMap.get(userDimName) == null) {
          dataDimNameMap.set(userDimName, i2);
        }
      }
      return dataDimNameMap;
    }
    function ensureSourceDimNameMap(source) {
      var innerSource = inner$h(source);
      return innerSource.dimNameMap || (innerSource.dimNameMap = createDimNameMap(source.dimensionsDefine));
    }
    function shouldOmitUnusedDimensions(dimCount) {
      return dimCount > 30;
    }
    var isObject$3 = isObject$5;
    var map = map$1;
    var CtorInt32Array = typeof Int32Array === "undefined" ? Array : Int32Array;
    var ID_PREFIX = "e\0\0";
    var INDEX_NOT_FOUND = -1;
    var TRANSFERABLE_PROPERTIES = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_dimSummary", "userOutput", "_rawData", "_dimValueGetter", "_nameDimIdx", "_idDimIdx", "_nameRepeatCount"];
    var CLONE_PROPERTIES = ["_approximateExtent"];
    var prepareInvertedIndex;
    var getId;
    var getIdNameFromStore;
    var normalizeDimensions;
    var transferProperties;
    var cloneListForMapAndSample;
    var makeIdFromName;
    var SeriesData = (
      /** @class */
      function() {
        function SeriesData2(dimensionsInput, hostModel) {
          this.type = "list";
          this._dimOmitted = false;
          this._nameList = [];
          this._idList = [];
          this._visual = {};
          this._layout = {};
          this._itemVisuals = [];
          this._itemLayouts = [];
          this._graphicEls = [];
          this._approximateExtent = {};
          this._calculationInfo = {};
          this.hasItemOption = false;
          this.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "minmaxDownSample", "lttbDownSample", "map"];
          this.CHANGABLE_METHODS = ["filterSelf", "selectRange"];
          this.DOWNSAMPLE_METHODS = ["downSample", "minmaxDownSample", "lttbDownSample"];
          var dimensions;
          var assignStoreDimIdx = false;
          if (isSeriesDataSchema(dimensionsInput)) {
            dimensions = dimensionsInput.dimensions;
            this._dimOmitted = dimensionsInput.isDimensionOmitted();
            this._schema = dimensionsInput;
          } else {
            assignStoreDimIdx = true;
            dimensions = dimensionsInput;
          }
          dimensions = dimensions || ["x", "y"];
          var dimensionInfos = {};
          var dimensionNames = [];
          var invertedIndicesMap = {};
          var needsHasOwn = false;
          var emptyObj = {};
          for (var i2 = 0; i2 < dimensions.length; i2++) {
            var dimInfoInput = dimensions[i2];
            var dimensionInfo = isString$1(dimInfoInput) ? new SeriesDimensionDefine({
              name: dimInfoInput
            }) : !(dimInfoInput instanceof SeriesDimensionDefine) ? new SeriesDimensionDefine(dimInfoInput) : dimInfoInput;
            var dimensionName = dimensionInfo.name;
            dimensionInfo.type = dimensionInfo.type || "float";
            if (!dimensionInfo.coordDim) {
              dimensionInfo.coordDim = dimensionName;
              dimensionInfo.coordDimIndex = 0;
            }
            var otherDims = dimensionInfo.otherDims = dimensionInfo.otherDims || {};
            dimensionNames.push(dimensionName);
            dimensionInfos[dimensionName] = dimensionInfo;
            if (emptyObj[dimensionName] != null) {
              needsHasOwn = true;
            }
            if (dimensionInfo.createInvertedIndices) {
              invertedIndicesMap[dimensionName] = [];
            }
            if (otherDims.itemName === 0) {
              this._nameDimIdx = i2;
            }
            if (otherDims.itemId === 0) {
              this._idDimIdx = i2;
            }
            if (assignStoreDimIdx) {
              dimensionInfo.storeDimIndex = i2;
            }
          }
          this.dimensions = dimensionNames;
          this._dimInfos = dimensionInfos;
          this._initGetDimensionInfo(needsHasOwn);
          this.hostModel = hostModel;
          this._invertedIndicesMap = invertedIndicesMap;
          if (this._dimOmitted) {
            var dimIdxToName_1 = this._dimIdxToName = createHashMap();
            each$f(dimensionNames, function(dimName) {
              dimIdxToName_1.set(dimensionInfos[dimName].storeDimIndex, dimName);
            });
          }
        }
        SeriesData2.prototype.getDimension = function(dim) {
          var dimIdx = this._recognizeDimIndex(dim);
          if (dimIdx == null) {
            return dim;
          }
          dimIdx = dim;
          if (!this._dimOmitted) {
            return this.dimensions[dimIdx];
          }
          var dimName = this._dimIdxToName.get(dimIdx);
          if (dimName != null) {
            return dimName;
          }
          var sourceDimDef = this._schema.getSourceDimension(dimIdx);
          if (sourceDimDef) {
            return sourceDimDef.name;
          }
        };
        SeriesData2.prototype.getDimensionIndex = function(dim) {
          var dimIdx = this._recognizeDimIndex(dim);
          if (dimIdx != null) {
            return dimIdx;
          }
          if (dim == null) {
            return -1;
          }
          var dimInfo = this._getDimInfo(dim);
          return dimInfo ? dimInfo.storeDimIndex : this._dimOmitted ? this._schema.getSourceDimensionIndex(dim) : -1;
        };
        SeriesData2.prototype._recognizeDimIndex = function(dim) {
          if (isNumber$1(dim) || dim != null && !isNaN(dim) && !this._getDimInfo(dim) && (!this._dimOmitted || this._schema.getSourceDimensionIndex(dim) < 0)) {
            return +dim;
          }
        };
        SeriesData2.prototype._getStoreDimIndex = function(dim) {
          var dimIdx = this.getDimensionIndex(dim);
          return dimIdx;
        };
        SeriesData2.prototype.getDimensionInfo = function(dim) {
          return this._getDimInfo(this.getDimension(dim));
        };
        SeriesData2.prototype._initGetDimensionInfo = function(needsHasOwn) {
          var dimensionInfos = this._dimInfos;
          this._getDimInfo = needsHasOwn ? function(dimName) {
            return dimensionInfos.hasOwnProperty(dimName) ? dimensionInfos[dimName] : void 0;
          } : function(dimName) {
            return dimensionInfos[dimName];
          };
        };
        SeriesData2.prototype.getDimensionsOnCoord = function() {
          return this._dimSummary.dataDimsOnCoord.slice();
        };
        SeriesData2.prototype.mapDimension = function(coordDim, idx) {
          var dimensionsSummary = this._dimSummary;
          if (idx == null) {
            return dimensionsSummary.encodeFirstDimNotExtra[coordDim];
          }
          var dims = dimensionsSummary.encode[coordDim];
          return dims ? dims[idx] : null;
        };
        SeriesData2.prototype.mapDimensionsAll = function(coordDim) {
          var dimensionsSummary = this._dimSummary;
          var dims = dimensionsSummary.encode[coordDim];
          return (dims || []).slice();
        };
        SeriesData2.prototype.getStore = function() {
          return this._store;
        };
        SeriesData2.prototype.initData = function(data, nameList, dimValueGetter) {
          var _this = this;
          var store2;
          if (data instanceof DataStore) {
            store2 = data;
          }
          if (!store2) {
            var dimensions = this.dimensions;
            var provider = isSourceInstance(data) || isArrayLike(data) ? new DefaultDataProvider(data, dimensions.length) : data;
            store2 = new DataStore();
            var dimensionInfos = map(dimensions, function(dimName) {
              return {
                type: _this._dimInfos[dimName].type,
                property: dimName
              };
            });
            store2.initData(provider, dimensionInfos, dimValueGetter);
          }
          this._store = store2;
          this._nameList = (nameList || []).slice();
          this._idList = [];
          this._nameRepeatCount = {};
          this._doInit(0, store2.count());
          this._dimSummary = summarizeDimensions(this, this._schema);
          this.userOutput = this._dimSummary.userOutput;
        };
        SeriesData2.prototype.appendData = function(data) {
          var range2 = this._store.appendData(data);
          this._doInit(range2[0], range2[1]);
        };
        SeriesData2.prototype.appendValues = function(values, names2) {
          var _a2 = this._store.appendValues(values, names2 && names2.length), start2 = _a2.start, end2 = _a2.end;
          var shouldMakeIdFromName = this._shouldMakeIdFromName();
          this._updateOrdinalMeta();
          if (names2) {
            for (var idx = start2; idx < end2; idx++) {
              var sourceIdx = idx - start2;
              this._nameList[idx] = names2[sourceIdx];
              if (shouldMakeIdFromName) {
                makeIdFromName(this, idx);
              }
            }
          }
        };
        SeriesData2.prototype._updateOrdinalMeta = function() {
          var store2 = this._store;
          var dimensions = this.dimensions;
          for (var i2 = 0; i2 < dimensions.length; i2++) {
            var dimInfo = this._dimInfos[dimensions[i2]];
            if (dimInfo.ordinalMeta) {
              store2.collectOrdinalMeta(dimInfo.storeDimIndex, dimInfo.ordinalMeta);
            }
          }
        };
        SeriesData2.prototype._shouldMakeIdFromName = function() {
          var provider = this._store.getProvider();
          return this._idDimIdx == null && provider.getSource().sourceFormat !== SOURCE_FORMAT_TYPED_ARRAY && !provider.fillStorage;
        };
        SeriesData2.prototype._doInit = function(start2, end2) {
          if (start2 >= end2) {
            return;
          }
          var store2 = this._store;
          var provider = store2.getProvider();
          this._updateOrdinalMeta();
          var nameList = this._nameList;
          var idList = this._idList;
          var sourceFormat = provider.getSource().sourceFormat;
          var isFormatOriginal = sourceFormat === SOURCE_FORMAT_ORIGINAL;
          if (isFormatOriginal && !provider.pure) {
            var sharedDataItem = [];
            for (var idx = start2; idx < end2; idx++) {
              var dataItem = provider.getItem(idx, sharedDataItem);
              if (!this.hasItemOption && isDataItemOption(dataItem)) {
                this.hasItemOption = true;
              }
              if (dataItem) {
                var itemName = dataItem.name;
                if (nameList[idx] == null && itemName != null) {
                  nameList[idx] = convertOptionIdName(itemName, null);
                }
                var itemId = dataItem.id;
                if (idList[idx] == null && itemId != null) {
                  idList[idx] = convertOptionIdName(itemId, null);
                }
              }
            }
          }
          if (this._shouldMakeIdFromName()) {
            for (var idx = start2; idx < end2; idx++) {
              makeIdFromName(this, idx);
            }
          }
          prepareInvertedIndex(this);
        };
        SeriesData2.prototype.getApproximateExtent = function(dim) {
          return this._approximateExtent[dim] || this._store.getDataExtent(this._getStoreDimIndex(dim));
        };
        SeriesData2.prototype.setApproximateExtent = function(extent3, dim) {
          dim = this.getDimension(dim);
          this._approximateExtent[dim] = extent3.slice();
        };
        SeriesData2.prototype.getCalculationInfo = function(key) {
          return this._calculationInfo[key];
        };
        SeriesData2.prototype.setCalculationInfo = function(key, value) {
          isObject$3(key) ? extend$1(this._calculationInfo, key) : this._calculationInfo[key] = value;
        };
        SeriesData2.prototype.getName = function(idx) {
          var rawIndex = this.getRawIndex(idx);
          var name = this._nameList[rawIndex];
          if (name == null && this._nameDimIdx != null) {
            name = getIdNameFromStore(this, this._nameDimIdx, rawIndex);
          }
          if (name == null) {
            name = "";
          }
          return name;
        };
        SeriesData2.prototype._getCategory = function(dimIdx, idx) {
          var ordinal = this._store.get(dimIdx, idx);
          var ordinalMeta = this._store.getOrdinalMeta(dimIdx);
          if (ordinalMeta) {
            return ordinalMeta.categories[ordinal];
          }
          return ordinal;
        };
        SeriesData2.prototype.getId = function(idx) {
          return getId(this, this.getRawIndex(idx));
        };
        SeriesData2.prototype.count = function() {
          return this._store.count();
        };
        SeriesData2.prototype.get = function(dim, idx) {
          var store2 = this._store;
          var dimInfo = this._dimInfos[dim];
          if (dimInfo) {
            return store2.get(dimInfo.storeDimIndex, idx);
          }
        };
        SeriesData2.prototype.getByRawIndex = function(dim, rawIdx) {
          var store2 = this._store;
          var dimInfo = this._dimInfos[dim];
          if (dimInfo) {
            return store2.getByRawIndex(dimInfo.storeDimIndex, rawIdx);
          }
        };
        SeriesData2.prototype.getIndices = function() {
          return this._store.getIndices();
        };
        SeriesData2.prototype.getDataExtent = function(dim) {
          return this._store.getDataExtent(this._getStoreDimIndex(dim));
        };
        SeriesData2.prototype.getSum = function(dim) {
          return this._store.getSum(this._getStoreDimIndex(dim));
        };
        SeriesData2.prototype.getMedian = function(dim) {
          return this._store.getMedian(this._getStoreDimIndex(dim));
        };
        SeriesData2.prototype.getValues = function(dimensions, idx) {
          var _this = this;
          var store2 = this._store;
          return isArray$2(dimensions) ? store2.getValues(map(dimensions, function(dim) {
            return _this._getStoreDimIndex(dim);
          }), idx) : store2.getValues(dimensions);
        };
        SeriesData2.prototype.hasValue = function(idx) {
          var dataDimIndicesOnCoord = this._dimSummary.dataDimIndicesOnCoord;
          for (var i2 = 0, len2 = dataDimIndicesOnCoord.length; i2 < len2; i2++) {
            if (isNaN(this._store.get(dataDimIndicesOnCoord[i2], idx))) {
              return false;
            }
          }
          return true;
        };
        SeriesData2.prototype.indexOfName = function(name) {
          for (var i2 = 0, len2 = this._store.count(); i2 < len2; i2++) {
            if (this.getName(i2) === name) {
              return i2;
            }
          }
          return -1;
        };
        SeriesData2.prototype.getRawIndex = function(idx) {
          return this._store.getRawIndex(idx);
        };
        SeriesData2.prototype.indexOfRawIndex = function(rawIndex) {
          return this._store.indexOfRawIndex(rawIndex);
        };
        SeriesData2.prototype.rawIndexOf = function(dim, value) {
          var invertedIndices = dim && this._invertedIndicesMap[dim];
          var rawIndex = invertedIndices && invertedIndices[value];
          if (rawIndex == null || isNaN(rawIndex)) {
            return INDEX_NOT_FOUND;
          }
          return rawIndex;
        };
        SeriesData2.prototype.indicesOfNearest = function(dim, value, maxDistance) {
          return this._store.indicesOfNearest(this._getStoreDimIndex(dim), value, maxDistance);
        };
        SeriesData2.prototype.each = function(dims, cb, ctx) {
          if (isFunction$1(dims)) {
            ctx = cb;
            cb = dims;
            dims = [];
          }
          var fCtx = ctx || this;
          var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);
          this._store.each(dimIndices, fCtx ? bind$2(cb, fCtx) : cb);
        };
        SeriesData2.prototype.filterSelf = function(dims, cb, ctx) {
          if (isFunction$1(dims)) {
            ctx = cb;
            cb = dims;
            dims = [];
          }
          var fCtx = ctx || this;
          var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);
          this._store = this._store.filter(dimIndices, fCtx ? bind$2(cb, fCtx) : cb);
          return this;
        };
        SeriesData2.prototype.selectRange = function(range2) {
          var _this = this;
          var innerRange = {};
          var dims = keys$1(range2);
          each$f(dims, function(dim) {
            var dimIdx = _this._getStoreDimIndex(dim);
            innerRange[dimIdx] = range2[dim];
          });
          this._store = this._store.selectRange(innerRange);
          return this;
        };
        SeriesData2.prototype.mapArray = function(dims, cb, ctx) {
          if (isFunction$1(dims)) {
            ctx = cb;
            cb = dims;
            dims = [];
          }
          ctx = ctx || this;
          var result = [];
          this.each(dims, function() {
            result.push(cb && cb.apply(this, arguments));
          }, ctx);
          return result;
        };
        SeriesData2.prototype.map = function(dims, cb, ctx, ctxCompat) {
          var fCtx = ctx || ctxCompat || this;
          var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);
          var list = cloneListForMapAndSample(this);
          list._store = this._store.map(dimIndices, fCtx ? bind$2(cb, fCtx) : cb);
          return list;
        };
        SeriesData2.prototype.modify = function(dims, cb, ctx, ctxCompat) {
          var fCtx = ctx || ctxCompat || this;
          var dimIndices = map(normalizeDimensions(dims), this._getStoreDimIndex, this);
          this._store.modify(dimIndices, fCtx ? bind$2(cb, fCtx) : cb);
        };
        SeriesData2.prototype.downSample = function(dimension, rate, sampleValue, sampleIndex) {
          var list = cloneListForMapAndSample(this);
          list._store = this._store.downSample(this._getStoreDimIndex(dimension), rate, sampleValue, sampleIndex);
          return list;
        };
        SeriesData2.prototype.minmaxDownSample = function(valueDimension, rate) {
          var list = cloneListForMapAndSample(this);
          list._store = this._store.minmaxDownSample(this._getStoreDimIndex(valueDimension), rate);
          return list;
        };
        SeriesData2.prototype.lttbDownSample = function(valueDimension, rate) {
          var list = cloneListForMapAndSample(this);
          list._store = this._store.lttbDownSample(this._getStoreDimIndex(valueDimension), rate);
          return list;
        };
        SeriesData2.prototype.getRawDataItem = function(idx) {
          return this._store.getRawDataItem(idx);
        };
        SeriesData2.prototype.getItemModel = function(idx) {
          var hostModel = this.hostModel;
          var dataItem = this.getRawDataItem(idx);
          return new Model(dataItem, hostModel, hostModel && hostModel.ecModel);
        };
        SeriesData2.prototype.diff = function(otherList) {
          var thisList = this;
          return new DataDiffer(otherList ? otherList.getStore().getIndices() : [], this.getStore().getIndices(), function(idx) {
            return getId(otherList, idx);
          }, function(idx) {
            return getId(thisList, idx);
          });
        };
        SeriesData2.prototype.getVisual = function(key) {
          var visual = this._visual;
          return visual && visual[key];
        };
        SeriesData2.prototype.setVisual = function(kvObj, val) {
          this._visual = this._visual || {};
          if (isObject$3(kvObj)) {
            extend$1(this._visual, kvObj);
          } else {
            this._visual[kvObj] = val;
          }
        };
        SeriesData2.prototype.getItemVisual = function(idx, key) {
          var itemVisual = this._itemVisuals[idx];
          var val = itemVisual && itemVisual[key];
          if (val == null) {
            return this.getVisual(key);
          }
          return val;
        };
        SeriesData2.prototype.hasItemVisual = function() {
          return this._itemVisuals.length > 0;
        };
        SeriesData2.prototype.ensureUniqueItemVisual = function(idx, key) {
          var itemVisuals = this._itemVisuals;
          var itemVisual = itemVisuals[idx];
          if (!itemVisual) {
            itemVisual = itemVisuals[idx] = {};
          }
          var val = itemVisual[key];
          if (val == null) {
            val = this.getVisual(key);
            if (isArray$2(val)) {
              val = val.slice();
            } else if (isObject$3(val)) {
              val = extend$1({}, val);
            }
            itemVisual[key] = val;
          }
          return val;
        };
        SeriesData2.prototype.setItemVisual = function(idx, key, value) {
          var itemVisual = this._itemVisuals[idx] || {};
          this._itemVisuals[idx] = itemVisual;
          if (isObject$3(key)) {
            extend$1(itemVisual, key);
          } else {
            itemVisual[key] = value;
          }
        };
        SeriesData2.prototype.clearAllVisual = function() {
          this._visual = {};
          this._itemVisuals = [];
        };
        SeriesData2.prototype.setLayout = function(key, val) {
          isObject$3(key) ? extend$1(this._layout, key) : this._layout[key] = val;
        };
        SeriesData2.prototype.getLayout = function(key) {
          return this._layout[key];
        };
        SeriesData2.prototype.getItemLayout = function(idx) {
          return this._itemLayouts[idx];
        };
        SeriesData2.prototype.setItemLayout = function(idx, layout2, merge2) {
          this._itemLayouts[idx] = merge2 ? extend$1(this._itemLayouts[idx] || {}, layout2) : layout2;
        };
        SeriesData2.prototype.clearItemLayouts = function() {
          this._itemLayouts.length = 0;
        };
        SeriesData2.prototype.setItemGraphicEl = function(idx, el) {
          var seriesIndex = this.hostModel && this.hostModel.seriesIndex;
          setCommonECData(seriesIndex, this.dataType, idx, el);
          this._graphicEls[idx] = el;
        };
        SeriesData2.prototype.getItemGraphicEl = function(idx) {
          return this._graphicEls[idx];
        };
        SeriesData2.prototype.eachItemGraphicEl = function(cb, context) {
          each$f(this._graphicEls, function(el, idx) {
            if (el) {
              cb && cb.call(context, el, idx);
            }
          });
        };
        SeriesData2.prototype.cloneShallow = function(list) {
          if (!list) {
            list = new SeriesData2(this._schema ? this._schema : map(this.dimensions, this._getDimInfo, this), this.hostModel);
          }
          transferProperties(list, this);
          list._store = this._store;
          return list;
        };
        SeriesData2.prototype.wrapMethod = function(methodName, injectFunction) {
          var originalMethod = this[methodName];
          if (!isFunction$1(originalMethod)) {
            return;
          }
          this.__wrappedMethods = this.__wrappedMethods || [];
          this.__wrappedMethods.push(methodName);
          this[methodName] = function() {
            var res = originalMethod.apply(this, arguments);
            return injectFunction.apply(this, [res].concat(slice(arguments)));
          };
        };
        SeriesData2.internalField = function() {
          prepareInvertedIndex = function(data) {
            var invertedIndicesMap = data._invertedIndicesMap;
            each$f(invertedIndicesMap, function(invertedIndices, dim) {
              var dimInfo = data._dimInfos[dim];
              var ordinalMeta = dimInfo.ordinalMeta;
              var store2 = data._store;
              if (ordinalMeta) {
                invertedIndices = invertedIndicesMap[dim] = new CtorInt32Array(ordinalMeta.categories.length);
                for (var i2 = 0; i2 < invertedIndices.length; i2++) {
                  invertedIndices[i2] = INDEX_NOT_FOUND;
                }
                for (var i2 = 0; i2 < store2.count(); i2++) {
                  invertedIndices[store2.get(dimInfo.storeDimIndex, i2)] = i2;
                }
              }
            });
          };
          getIdNameFromStore = function(data, dimIdx, idx) {
            return convertOptionIdName(data._getCategory(dimIdx, idx), null);
          };
          getId = function(data, rawIndex) {
            var id = data._idList[rawIndex];
            if (id == null && data._idDimIdx != null) {
              id = getIdNameFromStore(data, data._idDimIdx, rawIndex);
            }
            if (id == null) {
              id = ID_PREFIX + rawIndex;
            }
            return id;
          };
          normalizeDimensions = function(dimensions) {
            if (!isArray$2(dimensions)) {
              dimensions = dimensions != null ? [dimensions] : [];
            }
            return dimensions;
          };
          cloneListForMapAndSample = function(original) {
            var list = new SeriesData2(original._schema ? original._schema : map(original.dimensions, original._getDimInfo, original), original.hostModel);
            transferProperties(list, original);
            return list;
          };
          transferProperties = function(target, source) {
            each$f(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function(propName) {
              if (source.hasOwnProperty(propName)) {
                target[propName] = source[propName];
              }
            });
            target.__wrappedMethods = source.__wrappedMethods;
            each$f(CLONE_PROPERTIES, function(propName) {
              target[propName] = clone$4(source[propName]);
            });
            target._calculationInfo = extend$1({}, source._calculationInfo);
          };
          makeIdFromName = function(data, idx) {
            var nameList = data._nameList;
            var idList = data._idList;
            var nameDimIdx = data._nameDimIdx;
            var idDimIdx = data._idDimIdx;
            var name = nameList[idx];
            var id = idList[idx];
            if (name == null && nameDimIdx != null) {
              nameList[idx] = name = getIdNameFromStore(data, nameDimIdx, idx);
            }
            if (id == null && idDimIdx != null) {
              idList[idx] = id = getIdNameFromStore(data, idDimIdx, idx);
            }
            if (id == null && name != null) {
              var nameRepeatCount = data._nameRepeatCount;
              var nmCnt = nameRepeatCount[name] = (nameRepeatCount[name] || 0) + 1;
              id = name;
              if (nmCnt > 1) {
                id += "__ec__" + nmCnt;
              }
              idList[idx] = id;
            }
          };
        }();
        return SeriesData2;
      }()
    );
    function prepareSeriesDataSchema(source, opt) {
      if (!isSourceInstance(source)) {
        source = createSourceFromSeriesDataOption(source);
      }
      opt = opt || {};
      var sysDims = opt.coordDimensions || [];
      var dimsDef = opt.dimensionsDefine || source.dimensionsDefine || [];
      var coordDimNameMap = createHashMap();
      var resultList = [];
      var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimensionsCount);
      var omitUnusedDimensions = opt.canOmitUnusedDimensions && shouldOmitUnusedDimensions(dimCount);
      var isUsingSourceDimensionsDef = dimsDef === source.dimensionsDefine;
      var dataDimNameMap = isUsingSourceDimensionsDef ? ensureSourceDimNameMap(source) : createDimNameMap(dimsDef);
      var encodeDef = opt.encodeDefine;
      if (!encodeDef && opt.encodeDefaulter) {
        encodeDef = opt.encodeDefaulter(source, dimCount);
      }
      var encodeDefMap = createHashMap(encodeDef);
      var indicesMap = new CtorInt32Array$1(dimCount);
      for (var i2 = 0; i2 < indicesMap.length; i2++) {
        indicesMap[i2] = -1;
      }
      function getResultItem(dimIdx) {
        var idx = indicesMap[dimIdx];
        if (idx < 0) {
          var dimDefItemRaw = dimsDef[dimIdx];
          var dimDefItem = isObject$5(dimDefItemRaw) ? dimDefItemRaw : {
            name: dimDefItemRaw
          };
          var resultItem2 = new SeriesDimensionDefine();
          var userDimName = dimDefItem.name;
          if (userDimName != null && dataDimNameMap.get(userDimName) != null) {
            resultItem2.name = resultItem2.displayName = userDimName;
          }
          dimDefItem.type != null && (resultItem2.type = dimDefItem.type);
          dimDefItem.displayName != null && (resultItem2.displayName = dimDefItem.displayName);
          var newIdx = resultList.length;
          indicesMap[dimIdx] = newIdx;
          resultItem2.storeDimIndex = dimIdx;
          resultList.push(resultItem2);
          return resultItem2;
        }
        return resultList[idx];
      }
      if (!omitUnusedDimensions) {
        for (var i2 = 0; i2 < dimCount; i2++) {
          getResultItem(i2);
        }
      }
      encodeDefMap.each(function(dataDimsRaw, coordDim2) {
        var dataDims = normalizeToArray(dataDimsRaw).slice();
        if (dataDims.length === 1 && !isString$1(dataDims[0]) && dataDims[0] < 0) {
          encodeDefMap.set(coordDim2, false);
          return;
        }
        var validDataDims = encodeDefMap.set(coordDim2, []);
        each$f(dataDims, function(resultDimIdxOrName, idx) {
          var resultDimIdx2 = isString$1(resultDimIdxOrName) ? dataDimNameMap.get(resultDimIdxOrName) : resultDimIdxOrName;
          if (resultDimIdx2 != null && resultDimIdx2 < dimCount) {
            validDataDims[idx] = resultDimIdx2;
            applyDim(getResultItem(resultDimIdx2), coordDim2, idx);
          }
        });
      });
      var availDimIdx = 0;
      each$f(sysDims, function(sysDimItemRaw) {
        var coordDim2;
        var sysDimItemDimsDef;
        var sysDimItemOtherDims;
        var sysDimItem;
        if (isString$1(sysDimItemRaw)) {
          coordDim2 = sysDimItemRaw;
          sysDimItem = {};
        } else {
          sysDimItem = sysDimItemRaw;
          coordDim2 = sysDimItem.name;
          var ordinalMeta = sysDimItem.ordinalMeta;
          sysDimItem.ordinalMeta = null;
          sysDimItem = extend$1({}, sysDimItem);
          sysDimItem.ordinalMeta = ordinalMeta;
          sysDimItemDimsDef = sysDimItem.dimsDef;
          sysDimItemOtherDims = sysDimItem.otherDims;
          sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;
        }
        var dataDims = encodeDefMap.get(coordDim2);
        if (dataDims === false) {
          return;
        }
        dataDims = normalizeToArray(dataDims);
        if (!dataDims.length) {
          for (var i3 = 0; i3 < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i3++) {
            while (availDimIdx < dimCount && getResultItem(availDimIdx).coordDim != null) {
              availDimIdx++;
            }
            availDimIdx < dimCount && dataDims.push(availDimIdx++);
          }
        }
        each$f(dataDims, function(resultDimIdx2, coordDimIndex) {
          var resultItem2 = getResultItem(resultDimIdx2);
          if (isUsingSourceDimensionsDef && sysDimItem.type != null) {
            resultItem2.type = sysDimItem.type;
          }
          applyDim(defaults$1(resultItem2, sysDimItem), coordDim2, coordDimIndex);
          if (resultItem2.name == null && sysDimItemDimsDef) {
            var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];
            !isObject$5(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {
              name: sysDimItemDimsDefItem
            });
            resultItem2.name = resultItem2.displayName = sysDimItemDimsDefItem.name;
            resultItem2.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;
          }
          sysDimItemOtherDims && defaults$1(resultItem2.otherDims, sysDimItemOtherDims);
        });
      });
      function applyDim(resultItem2, coordDim2, coordDimIndex) {
        if (VISUAL_DIMENSIONS.get(coordDim2) != null) {
          resultItem2.otherDims[coordDim2] = coordDimIndex;
        } else {
          resultItem2.coordDim = coordDim2;
          resultItem2.coordDimIndex = coordDimIndex;
          coordDimNameMap.set(coordDim2, true);
        }
      }
      var generateCoord = opt.generateCoord;
      var generateCoordCount = opt.generateCoordCount;
      var fromZero = generateCoordCount != null;
      generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;
      var extra = generateCoord || "value";
      function ifNoNameFillWithCoordName(resultItem2) {
        if (resultItem2.name == null) {
          resultItem2.name = resultItem2.coordDim;
        }
      }
      if (!omitUnusedDimensions) {
        for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {
          var resultItem = getResultItem(resultDimIdx);
          var coordDim = resultItem.coordDim;
          if (coordDim == null) {
            resultItem.coordDim = genCoordDimName(extra, coordDimNameMap, fromZero);
            resultItem.coordDimIndex = 0;
            if (!generateCoord || generateCoordCount <= 0) {
              resultItem.isExtraCoord = true;
            }
            generateCoordCount--;
          }
          ifNoNameFillWithCoordName(resultItem);
          if (resultItem.type == null && (guessOrdinal(source, resultDimIdx) === BE_ORDINAL.Must || resultItem.isExtraCoord && (resultItem.otherDims.itemName != null || resultItem.otherDims.seriesName != null))) {
            resultItem.type = "ordinal";
          }
        }
      } else {
        each$f(resultList, function(resultItem2) {
          ifNoNameFillWithCoordName(resultItem2);
        });
        resultList.sort(function(item0, item1) {
          return item0.storeDimIndex - item1.storeDimIndex;
        });
      }
      removeDuplication(resultList);
      return new SeriesDataSchema({
        source,
        dimensions: resultList,
        fullDimensionCount: dimCount,
        dimensionOmitted: omitUnusedDimensions
      });
    }
    function removeDuplication(result) {
      var duplicationMap = createHashMap();
      for (var i2 = 0; i2 < result.length; i2++) {
        var dim = result[i2];
        var dimOriginalName = dim.name;
        var count2 = duplicationMap.get(dimOriginalName) || 0;
        if (count2 > 0) {
          dim.name = dimOriginalName + (count2 - 1);
        }
        count2++;
        duplicationMap.set(dimOriginalName, count2);
      }
    }
    function getDimCount(source, sysDims, dimsDef, optDimCount) {
      var dimCount = Math.max(source.dimensionsDetectedCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);
      each$f(sysDims, function(sysDimItem) {
        var sysDimItemDimsDef;
        if (isObject$5(sysDimItem) && (sysDimItemDimsDef = sysDimItem.dimsDef)) {
          dimCount = Math.max(dimCount, sysDimItemDimsDef.length);
        }
      });
      return dimCount;
    }
    function genCoordDimName(name, map2, fromZero) {
      if (fromZero || map2.hasKey(name)) {
        var i2 = 0;
        while (map2.hasKey(name + i2)) {
          i2++;
        }
        name += i2;
      }
      map2.set(name, true);
      return name;
    }
    var CoordSysInfo = (
      /** @class */
      /* @__PURE__ */ function() {
        function CoordSysInfo2(coordSysName) {
          this.coordSysDims = [];
          this.axisMap = createHashMap();
          this.categoryAxisMap = createHashMap();
          this.coordSysName = coordSysName;
        }
        return CoordSysInfo2;
      }()
    );
    function getCoordSysInfoBySeries(seriesModel) {
      var coordSysName = seriesModel.get("coordinateSystem");
      var result = new CoordSysInfo(coordSysName);
      var fetch2 = fetchers[coordSysName];
      if (fetch2) {
        fetch2(seriesModel, result, result.axisMap, result.categoryAxisMap);
        return result;
      }
    }
    var fetchers = {
      cartesian2d: function(seriesModel, result, axisMap, categoryAxisMap) {
        var xAxisModel = seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0];
        var yAxisModel = seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0];
        result.coordSysDims = ["x", "y"];
        axisMap.set("x", xAxisModel);
        axisMap.set("y", yAxisModel);
        if (isCategory(xAxisModel)) {
          categoryAxisMap.set("x", xAxisModel);
          result.firstCategoryDimIndex = 0;
        }
        if (isCategory(yAxisModel)) {
          categoryAxisMap.set("y", yAxisModel);
          result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);
        }
      },
      singleAxis: function(seriesModel, result, axisMap, categoryAxisMap) {
        var singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
        result.coordSysDims = ["single"];
        axisMap.set("single", singleAxisModel);
        if (isCategory(singleAxisModel)) {
          categoryAxisMap.set("single", singleAxisModel);
          result.firstCategoryDimIndex = 0;
        }
      },
      polar: function(seriesModel, result, axisMap, categoryAxisMap) {
        var polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0];
        var radiusAxisModel = polarModel.findAxisModel("radiusAxis");
        var angleAxisModel = polarModel.findAxisModel("angleAxis");
        result.coordSysDims = ["radius", "angle"];
        axisMap.set("radius", radiusAxisModel);
        axisMap.set("angle", angleAxisModel);
        if (isCategory(radiusAxisModel)) {
          categoryAxisMap.set("radius", radiusAxisModel);
          result.firstCategoryDimIndex = 0;
        }
        if (isCategory(angleAxisModel)) {
          categoryAxisMap.set("angle", angleAxisModel);
          result.firstCategoryDimIndex == null && (result.firstCategoryDimIndex = 1);
        }
      },
      geo: function(seriesModel, result, axisMap, categoryAxisMap) {
        result.coordSysDims = ["lng", "lat"];
      },
      parallel: function(seriesModel, result, axisMap, categoryAxisMap) {
        var ecModel = seriesModel.ecModel;
        var parallelModel = ecModel.getComponent("parallel", seriesModel.get("parallelIndex"));
        var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();
        each$f(parallelModel.parallelAxisIndex, function(axisIndex, index) {
          var axisModel = ecModel.getComponent("parallelAxis", axisIndex);
          var axisDim = coordSysDims[index];
          axisMap.set(axisDim, axisModel);
          if (isCategory(axisModel)) {
            categoryAxisMap.set(axisDim, axisModel);
            if (result.firstCategoryDimIndex == null) {
              result.firstCategoryDimIndex = index;
            }
          }
        });
      }
    };
    function isCategory(axisModel) {
      return axisModel.get("type") === "category";
    }
    function enableDataStack(seriesModel, dimensionsInput, opt) {
      opt = opt || {};
      var byIndex = opt.byIndex;
      var stackedCoordDimension = opt.stackedCoordDimension;
      var dimensionDefineList;
      var schema;
      var store2;
      if (isLegacyDimensionsInput(dimensionsInput)) {
        dimensionDefineList = dimensionsInput;
      } else {
        schema = dimensionsInput.schema;
        dimensionDefineList = schema.dimensions;
        store2 = dimensionsInput.store;
      }
      var mayStack = !!(seriesModel && seriesModel.get("stack"));
      var stackedByDimInfo;
      var stackedDimInfo;
      var stackResultDimension;
      var stackedOverDimension;
      each$f(dimensionDefineList, function(dimensionInfo, index) {
        if (isString$1(dimensionInfo)) {
          dimensionDefineList[index] = dimensionInfo = {
            name: dimensionInfo
          };
        }
        if (mayStack && !dimensionInfo.isExtraCoord) {
          if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) {
            stackedByDimInfo = dimensionInfo;
          }
          if (!stackedDimInfo && dimensionInfo.type !== "ordinal" && dimensionInfo.type !== "time" && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim)) {
            stackedDimInfo = dimensionInfo;
          }
        }
      });
      if (stackedDimInfo && !byIndex && !stackedByDimInfo) {
        byIndex = true;
      }
      if (stackedDimInfo) {
        stackResultDimension = "__\0ecstackresult_" + seriesModel.id;
        stackedOverDimension = "__\0ecstackedover_" + seriesModel.id;
        if (stackedByDimInfo) {
          stackedByDimInfo.createInvertedIndices = true;
        }
        var stackedDimCoordDim_1 = stackedDimInfo.coordDim;
        var stackedDimType = stackedDimInfo.type;
        var stackedDimCoordIndex_1 = 0;
        each$f(dimensionDefineList, function(dimensionInfo) {
          if (dimensionInfo.coordDim === stackedDimCoordDim_1) {
            stackedDimCoordIndex_1++;
          }
        });
        var stackedOverDimensionDefine = {
          name: stackResultDimension,
          coordDim: stackedDimCoordDim_1,
          coordDimIndex: stackedDimCoordIndex_1,
          type: stackedDimType,
          isExtraCoord: true,
          isCalculationCoord: true,
          storeDimIndex: dimensionDefineList.length
        };
        var stackResultDimensionDefine = {
          name: stackedOverDimension,
          // This dimension contains stack base (generally, 0), so do not set it as
          // `stackedDimCoordDim` to avoid extent calculation, consider log scale.
          coordDim: stackedOverDimension,
          coordDimIndex: stackedDimCoordIndex_1 + 1,
          type: stackedDimType,
          isExtraCoord: true,
          isCalculationCoord: true,
          storeDimIndex: dimensionDefineList.length + 1
        };
        if (schema) {
          if (store2) {
            stackedOverDimensionDefine.storeDimIndex = store2.ensureCalculationDimension(stackedOverDimension, stackedDimType);
            stackResultDimensionDefine.storeDimIndex = store2.ensureCalculationDimension(stackResultDimension, stackedDimType);
          }
          schema.appendCalculationDimension(stackedOverDimensionDefine);
          schema.appendCalculationDimension(stackResultDimensionDefine);
        } else {
          dimensionDefineList.push(stackedOverDimensionDefine);
          dimensionDefineList.push(stackResultDimensionDefine);
        }
      }
      return {
        stackedDimension: stackedDimInfo && stackedDimInfo.name,
        stackedByDimension: stackedByDimInfo && stackedByDimInfo.name,
        isStackedByIndex: byIndex,
        stackedOverDimension,
        stackResultDimension
      };
    }
    function isLegacyDimensionsInput(dimensionsInput) {
      return !isSeriesDataSchema(dimensionsInput.schema);
    }
    function isDimensionStacked(data, stackedDim) {
      return !!stackedDim && stackedDim === data.getCalculationInfo("stackedDimension");
    }
    function getStackedDimension(data, targetDim) {
      return isDimensionStacked(data, targetDim) ? data.getCalculationInfo("stackResultDimension") : targetDim;
    }
    function getCoordSysDimDefs(seriesModel, coordSysInfo) {
      var coordSysName = seriesModel.get("coordinateSystem");
      var registeredCoordSys = CoordinateSystemManager.get(coordSysName);
      var coordSysDimDefs;
      if (coordSysInfo && coordSysInfo.coordSysDims) {
        coordSysDimDefs = map$1(coordSysInfo.coordSysDims, function(dim) {
          var dimInfo = {
            name: dim
          };
          var axisModel = coordSysInfo.axisMap.get(dim);
          if (axisModel) {
            var axisType = axisModel.get("type");
            dimInfo.type = getDimensionTypeByAxis(axisType);
          }
          return dimInfo;
        });
      }
      if (!coordSysDimDefs) {
        coordSysDimDefs = registeredCoordSys && (registeredCoordSys.getDimensionsInfo ? registeredCoordSys.getDimensionsInfo() : registeredCoordSys.dimensions.slice()) || ["x", "y"];
      }
      return coordSysDimDefs;
    }
    function injectOrdinalMeta(dimInfoList, createInvertedIndices, coordSysInfo) {
      var firstCategoryDimIndex;
      var hasNameEncode;
      coordSysInfo && each$f(dimInfoList, function(dimInfo, dimIndex) {
        var coordDim = dimInfo.coordDim;
        var categoryAxisModel = coordSysInfo.categoryAxisMap.get(coordDim);
        if (categoryAxisModel) {
          if (firstCategoryDimIndex == null) {
            firstCategoryDimIndex = dimIndex;
          }
          dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta();
          if (createInvertedIndices) {
            dimInfo.createInvertedIndices = true;
          }
        }
        if (dimInfo.otherDims.itemName != null) {
          hasNameEncode = true;
        }
      });
      if (!hasNameEncode && firstCategoryDimIndex != null) {
        dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0;
      }
      return firstCategoryDimIndex;
    }
    function createSeriesData(sourceRaw, seriesModel, opt) {
      opt = opt || {};
      var sourceManager = seriesModel.getSourceManager();
      var source;
      var isOriginalSource = false;
      if (sourceRaw) {
        isOriginalSource = true;
        source = createSourceFromSeriesDataOption(sourceRaw);
      } else {
        source = sourceManager.getSource();
        isOriginalSource = source.sourceFormat === SOURCE_FORMAT_ORIGINAL;
      }
      var coordSysInfo = getCoordSysInfoBySeries(seriesModel);
      var coordSysDimDefs = getCoordSysDimDefs(seriesModel, coordSysInfo);
      var useEncodeDefaulter = opt.useEncodeDefaulter;
      var encodeDefaulter = isFunction$1(useEncodeDefaulter) ? useEncodeDefaulter : useEncodeDefaulter ? curry$1(makeSeriesEncodeForAxisCoordSys, coordSysDimDefs, seriesModel) : null;
      var createDimensionOptions = {
        coordDimensions: coordSysDimDefs,
        generateCoord: opt.generateCoord,
        encodeDefine: seriesModel.getEncode(),
        encodeDefaulter,
        canOmitUnusedDimensions: !isOriginalSource
      };
      var schema = prepareSeriesDataSchema(source, createDimensionOptions);
      var firstCategoryDimIndex = injectOrdinalMeta(schema.dimensions, opt.createInvertedIndices, coordSysInfo);
      var store2 = !isOriginalSource ? sourceManager.getSharedDataStore(schema) : null;
      var stackCalculationInfo = enableDataStack(seriesModel, {
        schema,
        store: store2
      });
      var data = new SeriesData(schema, seriesModel);
      data.setCalculationInfo(stackCalculationInfo);
      var dimValueGetter = firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source) ? function(itemOpt, dimName, dataIndex, dimIndex) {
        return dimIndex === firstCategoryDimIndex ? dataIndex : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex);
      } : null;
      data.hasItemOption = false;
      data.initData(
        // Try to reuse the data store in sourceManager if using dataset.
        isOriginalSource ? source : store2,
        null,
        dimValueGetter
      );
      return data;
    }
    function isNeedCompleteOrdinalData(source) {
      if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) {
        var sampleItem = firstDataNotNull(source.data || []);
        return !isArray$2(getDataItemValue(sampleItem));
      }
    }
    function firstDataNotNull(arr) {
      var i2 = 0;
      while (i2 < arr.length && arr[i2] == null) {
        i2++;
      }
      return arr[i2];
    }
    var Scale = (
      /** @class */
      function() {
        function Scale2(setting) {
          this._setting = setting || {};
          this._extent = [Infinity, -Infinity];
        }
        Scale2.prototype.getSetting = function(name) {
          return this._setting[name];
        };
        Scale2.prototype.unionExtent = function(other) {
          var extent3 = this._extent;
          other[0] < extent3[0] && (extent3[0] = other[0]);
          other[1] > extent3[1] && (extent3[1] = other[1]);
        };
        Scale2.prototype.unionExtentFromData = function(data, dim) {
          this.unionExtent(data.getApproximateExtent(dim));
        };
        Scale2.prototype.getExtent = function() {
          return this._extent.slice();
        };
        Scale2.prototype.setExtent = function(start2, end2) {
          var thisExtent = this._extent;
          if (!isNaN(start2)) {
            thisExtent[0] = start2;
          }
          if (!isNaN(end2)) {
            thisExtent[1] = end2;
          }
        };
        Scale2.prototype.isInExtentRange = function(value) {
          return this._extent[0] <= value && this._extent[1] >= value;
        };
        Scale2.prototype.isBlank = function() {
          return this._isBlank;
        };
        Scale2.prototype.setBlank = function(isBlank) {
          this._isBlank = isBlank;
        };
        return Scale2;
      }()
    );
    enableClassManagement(Scale);
    var uidBase = 0;
    var OrdinalMeta = (
      /** @class */
      function() {
        function OrdinalMeta2(opt) {
          this.categories = opt.categories || [];
          this._needCollect = opt.needCollect;
          this._deduplication = opt.deduplication;
          this.uid = ++uidBase;
        }
        OrdinalMeta2.createByAxisModel = function(axisModel) {
          var option = axisModel.option;
          var data = option.data;
          var categories = data && map$1(data, getName);
          return new OrdinalMeta2({
            categories,
            needCollect: !categories,
            // deduplication is default in axis.
            deduplication: option.dedplication !== false
          });
        };
        OrdinalMeta2.prototype.getOrdinal = function(category) {
          return this._getOrCreateMap().get(category);
        };
        OrdinalMeta2.prototype.parseAndCollect = function(category) {
          var index;
          var needCollect = this._needCollect;
          if (!isString$1(category) && !needCollect) {
            return category;
          }
          if (needCollect && !this._deduplication) {
            index = this.categories.length;
            this.categories[index] = category;
            return index;
          }
          var map2 = this._getOrCreateMap();
          index = map2.get(category);
          if (index == null) {
            if (needCollect) {
              index = this.categories.length;
              this.categories[index] = category;
              map2.set(category, index);
            } else {
              index = NaN;
            }
          }
          return index;
        };
        OrdinalMeta2.prototype._getOrCreateMap = function() {
          return this._map || (this._map = createHashMap(this.categories));
        };
        return OrdinalMeta2;
      }()
    );
    function getName(obj) {
      if (isObject$5(obj) && obj.value != null) {
        return obj.value;
      } else {
        return obj + "";
      }
    }
    function isIntervalOrLogScale(scale2) {
      return scale2.type === "interval" || scale2.type === "log";
    }
    function intervalScaleNiceTicks(extent3, splitNumber, minInterval, maxInterval) {
      var result = {};
      var span = extent3[1] - extent3[0];
      var interval = result.interval = nice(span / splitNumber);
      if (minInterval != null && interval < minInterval) {
        interval = result.interval = minInterval;
      }
      if (maxInterval != null && interval > maxInterval) {
        interval = result.interval = maxInterval;
      }
      var precision = result.intervalPrecision = getIntervalPrecision(interval);
      var niceTickExtent = result.niceTickExtent = [round$3(Math.ceil(extent3[0] / interval) * interval, precision), round$3(Math.floor(extent3[1] / interval) * interval, precision)];
      fixExtent(niceTickExtent, extent3);
      return result;
    }
    function increaseInterval(interval) {
      var exp10 = Math.pow(10, quantityExponent(interval));
      var f2 = interval / exp10;
      if (!f2) {
        f2 = 1;
      } else if (f2 === 2) {
        f2 = 3;
      } else if (f2 === 3) {
        f2 = 5;
      } else {
        f2 *= 2;
      }
      return round$3(f2 * exp10);
    }
    function getIntervalPrecision(interval) {
      return getPrecision(interval) + 2;
    }
    function clamp(niceTickExtent, idx, extent3) {
      niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent3[1]), extent3[0]);
    }
    function fixExtent(niceTickExtent, extent3) {
      !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent3[0]);
      !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent3[1]);
      clamp(niceTickExtent, 0, extent3);
      clamp(niceTickExtent, 1, extent3);
      if (niceTickExtent[0] > niceTickExtent[1]) {
        niceTickExtent[0] = niceTickExtent[1];
      }
    }
    function contain$1(val, extent3) {
      return val >= extent3[0] && val <= extent3[1];
    }
    function normalize$2(val, extent3) {
      if (extent3[1] === extent3[0]) {
        return 0.5;
      }
      return (val - extent3[0]) / (extent3[1] - extent3[0]);
    }
    function scale(val, extent3) {
      return val * (extent3[1] - extent3[0]) + extent3[0];
    }
    var OrdinalScale = (
      /** @class */
      function(_super) {
        __extends$1(OrdinalScale2, _super);
        function OrdinalScale2(setting) {
          var _this = _super.call(this, setting) || this;
          _this.type = "ordinal";
          var ordinalMeta = _this.getSetting("ordinalMeta");
          if (!ordinalMeta) {
            ordinalMeta = new OrdinalMeta({});
          }
          if (isArray$2(ordinalMeta)) {
            ordinalMeta = new OrdinalMeta({
              categories: map$1(ordinalMeta, function(item) {
                return isObject$5(item) ? item.value : item;
              })
            });
          }
          _this._ordinalMeta = ordinalMeta;
          _this._extent = _this.getSetting("extent") || [0, ordinalMeta.categories.length - 1];
          return _this;
        }
        OrdinalScale2.prototype.parse = function(val) {
          if (val == null) {
            return NaN;
          }
          return isString$1(val) ? this._ordinalMeta.getOrdinal(val) : Math.round(val);
        };
        OrdinalScale2.prototype.contain = function(rank) {
          rank = this.parse(rank);
          return contain$1(rank, this._extent) && this._ordinalMeta.categories[rank] != null;
        };
        OrdinalScale2.prototype.normalize = function(val) {
          val = this._getTickNumber(this.parse(val));
          return normalize$2(val, this._extent);
        };
        OrdinalScale2.prototype.scale = function(val) {
          val = Math.round(scale(val, this._extent));
          return this.getRawOrdinalNumber(val);
        };
        OrdinalScale2.prototype.getTicks = function() {
          var ticks = [];
          var extent3 = this._extent;
          var rank = extent3[0];
          while (rank <= extent3[1]) {
            ticks.push({
              value: rank
            });
            rank++;
          }
          return ticks;
        };
        OrdinalScale2.prototype.getMinorTicks = function(splitNumber) {
          return;
        };
        OrdinalScale2.prototype.setSortInfo = function(info) {
          if (info == null) {
            this._ordinalNumbersByTick = this._ticksByOrdinalNumber = null;
            return;
          }
          var infoOrdinalNumbers = info.ordinalNumbers;
          var ordinalsByTick = this._ordinalNumbersByTick = [];
          var ticksByOrdinal = this._ticksByOrdinalNumber = [];
          var tickNum = 0;
          var allCategoryLen = this._ordinalMeta.categories.length;
          for (var len2 = Math.min(allCategoryLen, infoOrdinalNumbers.length); tickNum < len2; ++tickNum) {
            var ordinalNumber = infoOrdinalNumbers[tickNum];
            ordinalsByTick[tickNum] = ordinalNumber;
            ticksByOrdinal[ordinalNumber] = tickNum;
          }
          var unusedOrdinal = 0;
          for (; tickNum < allCategoryLen; ++tickNum) {
            while (ticksByOrdinal[unusedOrdinal] != null) {
              unusedOrdinal++;
            }
            ordinalsByTick.push(unusedOrdinal);
            ticksByOrdinal[unusedOrdinal] = tickNum;
          }
        };
        OrdinalScale2.prototype._getTickNumber = function(ordinal) {
          var ticksByOrdinalNumber = this._ticksByOrdinalNumber;
          return ticksByOrdinalNumber && ordinal >= 0 && ordinal < ticksByOrdinalNumber.length ? ticksByOrdinalNumber[ordinal] : ordinal;
        };
        OrdinalScale2.prototype.getRawOrdinalNumber = function(tickNumber) {
          var ordinalNumbersByTick = this._ordinalNumbersByTick;
          return ordinalNumbersByTick && tickNumber >= 0 && tickNumber < ordinalNumbersByTick.length ? ordinalNumbersByTick[tickNumber] : tickNumber;
        };
        OrdinalScale2.prototype.getLabel = function(tick) {
          if (!this.isBlank()) {
            var ordinalNumber = this.getRawOrdinalNumber(tick.value);
            var cateogry = this._ordinalMeta.categories[ordinalNumber];
            return cateogry == null ? "" : cateogry + "";
          }
        };
        OrdinalScale2.prototype.count = function() {
          return this._extent[1] - this._extent[0] + 1;
        };
        OrdinalScale2.prototype.unionExtentFromData = function(data, dim) {
          this.unionExtent(data.getApproximateExtent(dim));
        };
        OrdinalScale2.prototype.isInExtentRange = function(value) {
          value = this._getTickNumber(value);
          return this._extent[0] <= value && this._extent[1] >= value;
        };
        OrdinalScale2.prototype.getOrdinalMeta = function() {
          return this._ordinalMeta;
        };
        OrdinalScale2.prototype.calcNiceTicks = function() {
        };
        OrdinalScale2.prototype.calcNiceExtent = function() {
        };
        OrdinalScale2.type = "ordinal";
        return OrdinalScale2;
      }(Scale)
    );
    Scale.registerClass(OrdinalScale);
    var roundNumber = round$3;
    var IntervalScale = (
      /** @class */
      function(_super) {
        __extends$1(IntervalScale2, _super);
        function IntervalScale2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "interval";
          _this._interval = 0;
          _this._intervalPrecision = 2;
          return _this;
        }
        IntervalScale2.prototype.parse = function(val) {
          return val;
        };
        IntervalScale2.prototype.contain = function(val) {
          return contain$1(val, this._extent);
        };
        IntervalScale2.prototype.normalize = function(val) {
          return normalize$2(val, this._extent);
        };
        IntervalScale2.prototype.scale = function(val) {
          return scale(val, this._extent);
        };
        IntervalScale2.prototype.setExtent = function(start2, end2) {
          var thisExtent = this._extent;
          if (!isNaN(start2)) {
            thisExtent[0] = parseFloat(start2);
          }
          if (!isNaN(end2)) {
            thisExtent[1] = parseFloat(end2);
          }
        };
        IntervalScale2.prototype.unionExtent = function(other) {
          var extent3 = this._extent;
          other[0] < extent3[0] && (extent3[0] = other[0]);
          other[1] > extent3[1] && (extent3[1] = other[1]);
          this.setExtent(extent3[0], extent3[1]);
        };
        IntervalScale2.prototype.getInterval = function() {
          return this._interval;
        };
        IntervalScale2.prototype.setInterval = function(interval) {
          this._interval = interval;
          this._niceExtent = this._extent.slice();
          this._intervalPrecision = getIntervalPrecision(interval);
        };
        IntervalScale2.prototype.getTicks = function(expandToNicedExtent) {
          var interval = this._interval;
          var extent3 = this._extent;
          var niceTickExtent = this._niceExtent;
          var intervalPrecision = this._intervalPrecision;
          var ticks = [];
          if (!interval) {
            return ticks;
          }
          var safeLimit = 1e4;
          if (extent3[0] < niceTickExtent[0]) {
            if (expandToNicedExtent) {
              ticks.push({
                value: roundNumber(niceTickExtent[0] - interval, intervalPrecision)
              });
            } else {
              ticks.push({
                value: extent3[0]
              });
            }
          }
          var tick = niceTickExtent[0];
          while (tick <= niceTickExtent[1]) {
            ticks.push({
              value: tick
            });
            tick = roundNumber(tick + interval, intervalPrecision);
            if (tick === ticks[ticks.length - 1].value) {
              break;
            }
            if (ticks.length > safeLimit) {
              return [];
            }
          }
          var lastNiceTick = ticks.length ? ticks[ticks.length - 1].value : niceTickExtent[1];
          if (extent3[1] > lastNiceTick) {
            if (expandToNicedExtent) {
              ticks.push({
                value: roundNumber(lastNiceTick + interval, intervalPrecision)
              });
            } else {
              ticks.push({
                value: extent3[1]
              });
            }
          }
          return ticks;
        };
        IntervalScale2.prototype.getMinorTicks = function(splitNumber) {
          var ticks = this.getTicks(true);
          var minorTicks = [];
          var extent3 = this.getExtent();
          for (var i2 = 1; i2 < ticks.length; i2++) {
            var nextTick2 = ticks[i2];
            var prevTick = ticks[i2 - 1];
            var count2 = 0;
            var minorTicksGroup = [];
            var interval = nextTick2.value - prevTick.value;
            var minorInterval = interval / splitNumber;
            while (count2 < splitNumber - 1) {
              var minorTick = roundNumber(prevTick.value + (count2 + 1) * minorInterval);
              if (minorTick > extent3[0] && minorTick < extent3[1]) {
                minorTicksGroup.push(minorTick);
              }
              count2++;
            }
            minorTicks.push(minorTicksGroup);
          }
          return minorTicks;
        };
        IntervalScale2.prototype.getLabel = function(data, opt) {
          if (data == null) {
            return "";
          }
          var precision = opt && opt.precision;
          if (precision == null) {
            precision = getPrecision(data.value) || 0;
          } else if (precision === "auto") {
            precision = this._intervalPrecision;
          }
          var dataNum = roundNumber(data.value, precision, true);
          return addCommas(dataNum);
        };
        IntervalScale2.prototype.calcNiceTicks = function(splitNumber, minInterval, maxInterval) {
          splitNumber = splitNumber || 5;
          var extent3 = this._extent;
          var span = extent3[1] - extent3[0];
          if (!isFinite(span)) {
            return;
          }
          if (span < 0) {
            span = -span;
            extent3.reverse();
          }
          var result = intervalScaleNiceTicks(extent3, splitNumber, minInterval, maxInterval);
          this._intervalPrecision = result.intervalPrecision;
          this._interval = result.interval;
          this._niceExtent = result.niceTickExtent;
        };
        IntervalScale2.prototype.calcNiceExtent = function(opt) {
          var extent3 = this._extent;
          if (extent3[0] === extent3[1]) {
            if (extent3[0] !== 0) {
              var expandSize = Math.abs(extent3[0]);
              if (!opt.fixMax) {
                extent3[1] += expandSize / 2;
                extent3[0] -= expandSize / 2;
              } else {
                extent3[0] -= expandSize / 2;
              }
            } else {
              extent3[1] = 1;
            }
          }
          var span = extent3[1] - extent3[0];
          if (!isFinite(span)) {
            extent3[0] = 0;
            extent3[1] = 1;
          }
          this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);
          var interval = this._interval;
          if (!opt.fixMin) {
            extent3[0] = roundNumber(Math.floor(extent3[0] / interval) * interval);
          }
          if (!opt.fixMax) {
            extent3[1] = roundNumber(Math.ceil(extent3[1] / interval) * interval);
          }
        };
        IntervalScale2.prototype.setNiceExtent = function(min3, max3) {
          this._niceExtent = [min3, max3];
        };
        IntervalScale2.type = "interval";
        return IntervalScale2;
      }(Scale)
    );
    Scale.registerClass(IntervalScale);
    var supportFloat32Array = typeof Float32Array !== "undefined";
    var Float32ArrayCtor = !supportFloat32Array ? Array : Float32Array;
    function createFloat32Array(arg) {
      if (isArray$2(arg)) {
        return supportFloat32Array ? new Float32Array(arg) : arg;
      }
      return new Float32ArrayCtor(arg);
    }
    var STACK_PREFIX = "__ec_stack_";
    function getSeriesStackId$1(seriesModel) {
      return seriesModel.get("stack") || STACK_PREFIX + seriesModel.seriesIndex;
    }
    function getAxisKey$1(axis) {
      return axis.dim + axis.index;
    }
    function getLayoutOnAxis(opt) {
      var params = [];
      var baseAxis = opt.axis;
      var axisKey = "axis0";
      if (baseAxis.type !== "category") {
        return;
      }
      var bandWidth = baseAxis.getBandWidth();
      for (var i2 = 0; i2 < opt.count || 0; i2++) {
        params.push(defaults$1({
          bandWidth,
          axisKey,
          stackId: STACK_PREFIX + i2
        }, opt));
      }
      var widthAndOffsets = doCalBarWidthAndOffset(params);
      var result = [];
      for (var i2 = 0; i2 < opt.count; i2++) {
        var item = widthAndOffsets[axisKey][STACK_PREFIX + i2];
        item.offsetCenter = item.offset + item.width / 2;
        result.push(item);
      }
      return result;
    }
    function prepareLayoutBarSeries(seriesType2, ecModel) {
      var seriesModels = [];
      ecModel.eachSeriesByType(seriesType2, function(seriesModel) {
        if (isOnCartesian(seriesModel)) {
          seriesModels.push(seriesModel);
        }
      });
      return seriesModels;
    }
    function getValueAxesMinGaps(barSeries) {
      var axisValues = {};
      each$f(barSeries, function(seriesModel) {
        var cartesian = seriesModel.coordinateSystem;
        var baseAxis = cartesian.getBaseAxis();
        if (baseAxis.type !== "time" && baseAxis.type !== "value") {
          return;
        }
        var data = seriesModel.getData();
        var key2 = baseAxis.dim + "_" + baseAxis.index;
        var dimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));
        var store2 = data.getStore();
        for (var i2 = 0, cnt = store2.count(); i2 < cnt; ++i2) {
          var value = store2.get(dimIdx, i2);
          if (!axisValues[key2]) {
            axisValues[key2] = [value];
          } else {
            axisValues[key2].push(value);
          }
        }
      });
      var axisMinGaps = {};
      for (var key in axisValues) {
        if (axisValues.hasOwnProperty(key)) {
          var valuesInAxis = axisValues[key];
          if (valuesInAxis) {
            valuesInAxis.sort(function(a2, b2) {
              return a2 - b2;
            });
            var min3 = null;
            for (var j = 1; j < valuesInAxis.length; ++j) {
              var delta = valuesInAxis[j] - valuesInAxis[j - 1];
              if (delta > 0) {
                min3 = min3 === null ? delta : Math.min(min3, delta);
              }
            }
            axisMinGaps[key] = min3;
          }
        }
      }
      return axisMinGaps;
    }
    function makeColumnLayout(barSeries) {
      var axisMinGaps = getValueAxesMinGaps(barSeries);
      var seriesInfoList = [];
      each$f(barSeries, function(seriesModel) {
        var cartesian = seriesModel.coordinateSystem;
        var baseAxis = cartesian.getBaseAxis();
        var axisExtent = baseAxis.getExtent();
        var bandWidth;
        if (baseAxis.type === "category") {
          bandWidth = baseAxis.getBandWidth();
        } else if (baseAxis.type === "value" || baseAxis.type === "time") {
          var key = baseAxis.dim + "_" + baseAxis.index;
          var minGap = axisMinGaps[key];
          var extentSpan = Math.abs(axisExtent[1] - axisExtent[0]);
          var scale2 = baseAxis.scale.getExtent();
          var scaleSpan = Math.abs(scale2[1] - scale2[0]);
          bandWidth = minGap ? extentSpan / scaleSpan * minGap : extentSpan;
        } else {
          var data = seriesModel.getData();
          bandWidth = Math.abs(axisExtent[1] - axisExtent[0]) / data.count();
        }
        var barWidth = parsePercent(seriesModel.get("barWidth"), bandWidth);
        var barMaxWidth = parsePercent(seriesModel.get("barMaxWidth"), bandWidth);
        var barMinWidth = parsePercent(
          // barMinWidth by default is 0.5 / 1 in cartesian. Because in value axis,
          // the auto-calculated bar width might be less than 0.5 / 1.
          seriesModel.get("barMinWidth") || (isInLargeMode(seriesModel) ? 0.5 : 1),
          bandWidth
        );
        var barGap = seriesModel.get("barGap");
        var barCategoryGap = seriesModel.get("barCategoryGap");
        seriesInfoList.push({
          bandWidth,
          barWidth,
          barMaxWidth,
          barMinWidth,
          barGap,
          barCategoryGap,
          axisKey: getAxisKey$1(baseAxis),
          stackId: getSeriesStackId$1(seriesModel)
        });
      });
      return doCalBarWidthAndOffset(seriesInfoList);
    }
    function doCalBarWidthAndOffset(seriesInfoList) {
      var columnsMap = {};
      each$f(seriesInfoList, function(seriesInfo, idx) {
        var axisKey = seriesInfo.axisKey;
        var bandWidth = seriesInfo.bandWidth;
        var columnsOnAxis = columnsMap[axisKey] || {
          bandWidth,
          remainedWidth: bandWidth,
          autoWidthCount: 0,
          categoryGap: null,
          gap: "20%",
          stacks: {}
        };
        var stacks = columnsOnAxis.stacks;
        columnsMap[axisKey] = columnsOnAxis;
        var stackId = seriesInfo.stackId;
        if (!stacks[stackId]) {
          columnsOnAxis.autoWidthCount++;
        }
        stacks[stackId] = stacks[stackId] || {
          width: 0,
          maxWidth: 0
        };
        var barWidth = seriesInfo.barWidth;
        if (barWidth && !stacks[stackId].width) {
          stacks[stackId].width = barWidth;
          barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
          columnsOnAxis.remainedWidth -= barWidth;
        }
        var barMaxWidth = seriesInfo.barMaxWidth;
        barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);
        var barMinWidth = seriesInfo.barMinWidth;
        barMinWidth && (stacks[stackId].minWidth = barMinWidth);
        var barGap = seriesInfo.barGap;
        barGap != null && (columnsOnAxis.gap = barGap);
        var barCategoryGap = seriesInfo.barCategoryGap;
        barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);
      });
      var result = {};
      each$f(columnsMap, function(columnsOnAxis, coordSysName) {
        result[coordSysName] = {};
        var stacks = columnsOnAxis.stacks;
        var bandWidth = columnsOnAxis.bandWidth;
        var categoryGapPercent = columnsOnAxis.categoryGap;
        if (categoryGapPercent == null) {
          var columnCount = keys$1(stacks).length;
          categoryGapPercent = Math.max(35 - columnCount * 4, 15) + "%";
        }
        var categoryGap = parsePercent(categoryGapPercent, bandWidth);
        var barGapPercent = parsePercent(columnsOnAxis.gap, 1);
        var remainedWidth = columnsOnAxis.remainedWidth;
        var autoWidthCount = columnsOnAxis.autoWidthCount;
        var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
        autoWidth = Math.max(autoWidth, 0);
        each$f(stacks, function(column) {
          var maxWidth = column.maxWidth;
          var minWidth = column.minWidth;
          if (!column.width) {
            var finalWidth = autoWidth;
            if (maxWidth && maxWidth < finalWidth) {
              finalWidth = Math.min(maxWidth, remainedWidth);
            }
            if (minWidth && minWidth > finalWidth) {
              finalWidth = minWidth;
            }
            if (finalWidth !== autoWidth) {
              column.width = finalWidth;
              remainedWidth -= finalWidth + barGapPercent * finalWidth;
              autoWidthCount--;
            }
          } else {
            var finalWidth = column.width;
            if (maxWidth) {
              finalWidth = Math.min(finalWidth, maxWidth);
            }
            if (minWidth) {
              finalWidth = Math.max(finalWidth, minWidth);
            }
            column.width = finalWidth;
            remainedWidth -= finalWidth + barGapPercent * finalWidth;
            autoWidthCount--;
          }
        });
        autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
        autoWidth = Math.max(autoWidth, 0);
        var widthSum = 0;
        var lastColumn;
        each$f(stacks, function(column, idx) {
          if (!column.width) {
            column.width = autoWidth;
          }
          lastColumn = column;
          widthSum += column.width * (1 + barGapPercent);
        });
        if (lastColumn) {
          widthSum -= lastColumn.width * barGapPercent;
        }
        var offset2 = -widthSum / 2;
        each$f(stacks, function(column, stackId) {
          result[coordSysName][stackId] = result[coordSysName][stackId] || {
            bandWidth,
            offset: offset2,
            width: column.width
          };
          offset2 += column.width * (1 + barGapPercent);
        });
      });
      return result;
    }
    function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) {
      if (barWidthAndOffset && axis) {
        var result = barWidthAndOffset[getAxisKey$1(axis)];
        return result;
      }
    }
    function layout$3(seriesType2, ecModel) {
      var seriesModels = prepareLayoutBarSeries(seriesType2, ecModel);
      var barWidthAndOffset = makeColumnLayout(seriesModels);
      each$f(seriesModels, function(seriesModel) {
        var data = seriesModel.getData();
        var cartesian = seriesModel.coordinateSystem;
        var baseAxis = cartesian.getBaseAxis();
        var stackId = getSeriesStackId$1(seriesModel);
        var columnLayoutInfo = barWidthAndOffset[getAxisKey$1(baseAxis)][stackId];
        var columnOffset = columnLayoutInfo.offset;
        var columnWidth = columnLayoutInfo.width;
        data.setLayout({
          bandWidth: columnLayoutInfo.bandWidth,
          offset: columnOffset,
          size: columnWidth
        });
      });
    }
    function createProgressiveLayout(seriesType2) {
      return {
        seriesType: seriesType2,
        plan: createRenderPlanner(),
        reset: function(seriesModel) {
          if (!isOnCartesian(seriesModel)) {
            return;
          }
          var data = seriesModel.getData();
          var cartesian = seriesModel.coordinateSystem;
          var baseAxis = cartesian.getBaseAxis();
          var valueAxis2 = cartesian.getOtherAxis(baseAxis);
          var valueDimIdx = data.getDimensionIndex(data.mapDimension(valueAxis2.dim));
          var baseDimIdx = data.getDimensionIndex(data.mapDimension(baseAxis.dim));
          var drawBackground = seriesModel.get("showBackground", true);
          var valueDim = data.mapDimension(valueAxis2.dim);
          var stackResultDim = data.getCalculationInfo("stackResultDimension");
          var stacked = isDimensionStacked(data, valueDim) && !!data.getCalculationInfo("stackedOnSeries");
          var isValueAxisH = valueAxis2.isHorizontal();
          var valueAxisStart = getValueAxisStart(baseAxis, valueAxis2);
          var isLarge = isInLargeMode(seriesModel);
          var barMinHeight = seriesModel.get("barMinHeight") || 0;
          var stackedDimIdx = stackResultDim && data.getDimensionIndex(stackResultDim);
          var columnWidth = data.getLayout("size");
          var columnOffset = data.getLayout("offset");
          return {
            progress: function(params, data2) {
              var count2 = params.count;
              var largePoints = isLarge && createFloat32Array(count2 * 3);
              var largeBackgroundPoints = isLarge && drawBackground && createFloat32Array(count2 * 3);
              var largeDataIndices = isLarge && createFloat32Array(count2);
              var coordLayout = cartesian.master.getRect();
              var bgSize = isValueAxisH ? coordLayout.width : coordLayout.height;
              var dataIndex;
              var store2 = data2.getStore();
              var idxOffset = 0;
              while ((dataIndex = params.next()) != null) {
                var value = store2.get(stacked ? stackedDimIdx : valueDimIdx, dataIndex);
                var baseValue = store2.get(baseDimIdx, dataIndex);
                var baseCoord = valueAxisStart;
                var stackStartValue = void 0;
                if (stacked) {
                  stackStartValue = +value - store2.get(valueDimIdx, dataIndex);
                }
                var x2 = void 0;
                var y = void 0;
                var width = void 0;
                var height = void 0;
                if (isValueAxisH) {
                  var coord = cartesian.dataToPoint([value, baseValue]);
                  if (stacked) {
                    var startCoord = cartesian.dataToPoint([stackStartValue, baseValue]);
                    baseCoord = startCoord[0];
                  }
                  x2 = baseCoord;
                  y = coord[1] + columnOffset;
                  width = coord[0] - baseCoord;
                  height = columnWidth;
                  if (Math.abs(width) < barMinHeight) {
                    width = (width < 0 ? -1 : 1) * barMinHeight;
                  }
                } else {
                  var coord = cartesian.dataToPoint([baseValue, value]);
                  if (stacked) {
                    var startCoord = cartesian.dataToPoint([baseValue, stackStartValue]);
                    baseCoord = startCoord[1];
                  }
                  x2 = coord[0] + columnOffset;
                  y = baseCoord;
                  width = columnWidth;
                  height = coord[1] - baseCoord;
                  if (Math.abs(height) < barMinHeight) {
                    height = (height <= 0 ? -1 : 1) * barMinHeight;
                  }
                }
                if (!isLarge) {
                  data2.setItemLayout(dataIndex, {
                    x: x2,
                    y,
                    width,
                    height
                  });
                } else {
                  largePoints[idxOffset] = x2;
                  largePoints[idxOffset + 1] = y;
                  largePoints[idxOffset + 2] = isValueAxisH ? width : height;
                  if (largeBackgroundPoints) {
                    largeBackgroundPoints[idxOffset] = isValueAxisH ? coordLayout.x : x2;
                    largeBackgroundPoints[idxOffset + 1] = isValueAxisH ? y : coordLayout.y;
                    largeBackgroundPoints[idxOffset + 2] = bgSize;
                  }
                  largeDataIndices[dataIndex] = dataIndex;
                }
                idxOffset += 3;
              }
              if (isLarge) {
                data2.setLayout({
                  largePoints,
                  largeDataIndices,
                  largeBackgroundPoints,
                  valueAxisHorizontal: isValueAxisH
                });
              }
            }
          };
        }
      };
    }
    function isOnCartesian(seriesModel) {
      return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "cartesian2d";
    }
    function isInLargeMode(seriesModel) {
      return seriesModel.pipelineContext && seriesModel.pipelineContext.large;
    }
    function getValueAxisStart(baseAxis, valueAxis2) {
      var startValue = valueAxis2.model.get("startValue");
      if (!startValue) {
        startValue = 0;
      }
      return valueAxis2.toGlobalCoord(valueAxis2.dataToCoord(valueAxis2.type === "log" ? startValue > 0 ? startValue : 1 : startValue));
    }
    var bisect = function(a2, x2, lo, hi) {
      while (lo < hi) {
        var mid = lo + hi >>> 1;
        if (a2[mid][1] < x2) {
          lo = mid + 1;
        } else {
          hi = mid;
        }
      }
      return lo;
    };
    var TimeScale = (
      /** @class */
      function(_super) {
        __extends$1(TimeScale2, _super);
        function TimeScale2(settings) {
          var _this = _super.call(this, settings) || this;
          _this.type = "time";
          return _this;
        }
        TimeScale2.prototype.getLabel = function(tick) {
          var useUTC = this.getSetting("useUTC");
          return format(tick.value, fullLeveledFormatter[getDefaultFormatPrecisionOfInterval(getPrimaryTimeUnit(this._minLevelUnit))] || fullLeveledFormatter.second, useUTC, this.getSetting("locale"));
        };
        TimeScale2.prototype.getFormattedLabel = function(tick, idx, labelFormatter) {
          var isUTC = this.getSetting("useUTC");
          var lang = this.getSetting("locale");
          return leveledFormat(tick, idx, labelFormatter, lang, isUTC);
        };
        TimeScale2.prototype.getTicks = function() {
          var interval = this._interval;
          var extent3 = this._extent;
          var ticks = [];
          if (!interval) {
            return ticks;
          }
          ticks.push({
            value: extent3[0],
            level: 0
          });
          var useUTC = this.getSetting("useUTC");
          var innerTicks = getIntervalTicks(this._minLevelUnit, this._approxInterval, useUTC, extent3);
          ticks = ticks.concat(innerTicks);
          ticks.push({
            value: extent3[1],
            level: 0
          });
          return ticks;
        };
        TimeScale2.prototype.calcNiceExtent = function(opt) {
          var extent3 = this._extent;
          if (extent3[0] === extent3[1]) {
            extent3[0] -= ONE_DAY;
            extent3[1] += ONE_DAY;
          }
          if (extent3[1] === -Infinity && extent3[0] === Infinity) {
            var d2 = /* @__PURE__ */ new Date();
            extent3[1] = +new Date(d2.getFullYear(), d2.getMonth(), d2.getDate());
            extent3[0] = extent3[1] - ONE_DAY;
          }
          this.calcNiceTicks(opt.splitNumber, opt.minInterval, opt.maxInterval);
        };
        TimeScale2.prototype.calcNiceTicks = function(approxTickNum, minInterval, maxInterval) {
          approxTickNum = approxTickNum || 10;
          var extent3 = this._extent;
          var span = extent3[1] - extent3[0];
          this._approxInterval = span / approxTickNum;
          if (minInterval != null && this._approxInterval < minInterval) {
            this._approxInterval = minInterval;
          }
          if (maxInterval != null && this._approxInterval > maxInterval) {
            this._approxInterval = maxInterval;
          }
          var scaleIntervalsLen = scaleIntervals.length;
          var idx = Math.min(bisect(scaleIntervals, this._approxInterval, 0, scaleIntervalsLen), scaleIntervalsLen - 1);
          this._interval = scaleIntervals[idx][1];
          this._minLevelUnit = scaleIntervals[Math.max(idx - 1, 0)][0];
        };
        TimeScale2.prototype.parse = function(val) {
          return isNumber$1(val) ? val : +parseDate$1(val);
        };
        TimeScale2.prototype.contain = function(val) {
          return contain$1(this.parse(val), this._extent);
        };
        TimeScale2.prototype.normalize = function(val) {
          return normalize$2(this.parse(val), this._extent);
        };
        TimeScale2.prototype.scale = function(val) {
          return scale(val, this._extent);
        };
        TimeScale2.type = "time";
        return TimeScale2;
      }(IntervalScale)
    );
    var scaleIntervals = [
      // Format                           interval
      ["second", ONE_SECOND],
      ["minute", ONE_MINUTE],
      ["hour", ONE_HOUR],
      ["quarter-day", ONE_HOUR * 6],
      ["half-day", ONE_HOUR * 12],
      ["day", ONE_DAY * 1.2],
      ["half-week", ONE_DAY * 3.5],
      ["week", ONE_DAY * 7],
      ["month", ONE_DAY * 31],
      ["quarter", ONE_DAY * 95],
      ["half-year", ONE_YEAR / 2],
      ["year", ONE_YEAR]
      // 1Y
    ];
    function isUnitValueSame(unit2, valueA, valueB, isUTC) {
      var dateA = parseDate$1(valueA);
      var dateB = parseDate$1(valueB);
      var isSame = function(unit22) {
        return getUnitValue(dateA, unit22, isUTC) === getUnitValue(dateB, unit22, isUTC);
      };
      var isSameYear = function() {
        return isSame("year");
      };
      var isSameMonth = function() {
        return isSameYear() && isSame("month");
      };
      var isSameDay = function() {
        return isSameMonth() && isSame("day");
      };
      var isSameHour = function() {
        return isSameDay() && isSame("hour");
      };
      var isSameMinute = function() {
        return isSameHour() && isSame("minute");
      };
      var isSameSecond = function() {
        return isSameMinute() && isSame("second");
      };
      var isSameMilliSecond = function() {
        return isSameSecond() && isSame("millisecond");
      };
      switch (unit2) {
        case "year":
          return isSameYear();
        case "month":
          return isSameMonth();
        case "day":
          return isSameDay();
        case "hour":
          return isSameHour();
        case "minute":
          return isSameMinute();
        case "second":
          return isSameSecond();
        case "millisecond":
          return isSameMilliSecond();
      }
    }
    function getDateInterval(approxInterval, daysInMonth) {
      approxInterval /= ONE_DAY;
      return approxInterval > 16 ? 16 : approxInterval > 7.5 ? 7 : approxInterval > 3.5 ? 4 : approxInterval > 1.5 ? 2 : 1;
    }
    function getMonthInterval(approxInterval) {
      var APPROX_ONE_MONTH = 30 * ONE_DAY;
      approxInterval /= APPROX_ONE_MONTH;
      return approxInterval > 6 ? 6 : approxInterval > 3 ? 3 : approxInterval > 2 ? 2 : 1;
    }
    function getHourInterval(approxInterval) {
      approxInterval /= ONE_HOUR;
      return approxInterval > 12 ? 12 : approxInterval > 6 ? 6 : approxInterval > 3.5 ? 4 : approxInterval > 2 ? 2 : 1;
    }
    function getMinutesAndSecondsInterval(approxInterval, isMinutes) {
      approxInterval /= isMinutes ? ONE_MINUTE : ONE_SECOND;
      return approxInterval > 30 ? 30 : approxInterval > 20 ? 20 : approxInterval > 15 ? 15 : approxInterval > 10 ? 10 : approxInterval > 5 ? 5 : approxInterval > 2 ? 2 : 1;
    }
    function getMillisecondsInterval(approxInterval) {
      return nice(approxInterval);
    }
    function getFirstTimestampOfUnit(date, unitName, isUTC) {
      var outDate = new Date(date);
      switch (getPrimaryTimeUnit(unitName)) {
        case "year":
        case "month":
          outDate[monthSetterName(isUTC)](0);
        case "day":
          outDate[dateSetterName(isUTC)](1);
        case "hour":
          outDate[hoursSetterName(isUTC)](0);
        case "minute":
          outDate[minutesSetterName(isUTC)](0);
        case "second":
          outDate[secondsSetterName(isUTC)](0);
          outDate[millisecondsSetterName(isUTC)](0);
      }
      return outDate.getTime();
    }
    function getIntervalTicks(bottomUnitName, approxInterval, isUTC, extent3) {
      var safeLimit = 1e4;
      var unitNames = timeUnits;
      var iter = 0;
      function addTicksInSpan(interval, minTimestamp, maxTimestamp, getMethodName, setMethodName, isDate2, out2) {
        var date = new Date(minTimestamp);
        var dateTime = minTimestamp;
        var d2 = date[getMethodName]();
        while (dateTime < maxTimestamp && dateTime <= extent3[1]) {
          out2.push({
            value: dateTime
          });
          d2 += interval;
          date[setMethodName](d2);
          dateTime = date.getTime();
        }
        out2.push({
          value: dateTime,
          notAdd: true
        });
      }
      function addLevelTicks(unitName, lastLevelTicks, levelTicks2) {
        var newAddedTicks = [];
        var isFirstLevel = !lastLevelTicks.length;
        if (isUnitValueSame(getPrimaryTimeUnit(unitName), extent3[0], extent3[1], isUTC)) {
          return;
        }
        if (isFirstLevel) {
          lastLevelTicks = [{
            // TODO Optimize. Not include so may ticks.
            value: getFirstTimestampOfUnit(new Date(extent3[0]), unitName, isUTC)
          }, {
            value: extent3[1]
          }];
        }
        for (var i22 = 0; i22 < lastLevelTicks.length - 1; i22++) {
          var startTick = lastLevelTicks[i22].value;
          var endTick = lastLevelTicks[i22 + 1].value;
          if (startTick === endTick) {
            continue;
          }
          var interval = void 0;
          var getterName = void 0;
          var setterName = void 0;
          var isDate2 = false;
          switch (unitName) {
            case "year":
              interval = Math.max(1, Math.round(approxInterval / ONE_DAY / 365));
              getterName = fullYearGetterName(isUTC);
              setterName = fullYearSetterName(isUTC);
              break;
            case "half-year":
            case "quarter":
            case "month":
              interval = getMonthInterval(approxInterval);
              getterName = monthGetterName(isUTC);
              setterName = monthSetterName(isUTC);
              break;
            case "week":
            // PENDING If week is added. Ignore day.
            case "half-week":
            case "day":
              interval = getDateInterval(approxInterval);
              getterName = dateGetterName(isUTC);
              setterName = dateSetterName(isUTC);
              isDate2 = true;
              break;
            case "half-day":
            case "quarter-day":
            case "hour":
              interval = getHourInterval(approxInterval);
              getterName = hoursGetterName(isUTC);
              setterName = hoursSetterName(isUTC);
              break;
            case "minute":
              interval = getMinutesAndSecondsInterval(approxInterval, true);
              getterName = minutesGetterName(isUTC);
              setterName = minutesSetterName(isUTC);
              break;
            case "second":
              interval = getMinutesAndSecondsInterval(approxInterval, false);
              getterName = secondsGetterName(isUTC);
              setterName = secondsSetterName(isUTC);
              break;
            case "millisecond":
              interval = getMillisecondsInterval(approxInterval);
              getterName = millisecondsGetterName(isUTC);
              setterName = millisecondsSetterName(isUTC);
              break;
          }
          addTicksInSpan(interval, startTick, endTick, getterName, setterName, isDate2, newAddedTicks);
          if (unitName === "year" && levelTicks2.length > 1 && i22 === 0) {
            levelTicks2.unshift({
              value: levelTicks2[0].value - interval
            });
          }
        }
        for (var i22 = 0; i22 < newAddedTicks.length; i22++) {
          levelTicks2.push(newAddedTicks[i22]);
        }
        return newAddedTicks;
      }
      var levelsTicks = [];
      var currentLevelTicks = [];
      var tickCount = 0;
      var lastLevelTickCount = 0;
      for (var i2 = 0; i2 < unitNames.length && iter++ < safeLimit; ++i2) {
        var primaryTimeUnit = getPrimaryTimeUnit(unitNames[i2]);
        if (!isPrimaryTimeUnit(unitNames[i2])) {
          continue;
        }
        addLevelTicks(unitNames[i2], levelsTicks[levelsTicks.length - 1] || [], currentLevelTicks);
        var nextPrimaryTimeUnit = unitNames[i2 + 1] ? getPrimaryTimeUnit(unitNames[i2 + 1]) : null;
        if (primaryTimeUnit !== nextPrimaryTimeUnit) {
          if (currentLevelTicks.length) {
            lastLevelTickCount = tickCount;
            currentLevelTicks.sort(function(a2, b2) {
              return a2.value - b2.value;
            });
            var levelTicksRemoveDuplicated = [];
            for (var i_1 = 0; i_1 < currentLevelTicks.length; ++i_1) {
              var tickValue = currentLevelTicks[i_1].value;
              if (i_1 === 0 || currentLevelTicks[i_1 - 1].value !== tickValue) {
                levelTicksRemoveDuplicated.push(currentLevelTicks[i_1]);
                if (tickValue >= extent3[0] && tickValue <= extent3[1]) {
                  tickCount++;
                }
              }
            }
            var targetTickNum = (extent3[1] - extent3[0]) / approxInterval;
            if (tickCount > targetTickNum * 1.5 && lastLevelTickCount > targetTickNum / 1.5) {
              break;
            }
            levelsTicks.push(levelTicksRemoveDuplicated);
            if (tickCount > targetTickNum || bottomUnitName === unitNames[i2]) {
              break;
            }
          }
          currentLevelTicks = [];
        }
      }
      var levelsTicksInExtent = filter(map$1(levelsTicks, function(levelTicks2) {
        return filter(levelTicks2, function(tick) {
          return tick.value >= extent3[0] && tick.value <= extent3[1] && !tick.notAdd;
        });
      }), function(levelTicks2) {
        return levelTicks2.length > 0;
      });
      var ticks = [];
      var maxLevel = levelsTicksInExtent.length - 1;
      for (var i2 = 0; i2 < levelsTicksInExtent.length; ++i2) {
        var levelTicks = levelsTicksInExtent[i2];
        for (var k2 = 0; k2 < levelTicks.length; ++k2) {
          ticks.push({
            value: levelTicks[k2].value,
            level: maxLevel - i2
          });
        }
      }
      ticks.sort(function(a2, b2) {
        return a2.value - b2.value;
      });
      var result = [];
      for (var i2 = 0; i2 < ticks.length; ++i2) {
        if (i2 === 0 || ticks[i2].value !== ticks[i2 - 1].value) {
          result.push(ticks[i2]);
        }
      }
      return result;
    }
    Scale.registerClass(TimeScale);
    var scaleProto = Scale.prototype;
    var intervalScaleProto = IntervalScale.prototype;
    var roundingErrorFix = round$3;
    var mathFloor$1 = Math.floor;
    var mathCeil$1 = Math.ceil;
    var mathPow$1 = Math.pow;
    var mathLog$1 = Math.log;
    var LogScale = (
      /** @class */
      function(_super) {
        __extends$1(LogScale2, _super);
        function LogScale2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "log";
          _this.base = 10;
          _this._originalScale = new IntervalScale();
          _this._interval = 0;
          return _this;
        }
        LogScale2.prototype.getTicks = function(expandToNicedExtent) {
          var originalScale = this._originalScale;
          var extent3 = this._extent;
          var originalExtent = originalScale.getExtent();
          var ticks = intervalScaleProto.getTicks.call(this, expandToNicedExtent);
          return map$1(ticks, function(tick) {
            var val = tick.value;
            var powVal = round$3(mathPow$1(this.base, val));
            powVal = val === extent3[0] && this._fixMin ? fixRoundingError(powVal, originalExtent[0]) : powVal;
            powVal = val === extent3[1] && this._fixMax ? fixRoundingError(powVal, originalExtent[1]) : powVal;
            return {
              value: powVal
            };
          }, this);
        };
        LogScale2.prototype.setExtent = function(start2, end2) {
          var base2 = mathLog$1(this.base);
          start2 = mathLog$1(Math.max(0, start2)) / base2;
          end2 = mathLog$1(Math.max(0, end2)) / base2;
          intervalScaleProto.setExtent.call(this, start2, end2);
        };
        LogScale2.prototype.getExtent = function() {
          var base2 = this.base;
          var extent3 = scaleProto.getExtent.call(this);
          extent3[0] = mathPow$1(base2, extent3[0]);
          extent3[1] = mathPow$1(base2, extent3[1]);
          var originalScale = this._originalScale;
          var originalExtent = originalScale.getExtent();
          this._fixMin && (extent3[0] = fixRoundingError(extent3[0], originalExtent[0]));
          this._fixMax && (extent3[1] = fixRoundingError(extent3[1], originalExtent[1]));
          return extent3;
        };
        LogScale2.prototype.unionExtent = function(extent3) {
          this._originalScale.unionExtent(extent3);
          var base2 = this.base;
          extent3[0] = mathLog$1(extent3[0]) / mathLog$1(base2);
          extent3[1] = mathLog$1(extent3[1]) / mathLog$1(base2);
          scaleProto.unionExtent.call(this, extent3);
        };
        LogScale2.prototype.unionExtentFromData = function(data, dim) {
          this.unionExtent(data.getApproximateExtent(dim));
        };
        LogScale2.prototype.calcNiceTicks = function(approxTickNum) {
          approxTickNum = approxTickNum || 10;
          var extent3 = this._extent;
          var span = extent3[1] - extent3[0];
          if (span === Infinity || span <= 0) {
            return;
          }
          var interval = quantity(span);
          var err = approxTickNum / span * interval;
          if (err <= 0.5) {
            interval *= 10;
          }
          while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) {
            interval *= 10;
          }
          var niceExtent = [round$3(mathCeil$1(extent3[0] / interval) * interval), round$3(mathFloor$1(extent3[1] / interval) * interval)];
          this._interval = interval;
          this._niceExtent = niceExtent;
        };
        LogScale2.prototype.calcNiceExtent = function(opt) {
          intervalScaleProto.calcNiceExtent.call(this, opt);
          this._fixMin = opt.fixMin;
          this._fixMax = opt.fixMax;
        };
        LogScale2.prototype.parse = function(val) {
          return val;
        };
        LogScale2.prototype.contain = function(val) {
          val = mathLog$1(val) / mathLog$1(this.base);
          return contain$1(val, this._extent);
        };
        LogScale2.prototype.normalize = function(val) {
          val = mathLog$1(val) / mathLog$1(this.base);
          return normalize$2(val, this._extent);
        };
        LogScale2.prototype.scale = function(val) {
          val = scale(val, this._extent);
          return mathPow$1(this.base, val);
        };
        LogScale2.type = "log";
        return LogScale2;
      }(Scale)
    );
    var proto = LogScale.prototype;
    proto.getMinorTicks = intervalScaleProto.getMinorTicks;
    proto.getLabel = intervalScaleProto.getLabel;
    function fixRoundingError(val, originalVal) {
      return roundingErrorFix(val, getPrecision(originalVal));
    }
    Scale.registerClass(LogScale);
    var ScaleRawExtentInfo = (
      /** @class */
      function() {
        function ScaleRawExtentInfo2(scale2, model, originalExtent) {
          this._prepareParams(scale2, model, originalExtent);
        }
        ScaleRawExtentInfo2.prototype._prepareParams = function(scale2, model, dataExtent) {
          if (dataExtent[1] < dataExtent[0]) {
            dataExtent = [NaN, NaN];
          }
          this._dataMin = dataExtent[0];
          this._dataMax = dataExtent[1];
          var isOrdinal = this._isOrdinal = scale2.type === "ordinal";
          this._needCrossZero = scale2.type === "interval" && model.getNeedCrossZero && model.getNeedCrossZero();
          var axisMinValue = model.get("min", true);
          if (axisMinValue == null) {
            axisMinValue = model.get("startValue", true);
          }
          var modelMinRaw = this._modelMinRaw = axisMinValue;
          if (isFunction$1(modelMinRaw)) {
            this._modelMinNum = parseAxisModelMinMax(scale2, modelMinRaw({
              min: dataExtent[0],
              max: dataExtent[1]
            }));
          } else if (modelMinRaw !== "dataMin") {
            this._modelMinNum = parseAxisModelMinMax(scale2, modelMinRaw);
          }
          var modelMaxRaw = this._modelMaxRaw = model.get("max", true);
          if (isFunction$1(modelMaxRaw)) {
            this._modelMaxNum = parseAxisModelMinMax(scale2, modelMaxRaw({
              min: dataExtent[0],
              max: dataExtent[1]
            }));
          } else if (modelMaxRaw !== "dataMax") {
            this._modelMaxNum = parseAxisModelMinMax(scale2, modelMaxRaw);
          }
          if (isOrdinal) {
            this._axisDataLen = model.getCategories().length;
          } else {
            var boundaryGap = model.get("boundaryGap");
            var boundaryGapArr = isArray$2(boundaryGap) ? boundaryGap : [boundaryGap || 0, boundaryGap || 0];
            if (typeof boundaryGapArr[0] === "boolean" || typeof boundaryGapArr[1] === "boolean") {
              this._boundaryGapInner = [0, 0];
            } else {
              this._boundaryGapInner = [parsePercent$1(boundaryGapArr[0], 1), parsePercent$1(boundaryGapArr[1], 1)];
            }
          }
        };
        ScaleRawExtentInfo2.prototype.calculate = function() {
          var isOrdinal = this._isOrdinal;
          var dataMin = this._dataMin;
          var dataMax = this._dataMax;
          var axisDataLen = this._axisDataLen;
          var boundaryGapInner = this._boundaryGapInner;
          var span = !isOrdinal ? dataMax - dataMin || Math.abs(dataMin) : null;
          var min3 = this._modelMinRaw === "dataMin" ? dataMin : this._modelMinNum;
          var max3 = this._modelMaxRaw === "dataMax" ? dataMax : this._modelMaxNum;
          var minFixed = min3 != null;
          var maxFixed = max3 != null;
          if (min3 == null) {
            min3 = isOrdinal ? axisDataLen ? 0 : NaN : dataMin - boundaryGapInner[0] * span;
          }
          if (max3 == null) {
            max3 = isOrdinal ? axisDataLen ? axisDataLen - 1 : NaN : dataMax + boundaryGapInner[1] * span;
          }
          (min3 == null || !isFinite(min3)) && (min3 = NaN);
          (max3 == null || !isFinite(max3)) && (max3 = NaN);
          var isBlank = eqNaN(min3) || eqNaN(max3) || isOrdinal && !axisDataLen;
          if (this._needCrossZero) {
            if (min3 > 0 && max3 > 0 && !minFixed) {
              min3 = 0;
            }
            if (min3 < 0 && max3 < 0 && !maxFixed) {
              max3 = 0;
            }
          }
          var determinedMin = this._determinedMin;
          var determinedMax = this._determinedMax;
          if (determinedMin != null) {
            min3 = determinedMin;
            minFixed = true;
          }
          if (determinedMax != null) {
            max3 = determinedMax;
            maxFixed = true;
          }
          return {
            min: min3,
            max: max3,
            minFixed,
            maxFixed,
            isBlank
          };
        };
        ScaleRawExtentInfo2.prototype.modifyDataMinMax = function(minMaxName, val) {
          this[DATA_MIN_MAX_ATTR[minMaxName]] = val;
        };
        ScaleRawExtentInfo2.prototype.setDeterminedMinMax = function(minMaxName, val) {
          var attr = DETERMINED_MIN_MAX_ATTR[minMaxName];
          this[attr] = val;
        };
        ScaleRawExtentInfo2.prototype.freeze = function() {
          this.frozen = true;
        };
        return ScaleRawExtentInfo2;
      }()
    );
    var DETERMINED_MIN_MAX_ATTR = {
      min: "_determinedMin",
      max: "_determinedMax"
    };
    var DATA_MIN_MAX_ATTR = {
      min: "_dataMin",
      max: "_dataMax"
    };
    function ensureScaleRawExtentInfo(scale2, model, originalExtent) {
      var rawExtentInfo = scale2.rawExtentInfo;
      if (rawExtentInfo) {
        return rawExtentInfo;
      }
      rawExtentInfo = new ScaleRawExtentInfo(scale2, model, originalExtent);
      scale2.rawExtentInfo = rawExtentInfo;
      return rawExtentInfo;
    }
    function parseAxisModelMinMax(scale2, minMax) {
      return minMax == null ? null : eqNaN(minMax) ? NaN : scale2.parse(minMax);
    }
    function getScaleExtent(scale2, model) {
      var scaleType = scale2.type;
      var rawExtentResult = ensureScaleRawExtentInfo(scale2, model, scale2.getExtent()).calculate();
      scale2.setBlank(rawExtentResult.isBlank);
      var min3 = rawExtentResult.min;
      var max3 = rawExtentResult.max;
      var ecModel = model.ecModel;
      if (ecModel && scaleType === "time") {
        var barSeriesModels = prepareLayoutBarSeries("bar", ecModel);
        var isBaseAxisAndHasBarSeries_1 = false;
        each$f(barSeriesModels, function(seriesModel) {
          isBaseAxisAndHasBarSeries_1 = isBaseAxisAndHasBarSeries_1 || seriesModel.getBaseAxis() === model.axis;
        });
        if (isBaseAxisAndHasBarSeries_1) {
          var barWidthAndOffset = makeColumnLayout(barSeriesModels);
          var adjustedScale = adjustScaleForOverflow(min3, max3, model, barWidthAndOffset);
          min3 = adjustedScale.min;
          max3 = adjustedScale.max;
        }
      }
      return {
        extent: [min3, max3],
        // "fix" means "fixed", the value should not be
        // changed in the subsequent steps.
        fixMin: rawExtentResult.minFixed,
        fixMax: rawExtentResult.maxFixed
      };
    }
    function adjustScaleForOverflow(min3, max3, model, barWidthAndOffset) {
      var axisExtent = model.axis.getExtent();
      var axisLength = Math.abs(axisExtent[1] - axisExtent[0]);
      var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis);
      if (barsOnCurrentAxis === void 0) {
        return {
          min: min3,
          max: max3
        };
      }
      var minOverflow = Infinity;
      each$f(barsOnCurrentAxis, function(item) {
        minOverflow = Math.min(item.offset, minOverflow);
      });
      var maxOverflow = -Infinity;
      each$f(barsOnCurrentAxis, function(item) {
        maxOverflow = Math.max(item.offset + item.width, maxOverflow);
      });
      minOverflow = Math.abs(minOverflow);
      maxOverflow = Math.abs(maxOverflow);
      var totalOverFlow = minOverflow + maxOverflow;
      var oldRange = max3 - min3;
      var oldRangePercentOfNew = 1 - (minOverflow + maxOverflow) / axisLength;
      var overflowBuffer = oldRange / oldRangePercentOfNew - oldRange;
      max3 += overflowBuffer * (maxOverflow / totalOverFlow);
      min3 -= overflowBuffer * (minOverflow / totalOverFlow);
      return {
        min: min3,
        max: max3
      };
    }
    function niceScaleExtent(scale2, inModel) {
      var model = inModel;
      var extentInfo = getScaleExtent(scale2, model);
      var extent3 = extentInfo.extent;
      var splitNumber = model.get("splitNumber");
      if (scale2 instanceof LogScale) {
        scale2.base = model.get("logBase");
      }
      var scaleType = scale2.type;
      var interval = model.get("interval");
      var isIntervalOrTime = scaleType === "interval" || scaleType === "time";
      scale2.setExtent(extent3[0], extent3[1]);
      scale2.calcNiceExtent({
        splitNumber,
        fixMin: extentInfo.fixMin,
        fixMax: extentInfo.fixMax,
        minInterval: isIntervalOrTime ? model.get("minInterval") : null,
        maxInterval: isIntervalOrTime ? model.get("maxInterval") : null
      });
      if (interval != null) {
        scale2.setInterval && scale2.setInterval(interval);
      }
    }
    function createScaleByModel$1(model, axisType) {
      axisType = axisType || model.get("type");
      if (axisType) {
        switch (axisType) {
          // Buildin scale
          case "category":
            return new OrdinalScale({
              ordinalMeta: model.getOrdinalMeta ? model.getOrdinalMeta() : model.getCategories(),
              extent: [Infinity, -Infinity]
            });
          case "time":
            return new TimeScale({
              locale: model.ecModel.getLocaleModel(),
              useUTC: model.ecModel.get("useUTC")
            });
          default:
            return new (Scale.getClass(axisType) || IntervalScale)();
        }
      }
    }
    function ifAxisCrossZero(axis) {
      var dataExtent = axis.scale.getExtent();
      var min3 = dataExtent[0];
      var max3 = dataExtent[1];
      return !(min3 > 0 && max3 > 0 || min3 < 0 && max3 < 0);
    }
    function makeLabelFormatter(axis) {
      var labelFormatter = axis.getLabelModel().get("formatter");
      var categoryTickStart = axis.type === "category" ? axis.scale.getExtent()[0] : null;
      if (axis.scale.type === "time") {
        return /* @__PURE__ */ function(tpl) {
          return function(tick, idx) {
            return axis.scale.getFormattedLabel(tick, idx, tpl);
          };
        }(labelFormatter);
      } else if (isString$1(labelFormatter)) {
        return /* @__PURE__ */ function(tpl) {
          return function(tick) {
            var label = axis.scale.getLabel(tick);
            var text = tpl.replace("{value}", label != null ? label : "");
            return text;
          };
        }(labelFormatter);
      } else if (isFunction$1(labelFormatter)) {
        return /* @__PURE__ */ function(cb) {
          return function(tick, idx) {
            if (categoryTickStart != null) {
              idx = tick.value - categoryTickStart;
            }
            return cb(getAxisRawValue(axis, tick), idx, tick.level != null ? {
              level: tick.level
            } : null);
          };
        }(labelFormatter);
      } else {
        return function(tick) {
          return axis.scale.getLabel(tick);
        };
      }
    }
    function getAxisRawValue(axis, tick) {
      return axis.type === "category" ? axis.scale.getLabel(tick) : tick.value;
    }
    function estimateLabelUnionRect(axis) {
      var axisModel = axis.model;
      var scale2 = axis.scale;
      if (!axisModel.get(["axisLabel", "show"]) || scale2.isBlank()) {
        return;
      }
      var realNumberScaleTicks;
      var tickCount;
      var categoryScaleExtent = scale2.getExtent();
      if (scale2 instanceof OrdinalScale) {
        tickCount = scale2.count();
      } else {
        realNumberScaleTicks = scale2.getTicks();
        tickCount = realNumberScaleTicks.length;
      }
      var axisLabelModel = axis.getLabelModel();
      var labelFormatter = makeLabelFormatter(axis);
      var rect;
      var step = 1;
      if (tickCount > 40) {
        step = Math.ceil(tickCount / 40);
      }
      for (var i2 = 0; i2 < tickCount; i2 += step) {
        var tick = realNumberScaleTicks ? realNumberScaleTicks[i2] : {
          value: categoryScaleExtent[0] + i2
        };
        var label = labelFormatter(tick, i2);
        var unrotatedSingleRect = axisLabelModel.getTextRect(label);
        var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get("rotate") || 0);
        rect ? rect.union(singleRect) : rect = singleRect;
      }
      return rect;
    }
    function rotateTextRect(textRect, rotate2) {
      var rotateRadians = rotate2 * Math.PI / 180;
      var beforeWidth = textRect.width;
      var beforeHeight = textRect.height;
      var afterWidth = beforeWidth * Math.abs(Math.cos(rotateRadians)) + Math.abs(beforeHeight * Math.sin(rotateRadians));
      var afterHeight = beforeWidth * Math.abs(Math.sin(rotateRadians)) + Math.abs(beforeHeight * Math.cos(rotateRadians));
      var rotatedRect = new BoundingRect(textRect.x, textRect.y, afterWidth, afterHeight);
      return rotatedRect;
    }
    function getOptionCategoryInterval(model) {
      var interval = model.get("interval");
      return interval == null ? "auto" : interval;
    }
    function shouldShowAllLabels(axis) {
      return axis.type === "category" && getOptionCategoryInterval(axis.getLabelModel()) === 0;
    }
    function getDataDimensionsOnAxis(data, axisDim) {
      var dataDimMap = {};
      each$f(data.mapDimensionsAll(axisDim), function(dataDim) {
        dataDimMap[getStackedDimension(data, dataDim)] = true;
      });
      return keys$1(dataDimMap);
    }
    function unionAxisExtentFromData(dataExtent, data, axisDim) {
      if (data) {
        each$f(getDataDimensionsOnAxis(data, axisDim), function(dim) {
          var seriesExtent = data.getApproximateExtent(dim);
          seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);
          seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);
        });
      }
    }
    var AxisModelCommonMixin = (
      /** @class */
      function() {
        function AxisModelCommonMixin2() {
        }
        AxisModelCommonMixin2.prototype.getNeedCrossZero = function() {
          var option = this.option;
          return !option.scale;
        };
        AxisModelCommonMixin2.prototype.getCoordSysModel = function() {
          return;
        };
        return AxisModelCommonMixin2;
      }()
    );
    var EPSILON = 1e-8;
    function isAroundEqual(a2, b2) {
      return Math.abs(a2 - b2) < EPSILON;
    }
    function contain(points2, x2, y) {
      var w2 = 0;
      var p2 = points2[0];
      if (!p2) {
        return false;
      }
      for (var i2 = 1; i2 < points2.length; i2++) {
        var p22 = points2[i2];
        w2 += windingLine(p2[0], p2[1], p22[0], p22[1], x2, y);
        p2 = p22;
      }
      var p0 = points2[0];
      if (!isAroundEqual(p2[0], p0[0]) || !isAroundEqual(p2[1], p0[1])) {
        w2 += windingLine(p2[0], p2[1], p0[0], p0[1], x2, y);
      }
      return w2 !== 0;
    }
    var TMP_TRANSFORM = [];
    function transformPoints(points2, transform2) {
      for (var p2 = 0; p2 < points2.length; p2++) {
        applyTransform$1(points2[p2], points2[p2], transform2);
      }
    }
    function updateBBoxFromPoints(points2, min3, max3, projection) {
      for (var i2 = 0; i2 < points2.length; i2++) {
        var p2 = points2[i2];
        if (projection) {
          p2 = projection.project(p2);
        }
        if (p2 && isFinite(p2[0]) && isFinite(p2[1])) {
          min$1(min3, min3, p2);
          max$1(max3, max3, p2);
        }
      }
    }
    function centroid$1(points2) {
      var signedArea = 0;
      var cx = 0;
      var cy = 0;
      var len2 = points2.length;
      var x0 = points2[len2 - 1][0];
      var y0 = points2[len2 - 1][1];
      for (var i2 = 0; i2 < len2; i2++) {
        var x1 = points2[i2][0];
        var y1 = points2[i2][1];
        var a2 = x0 * y1 - x1 * y0;
        signedArea += a2;
        cx += (x0 + x1) * a2;
        cy += (y0 + y1) * a2;
        x0 = x1;
        y0 = y1;
      }
      return signedArea ? [cx / signedArea / 3, cy / signedArea / 3, signedArea] : [points2[0][0] || 0, points2[0][1] || 0];
    }
    var Region = (
      /** @class */
      function() {
        function Region2(name) {
          this.name = name;
        }
        Region2.prototype.setCenter = function(center2) {
          this._center = center2;
        };
        Region2.prototype.getCenter = function() {
          var center2 = this._center;
          if (!center2) {
            center2 = this._center = this.calcCenter();
          }
          return center2;
        };
        return Region2;
      }()
    );
    var GeoJSONPolygonGeometry = (
      /** @class */
      /* @__PURE__ */ function() {
        function GeoJSONPolygonGeometry2(exterior, interiors) {
          this.type = "polygon";
          this.exterior = exterior;
          this.interiors = interiors;
        }
        return GeoJSONPolygonGeometry2;
      }()
    );
    var GeoJSONLineStringGeometry = (
      /** @class */
      /* @__PURE__ */ function() {
        function GeoJSONLineStringGeometry2(points2) {
          this.type = "linestring";
          this.points = points2;
        }
        return GeoJSONLineStringGeometry2;
      }()
    );
    var GeoJSONRegion = (
      /** @class */
      function(_super) {
        __extends$1(GeoJSONRegion2, _super);
        function GeoJSONRegion2(name, geometries, cp) {
          var _this = _super.call(this, name) || this;
          _this.type = "geoJSON";
          _this.geometries = geometries;
          _this._center = cp && [cp[0], cp[1]];
          return _this;
        }
        GeoJSONRegion2.prototype.calcCenter = function() {
          var geometries = this.geometries;
          var largestGeo;
          var largestGeoSize = 0;
          for (var i2 = 0; i2 < geometries.length; i2++) {
            var geo = geometries[i2];
            var exterior = geo.exterior;
            var size = exterior && exterior.length;
            if (size > largestGeoSize) {
              largestGeo = geo;
              largestGeoSize = size;
            }
          }
          if (largestGeo) {
            return centroid$1(largestGeo.exterior);
          }
          var rect = this.getBoundingRect();
          return [rect.x + rect.width / 2, rect.y + rect.height / 2];
        };
        GeoJSONRegion2.prototype.getBoundingRect = function(projection) {
          var rect = this._rect;
          if (rect && !projection) {
            return rect;
          }
          var min3 = [Infinity, Infinity];
          var max3 = [-Infinity, -Infinity];
          var geometries = this.geometries;
          each$f(geometries, function(geo) {
            if (geo.type === "polygon") {
              updateBBoxFromPoints(geo.exterior, min3, max3, projection);
            } else {
              each$f(geo.points, function(points2) {
                updateBBoxFromPoints(points2, min3, max3, projection);
              });
            }
          });
          if (!(isFinite(min3[0]) && isFinite(min3[1]) && isFinite(max3[0]) && isFinite(max3[1]))) {
            min3[0] = min3[1] = max3[0] = max3[1] = 0;
          }
          rect = new BoundingRect(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]);
          if (!projection) {
            this._rect = rect;
          }
          return rect;
        };
        GeoJSONRegion2.prototype.contain = function(coord) {
          var rect = this.getBoundingRect();
          var geometries = this.geometries;
          if (!rect.contain(coord[0], coord[1])) {
            return false;
          }
          loopGeo: for (var i2 = 0, len2 = geometries.length; i2 < len2; i2++) {
            var geo = geometries[i2];
            if (geo.type !== "polygon") {
              continue;
            }
            var exterior = geo.exterior;
            var interiors = geo.interiors;
            if (contain(exterior, coord[0], coord[1])) {
              for (var k2 = 0; k2 < (interiors ? interiors.length : 0); k2++) {
                if (contain(interiors[k2], coord[0], coord[1])) {
                  continue loopGeo;
                }
              }
              return true;
            }
          }
          return false;
        };
        GeoJSONRegion2.prototype.transformTo = function(x2, y, width, height) {
          var rect = this.getBoundingRect();
          var aspect = rect.width / rect.height;
          if (!width) {
            width = aspect * height;
          } else if (!height) {
            height = width / aspect;
          }
          var target = new BoundingRect(x2, y, width, height);
          var transform2 = rect.calculateTransform(target);
          var geometries = this.geometries;
          for (var i2 = 0; i2 < geometries.length; i2++) {
            var geo = geometries[i2];
            if (geo.type === "polygon") {
              transformPoints(geo.exterior, transform2);
              each$f(geo.interiors, function(interior) {
                transformPoints(interior, transform2);
              });
            } else {
              each$f(geo.points, function(points2) {
                transformPoints(points2, transform2);
              });
            }
          }
          rect = this._rect;
          rect.copy(target);
          this._center = [rect.x + rect.width / 2, rect.y + rect.height / 2];
        };
        GeoJSONRegion2.prototype.cloneShallow = function(name) {
          name == null && (name = this.name);
          var newRegion = new GeoJSONRegion2(name, this.geometries, this._center);
          newRegion._rect = this._rect;
          newRegion.transformTo = null;
          return newRegion;
        };
        return GeoJSONRegion2;
      }(Region)
    );
    var GeoSVGRegion = (
      /** @class */
      function(_super) {
        __extends$1(GeoSVGRegion2, _super);
        function GeoSVGRegion2(name, elOnlyForCalculate) {
          var _this = _super.call(this, name) || this;
          _this.type = "geoSVG";
          _this._elOnlyForCalculate = elOnlyForCalculate;
          return _this;
        }
        GeoSVGRegion2.prototype.calcCenter = function() {
          var el = this._elOnlyForCalculate;
          var rect = el.getBoundingRect();
          var center2 = [rect.x + rect.width / 2, rect.y + rect.height / 2];
          var mat = identity(TMP_TRANSFORM);
          var target = el;
          while (target && !target.isGeoSVGGraphicRoot) {
            mul(mat, target.getLocalTransform(), mat);
            target = target.parent;
          }
          invert(mat, mat);
          applyTransform$1(center2, center2, mat);
          return center2;
        };
        return GeoSVGRegion2;
      }(Region)
    );
    function decode$2(json) {
      if (!json.UTF8Encoding) {
        return json;
      }
      var jsonCompressed = json;
      var encodeScale = jsonCompressed.UTF8Scale;
      if (encodeScale == null) {
        encodeScale = 1024;
      }
      var features2 = jsonCompressed.features;
      each$f(features2, function(feature) {
        var geometry = feature.geometry;
        var encodeOffsets = geometry.encodeOffsets;
        var coordinates = geometry.coordinates;
        if (!encodeOffsets) {
          return;
        }
        switch (geometry.type) {
          case "LineString":
            geometry.coordinates = decodeRing(coordinates, encodeOffsets, encodeScale);
            break;
          case "Polygon":
            decodeRings(coordinates, encodeOffsets, encodeScale);
            break;
          case "MultiLineString":
            decodeRings(coordinates, encodeOffsets, encodeScale);
            break;
          case "MultiPolygon":
            each$f(coordinates, function(rings, idx) {
              return decodeRings(rings, encodeOffsets[idx], encodeScale);
            });
        }
      });
      jsonCompressed.UTF8Encoding = false;
      return jsonCompressed;
    }
    function decodeRings(rings, encodeOffsets, encodeScale) {
      for (var c2 = 0; c2 < rings.length; c2++) {
        rings[c2] = decodeRing(rings[c2], encodeOffsets[c2], encodeScale);
      }
    }
    function decodeRing(coordinate, encodeOffsets, encodeScale) {
      var result = [];
      var prevX = encodeOffsets[0];
      var prevY = encodeOffsets[1];
      for (var i2 = 0; i2 < coordinate.length; i2 += 2) {
        var x2 = coordinate.charCodeAt(i2) - 64;
        var y = coordinate.charCodeAt(i2 + 1) - 64;
        x2 = x2 >> 1 ^ -(x2 & 1);
        y = y >> 1 ^ -(y & 1);
        x2 += prevX;
        y += prevY;
        prevX = x2;
        prevY = y;
        result.push([x2 / encodeScale, y / encodeScale]);
      }
      return result;
    }
    function parseGeoJSON(geoJson, nameProperty) {
      geoJson = decode$2(geoJson);
      return map$1(filter(geoJson.features, function(featureObj) {
        return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;
      }), function(featureObj) {
        var properties = featureObj.properties;
        var geo = featureObj.geometry;
        var geometries = [];
        switch (geo.type) {
          case "Polygon":
            var coordinates = geo.coordinates;
            geometries.push(new GeoJSONPolygonGeometry(coordinates[0], coordinates.slice(1)));
            break;
          case "MultiPolygon":
            each$f(geo.coordinates, function(item) {
              if (item[0]) {
                geometries.push(new GeoJSONPolygonGeometry(item[0], item.slice(1)));
              }
            });
            break;
          case "LineString":
            geometries.push(new GeoJSONLineStringGeometry([geo.coordinates]));
            break;
          case "MultiLineString":
            geometries.push(new GeoJSONLineStringGeometry(geo.coordinates));
        }
        var region = new GeoJSONRegion(properties[nameProperty || "name"], geometries, properties.cp);
        region.properties = properties;
        return region;
      });
    }
    var inner$g = makeInner();
    function tickValuesToNumbers(axis, values) {
      var nums = map$1(values, function(val) {
        return axis.scale.parse(val);
      });
      if (axis.type === "time" && nums.length > 0) {
        nums.sort();
        nums.unshift(nums[0]);
        nums.push(nums[nums.length - 1]);
      }
      return nums;
    }
    function createAxisLabels(axis) {
      var custom = axis.getLabelModel().get("customValues");
      if (custom) {
        var labelFormatter_1 = makeLabelFormatter(axis);
        var extent_1 = axis.scale.getExtent();
        var tickNumbers = tickValuesToNumbers(axis, custom);
        var ticks = filter(tickNumbers, function(val) {
          return val >= extent_1[0] && val <= extent_1[1];
        });
        return {
          labels: map$1(ticks, function(numval) {
            var tick = {
              value: numval
            };
            return {
              formattedLabel: labelFormatter_1(tick),
              rawLabel: axis.scale.getLabel(tick),
              tickValue: numval
            };
          })
        };
      }
      return axis.type === "category" ? makeCategoryLabels(axis) : makeRealNumberLabels(axis);
    }
    function createAxisTicks(axis, tickModel) {
      var custom = axis.getTickModel().get("customValues");
      if (custom) {
        var extent_2 = axis.scale.getExtent();
        var tickNumbers = tickValuesToNumbers(axis, custom);
        return {
          ticks: filter(tickNumbers, function(val) {
            return val >= extent_2[0] && val <= extent_2[1];
          })
        };
      }
      return axis.type === "category" ? makeCategoryTicks(axis, tickModel) : {
        ticks: map$1(axis.scale.getTicks(), function(tick) {
          return tick.value;
        })
      };
    }
    function makeCategoryLabels(axis) {
      var labelModel = axis.getLabelModel();
      var result = makeCategoryLabelsActually(axis, labelModel);
      return !labelModel.get("show") || axis.scale.isBlank() ? {
        labels: [],
        labelCategoryInterval: result.labelCategoryInterval
      } : result;
    }
    function makeCategoryLabelsActually(axis, labelModel) {
      var labelsCache = getListCache(axis, "labels");
      var optionLabelInterval = getOptionCategoryInterval(labelModel);
      var result = listCacheGet(labelsCache, optionLabelInterval);
      if (result) {
        return result;
      }
      var labels;
      var numericLabelInterval;
      if (isFunction$1(optionLabelInterval)) {
        labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval);
      } else {
        numericLabelInterval = optionLabelInterval === "auto" ? makeAutoCategoryInterval(axis) : optionLabelInterval;
        labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval);
      }
      return listCacheSet(labelsCache, optionLabelInterval, {
        labels,
        labelCategoryInterval: numericLabelInterval
      });
    }
    function makeCategoryTicks(axis, tickModel) {
      var ticksCache = getListCache(axis, "ticks");
      var optionTickInterval = getOptionCategoryInterval(tickModel);
      var result = listCacheGet(ticksCache, optionTickInterval);
      if (result) {
        return result;
      }
      var ticks;
      var tickCategoryInterval;
      if (!tickModel.get("show") || axis.scale.isBlank()) {
        ticks = [];
      }
      if (isFunction$1(optionTickInterval)) {
        ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true);
      } else if (optionTickInterval === "auto") {
        var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel());
        tickCategoryInterval = labelsResult.labelCategoryInterval;
        ticks = map$1(labelsResult.labels, function(labelItem) {
          return labelItem.tickValue;
        });
      } else {
        tickCategoryInterval = optionTickInterval;
        ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true);
      }
      return listCacheSet(ticksCache, optionTickInterval, {
        ticks,
        tickCategoryInterval
      });
    }
    function makeRealNumberLabels(axis) {
      var ticks = axis.scale.getTicks();
      var labelFormatter = makeLabelFormatter(axis);
      return {
        labels: map$1(ticks, function(tick, idx) {
          return {
            level: tick.level,
            formattedLabel: labelFormatter(tick, idx),
            rawLabel: axis.scale.getLabel(tick),
            tickValue: tick.value
          };
        })
      };
    }
    function getListCache(axis, prop) {
      return inner$g(axis)[prop] || (inner$g(axis)[prop] = []);
    }
    function listCacheGet(cache2, key) {
      for (var i2 = 0; i2 < cache2.length; i2++) {
        if (cache2[i2].key === key) {
          return cache2[i2].value;
        }
      }
    }
    function listCacheSet(cache2, key, value) {
      cache2.push({
        key,
        value
      });
      return value;
    }
    function makeAutoCategoryInterval(axis) {
      var result = inner$g(axis).autoInterval;
      return result != null ? result : inner$g(axis).autoInterval = axis.calculateCategoryInterval();
    }
    function calculateCategoryInterval(axis) {
      var params = fetchAutoCategoryIntervalCalculationParams(axis);
      var labelFormatter = makeLabelFormatter(axis);
      var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;
      var ordinalScale = axis.scale;
      var ordinalExtent = ordinalScale.getExtent();
      var tickCount = ordinalScale.count();
      if (ordinalExtent[1] - ordinalExtent[0] < 1) {
        return 0;
      }
      var step = 1;
      if (tickCount > 40) {
        step = Math.max(1, Math.floor(tickCount / 40));
      }
      var tickValue = ordinalExtent[0];
      var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);
      var unitW = Math.abs(unitSpan * Math.cos(rotation));
      var unitH = Math.abs(unitSpan * Math.sin(rotation));
      var maxW = 0;
      var maxH = 0;
      for (; tickValue <= ordinalExtent[1]; tickValue += step) {
        var width = 0;
        var height = 0;
        var rect = getBoundingRect(labelFormatter({
          value: tickValue
        }), params.font, "center", "top");
        width = rect.width * 1.3;
        height = rect.height * 1.3;
        maxW = Math.max(maxW, width, 7);
        maxH = Math.max(maxH, height, 7);
      }
      var dw = maxW / unitW;
      var dh = maxH / unitH;
      isNaN(dw) && (dw = Infinity);
      isNaN(dh) && (dh = Infinity);
      var interval = Math.max(0, Math.floor(Math.min(dw, dh)));
      var cache2 = inner$g(axis.model);
      var axisExtent = axis.getExtent();
      var lastAutoInterval = cache2.lastAutoInterval;
      var lastTickCount = cache2.lastTickCount;
      if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval && cache2.axisExtent0 === axisExtent[0] && cache2.axisExtent1 === axisExtent[1]) {
        interval = lastAutoInterval;
      } else {
        cache2.lastTickCount = tickCount;
        cache2.lastAutoInterval = interval;
        cache2.axisExtent0 = axisExtent[0];
        cache2.axisExtent1 = axisExtent[1];
      }
      return interval;
    }
    function fetchAutoCategoryIntervalCalculationParams(axis) {
      var labelModel = axis.getLabelModel();
      return {
        axisRotate: axis.getRotate ? axis.getRotate() : axis.isHorizontal && !axis.isHorizontal() ? 90 : 0,
        labelRotate: labelModel.get("rotate") || 0,
        font: labelModel.getFont()
      };
    }
    function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) {
      var labelFormatter = makeLabelFormatter(axis);
      var ordinalScale = axis.scale;
      var ordinalExtent = ordinalScale.getExtent();
      var labelModel = axis.getLabelModel();
      var result = [];
      var step = Math.max((categoryInterval || 0) + 1, 1);
      var startTick = ordinalExtent[0];
      var tickCount = ordinalScale.count();
      if (startTick !== 0 && step > 1 && tickCount / step > 2) {
        startTick = Math.round(Math.ceil(startTick / step) * step);
      }
      var showAllLabel = shouldShowAllLabels(axis);
      var includeMinLabel = labelModel.get("showMinLabel") || showAllLabel;
      var includeMaxLabel = labelModel.get("showMaxLabel") || showAllLabel;
      if (includeMinLabel && startTick !== ordinalExtent[0]) {
        addItem(ordinalExtent[0]);
      }
      var tickValue = startTick;
      for (; tickValue <= ordinalExtent[1]; tickValue += step) {
        addItem(tickValue);
      }
      if (includeMaxLabel && tickValue - step !== ordinalExtent[1]) {
        addItem(ordinalExtent[1]);
      }
      function addItem(tickValue2) {
        var tickObj = {
          value: tickValue2
        };
        result.push(onlyTick ? tickValue2 : {
          formattedLabel: labelFormatter(tickObj),
          rawLabel: ordinalScale.getLabel(tickObj),
          tickValue: tickValue2
        });
      }
      return result;
    }
    function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) {
      var ordinalScale = axis.scale;
      var labelFormatter = makeLabelFormatter(axis);
      var result = [];
      each$f(ordinalScale.getTicks(), function(tick) {
        var rawLabel = ordinalScale.getLabel(tick);
        var tickValue = tick.value;
        if (categoryInterval(tick.value, rawLabel)) {
          result.push(onlyTick ? tickValue : {
            formattedLabel: labelFormatter(tick),
            rawLabel,
            tickValue
          });
        }
      });
      return result;
    }
    var NORMALIZED_EXTENT = [0, 1];
    var Axis = (
      /** @class */
      function() {
        function Axis2(dim, scale2, extent3) {
          this.onBand = false;
          this.inverse = false;
          this.dim = dim;
          this.scale = scale2;
          this._extent = extent3 || [0, 0];
        }
        Axis2.prototype.contain = function(coord) {
          var extent3 = this._extent;
          var min3 = Math.min(extent3[0], extent3[1]);
          var max3 = Math.max(extent3[0], extent3[1]);
          return coord >= min3 && coord <= max3;
        };
        Axis2.prototype.containData = function(data) {
          return this.scale.contain(data);
        };
        Axis2.prototype.getExtent = function() {
          return this._extent.slice();
        };
        Axis2.prototype.getPixelPrecision = function(dataExtent) {
          return getPixelPrecision(dataExtent || this.scale.getExtent(), this._extent);
        };
        Axis2.prototype.setExtent = function(start2, end2) {
          var extent3 = this._extent;
          extent3[0] = start2;
          extent3[1] = end2;
        };
        Axis2.prototype.dataToCoord = function(data, clamp2) {
          var extent3 = this._extent;
          var scale2 = this.scale;
          data = scale2.normalize(data);
          if (this.onBand && scale2.type === "ordinal") {
            extent3 = extent3.slice();
            fixExtentWithBands(extent3, scale2.count());
          }
          return linearMap$2(data, NORMALIZED_EXTENT, extent3, clamp2);
        };
        Axis2.prototype.coordToData = function(coord, clamp2) {
          var extent3 = this._extent;
          var scale2 = this.scale;
          if (this.onBand && scale2.type === "ordinal") {
            extent3 = extent3.slice();
            fixExtentWithBands(extent3, scale2.count());
          }
          var t = linearMap$2(coord, extent3, NORMALIZED_EXTENT, clamp2);
          return this.scale.scale(t);
        };
        Axis2.prototype.pointToData = function(point, clamp2) {
          return;
        };
        Axis2.prototype.getTicksCoords = function(opt) {
          opt = opt || {};
          var tickModel = opt.tickModel || this.getTickModel();
          var result = createAxisTicks(this, tickModel);
          var ticks = result.ticks;
          var ticksCoords = map$1(ticks, function(tickVal) {
            return {
              coord: this.dataToCoord(this.scale.type === "ordinal" ? this.scale.getRawOrdinalNumber(tickVal) : tickVal),
              tickValue: tickVal
            };
          }, this);
          var alignWithLabel = tickModel.get("alignWithLabel");
          fixOnBandTicksCoords(this, ticksCoords, alignWithLabel, opt.clamp);
          return ticksCoords;
        };
        Axis2.prototype.getMinorTicksCoords = function() {
          if (this.scale.type === "ordinal") {
            return [];
          }
          var minorTickModel = this.model.getModel("minorTick");
          var splitNumber = minorTickModel.get("splitNumber");
          if (!(splitNumber > 0 && splitNumber < 100)) {
            splitNumber = 5;
          }
          var minorTicks = this.scale.getMinorTicks(splitNumber);
          var minorTicksCoords = map$1(minorTicks, function(minorTicksGroup) {
            return map$1(minorTicksGroup, function(minorTick) {
              return {
                coord: this.dataToCoord(minorTick),
                tickValue: minorTick
              };
            }, this);
          }, this);
          return minorTicksCoords;
        };
        Axis2.prototype.getViewLabels = function() {
          return createAxisLabels(this).labels;
        };
        Axis2.prototype.getLabelModel = function() {
          return this.model.getModel("axisLabel");
        };
        Axis2.prototype.getTickModel = function() {
          return this.model.getModel("axisTick");
        };
        Axis2.prototype.getBandWidth = function() {
          var axisExtent = this._extent;
          var dataExtent = this.scale.getExtent();
          var len2 = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);
          len2 === 0 && (len2 = 1);
          var size = Math.abs(axisExtent[1] - axisExtent[0]);
          return Math.abs(size) / len2;
        };
        Axis2.prototype.calculateCategoryInterval = function() {
          return calculateCategoryInterval(this);
        };
        return Axis2;
      }()
    );
    function fixExtentWithBands(extent3, nTick) {
      var size = extent3[1] - extent3[0];
      var len2 = nTick;
      var margin = size / len2 / 2;
      extent3[0] += margin;
      extent3[1] -= margin;
    }
    function fixOnBandTicksCoords(axis, ticksCoords, alignWithLabel, clamp2) {
      var ticksLen = ticksCoords.length;
      if (!axis.onBand || alignWithLabel || !ticksLen) {
        return;
      }
      var axisExtent = axis.getExtent();
      var last2;
      var diffSize;
      if (ticksLen === 1) {
        ticksCoords[0].coord = axisExtent[0];
        last2 = ticksCoords[1] = {
          coord: axisExtent[1],
          tickValue: ticksCoords[0].tickValue
        };
      } else {
        var crossLen = ticksCoords[ticksLen - 1].tickValue - ticksCoords[0].tickValue;
        var shift_1 = (ticksCoords[ticksLen - 1].coord - ticksCoords[0].coord) / crossLen;
        each$f(ticksCoords, function(ticksItem) {
          ticksItem.coord -= shift_1 / 2;
        });
        var dataExtent = axis.scale.getExtent();
        diffSize = 1 + dataExtent[1] - ticksCoords[ticksLen - 1].tickValue;
        last2 = {
          coord: ticksCoords[ticksLen - 1].coord + shift_1 * diffSize,
          tickValue: dataExtent[1] + 1
        };
        ticksCoords.push(last2);
      }
      var inverse = axisExtent[0] > axisExtent[1];
      if (littleThan2(ticksCoords[0].coord, axisExtent[0])) {
        clamp2 ? ticksCoords[0].coord = axisExtent[0] : ticksCoords.shift();
      }
      if (clamp2 && littleThan2(axisExtent[0], ticksCoords[0].coord)) {
        ticksCoords.unshift({
          coord: axisExtent[0]
        });
      }
      if (littleThan2(axisExtent[1], last2.coord)) {
        clamp2 ? last2.coord = axisExtent[1] : ticksCoords.pop();
      }
      if (clamp2 && littleThan2(last2.coord, axisExtent[1])) {
        ticksCoords.push({
          coord: axisExtent[1]
        });
      }
      function littleThan2(a2, b2) {
        a2 = round$3(a2);
        b2 = round$3(b2);
        return inverse ? a2 > b2 : a2 < b2;
      }
    }
    var PI2$2 = Math.PI * 2;
    var CMD$1 = PathProxy.CMD;
    var DEFAULT_SEARCH_SPACE = ["top", "right", "bottom", "left"];
    function getCandidateAnchor(pos, distance2, rect, outPt, outDir) {
      var width = rect.width;
      var height = rect.height;
      switch (pos) {
        case "top":
          outPt.set(rect.x + width / 2, rect.y - distance2);
          outDir.set(0, -1);
          break;
        case "bottom":
          outPt.set(rect.x + width / 2, rect.y + height + distance2);
          outDir.set(0, 1);
          break;
        case "left":
          outPt.set(rect.x - distance2, rect.y + height / 2);
          outDir.set(-1, 0);
          break;
        case "right":
          outPt.set(rect.x + width + distance2, rect.y + height / 2);
          outDir.set(1, 0);
          break;
      }
    }
    function projectPointToArc(cx, cy, r, startAngle, endAngle, anticlockwise, x2, y, out2) {
      x2 -= cx;
      y -= cy;
      var d2 = Math.sqrt(x2 * x2 + y * y);
      x2 /= d2;
      y /= d2;
      var ox = x2 * r + cx;
      var oy = y * r + cy;
      if (Math.abs(startAngle - endAngle) % PI2$2 < 1e-4) {
        out2[0] = ox;
        out2[1] = oy;
        return d2 - r;
      }
      if (anticlockwise) {
        var tmp = startAngle;
        startAngle = normalizeRadian(endAngle);
        endAngle = normalizeRadian(tmp);
      } else {
        startAngle = normalizeRadian(startAngle);
        endAngle = normalizeRadian(endAngle);
      }
      if (startAngle > endAngle) {
        endAngle += PI2$2;
      }
      var angle2 = Math.atan2(y, x2);
      if (angle2 < 0) {
        angle2 += PI2$2;
      }
      if (angle2 >= startAngle && angle2 <= endAngle || angle2 + PI2$2 >= startAngle && angle2 + PI2$2 <= endAngle) {
        out2[0] = ox;
        out2[1] = oy;
        return d2 - r;
      }
      var x1 = r * Math.cos(startAngle) + cx;
      var y1 = r * Math.sin(startAngle) + cy;
      var x22 = r * Math.cos(endAngle) + cx;
      var y2 = r * Math.sin(endAngle) + cy;
      var d1 = (x1 - x2) * (x1 - x2) + (y1 - y) * (y1 - y);
      var d22 = (x22 - x2) * (x22 - x2) + (y2 - y) * (y2 - y);
      if (d1 < d22) {
        out2[0] = x1;
        out2[1] = y1;
        return Math.sqrt(d1);
      } else {
        out2[0] = x22;
        out2[1] = y2;
        return Math.sqrt(d22);
      }
    }
    function projectPointToLine(x1, y1, x2, y2, x3, y, out2, limitToEnds) {
      var dx = x3 - x1;
      var dy = y - y1;
      var dx1 = x2 - x1;
      var dy1 = y2 - y1;
      var lineLen = Math.sqrt(dx1 * dx1 + dy1 * dy1);
      dx1 /= lineLen;
      dy1 /= lineLen;
      var projectedLen = dx * dx1 + dy * dy1;
      var t = projectedLen / lineLen;
      if (limitToEnds) {
        t = Math.min(Math.max(t, 0), 1);
      }
      t *= lineLen;
      var ox = out2[0] = x1 + t * dx1;
      var oy = out2[1] = y1 + t * dy1;
      return Math.sqrt((ox - x3) * (ox - x3) + (oy - y) * (oy - y));
    }
    function projectPointToRect(x1, y1, width, height, x2, y, out2) {
      if (width < 0) {
        x1 = x1 + width;
        width = -width;
      }
      if (height < 0) {
        y1 = y1 + height;
        height = -height;
      }
      var x22 = x1 + width;
      var y2 = y1 + height;
      var ox = out2[0] = Math.min(Math.max(x2, x1), x22);
      var oy = out2[1] = Math.min(Math.max(y, y1), y2);
      return Math.sqrt((ox - x2) * (ox - x2) + (oy - y) * (oy - y));
    }
    var tmpPt = [];
    function nearestPointOnRect(pt3, rect, out2) {
      var dist2 = projectPointToRect(rect.x, rect.y, rect.width, rect.height, pt3.x, pt3.y, tmpPt);
      out2.set(tmpPt[0], tmpPt[1]);
      return dist2;
    }
    function nearestPointOnPath(pt3, path, out2) {
      var xi = 0;
      var yi = 0;
      var x0 = 0;
      var y0 = 0;
      var x1;
      var y1;
      var minDist = Infinity;
      var data = path.data;
      var x2 = pt3.x;
      var y = pt3.y;
      for (var i2 = 0; i2 < data.length; ) {
        var cmd = data[i2++];
        if (i2 === 1) {
          xi = data[i2];
          yi = data[i2 + 1];
          x0 = xi;
          y0 = yi;
        }
        var d2 = minDist;
        switch (cmd) {
          case CMD$1.M:
            x0 = data[i2++];
            y0 = data[i2++];
            xi = x0;
            yi = y0;
            break;
          case CMD$1.L:
            d2 = projectPointToLine(xi, yi, data[i2], data[i2 + 1], x2, y, tmpPt, true);
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$1.C:
            d2 = cubicProjectPoint(xi, yi, data[i2++], data[i2++], data[i2++], data[i2++], data[i2], data[i2 + 1], x2, y, tmpPt);
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$1.Q:
            d2 = quadraticProjectPoint(xi, yi, data[i2++], data[i2++], data[i2], data[i2 + 1], x2, y, tmpPt);
            xi = data[i2++];
            yi = data[i2++];
            break;
          case CMD$1.A:
            var cx = data[i2++];
            var cy = data[i2++];
            var rx = data[i2++];
            var ry = data[i2++];
            var theta = data[i2++];
            var dTheta = data[i2++];
            i2 += 1;
            var anticlockwise = !!(1 - data[i2++]);
            x1 = Math.cos(theta) * rx + cx;
            y1 = Math.sin(theta) * ry + cy;
            if (i2 <= 1) {
              x0 = x1;
              y0 = y1;
            }
            var _x = (x2 - cx) * ry / rx + cx;
            d2 = projectPointToArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y, tmpPt);
            xi = Math.cos(theta + dTheta) * rx + cx;
            yi = Math.sin(theta + dTheta) * ry + cy;
            break;
          case CMD$1.R:
            x0 = xi = data[i2++];
            y0 = yi = data[i2++];
            var width = data[i2++];
            var height = data[i2++];
            d2 = projectPointToRect(x0, y0, width, height, x2, y, tmpPt);
            break;
          case CMD$1.Z:
            d2 = projectPointToLine(xi, yi, x0, y0, x2, y, tmpPt, true);
            xi = x0;
            yi = y0;
            break;
        }
        if (d2 < minDist) {
          minDist = d2;
          out2.set(tmpPt[0], tmpPt[1]);
        }
      }
      return minDist;
    }
    var pt0 = new Point();
    var pt1 = new Point();
    var pt2 = new Point();
    var dir = new Point();
    var dir2 = new Point();
    function updateLabelLinePoints(target, labelLineModel) {
      if (!target) {
        return;
      }
      var labelLine = target.getTextGuideLine();
      var label = target.getTextContent();
      if (!(label && labelLine)) {
        return;
      }
      var labelGuideConfig = target.textGuideLineConfig || {};
      var points2 = [[0, 0], [0, 0], [0, 0]];
      var searchSpace = labelGuideConfig.candidates || DEFAULT_SEARCH_SPACE;
      var labelRect = label.getBoundingRect().clone();
      labelRect.applyTransform(label.getComputedTransform());
      var minDist = Infinity;
      var anchorPoint = labelGuideConfig.anchor;
      var targetTransform = target.getComputedTransform();
      var targetInversedTransform = targetTransform && invert([], targetTransform);
      var len2 = labelLineModel.get("length2") || 0;
      if (anchorPoint) {
        pt2.copy(anchorPoint);
      }
      for (var i2 = 0; i2 < searchSpace.length; i2++) {
        var candidate = searchSpace[i2];
        getCandidateAnchor(candidate, 0, labelRect, pt0, dir);
        Point.scaleAndAdd(pt1, pt0, dir, len2);
        pt1.transform(targetInversedTransform);
        var boundingRect = target.getBoundingRect();
        var dist2 = anchorPoint ? anchorPoint.distance(pt1) : target instanceof Path ? nearestPointOnPath(pt1, target.path, pt2) : nearestPointOnRect(pt1, boundingRect, pt2);
        if (dist2 < minDist) {
          minDist = dist2;
          pt1.transform(targetTransform);
          pt2.transform(targetTransform);
          pt2.toArray(points2[0]);
          pt1.toArray(points2[1]);
          pt0.toArray(points2[2]);
        }
      }
      limitTurnAngle(points2, labelLineModel.get("minTurnAngle"));
      labelLine.setShape({
        points: points2
      });
    }
    var tmpArr = [];
    var tmpProjPoint = new Point();
    function limitTurnAngle(linePoints, minTurnAngle) {
      if (!(minTurnAngle <= 180 && minTurnAngle > 0)) {
        return;
      }
      minTurnAngle = minTurnAngle / 180 * Math.PI;
      pt0.fromArray(linePoints[0]);
      pt1.fromArray(linePoints[1]);
      pt2.fromArray(linePoints[2]);
      Point.sub(dir, pt0, pt1);
      Point.sub(dir2, pt2, pt1);
      var len1 = dir.len();
      var len2 = dir2.len();
      if (len1 < 1e-3 || len2 < 1e-3) {
        return;
      }
      dir.scale(1 / len1);
      dir2.scale(1 / len2);
      var angleCos = dir.dot(dir2);
      var minTurnAngleCos = Math.cos(minTurnAngle);
      if (minTurnAngleCos < angleCos) {
        var d2 = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);
        tmpProjPoint.fromArray(tmpArr);
        tmpProjPoint.scaleAndAdd(dir2, d2 / Math.tan(Math.PI - minTurnAngle));
        var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);
        if (isNaN(t)) {
          return;
        }
        if (t < 0) {
          Point.copy(tmpProjPoint, pt1);
        } else if (t > 1) {
          Point.copy(tmpProjPoint, pt2);
        }
        tmpProjPoint.toArray(linePoints[1]);
      }
    }
    function limitSurfaceAngle(linePoints, surfaceNormal, maxSurfaceAngle) {
      if (!(maxSurfaceAngle <= 180 && maxSurfaceAngle > 0)) {
        return;
      }
      maxSurfaceAngle = maxSurfaceAngle / 180 * Math.PI;
      pt0.fromArray(linePoints[0]);
      pt1.fromArray(linePoints[1]);
      pt2.fromArray(linePoints[2]);
      Point.sub(dir, pt1, pt0);
      Point.sub(dir2, pt2, pt1);
      var len1 = dir.len();
      var len2 = dir2.len();
      if (len1 < 1e-3 || len2 < 1e-3) {
        return;
      }
      dir.scale(1 / len1);
      dir2.scale(1 / len2);
      var angleCos = dir.dot(surfaceNormal);
      var maxSurfaceAngleCos = Math.cos(maxSurfaceAngle);
      if (angleCos < maxSurfaceAngleCos) {
        var d2 = projectPointToLine(pt1.x, pt1.y, pt2.x, pt2.y, pt0.x, pt0.y, tmpArr, false);
        tmpProjPoint.fromArray(tmpArr);
        var HALF_PI = Math.PI / 2;
        var angle2 = Math.acos(dir2.dot(surfaceNormal));
        var newAngle = HALF_PI + angle2 - maxSurfaceAngle;
        if (newAngle >= HALF_PI) {
          Point.copy(tmpProjPoint, pt2);
        } else {
          tmpProjPoint.scaleAndAdd(dir2, d2 / Math.tan(Math.PI / 2 - newAngle));
          var t = pt2.x !== pt1.x ? (tmpProjPoint.x - pt1.x) / (pt2.x - pt1.x) : (tmpProjPoint.y - pt1.y) / (pt2.y - pt1.y);
          if (isNaN(t)) {
            return;
          }
          if (t < 0) {
            Point.copy(tmpProjPoint, pt1);
          } else if (t > 1) {
            Point.copy(tmpProjPoint, pt2);
          }
        }
        tmpProjPoint.toArray(linePoints[1]);
      }
    }
    function setLabelLineState(labelLine, ignore, stateName, stateModel) {
      var isNormal = stateName === "normal";
      var stateObj = isNormal ? labelLine : labelLine.ensureState(stateName);
      stateObj.ignore = ignore;
      var smooth = stateModel.get("smooth");
      if (smooth && smooth === true) {
        smooth = 0.3;
      }
      stateObj.shape = stateObj.shape || {};
      if (smooth > 0) {
        stateObj.shape.smooth = smooth;
      }
      var styleObj = stateModel.getModel("lineStyle").getLineStyle();
      isNormal ? labelLine.useStyle(styleObj) : stateObj.style = styleObj;
    }
    function buildLabelLinePath(path, shape) {
      var smooth = shape.smooth;
      var points2 = shape.points;
      if (!points2) {
        return;
      }
      path.moveTo(points2[0][0], points2[0][1]);
      if (smooth > 0 && points2.length >= 3) {
        var len1 = dist$1(points2[0], points2[1]);
        var len2 = dist$1(points2[1], points2[2]);
        if (!len1 || !len2) {
          path.lineTo(points2[1][0], points2[1][1]);
          path.lineTo(points2[2][0], points2[2][1]);
          return;
        }
        var moveLen = Math.min(len1, len2) * smooth;
        var midPoint0 = lerp$2([], points2[1], points2[0], moveLen / len1);
        var midPoint2 = lerp$2([], points2[1], points2[2], moveLen / len2);
        var midPoint1 = lerp$2([], midPoint0, midPoint2, 0.5);
        path.bezierCurveTo(midPoint0[0], midPoint0[1], midPoint0[0], midPoint0[1], midPoint1[0], midPoint1[1]);
        path.bezierCurveTo(midPoint2[0], midPoint2[1], midPoint2[0], midPoint2[1], points2[2][0], points2[2][1]);
      } else {
        for (var i2 = 1; i2 < points2.length; i2++) {
          path.lineTo(points2[i2][0], points2[i2][1]);
        }
      }
    }
    function setLabelLineStyle(targetEl, statesModels, defaultStyle) {
      var labelLine = targetEl.getTextGuideLine();
      var label = targetEl.getTextContent();
      if (!label) {
        if (labelLine) {
          targetEl.removeTextGuideLine();
        }
        return;
      }
      var normalModel = statesModels.normal;
      var showNormal = normalModel.get("show");
      var labelIgnoreNormal = label.ignore;
      for (var i2 = 0; i2 < DISPLAY_STATES.length; i2++) {
        var stateName = DISPLAY_STATES[i2];
        var stateModel = statesModels[stateName];
        var isNormal = stateName === "normal";
        if (stateModel) {
          var stateShow = stateModel.get("show");
          var isLabelIgnored = isNormal ? labelIgnoreNormal : retrieve2(label.states[stateName] && label.states[stateName].ignore, labelIgnoreNormal);
          if (isLabelIgnored || !retrieve2(stateShow, showNormal)) {
            var stateObj = isNormal ? labelLine : labelLine && labelLine.states[stateName];
            if (stateObj) {
              stateObj.ignore = true;
            }
            if (!!labelLine) {
              setLabelLineState(labelLine, true, stateName, stateModel);
            }
            continue;
          }
          if (!labelLine) {
            labelLine = new Polyline$1();
            targetEl.setTextGuideLine(labelLine);
            if (!isNormal && (labelIgnoreNormal || !showNormal)) {
              setLabelLineState(labelLine, true, "normal", statesModels.normal);
            }
            if (targetEl.stateProxy) {
              labelLine.stateProxy = targetEl.stateProxy;
            }
          }
          setLabelLineState(labelLine, false, stateName, stateModel);
        }
      }
      if (labelLine) {
        defaults$1(labelLine.style, defaultStyle);
        labelLine.style.fill = null;
        var showAbove = normalModel.get("showAbove");
        var labelLineConfig = targetEl.textGuideLineConfig = targetEl.textGuideLineConfig || {};
        labelLineConfig.showAbove = showAbove || false;
        labelLine.buildPath = buildLabelLinePath;
      }
    }
    function getLabelLineStatesModels(itemModel, labelLineName) {
      labelLineName = labelLineName || "labelLine";
      var statesModels = {
        normal: itemModel.getModel(labelLineName)
      };
      for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
        var stateName = SPECIAL_STATES[i2];
        statesModels[stateName] = itemModel.getModel([stateName, labelLineName]);
      }
      return statesModels;
    }
    function prepareLayoutList(input) {
      var list = [];
      for (var i2 = 0; i2 < input.length; i2++) {
        var rawItem = input[i2];
        if (rawItem.defaultAttr.ignore) {
          continue;
        }
        var label = rawItem.label;
        var transform2 = label.getComputedTransform();
        var localRect = label.getBoundingRect();
        var isAxisAligned = !transform2 || transform2[1] < 1e-5 && transform2[2] < 1e-5;
        var minMargin = label.style.margin || 0;
        var globalRect = localRect.clone();
        globalRect.applyTransform(transform2);
        globalRect.x -= minMargin / 2;
        globalRect.y -= minMargin / 2;
        globalRect.width += minMargin;
        globalRect.height += minMargin;
        var obb = isAxisAligned ? new OrientedBoundingRect(localRect, transform2) : null;
        list.push({
          label,
          labelLine: rawItem.labelLine,
          rect: globalRect,
          localRect,
          obb,
          priority: rawItem.priority,
          defaultAttr: rawItem.defaultAttr,
          layoutOption: rawItem.computedLayoutOption,
          axisAligned: isAxisAligned,
          transform: transform2
        });
      }
      return list;
    }
    function shiftLayout(list, xyDim, sizeDim, minBound, maxBound, balanceShift) {
      var len2 = list.length;
      if (len2 < 2) {
        return;
      }
      list.sort(function(a2, b2) {
        return a2.rect[xyDim] - b2.rect[xyDim];
      });
      var lastPos = 0;
      var delta;
      var adjusted = false;
      for (var i2 = 0; i2 < len2; i2++) {
        var item = list[i2];
        var rect = item.rect;
        delta = rect[xyDim] - lastPos;
        if (delta < 0) {
          rect[xyDim] -= delta;
          item.label[xyDim] -= delta;
          adjusted = true;
        }
        lastPos = rect[xyDim] + rect[sizeDim];
      }
      var first = list[0];
      var last2 = list[len2 - 1];
      var minGap;
      var maxGap;
      updateMinMaxGap();
      minGap < 0 && squeezeGaps(-minGap, 0.8);
      maxGap < 0 && squeezeGaps(maxGap, 0.8);
      updateMinMaxGap();
      takeBoundsGap(minGap, maxGap, 1);
      takeBoundsGap(maxGap, minGap, -1);
      updateMinMaxGap();
      if (minGap < 0) {
        squeezeWhenBailout(-minGap);
      }
      if (maxGap < 0) {
        squeezeWhenBailout(maxGap);
      }
      function updateMinMaxGap() {
        minGap = first.rect[xyDim] - minBound;
        maxGap = maxBound - last2.rect[xyDim] - last2.rect[sizeDim];
      }
      function takeBoundsGap(gapThisBound, gapOtherBound, moveDir) {
        if (gapThisBound < 0) {
          var moveFromMaxGap = Math.min(gapOtherBound, -gapThisBound);
          if (moveFromMaxGap > 0) {
            shiftList(moveFromMaxGap * moveDir, 0, len2);
            var remained = moveFromMaxGap + gapThisBound;
            if (remained < 0) {
              squeezeGaps(-remained * moveDir, 1);
            }
          } else {
            squeezeGaps(-gapThisBound * moveDir, 1);
          }
        }
      }
      function shiftList(delta2, start2, end2) {
        if (delta2 !== 0) {
          adjusted = true;
        }
        for (var i3 = start2; i3 < end2; i3++) {
          var item2 = list[i3];
          var rect2 = item2.rect;
          rect2[xyDim] += delta2;
          item2.label[xyDim] += delta2;
        }
      }
      function squeezeGaps(delta2, maxSqeezePercent) {
        var gaps = [];
        var totalGaps = 0;
        for (var i3 = 1; i3 < len2; i3++) {
          var prevItemRect = list[i3 - 1].rect;
          var gap = Math.max(list[i3].rect[xyDim] - prevItemRect[xyDim] - prevItemRect[sizeDim], 0);
          gaps.push(gap);
          totalGaps += gap;
        }
        if (!totalGaps) {
          return;
        }
        var squeezePercent = Math.min(Math.abs(delta2) / totalGaps, maxSqeezePercent);
        if (delta2 > 0) {
          for (var i3 = 0; i3 < len2 - 1; i3++) {
            var movement = gaps[i3] * squeezePercent;
            shiftList(movement, 0, i3 + 1);
          }
        } else {
          for (var i3 = len2 - 1; i3 > 0; i3--) {
            var movement = gaps[i3 - 1] * squeezePercent;
            shiftList(-movement, i3, len2);
          }
        }
      }
      function squeezeWhenBailout(delta2) {
        var dir3 = delta2 < 0 ? -1 : 1;
        delta2 = Math.abs(delta2);
        var moveForEachLabel = Math.ceil(delta2 / (len2 - 1));
        for (var i3 = 0; i3 < len2 - 1; i3++) {
          if (dir3 > 0) {
            shiftList(moveForEachLabel, 0, i3 + 1);
          } else {
            shiftList(-moveForEachLabel, len2 - i3 - 1, len2);
          }
          delta2 -= moveForEachLabel;
          if (delta2 <= 0) {
            return;
          }
        }
      }
      return adjusted;
    }
    function shiftLayoutOnX(list, leftBound, rightBound, balanceShift) {
      return shiftLayout(list, "x", "width", leftBound, rightBound);
    }
    function shiftLayoutOnY(list, topBound, bottomBound, balanceShift) {
      return shiftLayout(list, "y", "height", topBound, bottomBound);
    }
    function hideOverlap(labelList) {
      var displayedLabels = [];
      labelList.sort(function(a2, b2) {
        return b2.priority - a2.priority;
      });
      var globalRect = new BoundingRect(0, 0, 0, 0);
      function hideEl(el) {
        if (!el.ignore) {
          var emphasisState = el.ensureState("emphasis");
          if (emphasisState.ignore == null) {
            emphasisState.ignore = false;
          }
        }
        el.ignore = true;
      }
      for (var i2 = 0; i2 < labelList.length; i2++) {
        var labelItem = labelList[i2];
        var isAxisAligned = labelItem.axisAligned;
        var localRect = labelItem.localRect;
        var transform2 = labelItem.transform;
        var label = labelItem.label;
        var labelLine = labelItem.labelLine;
        globalRect.copy(labelItem.rect);
        globalRect.width -= 0.1;
        globalRect.height -= 0.1;
        globalRect.x += 0.05;
        globalRect.y += 0.05;
        var obb = labelItem.obb;
        var overlapped = false;
        for (var j = 0; j < displayedLabels.length; j++) {
          var existsTextCfg = displayedLabels[j];
          if (!globalRect.intersect(existsTextCfg.rect)) {
            continue;
          }
          if (isAxisAligned && existsTextCfg.axisAligned) {
            overlapped = true;
            break;
          }
          if (!existsTextCfg.obb) {
            existsTextCfg.obb = new OrientedBoundingRect(existsTextCfg.localRect, existsTextCfg.transform);
          }
          if (!obb) {
            obb = new OrientedBoundingRect(localRect, transform2);
          }
          if (obb.intersect(existsTextCfg.obb)) {
            overlapped = true;
            break;
          }
        }
        if (overlapped) {
          hideEl(label);
          labelLine && hideEl(labelLine);
        } else {
          label.attr("ignore", labelItem.defaultAttr.ignore);
          labelLine && labelLine.attr("ignore", labelItem.defaultAttr.labelGuideIgnore);
          displayedLabels.push(labelItem);
        }
      }
    }
    function cloneArr(points2) {
      if (points2) {
        var newPoints = [];
        for (var i2 = 0; i2 < points2.length; i2++) {
          newPoints.push(points2[i2].slice());
        }
        return newPoints;
      }
    }
    function prepareLayoutCallbackParams(labelItem, hostEl) {
      var label = labelItem.label;
      var labelLine = hostEl && hostEl.getTextGuideLine();
      return {
        dataIndex: labelItem.dataIndex,
        dataType: labelItem.dataType,
        seriesIndex: labelItem.seriesModel.seriesIndex,
        text: labelItem.label.style.text,
        rect: labelItem.hostRect,
        labelRect: labelItem.rect,
        // x: labelAttr.x,
        // y: labelAttr.y,
        align: label.style.align,
        verticalAlign: label.style.verticalAlign,
        labelLinePoints: cloneArr(labelLine && labelLine.shape.points)
      };
    }
    var LABEL_OPTION_TO_STYLE_KEYS = ["align", "verticalAlign", "width", "height", "fontSize"];
    var dummyTransformable = new Transformable();
    var labelLayoutInnerStore = makeInner();
    var labelLineAnimationStore = makeInner();
    function extendWithKeys(target, source, keys2) {
      for (var i2 = 0; i2 < keys2.length; i2++) {
        var key = keys2[i2];
        if (source[key] != null) {
          target[key] = source[key];
        }
      }
    }
    var LABEL_LAYOUT_PROPS = ["x", "y", "rotation"];
    var LabelManager = (
      /** @class */
      function() {
        function LabelManager2() {
          this._labelList = [];
          this._chartViewList = [];
        }
        LabelManager2.prototype.clearLabels = function() {
          this._labelList = [];
          this._chartViewList = [];
        };
        LabelManager2.prototype._addLabel = function(dataIndex, dataType2, seriesModel, label, layoutOption) {
          var labelStyle = label.style;
          var hostEl = label.__hostTarget;
          var textConfig = hostEl.textConfig || {};
          var labelTransform = label.getComputedTransform();
          var labelRect = label.getBoundingRect().plain();
          BoundingRect.applyTransform(labelRect, labelRect, labelTransform);
          if (labelTransform) {
            dummyTransformable.setLocalTransform(labelTransform);
          } else {
            dummyTransformable.x = dummyTransformable.y = dummyTransformable.rotation = dummyTransformable.originX = dummyTransformable.originY = 0;
            dummyTransformable.scaleX = dummyTransformable.scaleY = 1;
          }
          dummyTransformable.rotation = normalizeRadian(dummyTransformable.rotation);
          var host = label.__hostTarget;
          var hostRect;
          if (host) {
            hostRect = host.getBoundingRect().plain();
            var transform2 = host.getComputedTransform();
            BoundingRect.applyTransform(hostRect, hostRect, transform2);
          }
          var labelGuide = hostRect && host.getTextGuideLine();
          this._labelList.push({
            label,
            labelLine: labelGuide,
            seriesModel,
            dataIndex,
            dataType: dataType2,
            layoutOption,
            computedLayoutOption: null,
            rect: labelRect,
            hostRect,
            // Label with lower priority will be hidden when overlapped
            // Use rect size as default priority
            priority: hostRect ? hostRect.width * hostRect.height : 0,
            // Save default label attributes.
            // For restore if developers want get back to default value in callback.
            defaultAttr: {
              ignore: label.ignore,
              labelGuideIgnore: labelGuide && labelGuide.ignore,
              x: dummyTransformable.x,
              y: dummyTransformable.y,
              scaleX: dummyTransformable.scaleX,
              scaleY: dummyTransformable.scaleY,
              rotation: dummyTransformable.rotation,
              style: {
                x: labelStyle.x,
                y: labelStyle.y,
                align: labelStyle.align,
                verticalAlign: labelStyle.verticalAlign,
                width: labelStyle.width,
                height: labelStyle.height,
                fontSize: labelStyle.fontSize
              },
              cursor: label.cursor,
              attachedPos: textConfig.position,
              attachedRot: textConfig.rotation
            }
          });
        };
        LabelManager2.prototype.addLabelsOfSeries = function(chartView) {
          var _this = this;
          this._chartViewList.push(chartView);
          var seriesModel = chartView.__model;
          var layoutOption = seriesModel.get("labelLayout");
          if (!(isFunction$1(layoutOption) || keys$1(layoutOption).length)) {
            return;
          }
          chartView.group.traverse(function(child) {
            if (child.ignore) {
              return true;
            }
            var textEl = child.getTextContent();
            var ecData = getECData(child);
            if (textEl && !textEl.disableLabelLayout) {
              _this._addLabel(ecData.dataIndex, ecData.dataType, seriesModel, textEl, layoutOption);
            }
          });
        };
        LabelManager2.prototype.updateLayoutConfig = function(api2) {
          var width = api2.getWidth();
          var height = api2.getHeight();
          function createDragHandler(el, labelLineModel) {
            return function() {
              updateLabelLinePoints(el, labelLineModel);
            };
          }
          for (var i2 = 0; i2 < this._labelList.length; i2++) {
            var labelItem = this._labelList[i2];
            var label = labelItem.label;
            var hostEl = label.__hostTarget;
            var defaultLabelAttr = labelItem.defaultAttr;
            var layoutOption = void 0;
            if (isFunction$1(labelItem.layoutOption)) {
              layoutOption = labelItem.layoutOption(prepareLayoutCallbackParams(labelItem, hostEl));
            } else {
              layoutOption = labelItem.layoutOption;
            }
            layoutOption = layoutOption || {};
            labelItem.computedLayoutOption = layoutOption;
            var degreeToRadian = Math.PI / 180;
            if (hostEl) {
              hostEl.setTextConfig({
                // Force to set local false.
                local: false,
                // Ignore position and rotation config on the host el if x or y is changed.
                position: layoutOption.x != null || layoutOption.y != null ? null : defaultLabelAttr.attachedPos,
                // Ignore rotation config on the host el if rotation is changed.
                rotation: layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.attachedRot,
                offset: [layoutOption.dx || 0, layoutOption.dy || 0]
              });
            }
            var needsUpdateLabelLine = false;
            if (layoutOption.x != null) {
              label.x = parsePercent(layoutOption.x, width);
              label.setStyle("x", 0);
              needsUpdateLabelLine = true;
            } else {
              label.x = defaultLabelAttr.x;
              label.setStyle("x", defaultLabelAttr.style.x);
            }
            if (layoutOption.y != null) {
              label.y = parsePercent(layoutOption.y, height);
              label.setStyle("y", 0);
              needsUpdateLabelLine = true;
            } else {
              label.y = defaultLabelAttr.y;
              label.setStyle("y", defaultLabelAttr.style.y);
            }
            if (layoutOption.labelLinePoints) {
              var guideLine = hostEl.getTextGuideLine();
              if (guideLine) {
                guideLine.setShape({
                  points: layoutOption.labelLinePoints
                });
                needsUpdateLabelLine = false;
              }
            }
            var labelLayoutStore = labelLayoutInnerStore(label);
            labelLayoutStore.needsUpdateLabelLine = needsUpdateLabelLine;
            label.rotation = layoutOption.rotate != null ? layoutOption.rotate * degreeToRadian : defaultLabelAttr.rotation;
            label.scaleX = defaultLabelAttr.scaleX;
            label.scaleY = defaultLabelAttr.scaleY;
            for (var k2 = 0; k2 < LABEL_OPTION_TO_STYLE_KEYS.length; k2++) {
              var key = LABEL_OPTION_TO_STYLE_KEYS[k2];
              label.setStyle(key, layoutOption[key] != null ? layoutOption[key] : defaultLabelAttr.style[key]);
            }
            if (layoutOption.draggable) {
              label.draggable = true;
              label.cursor = "move";
              if (hostEl) {
                var hostModel = labelItem.seriesModel;
                if (labelItem.dataIndex != null) {
                  var data = labelItem.seriesModel.getData(labelItem.dataType);
                  hostModel = data.getItemModel(labelItem.dataIndex);
                }
                label.on("drag", createDragHandler(hostEl, hostModel.getModel("labelLine")));
              }
            } else {
              label.off("drag");
              label.cursor = defaultLabelAttr.cursor;
            }
          }
        };
        LabelManager2.prototype.layout = function(api2) {
          var width = api2.getWidth();
          var height = api2.getHeight();
          var labelList = prepareLayoutList(this._labelList);
          var labelsNeedsAdjustOnX = filter(labelList, function(item) {
            return item.layoutOption.moveOverlap === "shiftX";
          });
          var labelsNeedsAdjustOnY = filter(labelList, function(item) {
            return item.layoutOption.moveOverlap === "shiftY";
          });
          shiftLayoutOnX(labelsNeedsAdjustOnX, 0, width);
          shiftLayoutOnY(labelsNeedsAdjustOnY, 0, height);
          var labelsNeedsHideOverlap = filter(labelList, function(item) {
            return item.layoutOption.hideOverlap;
          });
          hideOverlap(labelsNeedsHideOverlap);
        };
        LabelManager2.prototype.processLabelsOverall = function() {
          var _this = this;
          each$f(this._chartViewList, function(chartView) {
            var seriesModel = chartView.__model;
            var ignoreLabelLineUpdate = chartView.ignoreLabelLineUpdate;
            var animationEnabled = seriesModel.isAnimationEnabled();
            chartView.group.traverse(function(child) {
              if (child.ignore && !child.forceLabelAnimation) {
                return true;
              }
              var needsUpdateLabelLine = !ignoreLabelLineUpdate;
              var label = child.getTextContent();
              if (!needsUpdateLabelLine && label) {
                needsUpdateLabelLine = labelLayoutInnerStore(label).needsUpdateLabelLine;
              }
              if (needsUpdateLabelLine) {
                _this._updateLabelLine(child, seriesModel);
              }
              if (animationEnabled) {
                _this._animateLabels(child, seriesModel);
              }
            });
          });
        };
        LabelManager2.prototype._updateLabelLine = function(el, seriesModel) {
          var textEl = el.getTextContent();
          var ecData = getECData(el);
          var dataIndex = ecData.dataIndex;
          if (textEl && dataIndex != null) {
            var data = seriesModel.getData(ecData.dataType);
            var itemModel = data.getItemModel(dataIndex);
            var defaultStyle = {};
            var visualStyle = data.getItemVisual(dataIndex, "style");
            if (visualStyle) {
              var visualType = data.getVisual("drawType");
              defaultStyle.stroke = visualStyle[visualType];
            }
            var labelLineModel = itemModel.getModel("labelLine");
            setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle);
            updateLabelLinePoints(el, labelLineModel);
          }
        };
        LabelManager2.prototype._animateLabels = function(el, seriesModel) {
          var textEl = el.getTextContent();
          var guideLine = el.getTextGuideLine();
          if (textEl && (el.forceLabelAnimation || !textEl.ignore && !textEl.invisible && !el.disableLabelAnimation && !isElementRemoved(el))) {
            var layoutStore = labelLayoutInnerStore(textEl);
            var oldLayout = layoutStore.oldLayout;
            var ecData = getECData(el);
            var dataIndex = ecData.dataIndex;
            var newProps = {
              x: textEl.x,
              y: textEl.y,
              rotation: textEl.rotation
            };
            var data = seriesModel.getData(ecData.dataType);
            if (!oldLayout) {
              textEl.attr(newProps);
              if (!labelInner(textEl).valueAnimation) {
                var oldOpacity = retrieve2(textEl.style.opacity, 1);
                textEl.style.opacity = 0;
                initProps(textEl, {
                  style: {
                    opacity: oldOpacity
                  }
                }, seriesModel, dataIndex);
              }
            } else {
              textEl.attr(oldLayout);
              var prevStates = el.prevStates;
              if (prevStates) {
                if (indexOf(prevStates, "select") >= 0) {
                  textEl.attr(layoutStore.oldLayoutSelect);
                }
                if (indexOf(prevStates, "emphasis") >= 0) {
                  textEl.attr(layoutStore.oldLayoutEmphasis);
                }
              }
              updateProps$1(textEl, newProps, seriesModel, dataIndex);
            }
            layoutStore.oldLayout = newProps;
            if (textEl.states.select) {
              var layoutSelect = layoutStore.oldLayoutSelect = {};
              extendWithKeys(layoutSelect, newProps, LABEL_LAYOUT_PROPS);
              extendWithKeys(layoutSelect, textEl.states.select, LABEL_LAYOUT_PROPS);
            }
            if (textEl.states.emphasis) {
              var layoutEmphasis = layoutStore.oldLayoutEmphasis = {};
              extendWithKeys(layoutEmphasis, newProps, LABEL_LAYOUT_PROPS);
              extendWithKeys(layoutEmphasis, textEl.states.emphasis, LABEL_LAYOUT_PROPS);
            }
            animateLabelValue(textEl, dataIndex, data, seriesModel, seriesModel);
          }
          if (guideLine && !guideLine.ignore && !guideLine.invisible) {
            var layoutStore = labelLineAnimationStore(guideLine);
            var oldLayout = layoutStore.oldLayout;
            var newLayout = {
              points: guideLine.shape.points
            };
            if (!oldLayout) {
              guideLine.setShape(newLayout);
              guideLine.style.strokePercent = 0;
              initProps(guideLine, {
                style: {
                  strokePercent: 1
                }
              }, seriesModel);
            } else {
              guideLine.attr({
                shape: oldLayout
              });
              updateProps$1(guideLine, {
                shape: newLayout
              }, seriesModel);
            }
            layoutStore.oldLayout = newLayout;
          }
        };
        return LabelManager2;
      }()
    );
    var getLabelManager = makeInner();
    function installLabelLayout(registers) {
      registers.registerUpdateLifecycle("series:beforeupdate", function(ecModel, api2, params) {
        var labelManager = getLabelManager(api2).labelManager;
        if (!labelManager) {
          labelManager = getLabelManager(api2).labelManager = new LabelManager();
        }
        labelManager.clearLabels();
      });
      registers.registerUpdateLifecycle("series:layoutlabels", function(ecModel, api2, params) {
        var labelManager = getLabelManager(api2).labelManager;
        params.updatedSeries.forEach(function(series) {
          labelManager.addLabelsOfSeries(api2.getViewOfSeriesModel(series));
        });
        labelManager.updateLayoutConfig(api2);
        labelManager.layout(api2);
        labelManager.processLabelsOverall();
      });
    }
    var mathSin = Math.sin;
    var mathCos = Math.cos;
    var PI$4 = Math.PI;
    var PI2$1 = Math.PI * 2;
    var degree = 180 / PI$4;
    var SVGPathRebuilder = function() {
      function SVGPathRebuilder2() {
      }
      SVGPathRebuilder2.prototype.reset = function(precision) {
        this._start = true;
        this._d = [];
        this._str = "";
        this._p = Math.pow(10, precision || 4);
      };
      SVGPathRebuilder2.prototype.moveTo = function(x2, y) {
        this._add("M", x2, y);
      };
      SVGPathRebuilder2.prototype.lineTo = function(x2, y) {
        this._add("L", x2, y);
      };
      SVGPathRebuilder2.prototype.bezierCurveTo = function(x2, y, x22, y2, x3, y3) {
        this._add("C", x2, y, x22, y2, x3, y3);
      };
      SVGPathRebuilder2.prototype.quadraticCurveTo = function(x2, y, x22, y2) {
        this._add("Q", x2, y, x22, y2);
      };
      SVGPathRebuilder2.prototype.arc = function(cx, cy, r, startAngle, endAngle, anticlockwise) {
        this.ellipse(cx, cy, r, r, 0, startAngle, endAngle, anticlockwise);
      };
      SVGPathRebuilder2.prototype.ellipse = function(cx, cy, rx, ry, psi, startAngle, endAngle, anticlockwise) {
        var dTheta = endAngle - startAngle;
        var clockwise = !anticlockwise;
        var dThetaPositive = Math.abs(dTheta);
        var isCircle = isAroundZero(dThetaPositive - PI2$1) || (clockwise ? dTheta >= PI2$1 : -dTheta >= PI2$1);
        var unifiedTheta = dTheta > 0 ? dTheta % PI2$1 : dTheta % PI2$1 + PI2$1;
        var large = false;
        if (isCircle) {
          large = true;
        } else if (isAroundZero(dThetaPositive)) {
          large = false;
        } else {
          large = unifiedTheta >= PI$4 === !!clockwise;
        }
        var x0 = cx + rx * mathCos(startAngle);
        var y0 = cy + ry * mathSin(startAngle);
        if (this._start) {
          this._add("M", x0, y0);
        }
        var xRot = Math.round(psi * degree);
        if (isCircle) {
          var p2 = 1 / this._p;
          var dTheta_1 = (clockwise ? 1 : -1) * (PI2$1 - p2);
          this._add("A", rx, ry, xRot, 1, +clockwise, cx + rx * mathCos(startAngle + dTheta_1), cy + ry * mathSin(startAngle + dTheta_1));
          if (p2 > 0.01) {
            this._add("A", rx, ry, xRot, 0, +clockwise, x0, y0);
          }
        } else {
          var x2 = cx + rx * mathCos(endAngle);
          var y = cy + ry * mathSin(endAngle);
          this._add("A", rx, ry, xRot, +large, +clockwise, x2, y);
        }
      };
      SVGPathRebuilder2.prototype.rect = function(x2, y, w2, h2) {
        this._add("M", x2, y);
        this._add("l", w2, 0);
        this._add("l", 0, h2);
        this._add("l", -w2, 0);
        this._add("Z");
      };
      SVGPathRebuilder2.prototype.closePath = function() {
        if (this._d.length > 0) {
          this._add("Z");
        }
      };
      SVGPathRebuilder2.prototype._add = function(cmd, a2, b2, c2, d2, e2, f2, g, h2) {
        var vals = [];
        var p2 = this._p;
        for (var i2 = 1; i2 < arguments.length; i2++) {
          var val = arguments[i2];
          if (isNaN(val)) {
            this._invalid = true;
            return;
          }
          vals.push(Math.round(val * p2) / p2);
        }
        this._d.push(cmd + vals.join(" "));
        this._start = cmd === "Z";
      };
      SVGPathRebuilder2.prototype.generateStr = function() {
        this._str = this._invalid ? "" : this._d.join("");
        this._d = [];
      };
      SVGPathRebuilder2.prototype.getStr = function() {
        return this._str;
      };
      return SVGPathRebuilder2;
    }();
    var NONE = "none";
    var mathRound = Math.round;
    function pathHasFill(style) {
      var fill2 = style.fill;
      return fill2 != null && fill2 !== NONE;
    }
    function pathHasStroke(style) {
      var stroke = style.stroke;
      return stroke != null && stroke !== NONE;
    }
    var strokeProps = ["lineCap", "miterLimit", "lineJoin"];
    var svgStrokeProps = map$1(strokeProps, function(prop) {
      return "stroke-" + prop.toLowerCase();
    });
    function mapStyleToAttrs(updateAttr2, style, el, forceUpdate) {
      var opacity2 = style.opacity == null ? 1 : style.opacity;
      if (el instanceof ZRImage) {
        updateAttr2("opacity", opacity2);
        return;
      }
      if (pathHasFill(style)) {
        var fill2 = normalizeColor(style.fill);
        updateAttr2("fill", fill2.color);
        var fillOpacity = style.fillOpacity != null ? style.fillOpacity * fill2.opacity * opacity2 : fill2.opacity * opacity2;
        if (fillOpacity < 1) {
          updateAttr2("fill-opacity", fillOpacity);
        }
      } else {
        updateAttr2("fill", NONE);
      }
      if (pathHasStroke(style)) {
        var stroke = normalizeColor(style.stroke);
        updateAttr2("stroke", stroke.color);
        var strokeScale = style.strokeNoScale ? el.getLineScale() : 1;
        var strokeWidth = strokeScale ? (style.lineWidth || 0) / strokeScale : 0;
        var strokeOpacity = style.strokeOpacity != null ? style.strokeOpacity * stroke.opacity * opacity2 : stroke.opacity * opacity2;
        var strokeFirst = style.strokeFirst;
        if (strokeWidth !== 1) {
          updateAttr2("stroke-width", strokeWidth);
        }
        if (strokeFirst) {
          updateAttr2("paint-order", strokeFirst ? "stroke" : "fill");
        }
        if (strokeOpacity < 1) {
          updateAttr2("stroke-opacity", strokeOpacity);
        }
        if (style.lineDash) {
          var _a2 = getLineDash(el), lineDash = _a2[0], lineDashOffset = _a2[1];
          if (lineDash) {
            lineDashOffset = mathRound(lineDashOffset || 0);
            updateAttr2("stroke-dasharray", lineDash.join(","));
            if (lineDashOffset || forceUpdate) {
              updateAttr2("stroke-dashoffset", lineDashOffset);
            }
          }
        }
        for (var i2 = 0; i2 < strokeProps.length; i2++) {
          var propName = strokeProps[i2];
          if (style[propName] !== DEFAULT_PATH_STYLE[propName]) {
            var val = style[propName] || DEFAULT_PATH_STYLE[propName];
            val && updateAttr2(svgStrokeProps[i2], val);
          }
        }
      }
    }
    var SVGNS = "http://www.w3.org/2000/svg";
    var XLINKNS = "http://www.w3.org/1999/xlink";
    var XMLNS$1 = "http://www.w3.org/2000/xmlns/";
    var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace";
    var META_DATA_PREFIX = "ecmeta_";
    function createElement(name) {
      return document.createElementNS(SVGNS, name);
    }
    function createVNode(tag, key, attrs, children, text) {
      return {
        tag,
        attrs: attrs || {},
        children,
        text,
        key
      };
    }
    function createElementOpen(name, attrs) {
      var attrsStr = [];
      if (attrs) {
        for (var key in attrs) {
          var val = attrs[key];
          var part = key;
          if (val === false) {
            continue;
          } else if (val !== true && val != null) {
            part += '="' + val + '"';
          }
          attrsStr.push(part);
        }
      }
      return "<" + name + " " + attrsStr.join(" ") + ">";
    }
    function createElementClose(name) {
      return "</" + name + ">";
    }
    function vNodeToString(el, opts) {
      opts = opts || {};
      var S2 = opts.newline ? "\n" : "";
      function convertElToString(el2) {
        var children = el2.children, tag = el2.tag, attrs = el2.attrs, text = el2.text;
        return createElementOpen(tag, attrs) + (tag !== "style" ? encodeHTML(text) : text || "") + (children ? "" + S2 + map$1(children, function(child) {
          return convertElToString(child);
        }).join(S2) + S2 : "") + createElementClose(tag);
      }
      return convertElToString(el);
    }
    function getCssString(selectorNodes, animationNodes, opts) {
      opts = opts || {};
      var S2 = opts.newline ? "\n" : "";
      var bracketBegin = " {" + S2;
      var bracketEnd = S2 + "}";
      var selectors = map$1(keys$1(selectorNodes), function(className) {
        return className + bracketBegin + map$1(keys$1(selectorNodes[className]), function(attrName) {
          return attrName + ":" + selectorNodes[className][attrName] + ";";
        }).join(S2) + bracketEnd;
      }).join(S2);
      var animations = map$1(keys$1(animationNodes), function(animationName) {
        return "@keyframes " + animationName + bracketBegin + map$1(keys$1(animationNodes[animationName]), function(percent) {
          return percent + bracketBegin + map$1(keys$1(animationNodes[animationName][percent]), function(attrName) {
            var val = animationNodes[animationName][percent][attrName];
            if (attrName === "d") {
              val = 'path("' + val + '")';
            }
            return attrName + ":" + val + ";";
          }).join(S2) + bracketEnd;
        }).join(S2) + bracketEnd;
      }).join(S2);
      if (!selectors && !animations) {
        return "";
      }
      return ["<![CDATA[", selectors, animations, "]]>"].join(S2);
    }
    function createBrushScope(zrId) {
      return {
        zrId,
        shadowCache: {},
        patternCache: {},
        gradientCache: {},
        clipPathCache: {},
        defs: {},
        cssNodes: {},
        cssAnims: {},
        cssStyleCache: {},
        cssAnimIdx: 0,
        shadowIdx: 0,
        gradientIdx: 0,
        patternIdx: 0,
        clipPathIdx: 0
      };
    }
    function createSVGVNode(width, height, children, useViewBox) {
      return createVNode("svg", "root", {
        "width": width,
        "height": height,
        "xmlns": SVGNS,
        "xmlns:xlink": XLINKNS,
        "version": "1.1",
        "baseProfile": "full",
        "viewBox": useViewBox ? "0 0 " + width + " " + height : false
      }, children);
    }
    var cssClassIdx = 0;
    function getClassId() {
      return cssClassIdx++;
    }
    var EASING_MAP = {
      cubicIn: "0.32,0,0.67,0",
      cubicOut: "0.33,1,0.68,1",
      cubicInOut: "0.65,0,0.35,1",
      quadraticIn: "0.11,0,0.5,0",
      quadraticOut: "0.5,1,0.89,1",
      quadraticInOut: "0.45,0,0.55,1",
      quarticIn: "0.5,0,0.75,0",
      quarticOut: "0.25,1,0.5,1",
      quarticInOut: "0.76,0,0.24,1",
      quinticIn: "0.64,0,0.78,0",
      quinticOut: "0.22,1,0.36,1",
      quinticInOut: "0.83,0,0.17,1",
      sinusoidalIn: "0.12,0,0.39,0",
      sinusoidalOut: "0.61,1,0.88,1",
      sinusoidalInOut: "0.37,0,0.63,1",
      exponentialIn: "0.7,0,0.84,0",
      exponentialOut: "0.16,1,0.3,1",
      exponentialInOut: "0.87,0,0.13,1",
      circularIn: "0.55,0,1,0.45",
      circularOut: "0,0.55,0.45,1",
      circularInOut: "0.85,0,0.15,1"
    };
    var transformOriginKey = "transform-origin";
    function buildPathString(el, kfShape, path) {
      var shape = extend$1({}, el.shape);
      extend$1(shape, kfShape);
      el.buildPath(path, shape);
      var svgPathBuilder = new SVGPathRebuilder();
      svgPathBuilder.reset(getPathPrecision(el));
      path.rebuildPath(svgPathBuilder, 1);
      svgPathBuilder.generateStr();
      return svgPathBuilder.getStr();
    }
    function setTransformOrigin(target, transform2) {
      var originX = transform2.originX, originY = transform2.originY;
      if (originX || originY) {
        target[transformOriginKey] = originX + "px " + originY + "px";
      }
    }
    var ANIMATE_STYLE_MAP = {
      fill: "fill",
      opacity: "opacity",
      lineWidth: "stroke-width",
      lineDashOffset: "stroke-dashoffset"
    };
    function addAnimation(cssAnim, scope) {
      var animationName = scope.zrId + "-ani-" + scope.cssAnimIdx++;
      scope.cssAnims[animationName] = cssAnim;
      return animationName;
    }
    function createCompoundPathCSSAnimation(el, attrs, scope) {
      var paths = el.shape.paths;
      var composedAnim = {};
      var cssAnimationCfg;
      var cssAnimationName;
      each$f(paths, function(path) {
        var subScope = createBrushScope(scope.zrId);
        subScope.animation = true;
        createCSSAnimation(path, {}, subScope, true);
        var cssAnims = subScope.cssAnims;
        var cssNodes = subScope.cssNodes;
        var animNames = keys$1(cssAnims);
        var len2 = animNames.length;
        if (!len2) {
          return;
        }
        cssAnimationName = animNames[len2 - 1];
        var lastAnim = cssAnims[cssAnimationName];
        for (var percent in lastAnim) {
          var kf = lastAnim[percent];
          composedAnim[percent] = composedAnim[percent] || { d: "" };
          composedAnim[percent].d += kf.d || "";
        }
        for (var className in cssNodes) {
          var val = cssNodes[className].animation;
          if (val.indexOf(cssAnimationName) >= 0) {
            cssAnimationCfg = val;
          }
        }
      });
      if (!cssAnimationCfg) {
        return;
      }
      attrs.d = false;
      var animationName = addAnimation(composedAnim, scope);
      return cssAnimationCfg.replace(cssAnimationName, animationName);
    }
    function getEasingFunc(easing) {
      return isString$1(easing) ? EASING_MAP[easing] ? "cubic-bezier(" + EASING_MAP[easing] + ")" : createCubicEasingFunc(easing) ? easing : "" : "";
    }
    function createCSSAnimation(el, attrs, scope, onlyShape) {
      var animators = el.animators;
      var len2 = animators.length;
      var cssAnimations = [];
      if (el instanceof CompoundPath) {
        var animationCfg = createCompoundPathCSSAnimation(el, attrs, scope);
        if (animationCfg) {
          cssAnimations.push(animationCfg);
        } else if (!len2) {
          return;
        }
      } else if (!len2) {
        return;
      }
      var groupAnimators = {};
      for (var i2 = 0; i2 < len2; i2++) {
        var animator = animators[i2];
        var cfgArr = [animator.getMaxTime() / 1e3 + "s"];
        var easing = getEasingFunc(animator.getClip().easing);
        var delay = animator.getDelay();
        if (easing) {
          cfgArr.push(easing);
        } else {
          cfgArr.push("linear");
        }
        if (delay) {
          cfgArr.push(delay / 1e3 + "s");
        }
        if (animator.getLoop()) {
          cfgArr.push("infinite");
        }
        var cfg = cfgArr.join(" ");
        groupAnimators[cfg] = groupAnimators[cfg] || [cfg, []];
        groupAnimators[cfg][1].push(animator);
      }
      function createSingleCSSAnimation(groupAnimator) {
        var animators2 = groupAnimator[1];
        var len3 = animators2.length;
        var transformKfs = {};
        var shapeKfs = {};
        var finalKfs = {};
        var animationTimingFunctionAttrName = "animation-timing-function";
        function saveAnimatorTrackToCssKfs(animator3, cssKfs, toCssAttrName) {
          var tracks = animator3.getTracks();
          var maxTime = animator3.getMaxTime();
          for (var k2 = 0; k2 < tracks.length; k2++) {
            var track2 = tracks[k2];
            if (track2.needsAnimate()) {
              var kfs = track2.keyframes;
              var attrName = track2.propName;
              toCssAttrName && (attrName = toCssAttrName(attrName));
              if (attrName) {
                for (var i4 = 0; i4 < kfs.length; i4++) {
                  var kf = kfs[i4];
                  var percent2 = Math.round(kf.time / maxTime * 100) + "%";
                  var kfEasing = getEasingFunc(kf.easing);
                  var rawValue = kf.rawValue;
                  if (isString$1(rawValue) || isNumber$1(rawValue)) {
                    cssKfs[percent2] = cssKfs[percent2] || {};
                    cssKfs[percent2][attrName] = kf.rawValue;
                    if (kfEasing) {
                      cssKfs[percent2][animationTimingFunctionAttrName] = kfEasing;
                    }
                  }
                }
              }
            }
          }
        }
        for (var i3 = 0; i3 < len3; i3++) {
          var animator2 = animators2[i3];
          var targetProp = animator2.targetName;
          if (!targetProp) {
            !onlyShape && saveAnimatorTrackToCssKfs(animator2, transformKfs);
          } else if (targetProp === "shape") {
            saveAnimatorTrackToCssKfs(animator2, shapeKfs);
          }
        }
        for (var percent in transformKfs) {
          var transform2 = {};
          copyTransform(transform2, el);
          extend$1(transform2, transformKfs[percent]);
          var str = getSRTTransformString(transform2);
          var timingFunction = transformKfs[percent][animationTimingFunctionAttrName];
          finalKfs[percent] = str ? {
            transform: str
          } : {};
          setTransformOrigin(finalKfs[percent], transform2);
          if (timingFunction) {
            finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;
          }
        }
        var path;
        var canAnimateShape = true;
        for (var percent in shapeKfs) {
          finalKfs[percent] = finalKfs[percent] || {};
          var isFirst = !path;
          var timingFunction = shapeKfs[percent][animationTimingFunctionAttrName];
          if (isFirst) {
            path = new PathProxy();
          }
          var len_1 = path.len();
          path.reset();
          finalKfs[percent].d = buildPathString(el, shapeKfs[percent], path);
          var newLen = path.len();
          if (!isFirst && len_1 !== newLen) {
            canAnimateShape = false;
            break;
          }
          if (timingFunction) {
            finalKfs[percent][animationTimingFunctionAttrName] = timingFunction;
          }
        }
        if (!canAnimateShape) {
          for (var percent in finalKfs) {
            delete finalKfs[percent].d;
          }
        }
        if (!onlyShape) {
          for (var i3 = 0; i3 < len3; i3++) {
            var animator2 = animators2[i3];
            var targetProp = animator2.targetName;
            if (targetProp === "style") {
              saveAnimatorTrackToCssKfs(animator2, finalKfs, function(propName) {
                return ANIMATE_STYLE_MAP[propName];
              });
            }
          }
        }
        var percents = keys$1(finalKfs);
        var allTransformOriginSame = true;
        var transformOrigin2;
        for (var i3 = 1; i3 < percents.length; i3++) {
          var p0 = percents[i3 - 1];
          var p1 = percents[i3];
          if (finalKfs[p0][transformOriginKey] !== finalKfs[p1][transformOriginKey]) {
            allTransformOriginSame = false;
            break;
          }
          transformOrigin2 = finalKfs[p0][transformOriginKey];
        }
        if (allTransformOriginSame && transformOrigin2) {
          for (var percent in finalKfs) {
            if (finalKfs[percent][transformOriginKey]) {
              delete finalKfs[percent][transformOriginKey];
            }
          }
          attrs[transformOriginKey] = transformOrigin2;
        }
        if (filter(percents, function(percent2) {
          return keys$1(finalKfs[percent2]).length > 0;
        }).length) {
          var animationName = addAnimation(finalKfs, scope);
          return animationName + " " + groupAnimator[0] + " both";
        }
      }
      for (var key in groupAnimators) {
        var animationCfg = createSingleCSSAnimation(groupAnimators[key]);
        if (animationCfg) {
          cssAnimations.push(animationCfg);
        }
      }
      if (cssAnimations.length) {
        var className = scope.zrId + "-cls-" + getClassId();
        scope.cssNodes["." + className] = {
          animation: cssAnimations.join(",")
        };
        attrs["class"] = className;
      }
    }
    function createCSSEmphasis(el, attrs, scope) {
      if (!el.ignore) {
        if (el.isSilent()) {
          var style = {
            "pointer-events": "none"
          };
          setClassAttribute(style, attrs, scope);
        } else {
          var emphasisStyle = el.states.emphasis && el.states.emphasis.style ? el.states.emphasis.style : {};
          var fill2 = emphasisStyle.fill;
          if (!fill2) {
            var normalFill = el.style && el.style.fill;
            var selectFill = el.states.select && el.states.select.style && el.states.select.style.fill;
            var fromFill = el.currentStates.indexOf("select") >= 0 ? selectFill || normalFill : normalFill;
            if (fromFill) {
              fill2 = liftColor(fromFill);
            }
          }
          var lineWidth = emphasisStyle.lineWidth;
          if (lineWidth) {
            var scaleX = !emphasisStyle.strokeNoScale && el.transform ? el.transform[0] : 1;
            lineWidth = lineWidth / scaleX;
          }
          var style = {
            cursor: "pointer"
          };
          if (fill2) {
            style.fill = fill2;
          }
          if (emphasisStyle.stroke) {
            style.stroke = emphasisStyle.stroke;
          }
          if (lineWidth) {
            style["stroke-width"] = lineWidth;
          }
          setClassAttribute(style, attrs, scope);
        }
      }
    }
    function setClassAttribute(style, attrs, scope, withHover) {
      var styleKey = JSON.stringify(style);
      var className = scope.cssStyleCache[styleKey];
      if (!className) {
        className = scope.zrId + "-cls-" + getClassId();
        scope.cssStyleCache[styleKey] = className;
        scope.cssNodes["." + className + ":hover"] = style;
      }
      attrs["class"] = attrs["class"] ? attrs["class"] + " " + className : className;
    }
    var round$1 = Math.round;
    function isImageLike(val) {
      return val && isString$1(val.src);
    }
    function isCanvasLike(val) {
      return val && isFunction$1(val.toDataURL);
    }
    function setStyleAttrs(attrs, style, el, scope) {
      mapStyleToAttrs(function(key, val) {
        var isFillStroke = key === "fill" || key === "stroke";
        if (isFillStroke && isGradient(val)) {
          setGradient(style, attrs, key, scope);
        } else if (isFillStroke && isPattern(val)) {
          setPattern(el, attrs, key, scope);
        } else {
          attrs[key] = val;
        }
        if (isFillStroke && scope.ssr && val === "none") {
          attrs["pointer-events"] = "visible";
        }
      }, style, el, false);
      setShadow(el, attrs, scope);
    }
    function setMetaData(attrs, el) {
      var metaData = getElementSSRData(el);
      if (metaData) {
        metaData.each(function(val, key) {
          val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + "");
        });
        if (el.isSilent()) {
          attrs[META_DATA_PREFIX + "silent"] = "true";
        }
      }
    }
    function noRotateScale(m2) {
      return isAroundZero(m2[0] - 1) && isAroundZero(m2[1]) && isAroundZero(m2[2]) && isAroundZero(m2[3] - 1);
    }
    function noTranslate(m2) {
      return isAroundZero(m2[4]) && isAroundZero(m2[5]);
    }
    function setTransform(attrs, m2, compress) {
      if (m2 && !(noTranslate(m2) && noRotateScale(m2))) {
        var mul2 = 1e4;
        attrs.transform = noRotateScale(m2) ? "translate(" + round$1(m2[4] * mul2) / mul2 + " " + round$1(m2[5] * mul2) / mul2 + ")" : getMatrixStr(m2);
      }
    }
    function convertPolyShape(shape, attrs, mul2) {
      var points2 = shape.points;
      var strArr = [];
      for (var i2 = 0; i2 < points2.length; i2++) {
        strArr.push(round$1(points2[i2][0] * mul2) / mul2);
        strArr.push(round$1(points2[i2][1] * mul2) / mul2);
      }
      attrs.points = strArr.join(" ");
    }
    function validatePolyShape(shape) {
      return !shape.smooth;
    }
    function createAttrsConvert(desc) {
      var normalizedDesc = map$1(desc, function(item) {
        return typeof item === "string" ? [item, item] : item;
      });
      return function(shape, attrs, mul2) {
        for (var i2 = 0; i2 < normalizedDesc.length; i2++) {
          var item = normalizedDesc[i2];
          var val = shape[item[0]];
          if (val != null) {
            attrs[item[1]] = round$1(val * mul2) / mul2;
          }
        }
      };
    }
    var builtinShapesDef = {
      circle: [createAttrsConvert(["cx", "cy", "r"])],
      polyline: [convertPolyShape, validatePolyShape],
      polygon: [convertPolyShape, validatePolyShape]
    };
    function hasShapeAnimation(el) {
      var animators = el.animators;
      for (var i2 = 0; i2 < animators.length; i2++) {
        if (animators[i2].targetName === "shape") {
          return true;
        }
      }
      return false;
    }
    function brushSVGPath(el, scope) {
      var style = el.style;
      var shape = el.shape;
      var builtinShpDef = builtinShapesDef[el.type];
      var attrs = {};
      var needsAnimate = scope.animation;
      var svgElType = "path";
      var strokePercent = el.style.strokePercent;
      var precision = scope.compress && getPathPrecision(el) || 4;
      if (builtinShpDef && !scope.willUpdate && !(builtinShpDef[1] && !builtinShpDef[1](shape)) && !(needsAnimate && hasShapeAnimation(el)) && !(strokePercent < 1)) {
        svgElType = el.type;
        var mul2 = Math.pow(10, precision);
        builtinShpDef[0](shape, attrs, mul2);
      } else {
        var needBuildPath = !el.path || el.shapeChanged();
        if (!el.path) {
          el.createPathProxy();
        }
        var path = el.path;
        if (needBuildPath) {
          path.beginPath();
          el.buildPath(path, el.shape);
          el.pathUpdated();
        }
        var pathVersion = path.getVersion();
        var elExt = el;
        var svgPathBuilder = elExt.__svgPathBuilder;
        if (elExt.__svgPathVersion !== pathVersion || !svgPathBuilder || strokePercent !== elExt.__svgPathStrokePercent) {
          if (!svgPathBuilder) {
            svgPathBuilder = elExt.__svgPathBuilder = new SVGPathRebuilder();
          }
          svgPathBuilder.reset(precision);
          path.rebuildPath(svgPathBuilder, strokePercent);
          svgPathBuilder.generateStr();
          elExt.__svgPathVersion = pathVersion;
          elExt.__svgPathStrokePercent = strokePercent;
        }
        attrs.d = svgPathBuilder.getStr();
      }
      setTransform(attrs, el.transform);
      setStyleAttrs(attrs, style, el, scope);
      setMetaData(attrs, el);
      scope.animation && createCSSAnimation(el, attrs, scope);
      scope.emphasis && createCSSEmphasis(el, attrs, scope);
      return createVNode(svgElType, el.id + "", attrs);
    }
    function brushSVGImage(el, scope) {
      var style = el.style;
      var image2 = style.image;
      if (image2 && !isString$1(image2)) {
        if (isImageLike(image2)) {
          image2 = image2.src;
        } else if (isCanvasLike(image2)) {
          image2 = image2.toDataURL();
        }
      }
      if (!image2) {
        return;
      }
      var x2 = style.x || 0;
      var y = style.y || 0;
      var dw = style.width;
      var dh = style.height;
      var attrs = {
        href: image2,
        width: dw,
        height: dh
      };
      if (x2) {
        attrs.x = x2;
      }
      if (y) {
        attrs.y = y;
      }
      setTransform(attrs, el.transform);
      setStyleAttrs(attrs, style, el, scope);
      setMetaData(attrs, el);
      scope.animation && createCSSAnimation(el, attrs, scope);
      return createVNode("image", el.id + "", attrs);
    }
    function brushSVGTSpan(el, scope) {
      var style = el.style;
      var text = style.text;
      text != null && (text += "");
      if (!text || isNaN(style.x) || isNaN(style.y)) {
        return;
      }
      var font = style.font || DEFAULT_FONT;
      var x2 = style.x || 0;
      var y = adjustTextY$1(style.y || 0, getLineHeight(font), style.textBaseline);
      var textAlign2 = TEXT_ALIGN_TO_ANCHOR[style.textAlign] || style.textAlign;
      var attrs = {
        "dominant-baseline": "central",
        "text-anchor": textAlign2
      };
      if (hasSeparateFont(style)) {
        var separatedFontStr = "";
        var fontStyle2 = style.fontStyle;
        var fontSize2 = parseFontSize(style.fontSize);
        if (!parseFloat(fontSize2)) {
          return;
        }
        var fontFamily2 = style.fontFamily || DEFAULT_FONT_FAMILY;
        var fontWeight2 = style.fontWeight;
        separatedFontStr += "font-size:" + fontSize2 + ";font-family:" + fontFamily2 + ";";
        if (fontStyle2 && fontStyle2 !== "normal") {
          separatedFontStr += "font-style:" + fontStyle2 + ";";
        }
        if (fontWeight2 && fontWeight2 !== "normal") {
          separatedFontStr += "font-weight:" + fontWeight2 + ";";
        }
        attrs.style = separatedFontStr;
      } else {
        attrs.style = "font: " + font;
      }
      if (text.match(/\s/)) {
        attrs["xml:space"] = "preserve";
      }
      if (x2) {
        attrs.x = x2;
      }
      if (y) {
        attrs.y = y;
      }
      setTransform(attrs, el.transform);
      setStyleAttrs(attrs, style, el, scope);
      setMetaData(attrs, el);
      scope.animation && createCSSAnimation(el, attrs, scope);
      return createVNode("text", el.id + "", attrs, void 0, text);
    }
    function brush(el, scope) {
      if (el instanceof Path) {
        return brushSVGPath(el, scope);
      } else if (el instanceof ZRImage) {
        return brushSVGImage(el, scope);
      } else if (el instanceof TSpan) {
        return brushSVGTSpan(el, scope);
      }
    }
    function setShadow(el, attrs, scope) {
      var style = el.style;
      if (hasShadow(style)) {
        var shadowKey = getShadowKey(el);
        var shadowCache = scope.shadowCache;
        var shadowId = shadowCache[shadowKey];
        if (!shadowId) {
          var globalScale = el.getGlobalScale();
          var scaleX = globalScale[0];
          var scaleY = globalScale[1];
          if (!scaleX || !scaleY) {
            return;
          }
          var offsetX = style.shadowOffsetX || 0;
          var offsetY = style.shadowOffsetY || 0;
          var blur_1 = style.shadowBlur;
          var _a2 = normalizeColor(style.shadowColor), opacity2 = _a2.opacity, color2 = _a2.color;
          var stdDx = blur_1 / 2 / scaleX;
          var stdDy = blur_1 / 2 / scaleY;
          var stdDeviation = stdDx + " " + stdDy;
          shadowId = scope.zrId + "-s" + scope.shadowIdx++;
          scope.defs[shadowId] = createVNode("filter", shadowId, {
            "id": shadowId,
            "x": "-100%",
            "y": "-100%",
            "width": "300%",
            "height": "300%"
          }, [
            createVNode("feDropShadow", "", {
              "dx": offsetX / scaleX,
              "dy": offsetY / scaleY,
              "stdDeviation": stdDeviation,
              "flood-color": color2,
              "flood-opacity": opacity2
            })
          ]);
          shadowCache[shadowKey] = shadowId;
        }
        attrs.filter = getIdURL(shadowId);
      }
    }
    function setGradient(style, attrs, target, scope) {
      var val = style[target];
      var gradientTag;
      var gradientAttrs = {
        "gradientUnits": val.global ? "userSpaceOnUse" : "objectBoundingBox"
      };
      if (isLinearGradient$1(val)) {
        gradientTag = "linearGradient";
        gradientAttrs.x1 = val.x;
        gradientAttrs.y1 = val.y;
        gradientAttrs.x2 = val.x2;
        gradientAttrs.y2 = val.y2;
      } else if (isRadialGradient$1(val)) {
        gradientTag = "radialGradient";
        gradientAttrs.cx = retrieve2(val.x, 0.5);
        gradientAttrs.cy = retrieve2(val.y, 0.5);
        gradientAttrs.r = retrieve2(val.r, 0.5);
      } else {
        return;
      }
      var colors = val.colorStops;
      var colorStops = [];
      for (var i2 = 0, len2 = colors.length; i2 < len2; ++i2) {
        var offset2 = round4(colors[i2].offset) * 100 + "%";
        var stopColor = colors[i2].color;
        var _a2 = normalizeColor(stopColor), color2 = _a2.color, opacity2 = _a2.opacity;
        var stopsAttrs = {
          "offset": offset2
        };
        stopsAttrs["stop-color"] = color2;
        if (opacity2 < 1) {
          stopsAttrs["stop-opacity"] = opacity2;
        }
        colorStops.push(createVNode("stop", i2 + "", stopsAttrs));
      }
      var gradientVNode = createVNode(gradientTag, "", gradientAttrs, colorStops);
      var gradientKey = vNodeToString(gradientVNode);
      var gradientCache = scope.gradientCache;
      var gradientId = gradientCache[gradientKey];
      if (!gradientId) {
        gradientId = scope.zrId + "-g" + scope.gradientIdx++;
        gradientCache[gradientKey] = gradientId;
        gradientAttrs.id = gradientId;
        scope.defs[gradientId] = createVNode(gradientTag, gradientId, gradientAttrs, colorStops);
      }
      attrs[target] = getIdURL(gradientId);
    }
    function setPattern(el, attrs, target, scope) {
      var val = el.style[target];
      var boundingRect = el.getBoundingRect();
      var patternAttrs = {};
      var repeat = val.repeat;
      var noRepeat = repeat === "no-repeat";
      var repeatX = repeat === "repeat-x";
      var repeatY = repeat === "repeat-y";
      var child;
      if (isImagePattern(val)) {
        var imageWidth_1 = val.imageWidth;
        var imageHeight_1 = val.imageHeight;
        var imageSrc = void 0;
        var patternImage = val.image;
        if (isString$1(patternImage)) {
          imageSrc = patternImage;
        } else if (isImageLike(patternImage)) {
          imageSrc = patternImage.src;
        } else if (isCanvasLike(patternImage)) {
          imageSrc = patternImage.toDataURL();
        }
        if (typeof Image === "undefined") {
          var errMsg = "Image width/height must been given explictly in svg-ssr renderer.";
          assert(imageWidth_1, errMsg);
          assert(imageHeight_1, errMsg);
        } else if (imageWidth_1 == null || imageHeight_1 == null) {
          var setSizeToVNode_1 = function(vNode, img) {
            if (vNode) {
              var svgEl = vNode.elm;
              var width = imageWidth_1 || img.width;
              var height = imageHeight_1 || img.height;
              if (vNode.tag === "pattern") {
                if (repeatX) {
                  height = 1;
                  width /= boundingRect.width;
                } else if (repeatY) {
                  width = 1;
                  height /= boundingRect.height;
                }
              }
              vNode.attrs.width = width;
              vNode.attrs.height = height;
              if (svgEl) {
                svgEl.setAttribute("width", width);
                svgEl.setAttribute("height", height);
              }
            }
          };
          var createdImage = createOrUpdateImage(imageSrc, null, el, function(img) {
            noRepeat || setSizeToVNode_1(patternVNode, img);
            setSizeToVNode_1(child, img);
          });
          if (createdImage && createdImage.width && createdImage.height) {
            imageWidth_1 = imageWidth_1 || createdImage.width;
            imageHeight_1 = imageHeight_1 || createdImage.height;
          }
        }
        child = createVNode("image", "img", {
          href: imageSrc,
          width: imageWidth_1,
          height: imageHeight_1
        });
        patternAttrs.width = imageWidth_1;
        patternAttrs.height = imageHeight_1;
      } else if (val.svgElement) {
        child = clone$4(val.svgElement);
        patternAttrs.width = val.svgWidth;
        patternAttrs.height = val.svgHeight;
      }
      if (!child) {
        return;
      }
      var patternWidth;
      var patternHeight;
      if (noRepeat) {
        patternWidth = patternHeight = 1;
      } else if (repeatX) {
        patternHeight = 1;
        patternWidth = patternAttrs.width / boundingRect.width;
      } else if (repeatY) {
        patternWidth = 1;
        patternHeight = patternAttrs.height / boundingRect.height;
      } else {
        patternAttrs.patternUnits = "userSpaceOnUse";
      }
      if (patternWidth != null && !isNaN(patternWidth)) {
        patternAttrs.width = patternWidth;
      }
      if (patternHeight != null && !isNaN(patternHeight)) {
        patternAttrs.height = patternHeight;
      }
      var patternTransform = getSRTTransformString(val);
      patternTransform && (patternAttrs.patternTransform = patternTransform);
      var patternVNode = createVNode("pattern", "", patternAttrs, [child]);
      var patternKey = vNodeToString(patternVNode);
      var patternCache = scope.patternCache;
      var patternId = patternCache[patternKey];
      if (!patternId) {
        patternId = scope.zrId + "-p" + scope.patternIdx++;
        patternCache[patternKey] = patternId;
        patternAttrs.id = patternId;
        patternVNode = scope.defs[patternId] = createVNode("pattern", patternId, patternAttrs, [child]);
      }
      attrs[target] = getIdURL(patternId);
    }
    function setClipPath(clipPath, attrs, scope) {
      var clipPathCache = scope.clipPathCache, defs = scope.defs;
      var clipPathId = clipPathCache[clipPath.id];
      if (!clipPathId) {
        clipPathId = scope.zrId + "-c" + scope.clipPathIdx++;
        var clipPathAttrs = {
          id: clipPathId
        };
        clipPathCache[clipPath.id] = clipPathId;
        defs[clipPathId] = createVNode("clipPath", clipPathId, clipPathAttrs, [brushSVGPath(clipPath, scope)]);
      }
      attrs["clip-path"] = getIdURL(clipPathId);
    }
    function createTextNode(text) {
      return document.createTextNode(text);
    }
    function insertBefore(parentNode2, newNode, referenceNode) {
      parentNode2.insertBefore(newNode, referenceNode);
    }
    function removeChild(node, child) {
      node.removeChild(child);
    }
    function appendChild(node, child) {
      node.appendChild(child);
    }
    function parentNode(node) {
      return node.parentNode;
    }
    function nextSibling(node) {
      return node.nextSibling;
    }
    function setTextContent(node, text) {
      node.textContent = text;
    }
    var colonChar = 58;
    var xChar = 120;
    var emptyNode = createVNode("", "");
    function isUndef(s2) {
      return s2 === void 0;
    }
    function isDef(s2) {
      return s2 !== void 0;
    }
    function createKeyToOldIdx(children, beginIdx, endIdx) {
      var map2 = {};
      for (var i2 = beginIdx; i2 <= endIdx; ++i2) {
        var key = children[i2].key;
        if (key !== void 0) {
          map2[key] = i2;
        }
      }
      return map2;
    }
    function sameVnode(vnode1, vnode2) {
      var isSameKey = vnode1.key === vnode2.key;
      var isSameTag = vnode1.tag === vnode2.tag;
      return isSameTag && isSameKey;
    }
    function createElm(vnode) {
      var i2;
      var children = vnode.children;
      var tag = vnode.tag;
      if (isDef(tag)) {
        var elm = vnode.elm = createElement(tag);
        updateAttrs(emptyNode, vnode);
        if (isArray$2(children)) {
          for (i2 = 0; i2 < children.length; ++i2) {
            var ch = children[i2];
            if (ch != null) {
              appendChild(elm, createElm(ch));
            }
          }
        } else if (isDef(vnode.text) && !isObject$5(vnode.text)) {
          appendChild(elm, createTextNode(vnode.text));
        }
      } else {
        vnode.elm = createTextNode(vnode.text);
      }
      return vnode.elm;
    }
    function addVnodes(parentElm, before, vnodes, startIdx, endIdx) {
      for (; startIdx <= endIdx; ++startIdx) {
        var ch = vnodes[startIdx];
        if (ch != null) {
          insertBefore(parentElm, createElm(ch), before);
        }
      }
    }
    function removeVnodes(parentElm, vnodes, startIdx, endIdx) {
      for (; startIdx <= endIdx; ++startIdx) {
        var ch = vnodes[startIdx];
        if (ch != null) {
          if (isDef(ch.tag)) {
            var parent_1 = parentNode(ch.elm);
            removeChild(parent_1, ch.elm);
          } else {
            removeChild(parentElm, ch.elm);
          }
        }
      }
    }
    function updateAttrs(oldVnode, vnode) {
      var key;
      var elm = vnode.elm;
      var oldAttrs = oldVnode && oldVnode.attrs || {};
      var attrs = vnode.attrs || {};
      if (oldAttrs === attrs) {
        return;
      }
      for (key in attrs) {
        var cur = attrs[key];
        var old = oldAttrs[key];
        if (old !== cur) {
          if (cur === true) {
            elm.setAttribute(key, "");
          } else if (cur === false) {
            elm.removeAttribute(key);
          } else {
            if (key === "style") {
              elm.style.cssText = cur;
            } else if (key.charCodeAt(0) !== xChar) {
              elm.setAttribute(key, cur);
            } else if (key === "xmlns:xlink" || key === "xmlns") {
              elm.setAttributeNS(XMLNS$1, key, cur);
            } else if (key.charCodeAt(3) === colonChar) {
              elm.setAttributeNS(XML_NAMESPACE, key, cur);
            } else if (key.charCodeAt(5) === colonChar) {
              elm.setAttributeNS(XLINKNS, key, cur);
            } else {
              elm.setAttribute(key, cur);
            }
          }
        }
      }
      for (key in oldAttrs) {
        if (!(key in attrs)) {
          elm.removeAttribute(key);
        }
      }
    }
    function updateChildren(parentElm, oldCh, newCh) {
      var oldStartIdx = 0;
      var newStartIdx = 0;
      var oldEndIdx = oldCh.length - 1;
      var oldStartVnode = oldCh[0];
      var oldEndVnode = oldCh[oldEndIdx];
      var newEndIdx = newCh.length - 1;
      var newStartVnode = newCh[0];
      var newEndVnode = newCh[newEndIdx];
      var oldKeyToIdx;
      var idxInOld;
      var elmToMove;
      var before;
      while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
        if (oldStartVnode == null) {
          oldStartVnode = oldCh[++oldStartIdx];
        } else if (oldEndVnode == null) {
          oldEndVnode = oldCh[--oldEndIdx];
        } else if (newStartVnode == null) {
          newStartVnode = newCh[++newStartIdx];
        } else if (newEndVnode == null) {
          newEndVnode = newCh[--newEndIdx];
        } else if (sameVnode(oldStartVnode, newStartVnode)) {
          patchVnode(oldStartVnode, newStartVnode);
          oldStartVnode = oldCh[++oldStartIdx];
          newStartVnode = newCh[++newStartIdx];
        } else if (sameVnode(oldEndVnode, newEndVnode)) {
          patchVnode(oldEndVnode, newEndVnode);
          oldEndVnode = oldCh[--oldEndIdx];
          newEndVnode = newCh[--newEndIdx];
        } else if (sameVnode(oldStartVnode, newEndVnode)) {
          patchVnode(oldStartVnode, newEndVnode);
          insertBefore(parentElm, oldStartVnode.elm, nextSibling(oldEndVnode.elm));
          oldStartVnode = oldCh[++oldStartIdx];
          newEndVnode = newCh[--newEndIdx];
        } else if (sameVnode(oldEndVnode, newStartVnode)) {
          patchVnode(oldEndVnode, newStartVnode);
          insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
          oldEndVnode = oldCh[--oldEndIdx];
          newStartVnode = newCh[++newStartIdx];
        } else {
          if (isUndef(oldKeyToIdx)) {
            oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
          }
          idxInOld = oldKeyToIdx[newStartVnode.key];
          if (isUndef(idxInOld)) {
            insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);
          } else {
            elmToMove = oldCh[idxInOld];
            if (elmToMove.tag !== newStartVnode.tag) {
              insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);
            } else {
              patchVnode(elmToMove, newStartVnode);
              oldCh[idxInOld] = void 0;
              insertBefore(parentElm, elmToMove.elm, oldStartVnode.elm);
            }
          }
          newStartVnode = newCh[++newStartIdx];
        }
      }
      if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {
        if (oldStartIdx > oldEndIdx) {
          before = newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].elm;
          addVnodes(parentElm, before, newCh, newStartIdx, newEndIdx);
        } else {
          removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
        }
      }
    }
    function patchVnode(oldVnode, vnode) {
      var elm = vnode.elm = oldVnode.elm;
      var oldCh = oldVnode.children;
      var ch = vnode.children;
      if (oldVnode === vnode) {
        return;
      }
      updateAttrs(oldVnode, vnode);
      if (isUndef(vnode.text)) {
        if (isDef(oldCh) && isDef(ch)) {
          if (oldCh !== ch) {
            updateChildren(elm, oldCh, ch);
          }
        } else if (isDef(ch)) {
          if (isDef(oldVnode.text)) {
            setTextContent(elm, "");
          }
          addVnodes(elm, null, ch, 0, ch.length - 1);
        } else if (isDef(oldCh)) {
          removeVnodes(elm, oldCh, 0, oldCh.length - 1);
        } else if (isDef(oldVnode.text)) {
          setTextContent(elm, "");
        }
      } else if (oldVnode.text !== vnode.text) {
        if (isDef(oldCh)) {
          removeVnodes(elm, oldCh, 0, oldCh.length - 1);
        }
        setTextContent(elm, vnode.text);
      }
    }
    function patch(oldVnode, vnode) {
      if (sameVnode(oldVnode, vnode)) {
        patchVnode(oldVnode, vnode);
      } else {
        var elm = oldVnode.elm;
        var parent_2 = parentNode(elm);
        createElm(vnode);
        if (parent_2 !== null) {
          insertBefore(parent_2, vnode.elm, nextSibling(elm));
          removeVnodes(parent_2, [oldVnode], 0, 0);
        }
      }
      return vnode;
    }
    var svgId = 0;
    var SVGPainter = function() {
      function SVGPainter2(root2, storage2, opts) {
        this.type = "svg";
        this.refreshHover = createMethodNotSupport();
        this.configLayer = createMethodNotSupport();
        this.storage = storage2;
        this._opts = opts = extend$1({}, opts);
        this.root = root2;
        this._id = "zr" + svgId++;
        this._oldVNode = createSVGVNode(opts.width, opts.height);
        if (root2 && !opts.ssr) {
          var viewport = this._viewport = document.createElement("div");
          viewport.style.cssText = "position:relative;overflow:hidden";
          var svgDom = this._svgDom = this._oldVNode.elm = createElement("svg");
          updateAttrs(null, this._oldVNode);
          viewport.appendChild(svgDom);
          root2.appendChild(viewport);
        }
        this.resize(opts.width, opts.height);
      }
      SVGPainter2.prototype.getType = function() {
        return this.type;
      };
      SVGPainter2.prototype.getViewportRoot = function() {
        return this._viewport;
      };
      SVGPainter2.prototype.getViewportRootOffset = function() {
        var viewportRoot = this.getViewportRoot();
        if (viewportRoot) {
          return {
            offsetLeft: viewportRoot.offsetLeft || 0,
            offsetTop: viewportRoot.offsetTop || 0
          };
        }
      };
      SVGPainter2.prototype.getSvgDom = function() {
        return this._svgDom;
      };
      SVGPainter2.prototype.refresh = function() {
        if (this.root) {
          var vnode = this.renderToVNode({
            willUpdate: true
          });
          vnode.attrs.style = "position:absolute;left:0;top:0;user-select:none";
          patch(this._oldVNode, vnode);
          this._oldVNode = vnode;
        }
      };
      SVGPainter2.prototype.renderOneToVNode = function(el) {
        return brush(el, createBrushScope(this._id));
      };
      SVGPainter2.prototype.renderToVNode = function(opts) {
        opts = opts || {};
        var list = this.storage.getDisplayList(true);
        var width = this._width;
        var height = this._height;
        var scope = createBrushScope(this._id);
        scope.animation = opts.animation;
        scope.willUpdate = opts.willUpdate;
        scope.compress = opts.compress;
        scope.emphasis = opts.emphasis;
        scope.ssr = this._opts.ssr;
        var children = [];
        var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);
        bgVNode && children.push(bgVNode);
        var mainVNode = !opts.compress ? this._mainVNode = createVNode("g", "main", {}, []) : null;
        this._paintList(list, scope, mainVNode ? mainVNode.children : children);
        mainVNode && children.push(mainVNode);
        var defs = map$1(keys$1(scope.defs), function(id) {
          return scope.defs[id];
        });
        if (defs.length) {
          children.push(createVNode("defs", "defs", {}, defs));
        }
        if (opts.animation) {
          var animationCssStr = getCssString(scope.cssNodes, scope.cssAnims, { newline: true });
          if (animationCssStr) {
            var styleNode = createVNode("style", "stl", {}, [], animationCssStr);
            children.push(styleNode);
          }
        }
        return createSVGVNode(width, height, children, opts.useViewBox);
      };
      SVGPainter2.prototype.renderToString = function(opts) {
        opts = opts || {};
        return vNodeToString(this.renderToVNode({
          animation: retrieve2(opts.cssAnimation, true),
          emphasis: retrieve2(opts.cssEmphasis, true),
          willUpdate: false,
          compress: true,
          useViewBox: retrieve2(opts.useViewBox, true)
        }), { newline: true });
      };
      SVGPainter2.prototype.setBackgroundColor = function(backgroundColor2) {
        this._backgroundColor = backgroundColor2;
      };
      SVGPainter2.prototype.getSvgRoot = function() {
        return this._mainVNode && this._mainVNode.elm;
      };
      SVGPainter2.prototype._paintList = function(list, scope, out2) {
        var listLen = list.length;
        var clipPathsGroupsStack = [];
        var clipPathsGroupsStackDepth = 0;
        var currentClipPathGroup;
        var prevClipPaths;
        var clipGroupNodeIdx = 0;
        for (var i2 = 0; i2 < listLen; i2++) {
          var displayable = list[i2];
          if (!displayable.invisible) {
            var clipPaths = displayable.__clipPaths;
            var len2 = clipPaths && clipPaths.length || 0;
            var prevLen = prevClipPaths && prevClipPaths.length || 0;
            var lca = void 0;
            for (lca = Math.max(len2 - 1, prevLen - 1); lca >= 0; lca--) {
              if (clipPaths && prevClipPaths && clipPaths[lca] === prevClipPaths[lca]) {
                break;
              }
            }
            for (var i_1 = prevLen - 1; i_1 > lca; i_1--) {
              clipPathsGroupsStackDepth--;
              currentClipPathGroup = clipPathsGroupsStack[clipPathsGroupsStackDepth - 1];
            }
            for (var i_2 = lca + 1; i_2 < len2; i_2++) {
              var groupAttrs = {};
              setClipPath(clipPaths[i_2], groupAttrs, scope);
              var g = createVNode("g", "clip-g-" + clipGroupNodeIdx++, groupAttrs, []);
              (currentClipPathGroup ? currentClipPathGroup.children : out2).push(g);
              clipPathsGroupsStack[clipPathsGroupsStackDepth++] = g;
              currentClipPathGroup = g;
            }
            prevClipPaths = clipPaths;
            var ret = brush(displayable, scope);
            if (ret) {
              (currentClipPathGroup ? currentClipPathGroup.children : out2).push(ret);
            }
          }
        }
      };
      SVGPainter2.prototype.resize = function(width, height) {
        var opts = this._opts;
        var root2 = this.root;
        var viewport = this._viewport;
        width != null && (opts.width = width);
        height != null && (opts.height = height);
        if (root2 && viewport) {
          viewport.style.display = "none";
          width = getSize$1(root2, 0, opts);
          height = getSize$1(root2, 1, opts);
          viewport.style.display = "";
        }
        if (this._width !== width || this._height !== height) {
          this._width = width;
          this._height = height;
          if (viewport) {
            var viewportStyle = viewport.style;
            viewportStyle.width = width + "px";
            viewportStyle.height = height + "px";
          }
          if (!isPattern(this._backgroundColor)) {
            var svgDom = this._svgDom;
            if (svgDom) {
              svgDom.setAttribute("width", width);
              svgDom.setAttribute("height", height);
            }
            var bgEl = this._bgVNode && this._bgVNode.elm;
            if (bgEl) {
              bgEl.setAttribute("width", width);
              bgEl.setAttribute("height", height);
            }
          } else {
            this.refresh();
          }
        }
      };
      SVGPainter2.prototype.getWidth = function() {
        return this._width;
      };
      SVGPainter2.prototype.getHeight = function() {
        return this._height;
      };
      SVGPainter2.prototype.dispose = function() {
        if (this.root) {
          this.root.innerHTML = "";
        }
        this._svgDom = this._viewport = this.storage = this._oldVNode = this._bgVNode = this._mainVNode = null;
      };
      SVGPainter2.prototype.clear = function() {
        if (this._svgDom) {
          this._svgDom.innerHTML = null;
        }
        this._oldVNode = null;
      };
      SVGPainter2.prototype.toDataURL = function(base642) {
        var str = this.renderToString();
        var prefix = "data:image/svg+xml;";
        if (base642) {
          str = encodeBase64(str);
          return str && prefix + "base64," + str;
        }
        return prefix + "charset=UTF-8," + encodeURIComponent(str);
      };
      return SVGPainter2;
    }();
    function createMethodNotSupport(method) {
      return function() {
      };
    }
    function createBackgroundVNode(width, height, backgroundColor2, scope) {
      var bgVNode;
      if (backgroundColor2 && backgroundColor2 !== "none") {
        bgVNode = createVNode("rect", "bg", {
          width,
          height,
          x: "0",
          y: "0"
        });
        if (isGradient(backgroundColor2)) {
          setGradient({ fill: backgroundColor2 }, bgVNode.attrs, "fill", scope);
        } else if (isPattern(backgroundColor2)) {
          setPattern({
            style: {
              fill: backgroundColor2
            },
            dirty: noop$1,
            getBoundingRect: function() {
              return { width, height };
            }
          }, bgVNode.attrs, "fill", scope);
        } else {
          var _a2 = normalizeColor(backgroundColor2), color2 = _a2.color, opacity2 = _a2.opacity;
          bgVNode.attrs.fill = color2;
          opacity2 < 1 && (bgVNode.attrs["fill-opacity"] = opacity2);
        }
      }
      return bgVNode;
    }
    function install$S(registers) {
      registers.registerPainter("svg", SVGPainter);
    }
    function createDom(id, painter, dpr2) {
      var newDom = platformApi.createCanvas();
      var width = painter.getWidth();
      var height = painter.getHeight();
      var newDomStyle = newDom.style;
      if (newDomStyle) {
        newDomStyle.position = "absolute";
        newDomStyle.left = "0";
        newDomStyle.top = "0";
        newDomStyle.width = width + "px";
        newDomStyle.height = height + "px";
        newDom.setAttribute("data-zr-dom-id", id);
      }
      newDom.width = width * dpr2;
      newDom.height = height * dpr2;
      return newDom;
    }
    var Layer = function(_super) {
      __extends$1(Layer2, _super);
      function Layer2(id, painter, dpr2) {
        var _this = _super.call(this) || this;
        _this.motionBlur = false;
        _this.lastFrameAlpha = 0.7;
        _this.dpr = 1;
        _this.virtual = false;
        _this.config = {};
        _this.incremental = false;
        _this.zlevel = 0;
        _this.maxRepaintRectCount = 5;
        _this.__dirty = true;
        _this.__firstTimePaint = true;
        _this.__used = false;
        _this.__drawIndex = 0;
        _this.__startIndex = 0;
        _this.__endIndex = 0;
        _this.__prevStartIndex = null;
        _this.__prevEndIndex = null;
        var dom;
        dpr2 = dpr2 || devicePixelRatio;
        if (typeof id === "string") {
          dom = createDom(id, painter, dpr2);
        } else if (isObject$5(id)) {
          dom = id;
          id = dom.id;
        }
        _this.id = id;
        _this.dom = dom;
        var domStyle = dom.style;
        if (domStyle) {
          disableUserSelect(dom);
          dom.onselectstart = function() {
            return false;
          };
          domStyle.padding = "0";
          domStyle.margin = "0";
          domStyle.borderWidth = "0";
        }
        _this.painter = painter;
        _this.dpr = dpr2;
        return _this;
      }
      Layer2.prototype.getElementCount = function() {
        return this.__endIndex - this.__startIndex;
      };
      Layer2.prototype.afterBrush = function() {
        this.__prevStartIndex = this.__startIndex;
        this.__prevEndIndex = this.__endIndex;
      };
      Layer2.prototype.initContext = function() {
        this.ctx = this.dom.getContext("2d");
        this.ctx.dpr = this.dpr;
      };
      Layer2.prototype.setUnpainted = function() {
        this.__firstTimePaint = true;
      };
      Layer2.prototype.createBackBuffer = function() {
        var dpr2 = this.dpr;
        this.domBack = createDom("back-" + this.id, this.painter, dpr2);
        this.ctxBack = this.domBack.getContext("2d");
        if (dpr2 !== 1) {
          this.ctxBack.scale(dpr2, dpr2);
        }
      };
      Layer2.prototype.createRepaintRects = function(displayList, prevList, viewWidth, viewHeight) {
        if (this.__firstTimePaint) {
          this.__firstTimePaint = false;
          return null;
        }
        var mergedRepaintRects = [];
        var maxRepaintRectCount = this.maxRepaintRectCount;
        var full = false;
        var pendingRect = new BoundingRect(0, 0, 0, 0);
        function addRectToMergePool(rect) {
          if (!rect.isFinite() || rect.isZero()) {
            return;
          }
          if (mergedRepaintRects.length === 0) {
            var boundingRect = new BoundingRect(0, 0, 0, 0);
            boundingRect.copy(rect);
            mergedRepaintRects.push(boundingRect);
          } else {
            var isMerged = false;
            var minDeltaArea = Infinity;
            var bestRectToMergeIdx = 0;
            for (var i3 = 0; i3 < mergedRepaintRects.length; ++i3) {
              var mergedRect = mergedRepaintRects[i3];
              if (mergedRect.intersect(rect)) {
                var pendingRect_1 = new BoundingRect(0, 0, 0, 0);
                pendingRect_1.copy(mergedRect);
                pendingRect_1.union(rect);
                mergedRepaintRects[i3] = pendingRect_1;
                isMerged = true;
                break;
              } else if (full) {
                pendingRect.copy(rect);
                pendingRect.union(mergedRect);
                var aArea = rect.width * rect.height;
                var bArea = mergedRect.width * mergedRect.height;
                var pendingArea = pendingRect.width * pendingRect.height;
                var deltaArea = pendingArea - aArea - bArea;
                if (deltaArea < minDeltaArea) {
                  minDeltaArea = deltaArea;
                  bestRectToMergeIdx = i3;
                }
              }
            }
            if (full) {
              mergedRepaintRects[bestRectToMergeIdx].union(rect);
              isMerged = true;
            }
            if (!isMerged) {
              var boundingRect = new BoundingRect(0, 0, 0, 0);
              boundingRect.copy(rect);
              mergedRepaintRects.push(boundingRect);
            }
            if (!full) {
              full = mergedRepaintRects.length >= maxRepaintRectCount;
            }
          }
        }
        for (var i2 = this.__startIndex; i2 < this.__endIndex; ++i2) {
          var el = displayList[i2];
          if (el) {
            var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);
            var prevRect = el.__isRendered && (el.__dirty & REDRAW_BIT || !shouldPaint) ? el.getPrevPaintRect() : null;
            if (prevRect) {
              addRectToMergePool(prevRect);
            }
            var curRect = shouldPaint && (el.__dirty & REDRAW_BIT || !el.__isRendered) ? el.getPaintRect() : null;
            if (curRect) {
              addRectToMergePool(curRect);
            }
          }
        }
        for (var i2 = this.__prevStartIndex; i2 < this.__prevEndIndex; ++i2) {
          var el = prevList[i2];
          var shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);
          if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {
            var prevRect = el.getPrevPaintRect();
            if (prevRect) {
              addRectToMergePool(prevRect);
            }
          }
        }
        var hasIntersections;
        do {
          hasIntersections = false;
          for (var i2 = 0; i2 < mergedRepaintRects.length; ) {
            if (mergedRepaintRects[i2].isZero()) {
              mergedRepaintRects.splice(i2, 1);
              continue;
            }
            for (var j = i2 + 1; j < mergedRepaintRects.length; ) {
              if (mergedRepaintRects[i2].intersect(mergedRepaintRects[j])) {
                hasIntersections = true;
                mergedRepaintRects[i2].union(mergedRepaintRects[j]);
                mergedRepaintRects.splice(j, 1);
              } else {
                j++;
              }
            }
            i2++;
          }
        } while (hasIntersections);
        this._paintRects = mergedRepaintRects;
        return mergedRepaintRects;
      };
      Layer2.prototype.debugGetPaintRects = function() {
        return (this._paintRects || []).slice();
      };
      Layer2.prototype.resize = function(width, height) {
        var dpr2 = this.dpr;
        var dom = this.dom;
        var domStyle = dom.style;
        var domBack = this.domBack;
        if (domStyle) {
          domStyle.width = width + "px";
          domStyle.height = height + "px";
        }
        dom.width = width * dpr2;
        dom.height = height * dpr2;
        if (domBack) {
          domBack.width = width * dpr2;
          domBack.height = height * dpr2;
          if (dpr2 !== 1) {
            this.ctxBack.scale(dpr2, dpr2);
          }
        }
      };
      Layer2.prototype.clear = function(clearAll, clearColor, repaintRects) {
        var dom = this.dom;
        var ctx = this.ctx;
        var width = dom.width;
        var height = dom.height;
        clearColor = clearColor || this.clearColor;
        var haveMotionBLur = this.motionBlur && !clearAll;
        var lastFrameAlpha = this.lastFrameAlpha;
        var dpr2 = this.dpr;
        var self2 = this;
        if (haveMotionBLur) {
          if (!this.domBack) {
            this.createBackBuffer();
          }
          this.ctxBack.globalCompositeOperation = "copy";
          this.ctxBack.drawImage(dom, 0, 0, width / dpr2, height / dpr2);
        }
        var domBack = this.domBack;
        function doClear(x2, y, width2, height2) {
          ctx.clearRect(x2, y, width2, height2);
          if (clearColor && clearColor !== "transparent") {
            var clearColorGradientOrPattern = void 0;
            if (isGradientObject(clearColor)) {
              var shouldCache = clearColor.global || clearColor.__width === width2 && clearColor.__height === height2;
              clearColorGradientOrPattern = shouldCache && clearColor.__canvasGradient || getCanvasGradient(ctx, clearColor, {
                x: 0,
                y: 0,
                width: width2,
                height: height2
              });
              clearColor.__canvasGradient = clearColorGradientOrPattern;
              clearColor.__width = width2;
              clearColor.__height = height2;
            } else if (isImagePatternObject(clearColor)) {
              clearColor.scaleX = clearColor.scaleX || dpr2;
              clearColor.scaleY = clearColor.scaleY || dpr2;
              clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {
                dirty: function() {
                  self2.setUnpainted();
                  self2.painter.refresh();
                }
              });
            }
            ctx.save();
            ctx.fillStyle = clearColorGradientOrPattern || clearColor;
            ctx.fillRect(x2, y, width2, height2);
            ctx.restore();
          }
          if (haveMotionBLur) {
            ctx.save();
            ctx.globalAlpha = lastFrameAlpha;
            ctx.drawImage(domBack, x2, y, width2, height2);
            ctx.restore();
          }
        }
        if (!repaintRects || haveMotionBLur) {
          doClear(0, 0, width, height);
        } else if (repaintRects.length) {
          each$f(repaintRects, function(rect) {
            doClear(rect.x * dpr2, rect.y * dpr2, rect.width * dpr2, rect.height * dpr2);
          });
        }
      };
      return Layer2;
    }(Eventful);
    var HOVER_LAYER_ZLEVEL = 1e5;
    var CANVAS_ZLEVEL = 314159;
    var EL_AFTER_INCREMENTAL_INC = 0.01;
    var INCREMENTAL_INC = 1e-3;
    function isLayerValid(layer) {
      if (!layer) {
        return false;
      }
      if (layer.__builtin__) {
        return true;
      }
      if (typeof layer.resize !== "function" || typeof layer.refresh !== "function") {
        return false;
      }
      return true;
    }
    function createRoot(width, height) {
      var domRoot = document.createElement("div");
      domRoot.style.cssText = [
        "position:relative",
        "width:" + width + "px",
        "height:" + height + "px",
        "padding:0",
        "margin:0",
        "border-width:0"
      ].join(";") + ";";
      return domRoot;
    }
    var CanvasPainter = function() {
      function CanvasPainter2(root2, storage2, opts, id) {
        this.type = "canvas";
        this._zlevelList = [];
        this._prevDisplayList = [];
        this._layers = {};
        this._layerConfig = {};
        this._needsManuallyCompositing = false;
        this.type = "canvas";
        var singleCanvas = !root2.nodeName || root2.nodeName.toUpperCase() === "CANVAS";
        this._opts = opts = extend$1({}, opts || {});
        this.dpr = opts.devicePixelRatio || devicePixelRatio;
        this._singleCanvas = singleCanvas;
        this.root = root2;
        var rootStyle = root2.style;
        if (rootStyle) {
          disableUserSelect(root2);
          root2.innerHTML = "";
        }
        this.storage = storage2;
        var zlevelList = this._zlevelList;
        this._prevDisplayList = [];
        var layers = this._layers;
        if (!singleCanvas) {
          this._width = getSize$1(root2, 0, opts);
          this._height = getSize$1(root2, 1, opts);
          var domRoot = this._domRoot = createRoot(this._width, this._height);
          root2.appendChild(domRoot);
        } else {
          var rootCanvas = root2;
          var width = rootCanvas.width;
          var height = rootCanvas.height;
          if (opts.width != null) {
            width = opts.width;
          }
          if (opts.height != null) {
            height = opts.height;
          }
          this.dpr = opts.devicePixelRatio || 1;
          rootCanvas.width = width * this.dpr;
          rootCanvas.height = height * this.dpr;
          this._width = width;
          this._height = height;
          var mainLayer = new Layer(rootCanvas, this, this.dpr);
          mainLayer.__builtin__ = true;
          mainLayer.initContext();
          layers[CANVAS_ZLEVEL] = mainLayer;
          mainLayer.zlevel = CANVAS_ZLEVEL;
          zlevelList.push(CANVAS_ZLEVEL);
          this._domRoot = root2;
        }
      }
      CanvasPainter2.prototype.getType = function() {
        return "canvas";
      };
      CanvasPainter2.prototype.isSingleCanvas = function() {
        return this._singleCanvas;
      };
      CanvasPainter2.prototype.getViewportRoot = function() {
        return this._domRoot;
      };
      CanvasPainter2.prototype.getViewportRootOffset = function() {
        var viewportRoot = this.getViewportRoot();
        if (viewportRoot) {
          return {
            offsetLeft: viewportRoot.offsetLeft || 0,
            offsetTop: viewportRoot.offsetTop || 0
          };
        }
      };
      CanvasPainter2.prototype.refresh = function(paintAll) {
        var list = this.storage.getDisplayList(true);
        var prevList = this._prevDisplayList;
        var zlevelList = this._zlevelList;
        this._redrawId = Math.random();
        this._paintList(list, prevList, paintAll, this._redrawId);
        for (var i2 = 0; i2 < zlevelList.length; i2++) {
          var z2 = zlevelList[i2];
          var layer = this._layers[z2];
          if (!layer.__builtin__ && layer.refresh) {
            var clearColor = i2 === 0 ? this._backgroundColor : null;
            layer.refresh(clearColor);
          }
        }
        if (this._opts.useDirtyRect) {
          this._prevDisplayList = list.slice();
        }
        return this;
      };
      CanvasPainter2.prototype.refreshHover = function() {
        this._paintHoverList(this.storage.getDisplayList(false));
      };
      CanvasPainter2.prototype._paintHoverList = function(list) {
        var len2 = list.length;
        var hoverLayer = this._hoverlayer;
        hoverLayer && hoverLayer.clear();
        if (!len2) {
          return;
        }
        var scope = {
          inHover: true,
          viewWidth: this._width,
          viewHeight: this._height
        };
        var ctx;
        for (var i2 = 0; i2 < len2; i2++) {
          var el = list[i2];
          if (el.__inHover) {
            if (!hoverLayer) {
              hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL);
            }
            if (!ctx) {
              ctx = hoverLayer.ctx;
              ctx.save();
            }
            brush$1(ctx, el, scope, i2 === len2 - 1);
          }
        }
        if (ctx) {
          ctx.restore();
        }
      };
      CanvasPainter2.prototype.getHoverLayer = function() {
        return this.getLayer(HOVER_LAYER_ZLEVEL);
      };
      CanvasPainter2.prototype.paintOne = function(ctx, el) {
        brushSingle(ctx, el);
      };
      CanvasPainter2.prototype._paintList = function(list, prevList, paintAll, redrawId) {
        if (this._redrawId !== redrawId) {
          return;
        }
        paintAll = paintAll || false;
        this._updateLayerStatus(list);
        var _a2 = this._doPaintList(list, prevList, paintAll), finished = _a2.finished, needsRefreshHover = _a2.needsRefreshHover;
        if (this._needsManuallyCompositing) {
          this._compositeManually();
        }
        if (needsRefreshHover) {
          this._paintHoverList(list);
        }
        if (!finished) {
          var self_1 = this;
          requestAnimationFrame$1(function() {
            self_1._paintList(list, prevList, paintAll, redrawId);
          });
        } else {
          this.eachLayer(function(layer) {
            layer.afterBrush && layer.afterBrush();
          });
        }
      };
      CanvasPainter2.prototype._compositeManually = function() {
        var ctx = this.getLayer(CANVAS_ZLEVEL).ctx;
        var width = this._domRoot.width;
        var height = this._domRoot.height;
        ctx.clearRect(0, 0, width, height);
        this.eachBuiltinLayer(function(layer) {
          if (layer.virtual) {
            ctx.drawImage(layer.dom, 0, 0, width, height);
          }
        });
      };
      CanvasPainter2.prototype._doPaintList = function(list, prevList, paintAll) {
        var _this = this;
        var layerList = [];
        var useDirtyRect = this._opts.useDirtyRect;
        for (var zi = 0; zi < this._zlevelList.length; zi++) {
          var zlevel = this._zlevelList[zi];
          var layer = this._layers[zlevel];
          if (layer.__builtin__ && layer !== this._hoverlayer && (layer.__dirty || paintAll)) {
            layerList.push(layer);
          }
        }
        var finished = true;
        var needsRefreshHover = false;
        var _loop_1 = function(k22) {
          var layer2 = layerList[k22];
          var ctx = layer2.ctx;
          var repaintRects = useDirtyRect && layer2.createRepaintRects(list, prevList, this_1._width, this_1._height);
          var start2 = paintAll ? layer2.__startIndex : layer2.__drawIndex;
          var useTimer = !paintAll && layer2.incremental && Date.now;
          var startTime = useTimer && Date.now();
          var clearColor = layer2.zlevel === this_1._zlevelList[0] ? this_1._backgroundColor : null;
          if (layer2.__startIndex === layer2.__endIndex) {
            layer2.clear(false, clearColor, repaintRects);
          } else if (start2 === layer2.__startIndex) {
            var firstEl = list[start2];
            if (!firstEl.incremental || !firstEl.notClear || paintAll) {
              layer2.clear(false, clearColor, repaintRects);
            }
          }
          if (start2 === -1) {
            console.error("For some unknown reason. drawIndex is -1");
            start2 = layer2.__startIndex;
          }
          var i2;
          var repaint = function(repaintRect) {
            var scope = {
              inHover: false,
              allClipped: false,
              prevEl: null,
              viewWidth: _this._width,
              viewHeight: _this._height
            };
            for (i2 = start2; i2 < layer2.__endIndex; i2++) {
              var el = list[i2];
              if (el.__inHover) {
                needsRefreshHover = true;
              }
              _this._doPaintEl(el, layer2, useDirtyRect, repaintRect, scope, i2 === layer2.__endIndex - 1);
              if (useTimer) {
                var dTime = Date.now() - startTime;
                if (dTime > 15) {
                  break;
                }
              }
            }
            if (scope.prevElClipPaths) {
              ctx.restore();
            }
          };
          if (repaintRects) {
            if (repaintRects.length === 0) {
              i2 = layer2.__endIndex;
            } else {
              var dpr2 = this_1.dpr;
              for (var r = 0; r < repaintRects.length; ++r) {
                var rect = repaintRects[r];
                ctx.save();
                ctx.beginPath();
                ctx.rect(rect.x * dpr2, rect.y * dpr2, rect.width * dpr2, rect.height * dpr2);
                ctx.clip();
                repaint(rect);
                ctx.restore();
              }
            }
          } else {
            ctx.save();
            repaint();
            ctx.restore();
          }
          layer2.__drawIndex = i2;
          if (layer2.__drawIndex < layer2.__endIndex) {
            finished = false;
          }
        };
        var this_1 = this;
        for (var k2 = 0; k2 < layerList.length; k2++) {
          _loop_1(k2);
        }
        if (env.wxa) {
          each$f(this._layers, function(layer2) {
            if (layer2 && layer2.ctx && layer2.ctx.draw) {
              layer2.ctx.draw();
            }
          });
        }
        return {
          finished,
          needsRefreshHover
        };
      };
      CanvasPainter2.prototype._doPaintEl = function(el, currentLayer, useDirtyRect, repaintRect, scope, isLast) {
        var ctx = currentLayer.ctx;
        if (useDirtyRect) {
          var paintRect = el.getPaintRect();
          if (!repaintRect || paintRect && paintRect.intersect(repaintRect)) {
            brush$1(ctx, el, scope, isLast);
            el.setPrevPaintRect(paintRect);
          }
        } else {
          brush$1(ctx, el, scope, isLast);
        }
      };
      CanvasPainter2.prototype.getLayer = function(zlevel, virtual) {
        if (this._singleCanvas && !this._needsManuallyCompositing) {
          zlevel = CANVAS_ZLEVEL;
        }
        var layer = this._layers[zlevel];
        if (!layer) {
          layer = new Layer("zr_" + zlevel, this, this.dpr);
          layer.zlevel = zlevel;
          layer.__builtin__ = true;
          if (this._layerConfig[zlevel]) {
            merge$1(layer, this._layerConfig[zlevel], true);
          } else if (this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC]) {
            merge$1(layer, this._layerConfig[zlevel - EL_AFTER_INCREMENTAL_INC], true);
          }
          if (virtual) {
            layer.virtual = virtual;
          }
          this.insertLayer(zlevel, layer);
          layer.initContext();
        }
        return layer;
      };
      CanvasPainter2.prototype.insertLayer = function(zlevel, layer) {
        var layersMap = this._layers;
        var zlevelList = this._zlevelList;
        var len2 = zlevelList.length;
        var domRoot = this._domRoot;
        var prevLayer = null;
        var i2 = -1;
        if (layersMap[zlevel]) {
          return;
        }
        if (!isLayerValid(layer)) {
          return;
        }
        if (len2 > 0 && zlevel > zlevelList[0]) {
          for (i2 = 0; i2 < len2 - 1; i2++) {
            if (zlevelList[i2] < zlevel && zlevelList[i2 + 1] > zlevel) {
              break;
            }
          }
          prevLayer = layersMap[zlevelList[i2]];
        }
        zlevelList.splice(i2 + 1, 0, zlevel);
        layersMap[zlevel] = layer;
        if (!layer.virtual) {
          if (prevLayer) {
            var prevDom = prevLayer.dom;
            if (prevDom.nextSibling) {
              domRoot.insertBefore(layer.dom, prevDom.nextSibling);
            } else {
              domRoot.appendChild(layer.dom);
            }
          } else {
            if (domRoot.firstChild) {
              domRoot.insertBefore(layer.dom, domRoot.firstChild);
            } else {
              domRoot.appendChild(layer.dom);
            }
          }
        }
        layer.painter || (layer.painter = this);
      };
      CanvasPainter2.prototype.eachLayer = function(cb, context) {
        var zlevelList = this._zlevelList;
        for (var i2 = 0; i2 < zlevelList.length; i2++) {
          var z2 = zlevelList[i2];
          cb.call(context, this._layers[z2], z2);
        }
      };
      CanvasPainter2.prototype.eachBuiltinLayer = function(cb, context) {
        var zlevelList = this._zlevelList;
        for (var i2 = 0; i2 < zlevelList.length; i2++) {
          var z2 = zlevelList[i2];
          var layer = this._layers[z2];
          if (layer.__builtin__) {
            cb.call(context, layer, z2);
          }
        }
      };
      CanvasPainter2.prototype.eachOtherLayer = function(cb, context) {
        var zlevelList = this._zlevelList;
        for (var i2 = 0; i2 < zlevelList.length; i2++) {
          var z2 = zlevelList[i2];
          var layer = this._layers[z2];
          if (!layer.__builtin__) {
            cb.call(context, layer, z2);
          }
        }
      };
      CanvasPainter2.prototype.getLayers = function() {
        return this._layers;
      };
      CanvasPainter2.prototype._updateLayerStatus = function(list) {
        this.eachBuiltinLayer(function(layer2, z2) {
          layer2.__dirty = layer2.__used = false;
        });
        function updatePrevLayer(idx) {
          if (prevLayer) {
            if (prevLayer.__endIndex !== idx) {
              prevLayer.__dirty = true;
            }
            prevLayer.__endIndex = idx;
          }
        }
        if (this._singleCanvas) {
          for (var i_1 = 1; i_1 < list.length; i_1++) {
            var el = list[i_1];
            if (el.zlevel !== list[i_1 - 1].zlevel || el.incremental) {
              this._needsManuallyCompositing = true;
              break;
            }
          }
        }
        var prevLayer = null;
        var incrementalLayerCount = 0;
        var prevZlevel;
        var i2;
        for (i2 = 0; i2 < list.length; i2++) {
          var el = list[i2];
          var zlevel = el.zlevel;
          var layer = void 0;
          if (prevZlevel !== zlevel) {
            prevZlevel = zlevel;
            incrementalLayerCount = 0;
          }
          if (el.incremental) {
            layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing);
            layer.incremental = true;
            incrementalLayerCount = 1;
          } else {
            layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing);
          }
          if (!layer.__builtin__) {
            logError("ZLevel " + zlevel + " has been used by unkown layer " + layer.id);
          }
          if (layer !== prevLayer) {
            layer.__used = true;
            if (layer.__startIndex !== i2) {
              layer.__dirty = true;
            }
            layer.__startIndex = i2;
            if (!layer.incremental) {
              layer.__drawIndex = i2;
            } else {
              layer.__drawIndex = -1;
            }
            updatePrevLayer(i2);
            prevLayer = layer;
          }
          if (el.__dirty & REDRAW_BIT && !el.__inHover) {
            layer.__dirty = true;
            if (layer.incremental && layer.__drawIndex < 0) {
              layer.__drawIndex = i2;
            }
          }
        }
        updatePrevLayer(i2);
        this.eachBuiltinLayer(function(layer2, z2) {
          if (!layer2.__used && layer2.getElementCount() > 0) {
            layer2.__dirty = true;
            layer2.__startIndex = layer2.__endIndex = layer2.__drawIndex = 0;
          }
          if (layer2.__dirty && layer2.__drawIndex < 0) {
            layer2.__drawIndex = layer2.__startIndex;
          }
        });
      };
      CanvasPainter2.prototype.clear = function() {
        this.eachBuiltinLayer(this._clearLayer);
        return this;
      };
      CanvasPainter2.prototype._clearLayer = function(layer) {
        layer.clear();
      };
      CanvasPainter2.prototype.setBackgroundColor = function(backgroundColor2) {
        this._backgroundColor = backgroundColor2;
        each$f(this._layers, function(layer) {
          layer.setUnpainted();
        });
      };
      CanvasPainter2.prototype.configLayer = function(zlevel, config) {
        if (config) {
          var layerConfig = this._layerConfig;
          if (!layerConfig[zlevel]) {
            layerConfig[zlevel] = config;
          } else {
            merge$1(layerConfig[zlevel], config, true);
          }
          for (var i2 = 0; i2 < this._zlevelList.length; i2++) {
            var _zlevel = this._zlevelList[i2];
            if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) {
              var layer = this._layers[_zlevel];
              merge$1(layer, layerConfig[zlevel], true);
            }
          }
        }
      };
      CanvasPainter2.prototype.delLayer = function(zlevel) {
        var layers = this._layers;
        var zlevelList = this._zlevelList;
        var layer = layers[zlevel];
        if (!layer) {
          return;
        }
        layer.dom.parentNode.removeChild(layer.dom);
        delete layers[zlevel];
        zlevelList.splice(indexOf(zlevelList, zlevel), 1);
      };
      CanvasPainter2.prototype.resize = function(width, height) {
        if (!this._domRoot.style) {
          if (width == null || height == null) {
            return;
          }
          this._width = width;
          this._height = height;
          this.getLayer(CANVAS_ZLEVEL).resize(width, height);
        } else {
          var domRoot = this._domRoot;
          domRoot.style.display = "none";
          var opts = this._opts;
          var root2 = this.root;
          width != null && (opts.width = width);
          height != null && (opts.height = height);
          width = getSize$1(root2, 0, opts);
          height = getSize$1(root2, 1, opts);
          domRoot.style.display = "";
          if (this._width !== width || height !== this._height) {
            domRoot.style.width = width + "px";
            domRoot.style.height = height + "px";
            for (var id in this._layers) {
              if (this._layers.hasOwnProperty(id)) {
                this._layers[id].resize(width, height);
              }
            }
            this.refresh(true);
          }
          this._width = width;
          this._height = height;
        }
        return this;
      };
      CanvasPainter2.prototype.clearLayer = function(zlevel) {
        var layer = this._layers[zlevel];
        if (layer) {
          layer.clear();
        }
      };
      CanvasPainter2.prototype.dispose = function() {
        this.root.innerHTML = "";
        this.root = this.storage = this._domRoot = this._layers = null;
      };
      CanvasPainter2.prototype.getRenderedCanvas = function(opts) {
        opts = opts || {};
        if (this._singleCanvas && !this._compositeManually) {
          return this._layers[CANVAS_ZLEVEL].dom;
        }
        var imageLayer = new Layer("image", this, opts.pixelRatio || this.dpr);
        imageLayer.initContext();
        imageLayer.clear(false, opts.backgroundColor || this._backgroundColor);
        var ctx = imageLayer.ctx;
        if (opts.pixelRatio <= this.dpr) {
          this.refresh();
          var width_1 = imageLayer.dom.width;
          var height_1 = imageLayer.dom.height;
          this.eachLayer(function(layer) {
            if (layer.__builtin__) {
              ctx.drawImage(layer.dom, 0, 0, width_1, height_1);
            } else if (layer.renderToCanvas) {
              ctx.save();
              layer.renderToCanvas(ctx);
              ctx.restore();
            }
          });
        } else {
          var scope = {
            inHover: false,
            viewWidth: this._width,
            viewHeight: this._height
          };
          var displayList = this.storage.getDisplayList(true);
          for (var i2 = 0, len2 = displayList.length; i2 < len2; i2++) {
            var el = displayList[i2];
            brush$1(ctx, el, scope, i2 === len2 - 1);
          }
        }
        return imageLayer.dom;
      };
      CanvasPainter2.prototype.getWidth = function() {
        return this._width;
      };
      CanvasPainter2.prototype.getHeight = function() {
        return this._height;
      };
      return CanvasPainter2;
    }();
    function install$R(registers) {
      registers.registerPainter("canvas", CanvasPainter);
    }
    var LineSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(LineSeriesModel2, _super);
        function LineSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = LineSeriesModel2.type;
          _this.hasSymbolVisual = true;
          return _this;
        }
        LineSeriesModel2.prototype.getInitialData = function(option) {
          return createSeriesData(null, this, {
            useEncodeDefaulter: true
          });
        };
        LineSeriesModel2.prototype.getLegendIcon = function(opt) {
          var group = new Group$3();
          var line = createSymbol$1("line", 0, opt.itemHeight / 2, opt.itemWidth, 0, opt.lineStyle.stroke, false);
          group.add(line);
          line.setStyle(opt.lineStyle);
          var visualType = this.getData().getVisual("symbol");
          var visualRotate = this.getData().getVisual("symbolRotate");
          var symbolType = visualType === "none" ? "circle" : visualType;
          var size = opt.itemHeight * 0.8;
          var symbol = createSymbol$1(symbolType, (opt.itemWidth - size) / 2, (opt.itemHeight - size) / 2, size, size, opt.itemStyle.fill);
          group.add(symbol);
          symbol.setStyle(opt.itemStyle);
          var symbolRotate = opt.iconRotate === "inherit" ? visualRotate : opt.iconRotate || 0;
          symbol.rotation = symbolRotate * Math.PI / 180;
          symbol.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);
          if (symbolType.indexOf("empty") > -1) {
            symbol.style.stroke = symbol.style.fill;
            symbol.style.fill = "#fff";
            symbol.style.lineWidth = 2;
          }
          return group;
        };
        LineSeriesModel2.type = "series.line";
        LineSeriesModel2.dependencies = ["grid", "polar"];
        LineSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 3,
          coordinateSystem: "cartesian2d",
          legendHoverLink: true,
          clip: true,
          label: {
            position: "top"
          },
          // itemStyle: {
          // },
          endLabel: {
            show: false,
            valueAnimation: true,
            distance: 8
          },
          lineStyle: {
            width: 2,
            type: "solid"
          },
          emphasis: {
            scale: true
          },
          // areaStyle: {
          // origin of areaStyle. Valid values:
          // `'auto'/null/undefined`: from axisLine to data
          // `'start'`: from min to data
          // `'end'`: from data to max
          // origin: 'auto'
          // },
          // false, 'start', 'end', 'middle'
          step: false,
          // Disabled if step is true
          smooth: false,
          smoothMonotone: null,
          symbol: "emptyCircle",
          symbolSize: 4,
          symbolRotate: null,
          showSymbol: true,
          // `false`: follow the label interval strategy.
          // `true`: show all symbols.
          // `'auto'`: If possible, show all symbols, otherwise
          //           follow the label interval strategy.
          showAllSymbol: "auto",
          // Whether to connect break point.
          connectNulls: false,
          // Sampling for large data. Can be: 'average', 'max', 'min', 'sum', 'lttb'.
          sampling: "none",
          animationEasing: "linear",
          // Disable progressive
          progressive: 0,
          hoverLayerThreshold: Infinity,
          universalTransition: {
            divideShape: "clone"
          },
          triggerLineEvent: false
        };
        return LineSeriesModel2;
      }(SeriesModel)
    );
    function getDefaultLabel(data, dataIndex) {
      var labelDims = data.mapDimensionsAll("defaultedLabel");
      var len2 = labelDims.length;
      if (len2 === 1) {
        var rawVal = retrieveRawValue(data, dataIndex, labelDims[0]);
        return rawVal != null ? rawVal + "" : null;
      } else if (len2) {
        var vals = [];
        for (var i2 = 0; i2 < labelDims.length; i2++) {
          vals.push(retrieveRawValue(data, dataIndex, labelDims[i2]));
        }
        return vals.join(" ");
      }
    }
    function getDefaultInterpolatedLabel(data, interpolatedValue) {
      var labelDims = data.mapDimensionsAll("defaultedLabel");
      if (!isArray$2(interpolatedValue)) {
        return interpolatedValue + "";
      }
      var vals = [];
      for (var i2 = 0; i2 < labelDims.length; i2++) {
        var dimIndex = data.getDimensionIndex(labelDims[i2]);
        if (dimIndex >= 0) {
          vals.push(interpolatedValue[dimIndex]);
        }
      }
      return vals.join(" ");
    }
    var Symbol$1 = (
      /** @class */
      function(_super) {
        __extends$1(Symbol2, _super);
        function Symbol2(data, idx, seriesScope, opts) {
          var _this = _super.call(this) || this;
          _this.updateData(data, idx, seriesScope, opts);
          return _this;
        }
        Symbol2.prototype._createSymbol = function(symbolType, data, idx, symbolSize, keepAspect) {
          this.removeAll();
          var symbolPath = createSymbol$1(symbolType, -1, -1, 2, 2, null, keepAspect);
          symbolPath.attr({
            z2: 100,
            culling: true,
            scaleX: symbolSize[0] / 2,
            scaleY: symbolSize[1] / 2
          });
          symbolPath.drift = driftSymbol;
          this._symbolType = symbolType;
          this.add(symbolPath);
        };
        Symbol2.prototype.stopSymbolAnimation = function(toLastFrame) {
          this.childAt(0).stopAnimation(null, toLastFrame);
        };
        Symbol2.prototype.getSymbolType = function() {
          return this._symbolType;
        };
        Symbol2.prototype.getSymbolPath = function() {
          return this.childAt(0);
        };
        Symbol2.prototype.highlight = function() {
          enterEmphasis(this.childAt(0));
        };
        Symbol2.prototype.downplay = function() {
          leaveEmphasis(this.childAt(0));
        };
        Symbol2.prototype.setZ = function(zlevel, z2) {
          var symbolPath = this.childAt(0);
          symbolPath.zlevel = zlevel;
          symbolPath.z = z2;
        };
        Symbol2.prototype.setDraggable = function(draggable2, hasCursorOption) {
          var symbolPath = this.childAt(0);
          symbolPath.draggable = draggable2;
          symbolPath.cursor = !hasCursorOption && draggable2 ? "move" : symbolPath.cursor;
        };
        Symbol2.prototype.updateData = function(data, idx, seriesScope, opts) {
          this.silent = false;
          var symbolType = data.getItemVisual(idx, "symbol") || "circle";
          var seriesModel = data.hostModel;
          var symbolSize = Symbol2.getSymbolSize(data, idx);
          var isInit = symbolType !== this._symbolType;
          var disableAnimation = opts && opts.disableAnimation;
          if (isInit) {
            var keepAspect = data.getItemVisual(idx, "symbolKeepAspect");
            this._createSymbol(symbolType, data, idx, symbolSize, keepAspect);
          } else {
            var symbolPath = this.childAt(0);
            symbolPath.silent = false;
            var target = {
              scaleX: symbolSize[0] / 2,
              scaleY: symbolSize[1] / 2
            };
            disableAnimation ? symbolPath.attr(target) : updateProps$1(symbolPath, target, seriesModel, idx);
            saveOldStyle(symbolPath);
          }
          this._updateCommon(data, idx, symbolSize, seriesScope, opts);
          if (isInit) {
            var symbolPath = this.childAt(0);
            if (!disableAnimation) {
              var target = {
                scaleX: this._sizeX,
                scaleY: this._sizeY,
                style: {
                  // Always fadeIn. Because it has fadeOut animation when symbol is removed..
                  opacity: symbolPath.style.opacity
                }
              };
              symbolPath.scaleX = symbolPath.scaleY = 0;
              symbolPath.style.opacity = 0;
              initProps(symbolPath, target, seriesModel, idx);
            }
          }
          if (disableAnimation) {
            this.childAt(0).stopAnimation("leave");
          }
        };
        Symbol2.prototype._updateCommon = function(data, idx, symbolSize, seriesScope, opts) {
          var symbolPath = this.childAt(0);
          var seriesModel = data.hostModel;
          var emphasisItemStyle;
          var blurItemStyle;
          var selectItemStyle;
          var focus;
          var blurScope;
          var emphasisDisabled;
          var labelStatesModels;
          var hoverScale;
          var cursorStyle;
          if (seriesScope) {
            emphasisItemStyle = seriesScope.emphasisItemStyle;
            blurItemStyle = seriesScope.blurItemStyle;
            selectItemStyle = seriesScope.selectItemStyle;
            focus = seriesScope.focus;
            blurScope = seriesScope.blurScope;
            labelStatesModels = seriesScope.labelStatesModels;
            hoverScale = seriesScope.hoverScale;
            cursorStyle = seriesScope.cursorStyle;
            emphasisDisabled = seriesScope.emphasisDisabled;
          }
          if (!seriesScope || data.hasItemOption) {
            var itemModel = seriesScope && seriesScope.itemModel ? seriesScope.itemModel : data.getItemModel(idx);
            var emphasisModel = itemModel.getModel("emphasis");
            emphasisItemStyle = emphasisModel.getModel("itemStyle").getItemStyle();
            selectItemStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle();
            blurItemStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle();
            focus = emphasisModel.get("focus");
            blurScope = emphasisModel.get("blurScope");
            emphasisDisabled = emphasisModel.get("disabled");
            labelStatesModels = getLabelStatesModels(itemModel);
            hoverScale = emphasisModel.getShallow("scale");
            cursorStyle = itemModel.getShallow("cursor");
          }
          var symbolRotate = data.getItemVisual(idx, "symbolRotate");
          symbolPath.attr("rotation", (symbolRotate || 0) * Math.PI / 180 || 0);
          var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, "symbolOffset"), symbolSize);
          if (symbolOffset) {
            symbolPath.x = symbolOffset[0];
            symbolPath.y = symbolOffset[1];
          }
          cursorStyle && symbolPath.attr("cursor", cursorStyle);
          var symbolStyle = data.getItemVisual(idx, "style");
          var visualColor = symbolStyle.fill;
          if (symbolPath instanceof ZRImage) {
            var pathStyle = symbolPath.style;
            symbolPath.useStyle(extend$1({
              // TODO other properties like x, y ?
              image: pathStyle.image,
              x: pathStyle.x,
              y: pathStyle.y,
              width: pathStyle.width,
              height: pathStyle.height
            }, symbolStyle));
          } else {
            if (symbolPath.__isEmptyBrush) {
              symbolPath.useStyle(extend$1({}, symbolStyle));
            } else {
              symbolPath.useStyle(symbolStyle);
            }
            symbolPath.style.decal = null;
            symbolPath.setColor(visualColor, opts && opts.symbolInnerColor);
            symbolPath.style.strokeNoScale = true;
          }
          var liftZ = data.getItemVisual(idx, "liftZ");
          var z2Origin = this._z2;
          if (liftZ != null) {
            if (z2Origin == null) {
              this._z2 = symbolPath.z2;
              symbolPath.z2 += liftZ;
            }
          } else if (z2Origin != null) {
            symbolPath.z2 = z2Origin;
            this._z2 = null;
          }
          var useNameLabel = opts && opts.useNameLabel;
          setLabelStyle(symbolPath, labelStatesModels, {
            labelFetcher: seriesModel,
            labelDataIndex: idx,
            defaultText: getLabelDefaultText,
            inheritColor: visualColor,
            defaultOpacity: symbolStyle.opacity
          });
          function getLabelDefaultText(idx2) {
            return useNameLabel ? data.getName(idx2) : getDefaultLabel(data, idx2);
          }
          this._sizeX = symbolSize[0] / 2;
          this._sizeY = symbolSize[1] / 2;
          var emphasisState = symbolPath.ensureState("emphasis");
          emphasisState.style = emphasisItemStyle;
          symbolPath.ensureState("select").style = selectItemStyle;
          symbolPath.ensureState("blur").style = blurItemStyle;
          var scaleRatio = hoverScale == null || hoverScale === true ? Math.max(1.1, 3 / this._sizeY) : isFinite(hoverScale) && hoverScale > 0 ? +hoverScale : 1;
          emphasisState.scaleX = this._sizeX * scaleRatio;
          emphasisState.scaleY = this._sizeY * scaleRatio;
          this.setSymbolScale(1);
          toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);
        };
        Symbol2.prototype.setSymbolScale = function(scale2) {
          this.scaleX = this.scaleY = scale2;
        };
        Symbol2.prototype.fadeOut = function(cb, seriesModel, opt) {
          var symbolPath = this.childAt(0);
          var dataIndex = getECData(this).dataIndex;
          var animationOpt = opt && opt.animation;
          this.silent = symbolPath.silent = true;
          if (opt && opt.fadeLabel) {
            var textContent = symbolPath.getTextContent();
            if (textContent) {
              removeElement(textContent, {
                style: {
                  opacity: 0
                }
              }, seriesModel, {
                dataIndex,
                removeOpt: animationOpt,
                cb: function() {
                  symbolPath.removeTextContent();
                }
              });
            }
          } else {
            symbolPath.removeTextContent();
          }
          removeElement(symbolPath, {
            style: {
              opacity: 0
            },
            scaleX: 0,
            scaleY: 0
          }, seriesModel, {
            dataIndex,
            cb,
            removeOpt: animationOpt
          });
        };
        Symbol2.getSymbolSize = function(data, idx) {
          return normalizeSymbolSize(data.getItemVisual(idx, "symbolSize"));
        };
        return Symbol2;
      }(Group$3)
    );
    function driftSymbol(dx, dy) {
      this.parent.drift(dx, dy);
    }
    function symbolNeedsDraw$1(data, point, idx, opt) {
      return point && !isNaN(point[0]) && !isNaN(point[1]) && !(opt.isIgnore && opt.isIgnore(idx)) && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) && data.getItemVisual(idx, "symbol") !== "none";
    }
    function normalizeUpdateOpt(opt) {
      if (opt != null && !isObject$5(opt)) {
        opt = {
          isIgnore: opt
        };
      }
      return opt || {};
    }
    function makeSeriesScope$2(data) {
      var seriesModel = data.hostModel;
      var emphasisModel = seriesModel.getModel("emphasis");
      return {
        emphasisItemStyle: emphasisModel.getModel("itemStyle").getItemStyle(),
        blurItemStyle: seriesModel.getModel(["blur", "itemStyle"]).getItemStyle(),
        selectItemStyle: seriesModel.getModel(["select", "itemStyle"]).getItemStyle(),
        focus: emphasisModel.get("focus"),
        blurScope: emphasisModel.get("blurScope"),
        emphasisDisabled: emphasisModel.get("disabled"),
        hoverScale: emphasisModel.get("scale"),
        labelStatesModels: getLabelStatesModels(seriesModel),
        cursorStyle: seriesModel.get("cursor")
      };
    }
    var SymbolDraw = (
      /** @class */
      function() {
        function SymbolDraw2(SymbolCtor) {
          this.group = new Group$3();
          this._SymbolCtor = SymbolCtor || Symbol$1;
        }
        SymbolDraw2.prototype.updateData = function(data, opt) {
          this._progressiveEls = null;
          opt = normalizeUpdateOpt(opt);
          var group = this.group;
          var seriesModel = data.hostModel;
          var oldData = this._data;
          var SymbolCtor = this._SymbolCtor;
          var disableAnimation = opt.disableAnimation;
          var seriesScope = makeSeriesScope$2(data);
          var symbolUpdateOpt = {
            disableAnimation
          };
          var getSymbolPoint = opt.getSymbolPoint || function(idx) {
            return data.getItemLayout(idx);
          };
          if (!oldData) {
            group.removeAll();
          }
          data.diff(oldData).add(function(newIdx) {
            var point = getSymbolPoint(newIdx);
            if (symbolNeedsDraw$1(data, point, newIdx, opt)) {
              var symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);
              symbolEl.setPosition(point);
              data.setItemGraphicEl(newIdx, symbolEl);
              group.add(symbolEl);
            }
          }).update(function(newIdx, oldIdx) {
            var symbolEl = oldData.getItemGraphicEl(oldIdx);
            var point = getSymbolPoint(newIdx);
            if (!symbolNeedsDraw$1(data, point, newIdx, opt)) {
              group.remove(symbolEl);
              return;
            }
            var newSymbolType = data.getItemVisual(newIdx, "symbol") || "circle";
            var oldSymbolType = symbolEl && symbolEl.getSymbolType && symbolEl.getSymbolType();
            if (!symbolEl || oldSymbolType && oldSymbolType !== newSymbolType) {
              group.remove(symbolEl);
              symbolEl = new SymbolCtor(data, newIdx, seriesScope, symbolUpdateOpt);
              symbolEl.setPosition(point);
            } else {
              symbolEl.updateData(data, newIdx, seriesScope, symbolUpdateOpt);
              var target = {
                x: point[0],
                y: point[1]
              };
              disableAnimation ? symbolEl.attr(target) : updateProps$1(symbolEl, target, seriesModel);
            }
            group.add(symbolEl);
            data.setItemGraphicEl(newIdx, symbolEl);
          }).remove(function(oldIdx) {
            var el = oldData.getItemGraphicEl(oldIdx);
            el && el.fadeOut(function() {
              group.remove(el);
            }, seriesModel);
          }).execute();
          this._getSymbolPoint = getSymbolPoint;
          this._data = data;
        };
        SymbolDraw2.prototype.updateLayout = function() {
          var _this = this;
          var data = this._data;
          if (data) {
            data.eachItemGraphicEl(function(el, idx) {
              var point = _this._getSymbolPoint(idx);
              el.setPosition(point);
              el.markRedraw();
            });
          }
        };
        SymbolDraw2.prototype.incrementalPrepareUpdate = function(data) {
          this._seriesScope = makeSeriesScope$2(data);
          this._data = null;
          this.group.removeAll();
        };
        SymbolDraw2.prototype.incrementalUpdate = function(taskParams, data, opt) {
          this._progressiveEls = [];
          opt = normalizeUpdateOpt(opt);
          function updateIncrementalAndHover(el2) {
            if (!el2.isGroup) {
              el2.incremental = true;
              el2.ensureState("emphasis").hoverLayer = true;
            }
          }
          for (var idx = taskParams.start; idx < taskParams.end; idx++) {
            var point = data.getItemLayout(idx);
            if (symbolNeedsDraw$1(data, point, idx, opt)) {
              var el = new this._SymbolCtor(data, idx, this._seriesScope);
              el.traverse(updateIncrementalAndHover);
              el.setPosition(point);
              this.group.add(el);
              data.setItemGraphicEl(idx, el);
              this._progressiveEls.push(el);
            }
          }
        };
        SymbolDraw2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        SymbolDraw2.prototype.remove = function(enableAnimation) {
          var group = this.group;
          var data = this._data;
          if (data && enableAnimation) {
            data.eachItemGraphicEl(function(el) {
              el.fadeOut(function() {
                group.remove(el);
              }, data.hostModel);
            });
          } else {
            group.removeAll();
          }
        };
        return SymbolDraw2;
      }()
    );
    function prepareDataCoordInfo(coordSys, data, valueOrigin) {
      var baseAxis = coordSys.getBaseAxis();
      var valueAxis2 = coordSys.getOtherAxis(baseAxis);
      var valueStart = getValueStart(valueAxis2, valueOrigin);
      var baseAxisDim = baseAxis.dim;
      var valueAxisDim = valueAxis2.dim;
      var valueDim = data.mapDimension(valueAxisDim);
      var baseDim = data.mapDimension(baseAxisDim);
      var baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0;
      var dims = map$1(coordSys.dimensions, function(coordDim) {
        return data.mapDimension(coordDim);
      });
      var stacked = false;
      var stackResultDim = data.getCalculationInfo("stackResultDimension");
      if (isDimensionStacked(
        data,
        dims[0]
        /* , dims[1] */
      )) {
        stacked = true;
        dims[0] = stackResultDim;
      }
      if (isDimensionStacked(
        data,
        dims[1]
        /* , dims[0] */
      )) {
        stacked = true;
        dims[1] = stackResultDim;
      }
      return {
        dataDimsForPoint: dims,
        valueStart,
        valueAxisDim,
        baseAxisDim,
        stacked: !!stacked,
        valueDim,
        baseDim,
        baseDataOffset,
        stackedOverDimension: data.getCalculationInfo("stackedOverDimension")
      };
    }
    function getValueStart(valueAxis2, valueOrigin) {
      var valueStart = 0;
      var extent3 = valueAxis2.scale.getExtent();
      if (valueOrigin === "start") {
        valueStart = extent3[0];
      } else if (valueOrigin === "end") {
        valueStart = extent3[1];
      } else if (isNumber$1(valueOrigin) && !isNaN(valueOrigin)) {
        valueStart = valueOrigin;
      } else {
        if (extent3[0] > 0) {
          valueStart = extent3[0];
        } else if (extent3[1] < 0) {
          valueStart = extent3[1];
        }
      }
      return valueStart;
    }
    function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {
      var value = NaN;
      if (dataCoordInfo.stacked) {
        value = data.get(data.getCalculationInfo("stackedOverDimension"), idx);
      }
      if (isNaN(value)) {
        value = dataCoordInfo.valueStart;
      }
      var baseDataOffset = dataCoordInfo.baseDataOffset;
      var stackedData = [];
      stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);
      stackedData[1 - baseDataOffset] = value;
      return coordSys.dataToPoint(stackedData);
    }
    function diffData(oldData, newData) {
      var diffResult = [];
      newData.diff(oldData).add(function(idx) {
        diffResult.push({
          cmd: "+",
          idx
        });
      }).update(function(newIdx, oldIdx) {
        diffResult.push({
          cmd: "=",
          idx: oldIdx,
          idx1: newIdx
        });
      }).remove(function(idx) {
        diffResult.push({
          cmd: "-",
          idx
        });
      }).execute();
      return diffResult;
    }
    function lineAnimationDiff(oldData, newData, oldStackedOnPoints, newStackedOnPoints, oldCoordSys, newCoordSys, oldValueOrigin, newValueOrigin) {
      var diff = diffData(oldData, newData);
      var currPoints = [];
      var nextPoints = [];
      var currStackedPoints = [];
      var nextStackedPoints = [];
      var status = [];
      var sortedIndices = [];
      var rawIndices = [];
      var newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin);
      var oldPoints = oldData.getLayout("points") || [];
      var newPoints = newData.getLayout("points") || [];
      for (var i2 = 0; i2 < diff.length; i2++) {
        var diffItem = diff[i2];
        var pointAdded = true;
        var oldIdx2 = void 0;
        var newIdx2 = void 0;
        switch (diffItem.cmd) {
          case "=":
            oldIdx2 = diffItem.idx * 2;
            newIdx2 = diffItem.idx1 * 2;
            var currentX = oldPoints[oldIdx2];
            var currentY = oldPoints[oldIdx2 + 1];
            var nextX = newPoints[newIdx2];
            var nextY = newPoints[newIdx2 + 1];
            if (isNaN(currentX) || isNaN(currentY)) {
              currentX = nextX;
              currentY = nextY;
            }
            currPoints.push(currentX, currentY);
            nextPoints.push(nextX, nextY);
            currStackedPoints.push(oldStackedOnPoints[oldIdx2], oldStackedOnPoints[oldIdx2 + 1]);
            nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);
            rawIndices.push(newData.getRawIndex(diffItem.idx1));
            break;
          case "+":
            var newIdx = diffItem.idx;
            var newDataDimsForPoint = newDataOldCoordInfo.dataDimsForPoint;
            var oldPt = oldCoordSys.dataToPoint([newData.get(newDataDimsForPoint[0], newIdx), newData.get(newDataDimsForPoint[1], newIdx)]);
            newIdx2 = newIdx * 2;
            currPoints.push(oldPt[0], oldPt[1]);
            nextPoints.push(newPoints[newIdx2], newPoints[newIdx2 + 1]);
            var stackedOnPoint = getStackedOnPoint(newDataOldCoordInfo, oldCoordSys, newData, newIdx);
            currStackedPoints.push(stackedOnPoint[0], stackedOnPoint[1]);
            nextStackedPoints.push(newStackedOnPoints[newIdx2], newStackedOnPoints[newIdx2 + 1]);
            rawIndices.push(newData.getRawIndex(newIdx));
            break;
          case "-":
            pointAdded = false;
        }
        if (pointAdded) {
          status.push(diffItem);
          sortedIndices.push(sortedIndices.length);
        }
      }
      sortedIndices.sort(function(a2, b2) {
        return rawIndices[a2] - rawIndices[b2];
      });
      var len2 = currPoints.length;
      var sortedCurrPoints = createFloat32Array(len2);
      var sortedNextPoints = createFloat32Array(len2);
      var sortedCurrStackedPoints = createFloat32Array(len2);
      var sortedNextStackedPoints = createFloat32Array(len2);
      var sortedStatus = [];
      for (var i2 = 0; i2 < sortedIndices.length; i2++) {
        var idx = sortedIndices[i2];
        var i22 = i2 * 2;
        var idx2 = idx * 2;
        sortedCurrPoints[i22] = currPoints[idx2];
        sortedCurrPoints[i22 + 1] = currPoints[idx2 + 1];
        sortedNextPoints[i22] = nextPoints[idx2];
        sortedNextPoints[i22 + 1] = nextPoints[idx2 + 1];
        sortedCurrStackedPoints[i22] = currStackedPoints[idx2];
        sortedCurrStackedPoints[i22 + 1] = currStackedPoints[idx2 + 1];
        sortedNextStackedPoints[i22] = nextStackedPoints[idx2];
        sortedNextStackedPoints[i22 + 1] = nextStackedPoints[idx2 + 1];
        sortedStatus[i2] = status[idx];
      }
      return {
        current: sortedCurrPoints,
        next: sortedNextPoints,
        stackedOnCurrent: sortedCurrStackedPoints,
        stackedOnNext: sortedNextStackedPoints,
        status: sortedStatus
      };
    }
    var mathMin$5 = Math.min;
    var mathMax$5 = Math.max;
    function isPointNull$1(x2, y) {
      return isNaN(x2) || isNaN(y);
    }
    function drawSegment(ctx, points2, start2, segLen, allLen, dir3, smooth, smoothMonotone, connectNulls) {
      var prevX;
      var prevY;
      var cpx0;
      var cpy0;
      var cpx1;
      var cpy1;
      var idx = start2;
      var k2 = 0;
      for (; k2 < segLen; k2++) {
        var x2 = points2[idx * 2];
        var y = points2[idx * 2 + 1];
        if (idx >= allLen || idx < 0) {
          break;
        }
        if (isPointNull$1(x2, y)) {
          if (connectNulls) {
            idx += dir3;
            continue;
          }
          break;
        }
        if (idx === start2) {
          ctx[dir3 > 0 ? "moveTo" : "lineTo"](x2, y);
          cpx0 = x2;
          cpy0 = y;
        } else {
          var dx = x2 - prevX;
          var dy = y - prevY;
          if (dx * dx + dy * dy < 0.5) {
            idx += dir3;
            continue;
          }
          if (smooth > 0) {
            var nextIdx = idx + dir3;
            var nextX = points2[nextIdx * 2];
            var nextY = points2[nextIdx * 2 + 1];
            while (nextX === x2 && nextY === y && k2 < segLen) {
              k2++;
              nextIdx += dir3;
              idx += dir3;
              nextX = points2[nextIdx * 2];
              nextY = points2[nextIdx * 2 + 1];
              x2 = points2[idx * 2];
              y = points2[idx * 2 + 1];
              dx = x2 - prevX;
              dy = y - prevY;
            }
            var tmpK = k2 + 1;
            if (connectNulls) {
              while (isPointNull$1(nextX, nextY) && tmpK < segLen) {
                tmpK++;
                nextIdx += dir3;
                nextX = points2[nextIdx * 2];
                nextY = points2[nextIdx * 2 + 1];
              }
            }
            var ratioNextSeg = 0.5;
            var vx = 0;
            var vy = 0;
            var nextCpx0 = void 0;
            var nextCpy0 = void 0;
            if (tmpK >= segLen || isPointNull$1(nextX, nextY)) {
              cpx1 = x2;
              cpy1 = y;
            } else {
              vx = nextX - prevX;
              vy = nextY - prevY;
              var dx0 = x2 - prevX;
              var dx1 = nextX - x2;
              var dy0 = y - prevY;
              var dy1 = nextY - y;
              var lenPrevSeg = void 0;
              var lenNextSeg = void 0;
              if (smoothMonotone === "x") {
                lenPrevSeg = Math.abs(dx0);
                lenNextSeg = Math.abs(dx1);
                var dir_1 = vx > 0 ? 1 : -1;
                cpx1 = x2 - dir_1 * lenPrevSeg * smooth;
                cpy1 = y;
                nextCpx0 = x2 + dir_1 * lenNextSeg * smooth;
                nextCpy0 = y;
              } else if (smoothMonotone === "y") {
                lenPrevSeg = Math.abs(dy0);
                lenNextSeg = Math.abs(dy1);
                var dir_2 = vy > 0 ? 1 : -1;
                cpx1 = x2;
                cpy1 = y - dir_2 * lenPrevSeg * smooth;
                nextCpx0 = x2;
                nextCpy0 = y + dir_2 * lenNextSeg * smooth;
              } else {
                lenPrevSeg = Math.sqrt(dx0 * dx0 + dy0 * dy0);
                lenNextSeg = Math.sqrt(dx1 * dx1 + dy1 * dy1);
                ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);
                cpx1 = x2 - vx * smooth * (1 - ratioNextSeg);
                cpy1 = y - vy * smooth * (1 - ratioNextSeg);
                nextCpx0 = x2 + vx * smooth * ratioNextSeg;
                nextCpy0 = y + vy * smooth * ratioNextSeg;
                nextCpx0 = mathMin$5(nextCpx0, mathMax$5(nextX, x2));
                nextCpy0 = mathMin$5(nextCpy0, mathMax$5(nextY, y));
                nextCpx0 = mathMax$5(nextCpx0, mathMin$5(nextX, x2));
                nextCpy0 = mathMax$5(nextCpy0, mathMin$5(nextY, y));
                vx = nextCpx0 - x2;
                vy = nextCpy0 - y;
                cpx1 = x2 - vx * lenPrevSeg / lenNextSeg;
                cpy1 = y - vy * lenPrevSeg / lenNextSeg;
                cpx1 = mathMin$5(cpx1, mathMax$5(prevX, x2));
                cpy1 = mathMin$5(cpy1, mathMax$5(prevY, y));
                cpx1 = mathMax$5(cpx1, mathMin$5(prevX, x2));
                cpy1 = mathMax$5(cpy1, mathMin$5(prevY, y));
                vx = x2 - cpx1;
                vy = y - cpy1;
                nextCpx0 = x2 + vx * lenNextSeg / lenPrevSeg;
                nextCpy0 = y + vy * lenNextSeg / lenPrevSeg;
              }
            }
            ctx.bezierCurveTo(cpx0, cpy0, cpx1, cpy1, x2, y);
            cpx0 = nextCpx0;
            cpy0 = nextCpy0;
          } else {
            ctx.lineTo(x2, y);
          }
        }
        prevX = x2;
        prevY = y;
        idx += dir3;
      }
      return k2;
    }
    var ECPolylineShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function ECPolylineShape2() {
          this.smooth = 0;
          this.smoothConstraint = true;
        }
        return ECPolylineShape2;
      }()
    );
    var ECPolyline = (
      /** @class */
      function(_super) {
        __extends$1(ECPolyline2, _super);
        function ECPolyline2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "ec-polyline";
          return _this;
        }
        ECPolyline2.prototype.getDefaultStyle = function() {
          return {
            stroke: "#000",
            fill: null
          };
        };
        ECPolyline2.prototype.getDefaultShape = function() {
          return new ECPolylineShape();
        };
        ECPolyline2.prototype.buildPath = function(ctx, shape) {
          var points2 = shape.points;
          var i2 = 0;
          var len2 = points2.length / 2;
          if (shape.connectNulls) {
            for (; len2 > 0; len2--) {
              if (!isPointNull$1(points2[len2 * 2 - 2], points2[len2 * 2 - 1])) {
                break;
              }
            }
            for (; i2 < len2; i2++) {
              if (!isPointNull$1(points2[i2 * 2], points2[i2 * 2 + 1])) {
                break;
              }
            }
          }
          while (i2 < len2) {
            i2 += drawSegment(ctx, points2, i2, len2, len2, 1, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;
          }
        };
        ECPolyline2.prototype.getPointOn = function(xOrY, dim) {
          if (!this.path) {
            this.createPathProxy();
            this.buildPath(this.path, this.shape);
          }
          var path = this.path;
          var data = path.data;
          var CMD2 = PathProxy.CMD;
          var x0;
          var y0;
          var isDimX = dim === "x";
          var roots2 = [];
          for (var i2 = 0; i2 < data.length; ) {
            var cmd = data[i2++];
            var x2 = void 0;
            var y = void 0;
            var x22 = void 0;
            var y2 = void 0;
            var x3 = void 0;
            var y3 = void 0;
            var t = void 0;
            switch (cmd) {
              case CMD2.M:
                x0 = data[i2++];
                y0 = data[i2++];
                break;
              case CMD2.L:
                x2 = data[i2++];
                y = data[i2++];
                t = isDimX ? (xOrY - x0) / (x2 - x0) : (xOrY - y0) / (y - y0);
                if (t <= 1 && t >= 0) {
                  var val = isDimX ? (y - y0) * t + y0 : (x2 - x0) * t + x0;
                  return isDimX ? [xOrY, val] : [val, xOrY];
                }
                x0 = x2;
                y0 = y;
                break;
              case CMD2.C:
                x2 = data[i2++];
                y = data[i2++];
                x22 = data[i2++];
                y2 = data[i2++];
                x3 = data[i2++];
                y3 = data[i2++];
                var nRoot = isDimX ? cubicRootAt(x0, x2, x22, x3, xOrY, roots2) : cubicRootAt(y0, y, y2, y3, xOrY, roots2);
                if (nRoot > 0) {
                  for (var i_1 = 0; i_1 < nRoot; i_1++) {
                    var t_1 = roots2[i_1];
                    if (t_1 <= 1 && t_1 >= 0) {
                      var val = isDimX ? cubicAt(y0, y, y2, y3, t_1) : cubicAt(x0, x2, x22, x3, t_1);
                      return isDimX ? [xOrY, val] : [val, xOrY];
                    }
                  }
                }
                x0 = x3;
                y0 = y3;
                break;
            }
          }
        };
        return ECPolyline2;
      }(Path)
    );
    var ECPolygonShape = (
      /** @class */
      function(_super) {
        __extends$1(ECPolygonShape2, _super);
        function ECPolygonShape2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        return ECPolygonShape2;
      }(ECPolylineShape)
    );
    var ECPolygon = (
      /** @class */
      function(_super) {
        __extends$1(ECPolygon2, _super);
        function ECPolygon2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "ec-polygon";
          return _this;
        }
        ECPolygon2.prototype.getDefaultShape = function() {
          return new ECPolygonShape();
        };
        ECPolygon2.prototype.buildPath = function(ctx, shape) {
          var points2 = shape.points;
          var stackedOnPoints = shape.stackedOnPoints;
          var i2 = 0;
          var len2 = points2.length / 2;
          var smoothMonotone = shape.smoothMonotone;
          if (shape.connectNulls) {
            for (; len2 > 0; len2--) {
              if (!isPointNull$1(points2[len2 * 2 - 2], points2[len2 * 2 - 1])) {
                break;
              }
            }
            for (; i2 < len2; i2++) {
              if (!isPointNull$1(points2[i2 * 2], points2[i2 * 2 + 1])) {
                break;
              }
            }
          }
          while (i2 < len2) {
            var k2 = drawSegment(ctx, points2, i2, len2, len2, 1, shape.smooth, smoothMonotone, shape.connectNulls);
            drawSegment(ctx, stackedOnPoints, i2 + k2 - 1, k2, len2, -1, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);
            i2 += k2 + 1;
            ctx.closePath();
          }
        };
        return ECPolygon2;
      }(Path)
    );
    function createGridClipPath(cartesian, hasAnimation, seriesModel, done, during) {
      var rect = cartesian.getArea();
      var x2 = rect.x;
      var y = rect.y;
      var width = rect.width;
      var height = rect.height;
      var lineWidth = seriesModel.get(["lineStyle", "width"]) || 0;
      x2 -= lineWidth / 2;
      y -= lineWidth / 2;
      width += lineWidth;
      height += lineWidth;
      width = Math.ceil(width);
      if (x2 !== Math.floor(x2)) {
        x2 = Math.floor(x2);
        width++;
      }
      var clipPath = new Rect$2({
        shape: {
          x: x2,
          y,
          width,
          height
        }
      });
      if (hasAnimation) {
        var baseAxis = cartesian.getBaseAxis();
        var isHorizontal2 = baseAxis.isHorizontal();
        var isAxisInversed = baseAxis.inverse;
        if (isHorizontal2) {
          if (isAxisInversed) {
            clipPath.shape.x += width;
          }
          clipPath.shape.width = 0;
        } else {
          if (!isAxisInversed) {
            clipPath.shape.y += height;
          }
          clipPath.shape.height = 0;
        }
        var duringCb = isFunction$1(during) ? function(percent) {
          during(percent, clipPath);
        } : null;
        initProps(clipPath, {
          shape: {
            width,
            height,
            x: x2,
            y
          }
        }, seriesModel, null, done, duringCb);
      }
      return clipPath;
    }
    function createPolarClipPath(polar, hasAnimation, seriesModel) {
      var sectorArea = polar.getArea();
      var r0 = round$3(sectorArea.r0, 1);
      var r = round$3(sectorArea.r, 1);
      var clipPath = new Sector({
        shape: {
          cx: round$3(polar.cx, 1),
          cy: round$3(polar.cy, 1),
          r0,
          r,
          startAngle: sectorArea.startAngle,
          endAngle: sectorArea.endAngle,
          clockwise: sectorArea.clockwise
        }
      });
      if (hasAnimation) {
        var isRadial = polar.getBaseAxis().dim === "angle";
        if (isRadial) {
          clipPath.shape.endAngle = sectorArea.startAngle;
        } else {
          clipPath.shape.r = r0;
        }
        initProps(clipPath, {
          shape: {
            endAngle: sectorArea.endAngle,
            r
          }
        }, seriesModel);
      }
      return clipPath;
    }
    function createClipPath(coordSys, hasAnimation, seriesModel, done, during) {
      if (!coordSys) {
        return null;
      } else if (coordSys.type === "polar") {
        return createPolarClipPath(coordSys, hasAnimation, seriesModel);
      } else if (coordSys.type === "cartesian2d") {
        return createGridClipPath(coordSys, hasAnimation, seriesModel, done, during);
      }
      return null;
    }
    function isCoordinateSystemType(coordSys, type) {
      return coordSys.type === type;
    }
    function isPointsSame(points1, points2) {
      if (points1.length !== points2.length) {
        return;
      }
      for (var i2 = 0; i2 < points1.length; i2++) {
        if (points1[i2] !== points2[i2]) {
          return;
        }
      }
      return true;
    }
    function bboxFromPoints(points2) {
      var minX = Infinity;
      var minY = Infinity;
      var maxX = -Infinity;
      var maxY = -Infinity;
      for (var i2 = 0; i2 < points2.length; ) {
        var x2 = points2[i2++];
        var y = points2[i2++];
        if (!isNaN(x2)) {
          minX = Math.min(x2, minX);
          maxX = Math.max(x2, maxX);
        }
        if (!isNaN(y)) {
          minY = Math.min(y, minY);
          maxY = Math.max(y, maxY);
        }
      }
      return [[minX, minY], [maxX, maxY]];
    }
    function getBoundingDiff(points1, points2) {
      var _a2 = bboxFromPoints(points1), min1 = _a2[0], max1 = _a2[1];
      var _b2 = bboxFromPoints(points2), min22 = _b2[0], max22 = _b2[1];
      return Math.max(Math.abs(min1[0] - min22[0]), Math.abs(min1[1] - min22[1]), Math.abs(max1[0] - max22[0]), Math.abs(max1[1] - max22[1]));
    }
    function getSmooth(smooth) {
      return isNumber$1(smooth) ? smooth : smooth ? 0.5 : 0;
    }
    function getStackedOnPoints(coordSys, data, dataCoordInfo) {
      if (!dataCoordInfo.valueDim) {
        return [];
      }
      var len2 = data.count();
      var points2 = createFloat32Array(len2 * 2);
      for (var idx = 0; idx < len2; idx++) {
        var pt3 = getStackedOnPoint(dataCoordInfo, coordSys, data, idx);
        points2[idx * 2] = pt3[0];
        points2[idx * 2 + 1] = pt3[1];
      }
      return points2;
    }
    function turnPointsIntoStep(points2, basePoints, coordSys, stepTurnAt, connectNulls) {
      var baseAxis = coordSys.getBaseAxis();
      var baseIndex = baseAxis.dim === "x" || baseAxis.dim === "radius" ? 0 : 1;
      var stepPoints = [];
      var i2 = 0;
      var stepPt = [];
      var pt3 = [];
      var nextPt = [];
      var filteredPoints = [];
      if (connectNulls) {
        for (i2 = 0; i2 < points2.length; i2 += 2) {
          var reference = basePoints || points2;
          if (!isNaN(reference[i2]) && !isNaN(reference[i2 + 1])) {
            filteredPoints.push(points2[i2], points2[i2 + 1]);
          }
        }
        points2 = filteredPoints;
      }
      for (i2 = 0; i2 < points2.length - 2; i2 += 2) {
        nextPt[0] = points2[i2 + 2];
        nextPt[1] = points2[i2 + 3];
        pt3[0] = points2[i2];
        pt3[1] = points2[i2 + 1];
        stepPoints.push(pt3[0], pt3[1]);
        switch (stepTurnAt) {
          case "end":
            stepPt[baseIndex] = nextPt[baseIndex];
            stepPt[1 - baseIndex] = pt3[1 - baseIndex];
            stepPoints.push(stepPt[0], stepPt[1]);
            break;
          case "middle":
            var middle = (pt3[baseIndex] + nextPt[baseIndex]) / 2;
            var stepPt2 = [];
            stepPt[baseIndex] = stepPt2[baseIndex] = middle;
            stepPt[1 - baseIndex] = pt3[1 - baseIndex];
            stepPt2[1 - baseIndex] = nextPt[1 - baseIndex];
            stepPoints.push(stepPt[0], stepPt[1]);
            stepPoints.push(stepPt2[0], stepPt2[1]);
            break;
          default:
            stepPt[baseIndex] = pt3[baseIndex];
            stepPt[1 - baseIndex] = nextPt[1 - baseIndex];
            stepPoints.push(stepPt[0], stepPt[1]);
        }
      }
      stepPoints.push(points2[i2++], points2[i2++]);
      return stepPoints;
    }
    function clipColorStops(colorStops, maxSize) {
      var newColorStops = [];
      var len2 = colorStops.length;
      var prevOutOfRangeColorStop;
      var prevInRangeColorStop;
      function lerpStop(stop0, stop1, clippedCoord) {
        var coord0 = stop0.coord;
        var p2 = (clippedCoord - coord0) / (stop1.coord - coord0);
        var color2 = lerp$1(p2, [stop0.color, stop1.color]);
        return {
          coord: clippedCoord,
          color: color2
        };
      }
      for (var i2 = 0; i2 < len2; i2++) {
        var stop_1 = colorStops[i2];
        var coord = stop_1.coord;
        if (coord < 0) {
          prevOutOfRangeColorStop = stop_1;
        } else if (coord > maxSize) {
          if (prevInRangeColorStop) {
            newColorStops.push(lerpStop(prevInRangeColorStop, stop_1, maxSize));
          } else if (prevOutOfRangeColorStop) {
            newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0), lerpStop(prevOutOfRangeColorStop, stop_1, maxSize));
          }
          break;
        } else {
          if (prevOutOfRangeColorStop) {
            newColorStops.push(lerpStop(prevOutOfRangeColorStop, stop_1, 0));
            prevOutOfRangeColorStop = null;
          }
          newColorStops.push(stop_1);
          prevInRangeColorStop = stop_1;
        }
      }
      return newColorStops;
    }
    function getVisualGradient(data, coordSys, api2) {
      var visualMetaList = data.getVisual("visualMeta");
      if (!visualMetaList || !visualMetaList.length || !data.count()) {
        return;
      }
      if (coordSys.type !== "cartesian2d") {
        return;
      }
      var coordDim;
      var visualMeta;
      for (var i2 = visualMetaList.length - 1; i2 >= 0; i2--) {
        var dimInfo = data.getDimensionInfo(visualMetaList[i2].dimension);
        coordDim = dimInfo && dimInfo.coordDim;
        if (coordDim === "x" || coordDim === "y") {
          visualMeta = visualMetaList[i2];
          break;
        }
      }
      if (!visualMeta) {
        return;
      }
      var axis = coordSys.getAxis(coordDim);
      var colorStops = map$1(visualMeta.stops, function(stop2) {
        return {
          coord: axis.toGlobalCoord(axis.dataToCoord(stop2.value)),
          color: stop2.color
        };
      });
      var stopLen = colorStops.length;
      var outerColors = visualMeta.outerColors.slice();
      if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) {
        colorStops.reverse();
        outerColors.reverse();
      }
      var colorStopsInRange = clipColorStops(colorStops, coordDim === "x" ? api2.getWidth() : api2.getHeight());
      var inRangeStopLen = colorStopsInRange.length;
      if (!inRangeStopLen && stopLen) {
        return colorStops[0].coord < 0 ? outerColors[1] ? outerColors[1] : colorStops[stopLen - 1].color : outerColors[0] ? outerColors[0] : colorStops[0].color;
      }
      var tinyExtent = 10;
      var minCoord = colorStopsInRange[0].coord - tinyExtent;
      var maxCoord = colorStopsInRange[inRangeStopLen - 1].coord + tinyExtent;
      var coordSpan = maxCoord - minCoord;
      if (coordSpan < 1e-3) {
        return "transparent";
      }
      each$f(colorStopsInRange, function(stop2) {
        stop2.offset = (stop2.coord - minCoord) / coordSpan;
      });
      colorStopsInRange.push({
        // NOTE: inRangeStopLen may still be 0 if stoplen is zero.
        offset: inRangeStopLen ? colorStopsInRange[inRangeStopLen - 1].offset : 0.5,
        color: outerColors[1] || "transparent"
      });
      colorStopsInRange.unshift({
        offset: inRangeStopLen ? colorStopsInRange[0].offset : 0.5,
        color: outerColors[0] || "transparent"
      });
      var gradient = new LinearGradient(0, 0, 0, 0, colorStopsInRange, true);
      gradient[coordDim] = minCoord;
      gradient[coordDim + "2"] = maxCoord;
      return gradient;
    }
    function getIsIgnoreFunc(seriesModel, data, coordSys) {
      var showAllSymbol = seriesModel.get("showAllSymbol");
      var isAuto2 = showAllSymbol === "auto";
      if (showAllSymbol && !isAuto2) {
        return;
      }
      var categoryAxis2 = coordSys.getAxesByScale("ordinal")[0];
      if (!categoryAxis2) {
        return;
      }
      if (isAuto2 && canShowAllSymbolForCategory(categoryAxis2, data)) {
        return;
      }
      var categoryDataDim = data.mapDimension(categoryAxis2.dim);
      var labelMap = {};
      each$f(categoryAxis2.getViewLabels(), function(labelItem) {
        var ordinalNumber = categoryAxis2.scale.getRawOrdinalNumber(labelItem.tickValue);
        labelMap[ordinalNumber] = 1;
      });
      return function(dataIndex) {
        return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex));
      };
    }
    function canShowAllSymbolForCategory(categoryAxis2, data) {
      var axisExtent = categoryAxis2.getExtent();
      var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis2.scale.count();
      isNaN(availSize) && (availSize = 0);
      var dataLen = data.count();
      var step = Math.max(1, Math.round(dataLen / 5));
      for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) {
        if (Symbol$1.getSymbolSize(
          data,
          dataIndex
          // Only for cartesian, where `isHorizontal` exists.
        )[categoryAxis2.isHorizontal() ? 1 : 0] * 1.5 > availSize) {
          return false;
        }
      }
      return true;
    }
    function isPointNull(x2, y) {
      return isNaN(x2) || isNaN(y);
    }
    function getLastIndexNotNull(points2) {
      var len2 = points2.length / 2;
      for (; len2 > 0; len2--) {
        if (!isPointNull(points2[len2 * 2 - 2], points2[len2 * 2 - 1])) {
          break;
        }
      }
      return len2 - 1;
    }
    function getPointAtIndex(points2, idx) {
      return [points2[idx * 2], points2[idx * 2 + 1]];
    }
    function getIndexRange(points2, xOrY, dim) {
      var len2 = points2.length / 2;
      var dimIdx = dim === "x" ? 0 : 1;
      var a2;
      var b2;
      var prevIndex = 0;
      var nextIndex = -1;
      for (var i2 = 0; i2 < len2; i2++) {
        b2 = points2[i2 * 2 + dimIdx];
        if (isNaN(b2) || isNaN(points2[i2 * 2 + 1 - dimIdx])) {
          continue;
        }
        if (i2 === 0) {
          a2 = b2;
          continue;
        }
        if (a2 <= xOrY && b2 >= xOrY || a2 >= xOrY && b2 <= xOrY) {
          nextIndex = i2;
          break;
        }
        prevIndex = i2;
        a2 = b2;
      }
      return {
        range: [prevIndex, nextIndex],
        t: (xOrY - a2) / (b2 - a2)
      };
    }
    function anyStateShowEndLabel(seriesModel) {
      if (seriesModel.get(["endLabel", "show"])) {
        return true;
      }
      for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
        if (seriesModel.get([SPECIAL_STATES[i2], "endLabel", "show"])) {
          return true;
        }
      }
      return false;
    }
    function createLineClipPath(lineView, coordSys, hasAnimation, seriesModel) {
      if (isCoordinateSystemType(coordSys, "cartesian2d")) {
        var endLabelModel_1 = seriesModel.getModel("endLabel");
        var valueAnimation_1 = endLabelModel_1.get("valueAnimation");
        var data_1 = seriesModel.getData();
        var labelAnimationRecord_1 = {
          lastFrameIndex: 0
        };
        var during = anyStateShowEndLabel(seriesModel) ? function(percent, clipRect) {
          lineView._endLabelOnDuring(percent, clipRect, data_1, labelAnimationRecord_1, valueAnimation_1, endLabelModel_1, coordSys);
        } : null;
        var isHorizontal2 = coordSys.getBaseAxis().isHorizontal();
        var clipPath = createGridClipPath(coordSys, hasAnimation, seriesModel, function() {
          var endLabel = lineView._endLabel;
          if (endLabel && hasAnimation) {
            if (labelAnimationRecord_1.originalX != null) {
              endLabel.attr({
                x: labelAnimationRecord_1.originalX,
                y: labelAnimationRecord_1.originalY
              });
            }
          }
        }, during);
        if (!seriesModel.get("clip", true)) {
          var rectShape = clipPath.shape;
          var expandSize = Math.max(rectShape.width, rectShape.height);
          if (isHorizontal2) {
            rectShape.y -= expandSize;
            rectShape.height += expandSize * 2;
          } else {
            rectShape.x -= expandSize;
            rectShape.width += expandSize * 2;
          }
        }
        if (during) {
          during(1, clipPath);
        }
        return clipPath;
      } else {
        return createPolarClipPath(coordSys, hasAnimation, seriesModel);
      }
    }
    function getEndLabelStateSpecified(endLabelModel, coordSys) {
      var baseAxis = coordSys.getBaseAxis();
      var isHorizontal2 = baseAxis.isHorizontal();
      var isBaseInversed = baseAxis.inverse;
      var align = isHorizontal2 ? isBaseInversed ? "right" : "left" : "center";
      var verticalAlign = isHorizontal2 ? "middle" : isBaseInversed ? "top" : "bottom";
      return {
        normal: {
          align: endLabelModel.get("align") || align,
          verticalAlign: endLabelModel.get("verticalAlign") || verticalAlign
        }
      };
    }
    var LineView = (
      /** @class */
      function(_super) {
        __extends$1(LineView2, _super);
        function LineView2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        LineView2.prototype.init = function() {
          var lineGroup = new Group$3();
          var symbolDraw = new SymbolDraw();
          this.group.add(symbolDraw.group);
          this._symbolDraw = symbolDraw;
          this._lineGroup = lineGroup;
          this._changePolyState = bind$2(this._changePolyState, this);
        };
        LineView2.prototype.render = function(seriesModel, ecModel, api2) {
          var coordSys = seriesModel.coordinateSystem;
          var group = this.group;
          var data = seriesModel.getData();
          var lineStyleModel = seriesModel.getModel("lineStyle");
          var areaStyleModel = seriesModel.getModel("areaStyle");
          var points2 = data.getLayout("points") || [];
          var isCoordSysPolar = coordSys.type === "polar";
          var prevCoordSys = this._coordSys;
          var symbolDraw = this._symbolDraw;
          var polyline = this._polyline;
          var polygon = this._polygon;
          var lineGroup = this._lineGroup;
          var hasAnimation = !ecModel.ssr && seriesModel.get("animation");
          var isAreaChart = !areaStyleModel.isEmpty();
          var valueOrigin = areaStyleModel.get("origin");
          var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);
          var stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);
          var showSymbol = seriesModel.get("showSymbol");
          var connectNulls = seriesModel.get("connectNulls");
          var isIgnoreFunc = showSymbol && !isCoordSysPolar && getIsIgnoreFunc(seriesModel, data, coordSys);
          var oldData = this._data;
          oldData && oldData.eachItemGraphicEl(function(el, idx) {
            if (el.__temp) {
              group.remove(el);
              oldData.setItemGraphicEl(idx, null);
            }
          });
          if (!showSymbol) {
            symbolDraw.remove();
          }
          group.add(lineGroup);
          var step = !isCoordSysPolar ? seriesModel.get("step") : false;
          var clipShapeForSymbol;
          if (coordSys && coordSys.getArea && seriesModel.get("clip", true)) {
            clipShapeForSymbol = coordSys.getArea();
            if (clipShapeForSymbol.width != null) {
              clipShapeForSymbol.x -= 0.1;
              clipShapeForSymbol.y -= 0.1;
              clipShapeForSymbol.width += 0.2;
              clipShapeForSymbol.height += 0.2;
            } else if (clipShapeForSymbol.r0) {
              clipShapeForSymbol.r0 -= 0.5;
              clipShapeForSymbol.r += 0.5;
            }
          }
          this._clipShapeForSymbol = clipShapeForSymbol;
          var visualColor = getVisualGradient(data, coordSys, api2) || data.getVisual("style")[data.getVisual("drawType")];
          if (!(polyline && prevCoordSys.type === coordSys.type && step === this._step)) {
            showSymbol && symbolDraw.updateData(data, {
              isIgnore: isIgnoreFunc,
              clipShape: clipShapeForSymbol,
              disableAnimation: true,
              getSymbolPoint: function(idx) {
                return [points2[idx * 2], points2[idx * 2 + 1]];
              }
            });
            hasAnimation && this._initSymbolLabelAnimation(data, coordSys, clipShapeForSymbol);
            if (step) {
              if (stackedOnPoints) {
                stackedOnPoints = turnPointsIntoStep(stackedOnPoints, points2, coordSys, step, connectNulls);
              }
              points2 = turnPointsIntoStep(points2, null, coordSys, step, connectNulls);
            }
            polyline = this._newPolyline(points2);
            if (isAreaChart) {
              polygon = this._newPolygon(points2, stackedOnPoints);
            } else if (polygon) {
              lineGroup.remove(polygon);
              polygon = this._polygon = null;
            }
            if (!isCoordSysPolar) {
              this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));
            }
            lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));
          } else {
            if (isAreaChart && !polygon) {
              polygon = this._newPolygon(points2, stackedOnPoints);
            } else if (polygon && !isAreaChart) {
              lineGroup.remove(polygon);
              polygon = this._polygon = null;
            }
            if (!isCoordSysPolar) {
              this._initOrUpdateEndLabel(seriesModel, coordSys, convertToColorString(visualColor));
            }
            var oldClipPath = lineGroup.getClipPath();
            if (oldClipPath) {
              var newClipPath = createLineClipPath(this, coordSys, false, seriesModel);
              initProps(oldClipPath, {
                shape: newClipPath.shape
              }, seriesModel);
            } else {
              lineGroup.setClipPath(createLineClipPath(this, coordSys, true, seriesModel));
            }
            showSymbol && symbolDraw.updateData(data, {
              isIgnore: isIgnoreFunc,
              clipShape: clipShapeForSymbol,
              disableAnimation: true,
              getSymbolPoint: function(idx) {
                return [points2[idx * 2], points2[idx * 2 + 1]];
              }
            });
            if (!isPointsSame(this._stackedOnPoints, stackedOnPoints) || !isPointsSame(this._points, points2)) {
              if (hasAnimation) {
                this._doUpdateAnimation(data, stackedOnPoints, coordSys, api2, step, valueOrigin, connectNulls);
              } else {
                if (step) {
                  if (stackedOnPoints) {
                    stackedOnPoints = turnPointsIntoStep(stackedOnPoints, points2, coordSys, step, connectNulls);
                  }
                  points2 = turnPointsIntoStep(points2, null, coordSys, step, connectNulls);
                }
                polyline.setShape({
                  points: points2
                });
                polygon && polygon.setShape({
                  points: points2,
                  stackedOnPoints
                });
              }
            }
          }
          var emphasisModel = seriesModel.getModel("emphasis");
          var focus = emphasisModel.get("focus");
          var blurScope = emphasisModel.get("blurScope");
          var emphasisDisabled = emphasisModel.get("disabled");
          polyline.useStyle(defaults$1(
            // Use color in lineStyle first
            lineStyleModel.getLineStyle(),
            {
              fill: "none",
              stroke: visualColor,
              lineJoin: "bevel"
            }
          ));
          setStatesStylesFromModel(polyline, seriesModel, "lineStyle");
          if (polyline.style.lineWidth > 0 && seriesModel.get(["emphasis", "lineStyle", "width"]) === "bolder") {
            var emphasisLineStyle = polyline.getState("emphasis").style;
            emphasisLineStyle.lineWidth = +polyline.style.lineWidth + 1;
          }
          getECData(polyline).seriesIndex = seriesModel.seriesIndex;
          toggleHoverEmphasis(polyline, focus, blurScope, emphasisDisabled);
          var smooth = getSmooth(seriesModel.get("smooth"));
          var smoothMonotone = seriesModel.get("smoothMonotone");
          polyline.setShape({
            smooth,
            smoothMonotone,
            connectNulls
          });
          if (polygon) {
            var stackedOnSeries = data.getCalculationInfo("stackedOnSeries");
            var stackedOnSmooth = 0;
            polygon.useStyle(defaults$1(areaStyleModel.getAreaStyle(), {
              fill: visualColor,
              opacity: 0.7,
              lineJoin: "bevel",
              decal: data.getVisual("style").decal
            }));
            if (stackedOnSeries) {
              stackedOnSmooth = getSmooth(stackedOnSeries.get("smooth"));
            }
            polygon.setShape({
              smooth,
              stackedOnSmooth,
              smoothMonotone,
              connectNulls
            });
            setStatesStylesFromModel(polygon, seriesModel, "areaStyle");
            getECData(polygon).seriesIndex = seriesModel.seriesIndex;
            toggleHoverEmphasis(polygon, focus, blurScope, emphasisDisabled);
          }
          var changePolyState = this._changePolyState;
          data.eachItemGraphicEl(function(el) {
            el && (el.onHoverStateChange = changePolyState);
          });
          this._polyline.onHoverStateChange = changePolyState;
          this._data = data;
          this._coordSys = coordSys;
          this._stackedOnPoints = stackedOnPoints;
          this._points = points2;
          this._step = step;
          this._valueOrigin = valueOrigin;
          if (seriesModel.get("triggerLineEvent")) {
            this.packEventData(seriesModel, polyline);
            polygon && this.packEventData(seriesModel, polygon);
          }
        };
        LineView2.prototype.packEventData = function(seriesModel, el) {
          getECData(el).eventData = {
            componentType: "series",
            componentSubType: "line",
            componentIndex: seriesModel.componentIndex,
            seriesIndex: seriesModel.seriesIndex,
            seriesName: seriesModel.name,
            seriesType: "line"
          };
        };
        LineView2.prototype.highlight = function(seriesModel, ecModel, api2, payload) {
          var data = seriesModel.getData();
          var dataIndex = queryDataIndex(data, payload);
          this._changePolyState("emphasis");
          if (!(dataIndex instanceof Array) && dataIndex != null && dataIndex >= 0) {
            var points2 = data.getLayout("points");
            var symbol = data.getItemGraphicEl(dataIndex);
            if (!symbol) {
              var x2 = points2[dataIndex * 2];
              var y = points2[dataIndex * 2 + 1];
              if (isNaN(x2) || isNaN(y)) {
                return;
              }
              if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(x2, y)) {
                return;
              }
              var zlevel = seriesModel.get("zlevel") || 0;
              var z2 = seriesModel.get("z") || 0;
              symbol = new Symbol$1(data, dataIndex);
              symbol.x = x2;
              symbol.y = y;
              symbol.setZ(zlevel, z2);
              var symbolLabel = symbol.getSymbolPath().getTextContent();
              if (symbolLabel) {
                symbolLabel.zlevel = zlevel;
                symbolLabel.z = z2;
                symbolLabel.z2 = this._polyline.z2 + 1;
              }
              symbol.__temp = true;
              data.setItemGraphicEl(dataIndex, symbol);
              symbol.stopSymbolAnimation(true);
              this.group.add(symbol);
            }
            symbol.highlight();
          } else {
            ChartView.prototype.highlight.call(this, seriesModel, ecModel, api2, payload);
          }
        };
        LineView2.prototype.downplay = function(seriesModel, ecModel, api2, payload) {
          var data = seriesModel.getData();
          var dataIndex = queryDataIndex(data, payload);
          this._changePolyState("normal");
          if (dataIndex != null && dataIndex >= 0) {
            var symbol = data.getItemGraphicEl(dataIndex);
            if (symbol) {
              if (symbol.__temp) {
                data.setItemGraphicEl(dataIndex, null);
                this.group.remove(symbol);
              } else {
                symbol.downplay();
              }
            }
          } else {
            ChartView.prototype.downplay.call(this, seriesModel, ecModel, api2, payload);
          }
        };
        LineView2.prototype._changePolyState = function(toState) {
          var polygon = this._polygon;
          setStatesFlag(this._polyline, toState);
          polygon && setStatesFlag(polygon, toState);
        };
        LineView2.prototype._newPolyline = function(points2) {
          var polyline = this._polyline;
          if (polyline) {
            this._lineGroup.remove(polyline);
          }
          polyline = new ECPolyline({
            shape: {
              points: points2
            },
            segmentIgnoreThreshold: 2,
            z2: 10
          });
          this._lineGroup.add(polyline);
          this._polyline = polyline;
          return polyline;
        };
        LineView2.prototype._newPolygon = function(points2, stackedOnPoints) {
          var polygon = this._polygon;
          if (polygon) {
            this._lineGroup.remove(polygon);
          }
          polygon = new ECPolygon({
            shape: {
              points: points2,
              stackedOnPoints
            },
            segmentIgnoreThreshold: 2
          });
          this._lineGroup.add(polygon);
          this._polygon = polygon;
          return polygon;
        };
        LineView2.prototype._initSymbolLabelAnimation = function(data, coordSys, clipShape) {
          var isHorizontalOrRadial;
          var isCoordSysPolar;
          var baseAxis = coordSys.getBaseAxis();
          var isAxisInverse = baseAxis.inverse;
          if (coordSys.type === "cartesian2d") {
            isHorizontalOrRadial = baseAxis.isHorizontal();
            isCoordSysPolar = false;
          } else if (coordSys.type === "polar") {
            isHorizontalOrRadial = baseAxis.dim === "angle";
            isCoordSysPolar = true;
          }
          var seriesModel = data.hostModel;
          var seriesDuration = seriesModel.get("animationDuration");
          if (isFunction$1(seriesDuration)) {
            seriesDuration = seriesDuration(null);
          }
          var seriesDelay = seriesModel.get("animationDelay") || 0;
          var seriesDelayValue = isFunction$1(seriesDelay) ? seriesDelay(null) : seriesDelay;
          data.eachItemGraphicEl(function(symbol, idx) {
            var el = symbol;
            if (el) {
              var point = [symbol.x, symbol.y];
              var start2 = void 0;
              var end2 = void 0;
              var current = void 0;
              if (clipShape) {
                if (isCoordSysPolar) {
                  var polarClip = clipShape;
                  var coord = coordSys.pointToCoord(point);
                  if (isHorizontalOrRadial) {
                    start2 = polarClip.startAngle;
                    end2 = polarClip.endAngle;
                    current = -coord[1] / 180 * Math.PI;
                  } else {
                    start2 = polarClip.r0;
                    end2 = polarClip.r;
                    current = coord[0];
                  }
                } else {
                  var gridClip = clipShape;
                  if (isHorizontalOrRadial) {
                    start2 = gridClip.x;
                    end2 = gridClip.x + gridClip.width;
                    current = symbol.x;
                  } else {
                    start2 = gridClip.y + gridClip.height;
                    end2 = gridClip.y;
                    current = symbol.y;
                  }
                }
              }
              var ratio = end2 === start2 ? 0 : (current - start2) / (end2 - start2);
              if (isAxisInverse) {
                ratio = 1 - ratio;
              }
              var delay = isFunction$1(seriesDelay) ? seriesDelay(idx) : seriesDuration * ratio + seriesDelayValue;
              var symbolPath = el.getSymbolPath();
              var text = symbolPath.getTextContent();
              el.attr({
                scaleX: 0,
                scaleY: 0
              });
              el.animateTo({
                scaleX: 1,
                scaleY: 1
              }, {
                duration: 200,
                setToFinal: true,
                delay
              });
              if (text) {
                text.animateFrom({
                  style: {
                    opacity: 0
                  }
                }, {
                  duration: 300,
                  delay
                });
              }
              symbolPath.disableLabelAnimation = true;
            }
          });
        };
        LineView2.prototype._initOrUpdateEndLabel = function(seriesModel, coordSys, inheritColor) {
          var endLabelModel = seriesModel.getModel("endLabel");
          if (anyStateShowEndLabel(seriesModel)) {
            var data_2 = seriesModel.getData();
            var polyline = this._polyline;
            var points2 = data_2.getLayout("points");
            if (!points2) {
              polyline.removeTextContent();
              this._endLabel = null;
              return;
            }
            var endLabel = this._endLabel;
            if (!endLabel) {
              endLabel = this._endLabel = new ZRText({
                z2: 200
                // should be higher than item symbol
              });
              endLabel.ignoreClip = true;
              polyline.setTextContent(this._endLabel);
              polyline.disableLabelAnimation = true;
            }
            var dataIndex = getLastIndexNotNull(points2);
            if (dataIndex >= 0) {
              setLabelStyle(polyline, getLabelStatesModels(seriesModel, "endLabel"), {
                inheritColor,
                labelFetcher: seriesModel,
                labelDataIndex: dataIndex,
                defaultText: function(dataIndex2, opt, interpolatedValue) {
                  return interpolatedValue != null ? getDefaultInterpolatedLabel(data_2, interpolatedValue) : getDefaultLabel(data_2, dataIndex2);
                },
                enableTextSetter: true
              }, getEndLabelStateSpecified(endLabelModel, coordSys));
              polyline.textConfig.position = null;
            }
          } else if (this._endLabel) {
            this._polyline.removeTextContent();
            this._endLabel = null;
          }
        };
        LineView2.prototype._endLabelOnDuring = function(percent, clipRect, data, animationRecord, valueAnimation, endLabelModel, coordSys) {
          var endLabel = this._endLabel;
          var polyline = this._polyline;
          if (endLabel) {
            if (percent < 1 && animationRecord.originalX == null) {
              animationRecord.originalX = endLabel.x;
              animationRecord.originalY = endLabel.y;
            }
            var points2 = data.getLayout("points");
            var seriesModel = data.hostModel;
            var connectNulls = seriesModel.get("connectNulls");
            var precision = endLabelModel.get("precision");
            var distance2 = endLabelModel.get("distance") || 0;
            var baseAxis = coordSys.getBaseAxis();
            var isHorizontal2 = baseAxis.isHorizontal();
            var isBaseInversed = baseAxis.inverse;
            var clipShape = clipRect.shape;
            var xOrY = isBaseInversed ? isHorizontal2 ? clipShape.x : clipShape.y + clipShape.height : isHorizontal2 ? clipShape.x + clipShape.width : clipShape.y;
            var distanceX = (isHorizontal2 ? distance2 : 0) * (isBaseInversed ? -1 : 1);
            var distanceY = (isHorizontal2 ? 0 : -distance2) * (isBaseInversed ? -1 : 1);
            var dim = isHorizontal2 ? "x" : "y";
            var dataIndexRange = getIndexRange(points2, xOrY, dim);
            var indices = dataIndexRange.range;
            var diff = indices[1] - indices[0];
            var value = void 0;
            if (diff >= 1) {
              if (diff > 1 && !connectNulls) {
                var pt3 = getPointAtIndex(points2, indices[0]);
                endLabel.attr({
                  x: pt3[0] + distanceX,
                  y: pt3[1] + distanceY
                });
                valueAnimation && (value = seriesModel.getRawValue(indices[0]));
              } else {
                var pt3 = polyline.getPointOn(xOrY, dim);
                pt3 && endLabel.attr({
                  x: pt3[0] + distanceX,
                  y: pt3[1] + distanceY
                });
                var startValue = seriesModel.getRawValue(indices[0]);
                var endValue = seriesModel.getRawValue(indices[1]);
                valueAnimation && (value = interpolateRawValues(data, precision, startValue, endValue, dataIndexRange.t));
              }
              animationRecord.lastFrameIndex = indices[0];
            } else {
              var idx = percent === 1 || animationRecord.lastFrameIndex > 0 ? indices[0] : 0;
              var pt3 = getPointAtIndex(points2, idx);
              valueAnimation && (value = seriesModel.getRawValue(idx));
              endLabel.attr({
                x: pt3[0] + distanceX,
                y: pt3[1] + distanceY
              });
            }
            if (valueAnimation) {
              var inner2 = labelInner(endLabel);
              if (typeof inner2.setLabelText === "function") {
                inner2.setLabelText(value);
              }
            }
          }
        };
        LineView2.prototype._doUpdateAnimation = function(data, stackedOnPoints, coordSys, api2, step, valueOrigin, connectNulls) {
          var polyline = this._polyline;
          var polygon = this._polygon;
          var seriesModel = data.hostModel;
          var diff = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin);
          var current = diff.current;
          var stackedOnCurrent = diff.stackedOnCurrent;
          var next = diff.next;
          var stackedOnNext = diff.stackedOnNext;
          if (step) {
            stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, diff.current, coordSys, step, connectNulls);
            current = turnPointsIntoStep(diff.current, null, coordSys, step, connectNulls);
            stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, diff.next, coordSys, step, connectNulls);
            next = turnPointsIntoStep(diff.next, null, coordSys, step, connectNulls);
          }
          if (getBoundingDiff(current, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) {
            polyline.stopAnimation();
            polyline.setShape({
              points: next
            });
            if (polygon) {
              polygon.stopAnimation();
              polygon.setShape({
                points: next,
                stackedOnPoints: stackedOnNext
              });
            }
            return;
          }
          polyline.shape.__points = diff.current;
          polyline.shape.points = current;
          var target = {
            shape: {
              points: next
            }
          };
          if (diff.current !== current) {
            target.shape.__points = diff.next;
          }
          polyline.stopAnimation();
          updateProps$1(polyline, target, seriesModel);
          if (polygon) {
            polygon.setShape({
              // Reuse the points with polyline.
              points: current,
              stackedOnPoints: stackedOnCurrent
            });
            polygon.stopAnimation();
            updateProps$1(polygon, {
              shape: {
                stackedOnPoints: stackedOnNext
              }
            }, seriesModel);
            if (polyline.shape.points !== polygon.shape.points) {
              polygon.shape.points = polyline.shape.points;
            }
          }
          var updatedDataInfo = [];
          var diffStatus = diff.status;
          for (var i2 = 0; i2 < diffStatus.length; i2++) {
            var cmd = diffStatus[i2].cmd;
            if (cmd === "=") {
              var el = data.getItemGraphicEl(diffStatus[i2].idx1);
              if (el) {
                updatedDataInfo.push({
                  el,
                  ptIdx: i2
                  // Index of points
                });
              }
            }
          }
          if (polyline.animators && polyline.animators.length) {
            polyline.animators[0].during(function() {
              polygon && polygon.dirtyShape();
              var points2 = polyline.shape.__points;
              for (var i22 = 0; i22 < updatedDataInfo.length; i22++) {
                var el2 = updatedDataInfo[i22].el;
                var offset2 = updatedDataInfo[i22].ptIdx * 2;
                el2.x = points2[offset2];
                el2.y = points2[offset2 + 1];
                el2.markRedraw();
              }
            });
          }
        };
        LineView2.prototype.remove = function(ecModel) {
          var group = this.group;
          var oldData = this._data;
          this._lineGroup.removeAll();
          this._symbolDraw.remove(true);
          oldData && oldData.eachItemGraphicEl(function(el, idx) {
            if (el.__temp) {
              group.remove(el);
              oldData.setItemGraphicEl(idx, null);
            }
          });
          this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._endLabel = this._data = null;
        };
        LineView2.type = "line";
        return LineView2;
      }(ChartView)
    );
    function pointsLayout(seriesType2, forceStoreInTypedArray) {
      return {
        seriesType: seriesType2,
        plan: createRenderPlanner(),
        reset: function(seriesModel) {
          var data = seriesModel.getData();
          var coordSys = seriesModel.coordinateSystem;
          var pipelineContext = seriesModel.pipelineContext;
          var useTypedArray = forceStoreInTypedArray || pipelineContext.large;
          if (!coordSys) {
            return;
          }
          var dims = map$1(coordSys.dimensions, function(dim) {
            return data.mapDimension(dim);
          }).slice(0, 2);
          var dimLen = dims.length;
          var stackResultDim = data.getCalculationInfo("stackResultDimension");
          if (isDimensionStacked(data, dims[0])) {
            dims[0] = stackResultDim;
          }
          if (isDimensionStacked(data, dims[1])) {
            dims[1] = stackResultDim;
          }
          var store2 = data.getStore();
          var dimIdx0 = data.getDimensionIndex(dims[0]);
          var dimIdx1 = data.getDimensionIndex(dims[1]);
          return dimLen && {
            progress: function(params, data2) {
              var segCount = params.end - params.start;
              var points2 = useTypedArray && createFloat32Array(segCount * dimLen);
              var tmpIn = [];
              var tmpOut = [];
              for (var i2 = params.start, offset2 = 0; i2 < params.end; i2++) {
                var point = void 0;
                if (dimLen === 1) {
                  var x2 = store2.get(dimIdx0, i2);
                  point = coordSys.dataToPoint(x2, null, tmpOut);
                } else {
                  tmpIn[0] = store2.get(dimIdx0, i2);
                  tmpIn[1] = store2.get(dimIdx1, i2);
                  point = coordSys.dataToPoint(tmpIn, null, tmpOut);
                }
                if (useTypedArray) {
                  points2[offset2++] = point[0];
                  points2[offset2++] = point[1];
                } else {
                  data2.setItemLayout(i2, point.slice());
                }
              }
              useTypedArray && data2.setLayout("points", points2);
            }
          };
        }
      };
    }
    var samplers = {
      average: function(frame) {
        var sum2 = 0;
        var count2 = 0;
        for (var i2 = 0; i2 < frame.length; i2++) {
          if (!isNaN(frame[i2])) {
            sum2 += frame[i2];
            count2++;
          }
        }
        return count2 === 0 ? NaN : sum2 / count2;
      },
      sum: function(frame) {
        var sum2 = 0;
        for (var i2 = 0; i2 < frame.length; i2++) {
          sum2 += frame[i2] || 0;
        }
        return sum2;
      },
      max: function(frame) {
        var max3 = -Infinity;
        for (var i2 = 0; i2 < frame.length; i2++) {
          frame[i2] > max3 && (max3 = frame[i2]);
        }
        return isFinite(max3) ? max3 : NaN;
      },
      min: function(frame) {
        var min3 = Infinity;
        for (var i2 = 0; i2 < frame.length; i2++) {
          frame[i2] < min3 && (min3 = frame[i2]);
        }
        return isFinite(min3) ? min3 : NaN;
      },
      // TODO
      // Median
      nearest: function(frame) {
        return frame[0];
      }
    };
    var indexSampler = function(frame) {
      return Math.round(frame.length / 2);
    };
    function dataSample(seriesType2) {
      return {
        seriesType: seriesType2,
        // FIXME:TS never used, so comment it
        // modifyOutputEnd: true,
        reset: function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var sampling = seriesModel.get("sampling");
          var coordSys = seriesModel.coordinateSystem;
          var count2 = data.count();
          if (count2 > 10 && coordSys.type === "cartesian2d" && sampling) {
            var baseAxis = coordSys.getBaseAxis();
            var valueAxis2 = coordSys.getOtherAxis(baseAxis);
            var extent3 = baseAxis.getExtent();
            var dpr2 = api2.getDevicePixelRatio();
            var size = Math.abs(extent3[1] - extent3[0]) * (dpr2 || 1);
            var rate = Math.round(count2 / size);
            if (isFinite(rate) && rate > 1) {
              if (sampling === "lttb") {
                seriesModel.setData(data.lttbDownSample(data.mapDimension(valueAxis2.dim), 1 / rate));
              } else if (sampling === "minmax") {
                seriesModel.setData(data.minmaxDownSample(data.mapDimension(valueAxis2.dim), 1 / rate));
              }
              var sampler = void 0;
              if (isString$1(sampling)) {
                sampler = samplers[sampling];
              } else if (isFunction$1(sampling)) {
                sampler = sampling;
              }
              if (sampler) {
                seriesModel.setData(data.downSample(data.mapDimension(valueAxis2.dim), 1 / rate, sampler, indexSampler));
              }
            }
          }
        }
      };
    }
    function install$Q(registers) {
      registers.registerChartView(LineView);
      registers.registerSeriesModel(LineSeriesModel);
      registers.registerLayout(pointsLayout("line", true));
      registers.registerVisual({
        seriesType: "line",
        reset: function(seriesModel) {
          var data = seriesModel.getData();
          var lineStyle = seriesModel.getModel("lineStyle").getLineStyle();
          if (lineStyle && !lineStyle.stroke) {
            lineStyle.stroke = data.getVisual("style").fill;
          }
          data.setVisual("legendLineStyle", lineStyle);
        }
      });
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample("line"));
    }
    var BaseBarSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(BaseBarSeriesModel2, _super);
        function BaseBarSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BaseBarSeriesModel2.type;
          return _this;
        }
        BaseBarSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this, {
            useEncodeDefaulter: true
          });
        };
        BaseBarSeriesModel2.prototype.getMarkerPosition = function(value, dims, startingAtTick) {
          var coordSys = this.coordinateSystem;
          if (coordSys && coordSys.clampData) {
            var clampData_1 = coordSys.clampData(value);
            var pt_1 = coordSys.dataToPoint(clampData_1);
            if (startingAtTick) {
              each$f(coordSys.getAxes(), function(axis, idx) {
                if (axis.type === "category" && dims != null) {
                  var tickCoords = axis.getTicksCoords();
                  var alignTicksWithLabel = axis.getTickModel().get("alignWithLabel");
                  var targetTickId = clampData_1[idx];
                  var isEnd = dims[idx] === "x1" || dims[idx] === "y1";
                  if (isEnd && !alignTicksWithLabel) {
                    targetTickId += 1;
                  }
                  if (tickCoords.length < 2) {
                    return;
                  } else if (tickCoords.length === 2) {
                    pt_1[idx] = axis.toGlobalCoord(axis.getExtent()[isEnd ? 1 : 0]);
                    return;
                  }
                  var leftCoord = void 0;
                  var coord = void 0;
                  var stepTickValue = 1;
                  for (var i2 = 0; i2 < tickCoords.length; i2++) {
                    var tickCoord = tickCoords[i2].coord;
                    var tickValue = i2 === tickCoords.length - 1 ? tickCoords[i2 - 1].tickValue + stepTickValue : tickCoords[i2].tickValue;
                    if (tickValue === targetTickId) {
                      coord = tickCoord;
                      break;
                    } else if (tickValue < targetTickId) {
                      leftCoord = tickCoord;
                    } else if (leftCoord != null && tickValue > targetTickId) {
                      coord = (tickCoord + leftCoord) / 2;
                      break;
                    }
                    if (i2 === 1) {
                      stepTickValue = tickValue - tickCoords[0].tickValue;
                    }
                  }
                  if (coord == null) {
                    if (!leftCoord) {
                      coord = tickCoords[0].coord;
                    } else if (leftCoord) {
                      coord = tickCoords[tickCoords.length - 1].coord;
                    }
                  }
                  pt_1[idx] = axis.toGlobalCoord(coord);
                }
              });
            } else {
              var data = this.getData();
              var offset2 = data.getLayout("offset");
              var size = data.getLayout("size");
              var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;
              pt_1[offsetIndex] += offset2 + size / 2;
            }
            return pt_1;
          }
          return [NaN, NaN];
        };
        BaseBarSeriesModel2.type = "series.__base_bar__";
        BaseBarSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "cartesian2d",
          legendHoverLink: true,
          // stack: null
          // Cartesian coordinate system
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          barMinHeight: 0,
          barMinAngle: 0,
          // cursor: null,
          large: false,
          largeThreshold: 400,
          progressive: 3e3,
          progressiveChunkMode: "mod"
        };
        return BaseBarSeriesModel2;
      }(SeriesModel)
    );
    SeriesModel.registerClass(BaseBarSeriesModel);
    var BarSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(BarSeriesModel2, _super);
        function BarSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BarSeriesModel2.type;
          return _this;
        }
        BarSeriesModel2.prototype.getInitialData = function() {
          return createSeriesData(null, this, {
            useEncodeDefaulter: true,
            createInvertedIndices: !!this.get("realtimeSort", true) || null
          });
        };
        BarSeriesModel2.prototype.getProgressive = function() {
          return this.get("large") ? this.get("progressive") : false;
        };
        BarSeriesModel2.prototype.getProgressiveThreshold = function() {
          var progressiveThreshold = this.get("progressiveThreshold");
          var largeThreshold = this.get("largeThreshold");
          if (largeThreshold > progressiveThreshold) {
            progressiveThreshold = largeThreshold;
          }
          return progressiveThreshold;
        };
        BarSeriesModel2.prototype.brushSelector = function(dataIndex, data, selectors) {
          return selectors.rect(data.getItemLayout(dataIndex));
        };
        BarSeriesModel2.type = "series.bar";
        BarSeriesModel2.dependencies = ["grid", "polar"];
        BarSeriesModel2.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {
          // If clipped
          // Only available on cartesian2d
          clip: true,
          roundCap: false,
          showBackground: false,
          backgroundStyle: {
            color: "rgba(180, 180, 180, 0.2)",
            borderColor: null,
            borderWidth: 0,
            borderType: "solid",
            borderRadius: 0,
            shadowBlur: 0,
            shadowColor: null,
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            opacity: 1
          },
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          },
          realtimeSort: false
        });
        return BarSeriesModel2;
      }(BaseBarSeriesModel)
    );
    var SausageShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function SausageShape2() {
          this.cx = 0;
          this.cy = 0;
          this.r0 = 0;
          this.r = 0;
          this.startAngle = 0;
          this.endAngle = Math.PI * 2;
          this.clockwise = true;
        }
        return SausageShape2;
      }()
    );
    var SausagePath = (
      /** @class */
      function(_super) {
        __extends$1(SausagePath2, _super);
        function SausagePath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "sausage";
          return _this;
        }
        SausagePath2.prototype.getDefaultShape = function() {
          return new SausageShape();
        };
        SausagePath2.prototype.buildPath = function(ctx, shape) {
          var cx = shape.cx;
          var cy = shape.cy;
          var r0 = Math.max(shape.r0 || 0, 0);
          var r = Math.max(shape.r, 0);
          var dr = (r - r0) * 0.5;
          var rCenter = r0 + dr;
          var startAngle = shape.startAngle;
          var endAngle = shape.endAngle;
          var clockwise = shape.clockwise;
          var PI22 = Math.PI * 2;
          var lessThanCircle = clockwise ? endAngle - startAngle < PI22 : startAngle - endAngle < PI22;
          if (!lessThanCircle) {
            startAngle = endAngle - (clockwise ? PI22 : -PI22);
          }
          var unitStartX = Math.cos(startAngle);
          var unitStartY = Math.sin(startAngle);
          var unitEndX = Math.cos(endAngle);
          var unitEndY = Math.sin(endAngle);
          if (lessThanCircle) {
            ctx.moveTo(unitStartX * r0 + cx, unitStartY * r0 + cy);
            ctx.arc(unitStartX * rCenter + cx, unitStartY * rCenter + cy, dr, -Math.PI + startAngle, startAngle, !clockwise);
          } else {
            ctx.moveTo(unitStartX * r + cx, unitStartY * r + cy);
          }
          ctx.arc(cx, cy, r, startAngle, endAngle, !clockwise);
          ctx.arc(unitEndX * rCenter + cx, unitEndY * rCenter + cy, dr, endAngle - Math.PI * 2, endAngle - Math.PI, !clockwise);
          if (r0 !== 0) {
            ctx.arc(cx, cy, r0, endAngle, startAngle, clockwise);
          }
        };
        return SausagePath2;
      }(Path)
    );
    function createSectorCalculateTextPosition(positionMapping, opts) {
      opts = opts || {};
      var isRoundCap = opts.isRoundCap;
      return function(out2, opts2, boundingRect) {
        var textPosition = opts2.position;
        if (!textPosition || textPosition instanceof Array) {
          return calculateTextPosition(out2, opts2, boundingRect);
        }
        var mappedSectorPosition = positionMapping(textPosition);
        var distance2 = opts2.distance != null ? opts2.distance : 5;
        var sector = this.shape;
        var cx = sector.cx;
        var cy = sector.cy;
        var r = sector.r;
        var r0 = sector.r0;
        var middleR = (r + r0) / 2;
        var startAngle = sector.startAngle;
        var endAngle = sector.endAngle;
        var middleAngle = (startAngle + endAngle) / 2;
        var extraDist = isRoundCap ? Math.abs(r - r0) / 2 : 0;
        var mathCos2 = Math.cos;
        var mathSin2 = Math.sin;
        var x2 = cx + r * mathCos2(startAngle);
        var y = cy + r * mathSin2(startAngle);
        var textAlign2 = "left";
        var textVerticalAlign = "top";
        switch (mappedSectorPosition) {
          case "startArc":
            x2 = cx + (r0 - distance2) * mathCos2(middleAngle);
            y = cy + (r0 - distance2) * mathSin2(middleAngle);
            textAlign2 = "center";
            textVerticalAlign = "top";
            break;
          case "insideStartArc":
            x2 = cx + (r0 + distance2) * mathCos2(middleAngle);
            y = cy + (r0 + distance2) * mathSin2(middleAngle);
            textAlign2 = "center";
            textVerticalAlign = "bottom";
            break;
          case "startAngle":
            x2 = cx + middleR * mathCos2(startAngle) + adjustAngleDistanceX(startAngle, distance2 + extraDist, false);
            y = cy + middleR * mathSin2(startAngle) + adjustAngleDistanceY(startAngle, distance2 + extraDist, false);
            textAlign2 = "right";
            textVerticalAlign = "middle";
            break;
          case "insideStartAngle":
            x2 = cx + middleR * mathCos2(startAngle) + adjustAngleDistanceX(startAngle, -distance2 + extraDist, false);
            y = cy + middleR * mathSin2(startAngle) + adjustAngleDistanceY(startAngle, -distance2 + extraDist, false);
            textAlign2 = "left";
            textVerticalAlign = "middle";
            break;
          case "middle":
            x2 = cx + middleR * mathCos2(middleAngle);
            y = cy + middleR * mathSin2(middleAngle);
            textAlign2 = "center";
            textVerticalAlign = "middle";
            break;
          case "endArc":
            x2 = cx + (r + distance2) * mathCos2(middleAngle);
            y = cy + (r + distance2) * mathSin2(middleAngle);
            textAlign2 = "center";
            textVerticalAlign = "bottom";
            break;
          case "insideEndArc":
            x2 = cx + (r - distance2) * mathCos2(middleAngle);
            y = cy + (r - distance2) * mathSin2(middleAngle);
            textAlign2 = "center";
            textVerticalAlign = "top";
            break;
          case "endAngle":
            x2 = cx + middleR * mathCos2(endAngle) + adjustAngleDistanceX(endAngle, distance2 + extraDist, true);
            y = cy + middleR * mathSin2(endAngle) + adjustAngleDistanceY(endAngle, distance2 + extraDist, true);
            textAlign2 = "left";
            textVerticalAlign = "middle";
            break;
          case "insideEndAngle":
            x2 = cx + middleR * mathCos2(endAngle) + adjustAngleDistanceX(endAngle, -distance2 + extraDist, true);
            y = cy + middleR * mathSin2(endAngle) + adjustAngleDistanceY(endAngle, -distance2 + extraDist, true);
            textAlign2 = "right";
            textVerticalAlign = "middle";
            break;
          default:
            return calculateTextPosition(out2, opts2, boundingRect);
        }
        out2 = out2 || {};
        out2.x = x2;
        out2.y = y;
        out2.align = textAlign2;
        out2.verticalAlign = textVerticalAlign;
        return out2;
      };
    }
    function setSectorTextRotation(sector, textPosition, positionMapping, rotateType) {
      if (isNumber$1(rotateType)) {
        sector.setTextConfig({
          rotation: rotateType
        });
        return;
      } else if (isArray$2(textPosition)) {
        sector.setTextConfig({
          rotation: 0
        });
        return;
      }
      var shape = sector.shape;
      var startAngle = shape.clockwise ? shape.startAngle : shape.endAngle;
      var endAngle = shape.clockwise ? shape.endAngle : shape.startAngle;
      var middleAngle = (startAngle + endAngle) / 2;
      var anchorAngle;
      var mappedSectorPosition = positionMapping(textPosition);
      switch (mappedSectorPosition) {
        case "startArc":
        case "insideStartArc":
        case "middle":
        case "insideEndArc":
        case "endArc":
          anchorAngle = middleAngle;
          break;
        case "startAngle":
        case "insideStartAngle":
          anchorAngle = startAngle;
          break;
        case "endAngle":
        case "insideEndAngle":
          anchorAngle = endAngle;
          break;
        default:
          sector.setTextConfig({
            rotation: 0
          });
          return;
      }
      var rotate2 = Math.PI * 1.5 - anchorAngle;
      if (mappedSectorPosition === "middle" && rotate2 > Math.PI / 2 && rotate2 < Math.PI * 1.5) {
        rotate2 -= Math.PI;
      }
      sector.setTextConfig({
        rotation: rotate2
      });
    }
    function adjustAngleDistanceX(angle2, distance2, isEnd) {
      return distance2 * Math.sin(angle2) * (isEnd ? -1 : 1);
    }
    function adjustAngleDistanceY(angle2, distance2, isEnd) {
      return distance2 * Math.cos(angle2) * (isEnd ? 1 : -1);
    }
    function getSectorCornerRadius(model, shape, zeroIfNull) {
      var cornerRadius = model.get("borderRadius");
      if (cornerRadius == null) {
        return zeroIfNull ? {
          cornerRadius: 0
        } : null;
      }
      if (!isArray$2(cornerRadius)) {
        cornerRadius = [cornerRadius, cornerRadius, cornerRadius, cornerRadius];
      }
      var dr = Math.abs(shape.r || 0 - shape.r0 || 0);
      return {
        cornerRadius: map$1(cornerRadius, function(cr) {
          return parsePercent$1(cr, dr);
        })
      };
    }
    var mathMax$4 = Math.max;
    var mathMin$4 = Math.min;
    function getClipArea(coord, data) {
      var coordSysClipArea = coord.getArea && coord.getArea();
      if (isCoordinateSystemType(coord, "cartesian2d")) {
        var baseAxis = coord.getBaseAxis();
        if (baseAxis.type !== "category" || !baseAxis.onBand) {
          var expandWidth = data.getLayout("bandWidth");
          if (baseAxis.isHorizontal()) {
            coordSysClipArea.x -= expandWidth;
            coordSysClipArea.width += expandWidth * 2;
          } else {
            coordSysClipArea.y -= expandWidth;
            coordSysClipArea.height += expandWidth * 2;
          }
        }
      }
      return coordSysClipArea;
    }
    var BarView = (
      /** @class */
      function(_super) {
        __extends$1(BarView2, _super);
        function BarView2() {
          var _this = _super.call(this) || this;
          _this.type = BarView2.type;
          _this._isFirstFrame = true;
          return _this;
        }
        BarView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
          this._model = seriesModel;
          this._removeOnRenderedListener(api2);
          this._updateDrawMode(seriesModel);
          var coordinateSystemType = seriesModel.get("coordinateSystem");
          if (coordinateSystemType === "cartesian2d" || coordinateSystemType === "polar") {
            this._progressiveEls = null;
            this._isLargeDraw ? this._renderLarge(seriesModel, ecModel, api2) : this._renderNormal(seriesModel, ecModel, api2, payload);
          }
        };
        BarView2.prototype.incrementalPrepareRender = function(seriesModel) {
          this._clear();
          this._updateDrawMode(seriesModel);
          this._updateLargeClip(seriesModel);
        };
        BarView2.prototype.incrementalRender = function(params, seriesModel) {
          this._progressiveEls = [];
          this._incrementalRenderLarge(params, seriesModel);
        };
        BarView2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        BarView2.prototype._updateDrawMode = function(seriesModel) {
          var isLargeDraw = seriesModel.pipelineContext.large;
          if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {
            this._isLargeDraw = isLargeDraw;
            this._clear();
          }
        };
        BarView2.prototype._renderNormal = function(seriesModel, ecModel, api2, payload) {
          var group = this.group;
          var data = seriesModel.getData();
          var oldData = this._data;
          var coord = seriesModel.coordinateSystem;
          var baseAxis = coord.getBaseAxis();
          var isHorizontalOrRadial;
          if (coord.type === "cartesian2d") {
            isHorizontalOrRadial = baseAxis.isHorizontal();
          } else if (coord.type === "polar") {
            isHorizontalOrRadial = baseAxis.dim === "angle";
          }
          var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null;
          var realtimeSortCfg = shouldRealtimeSort(seriesModel, coord);
          if (realtimeSortCfg) {
            this._enableRealtimeSort(realtimeSortCfg, data, api2);
          }
          var needsClip = seriesModel.get("clip", true) || realtimeSortCfg;
          var coordSysClipArea = getClipArea(coord, data);
          group.removeClipPath();
          var roundCap = seriesModel.get("roundCap", true);
          var drawBackground = seriesModel.get("showBackground", true);
          var backgroundModel = seriesModel.getModel("backgroundStyle");
          var barBorderRadius = backgroundModel.get("borderRadius") || 0;
          var bgEls = [];
          var oldBgEls = this._backgroundEls;
          var isInitSort = payload && payload.isInitSort;
          var isChangeOrder = payload && payload.type === "changeAxisOrder";
          function createBackground(dataIndex) {
            var bgLayout = getLayout[coord.type](data, dataIndex);
            var bgEl = createBackgroundEl(coord, isHorizontalOrRadial, bgLayout);
            bgEl.useStyle(backgroundModel.getItemStyle());
            if (coord.type === "cartesian2d") {
              bgEl.setShape("r", barBorderRadius);
            } else {
              bgEl.setShape("cornerRadius", barBorderRadius);
            }
            bgEls[dataIndex] = bgEl;
            return bgEl;
          }
          data.diff(oldData).add(function(dataIndex) {
            var itemModel = data.getItemModel(dataIndex);
            var layout2 = getLayout[coord.type](data, dataIndex, itemModel);
            if (drawBackground) {
              createBackground(dataIndex);
            }
            if (!data.hasValue(dataIndex) || !isValidLayout[coord.type](layout2)) {
              return;
            }
            var isClipped = false;
            if (needsClip) {
              isClipped = clip[coord.type](coordSysClipArea, layout2);
            }
            var el = elementCreator[coord.type](seriesModel, data, dataIndex, layout2, isHorizontalOrRadial, animationModel, baseAxis.model, false, roundCap);
            if (realtimeSortCfg) {
              el.forceLabelAnimation = true;
            }
            updateStyle(el, data, dataIndex, itemModel, layout2, seriesModel, isHorizontalOrRadial, coord.type === "polar");
            if (isInitSort) {
              el.attr({
                shape: layout2
              });
            } else if (realtimeSortCfg) {
              updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout2, dataIndex, isHorizontalOrRadial, false, false);
            } else {
              initProps(el, {
                shape: layout2
              }, seriesModel, dataIndex);
            }
            data.setItemGraphicEl(dataIndex, el);
            group.add(el);
            el.ignore = isClipped;
          }).update(function(newIndex, oldIndex) {
            var itemModel = data.getItemModel(newIndex);
            var layout2 = getLayout[coord.type](data, newIndex, itemModel);
            if (drawBackground) {
              var bgEl = void 0;
              if (oldBgEls.length === 0) {
                bgEl = createBackground(oldIndex);
              } else {
                bgEl = oldBgEls[oldIndex];
                bgEl.useStyle(backgroundModel.getItemStyle());
                if (coord.type === "cartesian2d") {
                  bgEl.setShape("r", barBorderRadius);
                } else {
                  bgEl.setShape("cornerRadius", barBorderRadius);
                }
                bgEls[newIndex] = bgEl;
              }
              var bgLayout = getLayout[coord.type](data, newIndex);
              var shape = createBackgroundShape(isHorizontalOrRadial, bgLayout, coord);
              updateProps$1(bgEl, {
                shape
              }, animationModel, newIndex);
            }
            var el = oldData.getItemGraphicEl(oldIndex);
            if (!data.hasValue(newIndex) || !isValidLayout[coord.type](layout2)) {
              group.remove(el);
              return;
            }
            var isClipped = false;
            if (needsClip) {
              isClipped = clip[coord.type](coordSysClipArea, layout2);
              if (isClipped) {
                group.remove(el);
              }
            }
            if (!el) {
              el = elementCreator[coord.type](seriesModel, data, newIndex, layout2, isHorizontalOrRadial, animationModel, baseAxis.model, !!el, roundCap);
            } else {
              saveOldStyle(el);
            }
            if (realtimeSortCfg) {
              el.forceLabelAnimation = true;
            }
            if (isChangeOrder) {
              var textEl = el.getTextContent();
              if (textEl) {
                var labelInnerStore = labelInner(textEl);
                if (labelInnerStore.prevValue != null) {
                  labelInnerStore.prevValue = labelInnerStore.value;
                }
              }
            } else {
              updateStyle(el, data, newIndex, itemModel, layout2, seriesModel, isHorizontalOrRadial, coord.type === "polar");
            }
            if (isInitSort) {
              el.attr({
                shape: layout2
              });
            } else if (realtimeSortCfg) {
              updateRealtimeAnimation(realtimeSortCfg, animationModel, el, layout2, newIndex, isHorizontalOrRadial, true, isChangeOrder);
            } else {
              updateProps$1(el, {
                shape: layout2
              }, seriesModel, newIndex, null);
            }
            data.setItemGraphicEl(newIndex, el);
            el.ignore = isClipped;
            group.add(el);
          }).remove(function(dataIndex) {
            var el = oldData.getItemGraphicEl(dataIndex);
            el && removeElementWithFadeOut(el, seriesModel, dataIndex);
          }).execute();
          var bgGroup = this._backgroundGroup || (this._backgroundGroup = new Group$3());
          bgGroup.removeAll();
          for (var i2 = 0; i2 < bgEls.length; ++i2) {
            bgGroup.add(bgEls[i2]);
          }
          group.add(bgGroup);
          this._backgroundEls = bgEls;
          this._data = data;
        };
        BarView2.prototype._renderLarge = function(seriesModel, ecModel, api2) {
          this._clear();
          createLarge$1(seriesModel, this.group);
          this._updateLargeClip(seriesModel);
        };
        BarView2.prototype._incrementalRenderLarge = function(params, seriesModel) {
          this._removeBackground();
          createLarge$1(seriesModel, this.group, this._progressiveEls, true);
        };
        BarView2.prototype._updateLargeClip = function(seriesModel) {
          var clipPath = seriesModel.get("clip", true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
          var group = this.group;
          if (clipPath) {
            group.setClipPath(clipPath);
          } else {
            group.removeClipPath();
          }
        };
        BarView2.prototype._enableRealtimeSort = function(realtimeSortCfg, data, api2) {
          var _this = this;
          if (!data.count()) {
            return;
          }
          var baseAxis = realtimeSortCfg.baseAxis;
          if (this._isFirstFrame) {
            this._dispatchInitSort(data, realtimeSortCfg, api2);
            this._isFirstFrame = false;
          } else {
            var orderMapping_1 = function(idx) {
              var el = data.getItemGraphicEl(idx);
              var shape = el && el.shape;
              return shape && // The result should be consistent with the initial sort by data value.
              // Do not support the case that both positive and negative exist.
              Math.abs(baseAxis.isHorizontal() ? shape.height : shape.width) || 0;
            };
            this._onRendered = function() {
              _this._updateSortWithinSameData(data, orderMapping_1, baseAxis, api2);
            };
            api2.getZr().on("rendered", this._onRendered);
          }
        };
        BarView2.prototype._dataSort = function(data, baseAxis, orderMapping) {
          var info = [];
          data.each(data.mapDimension(baseAxis.dim), function(ordinalNumber, dataIdx) {
            var mappedValue = orderMapping(dataIdx);
            mappedValue = mappedValue == null ? NaN : mappedValue;
            info.push({
              dataIndex: dataIdx,
              mappedValue,
              ordinalNumber
            });
          });
          info.sort(function(a2, b2) {
            return b2.mappedValue - a2.mappedValue;
          });
          return {
            ordinalNumbers: map$1(info, function(item) {
              return item.ordinalNumber;
            })
          };
        };
        BarView2.prototype._isOrderChangedWithinSameData = function(data, orderMapping, baseAxis) {
          var scale2 = baseAxis.scale;
          var ordinalDataDim = data.mapDimension(baseAxis.dim);
          var lastValue = Number.MAX_VALUE;
          for (var tickNum = 0, len2 = scale2.getOrdinalMeta().categories.length; tickNum < len2; ++tickNum) {
            var rawIdx = data.rawIndexOf(ordinalDataDim, scale2.getRawOrdinalNumber(tickNum));
            var value = rawIdx < 0 ? Number.MIN_VALUE : orderMapping(data.indexOfRawIndex(rawIdx));
            if (value > lastValue) {
              return true;
            }
            lastValue = value;
          }
          return false;
        };
        BarView2.prototype._isOrderDifferentInView = function(orderInfo, baseAxis) {
          var scale2 = baseAxis.scale;
          var extent3 = scale2.getExtent();
          var tickNum = Math.max(0, extent3[0]);
          var tickMax = Math.min(extent3[1], scale2.getOrdinalMeta().categories.length - 1);
          for (; tickNum <= tickMax; ++tickNum) {
            if (orderInfo.ordinalNumbers[tickNum] !== scale2.getRawOrdinalNumber(tickNum)) {
              return true;
            }
          }
        };
        BarView2.prototype._updateSortWithinSameData = function(data, orderMapping, baseAxis, api2) {
          if (!this._isOrderChangedWithinSameData(data, orderMapping, baseAxis)) {
            return;
          }
          var sortInfo = this._dataSort(data, baseAxis, orderMapping);
          if (this._isOrderDifferentInView(sortInfo, baseAxis)) {
            this._removeOnRenderedListener(api2);
            api2.dispatchAction({
              type: "changeAxisOrder",
              componentType: baseAxis.dim + "Axis",
              axisId: baseAxis.index,
              sortInfo
            });
          }
        };
        BarView2.prototype._dispatchInitSort = function(data, realtimeSortCfg, api2) {
          var baseAxis = realtimeSortCfg.baseAxis;
          var sortResult = this._dataSort(data, baseAxis, function(dataIdx) {
            return data.get(data.mapDimension(realtimeSortCfg.otherAxis.dim), dataIdx);
          });
          api2.dispatchAction({
            type: "changeAxisOrder",
            componentType: baseAxis.dim + "Axis",
            isInitSort: true,
            axisId: baseAxis.index,
            sortInfo: sortResult
          });
        };
        BarView2.prototype.remove = function(ecModel, api2) {
          this._clear(this._model);
          this._removeOnRenderedListener(api2);
        };
        BarView2.prototype.dispose = function(ecModel, api2) {
          this._removeOnRenderedListener(api2);
        };
        BarView2.prototype._removeOnRenderedListener = function(api2) {
          if (this._onRendered) {
            api2.getZr().off("rendered", this._onRendered);
            this._onRendered = null;
          }
        };
        BarView2.prototype._clear = function(model) {
          var group = this.group;
          var data = this._data;
          if (model && model.isAnimationEnabled() && data && !this._isLargeDraw) {
            this._removeBackground();
            this._backgroundEls = [];
            data.eachItemGraphicEl(function(el) {
              removeElementWithFadeOut(el, model, getECData(el).dataIndex);
            });
          } else {
            group.removeAll();
          }
          this._data = null;
          this._isFirstFrame = true;
        };
        BarView2.prototype._removeBackground = function() {
          this.group.remove(this._backgroundGroup);
          this._backgroundGroup = null;
        };
        BarView2.type = "bar";
        return BarView2;
      }(ChartView)
    );
    var clip = {
      cartesian2d: function(coordSysBoundingRect, layout2) {
        var signWidth = layout2.width < 0 ? -1 : 1;
        var signHeight = layout2.height < 0 ? -1 : 1;
        if (signWidth < 0) {
          layout2.x += layout2.width;
          layout2.width = -layout2.width;
        }
        if (signHeight < 0) {
          layout2.y += layout2.height;
          layout2.height = -layout2.height;
        }
        var coordSysX2 = coordSysBoundingRect.x + coordSysBoundingRect.width;
        var coordSysY2 = coordSysBoundingRect.y + coordSysBoundingRect.height;
        var x2 = mathMax$4(layout2.x, coordSysBoundingRect.x);
        var x22 = mathMin$4(layout2.x + layout2.width, coordSysX2);
        var y = mathMax$4(layout2.y, coordSysBoundingRect.y);
        var y2 = mathMin$4(layout2.y + layout2.height, coordSysY2);
        var xClipped = x22 < x2;
        var yClipped = y2 < y;
        layout2.x = xClipped && x2 > coordSysX2 ? x22 : x2;
        layout2.y = yClipped && y > coordSysY2 ? y2 : y;
        layout2.width = xClipped ? 0 : x22 - x2;
        layout2.height = yClipped ? 0 : y2 - y;
        if (signWidth < 0) {
          layout2.x += layout2.width;
          layout2.width = -layout2.width;
        }
        if (signHeight < 0) {
          layout2.y += layout2.height;
          layout2.height = -layout2.height;
        }
        return xClipped || yClipped;
      },
      polar: function(coordSysClipArea, layout2) {
        var signR = layout2.r0 <= layout2.r ? 1 : -1;
        if (signR < 0) {
          var tmp = layout2.r;
          layout2.r = layout2.r0;
          layout2.r0 = tmp;
        }
        var r = mathMin$4(layout2.r, coordSysClipArea.r);
        var r0 = mathMax$4(layout2.r0, coordSysClipArea.r0);
        layout2.r = r;
        layout2.r0 = r0;
        var clipped = r - r0 < 0;
        if (signR < 0) {
          var tmp = layout2.r;
          layout2.r = layout2.r0;
          layout2.r0 = tmp;
        }
        return clipped;
      }
    };
    var elementCreator = {
      cartesian2d: function(seriesModel, data, newIndex, layout2, isHorizontal2, animationModel, axisModel, isUpdate, roundCap) {
        var rect = new Rect$2({
          shape: extend$1({}, layout2),
          z2: 1
        });
        rect.__dataIndex = newIndex;
        rect.name = "item";
        if (animationModel) {
          var rectShape = rect.shape;
          var animateProperty = isHorizontal2 ? "height" : "width";
          rectShape[animateProperty] = 0;
        }
        return rect;
      },
      polar: function(seriesModel, data, newIndex, layout2, isRadial, animationModel, axisModel, isUpdate, roundCap) {
        var ShapeClass = !isRadial && roundCap ? SausagePath : Sector;
        var sector = new ShapeClass({
          shape: layout2,
          z2: 1
        });
        sector.name = "item";
        var positionMap2 = createPolarPositionMapping(isRadial);
        sector.calculateTextPosition = createSectorCalculateTextPosition(positionMap2, {
          isRoundCap: ShapeClass === SausagePath
        });
        if (animationModel) {
          var sectorShape = sector.shape;
          var animateProperty = isRadial ? "r" : "endAngle";
          var animateTarget = {};
          sectorShape[animateProperty] = isRadial ? layout2.r0 : layout2.startAngle;
          animateTarget[animateProperty] = layout2[animateProperty];
          (isUpdate ? updateProps$1 : initProps)(sector, {
            shape: animateTarget
            // __value: typeof dataValue === 'string' ? parseInt(dataValue, 10) : dataValue
          }, animationModel);
        }
        return sector;
      }
    };
    function shouldRealtimeSort(seriesModel, coordSys) {
      var realtimeSortOption = seriesModel.get("realtimeSort", true);
      var baseAxis = coordSys.getBaseAxis();
      if (realtimeSortOption && baseAxis.type === "category" && coordSys.type === "cartesian2d") {
        return {
          baseAxis,
          otherAxis: coordSys.getOtherAxis(baseAxis)
        };
      }
    }
    function updateRealtimeAnimation(realtimeSortCfg, seriesAnimationModel, el, layout2, newIndex, isHorizontal2, isUpdate, isChangeOrder) {
      var seriesTarget;
      var axisTarget;
      if (isHorizontal2) {
        axisTarget = {
          x: layout2.x,
          width: layout2.width
        };
        seriesTarget = {
          y: layout2.y,
          height: layout2.height
        };
      } else {
        axisTarget = {
          y: layout2.y,
          height: layout2.height
        };
        seriesTarget = {
          x: layout2.x,
          width: layout2.width
        };
      }
      if (!isChangeOrder) {
        (isUpdate ? updateProps$1 : initProps)(el, {
          shape: seriesTarget
        }, seriesAnimationModel, newIndex, null);
      }
      var axisAnimationModel = seriesAnimationModel ? realtimeSortCfg.baseAxis.model : null;
      (isUpdate ? updateProps$1 : initProps)(el, {
        shape: axisTarget
      }, axisAnimationModel, newIndex);
    }
    function checkPropertiesNotValid(obj, props2) {
      for (var i2 = 0; i2 < props2.length; i2++) {
        if (!isFinite(obj[props2[i2]])) {
          return true;
        }
      }
      return false;
    }
    var rectPropties = ["x", "y", "width", "height"];
    var polarPropties = ["cx", "cy", "r", "startAngle", "endAngle"];
    var isValidLayout = {
      cartesian2d: function(layout2) {
        return !checkPropertiesNotValid(layout2, rectPropties);
      },
      polar: function(layout2) {
        return !checkPropertiesNotValid(layout2, polarPropties);
      }
    };
    var getLayout = {
      // itemModel is only used to get borderWidth, which is not needed
      // when calculating bar background layout.
      cartesian2d: function(data, dataIndex, itemModel) {
        var layout2 = data.getItemLayout(dataIndex);
        var fixedLineWidth = itemModel ? getLineWidth(itemModel, layout2) : 0;
        var signX = layout2.width > 0 ? 1 : -1;
        var signY = layout2.height > 0 ? 1 : -1;
        return {
          x: layout2.x + signX * fixedLineWidth / 2,
          y: layout2.y + signY * fixedLineWidth / 2,
          width: layout2.width - signX * fixedLineWidth,
          height: layout2.height - signY * fixedLineWidth
        };
      },
      polar: function(data, dataIndex, itemModel) {
        var layout2 = data.getItemLayout(dataIndex);
        return {
          cx: layout2.cx,
          cy: layout2.cy,
          r0: layout2.r0,
          r: layout2.r,
          startAngle: layout2.startAngle,
          endAngle: layout2.endAngle,
          clockwise: layout2.clockwise
        };
      }
    };
    function isZeroOnPolar(layout2) {
      return layout2.startAngle != null && layout2.endAngle != null && layout2.startAngle === layout2.endAngle;
    }
    function createPolarPositionMapping(isRadial) {
      return /* @__PURE__ */ function(isRadial2) {
        var arcOrAngle = isRadial2 ? "Arc" : "Angle";
        return function(position2) {
          switch (position2) {
            case "start":
            case "insideStart":
            case "end":
            case "insideEnd":
              return position2 + arcOrAngle;
            default:
              return position2;
          }
        };
      }(isRadial);
    }
    function updateStyle(el, data, dataIndex, itemModel, layout2, seriesModel, isHorizontalOrRadial, isPolar) {
      var style = data.getItemVisual(dataIndex, "style");
      if (!isPolar) {
        var borderRadius = itemModel.get(["itemStyle", "borderRadius"]) || 0;
        el.setShape("r", borderRadius);
      } else if (!seriesModel.get("roundCap")) {
        var sectorShape = el.shape;
        var cornerRadius = getSectorCornerRadius(itemModel.getModel("itemStyle"), sectorShape, true);
        extend$1(sectorShape, cornerRadius);
        el.setShape(sectorShape);
      }
      el.useStyle(style);
      var cursorStyle = itemModel.getShallow("cursor");
      cursorStyle && el.attr("cursor", cursorStyle);
      var labelPositionOutside = isPolar ? isHorizontalOrRadial ? layout2.r >= layout2.r0 ? "endArc" : "startArc" : layout2.endAngle >= layout2.startAngle ? "endAngle" : "startAngle" : isHorizontalOrRadial ? layout2.height >= 0 ? "bottom" : "top" : layout2.width >= 0 ? "right" : "left";
      var labelStatesModels = getLabelStatesModels(itemModel);
      setLabelStyle(el, labelStatesModels, {
        labelFetcher: seriesModel,
        labelDataIndex: dataIndex,
        defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),
        inheritColor: style.fill,
        defaultOpacity: style.opacity,
        defaultOutsidePosition: labelPositionOutside
      });
      var label = el.getTextContent();
      if (isPolar && label) {
        var position2 = itemModel.get(["label", "position"]);
        el.textConfig.inside = position2 === "middle" ? true : null;
        setSectorTextRotation(el, position2 === "outside" ? labelPositionOutside : position2, createPolarPositionMapping(isHorizontalOrRadial), itemModel.get(["label", "rotate"]));
      }
      setLabelValueAnimation(label, labelStatesModels, seriesModel.getRawValue(dataIndex), function(value) {
        return getDefaultInterpolatedLabel(data, value);
      });
      var emphasisModel = itemModel.getModel(["emphasis"]);
      toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
      setStatesStylesFromModel(el, itemModel);
      if (isZeroOnPolar(layout2)) {
        el.style.fill = "none";
        el.style.stroke = "none";
        each$f(el.states, function(state) {
          if (state.style) {
            state.style.fill = state.style.stroke = "none";
          }
        });
      }
    }
    function getLineWidth(itemModel, rawLayout) {
      var borderColor = itemModel.get(["itemStyle", "borderColor"]);
      if (!borderColor || borderColor === "none") {
        return 0;
      }
      var lineWidth = itemModel.get(["itemStyle", "borderWidth"]) || 0;
      var width = isNaN(rawLayout.width) ? Number.MAX_VALUE : Math.abs(rawLayout.width);
      var height = isNaN(rawLayout.height) ? Number.MAX_VALUE : Math.abs(rawLayout.height);
      return Math.min(lineWidth, width, height);
    }
    var LagePathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function LagePathShape2() {
        }
        return LagePathShape2;
      }()
    );
    var LargePath = (
      /** @class */
      function(_super) {
        __extends$1(LargePath2, _super);
        function LargePath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "largeBar";
          return _this;
        }
        LargePath2.prototype.getDefaultShape = function() {
          return new LagePathShape();
        };
        LargePath2.prototype.buildPath = function(ctx, shape) {
          var points2 = shape.points;
          var baseDimIdx = this.baseDimIdx;
          var valueDimIdx = 1 - this.baseDimIdx;
          var startPoint = [];
          var size = [];
          var barWidth = this.barWidth;
          for (var i2 = 0; i2 < points2.length; i2 += 3) {
            size[baseDimIdx] = barWidth;
            size[valueDimIdx] = points2[i2 + 2];
            startPoint[baseDimIdx] = points2[i2 + baseDimIdx];
            startPoint[valueDimIdx] = points2[i2 + valueDimIdx];
            ctx.rect(startPoint[0], startPoint[1], size[0], size[1]);
          }
        };
        return LargePath2;
      }(Path)
    );
    function createLarge$1(seriesModel, group, progressiveEls, incremental) {
      var data = seriesModel.getData();
      var baseDimIdx = data.getLayout("valueAxisHorizontal") ? 1 : 0;
      var largeDataIndices = data.getLayout("largeDataIndices");
      var barWidth = data.getLayout("size");
      var backgroundModel = seriesModel.getModel("backgroundStyle");
      var bgPoints = data.getLayout("largeBackgroundPoints");
      if (bgPoints) {
        var bgEl = new LargePath({
          shape: {
            points: bgPoints
          },
          incremental: !!incremental,
          silent: true,
          z2: 0
        });
        bgEl.baseDimIdx = baseDimIdx;
        bgEl.largeDataIndices = largeDataIndices;
        bgEl.barWidth = barWidth;
        bgEl.useStyle(backgroundModel.getItemStyle());
        group.add(bgEl);
        progressiveEls && progressiveEls.push(bgEl);
      }
      var el = new LargePath({
        shape: {
          points: data.getLayout("largePoints")
        },
        incremental: !!incremental,
        ignoreCoarsePointer: true,
        z2: 1
      });
      el.baseDimIdx = baseDimIdx;
      el.largeDataIndices = largeDataIndices;
      el.barWidth = barWidth;
      group.add(el);
      el.useStyle(data.getVisual("style"));
      el.style.stroke = null;
      getECData(el).seriesIndex = seriesModel.seriesIndex;
      if (!seriesModel.get("silent")) {
        el.on("mousedown", largePathUpdateDataIndex);
        el.on("mousemove", largePathUpdateDataIndex);
      }
      progressiveEls && progressiveEls.push(el);
    }
    var largePathUpdateDataIndex = throttle$1(function(event) {
      var largePath = this;
      var dataIndex = largePathFindDataIndex(largePath, event.offsetX, event.offsetY);
      getECData(largePath).dataIndex = dataIndex >= 0 ? dataIndex : null;
    }, 30, false);
    function largePathFindDataIndex(largePath, x2, y) {
      var baseDimIdx = largePath.baseDimIdx;
      var valueDimIdx = 1 - baseDimIdx;
      var points2 = largePath.shape.points;
      var largeDataIndices = largePath.largeDataIndices;
      var startPoint = [];
      var size = [];
      var barWidth = largePath.barWidth;
      for (var i2 = 0, len2 = points2.length / 3; i2 < len2; i2++) {
        var ii = i2 * 3;
        size[baseDimIdx] = barWidth;
        size[valueDimIdx] = points2[ii + 2];
        startPoint[baseDimIdx] = points2[ii + baseDimIdx];
        startPoint[valueDimIdx] = points2[ii + valueDimIdx];
        if (size[valueDimIdx] < 0) {
          startPoint[valueDimIdx] += size[valueDimIdx];
          size[valueDimIdx] = -size[valueDimIdx];
        }
        if (x2 >= startPoint[0] && x2 <= startPoint[0] + size[0] && y >= startPoint[1] && y <= startPoint[1] + size[1]) {
          return largeDataIndices[i2];
        }
      }
      return -1;
    }
    function createBackgroundShape(isHorizontalOrRadial, layout2, coord) {
      if (isCoordinateSystemType(coord, "cartesian2d")) {
        var rectShape = layout2;
        var coordLayout = coord.getArea();
        return {
          x: isHorizontalOrRadial ? rectShape.x : coordLayout.x,
          y: isHorizontalOrRadial ? coordLayout.y : rectShape.y,
          width: isHorizontalOrRadial ? rectShape.width : coordLayout.width,
          height: isHorizontalOrRadial ? coordLayout.height : rectShape.height
        };
      } else {
        var coordLayout = coord.getArea();
        var sectorShape = layout2;
        return {
          cx: coordLayout.cx,
          cy: coordLayout.cy,
          r0: isHorizontalOrRadial ? coordLayout.r0 : sectorShape.r0,
          r: isHorizontalOrRadial ? coordLayout.r : sectorShape.r,
          startAngle: isHorizontalOrRadial ? sectorShape.startAngle : 0,
          endAngle: isHorizontalOrRadial ? sectorShape.endAngle : Math.PI * 2
        };
      }
    }
    function createBackgroundEl(coord, isHorizontalOrRadial, layout2) {
      var ElementClz = coord.type === "polar" ? Sector : Rect$2;
      return new ElementClz({
        shape: createBackgroundShape(isHorizontalOrRadial, layout2, coord),
        silent: true,
        z2: 0
      });
    }
    function install$P(registers) {
      registers.registerChartView(BarView);
      registers.registerSeriesModel(BarSeriesModel);
      registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry$1(layout$3, "bar"));
      registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout("bar"));
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, dataSample("bar"));
      registers.registerAction({
        type: "changeAxisOrder",
        event: "changeAxisOrder",
        update: "update"
      }, function(payload, ecModel) {
        var componentType = payload.componentType || "series";
        ecModel.eachComponent({
          mainType: componentType,
          query: payload
        }, function(componentModel) {
          if (payload.sortInfo) {
            componentModel.axis.setCategorySortInfo(payload.sortInfo);
          }
        });
      });
    }
    var PI2 = Math.PI * 2;
    var RADIAN$2 = Math.PI / 180;
    function getViewRect$5(seriesModel, api2) {
      return getLayoutRect(seriesModel.getBoxLayoutParams(), {
        width: api2.getWidth(),
        height: api2.getHeight()
      });
    }
    function getBasicPieLayout(seriesModel, api2) {
      var viewRect2 = getViewRect$5(seriesModel, api2);
      var center2 = seriesModel.get("center");
      var radius = seriesModel.get("radius");
      if (!isArray$2(radius)) {
        radius = [0, radius];
      }
      var width = parsePercent(viewRect2.width, api2.getWidth());
      var height = parsePercent(viewRect2.height, api2.getHeight());
      var size = Math.min(width, height);
      var r0 = parsePercent(radius[0], size / 2);
      var r = parsePercent(radius[1], size / 2);
      var cx;
      var cy;
      var coordSys = seriesModel.coordinateSystem;
      if (coordSys) {
        var point = coordSys.dataToPoint(center2);
        cx = point[0] || 0;
        cy = point[1] || 0;
      } else {
        if (!isArray$2(center2)) {
          center2 = [center2, center2];
        }
        cx = parsePercent(center2[0], width) + viewRect2.x;
        cy = parsePercent(center2[1], height) + viewRect2.y;
      }
      return {
        cx,
        cy,
        r0,
        r
      };
    }
    function pieLayout(seriesType2, ecModel, api2) {
      ecModel.eachSeriesByType(seriesType2, function(seriesModel) {
        var data = seriesModel.getData();
        var valueDim = data.mapDimension("value");
        var viewRect2 = getViewRect$5(seriesModel, api2);
        var _a2 = getBasicPieLayout(seriesModel, api2), cx = _a2.cx, cy = _a2.cy, r = _a2.r, r0 = _a2.r0;
        var startAngle = -seriesModel.get("startAngle") * RADIAN$2;
        var endAngle = seriesModel.get("endAngle");
        var padAngle = seriesModel.get("padAngle") * RADIAN$2;
        endAngle = endAngle === "auto" ? startAngle - PI2 : -endAngle * RADIAN$2;
        var minAngle = seriesModel.get("minAngle") * RADIAN$2;
        var minAndPadAngle = minAngle + padAngle;
        var validDataCount = 0;
        data.each(valueDim, function(value) {
          !isNaN(value) && validDataCount++;
        });
        var sum2 = data.getSum(valueDim);
        var unitRadian = Math.PI / (sum2 || validDataCount) * 2;
        var clockwise = seriesModel.get("clockwise");
        var roseType = seriesModel.get("roseType");
        var stillShowZeroSum = seriesModel.get("stillShowZeroSum");
        var extent3 = data.getDataExtent(valueDim);
        extent3[0] = 0;
        var dir3 = clockwise ? 1 : -1;
        var angles = [startAngle, endAngle];
        var halfPadAngle = dir3 * padAngle / 2;
        normalizeArcAngles(angles, !clockwise);
        startAngle = angles[0], endAngle = angles[1];
        var layoutData = getSeriesLayoutData(seriesModel);
        layoutData.startAngle = startAngle;
        layoutData.endAngle = endAngle;
        layoutData.clockwise = clockwise;
        var angleRange = Math.abs(endAngle - startAngle);
        var restAngle = angleRange;
        var valueSumLargerThanMinAngle = 0;
        var currentAngle = startAngle;
        data.setLayout({
          viewRect: viewRect2,
          r
        });
        data.each(valueDim, function(value, idx) {
          var angle2;
          if (isNaN(value)) {
            data.setItemLayout(idx, {
              angle: NaN,
              startAngle: NaN,
              endAngle: NaN,
              clockwise,
              cx,
              cy,
              r0,
              r: roseType ? NaN : r
            });
            return;
          }
          if (roseType !== "area") {
            angle2 = sum2 === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;
          } else {
            angle2 = angleRange / validDataCount;
          }
          if (angle2 < minAndPadAngle) {
            angle2 = minAndPadAngle;
            restAngle -= minAndPadAngle;
          } else {
            valueSumLargerThanMinAngle += value;
          }
          var endAngle2 = currentAngle + dir3 * angle2;
          var actualStartAngle = 0;
          var actualEndAngle = 0;
          if (padAngle > angle2) {
            actualStartAngle = currentAngle + dir3 * angle2 / 2;
            actualEndAngle = actualStartAngle;
          } else {
            actualStartAngle = currentAngle + halfPadAngle;
            actualEndAngle = endAngle2 - halfPadAngle;
          }
          data.setItemLayout(idx, {
            angle: angle2,
            startAngle: actualStartAngle,
            endAngle: actualEndAngle,
            clockwise,
            cx,
            cy,
            r0,
            r: roseType ? linearMap$2(value, extent3, [r0, r]) : r
          });
          currentAngle = endAngle2;
        });
        if (restAngle < PI2 && validDataCount) {
          if (restAngle <= 1e-3) {
            var angle_1 = angleRange / validDataCount;
            data.each(valueDim, function(value, idx) {
              if (!isNaN(value)) {
                var layout_1 = data.getItemLayout(idx);
                layout_1.angle = angle_1;
                var actualStartAngle = 0;
                var actualEndAngle = 0;
                if (angle_1 < padAngle) {
                  actualStartAngle = startAngle + dir3 * (idx + 1 / 2) * angle_1;
                  actualEndAngle = actualStartAngle;
                } else {
                  actualStartAngle = startAngle + dir3 * idx * angle_1 + halfPadAngle;
                  actualEndAngle = startAngle + dir3 * (idx + 1) * angle_1 - halfPadAngle;
                }
                layout_1.startAngle = actualStartAngle;
                layout_1.endAngle = actualEndAngle;
              }
            });
          } else {
            unitRadian = restAngle / valueSumLargerThanMinAngle;
            currentAngle = startAngle;
            data.each(valueDim, function(value, idx) {
              if (!isNaN(value)) {
                var layout_2 = data.getItemLayout(idx);
                var angle2 = layout_2.angle === minAndPadAngle ? minAndPadAngle : value * unitRadian;
                var actualStartAngle = 0;
                var actualEndAngle = 0;
                if (angle2 < padAngle) {
                  actualStartAngle = currentAngle + dir3 * angle2 / 2;
                  actualEndAngle = actualStartAngle;
                } else {
                  actualStartAngle = currentAngle + halfPadAngle;
                  actualEndAngle = currentAngle + dir3 * angle2 - halfPadAngle;
                }
                layout_2.startAngle = actualStartAngle;
                layout_2.endAngle = actualEndAngle;
                currentAngle += dir3 * angle2;
              }
            });
          }
        }
      });
    }
    var getSeriesLayoutData = makeInner();
    function dataFilter$1(seriesType2) {
      return {
        seriesType: seriesType2,
        reset: function(seriesModel, ecModel) {
          var legendModels = ecModel.findComponents({
            mainType: "legend"
          });
          if (!legendModels || !legendModels.length) {
            return;
          }
          var data = seriesModel.getData();
          data.filterSelf(function(idx) {
            var name = data.getName(idx);
            for (var i2 = 0; i2 < legendModels.length; i2++) {
              if (!legendModels[i2].isSelected(name)) {
                return false;
              }
            }
            return true;
          });
        }
      };
    }
    var RADIAN$1 = Math.PI / 180;
    function adjustSingleSide(list, cx, cy, r, dir3, viewWidth, viewHeight, viewLeft, viewTop, farthestX) {
      if (list.length < 2) {
        return;
      }
      function recalculateXOnSemiToAlignOnEllipseCurve(semi) {
        var rB = semi.rB;
        var rB2 = rB * rB;
        for (var i3 = 0; i3 < semi.list.length; i3++) {
          var item = semi.list[i3];
          var dy = Math.abs(item.label.y - cy);
          var rA = r + item.len;
          var rA2 = rA * rA;
          var dx2 = Math.sqrt(Math.abs((1 - dy * dy / rB2) * rA2));
          var newX = cx + (dx2 + item.len2) * dir3;
          var deltaX = newX - item.label.x;
          var newTargetWidth = item.targetTextWidth - deltaX * dir3;
          constrainTextWidth(item, newTargetWidth, true);
          item.label.x = newX;
        }
      }
      function recalculateX(items) {
        var topSemi = {
          list: [],
          maxY: 0
        };
        var bottomSemi = {
          list: [],
          maxY: 0
        };
        for (var i3 = 0; i3 < items.length; i3++) {
          if (items[i3].labelAlignTo !== "none") {
            continue;
          }
          var item = items[i3];
          var semi = item.label.y > cy ? bottomSemi : topSemi;
          var dy = Math.abs(item.label.y - cy);
          if (dy >= semi.maxY) {
            var dx2 = item.label.x - cx - item.len2 * dir3;
            var rA = r + item.len;
            var rB = Math.abs(dx2) < rA ? Math.sqrt(dy * dy / (1 - dx2 * dx2 / rA / rA)) : rA;
            semi.rB = rB;
            semi.maxY = dy;
          }
          semi.list.push(item);
        }
        recalculateXOnSemiToAlignOnEllipseCurve(topSemi);
        recalculateXOnSemiToAlignOnEllipseCurve(bottomSemi);
      }
      var len2 = list.length;
      for (var i2 = 0; i2 < len2; i2++) {
        if (list[i2].position === "outer" && list[i2].labelAlignTo === "labelLine") {
          var dx = list[i2].label.x - farthestX;
          list[i2].linePoints[1][0] += dx;
          list[i2].label.x = farthestX;
        }
      }
      if (shiftLayoutOnY(list, viewTop, viewTop + viewHeight)) {
        recalculateX(list);
      }
    }
    function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop) {
      var leftList = [];
      var rightList = [];
      var leftmostX = Number.MAX_VALUE;
      var rightmostX = -Number.MAX_VALUE;
      for (var i2 = 0; i2 < labelLayoutList.length; i2++) {
        var label = labelLayoutList[i2].label;
        if (isPositionCenter(labelLayoutList[i2])) {
          continue;
        }
        if (label.x < cx) {
          leftmostX = Math.min(leftmostX, label.x);
          leftList.push(labelLayoutList[i2]);
        } else {
          rightmostX = Math.max(rightmostX, label.x);
          rightList.push(labelLayoutList[i2]);
        }
      }
      for (var i2 = 0; i2 < labelLayoutList.length; i2++) {
        var layout2 = labelLayoutList[i2];
        if (!isPositionCenter(layout2) && layout2.linePoints) {
          if (layout2.labelStyleWidth != null) {
            continue;
          }
          var label = layout2.label;
          var linePoints = layout2.linePoints;
          var targetTextWidth = void 0;
          if (layout2.labelAlignTo === "edge") {
            if (label.x < cx) {
              targetTextWidth = linePoints[2][0] - layout2.labelDistance - viewLeft - layout2.edgeDistance;
            } else {
              targetTextWidth = viewLeft + viewWidth - layout2.edgeDistance - linePoints[2][0] - layout2.labelDistance;
            }
          } else if (layout2.labelAlignTo === "labelLine") {
            if (label.x < cx) {
              targetTextWidth = leftmostX - viewLeft - layout2.bleedMargin;
            } else {
              targetTextWidth = viewLeft + viewWidth - rightmostX - layout2.bleedMargin;
            }
          } else {
            if (label.x < cx) {
              targetTextWidth = label.x - viewLeft - layout2.bleedMargin;
            } else {
              targetTextWidth = viewLeft + viewWidth - label.x - layout2.bleedMargin;
            }
          }
          layout2.targetTextWidth = targetTextWidth;
          constrainTextWidth(layout2, targetTextWidth);
        }
      }
      adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight, viewLeft, viewTop, rightmostX);
      adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight, viewLeft, viewTop, leftmostX);
      for (var i2 = 0; i2 < labelLayoutList.length; i2++) {
        var layout2 = labelLayoutList[i2];
        if (!isPositionCenter(layout2) && layout2.linePoints) {
          var label = layout2.label;
          var linePoints = layout2.linePoints;
          var isAlignToEdge = layout2.labelAlignTo === "edge";
          var padding = label.style.padding;
          var paddingH = padding ? padding[1] + padding[3] : 0;
          var extraPaddingH = label.style.backgroundColor ? 0 : paddingH;
          var realTextWidth = layout2.rect.width + extraPaddingH;
          var dist2 = linePoints[1][0] - linePoints[2][0];
          if (isAlignToEdge) {
            if (label.x < cx) {
              linePoints[2][0] = viewLeft + layout2.edgeDistance + realTextWidth + layout2.labelDistance;
            } else {
              linePoints[2][0] = viewLeft + viewWidth - layout2.edgeDistance - realTextWidth - layout2.labelDistance;
            }
          } else {
            if (label.x < cx) {
              linePoints[2][0] = label.x + layout2.labelDistance;
            } else {
              linePoints[2][0] = label.x - layout2.labelDistance;
            }
            linePoints[1][0] = linePoints[2][0] + dist2;
          }
          linePoints[1][1] = linePoints[2][1] = label.y;
        }
      }
    }
    function constrainTextWidth(layout2, availableWidth, forceRecalculate) {
      if (forceRecalculate === void 0) {
        forceRecalculate = false;
      }
      if (layout2.labelStyleWidth != null) {
        return;
      }
      var label = layout2.label;
      var style = label.style;
      var textRect = layout2.rect;
      var bgColor = style.backgroundColor;
      var padding = style.padding;
      var paddingH = padding ? padding[1] + padding[3] : 0;
      var overflow2 = style.overflow;
      var oldOuterWidth = textRect.width + (bgColor ? 0 : paddingH);
      if (availableWidth < oldOuterWidth || forceRecalculate) {
        var oldHeight = textRect.height;
        if (overflow2 && overflow2.match("break")) {
          label.setStyle("backgroundColor", null);
          label.setStyle("width", availableWidth - paddingH);
          var innerRect = label.getBoundingRect();
          label.setStyle("width", Math.ceil(innerRect.width));
          label.setStyle("backgroundColor", bgColor);
        } else {
          var availableInnerWidth = availableWidth - paddingH;
          var newWidth = availableWidth < oldOuterWidth ? availableInnerWidth : (
            // Current available width is enough, but the text may have
            // already been wrapped with a smaller available width.
            forceRecalculate ? availableInnerWidth > layout2.unconstrainedWidth ? null : availableInnerWidth : null
          );
          label.setStyle("width", newWidth);
        }
        var newRect = label.getBoundingRect();
        textRect.width = newRect.width;
        var margin = (label.style.margin || 0) + 2.1;
        textRect.height = newRect.height + margin;
        textRect.y -= (textRect.height - oldHeight) / 2;
      }
    }
    function isPositionCenter(sectorShape) {
      return sectorShape.position === "center";
    }
    function pieLabelLayout(seriesModel) {
      var data = seriesModel.getData();
      var labelLayoutList = [];
      var cx;
      var cy;
      var hasLabelRotate = false;
      var minShowLabelRadian = (seriesModel.get("minShowLabelAngle") || 0) * RADIAN$1;
      var viewRect2 = data.getLayout("viewRect");
      var r = data.getLayout("r");
      var viewWidth = viewRect2.width;
      var viewLeft = viewRect2.x;
      var viewTop = viewRect2.y;
      var viewHeight = viewRect2.height;
      function setNotShow(el) {
        el.ignore = true;
      }
      function isLabelShown(label2) {
        if (!label2.ignore) {
          return true;
        }
        for (var key in label2.states) {
          if (label2.states[key].ignore === false) {
            return true;
          }
        }
        return false;
      }
      data.each(function(idx) {
        var sector = data.getItemGraphicEl(idx);
        var sectorShape = sector.shape;
        var label2 = sector.getTextContent();
        var labelLine2 = sector.getTextGuideLine();
        var itemModel = data.getItemModel(idx);
        var labelModel = itemModel.getModel("label");
        var labelPosition = labelModel.get("position") || itemModel.get(["emphasis", "label", "position"]);
        var labelDistance = labelModel.get("distanceToLabelLine");
        var labelAlignTo = labelModel.get("alignTo");
        var edgeDistance = parsePercent(labelModel.get("edgeDistance"), viewWidth);
        var bleedMargin = labelModel.get("bleedMargin");
        var labelLineModel = itemModel.getModel("labelLine");
        var labelLineLen = labelLineModel.get("length");
        labelLineLen = parsePercent(labelLineLen, viewWidth);
        var labelLineLen2 = labelLineModel.get("length2");
        labelLineLen2 = parsePercent(labelLineLen2, viewWidth);
        if (Math.abs(sectorShape.endAngle - sectorShape.startAngle) < minShowLabelRadian) {
          each$f(label2.states, setNotShow);
          label2.ignore = true;
          if (labelLine2) {
            each$f(labelLine2.states, setNotShow);
            labelLine2.ignore = true;
          }
          return;
        }
        if (!isLabelShown(label2)) {
          return;
        }
        var midAngle = (sectorShape.startAngle + sectorShape.endAngle) / 2;
        var nx = Math.cos(midAngle);
        var ny = Math.sin(midAngle);
        var textX;
        var textY;
        var linePoints2;
        var textAlign2;
        cx = sectorShape.cx;
        cy = sectorShape.cy;
        var isLabelInside = labelPosition === "inside" || labelPosition === "inner";
        if (labelPosition === "center") {
          textX = sectorShape.cx;
          textY = sectorShape.cy;
          textAlign2 = "center";
        } else {
          var x1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * nx : sectorShape.r * nx) + cx;
          var y1 = (isLabelInside ? (sectorShape.r + sectorShape.r0) / 2 * ny : sectorShape.r * ny) + cy;
          textX = x1 + nx * 3;
          textY = y1 + ny * 3;
          if (!isLabelInside) {
            var x2 = x1 + nx * (labelLineLen + r - sectorShape.r);
            var y2 = y1 + ny * (labelLineLen + r - sectorShape.r);
            var x3 = x2 + (nx < 0 ? -1 : 1) * labelLineLen2;
            var y3 = y2;
            if (labelAlignTo === "edge") {
              textX = nx < 0 ? viewLeft + edgeDistance : viewLeft + viewWidth - edgeDistance;
            } else {
              textX = x3 + (nx < 0 ? -labelDistance : labelDistance);
            }
            textY = y3;
            linePoints2 = [[x1, y1], [x2, y2], [x3, y3]];
          }
          textAlign2 = isLabelInside ? "center" : labelAlignTo === "edge" ? nx > 0 ? "right" : "left" : nx > 0 ? "left" : "right";
        }
        var PI3 = Math.PI;
        var labelRotate = 0;
        var rotate2 = labelModel.get("rotate");
        if (isNumber$1(rotate2)) {
          labelRotate = rotate2 * (PI3 / 180);
        } else if (labelPosition === "center") {
          labelRotate = 0;
        } else if (rotate2 === "radial" || rotate2 === true) {
          var radialAngle = nx < 0 ? -midAngle + PI3 : -midAngle;
          labelRotate = radialAngle;
        } else if (rotate2 === "tangential" && labelPosition !== "outside" && labelPosition !== "outer") {
          var rad = Math.atan2(nx, ny);
          if (rad < 0) {
            rad = PI3 * 2 + rad;
          }
          var isDown = ny > 0;
          if (isDown) {
            rad = PI3 + rad;
          }
          labelRotate = rad - PI3;
        }
        hasLabelRotate = !!labelRotate;
        label2.x = textX;
        label2.y = textY;
        label2.rotation = labelRotate;
        label2.setStyle({
          verticalAlign: "middle"
        });
        if (!isLabelInside) {
          var textRect = label2.getBoundingRect().clone();
          textRect.applyTransform(label2.getComputedTransform());
          var margin = (label2.style.margin || 0) + 2.1;
          textRect.y -= margin / 2;
          textRect.height += margin;
          labelLayoutList.push({
            label: label2,
            labelLine: labelLine2,
            position: labelPosition,
            len: labelLineLen,
            len2: labelLineLen2,
            minTurnAngle: labelLineModel.get("minTurnAngle"),
            maxSurfaceAngle: labelLineModel.get("maxSurfaceAngle"),
            surfaceNormal: new Point(nx, ny),
            linePoints: linePoints2,
            textAlign: textAlign2,
            labelDistance,
            labelAlignTo,
            edgeDistance,
            bleedMargin,
            rect: textRect,
            unconstrainedWidth: textRect.width,
            labelStyleWidth: label2.style.width
          });
        } else {
          label2.setStyle({
            align: textAlign2
          });
          var selectState2 = label2.states.select;
          if (selectState2) {
            selectState2.x += label2.x;
            selectState2.y += label2.y;
          }
        }
        sector.setTextConfig({
          inside: isLabelInside
        });
      });
      if (!hasLabelRotate && seriesModel.get("avoidLabelOverlap")) {
        avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight, viewLeft, viewTop);
      }
      for (var i2 = 0; i2 < labelLayoutList.length; i2++) {
        var layout2 = labelLayoutList[i2];
        var label = layout2.label;
        var labelLine = layout2.labelLine;
        var notShowLabel = isNaN(label.x) || isNaN(label.y);
        if (label) {
          label.setStyle({
            align: layout2.textAlign
          });
          if (notShowLabel) {
            each$f(label.states, setNotShow);
            label.ignore = true;
          }
          var selectState = label.states.select;
          if (selectState) {
            selectState.x += label.x;
            selectState.y += label.y;
          }
        }
        if (labelLine) {
          var linePoints = layout2.linePoints;
          if (notShowLabel || !linePoints) {
            each$f(labelLine.states, setNotShow);
            labelLine.ignore = true;
          } else {
            limitTurnAngle(linePoints, layout2.minTurnAngle);
            limitSurfaceAngle(linePoints, layout2.surfaceNormal, layout2.maxSurfaceAngle);
            labelLine.setShape({
              points: linePoints
            });
            label.__hostTarget.textGuideLineConfig = {
              anchor: new Point(linePoints[0][0], linePoints[0][1])
            };
          }
        }
      }
    }
    var PiePiece = (
      /** @class */
      function(_super) {
        __extends$1(PiePiece2, _super);
        function PiePiece2(data, idx, startAngle) {
          var _this = _super.call(this) || this;
          _this.z2 = 2;
          var text = new ZRText();
          _this.setTextContent(text);
          _this.updateData(data, idx, startAngle, true);
          return _this;
        }
        PiePiece2.prototype.updateData = function(data, idx, startAngle, firstCreate) {
          var sector = this;
          var seriesModel = data.hostModel;
          var itemModel = data.getItemModel(idx);
          var emphasisModel = itemModel.getModel("emphasis");
          var layout2 = data.getItemLayout(idx);
          var sectorShape = extend$1(getSectorCornerRadius(itemModel.getModel("itemStyle"), layout2, true), layout2);
          if (isNaN(sectorShape.startAngle)) {
            sector.setShape(sectorShape);
            return;
          }
          if (firstCreate) {
            sector.setShape(sectorShape);
            var animationType = seriesModel.getShallow("animationType");
            if (seriesModel.ecModel.ssr) {
              initProps(sector, {
                scaleX: 0,
                scaleY: 0
              }, seriesModel, {
                dataIndex: idx,
                isFrom: true
              });
              sector.originX = sectorShape.cx;
              sector.originY = sectorShape.cy;
            } else if (animationType === "scale") {
              sector.shape.r = layout2.r0;
              initProps(sector, {
                shape: {
                  r: layout2.r
                }
              }, seriesModel, idx);
            } else {
              if (startAngle != null) {
                sector.setShape({
                  startAngle,
                  endAngle: startAngle
                });
                initProps(sector, {
                  shape: {
                    startAngle: layout2.startAngle,
                    endAngle: layout2.endAngle
                  }
                }, seriesModel, idx);
              } else {
                sector.shape.endAngle = layout2.startAngle;
                updateProps$1(sector, {
                  shape: {
                    endAngle: layout2.endAngle
                  }
                }, seriesModel, idx);
              }
            }
          } else {
            saveOldStyle(sector);
            updateProps$1(sector, {
              shape: sectorShape
            }, seriesModel, idx);
          }
          sector.useStyle(data.getItemVisual(idx, "style"));
          setStatesStylesFromModel(sector, itemModel);
          var midAngle = (layout2.startAngle + layout2.endAngle) / 2;
          var offset2 = seriesModel.get("selectedOffset");
          var dx = Math.cos(midAngle) * offset2;
          var dy = Math.sin(midAngle) * offset2;
          var cursorStyle = itemModel.getShallow("cursor");
          cursorStyle && sector.attr("cursor", cursorStyle);
          this._updateLabel(seriesModel, data, idx);
          sector.ensureState("emphasis").shape = extend$1({
            r: layout2.r + (emphasisModel.get("scale") ? emphasisModel.get("scaleSize") || 0 : 0)
          }, getSectorCornerRadius(emphasisModel.getModel("itemStyle"), layout2));
          extend$1(sector.ensureState("select"), {
            x: dx,
            y: dy,
            shape: getSectorCornerRadius(itemModel.getModel(["select", "itemStyle"]), layout2)
          });
          extend$1(sector.ensureState("blur"), {
            shape: getSectorCornerRadius(itemModel.getModel(["blur", "itemStyle"]), layout2)
          });
          var labelLine = sector.getTextGuideLine();
          var labelText = sector.getTextContent();
          labelLine && extend$1(labelLine.ensureState("select"), {
            x: dx,
            y: dy
          });
          extend$1(labelText.ensureState("select"), {
            x: dx,
            y: dy
          });
          toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
        };
        PiePiece2.prototype._updateLabel = function(seriesModel, data, idx) {
          var sector = this;
          var itemModel = data.getItemModel(idx);
          var labelLineModel = itemModel.getModel("labelLine");
          var style = data.getItemVisual(idx, "style");
          var visualColor = style && style.fill;
          var visualOpacity = style && style.opacity;
          setLabelStyle(sector, getLabelStatesModels(itemModel), {
            labelFetcher: data.hostModel,
            labelDataIndex: idx,
            inheritColor: visualColor,
            defaultOpacity: visualOpacity,
            defaultText: seriesModel.getFormattedLabel(idx, "normal") || data.getName(idx)
          });
          var labelText = sector.getTextContent();
          sector.setTextConfig({
            // reset position, rotation
            position: null,
            rotation: null
          });
          labelText.attr({
            z2: 10
          });
          var labelPosition = seriesModel.get(["label", "position"]);
          if (labelPosition !== "outside" && labelPosition !== "outer") {
            sector.removeTextGuideLine();
          } else {
            var polyline = this.getTextGuideLine();
            if (!polyline) {
              polyline = new Polyline$1();
              this.setTextGuideLine(polyline);
            }
            setLabelLineStyle(this, getLabelLineStatesModels(itemModel), {
              stroke: visualColor,
              opacity: retrieve3(labelLineModel.get(["lineStyle", "opacity"]), visualOpacity, 1)
            });
          }
        };
        return PiePiece2;
      }(Sector)
    );
    var PieView = (
      /** @class */
      function(_super) {
        __extends$1(PieView2, _super);
        function PieView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.ignoreLabelLineUpdate = true;
          return _this;
        }
        PieView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
          var data = seriesModel.getData();
          var oldData = this._data;
          var group = this.group;
          var startAngle;
          if (!oldData && data.count() > 0) {
            var shape = data.getItemLayout(0);
            for (var s2 = 1; isNaN(shape && shape.startAngle) && s2 < data.count(); ++s2) {
              shape = data.getItemLayout(s2);
            }
            if (shape) {
              startAngle = shape.startAngle;
            }
          }
          if (this._emptyCircleSector) {
            group.remove(this._emptyCircleSector);
          }
          if (data.count() === 0 && seriesModel.get("showEmptyCircle")) {
            var layoutData = getSeriesLayoutData(seriesModel);
            var sector = new Sector({
              shape: extend$1(getBasicPieLayout(seriesModel, api2), layoutData)
            });
            sector.useStyle(seriesModel.getModel("emptyCircleStyle").getItemStyle());
            this._emptyCircleSector = sector;
            group.add(sector);
          }
          data.diff(oldData).add(function(idx) {
            var piePiece = new PiePiece(data, idx, startAngle);
            data.setItemGraphicEl(idx, piePiece);
            group.add(piePiece);
          }).update(function(newIdx, oldIdx) {
            var piePiece = oldData.getItemGraphicEl(oldIdx);
            piePiece.updateData(data, newIdx, startAngle);
            piePiece.off("click");
            group.add(piePiece);
            data.setItemGraphicEl(newIdx, piePiece);
          }).remove(function(idx) {
            var piePiece = oldData.getItemGraphicEl(idx);
            removeElementWithFadeOut(piePiece, seriesModel, idx);
          }).execute();
          pieLabelLayout(seriesModel);
          if (seriesModel.get("animationTypeUpdate") !== "expansion") {
            this._data = data;
          }
        };
        PieView2.prototype.dispose = function() {
        };
        PieView2.prototype.containPoint = function(point, seriesModel) {
          var data = seriesModel.getData();
          var itemLayout = data.getItemLayout(0);
          if (itemLayout) {
            var dx = point[0] - itemLayout.cx;
            var dy = point[1] - itemLayout.cy;
            var radius = Math.sqrt(dx * dx + dy * dy);
            return radius <= itemLayout.r && radius >= itemLayout.r0;
          }
        };
        PieView2.type = "pie";
        return PieView2;
      }(ChartView)
    );
    function createSeriesDataSimply(seriesModel, opt, nameList) {
      opt = isArray$2(opt) && {
        coordDimensions: opt
      } || extend$1({
        encodeDefine: seriesModel.getEncode()
      }, opt);
      var source = seriesModel.getSource();
      var dimensions = prepareSeriesDataSchema(source, opt).dimensions;
      var list = new SeriesData(dimensions, seriesModel);
      list.initData(source, nameList);
      return list;
    }
    var LegendVisualProvider = (
      /** @class */
      function() {
        function LegendVisualProvider2(getDataWithEncodedVisual, getRawData2) {
          this._getDataWithEncodedVisual = getDataWithEncodedVisual;
          this._getRawData = getRawData2;
        }
        LegendVisualProvider2.prototype.getAllNames = function() {
          var rawData = this._getRawData();
          return rawData.mapArray(rawData.getName);
        };
        LegendVisualProvider2.prototype.containName = function(name) {
          var rawData = this._getRawData();
          return rawData.indexOfName(name) >= 0;
        };
        LegendVisualProvider2.prototype.indexOfName = function(name) {
          var dataWithEncodedVisual = this._getDataWithEncodedVisual();
          return dataWithEncodedVisual.indexOfName(name);
        };
        LegendVisualProvider2.prototype.getItemVisual = function(dataIndex, key) {
          var dataWithEncodedVisual = this._getDataWithEncodedVisual();
          return dataWithEncodedVisual.getItemVisual(dataIndex, key);
        };
        return LegendVisualProvider2;
      }()
    );
    var innerData = makeInner();
    var PieSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(PieSeriesModel2, _super);
        function PieSeriesModel2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        PieSeriesModel2.prototype.init = function(option) {
          _super.prototype.init.apply(this, arguments);
          this.legendVisualProvider = new LegendVisualProvider(bind$2(this.getData, this), bind$2(this.getRawData, this));
          this._defaultLabelLine(option);
        };
        PieSeriesModel2.prototype.mergeOption = function() {
          _super.prototype.mergeOption.apply(this, arguments);
        };
        PieSeriesModel2.prototype.getInitialData = function() {
          return createSeriesDataSimply(this, {
            coordDimensions: ["value"],
            encodeDefaulter: curry$1(makeSeriesEncodeForNameBased, this)
          });
        };
        PieSeriesModel2.prototype.getDataParams = function(dataIndex) {
          var data = this.getData();
          var dataInner = innerData(data);
          var seats = dataInner.seats;
          if (!seats) {
            var valueList_1 = [];
            data.each(data.mapDimension("value"), function(value) {
              valueList_1.push(value);
            });
            seats = dataInner.seats = getPercentSeats(valueList_1, data.hostModel.get("percentPrecision"));
          }
          var params = _super.prototype.getDataParams.call(this, dataIndex);
          params.percent = seats[dataIndex] || 0;
          params.$vars.push("percent");
          return params;
        };
        PieSeriesModel2.prototype._defaultLabelLine = function(option) {
          defaultEmphasis(option, "labelLine", ["show"]);
          var labelLineNormalOpt = option.labelLine;
          var labelLineEmphasisOpt = option.emphasis.labelLine;
          labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;
          labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;
        };
        PieSeriesModel2.type = "series.pie";
        PieSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          legendHoverLink: true,
          colorBy: "data",
          // 默认全局居中
          center: ["50%", "50%"],
          radius: [0, "75%"],
          // 默认顺时针
          clockwise: true,
          startAngle: 90,
          endAngle: "auto",
          padAngle: 0,
          // 最小角度改为0
          minAngle: 0,
          // If the angle of a sector less than `minShowLabelAngle`,
          // the label will not be displayed.
          minShowLabelAngle: 0,
          // 选中时扇区偏移量
          selectedOffset: 10,
          // 选择模式，默认关闭，可选single，multiple
          // selectedMode: false,
          // 南丁格尔玫瑰图模式，'radius'（半径） | 'area'（面积）
          // roseType: null,
          percentPrecision: 2,
          // If still show when all data zero.
          stillShowZeroSum: true,
          // cursor: null,
          left: 0,
          top: 0,
          right: 0,
          bottom: 0,
          width: null,
          height: null,
          label: {
            // color: 'inherit',
            // If rotate around circle
            rotate: 0,
            show: true,
            overflow: "truncate",
            // 'outer', 'inside', 'center'
            position: "outer",
            // 'none', 'labelLine', 'edge'. Works only when position is 'outer'
            alignTo: "none",
            // Closest distance between label and chart edge.
            // Works only position is 'outer' and alignTo is 'edge'.
            edgeDistance: "25%",
            // Works only position is 'outer' and alignTo is not 'edge'.
            bleedMargin: 10,
            // Distance between text and label line.
            distanceToLabelLine: 5
            // formatter: 标签文本格式器，同 tooltip.formatter，不支持异步回调
            // 默认使用全局文本样式，详见 textStyle
            // distance: 当position为inner时有效，为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
          },
          // Enabled when label.normal.position is 'outer'
          labelLine: {
            show: true,
            // 引导线两段中的第一段长度
            length: 15,
            // 引导线两段中的第二段长度
            length2: 15,
            smooth: false,
            minTurnAngle: 90,
            maxSurfaceAngle: 90,
            lineStyle: {
              // color: 各异,
              width: 1,
              type: "solid"
            }
          },
          itemStyle: {
            borderWidth: 1,
            borderJoin: "round"
          },
          showEmptyCircle: true,
          emptyCircleStyle: {
            color: "lightgray",
            opacity: 1
          },
          labelLayout: {
            // Hide the overlapped label.
            hideOverlap: true
          },
          emphasis: {
            scale: true,
            scaleSize: 5
          },
          // If use strategy to avoid label overlapping
          avoidLabelOverlap: true,
          // Animation type. Valid values: expansion, scale
          animationType: "expansion",
          animationDuration: 1e3,
          // Animation type when update. Valid values: transition, expansion
          animationTypeUpdate: "transition",
          animationEasingUpdate: "cubicInOut",
          animationDurationUpdate: 500,
          animationEasing: "cubicInOut"
        };
        return PieSeriesModel2;
      }(SeriesModel)
    );
    function negativeDataFilter(seriesType2) {
      return {
        seriesType: seriesType2,
        reset: function(seriesModel, ecModel) {
          var data = seriesModel.getData();
          data.filterSelf(function(idx) {
            var valueDim = data.mapDimension("value");
            var curValue = data.get(valueDim, idx);
            if (isNumber$1(curValue) && !isNaN(curValue) && curValue < 0) {
              return false;
            }
            return true;
          });
        }
      };
    }
    function install$O(registers) {
      registers.registerChartView(PieView);
      registers.registerSeriesModel(PieSeriesModel);
      createLegacyDataSelectAction("pie", registers.registerAction);
      registers.registerLayout(curry$1(pieLayout, "pie"));
      registers.registerProcessor(dataFilter$1("pie"));
      registers.registerProcessor(negativeDataFilter("pie"));
    }
    var ScatterSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(ScatterSeriesModel2, _super);
        function ScatterSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ScatterSeriesModel2.type;
          _this.hasSymbolVisual = true;
          return _this;
        }
        ScatterSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this, {
            useEncodeDefaulter: true
          });
        };
        ScatterSeriesModel2.prototype.getProgressive = function() {
          var progressive = this.option.progressive;
          if (progressive == null) {
            return this.option.large ? 5e3 : this.get("progressive");
          }
          return progressive;
        };
        ScatterSeriesModel2.prototype.getProgressiveThreshold = function() {
          var progressiveThreshold = this.option.progressiveThreshold;
          if (progressiveThreshold == null) {
            return this.option.large ? 1e4 : this.get("progressiveThreshold");
          }
          return progressiveThreshold;
        };
        ScatterSeriesModel2.prototype.brushSelector = function(dataIndex, data, selectors) {
          return selectors.point(data.getItemLayout(dataIndex));
        };
        ScatterSeriesModel2.prototype.getZLevelKey = function() {
          return this.getData().count() > this.getProgressiveThreshold() ? this.id : "";
        };
        ScatterSeriesModel2.type = "series.scatter";
        ScatterSeriesModel2.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"];
        ScatterSeriesModel2.defaultOption = {
          coordinateSystem: "cartesian2d",
          // zlevel: 0,
          z: 2,
          legendHoverLink: true,
          symbolSize: 10,
          // symbolRotate: null,  // 图形旋转控制
          large: false,
          // Available when large is true
          largeThreshold: 2e3,
          // cursor: null,
          itemStyle: {
            opacity: 0.8
            // color: 各异
          },
          emphasis: {
            scale: true
          },
          // If clip the overflow graphics
          // Works on cartesian / polar series
          clip: true,
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          },
          universalTransition: {
            divideShape: "clone"
          }
          // progressive: null
        };
        return ScatterSeriesModel2;
      }(SeriesModel)
    );
    var BOOST_SIZE_THRESHOLD = 4;
    var LargeSymbolPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function LargeSymbolPathShape2() {
        }
        return LargeSymbolPathShape2;
      }()
    );
    var LargeSymbolPath = (
      /** @class */
      function(_super) {
        __extends$1(LargeSymbolPath2, _super);
        function LargeSymbolPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this._off = 0;
          _this.hoverDataIdx = -1;
          return _this;
        }
        LargeSymbolPath2.prototype.getDefaultShape = function() {
          return new LargeSymbolPathShape();
        };
        LargeSymbolPath2.prototype.reset = function() {
          this.notClear = false;
          this._off = 0;
        };
        LargeSymbolPath2.prototype.buildPath = function(path, shape) {
          var points2 = shape.points;
          var size = shape.size;
          var symbolProxy = this.symbolProxy;
          var symbolProxyShape = symbolProxy.shape;
          var ctx = path.getContext ? path.getContext() : path;
          var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD;
          var softClipShape = this.softClipShape;
          var i2;
          if (canBoost) {
            this._ctx = ctx;
            return;
          }
          this._ctx = null;
          for (i2 = this._off; i2 < points2.length; ) {
            var x2 = points2[i2++];
            var y = points2[i2++];
            if (isNaN(x2) || isNaN(y)) {
              continue;
            }
            if (softClipShape && !softClipShape.contain(x2, y)) {
              continue;
            }
            symbolProxyShape.x = x2 - size[0] / 2;
            symbolProxyShape.y = y - size[1] / 2;
            symbolProxyShape.width = size[0];
            symbolProxyShape.height = size[1];
            symbolProxy.buildPath(path, symbolProxyShape, true);
          }
          if (this.incremental) {
            this._off = i2;
            this.notClear = true;
          }
        };
        LargeSymbolPath2.prototype.afterBrush = function() {
          var shape = this.shape;
          var points2 = shape.points;
          var size = shape.size;
          var ctx = this._ctx;
          var softClipShape = this.softClipShape;
          var i2;
          if (!ctx) {
            return;
          }
          for (i2 = this._off; i2 < points2.length; ) {
            var x2 = points2[i2++];
            var y = points2[i2++];
            if (isNaN(x2) || isNaN(y)) {
              continue;
            }
            if (softClipShape && !softClipShape.contain(x2, y)) {
              continue;
            }
            ctx.fillRect(x2 - size[0] / 2, y - size[1] / 2, size[0], size[1]);
          }
          if (this.incremental) {
            this._off = i2;
            this.notClear = true;
          }
        };
        LargeSymbolPath2.prototype.findDataIndex = function(x2, y) {
          var shape = this.shape;
          var points2 = shape.points;
          var size = shape.size;
          var w2 = Math.max(size[0], 4);
          var h2 = Math.max(size[1], 4);
          for (var idx = points2.length / 2 - 1; idx >= 0; idx--) {
            var i2 = idx * 2;
            var x0 = points2[i2] - w2 / 2;
            var y0 = points2[i2 + 1] - h2 / 2;
            if (x2 >= x0 && y >= y0 && x2 <= x0 + w2 && y <= y0 + h2) {
              return idx;
            }
          }
          return -1;
        };
        LargeSymbolPath2.prototype.contain = function(x2, y) {
          var localPos = this.transformCoordToLocal(x2, y);
          var rect = this.getBoundingRect();
          x2 = localPos[0];
          y = localPos[1];
          if (rect.contain(x2, y)) {
            var dataIdx = this.hoverDataIdx = this.findDataIndex(x2, y);
            return dataIdx >= 0;
          }
          this.hoverDataIdx = -1;
          return false;
        };
        LargeSymbolPath2.prototype.getBoundingRect = function() {
          var rect = this._rect;
          if (!rect) {
            var shape = this.shape;
            var points2 = shape.points;
            var size = shape.size;
            var w2 = size[0];
            var h2 = size[1];
            var minX = Infinity;
            var minY = Infinity;
            var maxX = -Infinity;
            var maxY = -Infinity;
            for (var i2 = 0; i2 < points2.length; ) {
              var x2 = points2[i2++];
              var y = points2[i2++];
              minX = Math.min(x2, minX);
              maxX = Math.max(x2, maxX);
              minY = Math.min(y, minY);
              maxY = Math.max(y, maxY);
            }
            rect = this._rect = new BoundingRect(minX - w2 / 2, minY - h2 / 2, maxX - minX + w2, maxY - minY + h2);
          }
          return rect;
        };
        return LargeSymbolPath2;
      }(Path)
    );
    var LargeSymbolDraw = (
      /** @class */
      function() {
        function LargeSymbolDraw2() {
          this.group = new Group$3();
        }
        LargeSymbolDraw2.prototype.updateData = function(data, opt) {
          this._clear();
          var symbolEl = this._create();
          symbolEl.setShape({
            points: data.getLayout("points")
          });
          this._setCommon(symbolEl, data, opt);
        };
        LargeSymbolDraw2.prototype.updateLayout = function(data) {
          var points2 = data.getLayout("points");
          this.group.eachChild(function(child) {
            if (child.startIndex != null) {
              var len2 = (child.endIndex - child.startIndex) * 2;
              var byteOffset = child.startIndex * 4 * 2;
              points2 = new Float32Array(points2.buffer, byteOffset, len2);
            }
            child.setShape("points", points2);
            child.reset();
          });
        };
        LargeSymbolDraw2.prototype.incrementalPrepareUpdate = function(data) {
          this._clear();
        };
        LargeSymbolDraw2.prototype.incrementalUpdate = function(taskParams, data, opt) {
          var lastAdded = this._newAdded[0];
          var points2 = data.getLayout("points");
          var oldPoints = lastAdded && lastAdded.shape.points;
          if (oldPoints && oldPoints.length < 2e4) {
            var oldLen = oldPoints.length;
            var newPoints = new Float32Array(oldLen + points2.length);
            newPoints.set(oldPoints);
            newPoints.set(points2, oldLen);
            lastAdded.endIndex = taskParams.end;
            lastAdded.setShape({
              points: newPoints
            });
          } else {
            this._newAdded = [];
            var symbolEl = this._create();
            symbolEl.startIndex = taskParams.start;
            symbolEl.endIndex = taskParams.end;
            symbolEl.incremental = true;
            symbolEl.setShape({
              points: points2
            });
            this._setCommon(symbolEl, data, opt);
          }
        };
        LargeSymbolDraw2.prototype.eachRendered = function(cb) {
          this._newAdded[0] && cb(this._newAdded[0]);
        };
        LargeSymbolDraw2.prototype._create = function() {
          var symbolEl = new LargeSymbolPath({
            cursor: "default"
          });
          symbolEl.ignoreCoarsePointer = true;
          this.group.add(symbolEl);
          this._newAdded.push(symbolEl);
          return symbolEl;
        };
        LargeSymbolDraw2.prototype._setCommon = function(symbolEl, data, opt) {
          var hostModel = data.hostModel;
          opt = opt || {};
          var size = data.getVisual("symbolSize");
          symbolEl.setShape("size", size instanceof Array ? size : [size, size]);
          symbolEl.softClipShape = opt.clipShape || null;
          symbolEl.symbolProxy = createSymbol$1(data.getVisual("symbol"), 0, 0, 0, 0);
          symbolEl.setColor = symbolEl.symbolProxy.setColor;
          var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD;
          symbolEl.useStyle(
            // Draw shadow when doing fillRect is extremely slow.
            hostModel.getModel("itemStyle").getItemStyle(extrudeShadow ? ["color", "shadowBlur", "shadowColor"] : ["color"])
          );
          var globalStyle = data.getVisual("style");
          var visualColor = globalStyle && globalStyle.fill;
          if (visualColor) {
            symbolEl.setColor(visualColor);
          }
          var ecData = getECData(symbolEl);
          ecData.seriesIndex = hostModel.seriesIndex;
          symbolEl.on("mousemove", function(e2) {
            ecData.dataIndex = null;
            var dataIndex = symbolEl.hoverDataIdx;
            if (dataIndex >= 0) {
              ecData.dataIndex = dataIndex + (symbolEl.startIndex || 0);
            }
          });
        };
        LargeSymbolDraw2.prototype.remove = function() {
          this._clear();
        };
        LargeSymbolDraw2.prototype._clear = function() {
          this._newAdded = [];
          this.group.removeAll();
        };
        return LargeSymbolDraw2;
      }()
    );
    var ScatterView = (
      /** @class */
      function(_super) {
        __extends$1(ScatterView2, _super);
        function ScatterView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ScatterView2.type;
          return _this;
        }
        ScatterView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var symbolDraw = this._updateSymbolDraw(data, seriesModel);
          symbolDraw.updateData(data, {
            // TODO
            // If this parameter should be a shape or a bounding volume
            // shape will be more general.
            // But bounding volume like bounding rect will be much faster in the contain calculation
            clipShape: this._getClipShape(seriesModel)
          });
          this._finished = true;
        };
        ScatterView2.prototype.incrementalPrepareRender = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var symbolDraw = this._updateSymbolDraw(data, seriesModel);
          symbolDraw.incrementalPrepareUpdate(data);
          this._finished = false;
        };
        ScatterView2.prototype.incrementalRender = function(taskParams, seriesModel, ecModel) {
          this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData(), {
            clipShape: this._getClipShape(seriesModel)
          });
          this._finished = taskParams.end === seriesModel.getData().count();
        };
        ScatterView2.prototype.updateTransform = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          this.group.dirty();
          if (!this._finished || data.count() > 1e4) {
            return {
              update: true
            };
          } else {
            var res = pointsLayout("").reset(seriesModel, ecModel, api2);
            if (res.progress) {
              res.progress({
                start: 0,
                end: data.count(),
                count: data.count()
              }, data);
            }
            this._symbolDraw.updateLayout(data);
          }
        };
        ScatterView2.prototype.eachRendered = function(cb) {
          this._symbolDraw && this._symbolDraw.eachRendered(cb);
        };
        ScatterView2.prototype._getClipShape = function(seriesModel) {
          if (!seriesModel.get("clip", true)) {
            return;
          }
          var coordSys = seriesModel.coordinateSystem;
          return coordSys && coordSys.getArea && coordSys.getArea(0.1);
        };
        ScatterView2.prototype._updateSymbolDraw = function(data, seriesModel) {
          var symbolDraw = this._symbolDraw;
          var pipelineContext = seriesModel.pipelineContext;
          var isLargeDraw = pipelineContext.large;
          if (!symbolDraw || isLargeDraw !== this._isLargeDraw) {
            symbolDraw && symbolDraw.remove();
            symbolDraw = this._symbolDraw = isLargeDraw ? new LargeSymbolDraw() : new SymbolDraw();
            this._isLargeDraw = isLargeDraw;
            this.group.removeAll();
          }
          this.group.add(symbolDraw.group);
          return symbolDraw;
        };
        ScatterView2.prototype.remove = function(ecModel, api2) {
          this._symbolDraw && this._symbolDraw.remove(true);
          this._symbolDraw = null;
        };
        ScatterView2.prototype.dispose = function() {
        };
        ScatterView2.type = "scatter";
        return ScatterView2;
      }(ChartView)
    );
    var GridModel = (
      /** @class */
      function(_super) {
        __extends$1(GridModel2, _super);
        function GridModel2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        GridModel2.type = "grid";
        GridModel2.dependencies = ["xAxis", "yAxis"];
        GridModel2.layoutMode = "box";
        GridModel2.defaultOption = {
          show: false,
          // zlevel: 0,
          z: 0,
          left: "10%",
          top: 60,
          right: "10%",
          bottom: 70,
          // If grid size contain label
          containLabel: false,
          // width: {totalWidth} - left - right,
          // height: {totalHeight} - top - bottom,
          backgroundColor: "rgba(0,0,0,0)",
          borderWidth: 1,
          borderColor: "#ccc"
        };
        return GridModel2;
      }(ComponentModel)
    );
    var CartesianAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(CartesianAxisModel2, _super);
        function CartesianAxisModel2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        CartesianAxisModel2.prototype.getCoordSysModel = function() {
          return this.getReferringComponents("grid", SINGLE_REFERRING).models[0];
        };
        CartesianAxisModel2.type = "cartesian2dAxis";
        return CartesianAxisModel2;
      }(ComponentModel)
    );
    mixin(CartesianAxisModel, AxisModelCommonMixin);
    var defaultOption$1 = {
      show: true,
      // zlevel: 0,
      z: 0,
      // Inverse the axis.
      inverse: false,
      // Axis name displayed.
      name: "",
      // 'start' | 'middle' | 'end'
      nameLocation: "end",
      // By degree. By default auto rotate by nameLocation.
      nameRotate: null,
      nameTruncate: {
        maxWidth: null,
        ellipsis: "...",
        placeholder: "."
      },
      // Use global text style by default.
      nameTextStyle: {},
      // The gap between axisName and axisLine.
      nameGap: 15,
      // Default `false` to support tooltip.
      silent: false,
      // Default `false` to avoid legacy user event listener fail.
      triggerEvent: false,
      tooltip: {
        show: false
      },
      axisPointer: {},
      axisLine: {
        show: true,
        onZero: true,
        onZeroAxisIndex: null,
        lineStyle: {
          color: "#6E7079",
          width: 1,
          type: "solid"
        },
        // The arrow at both ends the the axis.
        symbol: ["none", "none"],
        symbolSize: [10, 15]
      },
      axisTick: {
        show: true,
        // Whether axisTick is inside the grid or outside the grid.
        inside: false,
        // The length of axisTick.
        length: 5,
        lineStyle: {
          width: 1
        }
      },
      axisLabel: {
        show: true,
        // Whether axisLabel is inside the grid or outside the grid.
        inside: false,
        rotate: 0,
        // true | false | null/undefined (auto)
        showMinLabel: null,
        // true | false | null/undefined (auto)
        showMaxLabel: null,
        margin: 8,
        // formatter: null,
        fontSize: 12
      },
      splitLine: {
        show: true,
        showMinLine: true,
        showMaxLine: true,
        lineStyle: {
          color: ["#E0E6F1"],
          width: 1,
          type: "solid"
        }
      },
      splitArea: {
        show: false,
        areaStyle: {
          color: ["rgba(250,250,250,0.2)", "rgba(210,219,238,0.2)"]
        }
      }
    };
    var categoryAxis = merge$1({
      // The gap at both ends of the axis. For categoryAxis, boolean.
      boundaryGap: true,
      // Set false to faster category collection.
      deduplication: null,
      // splitArea: {
      // show: false
      // },
      splitLine: {
        show: false
      },
      axisTick: {
        // If tick is align with label when boundaryGap is true
        alignWithLabel: false,
        interval: "auto"
      },
      axisLabel: {
        interval: "auto"
      }
    }, defaultOption$1);
    var valueAxis = merge$1({
      boundaryGap: [0, 0],
      axisLine: {
        // Not shown when other axis is categoryAxis in cartesian
        show: "auto"
      },
      axisTick: {
        // Not shown when other axis is categoryAxis in cartesian
        show: "auto"
      },
      // TODO
      // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]
      splitNumber: 5,
      minorTick: {
        // Minor tick, not available for cateogry axis.
        show: false,
        // Split number of minor ticks. The value should be in range of (0, 100)
        splitNumber: 5,
        // Length of minor tick
        length: 3,
        // Line style
        lineStyle: {
          // Default to be same with axisTick
        }
      },
      minorSplitLine: {
        show: false,
        lineStyle: {
          color: "#F4F7FD",
          width: 1
        }
      }
    }, defaultOption$1);
    var timeAxis = merge$1({
      splitNumber: 6,
      axisLabel: {
        // To eliminate labels that are not nice
        showMinLabel: false,
        showMaxLabel: false,
        rich: {
          primary: {
            fontWeight: "bold"
          }
        }
      },
      splitLine: {
        show: false
      }
    }, valueAxis);
    var logAxis = defaults$1({
      logBase: 10
    }, valueAxis);
    const axisDefault = {
      category: categoryAxis,
      value: valueAxis,
      time: timeAxis,
      log: logAxis
    };
    var AXIS_TYPES = {
      value: 1,
      category: 1,
      time: 1,
      log: 1
    };
    function axisModelCreator(registers, axisName, BaseAxisModelClass, extraDefaultOption) {
      each$f(AXIS_TYPES, function(v4, axisType) {
        var defaultOption2 = merge$1(merge$1({}, axisDefault[axisType], true), extraDefaultOption, true);
        var AxisModel = (
          /** @class */
          function(_super) {
            __extends$1(AxisModel2, _super);
            function AxisModel2() {
              var _this = _super !== null && _super.apply(this, arguments) || this;
              _this.type = axisName + "Axis." + axisType;
              return _this;
            }
            AxisModel2.prototype.mergeDefaultAndTheme = function(option, ecModel) {
              var layoutMode = fetchLayoutMode(this);
              var inputPositionParams = layoutMode ? getLayoutParams(option) : {};
              var themeModel = ecModel.getTheme();
              merge$1(option, themeModel.get(axisType + "Axis"));
              merge$1(option, this.getDefaultOption());
              option.type = getAxisType(option);
              if (layoutMode) {
                mergeLayoutParam(option, inputPositionParams, layoutMode);
              }
            };
            AxisModel2.prototype.optionUpdated = function() {
              var thisOption = this.option;
              if (thisOption.type === "category") {
                this.__ordinalMeta = OrdinalMeta.createByAxisModel(this);
              }
            };
            AxisModel2.prototype.getCategories = function(rawData) {
              var option = this.option;
              if (option.type === "category") {
                if (rawData) {
                  return option.data;
                }
                return this.__ordinalMeta.categories;
              }
            };
            AxisModel2.prototype.getOrdinalMeta = function() {
              return this.__ordinalMeta;
            };
            AxisModel2.type = axisName + "Axis." + axisType;
            AxisModel2.defaultOption = defaultOption2;
            return AxisModel2;
          }(BaseAxisModelClass)
        );
        registers.registerComponentModel(AxisModel);
      });
      registers.registerSubTypeDefaulter(axisName + "Axis", getAxisType);
    }
    function getAxisType(option) {
      return option.type || (option.data ? "category" : "value");
    }
    var Cartesian = (
      /** @class */
      function() {
        function Cartesian2(name) {
          this.type = "cartesian";
          this._dimList = [];
          this._axes = {};
          this.name = name || "";
        }
        Cartesian2.prototype.getAxis = function(dim) {
          return this._axes[dim];
        };
        Cartesian2.prototype.getAxes = function() {
          return map$1(this._dimList, function(dim) {
            return this._axes[dim];
          }, this);
        };
        Cartesian2.prototype.getAxesByScale = function(scaleType) {
          scaleType = scaleType.toLowerCase();
          return filter(this.getAxes(), function(axis) {
            return axis.scale.type === scaleType;
          });
        };
        Cartesian2.prototype.addAxis = function(axis) {
          var dim = axis.dim;
          this._axes[dim] = axis;
          this._dimList.push(dim);
        };
        return Cartesian2;
      }()
    );
    var cartesian2DDimensions = ["x", "y"];
    function canCalculateAffineTransform(scale2) {
      return scale2.type === "interval" || scale2.type === "time";
    }
    var Cartesian2D = (
      /** @class */
      function(_super) {
        __extends$1(Cartesian2D2, _super);
        function Cartesian2D2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "cartesian2d";
          _this.dimensions = cartesian2DDimensions;
          return _this;
        }
        Cartesian2D2.prototype.calcAffineTransform = function() {
          this._transform = this._invTransform = null;
          var xAxisScale = this.getAxis("x").scale;
          var yAxisScale = this.getAxis("y").scale;
          if (!canCalculateAffineTransform(xAxisScale) || !canCalculateAffineTransform(yAxisScale)) {
            return;
          }
          var xScaleExtent = xAxisScale.getExtent();
          var yScaleExtent = yAxisScale.getExtent();
          var start2 = this.dataToPoint([xScaleExtent[0], yScaleExtent[0]]);
          var end2 = this.dataToPoint([xScaleExtent[1], yScaleExtent[1]]);
          var xScaleSpan = xScaleExtent[1] - xScaleExtent[0];
          var yScaleSpan = yScaleExtent[1] - yScaleExtent[0];
          if (!xScaleSpan || !yScaleSpan) {
            return;
          }
          var scaleX = (end2[0] - start2[0]) / xScaleSpan;
          var scaleY = (end2[1] - start2[1]) / yScaleSpan;
          var translateX = start2[0] - xScaleExtent[0] * scaleX;
          var translateY = start2[1] - yScaleExtent[0] * scaleY;
          var m2 = this._transform = [scaleX, 0, 0, scaleY, translateX, translateY];
          this._invTransform = invert([], m2);
        };
        Cartesian2D2.prototype.getBaseAxis = function() {
          return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x");
        };
        Cartesian2D2.prototype.containPoint = function(point) {
          var axisX = this.getAxis("x");
          var axisY = this.getAxis("y");
          return axisX.contain(axisX.toLocalCoord(point[0])) && axisY.contain(axisY.toLocalCoord(point[1]));
        };
        Cartesian2D2.prototype.containData = function(data) {
          return this.getAxis("x").containData(data[0]) && this.getAxis("y").containData(data[1]);
        };
        Cartesian2D2.prototype.containZone = function(data1, data2) {
          var zoneDiag1 = this.dataToPoint(data1);
          var zoneDiag2 = this.dataToPoint(data2);
          var area = this.getArea();
          var zone = new BoundingRect(zoneDiag1[0], zoneDiag1[1], zoneDiag2[0] - zoneDiag1[0], zoneDiag2[1] - zoneDiag1[1]);
          return area.intersect(zone);
        };
        Cartesian2D2.prototype.dataToPoint = function(data, clamp2, out2) {
          out2 = out2 || [];
          var xVal = data[0];
          var yVal = data[1];
          if (this._transform && xVal != null && isFinite(xVal) && yVal != null && isFinite(yVal)) {
            return applyTransform$1(out2, data, this._transform);
          }
          var xAxis = this.getAxis("x");
          var yAxis = this.getAxis("y");
          out2[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(xVal, clamp2));
          out2[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(yVal, clamp2));
          return out2;
        };
        Cartesian2D2.prototype.clampData = function(data, out2) {
          var xScale = this.getAxis("x").scale;
          var yScale = this.getAxis("y").scale;
          var xAxisExtent = xScale.getExtent();
          var yAxisExtent = yScale.getExtent();
          var x2 = xScale.parse(data[0]);
          var y = yScale.parse(data[1]);
          out2 = out2 || [];
          out2[0] = Math.min(Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x2), Math.max(xAxisExtent[0], xAxisExtent[1]));
          out2[1] = Math.min(Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), Math.max(yAxisExtent[0], yAxisExtent[1]));
          return out2;
        };
        Cartesian2D2.prototype.pointToData = function(point, clamp2) {
          var out2 = [];
          if (this._invTransform) {
            return applyTransform$1(out2, point, this._invTransform);
          }
          var xAxis = this.getAxis("x");
          var yAxis = this.getAxis("y");
          out2[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp2);
          out2[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp2);
          return out2;
        };
        Cartesian2D2.prototype.getOtherAxis = function(axis) {
          return this.getAxis(axis.dim === "x" ? "y" : "x");
        };
        Cartesian2D2.prototype.getArea = function(tolerance) {
          tolerance = tolerance || 0;
          var xExtent = this.getAxis("x").getGlobalExtent();
          var yExtent = this.getAxis("y").getGlobalExtent();
          var x2 = Math.min(xExtent[0], xExtent[1]) - tolerance;
          var y = Math.min(yExtent[0], yExtent[1]) - tolerance;
          var width = Math.max(xExtent[0], xExtent[1]) - x2 + tolerance;
          var height = Math.max(yExtent[0], yExtent[1]) - y + tolerance;
          return new BoundingRect(x2, y, width, height);
        };
        return Cartesian2D2;
      }(Cartesian)
    );
    var Axis2D = (
      /** @class */
      function(_super) {
        __extends$1(Axis2D2, _super);
        function Axis2D2(dim, scale2, coordExtent, axisType, position2) {
          var _this = _super.call(this, dim, scale2, coordExtent) || this;
          _this.index = 0;
          _this.type = axisType || "value";
          _this.position = position2 || "bottom";
          return _this;
        }
        Axis2D2.prototype.isHorizontal = function() {
          var position2 = this.position;
          return position2 === "top" || position2 === "bottom";
        };
        Axis2D2.prototype.getGlobalExtent = function(asc2) {
          var ret = this.getExtent();
          ret[0] = this.toGlobalCoord(ret[0]);
          ret[1] = this.toGlobalCoord(ret[1]);
          asc2 && ret[0] > ret[1] && ret.reverse();
          return ret;
        };
        Axis2D2.prototype.pointToData = function(point, clamp2) {
          return this.coordToData(this.toLocalCoord(point[this.dim === "x" ? 0 : 1]), clamp2);
        };
        Axis2D2.prototype.setCategorySortInfo = function(info) {
          if (this.type !== "category") {
            return false;
          }
          this.model.option.categorySortInfo = info;
          this.scale.setSortInfo(info);
        };
        return Axis2D2;
      }(Axis)
    );
    function layout$2(gridModel, axisModel, opt) {
      opt = opt || {};
      var grid = gridModel.coordinateSystem;
      var axis = axisModel.axis;
      var layout2 = {};
      var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];
      var rawAxisPosition = axis.position;
      var axisPosition = otherAxisOnZeroOf ? "onZero" : rawAxisPosition;
      var axisDim = axis.dim;
      var rect = grid.getRect();
      var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
      var idx = {
        left: 0,
        right: 1,
        top: 0,
        bottom: 1,
        onZero: 2
      };
      var axisOffset = axisModel.get("offset") || 0;
      var posBound = axisDim === "x" ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];
      if (otherAxisOnZeroOf) {
        var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));
        posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);
      }
      layout2.position = [axisDim === "y" ? posBound[idx[axisPosition]] : rectBound[0], axisDim === "x" ? posBound[idx[axisPosition]] : rectBound[3]];
      layout2.rotation = Math.PI / 2 * (axisDim === "x" ? 0 : 1);
      var dirMap = {
        top: -1,
        bottom: 1,
        left: -1,
        right: 1
      };
      layout2.labelDirection = layout2.tickDirection = layout2.nameDirection = dirMap[rawAxisPosition];
      layout2.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;
      if (axisModel.get(["axisTick", "inside"])) {
        layout2.tickDirection = -layout2.tickDirection;
      }
      if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) {
        layout2.labelDirection = -layout2.labelDirection;
      }
      var labelRotate = axisModel.get(["axisLabel", "rotate"]);
      layout2.labelRotate = axisPosition === "top" ? -labelRotate : labelRotate;
      layout2.z2 = 1;
      return layout2;
    }
    function isCartesian2DSeries(seriesModel) {
      return seriesModel.get("coordinateSystem") === "cartesian2d";
    }
    function findAxisModels(seriesModel) {
      var axisModelMap = {
        xAxisModel: null,
        yAxisModel: null
      };
      each$f(axisModelMap, function(v4, key) {
        var axisType = key.replace(/Model$/, "");
        var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
        axisModelMap[key] = axisModel;
      });
      return axisModelMap;
    }
    var mathLog = Math.log;
    function alignScaleTicks(scale2, axisModel, alignToScale) {
      var intervalScaleProto2 = IntervalScale.prototype;
      var alignToTicks = intervalScaleProto2.getTicks.call(alignToScale);
      var alignToNicedTicks = intervalScaleProto2.getTicks.call(alignToScale, true);
      var alignToSplitNumber = alignToTicks.length - 1;
      var alignToInterval = intervalScaleProto2.getInterval.call(alignToScale);
      var scaleExtent = getScaleExtent(scale2, axisModel);
      var rawExtent = scaleExtent.extent;
      var isMinFixed = scaleExtent.fixMin;
      var isMaxFixed = scaleExtent.fixMax;
      if (scale2.type === "log") {
        var logBase = mathLog(scale2.base);
        rawExtent = [mathLog(rawExtent[0]) / logBase, mathLog(rawExtent[1]) / logBase];
      }
      scale2.setExtent(rawExtent[0], rawExtent[1]);
      scale2.calcNiceExtent({
        splitNumber: alignToSplitNumber,
        fixMin: isMinFixed,
        fixMax: isMaxFixed
      });
      var extent3 = intervalScaleProto2.getExtent.call(scale2);
      if (isMinFixed) {
        rawExtent[0] = extent3[0];
      }
      if (isMaxFixed) {
        rawExtent[1] = extent3[1];
      }
      var interval = intervalScaleProto2.getInterval.call(scale2);
      var min3 = rawExtent[0];
      var max3 = rawExtent[1];
      if (isMinFixed && isMaxFixed) {
        interval = (max3 - min3) / alignToSplitNumber;
      } else if (isMinFixed) {
        max3 = rawExtent[0] + interval * alignToSplitNumber;
        while (max3 < rawExtent[1] && isFinite(max3) && isFinite(rawExtent[1])) {
          interval = increaseInterval(interval);
          max3 = rawExtent[0] + interval * alignToSplitNumber;
        }
      } else if (isMaxFixed) {
        min3 = rawExtent[1] - interval * alignToSplitNumber;
        while (min3 > rawExtent[0] && isFinite(min3) && isFinite(rawExtent[0])) {
          interval = increaseInterval(interval);
          min3 = rawExtent[1] - interval * alignToSplitNumber;
        }
      } else {
        var nicedSplitNumber = scale2.getTicks().length - 1;
        if (nicedSplitNumber > alignToSplitNumber) {
          interval = increaseInterval(interval);
        }
        var range2 = interval * alignToSplitNumber;
        max3 = Math.ceil(rawExtent[1] / interval) * interval;
        min3 = round$3(max3 - range2);
        if (min3 < 0 && rawExtent[0] >= 0) {
          min3 = 0;
          max3 = round$3(range2);
        } else if (max3 > 0 && rawExtent[1] <= 0) {
          max3 = 0;
          min3 = -round$3(range2);
        }
      }
      var t0 = (alignToTicks[0].value - alignToNicedTicks[0].value) / alignToInterval;
      var t1 = (alignToTicks[alignToSplitNumber].value - alignToNicedTicks[alignToSplitNumber].value) / alignToInterval;
      intervalScaleProto2.setExtent.call(scale2, min3 + interval * t0, max3 + interval * t1);
      intervalScaleProto2.setInterval.call(scale2, interval);
      if (t0 || t1) {
        intervalScaleProto2.setNiceExtent.call(scale2, min3 + interval, max3 - interval);
      }
    }
    var Grid = (
      /** @class */
      function() {
        function Grid2(gridModel, ecModel, api2) {
          this.type = "grid";
          this._coordsMap = {};
          this._coordsList = [];
          this._axesMap = {};
          this._axesList = [];
          this.axisPointerEnabled = true;
          this.dimensions = cartesian2DDimensions;
          this._initCartesian(gridModel, ecModel, api2);
          this.model = gridModel;
        }
        Grid2.prototype.getRect = function() {
          return this._rect;
        };
        Grid2.prototype.update = function(ecModel, api2) {
          var axesMap = this._axesMap;
          this._updateScale(ecModel, this.model);
          function updateAxisTicks(axes) {
            var alignTo;
            var axesIndices = keys$1(axes);
            var len2 = axesIndices.length;
            if (!len2) {
              return;
            }
            var axisNeedsAlign = [];
            for (var i2 = len2 - 1; i2 >= 0; i2--) {
              var idx = +axesIndices[i2];
              var axis = axes[idx];
              var model = axis.model;
              var scale2 = axis.scale;
              if (
                // Only value and log axis without interval support alignTicks.
                isIntervalOrLogScale(scale2) && model.get("alignTicks") && model.get("interval") == null
              ) {
                axisNeedsAlign.push(axis);
              } else {
                niceScaleExtent(scale2, model);
                if (isIntervalOrLogScale(scale2)) {
                  alignTo = axis;
                }
              }
            }
            if (axisNeedsAlign.length) {
              if (!alignTo) {
                alignTo = axisNeedsAlign.pop();
                niceScaleExtent(alignTo.scale, alignTo.model);
              }
              each$f(axisNeedsAlign, function(axis2) {
                alignScaleTicks(axis2.scale, axis2.model, alignTo.scale);
              });
            }
          }
          updateAxisTicks(axesMap.x);
          updateAxisTicks(axesMap.y);
          var onZeroRecords = {};
          each$f(axesMap.x, function(xAxis) {
            fixAxisOnZero(axesMap, "y", xAxis, onZeroRecords);
          });
          each$f(axesMap.y, function(yAxis) {
            fixAxisOnZero(axesMap, "x", yAxis, onZeroRecords);
          });
          this.resize(this.model, api2);
        };
        Grid2.prototype.resize = function(gridModel, api2, ignoreContainLabel) {
          var boxLayoutParams = gridModel.getBoxLayoutParams();
          var isContainLabel = !ignoreContainLabel && gridModel.get("containLabel");
          var gridRect = getLayoutRect(boxLayoutParams, {
            width: api2.getWidth(),
            height: api2.getHeight()
          });
          this._rect = gridRect;
          var axesList = this._axesList;
          adjustAxes();
          if (isContainLabel) {
            each$f(axesList, function(axis) {
              if (!axis.model.get(["axisLabel", "inside"])) {
                var labelUnionRect = estimateLabelUnionRect(axis);
                if (labelUnionRect) {
                  var dim = axis.isHorizontal() ? "height" : "width";
                  var margin = axis.model.get(["axisLabel", "margin"]);
                  gridRect[dim] -= labelUnionRect[dim] + margin;
                  if (axis.position === "top") {
                    gridRect.y += labelUnionRect.height + margin;
                  } else if (axis.position === "left") {
                    gridRect.x += labelUnionRect.width + margin;
                  }
                }
              }
            });
            adjustAxes();
          }
          each$f(this._coordsList, function(coord) {
            coord.calcAffineTransform();
          });
          function adjustAxes() {
            each$f(axesList, function(axis) {
              var isHorizontal2 = axis.isHorizontal();
              var extent3 = isHorizontal2 ? [0, gridRect.width] : [0, gridRect.height];
              var idx = axis.inverse ? 1 : 0;
              axis.setExtent(extent3[idx], extent3[1 - idx]);
              updateAxisTransform(axis, isHorizontal2 ? gridRect.x : gridRect.y);
            });
          }
        };
        Grid2.prototype.getAxis = function(dim, axisIndex) {
          var axesMapOnDim = this._axesMap[dim];
          if (axesMapOnDim != null) {
            return axesMapOnDim[axisIndex || 0];
          }
        };
        Grid2.prototype.getAxes = function() {
          return this._axesList.slice();
        };
        Grid2.prototype.getCartesian = function(xAxisIndex, yAxisIndex) {
          if (xAxisIndex != null && yAxisIndex != null) {
            var key = "x" + xAxisIndex + "y" + yAxisIndex;
            return this._coordsMap[key];
          }
          if (isObject$5(xAxisIndex)) {
            yAxisIndex = xAxisIndex.yAxisIndex;
            xAxisIndex = xAxisIndex.xAxisIndex;
          }
          for (var i2 = 0, coordList = this._coordsList; i2 < coordList.length; i2++) {
            if (coordList[i2].getAxis("x").index === xAxisIndex || coordList[i2].getAxis("y").index === yAxisIndex) {
              return coordList[i2];
            }
          }
        };
        Grid2.prototype.getCartesians = function() {
          return this._coordsList.slice();
        };
        Grid2.prototype.convertToPixel = function(ecModel, finder, value) {
          var target = this._findConvertTarget(finder);
          return target.cartesian ? target.cartesian.dataToPoint(value) : target.axis ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) : null;
        };
        Grid2.prototype.convertFromPixel = function(ecModel, finder, value) {
          var target = this._findConvertTarget(finder);
          return target.cartesian ? target.cartesian.pointToData(value) : target.axis ? target.axis.coordToData(target.axis.toLocalCoord(value)) : null;
        };
        Grid2.prototype._findConvertTarget = function(finder) {
          var seriesModel = finder.seriesModel;
          var xAxisModel = finder.xAxisModel || seriesModel && seriesModel.getReferringComponents("xAxis", SINGLE_REFERRING).models[0];
          var yAxisModel = finder.yAxisModel || seriesModel && seriesModel.getReferringComponents("yAxis", SINGLE_REFERRING).models[0];
          var gridModel = finder.gridModel;
          var coordsList = this._coordsList;
          var cartesian;
          var axis;
          if (seriesModel) {
            cartesian = seriesModel.coordinateSystem;
            indexOf(coordsList, cartesian) < 0 && (cartesian = null);
          } else if (xAxisModel && yAxisModel) {
            cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
          } else if (xAxisModel) {
            axis = this.getAxis("x", xAxisModel.componentIndex);
          } else if (yAxisModel) {
            axis = this.getAxis("y", yAxisModel.componentIndex);
          } else if (gridModel) {
            var grid = gridModel.coordinateSystem;
            if (grid === this) {
              cartesian = this._coordsList[0];
            }
          }
          return {
            cartesian,
            axis
          };
        };
        Grid2.prototype.containPoint = function(point) {
          var coord = this._coordsList[0];
          if (coord) {
            return coord.containPoint(point);
          }
        };
        Grid2.prototype._initCartesian = function(gridModel, ecModel, api2) {
          var _this = this;
          var grid = this;
          var axisPositionUsed = {
            left: false,
            right: false,
            top: false,
            bottom: false
          };
          var axesMap = {
            x: {},
            y: {}
          };
          var axesCount = {
            x: 0,
            y: 0
          };
          ecModel.eachComponent("xAxis", createAxisCreator("x"), this);
          ecModel.eachComponent("yAxis", createAxisCreator("y"), this);
          if (!axesCount.x || !axesCount.y) {
            this._axesMap = {};
            this._axesList = [];
            return;
          }
          this._axesMap = axesMap;
          each$f(axesMap.x, function(xAxis, xAxisIndex) {
            each$f(axesMap.y, function(yAxis, yAxisIndex) {
              var key = "x" + xAxisIndex + "y" + yAxisIndex;
              var cartesian = new Cartesian2D(key);
              cartesian.master = _this;
              cartesian.model = gridModel;
              _this._coordsMap[key] = cartesian;
              _this._coordsList.push(cartesian);
              cartesian.addAxis(xAxis);
              cartesian.addAxis(yAxis);
            });
          });
          function createAxisCreator(dimName) {
            return function(axisModel, idx) {
              if (!isAxisUsedInTheGrid(axisModel, gridModel)) {
                return;
              }
              var axisPosition = axisModel.get("position");
              if (dimName === "x") {
                if (axisPosition !== "top" && axisPosition !== "bottom") {
                  axisPosition = axisPositionUsed.bottom ? "top" : "bottom";
                }
              } else {
                if (axisPosition !== "left" && axisPosition !== "right") {
                  axisPosition = axisPositionUsed.left ? "right" : "left";
                }
              }
              axisPositionUsed[axisPosition] = true;
              var axis = new Axis2D(dimName, createScaleByModel$1(axisModel), [0, 0], axisModel.get("type"), axisPosition);
              var isCategory2 = axis.type === "category";
              axis.onBand = isCategory2 && axisModel.get("boundaryGap");
              axis.inverse = axisModel.get("inverse");
              axisModel.axis = axis;
              axis.model = axisModel;
              axis.grid = grid;
              axis.index = idx;
              grid._axesList.push(axis);
              axesMap[dimName][idx] = axis;
              axesCount[dimName]++;
            };
          }
        };
        Grid2.prototype._updateScale = function(ecModel, gridModel) {
          each$f(this._axesList, function(axis) {
            axis.scale.setExtent(Infinity, -Infinity);
            if (axis.type === "category") {
              var categorySortInfo = axis.model.get("categorySortInfo");
              axis.scale.setSortInfo(categorySortInfo);
            }
          });
          ecModel.eachSeries(function(seriesModel) {
            if (isCartesian2DSeries(seriesModel)) {
              var axesModelMap = findAxisModels(seriesModel);
              var xAxisModel = axesModelMap.xAxisModel;
              var yAxisModel = axesModelMap.yAxisModel;
              if (!isAxisUsedInTheGrid(xAxisModel, gridModel) || !isAxisUsedInTheGrid(yAxisModel, gridModel)) {
                return;
              }
              var cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
              var data = seriesModel.getData();
              var xAxis = cartesian.getAxis("x");
              var yAxis = cartesian.getAxis("y");
              unionExtent(data, xAxis);
              unionExtent(data, yAxis);
            }
          }, this);
          function unionExtent(data, axis) {
            each$f(getDataDimensionsOnAxis(data, axis.dim), function(dim) {
              axis.scale.unionExtentFromData(data, dim);
            });
          }
        };
        Grid2.prototype.getTooltipAxes = function(dim) {
          var baseAxes = [];
          var otherAxes = [];
          each$f(this.getCartesians(), function(cartesian) {
            var baseAxis = dim != null && dim !== "auto" ? cartesian.getAxis(dim) : cartesian.getBaseAxis();
            var otherAxis = cartesian.getOtherAxis(baseAxis);
            indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis);
            indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis);
          });
          return {
            baseAxes,
            otherAxes
          };
        };
        Grid2.create = function(ecModel, api2) {
          var grids = [];
          ecModel.eachComponent("grid", function(gridModel, idx) {
            var grid = new Grid2(gridModel, ecModel, api2);
            grid.name = "grid_" + idx;
            grid.resize(gridModel, api2, true);
            gridModel.coordinateSystem = grid;
            grids.push(grid);
          });
          ecModel.eachSeries(function(seriesModel) {
            if (!isCartesian2DSeries(seriesModel)) {
              return;
            }
            var axesModelMap = findAxisModels(seriesModel);
            var xAxisModel = axesModelMap.xAxisModel;
            var yAxisModel = axesModelMap.yAxisModel;
            var gridModel = xAxisModel.getCoordSysModel();
            var grid = gridModel.coordinateSystem;
            seriesModel.coordinateSystem = grid.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex);
          });
          return grids;
        };
        Grid2.dimensions = cartesian2DDimensions;
        return Grid2;
      }()
    );
    function isAxisUsedInTheGrid(axisModel, gridModel) {
      return axisModel.getCoordSysModel() === gridModel;
    }
    function fixAxisOnZero(axesMap, otherAxisDim, axis, onZeroRecords) {
      axis.getAxesOnZeroOf = function() {
        return otherAxisOnZeroOf ? [otherAxisOnZeroOf] : [];
      };
      var otherAxes = axesMap[otherAxisDim];
      var otherAxisOnZeroOf;
      var axisModel = axis.model;
      var onZero = axisModel.get(["axisLine", "onZero"]);
      var onZeroAxisIndex = axisModel.get(["axisLine", "onZeroAxisIndex"]);
      if (!onZero) {
        return;
      }
      if (onZeroAxisIndex != null) {
        if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) {
          otherAxisOnZeroOf = otherAxes[onZeroAxisIndex];
        }
      } else {
        for (var idx in otherAxes) {
          if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx]) && !onZeroRecords[getOnZeroRecordKey(otherAxes[idx])]) {
            otherAxisOnZeroOf = otherAxes[idx];
            break;
          }
        }
      }
      if (otherAxisOnZeroOf) {
        onZeroRecords[getOnZeroRecordKey(otherAxisOnZeroOf)] = true;
      }
      function getOnZeroRecordKey(axis2) {
        return axis2.dim + "_" + axis2.index;
      }
    }
    function canOnZeroToAxis(axis) {
      return axis && axis.type !== "category" && axis.type !== "time" && ifAxisCrossZero(axis);
    }
    function updateAxisTransform(axis, coordBase) {
      var axisExtent = axis.getExtent();
      var axisExtentSum = axisExtent[0] + axisExtent[1];
      axis.toGlobalCoord = axis.dim === "x" ? function(coord) {
        return coord + coordBase;
      } : function(coord) {
        return axisExtentSum - coord + coordBase;
      };
      axis.toLocalCoord = axis.dim === "x" ? function(coord) {
        return coord - coordBase;
      } : function(coord) {
        return axisExtentSum - coord + coordBase;
      };
    }
    var PI$3 = Math.PI;
    var AxisBuilder = (
      /** @class */
      function() {
        function AxisBuilder2(axisModel, opt) {
          this.group = new Group$3();
          this.opt = opt;
          this.axisModel = axisModel;
          defaults$1(opt, {
            labelOffset: 0,
            nameDirection: 1,
            tickDirection: 1,
            labelDirection: 1,
            silent: true,
            handleAutoShown: function() {
              return true;
            }
          });
          var transformGroup = new Group$3({
            x: opt.position[0],
            y: opt.position[1],
            rotation: opt.rotation
          });
          transformGroup.updateTransform();
          this._transformGroup = transformGroup;
        }
        AxisBuilder2.prototype.hasBuilder = function(name) {
          return !!builders[name];
        };
        AxisBuilder2.prototype.add = function(name) {
          builders[name](this.opt, this.axisModel, this.group, this._transformGroup);
        };
        AxisBuilder2.prototype.getGroup = function() {
          return this.group;
        };
        AxisBuilder2.innerTextLayout = function(axisRotation, textRotation, direction2) {
          var rotationDiff = remRadian(textRotation - axisRotation);
          var textAlign2;
          var textVerticalAlign;
          if (isRadianAroundZero(rotationDiff)) {
            textVerticalAlign = direction2 > 0 ? "top" : "bottom";
            textAlign2 = "center";
          } else if (isRadianAroundZero(rotationDiff - PI$3)) {
            textVerticalAlign = direction2 > 0 ? "bottom" : "top";
            textAlign2 = "center";
          } else {
            textVerticalAlign = "middle";
            if (rotationDiff > 0 && rotationDiff < PI$3) {
              textAlign2 = direction2 > 0 ? "right" : "left";
            } else {
              textAlign2 = direction2 > 0 ? "left" : "right";
            }
          }
          return {
            rotation: rotationDiff,
            textAlign: textAlign2,
            textVerticalAlign
          };
        };
        AxisBuilder2.makeAxisEventDataBase = function(axisModel) {
          var eventData = {
            componentType: axisModel.mainType,
            componentIndex: axisModel.componentIndex
          };
          eventData[axisModel.mainType + "Index"] = axisModel.componentIndex;
          return eventData;
        };
        AxisBuilder2.isLabelSilent = function(axisModel) {
          var tooltipOpt = axisModel.get("tooltip");
          return axisModel.get("silent") || !(axisModel.get("triggerEvent") || tooltipOpt && tooltipOpt.show);
        };
        return AxisBuilder2;
      }()
    );
    var builders = {
      axisLine: function(opt, axisModel, group, transformGroup) {
        var shown = axisModel.get(["axisLine", "show"]);
        if (shown === "auto" && opt.handleAutoShown) {
          shown = opt.handleAutoShown("axisLine");
        }
        if (!shown) {
          return;
        }
        var extent3 = axisModel.axis.getExtent();
        var matrix2 = transformGroup.transform;
        var pt12 = [extent3[0], 0];
        var pt22 = [extent3[1], 0];
        var inverse = pt12[0] > pt22[0];
        if (matrix2) {
          applyTransform$1(pt12, pt12, matrix2);
          applyTransform$1(pt22, pt22, matrix2);
        }
        var lineStyle = extend$1({
          lineCap: "round"
        }, axisModel.getModel(["axisLine", "lineStyle"]).getLineStyle());
        var line = new Line$1({
          shape: {
            x1: pt12[0],
            y1: pt12[1],
            x2: pt22[0],
            y2: pt22[1]
          },
          style: lineStyle,
          strokeContainThreshold: opt.strokeContainThreshold || 5,
          silent: true,
          z2: 1
        });
        subPixelOptimizeLine(line.shape, line.style.lineWidth);
        line.anid = "line";
        group.add(line);
        var arrows = axisModel.get(["axisLine", "symbol"]);
        if (arrows != null) {
          var arrowSize = axisModel.get(["axisLine", "symbolSize"]);
          if (isString$1(arrows)) {
            arrows = [arrows, arrows];
          }
          if (isString$1(arrowSize) || isNumber$1(arrowSize)) {
            arrowSize = [arrowSize, arrowSize];
          }
          var arrowOffset = normalizeSymbolOffset(axisModel.get(["axisLine", "symbolOffset"]) || 0, arrowSize);
          var symbolWidth_1 = arrowSize[0];
          var symbolHeight_1 = arrowSize[1];
          each$f([{
            rotate: opt.rotation + Math.PI / 2,
            offset: arrowOffset[0],
            r: 0
          }, {
            rotate: opt.rotation - Math.PI / 2,
            offset: arrowOffset[1],
            r: Math.sqrt((pt12[0] - pt22[0]) * (pt12[0] - pt22[0]) + (pt12[1] - pt22[1]) * (pt12[1] - pt22[1]))
          }], function(point, index) {
            if (arrows[index] !== "none" && arrows[index] != null) {
              var symbol = createSymbol$1(arrows[index], -symbolWidth_1 / 2, -symbolHeight_1 / 2, symbolWidth_1, symbolHeight_1, lineStyle.stroke, true);
              var r = point.r + point.offset;
              var pt3 = inverse ? pt22 : pt12;
              symbol.attr({
                rotation: point.rotate,
                x: pt3[0] + r * Math.cos(opt.rotation),
                y: pt3[1] - r * Math.sin(opt.rotation),
                silent: true,
                z2: 11
              });
              group.add(symbol);
            }
          });
        }
      },
      axisTickLabel: function(opt, axisModel, group, transformGroup) {
        var ticksEls = buildAxisMajorTicks(group, transformGroup, axisModel, opt);
        var labelEls = buildAxisLabel(group, transformGroup, axisModel, opt);
        fixMinMaxLabelShow(axisModel, labelEls, ticksEls);
        buildAxisMinorTicks(group, transformGroup, axisModel, opt.tickDirection);
        if (axisModel.get(["axisLabel", "hideOverlap"])) {
          var labelList = prepareLayoutList(map$1(labelEls, function(label) {
            return {
              label,
              priority: label.z2,
              defaultAttr: {
                ignore: label.ignore
              }
            };
          }));
          hideOverlap(labelList);
        }
      },
      axisName: function(opt, axisModel, group, transformGroup) {
        var name = retrieve(opt.axisName, axisModel.get("name"));
        if (!name) {
          return;
        }
        var nameLocation = axisModel.get("nameLocation");
        var nameDirection = opt.nameDirection;
        var textStyleModel = axisModel.getModel("nameTextStyle");
        var gap = axisModel.get("nameGap") || 0;
        var extent3 = axisModel.axis.getExtent();
        var gapSignal = extent3[0] > extent3[1] ? -1 : 1;
        var pos = [
          nameLocation === "start" ? extent3[0] - gapSignal * gap : nameLocation === "end" ? extent3[1] + gapSignal * gap : (extent3[0] + extent3[1]) / 2,
          // Reuse labelOffset.
          isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0
        ];
        var labelLayout2;
        var nameRotation = axisModel.get("nameRotate");
        if (nameRotation != null) {
          nameRotation = nameRotation * PI$3 / 180;
        }
        var axisNameAvailableWidth;
        if (isNameLocationCenter(nameLocation)) {
          labelLayout2 = AxisBuilder.innerTextLayout(
            opt.rotation,
            nameRotation != null ? nameRotation : opt.rotation,
            // Adapt to axis.
            nameDirection
          );
        } else {
          labelLayout2 = endTextLayout(opt.rotation, nameLocation, nameRotation || 0, extent3);
          axisNameAvailableWidth = opt.axisNameAvailableWidth;
          if (axisNameAvailableWidth != null) {
            axisNameAvailableWidth = Math.abs(axisNameAvailableWidth / Math.sin(labelLayout2.rotation));
            !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null);
          }
        }
        var textFont = textStyleModel.getFont();
        var truncateOpt = axisModel.get("nameTruncate", true) || {};
        var ellipsis = truncateOpt.ellipsis;
        var maxWidth = retrieve(opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth);
        var textEl = new ZRText({
          x: pos[0],
          y: pos[1],
          rotation: labelLayout2.rotation,
          silent: AxisBuilder.isLabelSilent(axisModel),
          style: createTextStyle(textStyleModel, {
            text: name,
            font: textFont,
            overflow: "truncate",
            width: maxWidth,
            ellipsis,
            fill: textStyleModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]),
            align: textStyleModel.get("align") || labelLayout2.textAlign,
            verticalAlign: textStyleModel.get("verticalAlign") || labelLayout2.textVerticalAlign
          }),
          z2: 1
        });
        setTooltipConfig({
          el: textEl,
          componentModel: axisModel,
          itemName: name
        });
        textEl.__fullText = name;
        textEl.anid = "name";
        if (axisModel.get("triggerEvent")) {
          var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);
          eventData.targetType = "axisName";
          eventData.name = name;
          getECData(textEl).eventData = eventData;
        }
        transformGroup.add(textEl);
        textEl.updateTransform();
        group.add(textEl);
        textEl.decomposeTransform();
      }
    };
    function endTextLayout(rotation, textPosition, textRotate, extent3) {
      var rotationDiff = remRadian(textRotate - rotation);
      var textAlign2;
      var textVerticalAlign;
      var inverse = extent3[0] > extent3[1];
      var onLeft = textPosition === "start" && !inverse || textPosition !== "start" && inverse;
      if (isRadianAroundZero(rotationDiff - PI$3 / 2)) {
        textVerticalAlign = onLeft ? "bottom" : "top";
        textAlign2 = "center";
      } else if (isRadianAroundZero(rotationDiff - PI$3 * 1.5)) {
        textVerticalAlign = onLeft ? "top" : "bottom";
        textAlign2 = "center";
      } else {
        textVerticalAlign = "middle";
        if (rotationDiff < PI$3 * 1.5 && rotationDiff > PI$3 / 2) {
          textAlign2 = onLeft ? "left" : "right";
        } else {
          textAlign2 = onLeft ? "right" : "left";
        }
      }
      return {
        rotation: rotationDiff,
        textAlign: textAlign2,
        textVerticalAlign
      };
    }
    function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
      if (shouldShowAllLabels(axisModel.axis)) {
        return;
      }
      var showMinLabel = axisModel.get(["axisLabel", "showMinLabel"]);
      var showMaxLabel = axisModel.get(["axisLabel", "showMaxLabel"]);
      labelEls = labelEls || [];
      tickEls = tickEls || [];
      var firstLabel = labelEls[0];
      var nextLabel = labelEls[1];
      var lastLabel = labelEls[labelEls.length - 1];
      var prevLabel = labelEls[labelEls.length - 2];
      var firstTick = tickEls[0];
      var nextTick2 = tickEls[1];
      var lastTick = tickEls[tickEls.length - 1];
      var prevTick = tickEls[tickEls.length - 2];
      if (showMinLabel === false) {
        ignoreEl(firstLabel);
        ignoreEl(firstTick);
      } else if (isTwoLabelOverlapped(firstLabel, nextLabel)) {
        if (showMinLabel) {
          ignoreEl(nextLabel);
          ignoreEl(nextTick2);
        } else {
          ignoreEl(firstLabel);
          ignoreEl(firstTick);
        }
      }
      if (showMaxLabel === false) {
        ignoreEl(lastLabel);
        ignoreEl(lastTick);
      } else if (isTwoLabelOverlapped(prevLabel, lastLabel)) {
        if (showMaxLabel) {
          ignoreEl(prevLabel);
          ignoreEl(prevTick);
        } else {
          ignoreEl(lastLabel);
          ignoreEl(lastTick);
        }
      }
    }
    function ignoreEl(el) {
      el && (el.ignore = true);
    }
    function isTwoLabelOverlapped(current, next) {
      var firstRect = current && current.getBoundingRect().clone();
      var nextRect = next && next.getBoundingRect().clone();
      if (!firstRect || !nextRect) {
        return;
      }
      var mRotationBack = identity([]);
      rotate(mRotationBack, mRotationBack, -current.rotation);
      firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));
      nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));
      return firstRect.intersect(nextRect);
    }
    function isNameLocationCenter(nameLocation) {
      return nameLocation === "middle" || nameLocation === "center";
    }
    function createTicks(ticksCoords, tickTransform, tickEndCoord, tickLineStyle, anidPrefix) {
      var tickEls = [];
      var pt12 = [];
      var pt22 = [];
      for (var i2 = 0; i2 < ticksCoords.length; i2++) {
        var tickCoord = ticksCoords[i2].coord;
        pt12[0] = tickCoord;
        pt12[1] = 0;
        pt22[0] = tickCoord;
        pt22[1] = tickEndCoord;
        if (tickTransform) {
          applyTransform$1(pt12, pt12, tickTransform);
          applyTransform$1(pt22, pt22, tickTransform);
        }
        var tickEl = new Line$1({
          shape: {
            x1: pt12[0],
            y1: pt12[1],
            x2: pt22[0],
            y2: pt22[1]
          },
          style: tickLineStyle,
          z2: 2,
          autoBatch: true,
          silent: true
        });
        subPixelOptimizeLine(tickEl.shape, tickEl.style.lineWidth);
        tickEl.anid = anidPrefix + "_" + ticksCoords[i2].tickValue;
        tickEls.push(tickEl);
      }
      return tickEls;
    }
    function buildAxisMajorTicks(group, transformGroup, axisModel, opt) {
      var axis = axisModel.axis;
      var tickModel = axisModel.getModel("axisTick");
      var shown = tickModel.get("show");
      if (shown === "auto" && opt.handleAutoShown) {
        shown = opt.handleAutoShown("axisTick");
      }
      if (!shown || axis.scale.isBlank()) {
        return;
      }
      var lineStyleModel = tickModel.getModel("lineStyle");
      var tickEndCoord = opt.tickDirection * tickModel.get("length");
      var ticksCoords = axis.getTicksCoords();
      var ticksEls = createTicks(ticksCoords, transformGroup.transform, tickEndCoord, defaults$1(lineStyleModel.getLineStyle(), {
        stroke: axisModel.get(["axisLine", "lineStyle", "color"])
      }), "ticks");
      for (var i2 = 0; i2 < ticksEls.length; i2++) {
        group.add(ticksEls[i2]);
      }
      return ticksEls;
    }
    function buildAxisMinorTicks(group, transformGroup, axisModel, tickDirection) {
      var axis = axisModel.axis;
      var minorTickModel = axisModel.getModel("minorTick");
      if (!minorTickModel.get("show") || axis.scale.isBlank()) {
        return;
      }
      var minorTicksCoords = axis.getMinorTicksCoords();
      if (!minorTicksCoords.length) {
        return;
      }
      var lineStyleModel = minorTickModel.getModel("lineStyle");
      var tickEndCoord = tickDirection * minorTickModel.get("length");
      var minorTickLineStyle = defaults$1(lineStyleModel.getLineStyle(), defaults$1(axisModel.getModel("axisTick").getLineStyle(), {
        stroke: axisModel.get(["axisLine", "lineStyle", "color"])
      }));
      for (var i2 = 0; i2 < minorTicksCoords.length; i2++) {
        var minorTicksEls = createTicks(minorTicksCoords[i2], transformGroup.transform, tickEndCoord, minorTickLineStyle, "minorticks_" + i2);
        for (var k2 = 0; k2 < minorTicksEls.length; k2++) {
          group.add(minorTicksEls[k2]);
        }
      }
    }
    function buildAxisLabel(group, transformGroup, axisModel, opt) {
      var axis = axisModel.axis;
      var show = retrieve(opt.axisLabelShow, axisModel.get(["axisLabel", "show"]));
      if (!show || axis.scale.isBlank()) {
        return;
      }
      var labelModel = axisModel.getModel("axisLabel");
      var labelMargin = labelModel.get("margin");
      var labels = axis.getViewLabels();
      var labelRotation = (retrieve(opt.labelRotate, labelModel.get("rotate")) || 0) * PI$3 / 180;
      var labelLayout2 = AxisBuilder.innerTextLayout(opt.rotation, labelRotation, opt.labelDirection);
      var rawCategoryData = axisModel.getCategories && axisModel.getCategories(true);
      var labelEls = [];
      var silent = AxisBuilder.isLabelSilent(axisModel);
      var triggerEvent2 = axisModel.get("triggerEvent");
      each$f(labels, function(labelItem, index) {
        var tickValue = axis.scale.type === "ordinal" ? axis.scale.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
        var formattedLabel = labelItem.formattedLabel;
        var rawLabel = labelItem.rawLabel;
        var itemLabelModel = labelModel;
        if (rawCategoryData && rawCategoryData[tickValue]) {
          var rawCategoryItem = rawCategoryData[tickValue];
          if (isObject$5(rawCategoryItem) && rawCategoryItem.textStyle) {
            itemLabelModel = new Model(rawCategoryItem.textStyle, labelModel, axisModel.ecModel);
          }
        }
        var textColor = itemLabelModel.getTextColor() || axisModel.get(["axisLine", "lineStyle", "color"]);
        var tickCoord = axis.dataToCoord(tickValue);
        var align = itemLabelModel.getShallow("align", true) || labelLayout2.textAlign;
        var alignMin = retrieve2(itemLabelModel.getShallow("alignMinLabel", true), align);
        var alignMax = retrieve2(itemLabelModel.getShallow("alignMaxLabel", true), align);
        var verticalAlign = itemLabelModel.getShallow("verticalAlign", true) || itemLabelModel.getShallow("baseline", true) || labelLayout2.textVerticalAlign;
        var verticalAlignMin = retrieve2(itemLabelModel.getShallow("verticalAlignMinLabel", true), verticalAlign);
        var verticalAlignMax = retrieve2(itemLabelModel.getShallow("verticalAlignMaxLabel", true), verticalAlign);
        var textEl = new ZRText({
          x: tickCoord,
          y: opt.labelOffset + opt.labelDirection * labelMargin,
          rotation: labelLayout2.rotation,
          silent,
          z2: 10 + (labelItem.level || 0),
          style: createTextStyle(itemLabelModel, {
            text: formattedLabel,
            align: index === 0 ? alignMin : index === labels.length - 1 ? alignMax : align,
            verticalAlign: index === 0 ? verticalAlignMin : index === labels.length - 1 ? verticalAlignMax : verticalAlign,
            fill: isFunction$1(textColor) ? textColor(
              // (1) In category axis with data zoom, tick is not the original
              // index of axis.data. So tick should not be exposed to user
              // in category axis.
              // (2) Compatible with previous version, which always use formatted label as
              // input. But in interval scale the formatted label is like '223,445', which
              // maked user replace ','. So we modify it to return original val but remain
              // it as 'string' to avoid error in replacing.
              axis.type === "category" ? rawLabel : axis.type === "value" ? tickValue + "" : tickValue,
              index
            ) : textColor
          })
        });
        textEl.anid = "label_" + tickValue;
        setTooltipConfig({
          el: textEl,
          componentModel: axisModel,
          itemName: formattedLabel,
          formatterParamsExtra: {
            isTruncated: function() {
              return textEl.isTruncated;
            },
            value: rawLabel,
            tickIndex: index
          }
        });
        if (triggerEvent2) {
          var eventData = AxisBuilder.makeAxisEventDataBase(axisModel);
          eventData.targetType = "axisLabel";
          eventData.value = rawLabel;
          eventData.tickIndex = index;
          if (axis.type === "category") {
            eventData.dataIndex = tickValue;
          }
          getECData(textEl).eventData = eventData;
        }
        transformGroup.add(textEl);
        textEl.updateTransform();
        labelEls.push(textEl);
        group.add(textEl);
        textEl.decomposeTransform();
      });
      return labelEls;
    }
    function collect(ecModel, api2) {
      var result = {
        /**
         * key: makeKey(axis.model)
         * value: {
         *      axis,
         *      coordSys,
         *      axisPointerModel,
         *      triggerTooltip,
         *      triggerEmphasis,
         *      involveSeries,
         *      snap,
         *      seriesModels,
         *      seriesDataCount
         * }
         */
        axesInfo: {},
        seriesInvolved: false,
        /**
         * key: makeKey(coordSys.model)
         * value: Object: key makeKey(axis.model), value: axisInfo
         */
        coordSysAxesInfo: {},
        coordSysMap: {}
      };
      collectAxesInfo(result, ecModel, api2);
      result.seriesInvolved && collectSeriesInfo(result, ecModel);
      return result;
    }
    function collectAxesInfo(result, ecModel, api2) {
      var globalTooltipModel = ecModel.getComponent("tooltip");
      var globalAxisPointerModel = ecModel.getComponent("axisPointer");
      var linksOption = globalAxisPointerModel.get("link", true) || [];
      var linkGroups = [];
      each$f(api2.getCoordinateSystems(), function(coordSys) {
        if (!coordSys.axisPointerEnabled) {
          return;
        }
        var coordSysKey = makeKey(coordSys.model);
        var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {};
        result.coordSysMap[coordSysKey] = coordSys;
        var coordSysModel = coordSys.model;
        var baseTooltipModel = coordSysModel.getModel("tooltip", globalTooltipModel);
        each$f(coordSys.getAxes(), curry$1(saveTooltipAxisInfo, false, null));
        if (coordSys.getTooltipAxes && globalTooltipModel && baseTooltipModel.get("show")) {
          var triggerAxis = baseTooltipModel.get("trigger") === "axis";
          var cross = baseTooltipModel.get(["axisPointer", "type"]) === "cross";
          var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get(["axisPointer", "axis"]));
          if (triggerAxis || cross) {
            each$f(tooltipAxes.baseAxes, curry$1(saveTooltipAxisInfo, cross ? "cross" : true, triggerAxis));
          }
          if (cross) {
            each$f(tooltipAxes.otherAxes, curry$1(saveTooltipAxisInfo, "cross", false));
          }
        }
        function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) {
          var axisPointerModel = axis.model.getModel("axisPointer", globalAxisPointerModel);
          var axisPointerShow = axisPointerModel.get("show");
          if (!axisPointerShow || axisPointerShow === "auto" && !fromTooltip && !isHandleTrigger(axisPointerModel)) {
            return;
          }
          if (triggerTooltip == null) {
            triggerTooltip = axisPointerModel.get("triggerTooltip");
          }
          axisPointerModel = fromTooltip ? makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) : axisPointerModel;
          var snap = axisPointerModel.get("snap");
          var triggerEmphasis = axisPointerModel.get("triggerEmphasis");
          var axisKey = makeKey(axis.model);
          var involveSeries = triggerTooltip || snap || axis.type === "category";
          var axisInfo = result.axesInfo[axisKey] = {
            key: axisKey,
            axis,
            coordSys,
            axisPointerModel,
            triggerTooltip,
            triggerEmphasis,
            involveSeries,
            snap,
            useHandle: isHandleTrigger(axisPointerModel),
            seriesModels: [],
            linkGroup: null
          };
          axesInfoInCoordSys[axisKey] = axisInfo;
          result.seriesInvolved = result.seriesInvolved || involveSeries;
          var groupIndex = getLinkGroupIndex(linksOption, axis);
          if (groupIndex != null) {
            var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {
              axesInfo: {}
            });
            linkGroup.axesInfo[axisKey] = axisInfo;
            linkGroup.mapper = linksOption[groupIndex].mapper;
            axisInfo.linkGroup = linkGroup;
          }
        }
      });
    }
    function makeAxisPointerModel(axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip) {
      var tooltipAxisPointerModel = baseTooltipModel.getModel("axisPointer");
      var fields = ["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"];
      var volatileOption = {};
      each$f(fields, function(field) {
        volatileOption[field] = clone$4(tooltipAxisPointerModel.get(field));
      });
      volatileOption.snap = axis.type !== "category" && !!triggerTooltip;
      if (tooltipAxisPointerModel.get("type") === "cross") {
        volatileOption.type = "line";
      }
      var labelOption = volatileOption.label || (volatileOption.label = {});
      labelOption.show == null && (labelOption.show = false);
      if (fromTooltip === "cross") {
        var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get(["label", "show"]);
        labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true;
        if (!triggerTooltip) {
          var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get("crossStyle");
          crossStyle && defaults$1(labelOption, crossStyle.textStyle);
        }
      }
      return axis.model.getModel("axisPointer", new Model(volatileOption, globalAxisPointerModel, ecModel));
    }
    function collectSeriesInfo(result, ecModel) {
      ecModel.eachSeries(function(seriesModel) {
        var coordSys = seriesModel.coordinateSystem;
        var seriesTooltipTrigger = seriesModel.get(["tooltip", "trigger"], true);
        var seriesTooltipShow = seriesModel.get(["tooltip", "show"], true);
        if (!coordSys || seriesTooltipTrigger === "none" || seriesTooltipTrigger === false || seriesTooltipTrigger === "item" || seriesTooltipShow === false || seriesModel.get(["axisPointer", "show"], true) === false) {
          return;
        }
        each$f(result.coordSysAxesInfo[makeKey(coordSys.model)], function(axisInfo) {
          var axis = axisInfo.axis;
          if (coordSys.getAxis(axis.dim) === axis) {
            axisInfo.seriesModels.push(seriesModel);
            axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0);
            axisInfo.seriesDataCount += seriesModel.getData().count();
          }
        });
      });
    }
    function getLinkGroupIndex(linksOption, axis) {
      var axisModel = axis.model;
      var dim = axis.dim;
      for (var i2 = 0; i2 < linksOption.length; i2++) {
        var linkOption = linksOption[i2] || {};
        if (checkPropInLink(linkOption[dim + "AxisId"], axisModel.id) || checkPropInLink(linkOption[dim + "AxisIndex"], axisModel.componentIndex) || checkPropInLink(linkOption[dim + "AxisName"], axisModel.name)) {
          return i2;
        }
      }
    }
    function checkPropInLink(linkPropValue, axisPropValue) {
      return linkPropValue === "all" || isArray$2(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0 || linkPropValue === axisPropValue;
    }
    function fixValue(axisModel) {
      var axisInfo = getAxisInfo$1(axisModel);
      if (!axisInfo) {
        return;
      }
      var axisPointerModel = axisInfo.axisPointerModel;
      var scale2 = axisInfo.axis.scale;
      var option = axisPointerModel.option;
      var status = axisPointerModel.get("status");
      var value = axisPointerModel.get("value");
      if (value != null) {
        value = scale2.parse(value);
      }
      var useHandle = isHandleTrigger(axisPointerModel);
      if (status == null) {
        option.status = useHandle ? "show" : "hide";
      }
      var extent3 = scale2.getExtent().slice();
      extent3[0] > extent3[1] && extent3.reverse();
      if (
        // Pick a value on axis when initializing.
        value == null || value > extent3[1]
      ) {
        value = extent3[1];
      }
      if (value < extent3[0]) {
        value = extent3[0];
      }
      option.value = value;
      if (useHandle) {
        option.status = axisInfo.axis.scale.isBlank() ? "hide" : "show";
      }
    }
    function getAxisInfo$1(axisModel) {
      var coordSysAxesInfo = (axisModel.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
      return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)];
    }
    function getAxisPointerModel(axisModel) {
      var axisInfo = getAxisInfo$1(axisModel);
      return axisInfo && axisInfo.axisPointerModel;
    }
    function isHandleTrigger(axisPointerModel) {
      return !!axisPointerModel.get(["handle", "show"]);
    }
    function makeKey(model) {
      return model.type + "||" + model.id;
    }
    var axisPointerClazz = {};
    var AxisView = (
      /** @class */
      function(_super) {
        __extends$1(AxisView2, _super);
        function AxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = AxisView2.type;
          return _this;
        }
        AxisView2.prototype.render = function(axisModel, ecModel, api2, payload) {
          this.axisPointerClass && fixValue(axisModel);
          _super.prototype.render.apply(this, arguments);
          this._doUpdateAxisPointerClass(axisModel, api2, true);
        };
        AxisView2.prototype.updateAxisPointer = function(axisModel, ecModel, api2, payload) {
          this._doUpdateAxisPointerClass(axisModel, api2, false);
        };
        AxisView2.prototype.remove = function(ecModel, api2) {
          var axisPointer = this._axisPointer;
          axisPointer && axisPointer.remove(api2);
        };
        AxisView2.prototype.dispose = function(ecModel, api2) {
          this._disposeAxisPointer(api2);
          _super.prototype.dispose.apply(this, arguments);
        };
        AxisView2.prototype._doUpdateAxisPointerClass = function(axisModel, api2, forceRender) {
          var Clazz = AxisView2.getAxisPointerClass(this.axisPointerClass);
          if (!Clazz) {
            return;
          }
          var axisPointerModel = getAxisPointerModel(axisModel);
          axisPointerModel ? (this._axisPointer || (this._axisPointer = new Clazz())).render(axisModel, axisPointerModel, api2, forceRender) : this._disposeAxisPointer(api2);
        };
        AxisView2.prototype._disposeAxisPointer = function(api2) {
          this._axisPointer && this._axisPointer.dispose(api2);
          this._axisPointer = null;
        };
        AxisView2.registerAxisPointerClass = function(type, clazz) {
          axisPointerClazz[type] = clazz;
        };
        AxisView2.getAxisPointerClass = function(type) {
          return type && axisPointerClazz[type];
        };
        AxisView2.type = "axis";
        return AxisView2;
      }(ComponentView)
    );
    var inner$f = makeInner();
    function rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel) {
      var axis = axisModel.axis;
      if (axis.scale.isBlank()) {
        return;
      }
      var splitAreaModel = axisModel.getModel("splitArea");
      var areaStyleModel = splitAreaModel.getModel("areaStyle");
      var areaColors = areaStyleModel.get("color");
      var gridRect = gridModel.coordinateSystem.getRect();
      var ticksCoords = axis.getTicksCoords({
        tickModel: splitAreaModel,
        clamp: true
      });
      if (!ticksCoords.length) {
        return;
      }
      var areaColorsLen = areaColors.length;
      var lastSplitAreaColors = inner$f(axisView).splitAreaColors;
      var newSplitAreaColors = createHashMap();
      var colorIndex = 0;
      if (lastSplitAreaColors) {
        for (var i2 = 0; i2 < ticksCoords.length; i2++) {
          var cIndex = lastSplitAreaColors.get(ticksCoords[i2].tickValue);
          if (cIndex != null) {
            colorIndex = (cIndex + (areaColorsLen - 1) * i2) % areaColorsLen;
            break;
          }
        }
      }
      var prev = axis.toGlobalCoord(ticksCoords[0].coord);
      var areaStyle = areaStyleModel.getAreaStyle();
      areaColors = isArray$2(areaColors) ? areaColors : [areaColors];
      for (var i2 = 1; i2 < ticksCoords.length; i2++) {
        var tickCoord = axis.toGlobalCoord(ticksCoords[i2].coord);
        var x2 = void 0;
        var y = void 0;
        var width = void 0;
        var height = void 0;
        if (axis.isHorizontal()) {
          x2 = prev;
          y = gridRect.y;
          width = tickCoord - x2;
          height = gridRect.height;
          prev = x2 + width;
        } else {
          x2 = gridRect.x;
          y = prev;
          width = gridRect.width;
          height = tickCoord - y;
          prev = y + height;
        }
        var tickValue = ticksCoords[i2 - 1].tickValue;
        tickValue != null && newSplitAreaColors.set(tickValue, colorIndex);
        axisGroup.add(new Rect$2({
          anid: tickValue != null ? "area_" + tickValue : null,
          shape: {
            x: x2,
            y,
            width,
            height
          },
          style: defaults$1({
            fill: areaColors[colorIndex]
          }, areaStyle),
          autoBatch: true,
          silent: true
        }));
        colorIndex = (colorIndex + 1) % areaColorsLen;
      }
      inner$f(axisView).splitAreaColors = newSplitAreaColors;
    }
    function rectCoordAxisHandleRemove(axisView) {
      inner$f(axisView).splitAreaColors = null;
    }
    var axisBuilderAttrs$3 = ["axisLine", "axisTickLabel", "axisName"];
    var selfBuilderAttrs$2 = ["splitArea", "splitLine", "minorSplitLine"];
    var CartesianAxisView = (
      /** @class */
      function(_super) {
        __extends$1(CartesianAxisView2, _super);
        function CartesianAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CartesianAxisView2.type;
          _this.axisPointerClass = "CartesianAxisPointer";
          return _this;
        }
        CartesianAxisView2.prototype.render = function(axisModel, ecModel, api2, payload) {
          this.group.removeAll();
          var oldAxisGroup = this._axisGroup;
          this._axisGroup = new Group$3();
          this.group.add(this._axisGroup);
          if (!axisModel.get("show")) {
            return;
          }
          var gridModel = axisModel.getCoordSysModel();
          var layout2 = layout$2(gridModel, axisModel);
          var axisBuilder = new AxisBuilder(axisModel, extend$1({
            handleAutoShown: function(elementType) {
              var cartesians = gridModel.coordinateSystem.getCartesians();
              for (var i2 = 0; i2 < cartesians.length; i2++) {
                if (isIntervalOrLogScale(cartesians[i2].getOtherAxis(axisModel.axis).scale)) {
                  return true;
                }
              }
              return false;
            }
          }, layout2));
          each$f(axisBuilderAttrs$3, axisBuilder.add, axisBuilder);
          this._axisGroup.add(axisBuilder.getGroup());
          each$f(selfBuilderAttrs$2, function(name) {
            if (axisModel.get([name, "show"])) {
              axisElementBuilders$2[name](this, this._axisGroup, axisModel, gridModel);
            }
          }, this);
          var isInitialSortFromBarRacing = payload && payload.type === "changeAxisOrder" && payload.isInitSort;
          if (!isInitialSortFromBarRacing) {
            groupTransition(oldAxisGroup, this._axisGroup, axisModel);
          }
          _super.prototype.render.call(this, axisModel, ecModel, api2, payload);
        };
        CartesianAxisView2.prototype.remove = function() {
          rectCoordAxisHandleRemove(this);
        };
        CartesianAxisView2.type = "cartesianAxis";
        return CartesianAxisView2;
      }(AxisView)
    );
    var axisElementBuilders$2 = {
      splitLine: function(axisView, axisGroup, axisModel, gridModel) {
        var axis = axisModel.axis;
        if (axis.scale.isBlank()) {
          return;
        }
        var splitLineModel = axisModel.getModel("splitLine");
        var lineStyleModel = splitLineModel.getModel("lineStyle");
        var lineColors = lineStyleModel.get("color");
        var showMinLine = splitLineModel.get("showMinLine") !== false;
        var showMaxLine = splitLineModel.get("showMaxLine") !== false;
        lineColors = isArray$2(lineColors) ? lineColors : [lineColors];
        var gridRect = gridModel.coordinateSystem.getRect();
        var isHorizontal2 = axis.isHorizontal();
        var lineCount = 0;
        var ticksCoords = axis.getTicksCoords({
          tickModel: splitLineModel
        });
        var p1 = [];
        var p2 = [];
        var lineStyle = lineStyleModel.getLineStyle();
        for (var i2 = 0; i2 < ticksCoords.length; i2++) {
          var tickCoord = axis.toGlobalCoord(ticksCoords[i2].coord);
          if (i2 === 0 && !showMinLine || i2 === ticksCoords.length - 1 && !showMaxLine) {
            continue;
          }
          var tickValue = ticksCoords[i2].tickValue;
          if (isHorizontal2) {
            p1[0] = tickCoord;
            p1[1] = gridRect.y;
            p2[0] = tickCoord;
            p2[1] = gridRect.y + gridRect.height;
          } else {
            p1[0] = gridRect.x;
            p1[1] = tickCoord;
            p2[0] = gridRect.x + gridRect.width;
            p2[1] = tickCoord;
          }
          var colorIndex = lineCount++ % lineColors.length;
          var line = new Line$1({
            anid: tickValue != null ? "line_" + tickValue : null,
            autoBatch: true,
            shape: {
              x1: p1[0],
              y1: p1[1],
              x2: p2[0],
              y2: p2[1]
            },
            style: defaults$1({
              stroke: lineColors[colorIndex]
            }, lineStyle),
            silent: true
          });
          subPixelOptimizeLine(line.shape, lineStyle.lineWidth);
          axisGroup.add(line);
        }
      },
      minorSplitLine: function(axisView, axisGroup, axisModel, gridModel) {
        var axis = axisModel.axis;
        var minorSplitLineModel = axisModel.getModel("minorSplitLine");
        var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
        var gridRect = gridModel.coordinateSystem.getRect();
        var isHorizontal2 = axis.isHorizontal();
        var minorTicksCoords = axis.getMinorTicksCoords();
        if (!minorTicksCoords.length) {
          return;
        }
        var p1 = [];
        var p2 = [];
        var lineStyle = lineStyleModel.getLineStyle();
        for (var i2 = 0; i2 < minorTicksCoords.length; i2++) {
          for (var k2 = 0; k2 < minorTicksCoords[i2].length; k2++) {
            var tickCoord = axis.toGlobalCoord(minorTicksCoords[i2][k2].coord);
            if (isHorizontal2) {
              p1[0] = tickCoord;
              p1[1] = gridRect.y;
              p2[0] = tickCoord;
              p2[1] = gridRect.y + gridRect.height;
            } else {
              p1[0] = gridRect.x;
              p1[1] = tickCoord;
              p2[0] = gridRect.x + gridRect.width;
              p2[1] = tickCoord;
            }
            var line = new Line$1({
              anid: "minor_line_" + minorTicksCoords[i2][k2].tickValue,
              autoBatch: true,
              shape: {
                x1: p1[0],
                y1: p1[1],
                x2: p2[0],
                y2: p2[1]
              },
              style: lineStyle,
              silent: true
            });
            subPixelOptimizeLine(line.shape, lineStyle.lineWidth);
            axisGroup.add(line);
          }
        }
      },
      splitArea: function(axisView, axisGroup, axisModel, gridModel) {
        rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, gridModel);
      }
    };
    var CartesianXAxisView = (
      /** @class */
      function(_super) {
        __extends$1(CartesianXAxisView2, _super);
        function CartesianXAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CartesianXAxisView2.type;
          return _this;
        }
        CartesianXAxisView2.type = "xAxis";
        return CartesianXAxisView2;
      }(CartesianAxisView)
    );
    var CartesianYAxisView = (
      /** @class */
      function(_super) {
        __extends$1(CartesianYAxisView2, _super);
        function CartesianYAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CartesianXAxisView.type;
          return _this;
        }
        CartesianYAxisView2.type = "yAxis";
        return CartesianYAxisView2;
      }(CartesianAxisView)
    );
    var GridView = (
      /** @class */
      function(_super) {
        __extends$1(GridView2, _super);
        function GridView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "grid";
          return _this;
        }
        GridView2.prototype.render = function(gridModel, ecModel) {
          this.group.removeAll();
          if (gridModel.get("show")) {
            this.group.add(new Rect$2({
              shape: gridModel.coordinateSystem.getRect(),
              style: defaults$1({
                fill: gridModel.get("backgroundColor")
              }, gridModel.getItemStyle()),
              silent: true,
              z2: -1
            }));
          }
        };
        GridView2.type = "grid";
        return GridView2;
      }(ComponentView)
    );
    var extraOption = {
      // gridIndex: 0,
      // gridId: '',
      offset: 0
    };
    function install$N(registers) {
      registers.registerComponentView(GridView);
      registers.registerComponentModel(GridModel);
      registers.registerCoordinateSystem("cartesian2d", Grid);
      axisModelCreator(registers, "x", CartesianAxisModel, extraOption);
      axisModelCreator(registers, "y", CartesianAxisModel, extraOption);
      registers.registerComponentView(CartesianXAxisView);
      registers.registerComponentView(CartesianYAxisView);
      registers.registerPreprocessor(function(option) {
        if (option.xAxis && option.yAxis && !option.grid) {
          option.grid = {};
        }
      });
    }
    function install$M(registers) {
      use(install$N);
      registers.registerSeriesModel(ScatterSeriesModel);
      registers.registerChartView(ScatterView);
      registers.registerLayout(pointsLayout("scatter"));
    }
    function radarLayout(ecModel) {
      ecModel.eachSeriesByType("radar", function(seriesModel) {
        var data = seriesModel.getData();
        var points2 = [];
        var coordSys = seriesModel.coordinateSystem;
        if (!coordSys) {
          return;
        }
        var axes = coordSys.getIndicatorAxes();
        each$f(axes, function(axis, axisIndex) {
          data.each(data.mapDimension(axes[axisIndex].dim), function(val, dataIndex) {
            points2[dataIndex] = points2[dataIndex] || [];
            var point = coordSys.dataToPoint(val, axisIndex);
            points2[dataIndex][axisIndex] = isValidPoint(point) ? point : getValueMissingPoint(coordSys);
          });
        });
        data.each(function(idx) {
          var firstPoint = find(points2[idx], function(point) {
            return isValidPoint(point);
          }) || getValueMissingPoint(coordSys);
          points2[idx].push(firstPoint.slice());
          data.setItemLayout(idx, points2[idx]);
        });
      });
    }
    function isValidPoint(point) {
      return !isNaN(point[0]) && !isNaN(point[1]);
    }
    function getValueMissingPoint(coordSys) {
      return [coordSys.cx, coordSys.cy];
    }
    function radarBackwardCompat(option) {
      var polarOptArr = option.polar;
      if (polarOptArr) {
        if (!isArray$2(polarOptArr)) {
          polarOptArr = [polarOptArr];
        }
        var polarNotRadar_1 = [];
        each$f(polarOptArr, function(polarOpt, idx) {
          if (polarOpt.indicator) {
            if (polarOpt.type && !polarOpt.shape) {
              polarOpt.shape = polarOpt.type;
            }
            option.radar = option.radar || [];
            if (!isArray$2(option.radar)) {
              option.radar = [option.radar];
            }
            option.radar.push(polarOpt);
          } else {
            polarNotRadar_1.push(polarOpt);
          }
        });
        option.polar = polarNotRadar_1;
      }
      each$f(option.series, function(seriesOpt) {
        if (seriesOpt && seriesOpt.type === "radar" && seriesOpt.polarIndex) {
          seriesOpt.radarIndex = seriesOpt.polarIndex;
        }
      });
    }
    var RadarView$1 = (
      /** @class */
      function(_super) {
        __extends$1(RadarView2, _super);
        function RadarView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadarView2.type;
          return _this;
        }
        RadarView2.prototype.render = function(seriesModel, ecModel, api2) {
          var polar = seriesModel.coordinateSystem;
          var group = this.group;
          var data = seriesModel.getData();
          var oldData = this._data;
          function createSymbol2(data2, idx) {
            var symbolType = data2.getItemVisual(idx, "symbol") || "circle";
            if (symbolType === "none") {
              return;
            }
            var symbolSize = normalizeSymbolSize(data2.getItemVisual(idx, "symbolSize"));
            var symbolPath = createSymbol$1(symbolType, -1, -1, 2, 2);
            var symbolRotate = data2.getItemVisual(idx, "symbolRotate") || 0;
            symbolPath.attr({
              style: {
                strokeNoScale: true
              },
              z2: 100,
              scaleX: symbolSize[0] / 2,
              scaleY: symbolSize[1] / 2,
              rotation: symbolRotate * Math.PI / 180 || 0
            });
            return symbolPath;
          }
          function updateSymbols(oldPoints, newPoints, symbolGroup, data2, idx, isInit) {
            symbolGroup.removeAll();
            for (var i2 = 0; i2 < newPoints.length - 1; i2++) {
              var symbolPath = createSymbol2(data2, idx);
              if (symbolPath) {
                symbolPath.__dimIdx = i2;
                if (oldPoints[i2]) {
                  symbolPath.setPosition(oldPoints[i2]);
                  graphic[isInit ? "initProps" : "updateProps"](symbolPath, {
                    x: newPoints[i2][0],
                    y: newPoints[i2][1]
                  }, seriesModel, idx);
                } else {
                  symbolPath.setPosition(newPoints[i2]);
                }
                symbolGroup.add(symbolPath);
              }
            }
          }
          function getInitialPoints(points2) {
            return map$1(points2, function(pt3) {
              return [polar.cx, polar.cy];
            });
          }
          data.diff(oldData).add(function(idx) {
            var points2 = data.getItemLayout(idx);
            if (!points2) {
              return;
            }
            var polygon = new Polygon();
            var polyline = new Polyline$1();
            var target = {
              shape: {
                points: points2
              }
            };
            polygon.shape.points = getInitialPoints(points2);
            polyline.shape.points = getInitialPoints(points2);
            initProps(polygon, target, seriesModel, idx);
            initProps(polyline, target, seriesModel, idx);
            var itemGroup = new Group$3();
            var symbolGroup = new Group$3();
            itemGroup.add(polyline);
            itemGroup.add(polygon);
            itemGroup.add(symbolGroup);
            updateSymbols(polyline.shape.points, points2, symbolGroup, data, idx, true);
            data.setItemGraphicEl(idx, itemGroup);
          }).update(function(newIdx, oldIdx) {
            var itemGroup = oldData.getItemGraphicEl(oldIdx);
            var polyline = itemGroup.childAt(0);
            var polygon = itemGroup.childAt(1);
            var symbolGroup = itemGroup.childAt(2);
            var target = {
              shape: {
                points: data.getItemLayout(newIdx)
              }
            };
            if (!target.shape.points) {
              return;
            }
            updateSymbols(polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false);
            saveOldStyle(polygon);
            saveOldStyle(polyline);
            updateProps$1(polyline, target, seriesModel);
            updateProps$1(polygon, target, seriesModel);
            data.setItemGraphicEl(newIdx, itemGroup);
          }).remove(function(idx) {
            group.remove(oldData.getItemGraphicEl(idx));
          }).execute();
          data.eachItemGraphicEl(function(itemGroup, idx) {
            var itemModel = data.getItemModel(idx);
            var polyline = itemGroup.childAt(0);
            var polygon = itemGroup.childAt(1);
            var symbolGroup = itemGroup.childAt(2);
            var itemStyle = data.getItemVisual(idx, "style");
            var color2 = itemStyle.fill;
            group.add(itemGroup);
            polyline.useStyle(defaults$1(itemModel.getModel("lineStyle").getLineStyle(), {
              fill: "none",
              stroke: color2
            }));
            setStatesStylesFromModel(polyline, itemModel, "lineStyle");
            setStatesStylesFromModel(polygon, itemModel, "areaStyle");
            var areaStyleModel = itemModel.getModel("areaStyle");
            var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();
            polygon.ignore = polygonIgnore;
            each$f(["emphasis", "select", "blur"], function(stateName) {
              var stateModel = itemModel.getModel([stateName, "areaStyle"]);
              var stateIgnore = stateModel.isEmpty() && stateModel.parentModel.isEmpty();
              polygon.ensureState(stateName).ignore = stateIgnore && polygonIgnore;
            });
            polygon.useStyle(defaults$1(areaStyleModel.getAreaStyle(), {
              fill: color2,
              opacity: 0.7,
              decal: itemStyle.decal
            }));
            var emphasisModel = itemModel.getModel("emphasis");
            var itemHoverStyle = emphasisModel.getModel("itemStyle").getItemStyle();
            symbolGroup.eachChild(function(symbolPath) {
              if (symbolPath instanceof ZRImage) {
                var pathStyle = symbolPath.style;
                symbolPath.useStyle(extend$1({
                  // TODO other properties like x, y ?
                  image: pathStyle.image,
                  x: pathStyle.x,
                  y: pathStyle.y,
                  width: pathStyle.width,
                  height: pathStyle.height
                }, itemStyle));
              } else {
                symbolPath.useStyle(itemStyle);
                symbolPath.setColor(color2);
                symbolPath.style.strokeNoScale = true;
              }
              var pathEmphasisState = symbolPath.ensureState("emphasis");
              pathEmphasisState.style = clone$4(itemHoverStyle);
              var defaultText = data.getStore().get(data.getDimensionIndex(symbolPath.__dimIdx), idx);
              (defaultText == null || isNaN(defaultText)) && (defaultText = "");
              setLabelStyle(symbolPath, getLabelStatesModels(itemModel), {
                labelFetcher: data.hostModel,
                labelDataIndex: idx,
                labelDimIndex: symbolPath.__dimIdx,
                defaultText,
                inheritColor: color2,
                defaultOpacity: itemStyle.opacity
              });
            });
            toggleHoverEmphasis(itemGroup, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
          });
          this._data = data;
        };
        RadarView2.prototype.remove = function() {
          this.group.removeAll();
          this._data = null;
        };
        RadarView2.type = "radar";
        return RadarView2;
      }(ChartView)
    );
    var RadarSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(RadarSeriesModel2, _super);
        function RadarSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadarSeriesModel2.type;
          _this.hasSymbolVisual = true;
          return _this;
        }
        RadarSeriesModel2.prototype.init = function(option) {
          _super.prototype.init.apply(this, arguments);
          this.legendVisualProvider = new LegendVisualProvider(bind$2(this.getData, this), bind$2(this.getRawData, this));
        };
        RadarSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesDataSimply(this, {
            generateCoord: "indicator_",
            generateCoordCount: Infinity
          });
        };
        RadarSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var coordSys = this.coordinateSystem;
          var indicatorAxes = coordSys.getIndicatorAxes();
          var name = this.getData().getName(dataIndex);
          var nameToDisplay = name === "" ? this.name : name;
          var markerColor = retrieveVisualColorForTooltipMarker(this, dataIndex);
          return createTooltipMarkup("section", {
            header: nameToDisplay,
            sortBlocks: true,
            blocks: map$1(indicatorAxes, function(axis) {
              var val = data.get(data.mapDimension(axis.dim), dataIndex);
              return createTooltipMarkup("nameValue", {
                markerType: "subItem",
                markerColor,
                name: axis.name,
                value: val,
                sortParam: val
              });
            })
          });
        };
        RadarSeriesModel2.prototype.getTooltipPosition = function(dataIndex) {
          if (dataIndex != null) {
            var data_1 = this.getData();
            var coordSys = this.coordinateSystem;
            var values = data_1.getValues(map$1(coordSys.dimensions, function(dim) {
              return data_1.mapDimension(dim);
            }), dataIndex);
            for (var i2 = 0, len2 = values.length; i2 < len2; i2++) {
              if (!isNaN(values[i2])) {
                var indicatorAxes = coordSys.getIndicatorAxes();
                return coordSys.coordToPoint(indicatorAxes[i2].dataToCoord(values[i2]), i2);
              }
            }
          }
        };
        RadarSeriesModel2.type = "series.radar";
        RadarSeriesModel2.dependencies = ["radar"];
        RadarSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          colorBy: "data",
          coordinateSystem: "radar",
          legendHoverLink: true,
          radarIndex: 0,
          lineStyle: {
            width: 2,
            type: "solid",
            join: "round"
          },
          label: {
            position: "top"
          },
          // areaStyle: {
          // },
          // itemStyle: {}
          symbolSize: 8
          // symbolRotate: null
        };
        return RadarSeriesModel2;
      }(SeriesModel)
    );
    var valueAxisDefault = axisDefault.value;
    function defaultsShow(opt, show) {
      return defaults$1({
        show
      }, opt);
    }
    var RadarModel = (
      /** @class */
      function(_super) {
        __extends$1(RadarModel2, _super);
        function RadarModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadarModel2.type;
          return _this;
        }
        RadarModel2.prototype.optionUpdated = function() {
          var boundaryGap = this.get("boundaryGap");
          var splitNumber = this.get("splitNumber");
          var scale2 = this.get("scale");
          var axisLine = this.get("axisLine");
          var axisTick = this.get("axisTick");
          var axisLabel = this.get("axisLabel");
          var nameTextStyle = this.get("axisName");
          var showName = this.get(["axisName", "show"]);
          var nameFormatter = this.get(["axisName", "formatter"]);
          var nameGap = this.get("axisNameGap");
          var triggerEvent2 = this.get("triggerEvent");
          var indicatorModels = map$1(this.get("indicator") || [], function(indicatorOpt) {
            if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) {
              indicatorOpt.min = 0;
            } else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) {
              indicatorOpt.max = 0;
            }
            var iNameTextStyle = nameTextStyle;
            if (indicatorOpt.color != null) {
              iNameTextStyle = defaults$1({
                color: indicatorOpt.color
              }, nameTextStyle);
            }
            var innerIndicatorOpt = merge$1(clone$4(indicatorOpt), {
              boundaryGap,
              splitNumber,
              scale: scale2,
              axisLine,
              axisTick,
              // axisType: axisType,
              axisLabel,
              // Compatible with 2 and use text
              name: indicatorOpt.text,
              showName,
              nameLocation: "end",
              nameGap,
              // min: 0,
              nameTextStyle: iNameTextStyle,
              triggerEvent: triggerEvent2
            }, false);
            if (isString$1(nameFormatter)) {
              var indName = innerIndicatorOpt.name;
              innerIndicatorOpt.name = nameFormatter.replace("{value}", indName != null ? indName : "");
            } else if (isFunction$1(nameFormatter)) {
              innerIndicatorOpt.name = nameFormatter(innerIndicatorOpt.name, innerIndicatorOpt);
            }
            var model = new Model(innerIndicatorOpt, null, this.ecModel);
            mixin(model, AxisModelCommonMixin.prototype);
            model.mainType = "radar";
            model.componentIndex = this.componentIndex;
            return model;
          }, this);
          this._indicatorModels = indicatorModels;
        };
        RadarModel2.prototype.getIndicatorModels = function() {
          return this._indicatorModels;
        };
        RadarModel2.type = "radar";
        RadarModel2.defaultOption = {
          // zlevel: 0,
          z: 0,
          center: ["50%", "50%"],
          radius: "75%",
          startAngle: 90,
          axisName: {
            show: true
            // formatter: null
            // textStyle: {}
          },
          boundaryGap: [0, 0],
          splitNumber: 5,
          axisNameGap: 15,
          scale: false,
          // Polygon or circle
          shape: "polygon",
          axisLine: merge$1({
            lineStyle: {
              color: "#bbb"
            }
          }, valueAxisDefault.axisLine),
          axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),
          axisTick: defaultsShow(valueAxisDefault.axisTick, false),
          // axisType: 'value',
          splitLine: defaultsShow(valueAxisDefault.splitLine, true),
          splitArea: defaultsShow(valueAxisDefault.splitArea, true),
          // {text, min, max}
          indicator: []
        };
        return RadarModel2;
      }(ComponentModel)
    );
    var axisBuilderAttrs$2 = ["axisLine", "axisTickLabel", "axisName"];
    var RadarView = (
      /** @class */
      function(_super) {
        __extends$1(RadarView2, _super);
        function RadarView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadarView2.type;
          return _this;
        }
        RadarView2.prototype.render = function(radarModel, ecModel, api2) {
          var group = this.group;
          group.removeAll();
          this._buildAxes(radarModel);
          this._buildSplitLineAndArea(radarModel);
        };
        RadarView2.prototype._buildAxes = function(radarModel) {
          var radar = radarModel.coordinateSystem;
          var indicatorAxes = radar.getIndicatorAxes();
          var axisBuilders = map$1(indicatorAxes, function(indicatorAxis) {
            var axisName = indicatorAxis.model.get("showName") ? indicatorAxis.name : "";
            var axisBuilder = new AxisBuilder(indicatorAxis.model, {
              axisName,
              position: [radar.cx, radar.cy],
              rotation: indicatorAxis.angle,
              labelDirection: -1,
              tickDirection: -1,
              nameDirection: 1
            });
            return axisBuilder;
          });
          each$f(axisBuilders, function(axisBuilder) {
            each$f(axisBuilderAttrs$2, axisBuilder.add, axisBuilder);
            this.group.add(axisBuilder.getGroup());
          }, this);
        };
        RadarView2.prototype._buildSplitLineAndArea = function(radarModel) {
          var radar = radarModel.coordinateSystem;
          var indicatorAxes = radar.getIndicatorAxes();
          if (!indicatorAxes.length) {
            return;
          }
          var shape = radarModel.get("shape");
          var splitLineModel = radarModel.getModel("splitLine");
          var splitAreaModel = radarModel.getModel("splitArea");
          var lineStyleModel = splitLineModel.getModel("lineStyle");
          var areaStyleModel = splitAreaModel.getModel("areaStyle");
          var showSplitLine = splitLineModel.get("show");
          var showSplitArea = splitAreaModel.get("show");
          var splitLineColors = lineStyleModel.get("color");
          var splitAreaColors = areaStyleModel.get("color");
          var splitLineColorsArr = isArray$2(splitLineColors) ? splitLineColors : [splitLineColors];
          var splitAreaColorsArr = isArray$2(splitAreaColors) ? splitAreaColors : [splitAreaColors];
          var splitLines = [];
          var splitAreas = [];
          function getColorIndex(areaOrLine, areaOrLineColorList, idx) {
            var colorIndex2 = idx % areaOrLineColorList.length;
            areaOrLine[colorIndex2] = areaOrLine[colorIndex2] || [];
            return colorIndex2;
          }
          if (shape === "circle") {
            var ticksRadius = indicatorAxes[0].getTicksCoords();
            var cx = radar.cx;
            var cy = radar.cy;
            for (var i2 = 0; i2 < ticksRadius.length; i2++) {
              if (showSplitLine) {
                var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i2);
                splitLines[colorIndex].push(new Circle({
                  shape: {
                    cx,
                    cy,
                    r: ticksRadius[i2].coord
                  }
                }));
              }
              if (showSplitArea && i2 < ticksRadius.length - 1) {
                var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i2);
                splitAreas[colorIndex].push(new Ring({
                  shape: {
                    cx,
                    cy,
                    r0: ticksRadius[i2].coord,
                    r: ticksRadius[i2 + 1].coord
                  }
                }));
              }
            }
          } else {
            var realSplitNumber_1;
            var axesTicksPoints = map$1(indicatorAxes, function(indicatorAxis, idx) {
              var ticksCoords = indicatorAxis.getTicksCoords();
              realSplitNumber_1 = realSplitNumber_1 == null ? ticksCoords.length - 1 : Math.min(ticksCoords.length - 1, realSplitNumber_1);
              return map$1(ticksCoords, function(tickCoord) {
                return radar.coordToPoint(tickCoord.coord, idx);
              });
            });
            var prevPoints = [];
            for (var i2 = 0; i2 <= realSplitNumber_1; i2++) {
              var points2 = [];
              for (var j = 0; j < indicatorAxes.length; j++) {
                points2.push(axesTicksPoints[j][i2]);
              }
              if (points2[0]) {
                points2.push(points2[0].slice());
              }
              if (showSplitLine) {
                var colorIndex = getColorIndex(splitLines, splitLineColorsArr, i2);
                splitLines[colorIndex].push(new Polyline$1({
                  shape: {
                    points: points2
                  }
                }));
              }
              if (showSplitArea && prevPoints) {
                var colorIndex = getColorIndex(splitAreas, splitAreaColorsArr, i2 - 1);
                splitAreas[colorIndex].push(new Polygon({
                  shape: {
                    points: points2.concat(prevPoints)
                  }
                }));
              }
              prevPoints = points2.slice().reverse();
            }
          }
          var lineStyle = lineStyleModel.getLineStyle();
          var areaStyle = areaStyleModel.getAreaStyle();
          each$f(splitAreas, function(splitAreas2, idx) {
            this.group.add(mergePath(splitAreas2, {
              style: defaults$1({
                stroke: "none",
                fill: splitAreaColorsArr[idx % splitAreaColorsArr.length]
              }, areaStyle),
              silent: true
            }));
          }, this);
          each$f(splitLines, function(splitLines2, idx) {
            this.group.add(mergePath(splitLines2, {
              style: defaults$1({
                fill: "none",
                stroke: splitLineColorsArr[idx % splitLineColorsArr.length]
              }, lineStyle),
              silent: true
            }));
          }, this);
        };
        RadarView2.type = "radar";
        return RadarView2;
      }(ComponentView)
    );
    var IndicatorAxis = (
      /** @class */
      function(_super) {
        __extends$1(IndicatorAxis2, _super);
        function IndicatorAxis2(dim, scale2, radiusExtent) {
          var _this = _super.call(this, dim, scale2, radiusExtent) || this;
          _this.type = "value";
          _this.angle = 0;
          _this.name = "";
          return _this;
        }
        return IndicatorAxis2;
      }(Axis)
    );
    var Radar = (
      /** @class */
      function() {
        function Radar2(radarModel, ecModel, api2) {
          this.dimensions = [];
          this._model = radarModel;
          this._indicatorAxes = map$1(radarModel.getIndicatorModels(), function(indicatorModel, idx) {
            var dim = "indicator_" + idx;
            var indicatorAxis = new IndicatorAxis(
              dim,
              new IntervalScale()
              // (indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale()
            );
            indicatorAxis.name = indicatorModel.get("name");
            indicatorAxis.model = indicatorModel;
            indicatorModel.axis = indicatorAxis;
            this.dimensions.push(dim);
            return indicatorAxis;
          }, this);
          this.resize(radarModel, api2);
        }
        Radar2.prototype.getIndicatorAxes = function() {
          return this._indicatorAxes;
        };
        Radar2.prototype.dataToPoint = function(value, indicatorIndex) {
          var indicatorAxis = this._indicatorAxes[indicatorIndex];
          return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);
        };
        Radar2.prototype.coordToPoint = function(coord, indicatorIndex) {
          var indicatorAxis = this._indicatorAxes[indicatorIndex];
          var angle2 = indicatorAxis.angle;
          var x2 = this.cx + coord * Math.cos(angle2);
          var y = this.cy - coord * Math.sin(angle2);
          return [x2, y];
        };
        Radar2.prototype.pointToData = function(pt3) {
          var dx = pt3[0] - this.cx;
          var dy = pt3[1] - this.cy;
          var radius = Math.sqrt(dx * dx + dy * dy);
          dx /= radius;
          dy /= radius;
          var radian = Math.atan2(-dy, dx);
          var minRadianDiff = Infinity;
          var closestAxis;
          var closestAxisIdx = -1;
          for (var i2 = 0; i2 < this._indicatorAxes.length; i2++) {
            var indicatorAxis = this._indicatorAxes[i2];
            var diff = Math.abs(radian - indicatorAxis.angle);
            if (diff < minRadianDiff) {
              closestAxis = indicatorAxis;
              closestAxisIdx = i2;
              minRadianDiff = diff;
            }
          }
          return [closestAxisIdx, +(closestAxis && closestAxis.coordToData(radius))];
        };
        Radar2.prototype.resize = function(radarModel, api2) {
          var center2 = radarModel.get("center");
          var viewWidth = api2.getWidth();
          var viewHeight = api2.getHeight();
          var viewSize = Math.min(viewWidth, viewHeight) / 2;
          this.cx = parsePercent(center2[0], viewWidth);
          this.cy = parsePercent(center2[1], viewHeight);
          this.startAngle = radarModel.get("startAngle") * Math.PI / 180;
          var radius = radarModel.get("radius");
          if (isString$1(radius) || isNumber$1(radius)) {
            radius = [0, radius];
          }
          this.r0 = parsePercent(radius[0], viewSize);
          this.r = parsePercent(radius[1], viewSize);
          each$f(this._indicatorAxes, function(indicatorAxis, idx) {
            indicatorAxis.setExtent(this.r0, this.r);
            var angle2 = this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length;
            angle2 = Math.atan2(Math.sin(angle2), Math.cos(angle2));
            indicatorAxis.angle = angle2;
          }, this);
        };
        Radar2.prototype.update = function(ecModel, api2) {
          var indicatorAxes = this._indicatorAxes;
          var radarModel = this._model;
          each$f(indicatorAxes, function(indicatorAxis) {
            indicatorAxis.scale.setExtent(Infinity, -Infinity);
          });
          ecModel.eachSeriesByType("radar", function(radarSeries, idx) {
            if (radarSeries.get("coordinateSystem") !== "radar" || ecModel.getComponent("radar", radarSeries.get("radarIndex")) !== radarModel) {
              return;
            }
            var data = radarSeries.getData();
            each$f(indicatorAxes, function(indicatorAxis) {
              indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(indicatorAxis.dim));
            });
          }, this);
          var splitNumber = radarModel.get("splitNumber");
          var dummyScale = new IntervalScale();
          dummyScale.setExtent(0, splitNumber);
          dummyScale.setInterval(1);
          each$f(indicatorAxes, function(indicatorAxis, idx) {
            alignScaleTicks(indicatorAxis.scale, indicatorAxis.model, dummyScale);
          });
        };
        Radar2.prototype.convertToPixel = function(ecModel, finder, value) {
          console.warn("Not implemented.");
          return null;
        };
        Radar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          console.warn("Not implemented.");
          return null;
        };
        Radar2.prototype.containPoint = function(point) {
          console.warn("Not implemented.");
          return false;
        };
        Radar2.create = function(ecModel, api2) {
          var radarList = [];
          ecModel.eachComponent("radar", function(radarModel) {
            var radar = new Radar2(radarModel, ecModel, api2);
            radarList.push(radar);
            radarModel.coordinateSystem = radar;
          });
          ecModel.eachSeriesByType("radar", function(radarSeries) {
            if (radarSeries.get("coordinateSystem") === "radar") {
              radarSeries.coordinateSystem = radarList[radarSeries.get("radarIndex") || 0];
            }
          });
          return radarList;
        };
        Radar2.dimensions = [];
        return Radar2;
      }()
    );
    function install$L(registers) {
      registers.registerCoordinateSystem("radar", Radar);
      registers.registerComponentModel(RadarModel);
      registers.registerComponentView(RadarView);
      registers.registerVisual({
        seriesType: "radar",
        reset: function(seriesModel) {
          var data = seriesModel.getData();
          data.each(function(idx) {
            data.setItemVisual(idx, "legendIcon", "roundRect");
          });
          data.setVisual("legendIcon", "roundRect");
        }
      });
    }
    function install$K(registers) {
      use(install$L);
      registers.registerChartView(RadarView$1);
      registers.registerSeriesModel(RadarSeriesModel);
      registers.registerLayout(radarLayout);
      registers.registerProcessor(dataFilter$1("radar"));
      registers.registerPreprocessor(radarBackwardCompat);
    }
    var ATTR = "\0_ec_interaction_mutex";
    function take(zr, resourceKey, userKey) {
      var store2 = getStore(zr);
      store2[resourceKey] = userKey;
    }
    function release(zr, resourceKey, userKey) {
      var store2 = getStore(zr);
      var uKey = store2[resourceKey];
      if (uKey === userKey) {
        store2[resourceKey] = null;
      }
    }
    function isTaken(zr, resourceKey) {
      return !!getStore(zr)[resourceKey];
    }
    function getStore(zr) {
      return zr[ATTR] || (zr[ATTR] = {});
    }
    registerAction$1({
      type: "takeGlobalCursor",
      event: "globalCursorTaken",
      update: "update"
    }, noop$1);
    var RoamController = (
      /** @class */
      function(_super) {
        __extends$1(RoamController2, _super);
        function RoamController2(zr) {
          var _this = _super.call(this) || this;
          _this._zr = zr;
          var mousedownHandler = bind$2(_this._mousedownHandler, _this);
          var mousemoveHandler = bind$2(_this._mousemoveHandler, _this);
          var mouseupHandler = bind$2(_this._mouseupHandler, _this);
          var mousewheelHandler = bind$2(_this._mousewheelHandler, _this);
          var pinchHandler = bind$2(_this._pinchHandler, _this);
          _this.enable = function(controlType, opt) {
            this.disable();
            this._opt = defaults$1(clone$4(opt) || {}, {
              zoomOnMouseWheel: true,
              moveOnMouseMove: true,
              // By default, wheel do not trigger move.
              moveOnMouseWheel: false,
              preventDefaultMouseMove: true
            });
            if (controlType == null) {
              controlType = true;
            }
            if (controlType === true || controlType === "move" || controlType === "pan") {
              zr.on("mousedown", mousedownHandler);
              zr.on("mousemove", mousemoveHandler);
              zr.on("mouseup", mouseupHandler);
            }
            if (controlType === true || controlType === "scale" || controlType === "zoom") {
              zr.on("mousewheel", mousewheelHandler);
              zr.on("pinch", pinchHandler);
            }
          };
          _this.disable = function() {
            zr.off("mousedown", mousedownHandler);
            zr.off("mousemove", mousemoveHandler);
            zr.off("mouseup", mouseupHandler);
            zr.off("mousewheel", mousewheelHandler);
            zr.off("pinch", pinchHandler);
          };
          return _this;
        }
        RoamController2.prototype.isDragging = function() {
          return this._dragging;
        };
        RoamController2.prototype.isPinching = function() {
          return this._pinching;
        };
        RoamController2.prototype.setPointerChecker = function(pointerChecker) {
          this.pointerChecker = pointerChecker;
        };
        RoamController2.prototype.dispose = function() {
          this.disable();
        };
        RoamController2.prototype._mousedownHandler = function(e2) {
          if (isMiddleOrRightButtonOnMouseUpDown(e2)) {
            return;
          }
          var el = e2.target;
          while (el) {
            if (el.draggable) {
              return;
            }
            el = el.__hostTarget || el.parent;
          }
          var x2 = e2.offsetX;
          var y = e2.offsetY;
          if (this.pointerChecker && this.pointerChecker(e2, x2, y)) {
            this._x = x2;
            this._y = y;
            this._dragging = true;
          }
        };
        RoamController2.prototype._mousemoveHandler = function(e2) {
          if (!this._dragging || !isAvailableBehavior("moveOnMouseMove", e2, this._opt) || e2.gestureEvent === "pinch" || isTaken(this._zr, "globalPan")) {
            return;
          }
          var x2 = e2.offsetX;
          var y = e2.offsetY;
          var oldX = this._x;
          var oldY = this._y;
          var dx = x2 - oldX;
          var dy = y - oldY;
          this._x = x2;
          this._y = y;
          this._opt.preventDefaultMouseMove && stop(e2.event);
          trigger$1(this, "pan", "moveOnMouseMove", e2, {
            dx,
            dy,
            oldX,
            oldY,
            newX: x2,
            newY: y,
            isAvailableBehavior: null
          });
        };
        RoamController2.prototype._mouseupHandler = function(e2) {
          if (!isMiddleOrRightButtonOnMouseUpDown(e2)) {
            this._dragging = false;
          }
        };
        RoamController2.prototype._mousewheelHandler = function(e2) {
          var shouldZoom = isAvailableBehavior("zoomOnMouseWheel", e2, this._opt);
          var shouldMove = isAvailableBehavior("moveOnMouseWheel", e2, this._opt);
          var wheelDelta = e2.wheelDelta;
          var absWheelDeltaDelta = Math.abs(wheelDelta);
          var originX = e2.offsetX;
          var originY = e2.offsetY;
          if (wheelDelta === 0 || !shouldZoom && !shouldMove) {
            return;
          }
          if (shouldZoom) {
            var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1;
            var scale2 = wheelDelta > 0 ? factor : 1 / factor;
            checkPointerAndTrigger(this, "zoom", "zoomOnMouseWheel", e2, {
              scale: scale2,
              originX,
              originY,
              isAvailableBehavior: null
            });
          }
          if (shouldMove) {
            var absDelta = Math.abs(wheelDelta);
            var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05);
            checkPointerAndTrigger(this, "scrollMove", "moveOnMouseWheel", e2, {
              scrollDelta,
              originX,
              originY,
              isAvailableBehavior: null
            });
          }
        };
        RoamController2.prototype._pinchHandler = function(e2) {
          if (isTaken(this._zr, "globalPan")) {
            return;
          }
          var scale2 = e2.pinchScale > 1 ? 1.1 : 1 / 1.1;
          checkPointerAndTrigger(this, "zoom", null, e2, {
            scale: scale2,
            originX: e2.pinchX,
            originY: e2.pinchY,
            isAvailableBehavior: null
          });
        };
        return RoamController2;
      }(Eventful)
    );
    function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e2, contollerEvent) {
      if (controller.pointerChecker && controller.pointerChecker(e2, contollerEvent.originX, contollerEvent.originY)) {
        stop(e2.event);
        trigger$1(controller, eventName, behaviorToCheck, e2, contollerEvent);
      }
    }
    function trigger$1(controller, eventName, behaviorToCheck, e2, contollerEvent) {
      contollerEvent.isAvailableBehavior = bind$2(isAvailableBehavior, null, behaviorToCheck, e2);
      controller.trigger(eventName, contollerEvent);
    }
    function isAvailableBehavior(behaviorToCheck, e2, settings) {
      var setting = settings[behaviorToCheck];
      return !behaviorToCheck || setting && (!isString$1(setting) || e2.event[setting + "Key"]);
    }
    function updateViewOnPan(controllerHost, dx, dy) {
      var target = controllerHost.target;
      target.x += dx;
      target.y += dy;
      target.dirty();
    }
    function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) {
      var target = controllerHost.target;
      var zoomLimit = controllerHost.zoomLimit;
      var newZoom = controllerHost.zoom = controllerHost.zoom || 1;
      newZoom *= zoomDelta;
      if (zoomLimit) {
        var zoomMin = zoomLimit.min || 0;
        var zoomMax = zoomLimit.max || Infinity;
        newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);
      }
      var zoomScale = newZoom / controllerHost.zoom;
      controllerHost.zoom = newZoom;
      target.x -= (zoomX - target.x) * (zoomScale - 1);
      target.y -= (zoomY - target.y) * (zoomScale - 1);
      target.scaleX *= zoomScale;
      target.scaleY *= zoomScale;
      target.dirty();
    }
    var IRRELEVANT_EXCLUDES = {
      "axisPointer": 1,
      "tooltip": 1,
      "brush": 1
    };
    function onIrrelevantElement(e2, api2, targetCoordSysModel) {
      var model = api2.getComponentByElement(e2.topTarget);
      var coordSys = model && model.coordinateSystem;
      return model && model !== targetCoordSysModel && !IRRELEVANT_EXCLUDES.hasOwnProperty(model.mainType) && coordSys && coordSys.model !== targetCoordSysModel;
    }
    function parseXML(svg) {
      if (isString$1(svg)) {
        var parser = new DOMParser();
        svg = parser.parseFromString(svg, "text/xml");
      }
      var svgNode = svg;
      if (svgNode.nodeType === 9) {
        svgNode = svgNode.firstChild;
      }
      while (svgNode.nodeName.toLowerCase() !== "svg" || svgNode.nodeType !== 1) {
        svgNode = svgNode.nextSibling;
      }
      return svgNode;
    }
    var nodeParsers;
    var INHERITABLE_STYLE_ATTRIBUTES_MAP = {
      "fill": "fill",
      "stroke": "stroke",
      "stroke-width": "lineWidth",
      "opacity": "opacity",
      "fill-opacity": "fillOpacity",
      "stroke-opacity": "strokeOpacity",
      "stroke-dasharray": "lineDash",
      "stroke-dashoffset": "lineDashOffset",
      "stroke-linecap": "lineCap",
      "stroke-linejoin": "lineJoin",
      "stroke-miterlimit": "miterLimit",
      "font-family": "fontFamily",
      "font-size": "fontSize",
      "font-style": "fontStyle",
      "font-weight": "fontWeight",
      "text-anchor": "textAlign",
      "visibility": "visibility",
      "display": "display"
    };
    var INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS = keys$1(INHERITABLE_STYLE_ATTRIBUTES_MAP);
    var SELF_STYLE_ATTRIBUTES_MAP = {
      "alignment-baseline": "textBaseline",
      "stop-color": "stopColor"
    };
    var SELF_STYLE_ATTRIBUTES_MAP_KEYS = keys$1(SELF_STYLE_ATTRIBUTES_MAP);
    var SVGParser = function() {
      function SVGParser2() {
        this._defs = {};
        this._root = null;
      }
      SVGParser2.prototype.parse = function(xml, opt) {
        opt = opt || {};
        var svg = parseXML(xml);
        this._defsUsePending = [];
        var root2 = new Group$3();
        this._root = root2;
        var named = [];
        var viewBox = svg.getAttribute("viewBox") || "";
        var width = parseFloat(svg.getAttribute("width") || opt.width);
        var height = parseFloat(svg.getAttribute("height") || opt.height);
        isNaN(width) && (width = null);
        isNaN(height) && (height = null);
        parseAttributes(svg, root2, null, true, false);
        var child = svg.firstChild;
        while (child) {
          this._parseNode(child, root2, named, null, false, false);
          child = child.nextSibling;
        }
        applyDefs(this._defs, this._defsUsePending);
        this._defsUsePending = [];
        var viewBoxRect;
        var viewBoxTransform;
        if (viewBox) {
          var viewBoxArr = splitNumberSequence(viewBox);
          if (viewBoxArr.length >= 4) {
            viewBoxRect = {
              x: parseFloat(viewBoxArr[0] || 0),
              y: parseFloat(viewBoxArr[1] || 0),
              width: parseFloat(viewBoxArr[2]),
              height: parseFloat(viewBoxArr[3])
            };
          }
        }
        if (viewBoxRect && width != null && height != null) {
          viewBoxTransform = makeViewBoxTransform(viewBoxRect, { x: 0, y: 0, width, height });
          if (!opt.ignoreViewBox) {
            var elRoot = root2;
            root2 = new Group$3();
            root2.add(elRoot);
            elRoot.scaleX = elRoot.scaleY = viewBoxTransform.scale;
            elRoot.x = viewBoxTransform.x;
            elRoot.y = viewBoxTransform.y;
          }
        }
        if (!opt.ignoreRootClip && width != null && height != null) {
          root2.setClipPath(new Rect$2({
            shape: { x: 0, y: 0, width, height }
          }));
        }
        return {
          root: root2,
          width,
          height,
          viewBoxRect,
          viewBoxTransform,
          named
        };
      };
      SVGParser2.prototype._parseNode = function(xmlNode, parentGroup, named, namedFrom, isInDefs, isInText) {
        var nodeName = xmlNode.nodeName.toLowerCase();
        var el;
        var namedFromForSub = namedFrom;
        if (nodeName === "defs") {
          isInDefs = true;
        }
        if (nodeName === "text") {
          isInText = true;
        }
        if (nodeName === "defs" || nodeName === "switch") {
          el = parentGroup;
        } else {
          if (!isInDefs) {
            var parser_1 = nodeParsers[nodeName];
            if (parser_1 && hasOwn(nodeParsers, nodeName)) {
              el = parser_1.call(this, xmlNode, parentGroup);
              var nameAttr = xmlNode.getAttribute("name");
              if (nameAttr) {
                var newNamed = {
                  name: nameAttr,
                  namedFrom: null,
                  svgNodeTagLower: nodeName,
                  el
                };
                named.push(newNamed);
                if (nodeName === "g") {
                  namedFromForSub = newNamed;
                }
              } else if (namedFrom) {
                named.push({
                  name: namedFrom.name,
                  namedFrom,
                  svgNodeTagLower: nodeName,
                  el
                });
              }
              parentGroup.add(el);
            }
          }
          var parser = paintServerParsers[nodeName];
          if (parser && hasOwn(paintServerParsers, nodeName)) {
            var def2 = parser.call(this, xmlNode);
            var id = xmlNode.getAttribute("id");
            if (id) {
              this._defs[id] = def2;
            }
          }
        }
        if (el && el.isGroup) {
          var child = xmlNode.firstChild;
          while (child) {
            if (child.nodeType === 1) {
              this._parseNode(child, el, named, namedFromForSub, isInDefs, isInText);
            } else if (child.nodeType === 3 && isInText) {
              this._parseText(child, el);
            }
            child = child.nextSibling;
          }
        }
      };
      SVGParser2.prototype._parseText = function(xmlNode, parentGroup) {
        var text = new TSpan({
          style: {
            text: xmlNode.textContent
          },
          silent: true,
          x: this._textX || 0,
          y: this._textY || 0
        });
        inheritStyle(parentGroup, text);
        parseAttributes(xmlNode, text, this._defsUsePending, false, false);
        applyTextAlignment(text, parentGroup);
        var textStyle = text.style;
        var fontSize2 = textStyle.fontSize;
        if (fontSize2 && fontSize2 < 9) {
          textStyle.fontSize = 9;
          text.scaleX *= fontSize2 / 9;
          text.scaleY *= fontSize2 / 9;
        }
        var font = (textStyle.fontSize || textStyle.fontFamily) && [
          textStyle.fontStyle,
          textStyle.fontWeight,
          (textStyle.fontSize || 12) + "px",
          textStyle.fontFamily || "sans-serif"
        ].join(" ");
        textStyle.font = font;
        var rect = text.getBoundingRect();
        this._textX += rect.width;
        parentGroup.add(text);
        return text;
      };
      SVGParser2.internalField = function() {
        nodeParsers = {
          "g": function(xmlNode, parentGroup) {
            var g = new Group$3();
            inheritStyle(parentGroup, g);
            parseAttributes(xmlNode, g, this._defsUsePending, false, false);
            return g;
          },
          "rect": function(xmlNode, parentGroup) {
            var rect = new Rect$2();
            inheritStyle(parentGroup, rect);
            parseAttributes(xmlNode, rect, this._defsUsePending, false, false);
            rect.setShape({
              x: parseFloat(xmlNode.getAttribute("x") || "0"),
              y: parseFloat(xmlNode.getAttribute("y") || "0"),
              width: parseFloat(xmlNode.getAttribute("width") || "0"),
              height: parseFloat(xmlNode.getAttribute("height") || "0")
            });
            rect.silent = true;
            return rect;
          },
          "circle": function(xmlNode, parentGroup) {
            var circle = new Circle();
            inheritStyle(parentGroup, circle);
            parseAttributes(xmlNode, circle, this._defsUsePending, false, false);
            circle.setShape({
              cx: parseFloat(xmlNode.getAttribute("cx") || "0"),
              cy: parseFloat(xmlNode.getAttribute("cy") || "0"),
              r: parseFloat(xmlNode.getAttribute("r") || "0")
            });
            circle.silent = true;
            return circle;
          },
          "line": function(xmlNode, parentGroup) {
            var line = new Line$1();
            inheritStyle(parentGroup, line);
            parseAttributes(xmlNode, line, this._defsUsePending, false, false);
            line.setShape({
              x1: parseFloat(xmlNode.getAttribute("x1") || "0"),
              y1: parseFloat(xmlNode.getAttribute("y1") || "0"),
              x2: parseFloat(xmlNode.getAttribute("x2") || "0"),
              y2: parseFloat(xmlNode.getAttribute("y2") || "0")
            });
            line.silent = true;
            return line;
          },
          "ellipse": function(xmlNode, parentGroup) {
            var ellipse = new Ellipse();
            inheritStyle(parentGroup, ellipse);
            parseAttributes(xmlNode, ellipse, this._defsUsePending, false, false);
            ellipse.setShape({
              cx: parseFloat(xmlNode.getAttribute("cx") || "0"),
              cy: parseFloat(xmlNode.getAttribute("cy") || "0"),
              rx: parseFloat(xmlNode.getAttribute("rx") || "0"),
              ry: parseFloat(xmlNode.getAttribute("ry") || "0")
            });
            ellipse.silent = true;
            return ellipse;
          },
          "polygon": function(xmlNode, parentGroup) {
            var pointsStr = xmlNode.getAttribute("points");
            var pointsArr;
            if (pointsStr) {
              pointsArr = parsePoints(pointsStr);
            }
            var polygon = new Polygon({
              shape: {
                points: pointsArr || []
              },
              silent: true
            });
            inheritStyle(parentGroup, polygon);
            parseAttributes(xmlNode, polygon, this._defsUsePending, false, false);
            return polygon;
          },
          "polyline": function(xmlNode, parentGroup) {
            var pointsStr = xmlNode.getAttribute("points");
            var pointsArr;
            if (pointsStr) {
              pointsArr = parsePoints(pointsStr);
            }
            var polyline = new Polyline$1({
              shape: {
                points: pointsArr || []
              },
              silent: true
            });
            inheritStyle(parentGroup, polyline);
            parseAttributes(xmlNode, polyline, this._defsUsePending, false, false);
            return polyline;
          },
          "image": function(xmlNode, parentGroup) {
            var img = new ZRImage();
            inheritStyle(parentGroup, img);
            parseAttributes(xmlNode, img, this._defsUsePending, false, false);
            img.setStyle({
              image: xmlNode.getAttribute("xlink:href") || xmlNode.getAttribute("href"),
              x: +xmlNode.getAttribute("x"),
              y: +xmlNode.getAttribute("y"),
              width: +xmlNode.getAttribute("width"),
              height: +xmlNode.getAttribute("height")
            });
            img.silent = true;
            return img;
          },
          "text": function(xmlNode, parentGroup) {
            var x2 = xmlNode.getAttribute("x") || "0";
            var y = xmlNode.getAttribute("y") || "0";
            var dx = xmlNode.getAttribute("dx") || "0";
            var dy = xmlNode.getAttribute("dy") || "0";
            this._textX = parseFloat(x2) + parseFloat(dx);
            this._textY = parseFloat(y) + parseFloat(dy);
            var g = new Group$3();
            inheritStyle(parentGroup, g);
            parseAttributes(xmlNode, g, this._defsUsePending, false, true);
            return g;
          },
          "tspan": function(xmlNode, parentGroup) {
            var x2 = xmlNode.getAttribute("x");
            var y = xmlNode.getAttribute("y");
            if (x2 != null) {
              this._textX = parseFloat(x2);
            }
            if (y != null) {
              this._textY = parseFloat(y);
            }
            var dx = xmlNode.getAttribute("dx") || "0";
            var dy = xmlNode.getAttribute("dy") || "0";
            var g = new Group$3();
            inheritStyle(parentGroup, g);
            parseAttributes(xmlNode, g, this._defsUsePending, false, true);
            this._textX += parseFloat(dx);
            this._textY += parseFloat(dy);
            return g;
          },
          "path": function(xmlNode, parentGroup) {
            var d2 = xmlNode.getAttribute("d") || "";
            var path = createFromString(d2);
            inheritStyle(parentGroup, path);
            parseAttributes(xmlNode, path, this._defsUsePending, false, false);
            path.silent = true;
            return path;
          }
        };
      }();
      return SVGParser2;
    }();
    var paintServerParsers = {
      "lineargradient": function(xmlNode) {
        var x1 = parseInt(xmlNode.getAttribute("x1") || "0", 10);
        var y1 = parseInt(xmlNode.getAttribute("y1") || "0", 10);
        var x2 = parseInt(xmlNode.getAttribute("x2") || "10", 10);
        var y2 = parseInt(xmlNode.getAttribute("y2") || "0", 10);
        var gradient = new LinearGradient(x1, y1, x2, y2);
        parsePaintServerUnit(xmlNode, gradient);
        parseGradientColorStops(xmlNode, gradient);
        return gradient;
      },
      "radialgradient": function(xmlNode) {
        var cx = parseInt(xmlNode.getAttribute("cx") || "0", 10);
        var cy = parseInt(xmlNode.getAttribute("cy") || "0", 10);
        var r = parseInt(xmlNode.getAttribute("r") || "0", 10);
        var gradient = new RadialGradient(cx, cy, r);
        parsePaintServerUnit(xmlNode, gradient);
        parseGradientColorStops(xmlNode, gradient);
        return gradient;
      }
    };
    function parsePaintServerUnit(xmlNode, gradient) {
      var gradientUnits = xmlNode.getAttribute("gradientUnits");
      if (gradientUnits === "userSpaceOnUse") {
        gradient.global = true;
      }
    }
    function parseGradientColorStops(xmlNode, gradient) {
      var stop2 = xmlNode.firstChild;
      while (stop2) {
        if (stop2.nodeType === 1 && stop2.nodeName.toLocaleLowerCase() === "stop") {
          var offsetStr = stop2.getAttribute("offset");
          var offset2 = void 0;
          if (offsetStr && offsetStr.indexOf("%") > 0) {
            offset2 = parseInt(offsetStr, 10) / 100;
          } else if (offsetStr) {
            offset2 = parseFloat(offsetStr);
          } else {
            offset2 = 0;
          }
          var styleVals = {};
          parseInlineStyle(stop2, styleVals, styleVals);
          var stopColor = styleVals.stopColor || stop2.getAttribute("stop-color") || "#000000";
          gradient.colorStops.push({
            offset: offset2,
            color: stopColor
          });
        }
        stop2 = stop2.nextSibling;
      }
    }
    function inheritStyle(parent2, child) {
      if (parent2 && parent2.__inheritedStyle) {
        if (!child.__inheritedStyle) {
          child.__inheritedStyle = {};
        }
        defaults$1(child.__inheritedStyle, parent2.__inheritedStyle);
      }
    }
    function parsePoints(pointsString) {
      var list = splitNumberSequence(pointsString);
      var points2 = [];
      for (var i2 = 0; i2 < list.length; i2 += 2) {
        var x2 = parseFloat(list[i2]);
        var y = parseFloat(list[i2 + 1]);
        points2.push([x2, y]);
      }
      return points2;
    }
    function parseAttributes(xmlNode, el, defsUsePending, onlyInlineStyle, isTextGroup) {
      var disp = el;
      var inheritedStyle = disp.__inheritedStyle = disp.__inheritedStyle || {};
      var selfStyle = {};
      if (xmlNode.nodeType === 1) {
        parseTransformAttribute(xmlNode, el);
        parseInlineStyle(xmlNode, inheritedStyle, selfStyle);
        if (!onlyInlineStyle) {
          parseAttributeStyle(xmlNode, inheritedStyle, selfStyle);
        }
      }
      disp.style = disp.style || {};
      if (inheritedStyle.fill != null) {
        disp.style.fill = getFillStrokeStyle(disp, "fill", inheritedStyle.fill, defsUsePending);
      }
      if (inheritedStyle.stroke != null) {
        disp.style.stroke = getFillStrokeStyle(disp, "stroke", inheritedStyle.stroke, defsUsePending);
      }
      each$f([
        "lineWidth",
        "opacity",
        "fillOpacity",
        "strokeOpacity",
        "miterLimit",
        "fontSize"
      ], function(propName) {
        if (inheritedStyle[propName] != null) {
          disp.style[propName] = parseFloat(inheritedStyle[propName]);
        }
      });
      each$f([
        "lineDashOffset",
        "lineCap",
        "lineJoin",
        "fontWeight",
        "fontFamily",
        "fontStyle",
        "textAlign"
      ], function(propName) {
        if (inheritedStyle[propName] != null) {
          disp.style[propName] = inheritedStyle[propName];
        }
      });
      if (isTextGroup) {
        disp.__selfStyle = selfStyle;
      }
      if (inheritedStyle.lineDash) {
        disp.style.lineDash = map$1(splitNumberSequence(inheritedStyle.lineDash), function(str) {
          return parseFloat(str);
        });
      }
      if (inheritedStyle.visibility === "hidden" || inheritedStyle.visibility === "collapse") {
        disp.invisible = true;
      }
      if (inheritedStyle.display === "none") {
        disp.ignore = true;
      }
    }
    function applyTextAlignment(text, parentGroup) {
      var parentSelfStyle = parentGroup.__selfStyle;
      if (parentSelfStyle) {
        var textBaseline = parentSelfStyle.textBaseline;
        var zrTextBaseline = textBaseline;
        if (!textBaseline || textBaseline === "auto") {
          zrTextBaseline = "alphabetic";
        } else if (textBaseline === "baseline") {
          zrTextBaseline = "alphabetic";
        } else if (textBaseline === "before-edge" || textBaseline === "text-before-edge") {
          zrTextBaseline = "top";
        } else if (textBaseline === "after-edge" || textBaseline === "text-after-edge") {
          zrTextBaseline = "bottom";
        } else if (textBaseline === "central" || textBaseline === "mathematical") {
          zrTextBaseline = "middle";
        }
        text.style.textBaseline = zrTextBaseline;
      }
      var parentInheritedStyle = parentGroup.__inheritedStyle;
      if (parentInheritedStyle) {
        var textAlign2 = parentInheritedStyle.textAlign;
        var zrTextAlign = textAlign2;
        if (textAlign2) {
          if (textAlign2 === "middle") {
            zrTextAlign = "center";
          }
          text.style.textAlign = zrTextAlign;
        }
      }
    }
    var urlRegex = /^url\(\s*#(.*?)\)/;
    function getFillStrokeStyle(el, method, str, defsUsePending) {
      var urlMatch = str && str.match(urlRegex);
      if (urlMatch) {
        var url = trim$2(urlMatch[1]);
        defsUsePending.push([el, method, url]);
        return;
      }
      if (str === "none") {
        str = null;
      }
      return str;
    }
    function applyDefs(defs, defsUsePending) {
      for (var i2 = 0; i2 < defsUsePending.length; i2++) {
        var item = defsUsePending[i2];
        item[0].style[item[1]] = defs[item[2]];
      }
    }
    var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;
    function splitNumberSequence(rawStr) {
      return rawStr.match(numberReg) || [];
    }
    var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.eE,]*)\)/g;
    var DEGREE_TO_ANGLE = Math.PI / 180;
    function parseTransformAttribute(xmlNode, node) {
      var transform2 = xmlNode.getAttribute("transform");
      if (transform2) {
        transform2 = transform2.replace(/,/g, " ");
        var transformOps_1 = [];
        var mt2 = null;
        transform2.replace(transformRegex, function(str, type22, value2) {
          transformOps_1.push(type22, value2);
          return "";
        });
        for (var i2 = transformOps_1.length - 1; i2 > 0; i2 -= 2) {
          var value = transformOps_1[i2];
          var type = transformOps_1[i2 - 1];
          var valueArr = splitNumberSequence(value);
          mt2 = mt2 || create$1();
          switch (type) {
            case "translate":
              translate(mt2, mt2, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || "0")]);
              break;
            case "scale":
              scale$1(mt2, mt2, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);
              break;
            case "rotate":
              rotate(mt2, mt2, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [
                parseFloat(valueArr[1] || "0"),
                parseFloat(valueArr[2] || "0")
              ]);
              break;
            case "skewX":
              var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
              mul(mt2, [1, 0, sx, 1, 0, 0], mt2);
              break;
            case "skewY":
              var sy = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
              mul(mt2, [1, sy, 0, 1, 0, 0], mt2);
              break;
            case "matrix":
              mt2[0] = parseFloat(valueArr[0]);
              mt2[1] = parseFloat(valueArr[1]);
              mt2[2] = parseFloat(valueArr[2]);
              mt2[3] = parseFloat(valueArr[3]);
              mt2[4] = parseFloat(valueArr[4]);
              mt2[5] = parseFloat(valueArr[5]);
              break;
          }
        }
        node.setLocalTransform(mt2);
      }
    }
    var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g;
    function parseInlineStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
      var style = xmlNode.getAttribute("style");
      if (!style) {
        return;
      }
      styleRegex.lastIndex = 0;
      var styleRegResult;
      while ((styleRegResult = styleRegex.exec(style)) != null) {
        var svgStlAttr = styleRegResult[1];
        var zrInheritableStlAttr = hasOwn(INHERITABLE_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? INHERITABLE_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
        if (zrInheritableStlAttr) {
          inheritableStyleResult[zrInheritableStlAttr] = styleRegResult[2];
        }
        var zrSelfStlAttr = hasOwn(SELF_STYLE_ATTRIBUTES_MAP, svgStlAttr) ? SELF_STYLE_ATTRIBUTES_MAP[svgStlAttr] : null;
        if (zrSelfStlAttr) {
          selfStyleResult[zrSelfStlAttr] = styleRegResult[2];
        }
      }
    }
    function parseAttributeStyle(xmlNode, inheritableStyleResult, selfStyleResult) {
      for (var i2 = 0; i2 < INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS.length; i2++) {
        var svgAttrName = INHERITABLE_STYLE_ATTRIBUTES_MAP_KEYS[i2];
        var attrValue = xmlNode.getAttribute(svgAttrName);
        if (attrValue != null) {
          inheritableStyleResult[INHERITABLE_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
        }
      }
      for (var i2 = 0; i2 < SELF_STYLE_ATTRIBUTES_MAP_KEYS.length; i2++) {
        var svgAttrName = SELF_STYLE_ATTRIBUTES_MAP_KEYS[i2];
        var attrValue = xmlNode.getAttribute(svgAttrName);
        if (attrValue != null) {
          selfStyleResult[SELF_STYLE_ATTRIBUTES_MAP[svgAttrName]] = attrValue;
        }
      }
    }
    function makeViewBoxTransform(viewBoxRect, boundingRect) {
      var scaleX = boundingRect.width / viewBoxRect.width;
      var scaleY = boundingRect.height / viewBoxRect.height;
      var scale2 = Math.min(scaleX, scaleY);
      return {
        scale: scale2,
        x: -(viewBoxRect.x + viewBoxRect.width / 2) * scale2 + (boundingRect.x + boundingRect.width / 2),
        y: -(viewBoxRect.y + viewBoxRect.height / 2) * scale2 + (boundingRect.y + boundingRect.height / 2)
      };
    }
    function parseSVG(xml, opt) {
      var parser = new SVGParser();
      return parser.parse(xml, opt);
    }
    var REGION_AVAILABLE_SVG_TAG_MAP = createHashMap([
      "rect",
      "circle",
      "line",
      "ellipse",
      "polygon",
      "polyline",
      "path",
      // <text> <tspan> are also enabled because some SVG might paint text itself,
      // but still need to trigger events or tooltip.
      "text",
      "tspan",
      // <g> is also enabled because this case: if multiple tags share one name
      // and need label displayed, every tags will display the name, which is not
      // expected. So we can put them into a <g name="xxx">. Thereby only one label
      // displayed and located based on the bounding rect of the <g>.
      "g"
    ]);
    var GeoSVGResource = (
      /** @class */
      function() {
        function GeoSVGResource2(mapName, svg) {
          this.type = "geoSVG";
          this._usedGraphicMap = createHashMap();
          this._freedGraphics = [];
          this._mapName = mapName;
          this._parsedXML = parseXML(svg);
        }
        GeoSVGResource2.prototype.load = function() {
          var firstGraphic = this._firstGraphic;
          if (!firstGraphic) {
            firstGraphic = this._firstGraphic = this._buildGraphic(this._parsedXML);
            this._freedGraphics.push(firstGraphic);
            this._boundingRect = this._firstGraphic.boundingRect.clone();
            var _a2 = createRegions(firstGraphic.named), regions = _a2.regions, regionsMap = _a2.regionsMap;
            this._regions = regions;
            this._regionsMap = regionsMap;
          }
          return {
            boundingRect: this._boundingRect,
            regions: this._regions,
            regionsMap: this._regionsMap
          };
        };
        GeoSVGResource2.prototype._buildGraphic = function(svgXML) {
          var result;
          var rootFromParse;
          try {
            result = svgXML && parseSVG(svgXML, {
              ignoreViewBox: true,
              ignoreRootClip: true
            }) || {};
            rootFromParse = result.root;
            assert(rootFromParse != null);
          } catch (e2) {
            throw new Error("Invalid svg format\n" + e2.message);
          }
          var root2 = new Group$3();
          root2.add(rootFromParse);
          root2.isGeoSVGGraphicRoot = true;
          var svgWidth = result.width;
          var svgHeight = result.height;
          var viewBoxRect = result.viewBoxRect;
          var boundingRect = this._boundingRect;
          if (!boundingRect) {
            var bRectX = void 0;
            var bRectY = void 0;
            var bRectWidth = void 0;
            var bRectHeight = void 0;
            if (svgWidth != null) {
              bRectX = 0;
              bRectWidth = svgWidth;
            } else if (viewBoxRect) {
              bRectX = viewBoxRect.x;
              bRectWidth = viewBoxRect.width;
            }
            if (svgHeight != null) {
              bRectY = 0;
              bRectHeight = svgHeight;
            } else if (viewBoxRect) {
              bRectY = viewBoxRect.y;
              bRectHeight = viewBoxRect.height;
            }
            if (bRectX == null || bRectY == null) {
              var calculatedBoundingRect = rootFromParse.getBoundingRect();
              if (bRectX == null) {
                bRectX = calculatedBoundingRect.x;
                bRectWidth = calculatedBoundingRect.width;
              }
              if (bRectY == null) {
                bRectY = calculatedBoundingRect.y;
                bRectHeight = calculatedBoundingRect.height;
              }
            }
            boundingRect = this._boundingRect = new BoundingRect(bRectX, bRectY, bRectWidth, bRectHeight);
          }
          if (viewBoxRect) {
            var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect);
            rootFromParse.scaleX = rootFromParse.scaleY = viewBoxTransform.scale;
            rootFromParse.x = viewBoxTransform.x;
            rootFromParse.y = viewBoxTransform.y;
          }
          root2.setClipPath(new Rect$2({
            shape: boundingRect.plain()
          }));
          var named = [];
          each$f(result.named, function(namedItem) {
            if (REGION_AVAILABLE_SVG_TAG_MAP.get(namedItem.svgNodeTagLower) != null) {
              named.push(namedItem);
              setSilent(namedItem.el);
            }
          });
          return {
            root: root2,
            boundingRect,
            named
          };
        };
        GeoSVGResource2.prototype.useGraphic = function(hostKey) {
          var usedRootMap = this._usedGraphicMap;
          var svgGraphic = usedRootMap.get(hostKey);
          if (svgGraphic) {
            return svgGraphic;
          }
          svgGraphic = this._freedGraphics.pop() || this._buildGraphic(this._parsedXML);
          usedRootMap.set(hostKey, svgGraphic);
          return svgGraphic;
        };
        GeoSVGResource2.prototype.freeGraphic = function(hostKey) {
          var usedRootMap = this._usedGraphicMap;
          var svgGraphic = usedRootMap.get(hostKey);
          if (svgGraphic) {
            usedRootMap.removeKey(hostKey);
            this._freedGraphics.push(svgGraphic);
          }
        };
        return GeoSVGResource2;
      }()
    );
    function setSilent(el) {
      el.silent = false;
      if (el.isGroup) {
        el.traverse(function(child) {
          child.silent = false;
        });
      }
    }
    function createRegions(named) {
      var regions = [];
      var regionsMap = createHashMap();
      each$f(named, function(namedItem) {
        if (namedItem.namedFrom != null) {
          return;
        }
        var region = new GeoSVGRegion(namedItem.name, namedItem.el);
        regions.push(region);
        regionsMap.set(namedItem.name, region);
      });
      return {
        regions,
        regionsMap
      };
    }
    var geoCoord = [126, 25];
    var nanhaiName = "南海诸岛";
    var points$1 = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, 0.7], [52, 0.7], [56, 7.7], [59, 0.7], [64, 0.7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]];
    for (var i$4 = 0; i$4 < points$1.length; i$4++) {
      for (var k = 0; k < points$1[i$4].length; k++) {
        points$1[i$4][k][0] /= 10.5;
        points$1[i$4][k][1] /= -10.5 / 0.75;
        points$1[i$4][k][0] += geoCoord[0];
        points$1[i$4][k][1] += geoCoord[1];
      }
    }
    function fixNanhai(mapType, regions) {
      if (mapType === "china") {
        for (var i2 = 0; i2 < regions.length; i2++) {
          if (regions[i2].name === nanhaiName) {
            return;
          }
        }
        regions.push(new GeoJSONRegion(nanhaiName, map$1(points$1, function(exterior) {
          return {
            type: "polygon",
            exterior
          };
        }), geoCoord));
      }
    }
    var coordsOffsetMap = {
      "南海诸岛": [32, 80],
      // 全国
      "广东": [0, -10],
      "香港": [10, 5],
      "澳门": [-10, 10],
      // '北京': [-10, 0],
      "天津": [5, 5]
    };
    function fixTextCoords(mapType, region) {
      if (mapType === "china") {
        var coordFix = coordsOffsetMap[region.name];
        if (coordFix) {
          var cp = region.getCenter();
          cp[0] += coordFix[0] / 10.5;
          cp[1] += -coordFix[1] / (10.5 / 0.75);
          region.setCenter(cp);
        }
      }
    }
    var points = [[[123.45165252685547, 25.73527164402261], [123.49731445312499, 25.73527164402261], [123.49731445312499, 25.750734064600884], [123.45165252685547, 25.750734064600884], [123.45165252685547, 25.73527164402261]]];
    function fixDiaoyuIsland(mapType, region) {
      if (mapType === "china" && region.name === "台湾") {
        region.geometries.push({
          type: "polygon",
          exterior: points[0]
        });
      }
    }
    var DEFAULT_NAME_PROPERTY = "name";
    var GeoJSONResource = (
      /** @class */
      function() {
        function GeoJSONResource2(mapName, geoJSON, specialAreas) {
          this.type = "geoJSON";
          this._parsedMap = createHashMap();
          this._mapName = mapName;
          this._specialAreas = specialAreas;
          this._geoJSON = parseInput(geoJSON);
        }
        GeoJSONResource2.prototype.load = function(nameMap, nameProperty) {
          nameProperty = nameProperty || DEFAULT_NAME_PROPERTY;
          var parsed = this._parsedMap.get(nameProperty);
          if (!parsed) {
            var rawRegions = this._parseToRegions(nameProperty);
            parsed = this._parsedMap.set(nameProperty, {
              regions: rawRegions,
              boundingRect: calculateBoundingRect(rawRegions)
            });
          }
          var regionsMap = createHashMap();
          var finalRegions = [];
          each$f(parsed.regions, function(region) {
            var regionName = region.name;
            if (nameMap && hasOwn(nameMap, regionName)) {
              region = region.cloneShallow(regionName = nameMap[regionName]);
            }
            finalRegions.push(region);
            regionsMap.set(regionName, region);
          });
          return {
            regions: finalRegions,
            boundingRect: parsed.boundingRect || new BoundingRect(0, 0, 0, 0),
            regionsMap
          };
        };
        GeoJSONResource2.prototype._parseToRegions = function(nameProperty) {
          var mapName = this._mapName;
          var geoJSON = this._geoJSON;
          var rawRegions;
          try {
            rawRegions = geoJSON ? parseGeoJSON(geoJSON, nameProperty) : [];
          } catch (e2) {
            throw new Error("Invalid geoJson format\n" + e2.message);
          }
          fixNanhai(mapName, rawRegions);
          each$f(rawRegions, function(region) {
            var regionName = region.name;
            fixTextCoords(mapName, region);
            fixDiaoyuIsland(mapName, region);
            var specialArea = this._specialAreas && this._specialAreas[regionName];
            if (specialArea) {
              region.transformTo(specialArea.left, specialArea.top, specialArea.width, specialArea.height);
            }
          }, this);
          return rawRegions;
        };
        GeoJSONResource2.prototype.getMapForUser = function() {
          return {
            // For backward compatibility, use geoJson
            // PENDING: it has been returning them without clone.
            // do we need to avoid outsite modification?
            geoJson: this._geoJSON,
            geoJSON: this._geoJSON,
            specialAreas: this._specialAreas
          };
        };
        return GeoJSONResource2;
      }()
    );
    function calculateBoundingRect(regions) {
      var rect;
      for (var i2 = 0; i2 < regions.length; i2++) {
        var regionRect = regions[i2].getBoundingRect();
        rect = rect || regionRect.clone();
        rect.union(regionRect);
      }
      return rect;
    }
    function parseInput(source) {
      return !isString$1(source) ? source : typeof JSON !== "undefined" && JSON.parse ? JSON.parse(source) : new Function("return (" + source + ");")();
    }
    var storage = createHashMap();
    const geoSourceManager = {
      /**
       * Compatible with previous `echarts.registerMap`.
       *
       * @usage
       * ```js
       *
       * echarts.registerMap('USA', geoJson, specialAreas);
       *
       * echarts.registerMap('USA', {
       *     geoJson: geoJson,
       *     specialAreas: {...}
       * });
       * echarts.registerMap('USA', {
       *     geoJSON: geoJson,
       *     specialAreas: {...}
       * });
       *
       * echarts.registerMap('airport', {
       *     svg: svg
       * }
       * ```
       *
       * Note:
       * Do not support that register multiple geoJSON or SVG
       * one map name. Because different geoJSON and SVG have
       * different unit. It's not easy to make sure how those
       * units are mapping/normalize.
       * If intending to use multiple geoJSON or SVG, we can
       * use multiple geo coordinate system.
       */
      registerMap: function(mapName, rawDef, rawSpecialAreas) {
        if (rawDef.svg) {
          var resource = new GeoSVGResource(mapName, rawDef.svg);
          storage.set(mapName, resource);
        } else {
          var geoJSON = rawDef.geoJson || rawDef.geoJSON;
          if (geoJSON && !rawDef.features) {
            rawSpecialAreas = rawDef.specialAreas;
          } else {
            geoJSON = rawDef;
          }
          var resource = new GeoJSONResource(mapName, geoJSON, rawSpecialAreas);
          storage.set(mapName, resource);
        }
      },
      getGeoResource: function(mapName) {
        return storage.get(mapName);
      },
      /**
       * Only for exporting to users.
       * **MUST NOT** used internally.
       */
      getMapForUser: function(mapName) {
        var resource = storage.get(mapName);
        return resource && resource.type === "geoJSON" && resource.getMapForUser();
      },
      load: function(mapName, nameMap, nameProperty) {
        var resource = storage.get(mapName);
        if (!resource) {
          return;
        }
        return resource.load(nameMap, nameProperty);
      }
    };
    var OPTION_STYLE_ENABLED_TAGS = ["rect", "circle", "line", "ellipse", "polygon", "polyline", "path"];
    var OPTION_STYLE_ENABLED_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS);
    var STATE_TRIGGER_TAG_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"]));
    var LABEL_HOST_MAP = createHashMap(OPTION_STYLE_ENABLED_TAGS.concat(["g"]));
    var mapLabelRaw = makeInner();
    function getFixedItemStyle(model) {
      var itemStyle = model.getItemStyle();
      var areaColor = model.get("areaColor");
      if (areaColor != null) {
        itemStyle.fill = areaColor;
      }
      return itemStyle;
    }
    function fixLineStyle(styleHost) {
      var style = styleHost.style;
      if (style) {
        style.stroke = style.stroke || style.fill;
        style.fill = null;
      }
    }
    var MapDraw = (
      /** @class */
      function() {
        function MapDraw2(api2) {
          var group = new Group$3();
          this.uid = getUID("ec_map_draw");
          this._controller = new RoamController(api2.getZr());
          this._controllerHost = {
            target: group
          };
          this.group = group;
          group.add(this._regionsGroup = new Group$3());
          group.add(this._svgGroup = new Group$3());
        }
        MapDraw2.prototype.draw = function(mapOrGeoModel, ecModel, api2, fromView, payload) {
          var isGeo = mapOrGeoModel.mainType === "geo";
          var data = mapOrGeoModel.getData && mapOrGeoModel.getData();
          isGeo && ecModel.eachComponent({
            mainType: "series",
            subType: "map"
          }, function(mapSeries) {
            if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {
              data = mapSeries.getData();
            }
          });
          var geo = mapOrGeoModel.coordinateSystem;
          var regionsGroup = this._regionsGroup;
          var group = this.group;
          var transformInfo = geo.getTransformInfo();
          var transformInfoRaw = transformInfo.raw;
          var transformInfoRoam = transformInfo.roam;
          var isFirstDraw = !regionsGroup.childAt(0) || payload;
          if (isFirstDraw) {
            group.x = transformInfoRoam.x;
            group.y = transformInfoRoam.y;
            group.scaleX = transformInfoRoam.scaleX;
            group.scaleY = transformInfoRoam.scaleY;
            group.dirty();
          } else {
            updateProps$1(group, transformInfoRoam, mapOrGeoModel);
          }
          var isVisualEncodedByVisualMap = data && data.getVisual("visualMeta") && data.getVisual("visualMeta").length > 0;
          var viewBuildCtx = {
            api: api2,
            geo,
            mapOrGeoModel,
            data,
            isVisualEncodedByVisualMap,
            isGeo,
            transformInfoRaw
          };
          if (geo.resourceType === "geoJSON") {
            this._buildGeoJSON(viewBuildCtx);
          } else if (geo.resourceType === "geoSVG") {
            this._buildSVG(viewBuildCtx);
          }
          this._updateController(mapOrGeoModel, ecModel, api2);
          this._updateMapSelectHandler(mapOrGeoModel, regionsGroup, api2, fromView);
        };
        MapDraw2.prototype._buildGeoJSON = function(viewBuildCtx) {
          var regionsGroupByName = this._regionsGroupByName = createHashMap();
          var regionsInfoByName = createHashMap();
          var regionsGroup = this._regionsGroup;
          var transformInfoRaw = viewBuildCtx.transformInfoRaw;
          var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;
          var data = viewBuildCtx.data;
          var projection = viewBuildCtx.geo.projection;
          var projectionStream = projection && projection.stream;
          function transformPoint(point, project) {
            if (project) {
              point = project(point);
            }
            return point && [point[0] * transformInfoRaw.scaleX + transformInfoRaw.x, point[1] * transformInfoRaw.scaleY + transformInfoRaw.y];
          }
          function transformPolygonPoints(inPoints) {
            var outPoints = [];
            var project = !projectionStream && projection && projection.project;
            for (var i2 = 0; i2 < inPoints.length; ++i2) {
              var newPt = transformPoint(inPoints[i2], project);
              newPt && outPoints.push(newPt);
            }
            return outPoints;
          }
          function getPolyShape(points2) {
            return {
              shape: {
                points: transformPolygonPoints(points2)
              }
            };
          }
          regionsGroup.removeAll();
          each$f(viewBuildCtx.geo.regions, function(region) {
            var regionName = region.name;
            var regionGroup = regionsGroupByName.get(regionName);
            var _a2 = regionsInfoByName.get(regionName) || {}, dataIdx = _a2.dataIdx, regionModel = _a2.regionModel;
            if (!regionGroup) {
              regionGroup = regionsGroupByName.set(regionName, new Group$3());
              regionsGroup.add(regionGroup);
              dataIdx = data ? data.indexOfName(regionName) : null;
              regionModel = viewBuildCtx.isGeo ? mapOrGeoModel.getRegionModel(regionName) : data ? data.getItemModel(dataIdx) : null;
              var silent = regionModel.get("silent", true);
              silent != null && (regionGroup.silent = silent);
              regionsInfoByName.set(regionName, {
                dataIdx,
                regionModel
              });
            }
            var polygonSubpaths = [];
            var polylineSubpaths = [];
            each$f(region.geometries, function(geometry) {
              if (geometry.type === "polygon") {
                var polys = [geometry.exterior].concat(geometry.interiors || []);
                if (projectionStream) {
                  polys = projectPolys(polys, projectionStream);
                }
                each$f(polys, function(poly) {
                  polygonSubpaths.push(new Polygon(getPolyShape(poly)));
                });
              } else {
                var points2 = geometry.points;
                if (projectionStream) {
                  points2 = projectPolys(points2, projectionStream, true);
                }
                each$f(points2, function(points3) {
                  polylineSubpaths.push(new Polyline$1(getPolyShape(points3)));
                });
              }
            });
            var centerPt = transformPoint(region.getCenter(), projection && projection.project);
            function createCompoundPath(subpaths, isLine) {
              if (!subpaths.length) {
                return;
              }
              var compoundPath = new CompoundPath({
                culling: true,
                segmentIgnoreThreshold: 1,
                shape: {
                  paths: subpaths
                }
              });
              regionGroup.add(compoundPath);
              applyOptionStyleForRegion(viewBuildCtx, compoundPath, dataIdx, regionModel);
              resetLabelForRegion(viewBuildCtx, compoundPath, regionName, regionModel, mapOrGeoModel, dataIdx, centerPt);
              if (isLine) {
                fixLineStyle(compoundPath);
                each$f(compoundPath.states, fixLineStyle);
              }
            }
            createCompoundPath(polygonSubpaths);
            createCompoundPath(polylineSubpaths, true);
          });
          regionsGroupByName.each(function(regionGroup, regionName) {
            var _a2 = regionsInfoByName.get(regionName), dataIdx = _a2.dataIdx, regionModel = _a2.regionModel;
            resetEventTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel, dataIdx);
            resetTooltipForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);
            resetStateTriggerForRegion(viewBuildCtx, regionGroup, regionName, regionModel, mapOrGeoModel);
          }, this);
        };
        MapDraw2.prototype._buildSVG = function(viewBuildCtx) {
          var mapName = viewBuildCtx.geo.map;
          var transformInfoRaw = viewBuildCtx.transformInfoRaw;
          this._svgGroup.x = transformInfoRaw.x;
          this._svgGroup.y = transformInfoRaw.y;
          this._svgGroup.scaleX = transformInfoRaw.scaleX;
          this._svgGroup.scaleY = transformInfoRaw.scaleY;
          if (this._svgResourceChanged(mapName)) {
            this._freeSVG();
            this._useSVG(mapName);
          }
          var svgDispatcherMap = this._svgDispatcherMap = createHashMap();
          var focusSelf = false;
          each$f(this._svgGraphicRecord.named, function(namedItem) {
            var regionName = namedItem.name;
            var mapOrGeoModel = viewBuildCtx.mapOrGeoModel;
            var data = viewBuildCtx.data;
            var svgNodeTagLower = namedItem.svgNodeTagLower;
            var el = namedItem.el;
            var dataIdx = data ? data.indexOfName(regionName) : null;
            var regionModel = mapOrGeoModel.getRegionModel(regionName);
            if (OPTION_STYLE_ENABLED_TAG_MAP.get(svgNodeTagLower) != null && el instanceof Displayable) {
              applyOptionStyleForRegion(viewBuildCtx, el, dataIdx, regionModel);
            }
            if (el instanceof Displayable) {
              el.culling = true;
            }
            var silent = regionModel.get("silent", true);
            silent != null && (el.silent = silent);
            el.z2EmphasisLift = 0;
            if (!namedItem.namedFrom) {
              if (LABEL_HOST_MAP.get(svgNodeTagLower) != null) {
                resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, null);
              }
              resetEventTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx);
              resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);
              if (STATE_TRIGGER_TAG_MAP.get(svgNodeTagLower) != null) {
                var focus_1 = resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel);
                if (focus_1 === "self") {
                  focusSelf = true;
                }
                var els = svgDispatcherMap.get(regionName) || svgDispatcherMap.set(regionName, []);
                els.push(el);
              }
            }
          }, this);
          this._enableBlurEntireSVG(focusSelf, viewBuildCtx);
        };
        MapDraw2.prototype._enableBlurEntireSVG = function(focusSelf, viewBuildCtx) {
          if (focusSelf && viewBuildCtx.isGeo) {
            var blurStyle = viewBuildCtx.mapOrGeoModel.getModel(["blur", "itemStyle"]).getItemStyle();
            var opacity_1 = blurStyle.opacity;
            this._svgGraphicRecord.root.traverse(function(el) {
              if (!el.isGroup) {
                setDefaultStateProxy(el);
                var style = el.ensureState("blur").style || {};
                if (style.opacity == null && opacity_1 != null) {
                  style.opacity = opacity_1;
                }
                el.ensureState("emphasis");
              }
            });
          }
        };
        MapDraw2.prototype.remove = function() {
          this._regionsGroup.removeAll();
          this._regionsGroupByName = null;
          this._svgGroup.removeAll();
          this._freeSVG();
          this._controller.dispose();
          this._controllerHost = null;
        };
        MapDraw2.prototype.findHighDownDispatchers = function(name, geoModel) {
          if (name == null) {
            return [];
          }
          var geo = geoModel.coordinateSystem;
          if (geo.resourceType === "geoJSON") {
            var regionsGroupByName = this._regionsGroupByName;
            if (regionsGroupByName) {
              var regionGroup = regionsGroupByName.get(name);
              return regionGroup ? [regionGroup] : [];
            }
          } else if (geo.resourceType === "geoSVG") {
            return this._svgDispatcherMap && this._svgDispatcherMap.get(name) || [];
          }
        };
        MapDraw2.prototype._svgResourceChanged = function(mapName) {
          return this._svgMapName !== mapName;
        };
        MapDraw2.prototype._useSVG = function(mapName) {
          var resource = geoSourceManager.getGeoResource(mapName);
          if (resource && resource.type === "geoSVG") {
            var svgGraphic = resource.useGraphic(this.uid);
            this._svgGroup.add(svgGraphic.root);
            this._svgGraphicRecord = svgGraphic;
            this._svgMapName = mapName;
          }
        };
        MapDraw2.prototype._freeSVG = function() {
          var mapName = this._svgMapName;
          if (mapName == null) {
            return;
          }
          var resource = geoSourceManager.getGeoResource(mapName);
          if (resource && resource.type === "geoSVG") {
            resource.freeGraphic(this.uid);
          }
          this._svgGraphicRecord = null;
          this._svgDispatcherMap = null;
          this._svgGroup.removeAll();
          this._svgMapName = null;
        };
        MapDraw2.prototype._updateController = function(mapOrGeoModel, ecModel, api2) {
          var geo = mapOrGeoModel.coordinateSystem;
          var controller = this._controller;
          var controllerHost = this._controllerHost;
          controllerHost.zoomLimit = mapOrGeoModel.get("scaleLimit");
          controllerHost.zoom = geo.getZoom();
          controller.enable(mapOrGeoModel.get("roam") || false);
          var mainType = mapOrGeoModel.mainType;
          function makeActionBase() {
            var action = {
              type: "geoRoam",
              componentType: mainType
            };
            action[mainType + "Id"] = mapOrGeoModel.id;
            return action;
          }
          controller.off("pan").on("pan", function(e2) {
            this._mouseDownFlag = false;
            updateViewOnPan(controllerHost, e2.dx, e2.dy);
            api2.dispatchAction(extend$1(makeActionBase(), {
              dx: e2.dx,
              dy: e2.dy,
              animation: {
                duration: 0
              }
            }));
          }, this);
          controller.off("zoom").on("zoom", function(e2) {
            this._mouseDownFlag = false;
            updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY);
            api2.dispatchAction(extend$1(makeActionBase(), {
              totalZoom: controllerHost.zoom,
              zoom: e2.scale,
              originX: e2.originX,
              originY: e2.originY,
              animation: {
                duration: 0
              }
            }));
          }, this);
          controller.setPointerChecker(function(e2, x2, y) {
            return geo.containPoint([x2, y]) && !onIrrelevantElement(e2, api2, mapOrGeoModel);
          });
        };
        MapDraw2.prototype.resetForLabelLayout = function() {
          this.group.traverse(function(el) {
            var label = el.getTextContent();
            if (label) {
              label.ignore = mapLabelRaw(label).ignore;
            }
          });
        };
        MapDraw2.prototype._updateMapSelectHandler = function(mapOrGeoModel, regionsGroup, api2, fromView) {
          var mapDraw = this;
          regionsGroup.off("mousedown");
          regionsGroup.off("click");
          if (mapOrGeoModel.get("selectedMode")) {
            regionsGroup.on("mousedown", function() {
              mapDraw._mouseDownFlag = true;
            });
            regionsGroup.on("click", function(e2) {
              if (!mapDraw._mouseDownFlag) {
                return;
              }
              mapDraw._mouseDownFlag = false;
            });
          }
        };
        return MapDraw2;
      }()
    );
    function applyOptionStyleForRegion(viewBuildCtx, el, dataIndex, regionModel) {
      var normalStyleModel = regionModel.getModel("itemStyle");
      var emphasisStyleModel = regionModel.getModel(["emphasis", "itemStyle"]);
      var blurStyleModel = regionModel.getModel(["blur", "itemStyle"]);
      var selectStyleModel = regionModel.getModel(["select", "itemStyle"]);
      var normalStyle = getFixedItemStyle(normalStyleModel);
      var emphasisStyle = getFixedItemStyle(emphasisStyleModel);
      var selectStyle = getFixedItemStyle(selectStyleModel);
      var blurStyle = getFixedItemStyle(blurStyleModel);
      var data = viewBuildCtx.data;
      if (data) {
        var style = data.getItemVisual(dataIndex, "style");
        var decal = data.getItemVisual(dataIndex, "decal");
        if (viewBuildCtx.isVisualEncodedByVisualMap && style.fill) {
          normalStyle.fill = style.fill;
        }
        if (decal) {
          normalStyle.decal = createOrUpdatePatternFromDecal(decal, viewBuildCtx.api);
        }
      }
      el.setStyle(normalStyle);
      el.style.strokeNoScale = true;
      el.ensureState("emphasis").style = emphasisStyle;
      el.ensureState("select").style = selectStyle;
      el.ensureState("blur").style = blurStyle;
      setDefaultStateProxy(el);
    }
    function resetLabelForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel, dataIdx, labelXY) {
      var data = viewBuildCtx.data;
      var isGeo = viewBuildCtx.isGeo;
      var isDataNaN = data && isNaN(data.get(data.mapDimension("value"), dataIdx));
      var itemLayout = data && data.getItemLayout(dataIdx);
      if (isGeo || isDataNaN || itemLayout && itemLayout.showLabel) {
        var query = !isGeo ? dataIdx : regionName;
        var labelFetcher = void 0;
        if (!data || dataIdx >= 0) {
          labelFetcher = mapOrGeoModel;
        }
        var specifiedTextOpt = labelXY ? {
          normal: {
            align: "center",
            verticalAlign: "middle"
          }
        } : null;
        setLabelStyle(el, getLabelStatesModels(regionModel), {
          labelFetcher,
          labelDataIndex: query,
          defaultText: regionName
        }, specifiedTextOpt);
        var textEl = el.getTextContent();
        if (textEl) {
          mapLabelRaw(textEl).ignore = textEl.ignore;
          if (el.textConfig && labelXY) {
            var rect = el.getBoundingRect().clone();
            el.textConfig.layoutRect = rect;
            el.textConfig.position = [(labelXY[0] - rect.x) / rect.width * 100 + "%", (labelXY[1] - rect.y) / rect.height * 100 + "%"];
          }
        }
        el.disableLabelAnimation = true;
      } else {
        el.removeTextContent();
        el.removeTextConfig();
        el.disableLabelAnimation = null;
      }
    }
    function resetEventTriggerForRegion(viewBuildCtx, eventTrigger, regionName, regionModel, mapOrGeoModel, dataIdx) {
      if (viewBuildCtx.data) {
        viewBuildCtx.data.setItemGraphicEl(dataIdx, eventTrigger);
      } else {
        getECData(eventTrigger).eventData = {
          componentType: "geo",
          componentIndex: mapOrGeoModel.componentIndex,
          geoIndex: mapOrGeoModel.componentIndex,
          name: regionName,
          region: regionModel && regionModel.option || {}
        };
      }
    }
    function resetTooltipForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
      if (!viewBuildCtx.data) {
        setTooltipConfig({
          el,
          componentModel: mapOrGeoModel,
          itemName: regionName,
          // @ts-ignore FIXME:TS fix the "compatible with each other"?
          itemTooltipOption: regionModel.get("tooltip")
        });
      }
    }
    function resetStateTriggerForRegion(viewBuildCtx, el, regionName, regionModel, mapOrGeoModel) {
      el.highDownSilentOnTouch = !!mapOrGeoModel.get("selectedMode");
      var emphasisModel = regionModel.getModel("emphasis");
      var focus = emphasisModel.get("focus");
      toggleHoverEmphasis(el, focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
      if (viewBuildCtx.isGeo) {
        enableComponentHighDownFeatures(el, mapOrGeoModel, regionName);
      }
      return focus;
    }
    function projectPolys(rings, createStream, isLine) {
      var polygons = [];
      var curPoly;
      function startPolygon() {
        curPoly = [];
      }
      function endPolygon() {
        if (curPoly.length) {
          polygons.push(curPoly);
          curPoly = [];
        }
      }
      var stream = createStream({
        polygonStart: startPolygon,
        polygonEnd: endPolygon,
        lineStart: startPolygon,
        lineEnd: endPolygon,
        point: function(x2, y) {
          if (isFinite(x2) && isFinite(y)) {
            curPoly.push([x2, y]);
          }
        },
        sphere: function() {
        }
      });
      !isLine && stream.polygonStart();
      each$f(rings, function(ring) {
        stream.lineStart();
        for (var i2 = 0; i2 < ring.length; i2++) {
          stream.point(ring[i2][0], ring[i2][1]);
        }
        stream.lineEnd();
      });
      !isLine && stream.polygonEnd();
      return polygons;
    }
    var MapView = (
      /** @class */
      function(_super) {
        __extends$1(MapView2, _super);
        function MapView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MapView2.type;
          return _this;
        }
        MapView2.prototype.render = function(mapModel, ecModel, api2, payload) {
          if (payload && payload.type === "mapToggleSelect" && payload.from === this.uid) {
            return;
          }
          var group = this.group;
          group.removeAll();
          if (mapModel.getHostGeoModel()) {
            return;
          }
          if (this._mapDraw && payload && payload.type === "geoRoam") {
            this._mapDraw.resetForLabelLayout();
          }
          if (!(payload && payload.type === "geoRoam" && payload.componentType === "series" && payload.seriesId === mapModel.id)) {
            if (mapModel.needsDrawMap) {
              var mapDraw = this._mapDraw || new MapDraw(api2);
              group.add(mapDraw.group);
              mapDraw.draw(mapModel, ecModel, api2, this, payload);
              this._mapDraw = mapDraw;
            } else {
              this._mapDraw && this._mapDraw.remove();
              this._mapDraw = null;
            }
          } else {
            var mapDraw = this._mapDraw;
            mapDraw && group.add(mapDraw.group);
          }
          mapModel.get("showLegendSymbol") && ecModel.getComponent("legend") && this._renderSymbols(mapModel, ecModel, api2);
        };
        MapView2.prototype.remove = function() {
          this._mapDraw && this._mapDraw.remove();
          this._mapDraw = null;
          this.group.removeAll();
        };
        MapView2.prototype.dispose = function() {
          this._mapDraw && this._mapDraw.remove();
          this._mapDraw = null;
        };
        MapView2.prototype._renderSymbols = function(mapModel, ecModel, api2) {
          var originalData = mapModel.originalData;
          var group = this.group;
          originalData.each(originalData.mapDimension("value"), function(value, originalDataIndex) {
            if (isNaN(value)) {
              return;
            }
            var layout2 = originalData.getItemLayout(originalDataIndex);
            if (!layout2 || !layout2.point) {
              return;
            }
            var point = layout2.point;
            var offset2 = layout2.offset;
            var circle = new Circle({
              style: {
                // Because the special of map draw.
                // Which needs statistic of multiple series and draw on one map.
                // And each series also need a symbol with legend color
                //
                // Layout and visual are put one the different data
                // TODO
                fill: mapModel.getData().getVisual("style").fill
              },
              shape: {
                cx: point[0] + offset2 * 9,
                cy: point[1],
                r: 3
              },
              silent: true,
              // Do not overlap the first series, on which labels are displayed.
              z2: 8 + (!offset2 ? Z2_EMPHASIS_LIFT + 1 : 0)
            });
            if (!offset2) {
              var fullData = mapModel.mainSeries.getData();
              var name_1 = originalData.getName(originalDataIndex);
              var fullIndex_1 = fullData.indexOfName(name_1);
              var itemModel = originalData.getItemModel(originalDataIndex);
              var labelModel = itemModel.getModel("label");
              var regionGroup = fullData.getItemGraphicEl(fullIndex_1);
              setLabelStyle(circle, getLabelStatesModels(itemModel), {
                labelFetcher: {
                  getFormattedLabel: function(idx, state) {
                    return mapModel.getFormattedLabel(fullIndex_1, state);
                  }
                },
                defaultText: name_1
              });
              circle.disableLabelAnimation = true;
              if (!labelModel.get("position")) {
                circle.setTextConfig({
                  position: "bottom"
                });
              }
              regionGroup.onHoverStateChange = function(toState) {
                setStatesFlag(circle, toState);
              };
            }
            group.add(circle);
          });
        };
        MapView2.type = "map";
        return MapView2;
      }(ChartView)
    );
    var MapSeries = (
      /** @class */
      function(_super) {
        __extends$1(MapSeries2, _super);
        function MapSeries2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MapSeries2.type;
          _this.needsDrawMap = false;
          _this.seriesGroup = [];
          _this.getTooltipPosition = function(dataIndex) {
            if (dataIndex != null) {
              var name_1 = this.getData().getName(dataIndex);
              var geo = this.coordinateSystem;
              var region = geo.getRegion(name_1);
              return region && geo.dataToPoint(region.getCenter());
            }
          };
          return _this;
        }
        MapSeries2.prototype.getInitialData = function(option) {
          var data = createSeriesDataSimply(this, {
            coordDimensions: ["value"],
            encodeDefaulter: curry$1(makeSeriesEncodeForNameBased, this)
          });
          var dataNameIndexMap = createHashMap();
          var toAppendItems = [];
          for (var i2 = 0, len2 = data.count(); i2 < len2; i2++) {
            var name_2 = data.getName(i2);
            dataNameIndexMap.set(name_2, i2);
          }
          var geoSource = geoSourceManager.load(this.getMapType(), this.option.nameMap, this.option.nameProperty);
          each$f(geoSource.regions, function(region) {
            var name = region.name;
            var dataNameIdx = dataNameIndexMap.get(name);
            var specifiedGeoJSONRegionStyle = region.properties && region.properties.echartsStyle;
            var dataItem;
            if (dataNameIdx == null) {
              dataItem = {
                name
              };
              toAppendItems.push(dataItem);
            } else {
              dataItem = data.getRawDataItem(dataNameIdx);
            }
            specifiedGeoJSONRegionStyle && merge$1(dataItem, specifiedGeoJSONRegionStyle);
          });
          data.appendData(toAppendItems);
          return data;
        };
        MapSeries2.prototype.getHostGeoModel = function() {
          var geoIndex = this.option.geoIndex;
          return geoIndex != null ? this.ecModel.getComponent("geo", geoIndex) : null;
        };
        MapSeries2.prototype.getMapType = function() {
          return (this.getHostGeoModel() || this).option.map;
        };
        MapSeries2.prototype.getRawValue = function(dataIndex) {
          var data = this.getData();
          return data.get(data.mapDimension("value"), dataIndex);
        };
        MapSeries2.prototype.getRegionModel = function(regionName) {
          var data = this.getData();
          return data.getItemModel(data.indexOfName(regionName));
        };
        MapSeries2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var value = this.getRawValue(dataIndex);
          var name = data.getName(dataIndex);
          var seriesGroup = this.seriesGroup;
          var seriesNames = [];
          for (var i2 = 0; i2 < seriesGroup.length; i2++) {
            var otherIndex = seriesGroup[i2].originalData.indexOfName(name);
            var valueDim = data.mapDimension("value");
            if (!isNaN(seriesGroup[i2].originalData.get(valueDim, otherIndex))) {
              seriesNames.push(seriesGroup[i2].name);
            }
          }
          return createTooltipMarkup("section", {
            header: seriesNames.join(", "),
            noHeader: !seriesNames.length,
            blocks: [createTooltipMarkup("nameValue", {
              name,
              value
            })]
          });
        };
        MapSeries2.prototype.setZoom = function(zoom) {
          this.option.zoom = zoom;
        };
        MapSeries2.prototype.setCenter = function(center2) {
          this.option.center = center2;
        };
        MapSeries2.prototype.getLegendIcon = function(opt) {
          var iconType = opt.icon || "roundRect";
          var icon = createSymbol$1(iconType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill);
          icon.setStyle(opt.itemStyle);
          icon.style.stroke = "none";
          if (iconType.indexOf("empty") > -1) {
            icon.style.stroke = icon.style.fill;
            icon.style.fill = "#fff";
            icon.style.lineWidth = 2;
          }
          return icon;
        };
        MapSeries2.type = "series.map";
        MapSeries2.dependencies = ["geo"];
        MapSeries2.layoutMode = "box";
        MapSeries2.defaultOption = {
          // 一级层叠
          // zlevel: 0,
          // 二级层叠
          z: 2,
          coordinateSystem: "geo",
          // map should be explicitly specified since ec3.
          map: "",
          // If `geoIndex` is not specified, a exclusive geo will be
          // created. Otherwise use the specified geo component, and
          // `map` and `mapType` are ignored.
          // geoIndex: 0,
          // 'center' | 'left' | 'right' | 'x%' | {number}
          left: "center",
          // 'center' | 'top' | 'bottom' | 'x%' | {number}
          top: "center",
          // right
          // bottom
          // width:
          // height
          // Aspect is width / height. Inited to be geoJson bbox aspect
          // This parameter is used for scale this aspect
          // Default value:
          // for geoSVG source: 1,
          // for geoJSON source: 0.75.
          aspectScale: null,
          // Layout with center and size
          // If you want to put map in a fixed size box with right aspect ratio
          // This two properties may be more convenient.
          // layoutCenter: [50%, 50%]
          // layoutSize: 100
          showLegendSymbol: true,
          // Define left-top, right-bottom coords to control view
          // For example, [ [180, 90], [-180, -90] ],
          // higher priority than center and zoom
          boundingCoords: null,
          // Default on center of map
          center: null,
          zoom: 1,
          scaleLimit: null,
          selectedMode: true,
          label: {
            show: false,
            color: "#000"
          },
          // scaleLimit: null,
          itemStyle: {
            borderWidth: 0.5,
            borderColor: "#444",
            areaColor: "#eee"
          },
          emphasis: {
            label: {
              show: true,
              color: "rgb(100,0,0)"
            },
            itemStyle: {
              areaColor: "rgba(255,215,0,0.8)"
            }
          },
          select: {
            label: {
              show: true,
              color: "rgb(100,0,0)"
            },
            itemStyle: {
              color: "rgba(255,215,0,0.8)"
            }
          },
          nameProperty: "name"
        };
        return MapSeries2;
      }(SeriesModel)
    );
    function dataStatistics(datas, statisticType) {
      var dataNameMap = {};
      each$f(datas, function(data) {
        data.each(data.mapDimension("value"), function(value, idx) {
          var mapKey = "ec-" + data.getName(idx);
          dataNameMap[mapKey] = dataNameMap[mapKey] || [];
          if (!isNaN(value)) {
            dataNameMap[mapKey].push(value);
          }
        });
      });
      return datas[0].map(datas[0].mapDimension("value"), function(value, idx) {
        var mapKey = "ec-" + datas[0].getName(idx);
        var sum2 = 0;
        var min3 = Infinity;
        var max3 = -Infinity;
        var len2 = dataNameMap[mapKey].length;
        for (var i2 = 0; i2 < len2; i2++) {
          min3 = Math.min(min3, dataNameMap[mapKey][i2]);
          max3 = Math.max(max3, dataNameMap[mapKey][i2]);
          sum2 += dataNameMap[mapKey][i2];
        }
        var result;
        if (statisticType === "min") {
          result = min3;
        } else if (statisticType === "max") {
          result = max3;
        } else if (statisticType === "average") {
          result = sum2 / len2;
        } else {
          result = sum2;
        }
        return len2 === 0 ? NaN : result;
      });
    }
    function mapDataStatistic(ecModel) {
      var seriesGroups = {};
      ecModel.eachSeriesByType("map", function(seriesModel) {
        var hostGeoModel = seriesModel.getHostGeoModel();
        var key = hostGeoModel ? "o" + hostGeoModel.id : "i" + seriesModel.getMapType();
        (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel);
      });
      each$f(seriesGroups, function(seriesList, key) {
        var data = dataStatistics(map$1(seriesList, function(seriesModel) {
          return seriesModel.getData();
        }), seriesList[0].get("mapValueCalculation"));
        for (var i2 = 0; i2 < seriesList.length; i2++) {
          seriesList[i2].originalData = seriesList[i2].getData();
        }
        for (var i2 = 0; i2 < seriesList.length; i2++) {
          seriesList[i2].seriesGroup = seriesList;
          seriesList[i2].needsDrawMap = i2 === 0 && !seriesList[i2].getHostGeoModel();
          seriesList[i2].setData(data.cloneShallow());
          seriesList[i2].mainSeries = seriesList[0];
        }
      });
    }
    function mapSymbolLayout(ecModel) {
      var processedMapType = {};
      ecModel.eachSeriesByType("map", function(mapSeries) {
        var mapType = mapSeries.getMapType();
        if (mapSeries.getHostGeoModel() || processedMapType[mapType]) {
          return;
        }
        var mapSymbolOffsets = {};
        each$f(mapSeries.seriesGroup, function(subMapSeries) {
          var geo = subMapSeries.coordinateSystem;
          var data2 = subMapSeries.originalData;
          if (subMapSeries.get("showLegendSymbol") && ecModel.getComponent("legend")) {
            data2.each(data2.mapDimension("value"), function(value, idx) {
              var name = data2.getName(idx);
              var region = geo.getRegion(name);
              if (!region || isNaN(value)) {
                return;
              }
              var offset2 = mapSymbolOffsets[name] || 0;
              var point = geo.dataToPoint(region.getCenter());
              mapSymbolOffsets[name] = offset2 + 1;
              data2.setItemLayout(idx, {
                point,
                offset: offset2
              });
            });
          }
        });
        var data = mapSeries.getData();
        data.each(function(idx) {
          var name = data.getName(idx);
          var layout2 = data.getItemLayout(idx) || {};
          layout2.showLabel = !mapSymbolOffsets[name];
          data.setItemLayout(idx, layout2);
        });
        processedMapType[mapType] = true;
      });
    }
    var v2ApplyTransform = applyTransform$1;
    var View = (
      /** @class */
      function(_super) {
        __extends$1(View2, _super);
        function View2(name) {
          var _this = _super.call(this) || this;
          _this.type = "view";
          _this.dimensions = ["x", "y"];
          _this._roamTransformable = new Transformable();
          _this._rawTransformable = new Transformable();
          _this.name = name;
          return _this;
        }
        View2.prototype.setBoundingRect = function(x2, y, width, height) {
          this._rect = new BoundingRect(x2, y, width, height);
          return this._rect;
        };
        View2.prototype.getBoundingRect = function() {
          return this._rect;
        };
        View2.prototype.setViewRect = function(x2, y, width, height) {
          this._transformTo(x2, y, width, height);
          this._viewRect = new BoundingRect(x2, y, width, height);
        };
        View2.prototype._transformTo = function(x2, y, width, height) {
          var rect = this.getBoundingRect();
          var rawTransform = this._rawTransformable;
          rawTransform.transform = rect.calculateTransform(new BoundingRect(x2, y, width, height));
          var rawParent = rawTransform.parent;
          rawTransform.parent = null;
          rawTransform.decomposeTransform();
          rawTransform.parent = rawParent;
          this._updateTransform();
        };
        View2.prototype.setCenter = function(centerCoord, api2) {
          if (!centerCoord) {
            return;
          }
          this._center = [parsePercent(centerCoord[0], api2.getWidth()), parsePercent(centerCoord[1], api2.getHeight())];
          this._updateCenterAndZoom();
        };
        View2.prototype.setZoom = function(zoom) {
          zoom = zoom || 1;
          var zoomLimit = this.zoomLimit;
          if (zoomLimit) {
            if (zoomLimit.max != null) {
              zoom = Math.min(zoomLimit.max, zoom);
            }
            if (zoomLimit.min != null) {
              zoom = Math.max(zoomLimit.min, zoom);
            }
          }
          this._zoom = zoom;
          this._updateCenterAndZoom();
        };
        View2.prototype.getDefaultCenter = function() {
          var rawRect = this.getBoundingRect();
          var cx = rawRect.x + rawRect.width / 2;
          var cy = rawRect.y + rawRect.height / 2;
          return [cx, cy];
        };
        View2.prototype.getCenter = function() {
          return this._center || this.getDefaultCenter();
        };
        View2.prototype.getZoom = function() {
          return this._zoom || 1;
        };
        View2.prototype.getRoamTransform = function() {
          return this._roamTransformable.getLocalTransform();
        };
        View2.prototype._updateCenterAndZoom = function() {
          var rawTransformMatrix = this._rawTransformable.getLocalTransform();
          var roamTransform = this._roamTransformable;
          var defaultCenter = this.getDefaultCenter();
          var center2 = this.getCenter();
          var zoom = this.getZoom();
          center2 = applyTransform$1([], center2, rawTransformMatrix);
          defaultCenter = applyTransform$1([], defaultCenter, rawTransformMatrix);
          roamTransform.originX = center2[0];
          roamTransform.originY = center2[1];
          roamTransform.x = defaultCenter[0] - center2[0];
          roamTransform.y = defaultCenter[1] - center2[1];
          roamTransform.scaleX = roamTransform.scaleY = zoom;
          this._updateTransform();
        };
        View2.prototype._updateTransform = function() {
          var roamTransformable = this._roamTransformable;
          var rawTransformable = this._rawTransformable;
          rawTransformable.parent = roamTransformable;
          roamTransformable.updateTransform();
          rawTransformable.updateTransform();
          copy(this.transform || (this.transform = []), rawTransformable.transform || create$1());
          this._rawTransform = rawTransformable.getLocalTransform();
          this.invTransform = this.invTransform || [];
          invert(this.invTransform, this.transform);
          this.decomposeTransform();
        };
        View2.prototype.getTransformInfo = function() {
          var rawTransformable = this._rawTransformable;
          var roamTransformable = this._roamTransformable;
          var dummyTransformable2 = new Transformable();
          dummyTransformable2.transform = roamTransformable.transform;
          dummyTransformable2.decomposeTransform();
          return {
            roam: {
              x: dummyTransformable2.x,
              y: dummyTransformable2.y,
              scaleX: dummyTransformable2.scaleX,
              scaleY: dummyTransformable2.scaleY
            },
            raw: {
              x: rawTransformable.x,
              y: rawTransformable.y,
              scaleX: rawTransformable.scaleX,
              scaleY: rawTransformable.scaleY
            }
          };
        };
        View2.prototype.getViewRect = function() {
          return this._viewRect;
        };
        View2.prototype.getViewRectAfterRoam = function() {
          var rect = this.getBoundingRect().clone();
          rect.applyTransform(this.transform);
          return rect;
        };
        View2.prototype.dataToPoint = function(data, noRoam, out2) {
          var transform2 = noRoam ? this._rawTransform : this.transform;
          out2 = out2 || [];
          return transform2 ? v2ApplyTransform(out2, data, transform2) : copy$1(out2, data);
        };
        View2.prototype.pointToData = function(point) {
          var invTransform = this.invTransform;
          return invTransform ? v2ApplyTransform([], point, invTransform) : [point[0], point[1]];
        };
        View2.prototype.convertToPixel = function(ecModel, finder, value) {
          var coordSys = getCoordSys$4(finder);
          return coordSys === this ? coordSys.dataToPoint(value) : null;
        };
        View2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          var coordSys = getCoordSys$4(finder);
          return coordSys === this ? coordSys.pointToData(pixel) : null;
        };
        View2.prototype.containPoint = function(point) {
          return this.getViewRectAfterRoam().contain(point[0], point[1]);
        };
        View2.dimensions = ["x", "y"];
        return View2;
      }(Transformable)
    );
    function getCoordSys$4(finder) {
      var seriesModel = finder.seriesModel;
      return seriesModel ? seriesModel.coordinateSystem : null;
    }
    var GEO_DEFAULT_PARAMS = {
      "geoJSON": {
        aspectScale: 0.75,
        invertLongitute: true
      },
      "geoSVG": {
        aspectScale: 1,
        invertLongitute: false
      }
    };
    var geo2DDimensions = ["lng", "lat"];
    var Geo = (
      /** @class */
      function(_super) {
        __extends$1(Geo2, _super);
        function Geo2(name, map2, opt) {
          var _this = _super.call(this, name) || this;
          _this.dimensions = geo2DDimensions;
          _this.type = "geo";
          _this._nameCoordMap = createHashMap();
          _this.map = map2;
          var projection = opt.projection;
          var source = geoSourceManager.load(map2, opt.nameMap, opt.nameProperty);
          var resource = geoSourceManager.getGeoResource(map2);
          _this.resourceType = resource ? resource.type : null;
          var regions = _this.regions = source.regions;
          var defaultParams = GEO_DEFAULT_PARAMS[resource.type];
          _this._regionsMap = source.regionsMap;
          _this.regions = source.regions;
          _this.projection = projection;
          var boundingRect;
          if (projection) {
            for (var i2 = 0; i2 < regions.length; i2++) {
              var regionRect = regions[i2].getBoundingRect(projection);
              boundingRect = boundingRect || regionRect.clone();
              boundingRect.union(regionRect);
            }
          } else {
            boundingRect = source.boundingRect;
          }
          _this.setBoundingRect(boundingRect.x, boundingRect.y, boundingRect.width, boundingRect.height);
          _this.aspectScale = projection ? 1 : retrieve2(opt.aspectScale, defaultParams.aspectScale);
          _this._invertLongitute = projection ? false : defaultParams.invertLongitute;
          return _this;
        }
        Geo2.prototype._transformTo = function(x2, y, width, height) {
          var rect = this.getBoundingRect();
          var invertLongitute = this._invertLongitute;
          rect = rect.clone();
          if (invertLongitute) {
            rect.y = -rect.y - rect.height;
          }
          var rawTransformable = this._rawTransformable;
          rawTransformable.transform = rect.calculateTransform(new BoundingRect(x2, y, width, height));
          var rawParent = rawTransformable.parent;
          rawTransformable.parent = null;
          rawTransformable.decomposeTransform();
          rawTransformable.parent = rawParent;
          if (invertLongitute) {
            rawTransformable.scaleY = -rawTransformable.scaleY;
          }
          this._updateTransform();
        };
        Geo2.prototype.getRegion = function(name) {
          return this._regionsMap.get(name);
        };
        Geo2.prototype.getRegionByCoord = function(coord) {
          var regions = this.regions;
          for (var i2 = 0; i2 < regions.length; i2++) {
            var region = regions[i2];
            if (region.type === "geoJSON" && region.contain(coord)) {
              return regions[i2];
            }
          }
        };
        Geo2.prototype.addGeoCoord = function(name, geoCoord2) {
          this._nameCoordMap.set(name, geoCoord2);
        };
        Geo2.prototype.getGeoCoord = function(name) {
          var region = this._regionsMap.get(name);
          return this._nameCoordMap.get(name) || region && region.getCenter();
        };
        Geo2.prototype.dataToPoint = function(data, noRoam, out2) {
          if (isString$1(data)) {
            data = this.getGeoCoord(data);
          }
          if (data) {
            var projection = this.projection;
            if (projection) {
              data = projection.project(data);
            }
            return data && this.projectedToPoint(data, noRoam, out2);
          }
        };
        Geo2.prototype.pointToData = function(point) {
          var projection = this.projection;
          if (projection) {
            point = projection.unproject(point);
          }
          return point && this.pointToProjected(point);
        };
        Geo2.prototype.pointToProjected = function(point) {
          return _super.prototype.pointToData.call(this, point);
        };
        Geo2.prototype.projectedToPoint = function(projected, noRoam, out2) {
          return _super.prototype.dataToPoint.call(this, projected, noRoam, out2);
        };
        Geo2.prototype.convertToPixel = function(ecModel, finder, value) {
          var coordSys = getCoordSys$3(finder);
          return coordSys === this ? coordSys.dataToPoint(value) : null;
        };
        Geo2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          var coordSys = getCoordSys$3(finder);
          return coordSys === this ? coordSys.pointToData(pixel) : null;
        };
        return Geo2;
      }(View)
    );
    mixin(Geo, View);
    function getCoordSys$3(finder) {
      var geoModel = finder.geoModel;
      var seriesModel = finder.seriesModel;
      return geoModel ? geoModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem || (seriesModel.getReferringComponents("geo", SINGLE_REFERRING).models[0] || {}).coordinateSystem : null;
    }
    function resizeGeo(geoModel, api2) {
      var boundingCoords = geoModel.get("boundingCoords");
      if (boundingCoords != null) {
        var leftTop_1 = boundingCoords[0];
        var rightBottom_1 = boundingCoords[1];
        if (!(isFinite(leftTop_1[0]) && isFinite(leftTop_1[1]) && isFinite(rightBottom_1[0]) && isFinite(rightBottom_1[1]))) ;
        else {
          var projection_1 = this.projection;
          if (projection_1) {
            var xMin = leftTop_1[0];
            var yMin = leftTop_1[1];
            var xMax = rightBottom_1[0];
            var yMax = rightBottom_1[1];
            leftTop_1 = [Infinity, Infinity];
            rightBottom_1 = [-Infinity, -Infinity];
            var sampleLine = function(x0, y0, x1, y1) {
              var dx = x1 - x0;
              var dy = y1 - y0;
              for (var i2 = 0; i2 <= 100; i2++) {
                var p2 = i2 / 100;
                var pt3 = projection_1.project([x0 + dx * p2, y0 + dy * p2]);
                min$1(leftTop_1, leftTop_1, pt3);
                max$1(rightBottom_1, rightBottom_1, pt3);
              }
            };
            sampleLine(xMin, yMin, xMax, yMin);
            sampleLine(xMax, yMin, xMax, yMax);
            sampleLine(xMax, yMax, xMin, yMax);
            sampleLine(xMin, yMax, xMax, yMin);
          }
          this.setBoundingRect(leftTop_1[0], leftTop_1[1], rightBottom_1[0] - leftTop_1[0], rightBottom_1[1] - leftTop_1[1]);
        }
      }
      var rect = this.getBoundingRect();
      var centerOption = geoModel.get("layoutCenter");
      var sizeOption = geoModel.get("layoutSize");
      var viewWidth = api2.getWidth();
      var viewHeight = api2.getHeight();
      var aspect = rect.width / rect.height * this.aspectScale;
      var useCenterAndSize = false;
      var center2;
      var size;
      if (centerOption && sizeOption) {
        center2 = [parsePercent(centerOption[0], viewWidth), parsePercent(centerOption[1], viewHeight)];
        size = parsePercent(sizeOption, Math.min(viewWidth, viewHeight));
        if (!isNaN(center2[0]) && !isNaN(center2[1]) && !isNaN(size)) {
          useCenterAndSize = true;
        }
      }
      var viewRect2;
      if (useCenterAndSize) {
        viewRect2 = {};
        if (aspect > 1) {
          viewRect2.width = size;
          viewRect2.height = size / aspect;
        } else {
          viewRect2.height = size;
          viewRect2.width = size * aspect;
        }
        viewRect2.y = center2[1] - viewRect2.height / 2;
        viewRect2.x = center2[0] - viewRect2.width / 2;
      } else {
        var boxLayoutOption = geoModel.getBoxLayoutParams();
        boxLayoutOption.aspect = aspect;
        viewRect2 = getLayoutRect(boxLayoutOption, {
          width: viewWidth,
          height: viewHeight
        });
      }
      this.setViewRect(viewRect2.x, viewRect2.y, viewRect2.width, viewRect2.height);
      this.setCenter(geoModel.get("center"), api2);
      this.setZoom(geoModel.get("zoom"));
    }
    function setGeoCoords(geo, model) {
      each$f(model.get("geoCoord"), function(geoCoord2, name) {
        geo.addGeoCoord(name, geoCoord2);
      });
    }
    var GeoCreator = (
      /** @class */
      function() {
        function GeoCreator2() {
          this.dimensions = geo2DDimensions;
        }
        GeoCreator2.prototype.create = function(ecModel, api2) {
          var geoList = [];
          function getCommonGeoProperties(model) {
            return {
              nameProperty: model.get("nameProperty"),
              aspectScale: model.get("aspectScale"),
              projection: model.get("projection")
            };
          }
          ecModel.eachComponent("geo", function(geoModel, idx) {
            var mapName = geoModel.get("map");
            var geo = new Geo(mapName + idx, mapName, extend$1({
              nameMap: geoModel.get("nameMap")
            }, getCommonGeoProperties(geoModel)));
            geo.zoomLimit = geoModel.get("scaleLimit");
            geoList.push(geo);
            geoModel.coordinateSystem = geo;
            geo.model = geoModel;
            geo.resize = resizeGeo;
            geo.resize(geoModel, api2);
          });
          ecModel.eachSeries(function(seriesModel) {
            var coordSys = seriesModel.get("coordinateSystem");
            if (coordSys === "geo") {
              var geoIndex = seriesModel.get("geoIndex") || 0;
              seriesModel.coordinateSystem = geoList[geoIndex];
            }
          });
          var mapModelGroupBySeries = {};
          ecModel.eachSeriesByType("map", function(seriesModel) {
            if (!seriesModel.getHostGeoModel()) {
              var mapType = seriesModel.getMapType();
              mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];
              mapModelGroupBySeries[mapType].push(seriesModel);
            }
          });
          each$f(mapModelGroupBySeries, function(mapSeries, mapType) {
            var nameMapList = map$1(mapSeries, function(singleMapSeries) {
              return singleMapSeries.get("nameMap");
            });
            var geo = new Geo(mapType, mapType, extend$1({
              nameMap: mergeAll(nameMapList)
            }, getCommonGeoProperties(mapSeries[0])));
            geo.zoomLimit = retrieve.apply(null, map$1(mapSeries, function(singleMapSeries) {
              return singleMapSeries.get("scaleLimit");
            }));
            geoList.push(geo);
            geo.resize = resizeGeo;
            geo.resize(mapSeries[0], api2);
            each$f(mapSeries, function(singleMapSeries) {
              singleMapSeries.coordinateSystem = geo;
              setGeoCoords(geo, singleMapSeries);
            });
          });
          return geoList;
        };
        GeoCreator2.prototype.getFilledRegions = function(originRegionArr, mapName, nameMap, nameProperty) {
          var regionsArr = (originRegionArr || []).slice();
          var dataNameMap = createHashMap();
          for (var i2 = 0; i2 < regionsArr.length; i2++) {
            dataNameMap.set(regionsArr[i2].name, regionsArr[i2]);
          }
          var source = geoSourceManager.load(mapName, nameMap, nameProperty);
          each$f(source.regions, function(region) {
            var name = region.name;
            var regionOption = dataNameMap.get(name);
            var specifiedGeoJSONRegionStyle = region.properties && region.properties.echartsStyle;
            if (!regionOption) {
              regionOption = {
                name
              };
              regionsArr.push(regionOption);
            }
            specifiedGeoJSONRegionStyle && merge$1(regionOption, specifiedGeoJSONRegionStyle);
          });
          return regionsArr;
        };
        return GeoCreator2;
      }()
    );
    var geoCreator = new GeoCreator();
    var GeoModel = (
      /** @class */
      function(_super) {
        __extends$1(GeoModel2, _super);
        function GeoModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GeoModel2.type;
          return _this;
        }
        GeoModel2.prototype.init = function(option, parentModel, ecModel) {
          var source = geoSourceManager.getGeoResource(option.map);
          if (source && source.type === "geoJSON") {
            var itemStyle = option.itemStyle = option.itemStyle || {};
            if (!("color" in itemStyle)) {
              itemStyle.color = "#eee";
            }
          }
          this.mergeDefaultAndTheme(option, ecModel);
          defaultEmphasis(option, "label", ["show"]);
        };
        GeoModel2.prototype.optionUpdated = function() {
          var _this = this;
          var option = this.option;
          option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap, option.nameProperty);
          var selectedMap = {};
          this._optionModelMap = reduce(option.regions || [], function(optionModelMap, regionOpt) {
            var regionName = regionOpt.name;
            if (regionName) {
              optionModelMap.set(regionName, new Model(regionOpt, _this, _this.ecModel));
              if (regionOpt.selected) {
                selectedMap[regionName] = true;
              }
            }
            return optionModelMap;
          }, createHashMap());
          if (!option.selectedMap) {
            option.selectedMap = selectedMap;
          }
        };
        GeoModel2.prototype.getRegionModel = function(name) {
          return this._optionModelMap.get(name) || new Model(null, this, this.ecModel);
        };
        GeoModel2.prototype.getFormattedLabel = function(name, status) {
          var regionModel = this.getRegionModel(name);
          var formatter2 = status === "normal" ? regionModel.get(["label", "formatter"]) : regionModel.get(["emphasis", "label", "formatter"]);
          var params = {
            name
          };
          if (isFunction$1(formatter2)) {
            params.status = status;
            return formatter2(params);
          } else if (isString$1(formatter2)) {
            return formatter2.replace("{a}", name != null ? name : "");
          }
        };
        GeoModel2.prototype.setZoom = function(zoom) {
          this.option.zoom = zoom;
        };
        GeoModel2.prototype.setCenter = function(center2) {
          this.option.center = center2;
        };
        GeoModel2.prototype.select = function(name) {
          var option = this.option;
          var selectedMode = option.selectedMode;
          if (!selectedMode) {
            return;
          }
          if (selectedMode !== "multiple") {
            option.selectedMap = null;
          }
          var selectedMap = option.selectedMap || (option.selectedMap = {});
          selectedMap[name] = true;
        };
        GeoModel2.prototype.unSelect = function(name) {
          var selectedMap = this.option.selectedMap;
          if (selectedMap) {
            selectedMap[name] = false;
          }
        };
        GeoModel2.prototype.toggleSelected = function(name) {
          this[this.isSelected(name) ? "unSelect" : "select"](name);
        };
        GeoModel2.prototype.isSelected = function(name) {
          var selectedMap = this.option.selectedMap;
          return !!(selectedMap && selectedMap[name]);
        };
        GeoModel2.type = "geo";
        GeoModel2.layoutMode = "box";
        GeoModel2.defaultOption = {
          // zlevel: 0,
          z: 0,
          show: true,
          left: "center",
          top: "center",
          // Default value:
          // for geoSVG source: 1,
          // for geoJSON source: 0.75.
          aspectScale: null,
          // /// Layout with center and size
          // If you want to put map in a fixed size box with right aspect ratio
          // This two properties may be more convenient
          // layoutCenter: [50%, 50%]
          // layoutSize: 100
          silent: false,
          // Map type
          map: "",
          // Define left-top, right-bottom coords to control view
          // For example, [ [180, 90], [-180, -90] ]
          boundingCoords: null,
          // Default on center of map
          center: null,
          zoom: 1,
          scaleLimit: null,
          // selectedMode: false
          label: {
            show: false,
            color: "#000"
          },
          itemStyle: {
            borderWidth: 0.5,
            borderColor: "#444"
            // Default color:
            // + geoJSON: #eee
            // + geoSVG: null (use SVG original `fill`)
            // color: '#eee'
          },
          emphasis: {
            label: {
              show: true,
              color: "rgb(100,0,0)"
            },
            itemStyle: {
              color: "rgba(255,215,0,0.8)"
            }
          },
          select: {
            label: {
              show: true,
              color: "rgb(100,0,0)"
            },
            itemStyle: {
              color: "rgba(255,215,0,0.8)"
            }
          },
          regions: []
          // tooltip: {
          //     show: false
          // }
        };
        return GeoModel2;
      }(ComponentModel)
    );
    function getCenterCoord(view, point) {
      return view.pointToProjected ? view.pointToProjected(point) : view.pointToData(point);
    }
    function updateCenterAndZoom(view, payload, zoomLimit, api2) {
      var previousZoom = view.getZoom();
      var center2 = view.getCenter();
      var zoom = payload.zoom;
      var point = view.projectedToPoint ? view.projectedToPoint(center2) : view.dataToPoint(center2);
      if (payload.dx != null && payload.dy != null) {
        point[0] -= payload.dx;
        point[1] -= payload.dy;
        view.setCenter(getCenterCoord(view, point), api2);
      }
      if (zoom != null) {
        if (zoomLimit) {
          var zoomMin = zoomLimit.min || 0;
          var zoomMax = zoomLimit.max || Infinity;
          zoom = Math.max(Math.min(previousZoom * zoom, zoomMax), zoomMin) / previousZoom;
        }
        view.scaleX *= zoom;
        view.scaleY *= zoom;
        var fixX = (payload.originX - view.x) * (zoom - 1);
        var fixY = (payload.originY - view.y) * (zoom - 1);
        view.x -= fixX;
        view.y -= fixY;
        view.updateTransform();
        view.setCenter(getCenterCoord(view, point), api2);
        view.setZoom(zoom * previousZoom);
      }
      return {
        center: view.getCenter(),
        zoom: view.getZoom()
      };
    }
    var GeoView = (
      /** @class */
      function(_super) {
        __extends$1(GeoView2, _super);
        function GeoView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GeoView2.type;
          _this.focusBlurEnabled = true;
          return _this;
        }
        GeoView2.prototype.init = function(ecModel, api2) {
          this._api = api2;
        };
        GeoView2.prototype.render = function(geoModel, ecModel, api2, payload) {
          this._model = geoModel;
          if (!geoModel.get("show")) {
            this._mapDraw && this._mapDraw.remove();
            this._mapDraw = null;
            return;
          }
          if (!this._mapDraw) {
            this._mapDraw = new MapDraw(api2);
          }
          var mapDraw = this._mapDraw;
          mapDraw.draw(geoModel, ecModel, api2, this, payload);
          mapDraw.group.on("click", this._handleRegionClick, this);
          mapDraw.group.silent = geoModel.get("silent");
          this.group.add(mapDraw.group);
          this.updateSelectStatus(geoModel, ecModel, api2);
        };
        GeoView2.prototype._handleRegionClick = function(e2) {
          var eventData;
          findEventDispatcher(e2.target, function(current) {
            return (eventData = getECData(current).eventData) != null;
          }, true);
          if (eventData) {
            this._api.dispatchAction({
              type: "geoToggleSelect",
              geoId: this._model.id,
              name: eventData.name
            });
          }
        };
        GeoView2.prototype.updateSelectStatus = function(model, ecModel, api2) {
          var _this = this;
          this._mapDraw.group.traverse(function(node) {
            var eventData = getECData(node).eventData;
            if (eventData) {
              _this._model.isSelected(eventData.name) ? api2.enterSelect(node) : api2.leaveSelect(node);
              return true;
            }
          });
        };
        GeoView2.prototype.findHighDownDispatchers = function(name) {
          return this._mapDraw && this._mapDraw.findHighDownDispatchers(name, this._model);
        };
        GeoView2.prototype.dispose = function() {
          this._mapDraw && this._mapDraw.remove();
        };
        GeoView2.type = "geo";
        return GeoView2;
      }(ComponentView)
    );
    function registerMap(mapName, geoJson, specialAreas) {
      geoSourceManager.registerMap(mapName, geoJson, specialAreas);
    }
    function install$J(registers) {
      registers.registerCoordinateSystem("geo", geoCreator);
      registers.registerComponentModel(GeoModel);
      registers.registerComponentView(GeoView);
      registers.registerImpl("registerMap", registerMap);
      registers.registerImpl("getMap", function(mapName) {
        return geoSourceManager.getMapForUser(mapName);
      });
      function makeAction(method, actionInfo2) {
        actionInfo2.update = "geo:updateSelectStatus";
        registers.registerAction(actionInfo2, function(payload, ecModel) {
          var selected = {};
          var allSelected = [];
          ecModel.eachComponent({
            mainType: "geo",
            query: payload
          }, function(geoModel) {
            geoModel[method](payload.name);
            var geo = geoModel.coordinateSystem;
            each$f(geo.regions, function(region) {
              selected[region.name] = geoModel.isSelected(region.name) || false;
            });
            var names2 = [];
            each$f(selected, function(v4, name) {
              selected[name] && names2.push(name);
            });
            allSelected.push({
              geoIndex: geoModel.componentIndex,
              // Use singular, the same naming convention as the event `selectchanged`.
              name: names2
            });
          });
          return {
            selected,
            allSelected,
            name: payload.name
          };
        });
      }
      makeAction("toggleSelected", {
        type: "geoToggleSelect",
        event: "geoselectchanged"
      });
      makeAction("select", {
        type: "geoSelect",
        event: "geoselected"
      });
      makeAction("unSelect", {
        type: "geoUnSelect",
        event: "geounselected"
      });
      registers.registerAction({
        type: "geoRoam",
        event: "geoRoam",
        update: "updateTransform"
      }, function(payload, ecModel, api2) {
        var componentType = payload.componentType || "series";
        ecModel.eachComponent({
          mainType: componentType,
          query: payload
        }, function(componentModel) {
          var geo = componentModel.coordinateSystem;
          if (geo.type !== "geo") {
            return;
          }
          var res = updateCenterAndZoom(geo, payload, componentModel.get("scaleLimit"), api2);
          componentModel.setCenter && componentModel.setCenter(res.center);
          componentModel.setZoom && componentModel.setZoom(res.zoom);
          if (componentType === "series") {
            each$f(componentModel.seriesGroup, function(seriesModel) {
              seriesModel.setCenter(res.center);
              seriesModel.setZoom(res.zoom);
            });
          }
        });
      });
    }
    function install$I(registers) {
      use(install$J);
      registers.registerChartView(MapView);
      registers.registerSeriesModel(MapSeries);
      registers.registerLayout(mapSymbolLayout);
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic);
      createLegacyDataSelectAction("map", registers.registerAction);
    }
    function init(inRoot) {
      var root2 = inRoot;
      root2.hierNode = {
        defaultAncestor: null,
        ancestor: root2,
        prelim: 0,
        modifier: 0,
        change: 0,
        shift: 0,
        i: 0,
        thread: null
      };
      var nodes = [root2];
      var node;
      var children;
      while (node = nodes.pop()) {
        children = node.children;
        if (node.isExpand && children.length) {
          var n = children.length;
          for (var i2 = n - 1; i2 >= 0; i2--) {
            var child = children[i2];
            child.hierNode = {
              defaultAncestor: null,
              ancestor: child,
              prelim: 0,
              modifier: 0,
              change: 0,
              shift: 0,
              i: i2,
              thread: null
            };
            nodes.push(child);
          }
        }
      }
    }
    function firstWalk(node, separation2) {
      var children = node.isExpand ? node.children : [];
      var siblings = node.parentNode.children;
      var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;
      if (children.length) {
        executeShifts(node);
        var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;
        if (subtreeW) {
          node.hierNode.prelim = subtreeW.hierNode.prelim + separation2(node, subtreeW);
          node.hierNode.modifier = node.hierNode.prelim - midPoint;
        } else {
          node.hierNode.prelim = midPoint;
        }
      } else if (subtreeW) {
        node.hierNode.prelim = subtreeW.hierNode.prelim + separation2(node, subtreeW);
      }
      node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation2);
    }
    function secondWalk(node) {
      var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;
      node.setLayout({
        x: nodeX
      }, true);
      node.hierNode.modifier += node.parentNode.hierNode.modifier;
    }
    function separation(cb) {
      return arguments.length ? cb : defaultSeparation;
    }
    function radialCoordinate(rad, r) {
      rad -= Math.PI / 2;
      return {
        x: r * Math.cos(rad),
        y: r * Math.sin(rad)
      };
    }
    function getViewRect$4(seriesModel, api2) {
      return getLayoutRect(seriesModel.getBoxLayoutParams(), {
        width: api2.getWidth(),
        height: api2.getHeight()
      });
    }
    function executeShifts(node) {
      var children = node.children;
      var n = children.length;
      var shift2 = 0;
      var change = 0;
      while (--n >= 0) {
        var child = children[n];
        child.hierNode.prelim += shift2;
        child.hierNode.modifier += shift2;
        change += child.hierNode.change;
        shift2 += child.hierNode.shift + change;
      }
    }
    function apportion(subtreeV, subtreeW, ancestor, separation2) {
      if (subtreeW) {
        var nodeOutRight = subtreeV;
        var nodeInRight = subtreeV;
        var nodeOutLeft = nodeInRight.parentNode.children[0];
        var nodeInLeft = subtreeW;
        var sumOutRight = nodeOutRight.hierNode.modifier;
        var sumInRight = nodeInRight.hierNode.modifier;
        var sumOutLeft = nodeOutLeft.hierNode.modifier;
        var sumInLeft = nodeInLeft.hierNode.modifier;
        while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {
          nodeOutRight = nextRight(nodeOutRight);
          nodeOutLeft = nextLeft(nodeOutLeft);
          nodeOutRight.hierNode.ancestor = subtreeV;
          var shift2 = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation2(nodeInLeft, nodeInRight);
          if (shift2 > 0) {
            moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift2);
            sumInRight += shift2;
            sumOutRight += shift2;
          }
          sumInLeft += nodeInLeft.hierNode.modifier;
          sumInRight += nodeInRight.hierNode.modifier;
          sumOutRight += nodeOutRight.hierNode.modifier;
          sumOutLeft += nodeOutLeft.hierNode.modifier;
        }
        if (nodeInLeft && !nextRight(nodeOutRight)) {
          nodeOutRight.hierNode.thread = nodeInLeft;
          nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;
        }
        if (nodeInRight && !nextLeft(nodeOutLeft)) {
          nodeOutLeft.hierNode.thread = nodeInRight;
          nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;
          ancestor = subtreeV;
        }
      }
      return ancestor;
    }
    function nextRight(node) {
      var children = node.children;
      return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;
    }
    function nextLeft(node) {
      var children = node.children;
      return children.length && node.isExpand ? children[0] : node.hierNode.thread;
    }
    function nextAncestor(nodeInLeft, node, ancestor) {
      return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;
    }
    function moveSubtree(wl, wr, shift2) {
      var change = shift2 / (wr.hierNode.i - wl.hierNode.i);
      wr.hierNode.change -= change;
      wr.hierNode.shift += shift2;
      wr.hierNode.modifier += shift2;
      wr.hierNode.prelim += shift2;
      wl.hierNode.change += change;
    }
    function defaultSeparation(node1, node2) {
      return node1.parentNode === node2.parentNode ? 1 : 2;
    }
    var TreeEdgeShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function TreeEdgeShape2() {
          this.parentPoint = [];
          this.childPoints = [];
        }
        return TreeEdgeShape2;
      }()
    );
    var TreePath = (
      /** @class */
      function(_super) {
        __extends$1(TreePath2, _super);
        function TreePath2(opts) {
          return _super.call(this, opts) || this;
        }
        TreePath2.prototype.getDefaultStyle = function() {
          return {
            stroke: "#000",
            fill: null
          };
        };
        TreePath2.prototype.getDefaultShape = function() {
          return new TreeEdgeShape();
        };
        TreePath2.prototype.buildPath = function(ctx, shape) {
          var childPoints = shape.childPoints;
          var childLen = childPoints.length;
          var parentPoint = shape.parentPoint;
          var firstChildPos = childPoints[0];
          var lastChildPos = childPoints[childLen - 1];
          if (childLen === 1) {
            ctx.moveTo(parentPoint[0], parentPoint[1]);
            ctx.lineTo(firstChildPos[0], firstChildPos[1]);
            return;
          }
          var orient = shape.orient;
          var forkDim = orient === "TB" || orient === "BT" ? 0 : 1;
          var otherDim = 1 - forkDim;
          var forkPosition = parsePercent(shape.forkPosition, 1);
          var tmpPoint = [];
          tmpPoint[forkDim] = parentPoint[forkDim];
          tmpPoint[otherDim] = parentPoint[otherDim] + (lastChildPos[otherDim] - parentPoint[otherDim]) * forkPosition;
          ctx.moveTo(parentPoint[0], parentPoint[1]);
          ctx.lineTo(tmpPoint[0], tmpPoint[1]);
          ctx.moveTo(firstChildPos[0], firstChildPos[1]);
          tmpPoint[forkDim] = firstChildPos[forkDim];
          ctx.lineTo(tmpPoint[0], tmpPoint[1]);
          tmpPoint[forkDim] = lastChildPos[forkDim];
          ctx.lineTo(tmpPoint[0], tmpPoint[1]);
          ctx.lineTo(lastChildPos[0], lastChildPos[1]);
          for (var i2 = 1; i2 < childLen - 1; i2++) {
            var point = childPoints[i2];
            ctx.moveTo(point[0], point[1]);
            tmpPoint[forkDim] = point[forkDim];
            ctx.lineTo(tmpPoint[0], tmpPoint[1]);
          }
        };
        return TreePath2;
      }(Path)
    );
    var TreeView = (
      /** @class */
      function(_super) {
        __extends$1(TreeView2, _super);
        function TreeView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TreeView2.type;
          _this._mainGroup = new Group$3();
          return _this;
        }
        TreeView2.prototype.init = function(ecModel, api2) {
          this._controller = new RoamController(api2.getZr());
          this._controllerHost = {
            target: this.group
          };
          this.group.add(this._mainGroup);
        };
        TreeView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var layoutInfo = seriesModel.layoutInfo;
          var group = this._mainGroup;
          var layout2 = seriesModel.get("layout");
          if (layout2 === "radial") {
            group.x = layoutInfo.x + layoutInfo.width / 2;
            group.y = layoutInfo.y + layoutInfo.height / 2;
          } else {
            group.x = layoutInfo.x;
            group.y = layoutInfo.y;
          }
          this._updateViewCoordSys(seriesModel, api2);
          this._updateController(seriesModel, ecModel, api2);
          var oldData = this._data;
          data.diff(oldData).add(function(newIdx) {
            if (symbolNeedsDraw(data, newIdx)) {
              updateNode(data, newIdx, null, group, seriesModel);
            }
          }).update(function(newIdx, oldIdx) {
            var symbolEl = oldData.getItemGraphicEl(oldIdx);
            if (!symbolNeedsDraw(data, newIdx)) {
              symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel);
              return;
            }
            updateNode(data, newIdx, symbolEl, group, seriesModel);
          }).remove(function(oldIdx) {
            var symbolEl = oldData.getItemGraphicEl(oldIdx);
            if (symbolEl) {
              removeNode(oldData, oldIdx, symbolEl, group, seriesModel);
            }
          }).execute();
          this._nodeScaleRatio = seriesModel.get("nodeScaleRatio");
          this._updateNodeAndLinkScale(seriesModel);
          if (seriesModel.get("expandAndCollapse") === true) {
            data.eachItemGraphicEl(function(el, dataIndex) {
              el.off("click").on("click", function() {
                api2.dispatchAction({
                  type: "treeExpandAndCollapse",
                  seriesId: seriesModel.id,
                  dataIndex
                });
              });
            });
          }
          this._data = data;
        };
        TreeView2.prototype._updateViewCoordSys = function(seriesModel, api2) {
          var data = seriesModel.getData();
          var points2 = [];
          data.each(function(idx) {
            var layout2 = data.getItemLayout(idx);
            if (layout2 && !isNaN(layout2.x) && !isNaN(layout2.y)) {
              points2.push([+layout2.x, +layout2.y]);
            }
          });
          var min3 = [];
          var max3 = [];
          fromPoints(points2, min3, max3);
          var oldMin = this._min;
          var oldMax = this._max;
          if (max3[0] - min3[0] === 0) {
            min3[0] = oldMin ? oldMin[0] : min3[0] - 1;
            max3[0] = oldMax ? oldMax[0] : max3[0] + 1;
          }
          if (max3[1] - min3[1] === 0) {
            min3[1] = oldMin ? oldMin[1] : min3[1] - 1;
            max3[1] = oldMax ? oldMax[1] : max3[1] + 1;
          }
          var viewCoordSys = seriesModel.coordinateSystem = new View();
          viewCoordSys.zoomLimit = seriesModel.get("scaleLimit");
          viewCoordSys.setBoundingRect(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]);
          viewCoordSys.setCenter(seriesModel.get("center"), api2);
          viewCoordSys.setZoom(seriesModel.get("zoom"));
          this.group.attr({
            x: viewCoordSys.x,
            y: viewCoordSys.y,
            scaleX: viewCoordSys.scaleX,
            scaleY: viewCoordSys.scaleY
          });
          this._min = min3;
          this._max = max3;
        };
        TreeView2.prototype._updateController = function(seriesModel, ecModel, api2) {
          var _this = this;
          var controller = this._controller;
          var controllerHost = this._controllerHost;
          var group = this.group;
          controller.setPointerChecker(function(e2, x2, y) {
            var rect = group.getBoundingRect();
            rect.applyTransform(group.transform);
            return rect.contain(x2, y) && !onIrrelevantElement(e2, api2, seriesModel);
          });
          controller.enable(seriesModel.get("roam"));
          controllerHost.zoomLimit = seriesModel.get("scaleLimit");
          controllerHost.zoom = seriesModel.coordinateSystem.getZoom();
          controller.off("pan").off("zoom").on("pan", function(e2) {
            updateViewOnPan(controllerHost, e2.dx, e2.dy);
            api2.dispatchAction({
              seriesId: seriesModel.id,
              type: "treeRoam",
              dx: e2.dx,
              dy: e2.dy
            });
          }).on("zoom", function(e2) {
            updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY);
            api2.dispatchAction({
              seriesId: seriesModel.id,
              type: "treeRoam",
              zoom: e2.scale,
              originX: e2.originX,
              originY: e2.originY
            });
            _this._updateNodeAndLinkScale(seriesModel);
            api2.updateLabelLayout();
          });
        };
        TreeView2.prototype._updateNodeAndLinkScale = function(seriesModel) {
          var data = seriesModel.getData();
          var nodeScale = this._getNodeGlobalScale(seriesModel);
          data.eachItemGraphicEl(function(el, idx) {
            el.setSymbolScale(nodeScale);
          });
        };
        TreeView2.prototype._getNodeGlobalScale = function(seriesModel) {
          var coordSys = seriesModel.coordinateSystem;
          if (coordSys.type !== "view") {
            return 1;
          }
          var nodeScaleRatio = this._nodeScaleRatio;
          var groupZoom = coordSys.scaleX || 1;
          var roamZoom = coordSys.getZoom();
          var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;
          return nodeScale / groupZoom;
        };
        TreeView2.prototype.dispose = function() {
          this._controller && this._controller.dispose();
          this._controllerHost = null;
        };
        TreeView2.prototype.remove = function() {
          this._mainGroup.removeAll();
          this._data = null;
        };
        TreeView2.type = "tree";
        return TreeView2;
      }(ChartView)
    );
    function symbolNeedsDraw(data, dataIndex) {
      var layout2 = data.getItemLayout(dataIndex);
      return layout2 && !isNaN(layout2.x) && !isNaN(layout2.y);
    }
    function updateNode(data, dataIndex, symbolEl, group, seriesModel) {
      var isInit = !symbolEl;
      var node = data.tree.getNodeByDataIndex(dataIndex);
      var itemModel = node.getModel();
      var visualColor = node.getVisual("style").fill;
      var symbolInnerColor = node.isExpand === false && node.children.length !== 0 ? visualColor : "#fff";
      var virtualRoot = data.tree.root;
      var source = node.parentNode === virtualRoot ? node : node.parentNode || node;
      var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);
      var sourceLayout = source.getLayout();
      var sourceOldLayout = sourceSymbolEl ? {
        x: sourceSymbolEl.__oldX,
        y: sourceSymbolEl.__oldY,
        rawX: sourceSymbolEl.__radialOldRawX,
        rawY: sourceSymbolEl.__radialOldRawY
      } : sourceLayout;
      var targetLayout = node.getLayout();
      if (isInit) {
        symbolEl = new Symbol$1(data, dataIndex, null, {
          symbolInnerColor,
          useNameLabel: true
        });
        symbolEl.x = sourceOldLayout.x;
        symbolEl.y = sourceOldLayout.y;
      } else {
        symbolEl.updateData(data, dataIndex, null, {
          symbolInnerColor,
          useNameLabel: true
        });
      }
      symbolEl.__radialOldRawX = symbolEl.__radialRawX;
      symbolEl.__radialOldRawY = symbolEl.__radialRawY;
      symbolEl.__radialRawX = targetLayout.rawX;
      symbolEl.__radialRawY = targetLayout.rawY;
      group.add(symbolEl);
      data.setItemGraphicEl(dataIndex, symbolEl);
      symbolEl.__oldX = symbolEl.x;
      symbolEl.__oldY = symbolEl.y;
      updateProps$1(symbolEl, {
        x: targetLayout.x,
        y: targetLayout.y
      }, seriesModel);
      var symbolPath = symbolEl.getSymbolPath();
      if (seriesModel.get("layout") === "radial") {
        var realRoot = virtualRoot.children[0];
        var rootLayout = realRoot.getLayout();
        var length_1 = realRoot.children.length;
        var rad = void 0;
        var isLeft = void 0;
        if (targetLayout.x === rootLayout.x && node.isExpand === true && realRoot.children.length) {
          var center2 = {
            x: (realRoot.children[0].getLayout().x + realRoot.children[length_1 - 1].getLayout().x) / 2,
            y: (realRoot.children[0].getLayout().y + realRoot.children[length_1 - 1].getLayout().y) / 2
          };
          rad = Math.atan2(center2.y - rootLayout.y, center2.x - rootLayout.x);
          if (rad < 0) {
            rad = Math.PI * 2 + rad;
          }
          isLeft = center2.x < rootLayout.x;
          if (isLeft) {
            rad = rad - Math.PI;
          }
        } else {
          rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x);
          if (rad < 0) {
            rad = Math.PI * 2 + rad;
          }
          if (node.children.length === 0 || node.children.length !== 0 && node.isExpand === false) {
            isLeft = targetLayout.x < rootLayout.x;
            if (isLeft) {
              rad = rad - Math.PI;
            }
          } else {
            isLeft = targetLayout.x > rootLayout.x;
            if (!isLeft) {
              rad = rad - Math.PI;
            }
          }
        }
        var textPosition = isLeft ? "left" : "right";
        var normalLabelModel = itemModel.getModel("label");
        var rotate2 = normalLabelModel.get("rotate");
        var labelRotateRadian = rotate2 * (Math.PI / 180);
        var textContent = symbolPath.getTextContent();
        if (textContent) {
          symbolPath.setTextConfig({
            position: normalLabelModel.get("position") || textPosition,
            rotation: rotate2 == null ? -rad : labelRotateRadian,
            origin: "center"
          });
          textContent.setStyle("verticalAlign", "middle");
        }
      }
      var focus = itemModel.get(["emphasis", "focus"]);
      var focusDataIndices = focus === "relative" ? concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === "ancestor" ? node.getAncestorsIndices() : focus === "descendant" ? node.getDescendantIndices() : null;
      if (focusDataIndices) {
        getECData(symbolEl).focus = focusDataIndices;
      }
      drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group);
      if (symbolEl.__edge) {
        symbolEl.onHoverStateChange = function(toState) {
          if (toState !== "blur") {
            var parentEl = node.parentNode && data.getItemGraphicEl(node.parentNode.dataIndex);
            if (!(parentEl && parentEl.hoverState === HOVER_STATE_BLUR)) {
              setStatesFlag(symbolEl.__edge, toState);
            }
          }
        };
      }
    }
    function drawEdge(seriesModel, node, virtualRoot, symbolEl, sourceOldLayout, sourceLayout, targetLayout, group) {
      var itemModel = node.getModel();
      var edgeShape = seriesModel.get("edgeShape");
      var layout2 = seriesModel.get("layout");
      var orient = seriesModel.getOrient();
      var curvature = seriesModel.get(["lineStyle", "curveness"]);
      var edgeForkPosition = seriesModel.get("edgeForkPosition");
      var lineStyle = itemModel.getModel("lineStyle").getLineStyle();
      var edge = symbolEl.__edge;
      if (edgeShape === "curve") {
        if (node.parentNode && node.parentNode !== virtualRoot) {
          if (!edge) {
            edge = symbolEl.__edge = new BezierCurve$1({
              shape: getEdgeShape(layout2, orient, curvature, sourceOldLayout, sourceOldLayout)
            });
          }
          updateProps$1(edge, {
            shape: getEdgeShape(layout2, orient, curvature, sourceLayout, targetLayout)
          }, seriesModel);
        }
      } else if (edgeShape === "polyline") {
        if (layout2 === "orthogonal") {
          if (node !== virtualRoot && node.children && node.children.length !== 0 && node.isExpand === true) {
            var children = node.children;
            var childPoints = [];
            for (var i2 = 0; i2 < children.length; i2++) {
              var childLayout = children[i2].getLayout();
              childPoints.push([childLayout.x, childLayout.y]);
            }
            if (!edge) {
              edge = symbolEl.__edge = new TreePath({
                shape: {
                  parentPoint: [targetLayout.x, targetLayout.y],
                  childPoints: [[targetLayout.x, targetLayout.y]],
                  orient,
                  forkPosition: edgeForkPosition
                }
              });
            }
            updateProps$1(edge, {
              shape: {
                parentPoint: [targetLayout.x, targetLayout.y],
                childPoints
              }
            }, seriesModel);
          }
        }
      }
      if (edge && !(edgeShape === "polyline" && !node.isExpand)) {
        edge.useStyle(defaults$1({
          strokeNoScale: true,
          fill: null
        }, lineStyle));
        setStatesStylesFromModel(edge, itemModel, "lineStyle");
        setDefaultStateProxy(edge);
        group.add(edge);
      }
    }
    function removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt) {
      var virtualRoot = data.tree.root;
      var _a2 = getSourceNode(virtualRoot, node), source = _a2.source, sourceLayout = _a2.sourceLayout;
      var symbolEl = data.getItemGraphicEl(node.dataIndex);
      if (!symbolEl) {
        return;
      }
      var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex);
      var sourceEdge = sourceSymbolEl.__edge;
      var edge = symbolEl.__edge || (source.isExpand === false || source.children.length === 1 ? sourceEdge : void 0);
      var edgeShape = seriesModel.get("edgeShape");
      var layoutOpt = seriesModel.get("layout");
      var orient = seriesModel.get("orient");
      var curvature = seriesModel.get(["lineStyle", "curveness"]);
      if (edge) {
        if (edgeShape === "curve") {
          removeElement(edge, {
            shape: getEdgeShape(layoutOpt, orient, curvature, sourceLayout, sourceLayout),
            style: {
              opacity: 0
            }
          }, seriesModel, {
            cb: function() {
              group.remove(edge);
            },
            removeOpt: removeAnimationOpt
          });
        } else if (edgeShape === "polyline" && seriesModel.get("layout") === "orthogonal") {
          removeElement(edge, {
            shape: {
              parentPoint: [sourceLayout.x, sourceLayout.y],
              childPoints: [[sourceLayout.x, sourceLayout.y]]
            },
            style: {
              opacity: 0
            }
          }, seriesModel, {
            cb: function() {
              group.remove(edge);
            },
            removeOpt: removeAnimationOpt
          });
        }
      }
    }
    function getSourceNode(virtualRoot, node) {
      var source = node.parentNode === virtualRoot ? node : node.parentNode || node;
      var sourceLayout;
      while (sourceLayout = source.getLayout(), sourceLayout == null) {
        source = source.parentNode === virtualRoot ? source : source.parentNode || source;
      }
      return {
        source,
        sourceLayout
      };
    }
    function removeNode(data, dataIndex, symbolEl, group, seriesModel) {
      var node = data.tree.getNodeByDataIndex(dataIndex);
      var virtualRoot = data.tree.root;
      var sourceLayout = getSourceNode(virtualRoot, node).sourceLayout;
      var removeAnimationOpt = {
        duration: seriesModel.get("animationDurationUpdate"),
        easing: seriesModel.get("animationEasingUpdate")
      };
      removeElement(symbolEl, {
        x: sourceLayout.x + 1,
        y: sourceLayout.y + 1
      }, seriesModel, {
        cb: function() {
          group.remove(symbolEl);
          data.setItemGraphicEl(dataIndex, null);
        },
        removeOpt: removeAnimationOpt
      });
      symbolEl.fadeOut(null, data.hostModel, {
        fadeLabel: true,
        animation: removeAnimationOpt
      });
      node.children.forEach(function(childNode) {
        removeNodeEdge(childNode, data, group, seriesModel, removeAnimationOpt);
      });
      removeNodeEdge(node, data, group, seriesModel, removeAnimationOpt);
    }
    function getEdgeShape(layoutOpt, orient, curvature, sourceLayout, targetLayout) {
      var cpx1;
      var cpy1;
      var cpx2;
      var cpy2;
      var x1;
      var x2;
      var y1;
      var y2;
      if (layoutOpt === "radial") {
        x1 = sourceLayout.rawX;
        y1 = sourceLayout.rawY;
        x2 = targetLayout.rawX;
        y2 = targetLayout.rawY;
        var radialCoor1 = radialCoordinate(x1, y1);
        var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * curvature);
        var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * curvature);
        var radialCoor4 = radialCoordinate(x2, y2);
        return {
          x1: radialCoor1.x || 0,
          y1: radialCoor1.y || 0,
          x2: radialCoor4.x || 0,
          y2: radialCoor4.y || 0,
          cpx1: radialCoor2.x || 0,
          cpy1: radialCoor2.y || 0,
          cpx2: radialCoor3.x || 0,
          cpy2: radialCoor3.y || 0
        };
      } else {
        x1 = sourceLayout.x;
        y1 = sourceLayout.y;
        x2 = targetLayout.x;
        y2 = targetLayout.y;
        if (orient === "LR" || orient === "RL") {
          cpx1 = x1 + (x2 - x1) * curvature;
          cpy1 = y1;
          cpx2 = x2 + (x1 - x2) * curvature;
          cpy2 = y2;
        }
        if (orient === "TB" || orient === "BT") {
          cpx1 = x1;
          cpy1 = y1 + (y2 - y1) * curvature;
          cpx2 = x2;
          cpy2 = y2 + (y1 - y2) * curvature;
        }
      }
      return {
        x1,
        y1,
        x2,
        y2,
        cpx1,
        cpy1,
        cpx2,
        cpy2
      };
    }
    var inner$e = makeInner();
    function linkSeriesData(opt) {
      var mainData = opt.mainData;
      var datas = opt.datas;
      if (!datas) {
        datas = {
          main: mainData
        };
        opt.datasAttr = {
          main: "data"
        };
      }
      opt.datas = opt.mainData = null;
      linkAll(mainData, datas, opt);
      each$f(datas, function(data) {
        each$f(mainData.TRANSFERABLE_METHODS, function(methodName) {
          data.wrapMethod(methodName, curry$1(transferInjection, opt));
        });
      });
      mainData.wrapMethod("cloneShallow", curry$1(cloneShallowInjection, opt));
      each$f(mainData.CHANGABLE_METHODS, function(methodName) {
        mainData.wrapMethod(methodName, curry$1(changeInjection, opt));
      });
      assert(datas[mainData.dataType] === mainData);
    }
    function transferInjection(opt, res) {
      if (isMainData(this)) {
        var datas = extend$1({}, inner$e(this).datas);
        datas[this.dataType] = res;
        linkAll(res, datas, opt);
      } else {
        linkSingle(res, this.dataType, inner$e(this).mainData, opt);
      }
      return res;
    }
    function changeInjection(opt, res) {
      opt.struct && opt.struct.update();
      return res;
    }
    function cloneShallowInjection(opt, res) {
      each$f(inner$e(res).datas, function(data, dataType2) {
        data !== res && linkSingle(data.cloneShallow(), dataType2, res, opt);
      });
      return res;
    }
    function getLinkedData(dataType2) {
      var mainData = inner$e(this).mainData;
      return dataType2 == null || mainData == null ? mainData : inner$e(mainData).datas[dataType2];
    }
    function getLinkedDataAll() {
      var mainData = inner$e(this).mainData;
      return mainData == null ? [{
        data: mainData
      }] : map$1(keys$1(inner$e(mainData).datas), function(type) {
        return {
          type,
          data: inner$e(mainData).datas[type]
        };
      });
    }
    function isMainData(data) {
      return inner$e(data).mainData === data;
    }
    function linkAll(mainData, datas, opt) {
      inner$e(mainData).datas = {};
      each$f(datas, function(data, dataType2) {
        linkSingle(data, dataType2, mainData, opt);
      });
    }
    function linkSingle(data, dataType2, mainData, opt) {
      inner$e(mainData).datas[dataType2] = data;
      inner$e(data).mainData = mainData;
      data.dataType = dataType2;
      if (opt.struct) {
        data[opt.structAttr] = opt.struct;
        opt.struct[opt.datasAttr[dataType2]] = data;
      }
      data.getLinkedData = getLinkedData;
      data.getLinkedDataAll = getLinkedDataAll;
    }
    var TreeNode = (
      /** @class */
      function() {
        function TreeNode2(name, hostTree) {
          this.depth = 0;
          this.height = 0;
          this.dataIndex = -1;
          this.children = [];
          this.viewChildren = [];
          this.isExpand = false;
          this.name = name || "";
          this.hostTree = hostTree;
        }
        TreeNode2.prototype.isRemoved = function() {
          return this.dataIndex < 0;
        };
        TreeNode2.prototype.eachNode = function(options, cb, context) {
          if (isFunction$1(options)) {
            context = cb;
            cb = options;
            options = null;
          }
          options = options || {};
          if (isString$1(options)) {
            options = {
              order: options
            };
          }
          var order = options.order || "preorder";
          var children = this[options.attr || "children"];
          var suppressVisitSub;
          order === "preorder" && (suppressVisitSub = cb.call(context, this));
          for (var i2 = 0; !suppressVisitSub && i2 < children.length; i2++) {
            children[i2].eachNode(options, cb, context);
          }
          order === "postorder" && cb.call(context, this);
        };
        TreeNode2.prototype.updateDepthAndHeight = function(depth) {
          var height = 0;
          this.depth = depth;
          for (var i2 = 0; i2 < this.children.length; i2++) {
            var child = this.children[i2];
            child.updateDepthAndHeight(depth + 1);
            if (child.height > height) {
              height = child.height;
            }
          }
          this.height = height + 1;
        };
        TreeNode2.prototype.getNodeById = function(id) {
          if (this.getId() === id) {
            return this;
          }
          for (var i2 = 0, children = this.children, len2 = children.length; i2 < len2; i2++) {
            var res = children[i2].getNodeById(id);
            if (res) {
              return res;
            }
          }
        };
        TreeNode2.prototype.contains = function(node) {
          if (node === this) {
            return true;
          }
          for (var i2 = 0, children = this.children, len2 = children.length; i2 < len2; i2++) {
            var res = children[i2].contains(node);
            if (res) {
              return res;
            }
          }
        };
        TreeNode2.prototype.getAncestors = function(includeSelf) {
          var ancestors = [];
          var node = includeSelf ? this : this.parentNode;
          while (node) {
            ancestors.push(node);
            node = node.parentNode;
          }
          ancestors.reverse();
          return ancestors;
        };
        TreeNode2.prototype.getAncestorsIndices = function() {
          var indices = [];
          var currNode = this;
          while (currNode) {
            indices.push(currNode.dataIndex);
            currNode = currNode.parentNode;
          }
          indices.reverse();
          return indices;
        };
        TreeNode2.prototype.getDescendantIndices = function() {
          var indices = [];
          this.eachNode(function(childNode) {
            indices.push(childNode.dataIndex);
          });
          return indices;
        };
        TreeNode2.prototype.getValue = function(dimension) {
          var data = this.hostTree.data;
          return data.getStore().get(data.getDimensionIndex(dimension || "value"), this.dataIndex);
        };
        TreeNode2.prototype.setLayout = function(layout2, merge2) {
          this.dataIndex >= 0 && this.hostTree.data.setItemLayout(this.dataIndex, layout2, merge2);
        };
        TreeNode2.prototype.getLayout = function() {
          return this.hostTree.data.getItemLayout(this.dataIndex);
        };
        TreeNode2.prototype.getModel = function(path) {
          if (this.dataIndex < 0) {
            return;
          }
          var hostTree = this.hostTree;
          var itemModel = hostTree.data.getItemModel(this.dataIndex);
          return itemModel.getModel(path);
        };
        TreeNode2.prototype.getLevelModel = function() {
          return (this.hostTree.levelModels || [])[this.depth];
        };
        TreeNode2.prototype.setVisual = function(key, value) {
          this.dataIndex >= 0 && this.hostTree.data.setItemVisual(this.dataIndex, key, value);
        };
        TreeNode2.prototype.getVisual = function(key) {
          return this.hostTree.data.getItemVisual(this.dataIndex, key);
        };
        TreeNode2.prototype.getRawIndex = function() {
          return this.hostTree.data.getRawIndex(this.dataIndex);
        };
        TreeNode2.prototype.getId = function() {
          return this.hostTree.data.getId(this.dataIndex);
        };
        TreeNode2.prototype.getChildIndex = function() {
          if (this.parentNode) {
            var children = this.parentNode.children;
            for (var i2 = 0; i2 < children.length; ++i2) {
              if (children[i2] === this) {
                return i2;
              }
            }
            return -1;
          }
          return -1;
        };
        TreeNode2.prototype.isAncestorOf = function(node) {
          var parent2 = node.parentNode;
          while (parent2) {
            if (parent2 === this) {
              return true;
            }
            parent2 = parent2.parentNode;
          }
          return false;
        };
        TreeNode2.prototype.isDescendantOf = function(node) {
          return node !== this && node.isAncestorOf(this);
        };
        return TreeNode2;
      }()
    );
    var Tree = (
      /** @class */
      function() {
        function Tree2(hostModel) {
          this.type = "tree";
          this._nodes = [];
          this.hostModel = hostModel;
        }
        Tree2.prototype.eachNode = function(options, cb, context) {
          this.root.eachNode(options, cb, context);
        };
        Tree2.prototype.getNodeByDataIndex = function(dataIndex) {
          var rawIndex = this.data.getRawIndex(dataIndex);
          return this._nodes[rawIndex];
        };
        Tree2.prototype.getNodeById = function(name) {
          return this.root.getNodeById(name);
        };
        Tree2.prototype.update = function() {
          var data = this.data;
          var nodes = this._nodes;
          for (var i2 = 0, len2 = nodes.length; i2 < len2; i2++) {
            nodes[i2].dataIndex = -1;
          }
          for (var i2 = 0, len2 = data.count(); i2 < len2; i2++) {
            nodes[data.getRawIndex(i2)].dataIndex = i2;
          }
        };
        Tree2.prototype.clearLayouts = function() {
          this.data.clearItemLayouts();
        };
        Tree2.createTree = function(dataRoot, hostModel, beforeLink) {
          var tree = new Tree2(hostModel);
          var listData = [];
          var dimMax = 1;
          buildHierarchy(dataRoot);
          function buildHierarchy(dataNode, parentNode2) {
            var value = dataNode.value;
            dimMax = Math.max(dimMax, isArray$2(value) ? value.length : 1);
            listData.push(dataNode);
            var node = new TreeNode(convertOptionIdName(dataNode.name, ""), tree);
            parentNode2 ? addChild(node, parentNode2) : tree.root = node;
            tree._nodes.push(node);
            var children = dataNode.children;
            if (children) {
              for (var i2 = 0; i2 < children.length; i2++) {
                buildHierarchy(children[i2], node);
              }
            }
          }
          tree.root.updateDepthAndHeight(0);
          var dimensions = prepareSeriesDataSchema(listData, {
            coordDimensions: ["value"],
            dimensionsCount: dimMax
          }).dimensions;
          var list = new SeriesData(dimensions, hostModel);
          list.initData(listData);
          beforeLink && beforeLink(list);
          linkSeriesData({
            mainData: list,
            struct: tree,
            structAttr: "tree"
          });
          tree.update();
          return tree;
        };
        return Tree2;
      }()
    );
    function addChild(child, node) {
      var children = node.children;
      if (child.parentNode === node) {
        return;
      }
      children.push(child);
      child.parentNode = node;
    }
    function retrieveTargetInfo(payload, validPayloadTypes, seriesModel) {
      if (payload && indexOf(validPayloadTypes, payload.type) >= 0) {
        var root2 = seriesModel.getData().tree.root;
        var targetNode = payload.targetNode;
        if (isString$1(targetNode)) {
          targetNode = root2.getNodeById(targetNode);
        }
        if (targetNode && root2.contains(targetNode)) {
          return {
            node: targetNode
          };
        }
        var targetNodeId = payload.targetNodeId;
        if (targetNodeId != null && (targetNode = root2.getNodeById(targetNodeId))) {
          return {
            node: targetNode
          };
        }
      }
    }
    function getPathToRoot(node) {
      var path = [];
      while (node) {
        node = node.parentNode;
        node && path.push(node);
      }
      return path.reverse();
    }
    function aboveViewRoot(viewRoot, node) {
      var viewPath = getPathToRoot(viewRoot);
      return indexOf(viewPath, node) >= 0;
    }
    function wrapTreePathInfo(node, seriesModel) {
      var treePathInfo = [];
      while (node) {
        var nodeDataIndex = node.dataIndex;
        treePathInfo.push({
          name: node.name,
          dataIndex: nodeDataIndex,
          value: seriesModel.getRawValue(nodeDataIndex)
        });
        node = node.parentNode;
      }
      treePathInfo.reverse();
      return treePathInfo;
    }
    var TreeSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(TreeSeriesModel2, _super);
        function TreeSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.hasSymbolVisual = true;
          _this.ignoreStyleOnData = true;
          return _this;
        }
        TreeSeriesModel2.prototype.getInitialData = function(option) {
          var root2 = {
            name: option.name,
            children: option.data
          };
          var leaves = option.leaves || {};
          var leavesModel = new Model(leaves, this, this.ecModel);
          var tree = Tree.createTree(root2, this, beforeLink);
          function beforeLink(nodeData) {
            nodeData.wrapMethod("getItemModel", function(model, idx) {
              var node = tree.getNodeByDataIndex(idx);
              if (!(node && node.children.length && node.isExpand)) {
                model.parentModel = leavesModel;
              }
              return model;
            });
          }
          var treeDepth = 0;
          tree.eachNode("preorder", function(node) {
            if (node.depth > treeDepth) {
              treeDepth = node.depth;
            }
          });
          var expandAndCollapse = option.expandAndCollapse;
          var expandTreeDepth = expandAndCollapse && option.initialTreeDepth >= 0 ? option.initialTreeDepth : treeDepth;
          tree.root.eachNode("preorder", function(node) {
            var item = node.hostTree.data.getRawDataItem(node.dataIndex);
            node.isExpand = item && item.collapsed != null ? !item.collapsed : node.depth <= expandTreeDepth;
          });
          return tree.data;
        };
        TreeSeriesModel2.prototype.getOrient = function() {
          var orient = this.get("orient");
          if (orient === "horizontal") {
            orient = "LR";
          } else if (orient === "vertical") {
            orient = "TB";
          }
          return orient;
        };
        TreeSeriesModel2.prototype.setZoom = function(zoom) {
          this.option.zoom = zoom;
        };
        TreeSeriesModel2.prototype.setCenter = function(center2) {
          this.option.center = center2;
        };
        TreeSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var tree = this.getData().tree;
          var realRoot = tree.root.children[0];
          var node = tree.getNodeByDataIndex(dataIndex);
          var value = node.getValue();
          var name = node.name;
          while (node && node !== realRoot) {
            name = node.parentNode.name + "." + name;
            node = node.parentNode;
          }
          return createTooltipMarkup("nameValue", {
            name,
            value,
            noValue: isNaN(value) || value == null
          });
        };
        TreeSeriesModel2.prototype.getDataParams = function(dataIndex) {
          var params = _super.prototype.getDataParams.apply(this, arguments);
          var node = this.getData().tree.getNodeByDataIndex(dataIndex);
          params.treeAncestors = wrapTreePathInfo(node, this);
          params.collapsed = !node.isExpand;
          return params;
        };
        TreeSeriesModel2.type = "series.tree";
        TreeSeriesModel2.layoutMode = "box";
        TreeSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "view",
          // the position of the whole view
          left: "12%",
          top: "12%",
          right: "12%",
          bottom: "12%",
          // the layout of the tree, two value can be selected, 'orthogonal' or 'radial'
          layout: "orthogonal",
          // value can be 'polyline'
          edgeShape: "curve",
          edgeForkPosition: "50%",
          // true | false | 'move' | 'scale', see module:component/helper/RoamController.
          roam: false,
          // Symbol size scale ratio in roam
          nodeScaleRatio: 0.4,
          // Default on center of graph
          center: null,
          zoom: 1,
          orient: "LR",
          symbol: "emptyCircle",
          symbolSize: 7,
          expandAndCollapse: true,
          initialTreeDepth: 2,
          lineStyle: {
            color: "#ccc",
            width: 1.5,
            curveness: 0.5
          },
          itemStyle: {
            color: "lightsteelblue",
            // borderColor: '#c23531',
            borderWidth: 1.5
          },
          label: {
            show: true
          },
          animationEasing: "linear",
          animationDuration: 700,
          animationDurationUpdate: 500
        };
        return TreeSeriesModel2;
      }(SeriesModel)
    );
    function eachAfter(root2, callback, separation2) {
      var nodes = [root2];
      var next = [];
      var node;
      while (node = nodes.pop()) {
        next.push(node);
        if (node.isExpand) {
          var children = node.children;
          if (children.length) {
            for (var i2 = 0; i2 < children.length; i2++) {
              nodes.push(children[i2]);
            }
          }
        }
      }
      while (node = next.pop()) {
        callback(node, separation2);
      }
    }
    function eachBefore(root2, callback) {
      var nodes = [root2];
      var node;
      while (node = nodes.pop()) {
        callback(node);
        if (node.isExpand) {
          var children = node.children;
          if (children.length) {
            for (var i2 = children.length - 1; i2 >= 0; i2--) {
              nodes.push(children[i2]);
            }
          }
        }
      }
    }
    function treeLayout(ecModel, api2) {
      ecModel.eachSeriesByType("tree", function(seriesModel) {
        commonLayout(seriesModel, api2);
      });
    }
    function commonLayout(seriesModel, api2) {
      var layoutInfo = getViewRect$4(seriesModel, api2);
      seriesModel.layoutInfo = layoutInfo;
      var layout2 = seriesModel.get("layout");
      var width = 0;
      var height = 0;
      var separation$1 = null;
      if (layout2 === "radial") {
        width = 2 * Math.PI;
        height = Math.min(layoutInfo.height, layoutInfo.width) / 2;
        separation$1 = separation(function(node1, node2) {
          return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth;
        });
      } else {
        width = layoutInfo.width;
        height = layoutInfo.height;
        separation$1 = separation();
      }
      var virtualRoot = seriesModel.getData().tree.root;
      var realRoot = virtualRoot.children[0];
      if (realRoot) {
        init(virtualRoot);
        eachAfter(realRoot, firstWalk, separation$1);
        virtualRoot.hierNode.modifier = -realRoot.hierNode.prelim;
        eachBefore(realRoot, secondWalk);
        var left_1 = realRoot;
        var right_1 = realRoot;
        var bottom_1 = realRoot;
        eachBefore(realRoot, function(node) {
          var x2 = node.getLayout().x;
          if (x2 < left_1.getLayout().x) {
            left_1 = node;
          }
          if (x2 > right_1.getLayout().x) {
            right_1 = node;
          }
          if (node.depth > bottom_1.depth) {
            bottom_1 = node;
          }
        });
        var delta = left_1 === right_1 ? 1 : separation$1(left_1, right_1) / 2;
        var tx_1 = delta - left_1.getLayout().x;
        var kx_1 = 0;
        var ky_1 = 0;
        var coorX_1 = 0;
        var coorY_1 = 0;
        if (layout2 === "radial") {
          kx_1 = width / (right_1.getLayout().x + delta + tx_1);
          ky_1 = height / (bottom_1.depth - 1 || 1);
          eachBefore(realRoot, function(node) {
            coorX_1 = (node.getLayout().x + tx_1) * kx_1;
            coorY_1 = (node.depth - 1) * ky_1;
            var finalCoor = radialCoordinate(coorX_1, coorY_1);
            node.setLayout({
              x: finalCoor.x,
              y: finalCoor.y,
              rawX: coorX_1,
              rawY: coorY_1
            }, true);
          });
        } else {
          var orient_1 = seriesModel.getOrient();
          if (orient_1 === "RL" || orient_1 === "LR") {
            ky_1 = height / (right_1.getLayout().x + delta + tx_1);
            kx_1 = width / (bottom_1.depth - 1 || 1);
            eachBefore(realRoot, function(node) {
              coorY_1 = (node.getLayout().x + tx_1) * ky_1;
              coorX_1 = orient_1 === "LR" ? (node.depth - 1) * kx_1 : width - (node.depth - 1) * kx_1;
              node.setLayout({
                x: coorX_1,
                y: coorY_1
              }, true);
            });
          } else if (orient_1 === "TB" || orient_1 === "BT") {
            kx_1 = width / (right_1.getLayout().x + delta + tx_1);
            ky_1 = height / (bottom_1.depth - 1 || 1);
            eachBefore(realRoot, function(node) {
              coorX_1 = (node.getLayout().x + tx_1) * kx_1;
              coorY_1 = orient_1 === "TB" ? (node.depth - 1) * ky_1 : height - (node.depth - 1) * ky_1;
              node.setLayout({
                x: coorX_1,
                y: coorY_1
              }, true);
            });
          }
        }
      }
    }
    function treeVisual(ecModel) {
      ecModel.eachSeriesByType("tree", function(seriesModel) {
        var data = seriesModel.getData();
        var tree = data.tree;
        tree.eachNode(function(node) {
          var model = node.getModel();
          var style = model.getModel("itemStyle").getItemStyle();
          var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style");
          extend$1(existsStyle, style);
        });
      });
    }
    function installTreeAction(registers) {
      registers.registerAction({
        type: "treeExpandAndCollapse",
        event: "treeExpandAndCollapse",
        update: "update"
      }, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "tree",
          query: payload
        }, function(seriesModel) {
          var dataIndex = payload.dataIndex;
          var tree = seriesModel.getData().tree;
          var node = tree.getNodeByDataIndex(dataIndex);
          node.isExpand = !node.isExpand;
        });
      });
      registers.registerAction({
        type: "treeRoam",
        event: "treeRoam",
        // Here we set 'none' instead of 'update', because roam action
        // just need to update the transform matrix without having to recalculate
        // the layout. So don't need to go through the whole update process, such
        // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on.
        update: "none"
      }, function(payload, ecModel, api2) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "tree",
          query: payload
        }, function(seriesModel) {
          var coordSys = seriesModel.coordinateSystem;
          var res = updateCenterAndZoom(coordSys, payload, void 0, api2);
          seriesModel.setCenter && seriesModel.setCenter(res.center);
          seriesModel.setZoom && seriesModel.setZoom(res.zoom);
        });
      });
    }
    function install$H(registers) {
      registers.registerChartView(TreeView);
      registers.registerSeriesModel(TreeSeriesModel);
      registers.registerLayout(treeLayout);
      registers.registerVisual(treeVisual);
      installTreeAction(registers);
    }
    var actionTypes = ["treemapZoomToNode", "treemapRender", "treemapMove"];
    function installTreemapAction(registers) {
      for (var i2 = 0; i2 < actionTypes.length; i2++) {
        registers.registerAction({
          type: actionTypes[i2],
          update: "updateView"
        }, noop$1);
      }
      registers.registerAction({
        type: "treemapRootToNode",
        update: "updateView"
      }, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "treemap",
          query: payload
        }, handleRootToNode);
        function handleRootToNode(model, index) {
          var types2 = ["treemapZoomToNode", "treemapRootToNode"];
          var targetInfo = retrieveTargetInfo(payload, types2, model);
          if (targetInfo) {
            var originViewRoot = model.getViewRoot();
            if (originViewRoot) {
              payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? "rollUp" : "drillDown";
            }
            model.resetViewRoot(targetInfo.node);
          }
        }
      });
    }
    function enableAriaDecalForTree(seriesModel) {
      var data = seriesModel.getData();
      var tree = data.tree;
      var decalPaletteScope2 = {};
      tree.eachNode(function(node) {
        var current = node;
        while (current && current.depth > 1) {
          current = current.parentNode;
        }
        var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + "", decalPaletteScope2);
        node.setVisual("decal", decal);
      });
    }
    var TreemapSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(TreemapSeriesModel2, _super);
        function TreemapSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TreemapSeriesModel2.type;
          _this.preventUsingHoverLayer = true;
          return _this;
        }
        TreemapSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var root2 = {
            name: option.name,
            children: option.data
          };
          completeTreeValue$1(root2);
          var levels = option.levels || [];
          var designatedVisualItemStyle = this.designatedVisualItemStyle = {};
          var designatedVisualModel = new Model({
            itemStyle: designatedVisualItemStyle
          }, this, ecModel);
          levels = option.levels = setDefault(levels, ecModel);
          var levelModels = map$1(levels || [], function(levelDefine) {
            return new Model(levelDefine, designatedVisualModel, ecModel);
          }, this);
          var tree = Tree.createTree(root2, this, beforeLink);
          function beforeLink(nodeData) {
            nodeData.wrapMethod("getItemModel", function(model, idx) {
              var node = tree.getNodeByDataIndex(idx);
              var levelModel = node ? levelModels[node.depth] : null;
              model.parentModel = levelModel || designatedVisualModel;
              return model;
            });
          }
          return tree.data;
        };
        TreemapSeriesModel2.prototype.optionUpdated = function() {
          this.resetViewRoot();
        };
        TreemapSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var value = this.getRawValue(dataIndex);
          var name = data.getName(dataIndex);
          return createTooltipMarkup("nameValue", {
            name,
            value
          });
        };
        TreemapSeriesModel2.prototype.getDataParams = function(dataIndex) {
          var params = _super.prototype.getDataParams.apply(this, arguments);
          var node = this.getData().tree.getNodeByDataIndex(dataIndex);
          params.treeAncestors = wrapTreePathInfo(node, this);
          params.treePathInfo = params.treeAncestors;
          return params;
        };
        TreemapSeriesModel2.prototype.setLayoutInfo = function(layoutInfo) {
          this.layoutInfo = this.layoutInfo || {};
          extend$1(this.layoutInfo, layoutInfo);
        };
        TreemapSeriesModel2.prototype.mapIdToIndex = function(id) {
          var idIndexMap = this._idIndexMap;
          if (!idIndexMap) {
            idIndexMap = this._idIndexMap = createHashMap();
            this._idIndexMapCount = 0;
          }
          var index = idIndexMap.get(id);
          if (index == null) {
            idIndexMap.set(id, index = this._idIndexMapCount++);
          }
          return index;
        };
        TreemapSeriesModel2.prototype.getViewRoot = function() {
          return this._viewRoot;
        };
        TreemapSeriesModel2.prototype.resetViewRoot = function(viewRoot) {
          viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;
          var root2 = this.getRawData().tree.root;
          if (!viewRoot || viewRoot !== root2 && !root2.contains(viewRoot)) {
            this._viewRoot = root2;
          }
        };
        TreemapSeriesModel2.prototype.enableAriaDecal = function() {
          enableAriaDecalForTree(this);
        };
        TreemapSeriesModel2.type = "series.treemap";
        TreemapSeriesModel2.layoutMode = "box";
        TreemapSeriesModel2.defaultOption = {
          // Disable progressive rendering
          progressive: 0,
          // size: ['80%', '80%'],            // deprecated, compatible with ec2.
          left: "center",
          top: "middle",
          width: "80%",
          height: "80%",
          sort: true,
          clipWindow: "origin",
          squareRatio: 0.5 * (1 + Math.sqrt(5)),
          leafDepth: null,
          drillDownIcon: "▶",
          // to align specialized icon. ▷▶❒❐▼✚
          zoomToNodeRatio: 0.32 * 0.32,
          scaleLimit: null,
          roam: true,
          nodeClick: "zoomToNode",
          animation: true,
          animationDurationUpdate: 900,
          animationEasing: "quinticInOut",
          breadcrumb: {
            show: true,
            height: 22,
            left: "center",
            top: "bottom",
            // right
            // bottom
            emptyItemWidth: 25,
            itemStyle: {
              color: "rgba(0,0,0,0.7)",
              textStyle: {
                color: "#fff"
              }
            },
            emphasis: {
              itemStyle: {
                color: "rgba(0,0,0,0.9)"
                // '#5793f3',
              }
            }
          },
          label: {
            show: true,
            // Do not use textDistance, for ellipsis rect just the same as treemap node rect.
            distance: 0,
            padding: 5,
            position: "inside",
            // formatter: null,
            color: "#fff",
            overflow: "truncate"
            // align
            // verticalAlign
          },
          upperLabel: {
            show: false,
            position: [0, "50%"],
            height: 20,
            // formatter: null,
            // color: '#fff',
            overflow: "truncate",
            // align: null,
            verticalAlign: "middle"
          },
          itemStyle: {
            color: null,
            colorAlpha: null,
            colorSaturation: null,
            borderWidth: 0,
            gapWidth: 0,
            borderColor: "#fff",
            borderColorSaturation: null
            // If specified, borderColor will be ineffective, and the
            // border color is evaluated by color of current node and
            // borderColorSaturation.
          },
          emphasis: {
            upperLabel: {
              show: true,
              position: [0, "50%"],
              overflow: "truncate",
              verticalAlign: "middle"
            }
          },
          visualDimension: 0,
          visualMin: null,
          visualMax: null,
          color: [],
          // level[n].color (if necessary).
          // + Specify color list of each level. level[0].color would be global
          // color list if not specified. (see method `setDefault`).
          // + But set as a empty array to forbid fetch color from global palette
          // when using nodeModel.get('color'), otherwise nodes on deep level
          // will always has color palette set and are not able to inherit color
          // from parent node.
          // + TreemapSeries.color can not be set as 'none', otherwise effect
          // legend color fetching (see seriesColor.js).
          colorAlpha: null,
          colorSaturation: null,
          colorMappingBy: "index",
          visibleMin: 10,
          // be rendered. Only works when sort is 'asc' or 'desc'.
          childrenVisibleMin: null,
          // grandchildren will not show.
          // Why grandchildren? If not grandchildren but children,
          // some siblings show children and some not,
          // the appearance may be mess and not consistent,
          levels: []
          // Each item: {
          //     visibleMin, itemStyle, visualDimension, label
          // }
        };
        return TreemapSeriesModel2;
      }(SeriesModel)
    );
    function completeTreeValue$1(dataNode) {
      var sum2 = 0;
      each$f(dataNode.children, function(child) {
        completeTreeValue$1(child);
        var childValue = child.value;
        isArray$2(childValue) && (childValue = childValue[0]);
        sum2 += childValue;
      });
      var thisValue = dataNode.value;
      if (isArray$2(thisValue)) {
        thisValue = thisValue[0];
      }
      if (thisValue == null || isNaN(thisValue)) {
        thisValue = sum2;
      }
      if (thisValue < 0) {
        thisValue = 0;
      }
      isArray$2(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;
    }
    function setDefault(levels, ecModel) {
      var globalColorList = normalizeToArray(ecModel.get("color"));
      var globalDecalList = normalizeToArray(ecModel.get(["aria", "decal", "decals"]));
      if (!globalColorList) {
        return;
      }
      levels = levels || [];
      var hasColorDefine;
      var hasDecalDefine;
      each$f(levels, function(levelDefine) {
        var model = new Model(levelDefine);
        var modelColor = model.get("color");
        var modelDecal = model.get("decal");
        if (model.get(["itemStyle", "color"]) || modelColor && modelColor !== "none") {
          hasColorDefine = true;
        }
        if (model.get(["itemStyle", "decal"]) || modelDecal && modelDecal !== "none") {
          hasDecalDefine = true;
        }
      });
      var level0 = levels[0] || (levels[0] = {});
      if (!hasColorDefine) {
        level0.color = globalColorList.slice();
      }
      if (!hasDecalDefine && globalDecalList) {
        level0.decal = globalDecalList.slice();
      }
      return levels;
    }
    var TEXT_PADDING = 8;
    var ITEM_GAP = 8;
    var ARRAY_LENGTH = 5;
    var Breadcrumb = (
      /** @class */
      function() {
        function Breadcrumb2(containerGroup) {
          this.group = new Group$3();
          containerGroup.add(this.group);
        }
        Breadcrumb2.prototype.render = function(seriesModel, api2, targetNode, onSelect) {
          var model = seriesModel.getModel("breadcrumb");
          var thisGroup = this.group;
          thisGroup.removeAll();
          if (!model.get("show") || !targetNode) {
            return;
          }
          var normalStyleModel = model.getModel("itemStyle");
          var emphasisModel = model.getModel("emphasis");
          var textStyleModel = normalStyleModel.getModel("textStyle");
          var emphasisTextStyleModel = emphasisModel.getModel(["itemStyle", "textStyle"]);
          var layoutParam = {
            pos: {
              left: model.get("left"),
              right: model.get("right"),
              top: model.get("top"),
              bottom: model.get("bottom")
            },
            box: {
              width: api2.getWidth(),
              height: api2.getHeight()
            },
            emptyItemWidth: model.get("emptyItemWidth"),
            totalWidth: 0,
            renderList: []
          };
          this._prepare(targetNode, layoutParam, textStyleModel);
          this._renderContent(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect);
          positionElement(thisGroup, layoutParam.pos, layoutParam.box);
        };
        Breadcrumb2.prototype._prepare = function(targetNode, layoutParam, textStyleModel) {
          for (var node = targetNode; node; node = node.parentNode) {
            var text = convertOptionIdName(node.getModel().get("name"), "");
            var textRect = textStyleModel.getTextRect(text);
            var itemWidth = Math.max(textRect.width + TEXT_PADDING * 2, layoutParam.emptyItemWidth);
            layoutParam.totalWidth += itemWidth + ITEM_GAP;
            layoutParam.renderList.push({
              node,
              text,
              width: itemWidth
            });
          }
        };
        Breadcrumb2.prototype._renderContent = function(seriesModel, layoutParam, normalStyleModel, emphasisModel, textStyleModel, emphasisTextStyleModel, onSelect) {
          var lastX = 0;
          var emptyItemWidth = layoutParam.emptyItemWidth;
          var height = seriesModel.get(["breadcrumb", "height"]);
          var availableSize = getAvailableSize(layoutParam.pos, layoutParam.box);
          var totalWidth = layoutParam.totalWidth;
          var renderList2 = layoutParam.renderList;
          var emphasisItemStyle = emphasisModel.getModel("itemStyle").getItemStyle();
          for (var i2 = renderList2.length - 1; i2 >= 0; i2--) {
            var item = renderList2[i2];
            var itemNode = item.node;
            var itemWidth = item.width;
            var text = item.text;
            if (totalWidth > availableSize.width) {
              totalWidth -= itemWidth - emptyItemWidth;
              itemWidth = emptyItemWidth;
              text = null;
            }
            var el = new Polygon({
              shape: {
                points: makeItemPoints(lastX, 0, itemWidth, height, i2 === renderList2.length - 1, i2 === 0)
              },
              style: defaults$1(normalStyleModel.getItemStyle(), {
                lineJoin: "bevel"
              }),
              textContent: new ZRText({
                style: createTextStyle(textStyleModel, {
                  text
                })
              }),
              textConfig: {
                position: "inside"
              },
              z2: Z2_EMPHASIS_LIFT * 1e4,
              onclick: curry$1(onSelect, itemNode)
            });
            el.disableLabelAnimation = true;
            el.getTextContent().ensureState("emphasis").style = createTextStyle(emphasisTextStyleModel, {
              text
            });
            el.ensureState("emphasis").style = emphasisItemStyle;
            toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
            this.group.add(el);
            packEventData(el, seriesModel, itemNode);
            lastX += itemWidth + ITEM_GAP;
          }
        };
        Breadcrumb2.prototype.remove = function() {
          this.group.removeAll();
        };
        return Breadcrumb2;
      }()
    );
    function makeItemPoints(x2, y, itemWidth, itemHeight, head, tail) {
      var points2 = [[head ? x2 : x2 - ARRAY_LENGTH, y], [x2 + itemWidth, y], [x2 + itemWidth, y + itemHeight], [head ? x2 : x2 - ARRAY_LENGTH, y + itemHeight]];
      !tail && points2.splice(2, 0, [x2 + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);
      !head && points2.push([x2, y + itemHeight / 2]);
      return points2;
    }
    function packEventData(el, seriesModel, itemNode) {
      getECData(el).eventData = {
        componentType: "series",
        componentSubType: "treemap",
        componentIndex: seriesModel.componentIndex,
        seriesIndex: seriesModel.seriesIndex,
        seriesName: seriesModel.name,
        seriesType: "treemap",
        selfType: "breadcrumb",
        nodeData: {
          dataIndex: itemNode && itemNode.dataIndex,
          name: itemNode && itemNode.name
        },
        treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel)
      };
    }
    var AnimationWrap = (
      /** @class */
      function() {
        function AnimationWrap2() {
          this._storage = [];
          this._elExistsMap = {};
        }
        AnimationWrap2.prototype.add = function(el, target, duration2, delay, easing) {
          if (this._elExistsMap[el.id]) {
            return false;
          }
          this._elExistsMap[el.id] = true;
          this._storage.push({
            el,
            target,
            duration: duration2,
            delay,
            easing
          });
          return true;
        };
        AnimationWrap2.prototype.finished = function(callback) {
          this._finishedCallback = callback;
          return this;
        };
        AnimationWrap2.prototype.start = function() {
          var _this = this;
          var count2 = this._storage.length;
          var checkTerminate = function() {
            count2--;
            if (count2 <= 0) {
              _this._storage.length = 0;
              _this._elExistsMap = {};
              _this._finishedCallback && _this._finishedCallback();
            }
          };
          for (var i2 = 0, len2 = this._storage.length; i2 < len2; i2++) {
            var item = this._storage[i2];
            item.el.animateTo(item.target, {
              duration: item.duration,
              delay: item.delay,
              easing: item.easing,
              setToFinal: true,
              done: checkTerminate,
              aborted: checkTerminate
            });
          }
          return this;
        };
        return AnimationWrap2;
      }()
    );
    function createWrap() {
      return new AnimationWrap();
    }
    var Group$2 = Group$3;
    var Rect$1 = Rect$2;
    var DRAG_THRESHOLD = 3;
    var PATH_LABEL_NOAMAL = "label";
    var PATH_UPPERLABEL_NORMAL = "upperLabel";
    var Z2_BASE = Z2_EMPHASIS_LIFT * 10;
    var Z2_BG = Z2_EMPHASIS_LIFT * 2;
    var Z2_CONTENT = Z2_EMPHASIS_LIFT * 3;
    var getStateItemStyle = makeStyleMapper([
      ["fill", "color"],
      // `borderColor` and `borderWidth` has been occupied,
      // so use `stroke` to indicate the stroke of the rect.
      ["stroke", "strokeColor"],
      ["lineWidth", "strokeWidth"],
      ["shadowBlur"],
      ["shadowOffsetX"],
      ["shadowOffsetY"],
      ["shadowColor"]
      // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
      // So do not transfer decal directly.
    ]);
    var getItemStyleNormal = function(model) {
      var itemStyle = getStateItemStyle(model);
      itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null;
      return itemStyle;
    };
    var inner$d = makeInner();
    var TreemapView = (
      /** @class */
      function(_super) {
        __extends$1(TreemapView2, _super);
        function TreemapView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TreemapView2.type;
          _this._state = "ready";
          _this._storage = createStorage();
          return _this;
        }
        TreemapView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
          var models = ecModel.findComponents({
            mainType: "series",
            subType: "treemap",
            query: payload
          });
          if (indexOf(models, seriesModel) < 0) {
            return;
          }
          this.seriesModel = seriesModel;
          this.api = api2;
          this.ecModel = ecModel;
          var types2 = ["treemapZoomToNode", "treemapRootToNode"];
          var targetInfo = retrieveTargetInfo(payload, types2, seriesModel);
          var payloadType = payload && payload.type;
          var layoutInfo = seriesModel.layoutInfo;
          var isInit = !this._oldTree;
          var thisStorage = this._storage;
          var reRoot = payloadType === "treemapRootToNode" && targetInfo && thisStorage ? {
            rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],
            direction: payload.direction
          } : null;
          var containerGroup = this._giveContainerGroup(layoutInfo);
          var hasAnimation = seriesModel.get("animation");
          var renderResult = this._doRender(containerGroup, seriesModel, reRoot);
          hasAnimation && !isInit && (!payloadType || payloadType === "treemapZoomToNode" || payloadType === "treemapRootToNode") ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot) : renderResult.renderFinally();
          this._resetController(api2);
          this._renderBreadcrumb(seriesModel, api2, targetInfo);
        };
        TreemapView2.prototype._giveContainerGroup = function(layoutInfo) {
          var containerGroup = this._containerGroup;
          if (!containerGroup) {
            containerGroup = this._containerGroup = new Group$2();
            this._initEvents(containerGroup);
            this.group.add(containerGroup);
          }
          containerGroup.x = layoutInfo.x;
          containerGroup.y = layoutInfo.y;
          return containerGroup;
        };
        TreemapView2.prototype._doRender = function(containerGroup, seriesModel, reRoot) {
          var thisTree = seriesModel.getData().tree;
          var oldTree = this._oldTree;
          var lastsForAnimation = createStorage();
          var thisStorage = createStorage();
          var oldStorage = this._storage;
          var willInvisibleEls = [];
          function doRenderNode(thisNode, oldNode, parentGroup, depth) {
            return renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth);
          }
          dualTravel(thisTree.root ? [thisTree.root] : [], oldTree && oldTree.root ? [oldTree.root] : [], containerGroup, thisTree === oldTree || !oldTree, 0);
          var willDeleteEls = clearStorage(oldStorage);
          this._oldTree = thisTree;
          this._storage = thisStorage;
          if (this._controllerHost) {
            var _oldRootLayout = this.seriesModel.layoutInfo;
            var rootLayout = thisTree.root.getLayout();
            if (rootLayout.width === _oldRootLayout.width && rootLayout.height === _oldRootLayout.height) {
              this._controllerHost.zoom = 1;
            }
          }
          return {
            lastsForAnimation,
            willDeleteEls,
            renderFinally
          };
          function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, depth) {
            if (sameTree) {
              oldViewChildren = thisViewChildren;
              each$f(thisViewChildren, function(child, index) {
                !child.isRemoved() && processNode(index, index);
              });
            } else {
              new DataDiffer(oldViewChildren, thisViewChildren, getKey2, getKey2).add(processNode).update(processNode).remove(curry$1(processNode, null)).execute();
            }
            function getKey2(node) {
              return node.getId();
            }
            function processNode(newIndex, oldIndex) {
              var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;
              var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;
              var group = doRenderNode(thisNode, oldNode, parentGroup, depth);
              group && dualTravel(thisNode && thisNode.viewChildren || [], oldNode && oldNode.viewChildren || [], group, sameTree, depth + 1);
            }
          }
          function clearStorage(storage2) {
            var willDeleteEls2 = createStorage();
            storage2 && each$f(storage2, function(store2, storageName) {
              var delEls = willDeleteEls2[storageName];
              each$f(store2, function(el) {
                el && (delEls.push(el), inner$d(el).willDelete = true);
              });
            });
            return willDeleteEls2;
          }
          function renderFinally() {
            each$f(willDeleteEls, function(els) {
              each$f(els, function(el) {
                el.parent && el.parent.remove(el);
              });
            });
            each$f(willInvisibleEls, function(el) {
              el.invisible = true;
              el.dirty();
            });
          }
        };
        TreemapView2.prototype._doAnimation = function(containerGroup, renderResult, seriesModel, reRoot) {
          var durationOption = seriesModel.get("animationDurationUpdate");
          var easingOption = seriesModel.get("animationEasing");
          var duration2 = (isFunction$1(durationOption) ? 0 : durationOption) || 0;
          var easing = (isFunction$1(easingOption) ? null : easingOption) || "cubicOut";
          var animationWrap = createWrap();
          each$f(renderResult.willDeleteEls, function(store2, storageName) {
            each$f(store2, function(el, rawIndex) {
              if (el.invisible) {
                return;
              }
              var parent2 = el.parent;
              var target;
              var innerStore = inner$d(parent2);
              if (reRoot && reRoot.direction === "drillDown") {
                target = parent2 === reRoot.rootNodeGroup ? {
                  shape: {
                    x: 0,
                    y: 0,
                    width: innerStore.nodeWidth,
                    height: innerStore.nodeHeight
                  },
                  style: {
                    opacity: 0
                  }
                } : {
                  style: {
                    opacity: 0
                  }
                };
              } else {
                var targetX = 0;
                var targetY = 0;
                if (!innerStore.willDelete) {
                  targetX = innerStore.nodeWidth / 2;
                  targetY = innerStore.nodeHeight / 2;
                }
                target = storageName === "nodeGroup" ? {
                  x: targetX,
                  y: targetY,
                  style: {
                    opacity: 0
                  }
                } : {
                  shape: {
                    x: targetX,
                    y: targetY,
                    width: 0,
                    height: 0
                  },
                  style: {
                    opacity: 0
                  }
                };
              }
              target && animationWrap.add(el, target, duration2, 0, easing);
            });
          });
          each$f(this._storage, function(store2, storageName) {
            each$f(store2, function(el, rawIndex) {
              var last2 = renderResult.lastsForAnimation[storageName][rawIndex];
              var target = {};
              if (!last2) {
                return;
              }
              if (el instanceof Group$3) {
                if (last2.oldX != null) {
                  target.x = el.x;
                  target.y = el.y;
                  el.x = last2.oldX;
                  el.y = last2.oldY;
                }
              } else {
                if (last2.oldShape) {
                  target.shape = extend$1({}, el.shape);
                  el.setShape(last2.oldShape);
                }
                if (last2.fadein) {
                  el.setStyle("opacity", 0);
                  target.style = {
                    opacity: 1
                  };
                } else if (el.style.opacity !== 1) {
                  target.style = {
                    opacity: 1
                  };
                }
              }
              animationWrap.add(el, target, duration2, 0, easing);
            });
          }, this);
          this._state = "animating";
          animationWrap.finished(bind$2(function() {
            this._state = "ready";
            renderResult.renderFinally();
          }, this)).start();
        };
        TreemapView2.prototype._resetController = function(api2) {
          var controller = this._controller;
          var controllerHost = this._controllerHost;
          if (!controllerHost) {
            this._controllerHost = {
              target: this.group
            };
            controllerHost = this._controllerHost;
          }
          if (!controller) {
            controller = this._controller = new RoamController(api2.getZr());
            controller.enable(this.seriesModel.get("roam"));
            controllerHost.zoomLimit = this.seriesModel.get("scaleLimit");
            controllerHost.zoom = this.seriesModel.get("zoom");
            controller.on("pan", bind$2(this._onPan, this));
            controller.on("zoom", bind$2(this._onZoom, this));
          }
          var rect = new BoundingRect(0, 0, api2.getWidth(), api2.getHeight());
          controller.setPointerChecker(function(e2, x2, y) {
            return rect.contain(x2, y);
          });
        };
        TreemapView2.prototype._clearController = function() {
          var controller = this._controller;
          this._controllerHost = null;
          if (controller) {
            controller.dispose();
            controller = null;
          }
        };
        TreemapView2.prototype._onPan = function(e2) {
          if (this._state !== "animating" && (Math.abs(e2.dx) > DRAG_THRESHOLD || Math.abs(e2.dy) > DRAG_THRESHOLD)) {
            var root2 = this.seriesModel.getData().tree.root;
            if (!root2) {
              return;
            }
            var rootLayout = root2.getLayout();
            if (!rootLayout) {
              return;
            }
            this.api.dispatchAction({
              type: "treemapMove",
              from: this.uid,
              seriesId: this.seriesModel.id,
              rootRect: {
                x: rootLayout.x + e2.dx,
                y: rootLayout.y + e2.dy,
                width: rootLayout.width,
                height: rootLayout.height
              }
            });
          }
        };
        TreemapView2.prototype._onZoom = function(e2) {
          var mouseX = e2.originX;
          var mouseY = e2.originY;
          var zoomDelta = e2.scale;
          if (this._state !== "animating") {
            var root2 = this.seriesModel.getData().tree.root;
            if (!root2) {
              return;
            }
            var rootLayout = root2.getLayout();
            if (!rootLayout) {
              return;
            }
            var rect = new BoundingRect(rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height);
            var zoomLimit = null;
            var _controllerHost = this._controllerHost;
            zoomLimit = _controllerHost.zoomLimit;
            var newZoom = _controllerHost.zoom = _controllerHost.zoom || 1;
            newZoom *= zoomDelta;
            if (zoomLimit) {
              var zoomMin = zoomLimit.min || 0;
              var zoomMax = zoomLimit.max || Infinity;
              newZoom = Math.max(Math.min(zoomMax, newZoom), zoomMin);
            }
            var zoomScale = newZoom / _controllerHost.zoom;
            _controllerHost.zoom = newZoom;
            var layoutInfo = this.seriesModel.layoutInfo;
            mouseX -= layoutInfo.x;
            mouseY -= layoutInfo.y;
            var m2 = create$1();
            translate(m2, m2, [-mouseX, -mouseY]);
            scale$1(m2, m2, [zoomScale, zoomScale]);
            translate(m2, m2, [mouseX, mouseY]);
            rect.applyTransform(m2);
            this.api.dispatchAction({
              type: "treemapRender",
              from: this.uid,
              seriesId: this.seriesModel.id,
              rootRect: {
                x: rect.x,
                y: rect.y,
                width: rect.width,
                height: rect.height
              }
            });
          }
        };
        TreemapView2.prototype._initEvents = function(containerGroup) {
          var _this = this;
          containerGroup.on("click", function(e2) {
            if (_this._state !== "ready") {
              return;
            }
            var nodeClick = _this.seriesModel.get("nodeClick", true);
            if (!nodeClick) {
              return;
            }
            var targetInfo = _this.findTarget(e2.offsetX, e2.offsetY);
            if (!targetInfo) {
              return;
            }
            var node = targetInfo.node;
            if (node.getLayout().isLeafRoot) {
              _this._rootToNode(targetInfo);
            } else {
              if (nodeClick === "zoomToNode") {
                _this._zoomToNode(targetInfo);
              } else if (nodeClick === "link") {
                var itemModel = node.hostTree.data.getItemModel(node.dataIndex);
                var link = itemModel.get("link", true);
                var linkTarget = itemModel.get("target", true) || "blank";
                link && windowOpen(link, linkTarget);
              }
            }
          }, this);
        };
        TreemapView2.prototype._renderBreadcrumb = function(seriesModel, api2, targetInfo) {
          var _this = this;
          if (!targetInfo) {
            targetInfo = seriesModel.get("leafDepth", true) != null ? {
              node: seriesModel.getViewRoot()
            } : this.findTarget(api2.getWidth() / 2, api2.getHeight() / 2);
            if (!targetInfo) {
              targetInfo = {
                node: seriesModel.getData().tree.root
              };
            }
          }
          (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))).render(seriesModel, api2, targetInfo.node, function(node) {
            if (_this._state !== "animating") {
              aboveViewRoot(seriesModel.getViewRoot(), node) ? _this._rootToNode({
                node
              }) : _this._zoomToNode({
                node
              });
            }
          });
        };
        TreemapView2.prototype.remove = function() {
          this._clearController();
          this._containerGroup && this._containerGroup.removeAll();
          this._storage = createStorage();
          this._state = "ready";
          this._breadcrumb && this._breadcrumb.remove();
        };
        TreemapView2.prototype.dispose = function() {
          this._clearController();
        };
        TreemapView2.prototype._zoomToNode = function(targetInfo) {
          this.api.dispatchAction({
            type: "treemapZoomToNode",
            from: this.uid,
            seriesId: this.seriesModel.id,
            targetNode: targetInfo.node
          });
        };
        TreemapView2.prototype._rootToNode = function(targetInfo) {
          this.api.dispatchAction({
            type: "treemapRootToNode",
            from: this.uid,
            seriesId: this.seriesModel.id,
            targetNode: targetInfo.node
          });
        };
        TreemapView2.prototype.findTarget = function(x2, y) {
          var targetInfo;
          var viewRoot = this.seriesModel.getViewRoot();
          viewRoot.eachNode({
            attr: "viewChildren",
            order: "preorder"
          }, function(node) {
            var bgEl = this._storage.background[node.getRawIndex()];
            if (bgEl) {
              var point = bgEl.transformCoordToLocal(x2, y);
              var shape = bgEl.shape;
              if (shape.x <= point[0] && point[0] <= shape.x + shape.width && shape.y <= point[1] && point[1] <= shape.y + shape.height) {
                targetInfo = {
                  node,
                  offsetX: point[0],
                  offsetY: point[1]
                };
              } else {
                return false;
              }
            }
          }, this);
          return targetInfo;
        };
        TreemapView2.type = "treemap";
        return TreemapView2;
      }(ChartView)
    );
    function createStorage() {
      return {
        nodeGroup: [],
        background: [],
        content: []
      };
    }
    function renderNode(seriesModel, thisStorage, oldStorage, reRoot, lastsForAnimation, willInvisibleEls, thisNode, oldNode, parentGroup, depth) {
      if (!thisNode) {
        return;
      }
      var thisLayout = thisNode.getLayout();
      var data = seriesModel.getData();
      var nodeModel = thisNode.getModel();
      data.setItemGraphicEl(thisNode.dataIndex, null);
      if (!thisLayout || !thisLayout.isInView) {
        return;
      }
      var thisWidth = thisLayout.width;
      var thisHeight = thisLayout.height;
      var borderWidth = thisLayout.borderWidth;
      var thisInvisible = thisLayout.invisible;
      var thisRawIndex = thisNode.getRawIndex();
      var oldRawIndex = oldNode && oldNode.getRawIndex();
      var thisViewChildren = thisNode.viewChildren;
      var upperHeight = thisLayout.upperHeight;
      var isParent = thisViewChildren && thisViewChildren.length;
      var itemStyleNormalModel = nodeModel.getModel("itemStyle");
      var itemStyleEmphasisModel = nodeModel.getModel(["emphasis", "itemStyle"]);
      var itemStyleBlurModel = nodeModel.getModel(["blur", "itemStyle"]);
      var itemStyleSelectModel = nodeModel.getModel(["select", "itemStyle"]);
      var borderRadius = itemStyleNormalModel.get("borderRadius") || 0;
      var group = giveGraphic("nodeGroup", Group$2);
      if (!group) {
        return;
      }
      parentGroup.add(group);
      group.x = thisLayout.x || 0;
      group.y = thisLayout.y || 0;
      group.markRedraw();
      inner$d(group).nodeWidth = thisWidth;
      inner$d(group).nodeHeight = thisHeight;
      if (thisLayout.isAboveViewRoot) {
        return group;
      }
      var bg = giveGraphic("background", Rect$1, depth, Z2_BG);
      bg && renderBackground(group, bg, isParent && thisLayout.upperLabelHeight);
      var emphasisModel = nodeModel.getModel("emphasis");
      var focus = emphasisModel.get("focus");
      var blurScope = emphasisModel.get("blurScope");
      var isDisabled = emphasisModel.get("disabled");
      var focusOrIndices = focus === "ancestor" ? thisNode.getAncestorsIndices() : focus === "descendant" ? thisNode.getDescendantIndices() : focus;
      if (isParent) {
        if (isHighDownDispatcher(group)) {
          setAsHighDownDispatcher(group, false);
        }
        if (bg) {
          setAsHighDownDispatcher(bg, !isDisabled);
          data.setItemGraphicEl(thisNode.dataIndex, bg);
          enableHoverFocus(bg, focusOrIndices, blurScope);
        }
      } else {
        var content2 = giveGraphic("content", Rect$1, depth, Z2_CONTENT);
        content2 && renderContent(group, content2);
        bg.disableMorphing = true;
        if (bg && isHighDownDispatcher(bg)) {
          setAsHighDownDispatcher(bg, false);
        }
        setAsHighDownDispatcher(group, !isDisabled);
        data.setItemGraphicEl(thisNode.dataIndex, group);
        var cursorStyle = nodeModel.getShallow("cursor");
        cursorStyle && content2.attr("cursor", cursorStyle);
        enableHoverFocus(group, focusOrIndices, blurScope);
      }
      return group;
      function renderBackground(group2, bg2, useUpperLabel) {
        var ecData = getECData(bg2);
        ecData.dataIndex = thisNode.dataIndex;
        ecData.seriesIndex = seriesModel.seriesIndex;
        bg2.setShape({
          x: 0,
          y: 0,
          width: thisWidth,
          height: thisHeight,
          r: borderRadius
        });
        if (thisInvisible) {
          processInvisible(bg2);
        } else {
          bg2.invisible = false;
          var style = thisNode.getVisual("style");
          var visualBorderColor = style.stroke;
          var normalStyle = getItemStyleNormal(itemStyleNormalModel);
          normalStyle.fill = visualBorderColor;
          var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);
          emphasisStyle.fill = itemStyleEmphasisModel.get("borderColor");
          var blurStyle = getStateItemStyle(itemStyleBlurModel);
          blurStyle.fill = itemStyleBlurModel.get("borderColor");
          var selectStyle = getStateItemStyle(itemStyleSelectModel);
          selectStyle.fill = itemStyleSelectModel.get("borderColor");
          if (useUpperLabel) {
            var upperLabelWidth = thisWidth - 2 * borderWidth;
            prepareText(
              // PENDING: convert ZRColor to ColorString for text.
              bg2,
              visualBorderColor,
              style.opacity,
              {
                x: borderWidth,
                y: 0,
                width: upperLabelWidth,
                height: upperHeight
              }
            );
          } else {
            bg2.removeTextContent();
          }
          bg2.setStyle(normalStyle);
          bg2.ensureState("emphasis").style = emphasisStyle;
          bg2.ensureState("blur").style = blurStyle;
          bg2.ensureState("select").style = selectStyle;
          setDefaultStateProxy(bg2);
        }
        group2.add(bg2);
      }
      function renderContent(group2, content3) {
        var ecData = getECData(content3);
        ecData.dataIndex = thisNode.dataIndex;
        ecData.seriesIndex = seriesModel.seriesIndex;
        var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);
        var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);
        content3.culling = true;
        content3.setShape({
          x: borderWidth,
          y: borderWidth,
          width: contentWidth,
          height: contentHeight,
          r: borderRadius
        });
        if (thisInvisible) {
          processInvisible(content3);
        } else {
          content3.invisible = false;
          var nodeStyle = thisNode.getVisual("style");
          var visualColor = nodeStyle.fill;
          var normalStyle = getItemStyleNormal(itemStyleNormalModel);
          normalStyle.fill = visualColor;
          normalStyle.decal = nodeStyle.decal;
          var emphasisStyle = getStateItemStyle(itemStyleEmphasisModel);
          var blurStyle = getStateItemStyle(itemStyleBlurModel);
          var selectStyle = getStateItemStyle(itemStyleSelectModel);
          prepareText(content3, visualColor, nodeStyle.opacity, null);
          content3.setStyle(normalStyle);
          content3.ensureState("emphasis").style = emphasisStyle;
          content3.ensureState("blur").style = blurStyle;
          content3.ensureState("select").style = selectStyle;
          setDefaultStateProxy(content3);
        }
        group2.add(content3);
      }
      function processInvisible(element) {
        !element.invisible && willInvisibleEls.push(element);
      }
      function prepareText(rectEl, visualColor, visualOpacity, upperLabelRect) {
        var normalLabelModel = nodeModel.getModel(upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL);
        var defaultText = convertOptionIdName(nodeModel.get("name"), null);
        var isShow = normalLabelModel.getShallow("show");
        setLabelStyle(rectEl, getLabelStatesModels(nodeModel, upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL), {
          defaultText: isShow ? defaultText : null,
          inheritColor: visualColor,
          defaultOpacity: visualOpacity,
          labelFetcher: seriesModel,
          labelDataIndex: thisNode.dataIndex
        });
        var textEl = rectEl.getTextContent();
        if (!textEl) {
          return;
        }
        var textStyle = textEl.style;
        var textPadding = normalizeCssArray$1(textStyle.padding || 0);
        if (upperLabelRect) {
          rectEl.setTextConfig({
            layoutRect: upperLabelRect
          });
          textEl.disableLabelLayout = true;
        }
        textEl.beforeUpdate = function() {
          var width = Math.max((upperLabelRect ? upperLabelRect.width : rectEl.shape.width) - textPadding[1] - textPadding[3], 0);
          var height = Math.max((upperLabelRect ? upperLabelRect.height : rectEl.shape.height) - textPadding[0] - textPadding[2], 0);
          if (textStyle.width !== width || textStyle.height !== height) {
            textEl.setStyle({
              width,
              height
            });
          }
        };
        textStyle.truncateMinChar = 2;
        textStyle.lineOverflow = "truncate";
        addDrillDownIcon(textStyle, upperLabelRect, thisLayout);
        var textEmphasisState = textEl.getState("emphasis");
        addDrillDownIcon(textEmphasisState ? textEmphasisState.style : null, upperLabelRect, thisLayout);
      }
      function addDrillDownIcon(style, upperLabelRect, thisLayout2) {
        var text = style ? style.text : null;
        if (!upperLabelRect && thisLayout2.isLeafRoot && text != null) {
          var iconChar = seriesModel.get("drillDownIcon", true);
          style.text = iconChar ? iconChar + " " + text : text;
        }
      }
      function giveGraphic(storageName, Ctor, depth2, z2) {
        var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];
        var lasts = lastsForAnimation[storageName];
        if (element) {
          oldStorage[storageName][oldRawIndex] = null;
          prepareAnimationWhenHasOld(lasts, element);
        } else if (!thisInvisible) {
          element = new Ctor();
          if (element instanceof Displayable) {
            element.z2 = calculateZ2(depth2, z2);
          }
          prepareAnimationWhenNoOld(lasts, element);
        }
        return thisStorage[storageName][thisRawIndex] = element;
      }
      function prepareAnimationWhenHasOld(lasts, element) {
        var lastCfg = lasts[thisRawIndex] = {};
        if (element instanceof Group$2) {
          lastCfg.oldX = element.x;
          lastCfg.oldY = element.y;
        } else {
          lastCfg.oldShape = extend$1({}, element.shape);
        }
      }
      function prepareAnimationWhenNoOld(lasts, element) {
        var lastCfg = lasts[thisRawIndex] = {};
        var parentNode2 = thisNode.parentNode;
        var isGroup = element instanceof Group$3;
        if (parentNode2 && (!reRoot || reRoot.direction === "drillDown")) {
          var parentOldX = 0;
          var parentOldY = 0;
          var parentOldBg = lastsForAnimation.background[parentNode2.getRawIndex()];
          if (!reRoot && parentOldBg && parentOldBg.oldShape) {
            parentOldX = parentOldBg.oldShape.width;
            parentOldY = parentOldBg.oldShape.height;
          }
          if (isGroup) {
            lastCfg.oldX = 0;
            lastCfg.oldY = parentOldY;
          } else {
            lastCfg.oldShape = {
              x: parentOldX,
              y: parentOldY,
              width: 0,
              height: 0
            };
          }
        }
        lastCfg.fadein = !isGroup;
      }
    }
    function calculateZ2(depth, z2InLevel) {
      return depth * Z2_BASE + z2InLevel;
    }
    var each$c = each$f;
    var isObject$2 = isObject$5;
    var CATEGORY_DEFAULT_VISUAL_INDEX = -1;
    var VisualMapping = (
      /** @class */
      function() {
        function VisualMapping2(option) {
          var mappingMethod = option.mappingMethod;
          var visualType = option.type;
          var thisOption = this.option = clone$4(option);
          this.type = visualType;
          this.mappingMethod = mappingMethod;
          this._normalizeData = normalizers[mappingMethod];
          var visualHandler = VisualMapping2.visualHandlers[visualType];
          this.applyVisual = visualHandler.applyVisual;
          this.getColorMapper = visualHandler.getColorMapper;
          this._normalizedToVisual = visualHandler._normalizedToVisual[mappingMethod];
          if (mappingMethod === "piecewise") {
            normalizeVisualRange(thisOption);
            preprocessForPiecewise(thisOption);
          } else if (mappingMethod === "category") {
            thisOption.categories ? preprocessForSpecifiedCategory(thisOption) : normalizeVisualRange(thisOption, true);
          } else {
            assert(mappingMethod !== "linear" || thisOption.dataExtent);
            normalizeVisualRange(thisOption);
          }
        }
        VisualMapping2.prototype.mapValueToVisual = function(value) {
          var normalized = this._normalizeData(value);
          return this._normalizedToVisual(normalized, value);
        };
        VisualMapping2.prototype.getNormalizer = function() {
          return bind$2(this._normalizeData, this);
        };
        VisualMapping2.listVisualTypes = function() {
          return keys$1(VisualMapping2.visualHandlers);
        };
        VisualMapping2.isValidType = function(visualType) {
          return VisualMapping2.visualHandlers.hasOwnProperty(visualType);
        };
        VisualMapping2.eachVisual = function(visual, callback, context) {
          if (isObject$5(visual)) {
            each$f(visual, callback, context);
          } else {
            callback.call(context, visual);
          }
        };
        VisualMapping2.mapVisual = function(visual, callback, context) {
          var isPrimary;
          var newVisual = isArray$2(visual) ? [] : isObject$5(visual) ? {} : (isPrimary = true, null);
          VisualMapping2.eachVisual(visual, function(v4, key) {
            var newVal = callback.call(context, v4, key);
            isPrimary ? newVisual = newVal : newVisual[key] = newVal;
          });
          return newVisual;
        };
        VisualMapping2.retrieveVisuals = function(obj) {
          var ret = {};
          var hasVisual;
          obj && each$c(VisualMapping2.visualHandlers, function(h2, visualType) {
            if (obj.hasOwnProperty(visualType)) {
              ret[visualType] = obj[visualType];
              hasVisual = true;
            }
          });
          return hasVisual ? ret : null;
        };
        VisualMapping2.prepareVisualTypes = function(visualTypes) {
          if (isArray$2(visualTypes)) {
            visualTypes = visualTypes.slice();
          } else if (isObject$2(visualTypes)) {
            var types_1 = [];
            each$c(visualTypes, function(item, type) {
              types_1.push(type);
            });
            visualTypes = types_1;
          } else {
            return [];
          }
          visualTypes.sort(function(type1, type22) {
            return type22 === "color" && type1 !== "color" && type1.indexOf("color") === 0 ? 1 : -1;
          });
          return visualTypes;
        };
        VisualMapping2.dependsOn = function(visualType1, visualType2) {
          return visualType2 === "color" ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) : visualType1 === visualType2;
        };
        VisualMapping2.findPieceIndex = function(value, pieceList, findClosestWhenOutside) {
          var possibleI;
          var abs2 = Infinity;
          for (var i2 = 0, len2 = pieceList.length; i2 < len2; i2++) {
            var pieceValue = pieceList[i2].value;
            if (pieceValue != null) {
              if (pieceValue === value || isString$1(pieceValue) && pieceValue === value + "") {
                return i2;
              }
              findClosestWhenOutside && updatePossible(pieceValue, i2);
            }
          }
          for (var i2 = 0, len2 = pieceList.length; i2 < len2; i2++) {
            var piece = pieceList[i2];
            var interval = piece.interval;
            var close_1 = piece.close;
            if (interval) {
              if (interval[0] === -Infinity) {
                if (littleThan(close_1[1], value, interval[1])) {
                  return i2;
                }
              } else if (interval[1] === Infinity) {
                if (littleThan(close_1[0], interval[0], value)) {
                  return i2;
                }
              } else if (littleThan(close_1[0], interval[0], value) && littleThan(close_1[1], value, interval[1])) {
                return i2;
              }
              findClosestWhenOutside && updatePossible(interval[0], i2);
              findClosestWhenOutside && updatePossible(interval[1], i2);
            }
          }
          if (findClosestWhenOutside) {
            return value === Infinity ? pieceList.length - 1 : value === -Infinity ? 0 : possibleI;
          }
          function updatePossible(val, index) {
            var newAbs = Math.abs(val - value);
            if (newAbs < abs2) {
              abs2 = newAbs;
              possibleI = index;
            }
          }
        };
        VisualMapping2.visualHandlers = {
          color: {
            applyVisual: makeApplyVisual("color"),
            getColorMapper: function() {
              var thisOption = this.option;
              return bind$2(thisOption.mappingMethod === "category" ? function(value, isNormalized) {
                !isNormalized && (value = this._normalizeData(value));
                return doMapCategory.call(this, value);
              } : function(value, isNormalized, out2) {
                var returnRGBArray = !!out2;
                !isNormalized && (value = this._normalizeData(value));
                out2 = fastLerp(value, thisOption.parsedVisual, out2);
                return returnRGBArray ? out2 : stringify(out2, "rgba");
              }, this);
            },
            _normalizedToVisual: {
              linear: function(normalized) {
                return stringify(fastLerp(normalized, this.option.parsedVisual), "rgba");
              },
              category: doMapCategory,
              piecewise: function(normalized, value) {
                var result = getSpecifiedVisual.call(this, value);
                if (result == null) {
                  result = stringify(fastLerp(normalized, this.option.parsedVisual), "rgba");
                }
                return result;
              },
              fixed: doMapFixed
            }
          },
          colorHue: makePartialColorVisualHandler(function(color2, value) {
            return modifyHSL(color2, value);
          }),
          colorSaturation: makePartialColorVisualHandler(function(color2, value) {
            return modifyHSL(color2, null, value);
          }),
          colorLightness: makePartialColorVisualHandler(function(color2, value) {
            return modifyHSL(color2, null, null, value);
          }),
          colorAlpha: makePartialColorVisualHandler(function(color2, value) {
            return modifyAlpha(color2, value);
          }),
          decal: {
            applyVisual: makeApplyVisual("decal"),
            _normalizedToVisual: {
              linear: null,
              category: doMapCategory,
              piecewise: null,
              fixed: null
            }
          },
          opacity: {
            applyVisual: makeApplyVisual("opacity"),
            _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
          },
          liftZ: {
            applyVisual: makeApplyVisual("liftZ"),
            _normalizedToVisual: {
              linear: doMapFixed,
              category: doMapFixed,
              piecewise: doMapFixed,
              fixed: doMapFixed
            }
          },
          symbol: {
            applyVisual: function(value, getter, setter) {
              var symbolCfg = this.mapValueToVisual(value);
              setter("symbol", symbolCfg);
            },
            _normalizedToVisual: {
              linear: doMapToArray,
              category: doMapCategory,
              piecewise: function(normalized, value) {
                var result = getSpecifiedVisual.call(this, value);
                if (result == null) {
                  result = doMapToArray.call(this, normalized);
                }
                return result;
              },
              fixed: doMapFixed
            }
          },
          symbolSize: {
            applyVisual: makeApplyVisual("symbolSize"),
            _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
          }
        };
        return VisualMapping2;
      }()
    );
    function preprocessForPiecewise(thisOption) {
      var pieceList = thisOption.pieceList;
      thisOption.hasSpecialVisual = false;
      each$f(pieceList, function(piece, index) {
        piece.originIndex = index;
        if (piece.visual != null) {
          thisOption.hasSpecialVisual = true;
        }
      });
    }
    function preprocessForSpecifiedCategory(thisOption) {
      var categories = thisOption.categories;
      var categoryMap = thisOption.categoryMap = {};
      var visual = thisOption.visual;
      each$c(categories, function(cate, index) {
        categoryMap[cate] = index;
      });
      if (!isArray$2(visual)) {
        var visualArr_1 = [];
        if (isObject$5(visual)) {
          each$c(visual, function(v4, cate) {
            var index = categoryMap[cate];
            visualArr_1[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v4;
          });
        } else {
          visualArr_1[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;
        }
        visual = setVisualToOption(thisOption, visualArr_1);
      }
      for (var i2 = categories.length - 1; i2 >= 0; i2--) {
        if (visual[i2] == null) {
          delete categoryMap[categories[i2]];
          categories.pop();
        }
      }
    }
    function normalizeVisualRange(thisOption, isCategory2) {
      var visual = thisOption.visual;
      var visualArr = [];
      if (isObject$5(visual)) {
        each$c(visual, function(v4) {
          visualArr.push(v4);
        });
      } else if (visual != null) {
        visualArr.push(visual);
      }
      var doNotNeedPair = {
        color: 1,
        symbol: 1
      };
      if (!isCategory2 && visualArr.length === 1 && !doNotNeedPair.hasOwnProperty(thisOption.type)) {
        visualArr[1] = visualArr[0];
      }
      setVisualToOption(thisOption, visualArr);
    }
    function makePartialColorVisualHandler(applyValue) {
      return {
        applyVisual: function(value, getter, setter) {
          var colorChannel = this.mapValueToVisual(value);
          setter("color", applyValue(getter("color"), colorChannel));
        },
        _normalizedToVisual: createNormalizedToNumericVisual([0, 1])
      };
    }
    function doMapToArray(normalized) {
      var visual = this.option.visual;
      return visual[Math.round(linearMap$2(normalized, [0, 1], [0, visual.length - 1], true))] || {};
    }
    function makeApplyVisual(visualType) {
      return function(value, getter, setter) {
        setter(visualType, this.mapValueToVisual(value));
      };
    }
    function doMapCategory(normalized) {
      var visual = this.option.visual;
      return visual[this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX ? normalized % visual.length : normalized];
    }
    function doMapFixed() {
      return this.option.visual[0];
    }
    function createNormalizedToNumericVisual(sourceExtent) {
      return {
        linear: function(normalized) {
          return linearMap$2(normalized, sourceExtent, this.option.visual, true);
        },
        category: doMapCategory,
        piecewise: function(normalized, value) {
          var result = getSpecifiedVisual.call(this, value);
          if (result == null) {
            result = linearMap$2(normalized, sourceExtent, this.option.visual, true);
          }
          return result;
        },
        fixed: doMapFixed
      };
    }
    function getSpecifiedVisual(value) {
      var thisOption = this.option;
      var pieceList = thisOption.pieceList;
      if (thisOption.hasSpecialVisual) {
        var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);
        var piece = pieceList[pieceIndex];
        if (piece && piece.visual) {
          return piece.visual[this.type];
        }
      }
    }
    function setVisualToOption(thisOption, visualArr) {
      thisOption.visual = visualArr;
      if (thisOption.type === "color") {
        thisOption.parsedVisual = map$1(visualArr, function(item) {
          var color2 = parse$1(item);
          return color2 || [0, 0, 0, 1];
        });
      }
      return visualArr;
    }
    var normalizers = {
      linear: function(value) {
        return linearMap$2(value, this.option.dataExtent, [0, 1], true);
      },
      piecewise: function(value) {
        var pieceList = this.option.pieceList;
        var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true);
        if (pieceIndex != null) {
          return linearMap$2(pieceIndex, [0, pieceList.length - 1], [0, 1], true);
        }
      },
      category: function(value) {
        var index = this.option.categories ? this.option.categoryMap[value] : value;
        return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;
      },
      fixed: noop$1
    };
    function littleThan(close2, a2, b2) {
      return close2 ? a2 <= b2 : a2 < b2;
    }
    var ITEM_STYLE_NORMAL = "itemStyle";
    var inner$c = makeInner();
    const treemapVisual = {
      seriesType: "treemap",
      reset: function(seriesModel) {
        var tree = seriesModel.getData().tree;
        var root2 = tree.root;
        if (root2.isRemoved()) {
          return;
        }
        travelTree(
          root2,
          // Visual should calculate from tree root but not view root.
          {},
          seriesModel.getViewRoot().getAncestors(),
          seriesModel
        );
      }
    };
    function travelTree(node, designatedVisual, viewRootAncestors, seriesModel) {
      var nodeModel = node.getModel();
      var nodeLayout = node.getLayout();
      var data = node.hostTree.data;
      if (!nodeLayout || nodeLayout.invisible || !nodeLayout.isInView) {
        return;
      }
      var nodeItemStyleModel = nodeModel.getModel(ITEM_STYLE_NORMAL);
      var visuals = buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel);
      var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style");
      var borderColor = nodeItemStyleModel.get("borderColor");
      var borderColorSaturation = nodeItemStyleModel.get("borderColorSaturation");
      var thisNodeColor;
      if (borderColorSaturation != null) {
        thisNodeColor = calculateColor(visuals);
        borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);
      }
      existsStyle.stroke = borderColor;
      var viewChildren = node.viewChildren;
      if (!viewChildren || !viewChildren.length) {
        thisNodeColor = calculateColor(visuals);
        existsStyle.fill = thisNodeColor;
      } else {
        var mapping_1 = buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren);
        each$f(viewChildren, function(child, index) {
          if (child.depth >= viewRootAncestors.length || child === viewRootAncestors[child.depth]) {
            var childVisual = mapVisual$1(nodeModel, visuals, child, index, mapping_1, seriesModel);
            travelTree(child, childVisual, viewRootAncestors, seriesModel);
          }
        });
      }
    }
    function buildVisuals(nodeItemStyleModel, designatedVisual, seriesModel) {
      var visuals = extend$1({}, designatedVisual);
      var designatedVisualItemStyle = seriesModel.designatedVisualItemStyle;
      each$f(["color", "colorAlpha", "colorSaturation"], function(visualName) {
        designatedVisualItemStyle[visualName] = designatedVisual[visualName];
        var val = nodeItemStyleModel.get(visualName);
        designatedVisualItemStyle[visualName] = null;
        val != null && (visuals[visualName] = val);
      });
      return visuals;
    }
    function calculateColor(visuals) {
      var color2 = getValueVisualDefine(visuals, "color");
      if (color2) {
        var colorAlpha = getValueVisualDefine(visuals, "colorAlpha");
        var colorSaturation = getValueVisualDefine(visuals, "colorSaturation");
        if (colorSaturation) {
          color2 = modifyHSL(color2, null, null, colorSaturation);
        }
        if (colorAlpha) {
          color2 = modifyAlpha(color2, colorAlpha);
        }
        return color2;
      }
    }
    function calculateBorderColor(borderColorSaturation, thisNodeColor) {
      return thisNodeColor != null ? modifyHSL(thisNodeColor, null, null, borderColorSaturation) : null;
    }
    function getValueVisualDefine(visuals, name) {
      var value = visuals[name];
      if (value != null && value !== "none") {
        return value;
      }
    }
    function buildVisualMapping(node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren) {
      if (!viewChildren || !viewChildren.length) {
        return;
      }
      var rangeVisual = getRangeVisual(nodeModel, "color") || visuals.color != null && visuals.color !== "none" && (getRangeVisual(nodeModel, "colorAlpha") || getRangeVisual(nodeModel, "colorSaturation"));
      if (!rangeVisual) {
        return;
      }
      var visualMin = nodeModel.get("visualMin");
      var visualMax = nodeModel.get("visualMax");
      var dataExtent = nodeLayout.dataExtent.slice();
      visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin);
      visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax);
      var colorMappingBy = nodeModel.get("colorMappingBy");
      var opt = {
        type: rangeVisual.name,
        dataExtent,
        visual: rangeVisual.range
      };
      if (opt.type === "color" && (colorMappingBy === "index" || colorMappingBy === "id")) {
        opt.mappingMethod = "category";
        opt.loop = true;
      } else {
        opt.mappingMethod = "linear";
      }
      var mapping = new VisualMapping(opt);
      inner$c(mapping).drColorMappingBy = colorMappingBy;
      return mapping;
    }
    function getRangeVisual(nodeModel, name) {
      var range2 = nodeModel.get(name);
      return isArray$2(range2) && range2.length ? {
        name,
        range: range2
      } : null;
    }
    function mapVisual$1(nodeModel, visuals, child, index, mapping, seriesModel) {
      var childVisuals = extend$1({}, visuals);
      if (mapping) {
        var mappingType = mapping.type;
        var colorMappingBy = mappingType === "color" && inner$c(mapping).drColorMappingBy;
        var value = colorMappingBy === "index" ? index : colorMappingBy === "id" ? seriesModel.mapIdToIndex(child.getId()) : child.getValue(nodeModel.get("visualDimension"));
        childVisuals[mappingType] = mapping.mapValueToVisual(value);
      }
      return childVisuals;
    }
    var mathMax$3 = Math.max;
    var mathMin$3 = Math.min;
    var retrieveValue = retrieve;
    var each$b = each$f;
    var PATH_BORDER_WIDTH = ["itemStyle", "borderWidth"];
    var PATH_GAP_WIDTH = ["itemStyle", "gapWidth"];
    var PATH_UPPER_LABEL_SHOW = ["upperLabel", "show"];
    var PATH_UPPER_LABEL_HEIGHT = ["upperLabel", "height"];
    const treemapLayout = {
      seriesType: "treemap",
      reset: function(seriesModel, ecModel, api2, payload) {
        var ecWidth = api2.getWidth();
        var ecHeight = api2.getHeight();
        var seriesOption = seriesModel.option;
        var layoutInfo = getLayoutRect(seriesModel.getBoxLayoutParams(), {
          width: api2.getWidth(),
          height: api2.getHeight()
        });
        var size = seriesOption.size || [];
        var containerWidth = parsePercent(retrieveValue(layoutInfo.width, size[0]), ecWidth);
        var containerHeight = parsePercent(retrieveValue(layoutInfo.height, size[1]), ecHeight);
        var payloadType = payload && payload.type;
        var types2 = ["treemapZoomToNode", "treemapRootToNode"];
        var targetInfo = retrieveTargetInfo(payload, types2, seriesModel);
        var rootRect = payloadType === "treemapRender" || payloadType === "treemapMove" ? payload.rootRect : null;
        var viewRoot = seriesModel.getViewRoot();
        var viewAbovePath = getPathToRoot(viewRoot);
        if (payloadType !== "treemapMove") {
          var rootSize = payloadType === "treemapZoomToNode" ? estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) : rootRect ? [rootRect.width, rootRect.height] : [containerWidth, containerHeight];
          var sort_1 = seriesOption.sort;
          if (sort_1 && sort_1 !== "asc" && sort_1 !== "desc") {
            sort_1 = "desc";
          }
          var options = {
            squareRatio: seriesOption.squareRatio,
            sort: sort_1,
            leafDepth: seriesOption.leafDepth
          };
          viewRoot.hostTree.clearLayouts();
          var viewRootLayout_1 = {
            x: 0,
            y: 0,
            width: rootSize[0],
            height: rootSize[1],
            area: rootSize[0] * rootSize[1]
          };
          viewRoot.setLayout(viewRootLayout_1);
          squarify(viewRoot, options, false, 0);
          viewRootLayout_1 = viewRoot.getLayout();
          each$b(viewAbovePath, function(node, index) {
            var childValue = (viewAbovePath[index + 1] || viewRoot).getValue();
            node.setLayout(extend$1({
              dataExtent: [childValue, childValue],
              borderWidth: 0,
              upperHeight: 0
            }, viewRootLayout_1));
          });
        }
        var treeRoot = seriesModel.getData().tree.root;
        treeRoot.setLayout(calculateRootPosition(layoutInfo, rootRect, targetInfo), true);
        seriesModel.setLayoutInfo(layoutInfo);
        prunning(
          treeRoot,
          // Transform to base element coordinate system.
          new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight),
          viewAbovePath,
          viewRoot,
          0
        );
      }
    };
    function squarify(node, options, hideChildren, depth) {
      var width;
      var height;
      if (node.isRemoved()) {
        return;
      }
      var thisLayout = node.getLayout();
      width = thisLayout.width;
      height = thisLayout.height;
      var nodeModel = node.getModel();
      var borderWidth = nodeModel.get(PATH_BORDER_WIDTH);
      var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2;
      var upperLabelHeight = getUpperLabelHeight(nodeModel);
      var upperHeight = Math.max(borderWidth, upperLabelHeight);
      var layoutOffset = borderWidth - halfGapWidth;
      var layoutOffsetUpper = upperHeight - halfGapWidth;
      node.setLayout({
        borderWidth,
        upperHeight,
        upperLabelHeight
      }, true);
      width = mathMax$3(width - 2 * layoutOffset, 0);
      height = mathMax$3(height - layoutOffset - layoutOffsetUpper, 0);
      var totalArea = width * height;
      var viewChildren = initChildren$1(node, nodeModel, totalArea, options, hideChildren, depth);
      if (!viewChildren.length) {
        return;
      }
      var rect = {
        x: layoutOffset,
        y: layoutOffsetUpper,
        width,
        height
      };
      var rowFixedLength = mathMin$3(width, height);
      var best = Infinity;
      var row = [];
      row.area = 0;
      for (var i2 = 0, len2 = viewChildren.length; i2 < len2; ) {
        var child = viewChildren[i2];
        row.push(child);
        row.area += child.getLayout().area;
        var score = worst(row, rowFixedLength, options.squareRatio);
        if (score <= best) {
          i2++;
          best = score;
        } else {
          row.area -= row.pop().getLayout().area;
          position$1(row, rowFixedLength, rect, halfGapWidth, false);
          rowFixedLength = mathMin$3(rect.width, rect.height);
          row.length = row.area = 0;
          best = Infinity;
        }
      }
      if (row.length) {
        position$1(row, rowFixedLength, rect, halfGapWidth, true);
      }
      if (!hideChildren) {
        var childrenVisibleMin = nodeModel.get("childrenVisibleMin");
        if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {
          hideChildren = true;
        }
      }
      for (var i2 = 0, len2 = viewChildren.length; i2 < len2; i2++) {
        squarify(viewChildren[i2], options, hideChildren, depth + 1);
      }
    }
    function initChildren$1(node, nodeModel, totalArea, options, hideChildren, depth) {
      var viewChildren = node.children || [];
      var orderBy2 = options.sort;
      orderBy2 !== "asc" && orderBy2 !== "desc" && (orderBy2 = null);
      var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;
      if (hideChildren && !overLeafDepth) {
        return node.viewChildren = [];
      }
      viewChildren = filter(viewChildren, function(child) {
        return !child.isRemoved();
      });
      sort$1(viewChildren, orderBy2);
      var info = statistic(nodeModel, viewChildren, orderBy2);
      if (info.sum === 0) {
        return node.viewChildren = [];
      }
      info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy2, viewChildren);
      if (info.sum === 0) {
        return node.viewChildren = [];
      }
      for (var i2 = 0, len2 = viewChildren.length; i2 < len2; i2++) {
        var area = viewChildren[i2].getValue() / info.sum * totalArea;
        viewChildren[i2].setLayout({
          area
        });
      }
      if (overLeafDepth) {
        viewChildren.length && node.setLayout({
          isLeafRoot: true
        }, true);
        viewChildren.length = 0;
      }
      node.viewChildren = viewChildren;
      node.setLayout({
        dataExtent: info.dataExtent
      }, true);
      return viewChildren;
    }
    function filterByThreshold(nodeModel, totalArea, sum2, orderBy2, orderedChildren) {
      if (!orderBy2) {
        return sum2;
      }
      var visibleMin = nodeModel.get("visibleMin");
      var len2 = orderedChildren.length;
      var deletePoint = len2;
      for (var i2 = len2 - 1; i2 >= 0; i2--) {
        var value = orderedChildren[orderBy2 === "asc" ? len2 - i2 - 1 : i2].getValue();
        if (value / sum2 * totalArea < visibleMin) {
          deletePoint = i2;
          sum2 -= value;
        }
      }
      orderBy2 === "asc" ? orderedChildren.splice(0, len2 - deletePoint) : orderedChildren.splice(deletePoint, len2 - deletePoint);
      return sum2;
    }
    function sort$1(viewChildren, orderBy2) {
      if (orderBy2) {
        viewChildren.sort(function(a2, b2) {
          var diff = orderBy2 === "asc" ? a2.getValue() - b2.getValue() : b2.getValue() - a2.getValue();
          return diff === 0 ? orderBy2 === "asc" ? a2.dataIndex - b2.dataIndex : b2.dataIndex - a2.dataIndex : diff;
        });
      }
      return viewChildren;
    }
    function statistic(nodeModel, children, orderBy2) {
      var sum2 = 0;
      for (var i2 = 0, len2 = children.length; i2 < len2; i2++) {
        sum2 += children[i2].getValue();
      }
      var dimension = nodeModel.get("visualDimension");
      var dataExtent;
      if (!children || !children.length) {
        dataExtent = [NaN, NaN];
      } else if (dimension === "value" && orderBy2) {
        dataExtent = [children[children.length - 1].getValue(), children[0].getValue()];
        orderBy2 === "asc" && dataExtent.reverse();
      } else {
        dataExtent = [Infinity, -Infinity];
        each$b(children, function(child) {
          var value = child.getValue(dimension);
          value < dataExtent[0] && (dataExtent[0] = value);
          value > dataExtent[1] && (dataExtent[1] = value);
        });
      }
      return {
        sum: sum2,
        dataExtent
      };
    }
    function worst(row, rowFixedLength, ratio) {
      var areaMax = 0;
      var areaMin = Infinity;
      for (var i2 = 0, area = void 0, len2 = row.length; i2 < len2; i2++) {
        area = row[i2].getLayout().area;
        if (area) {
          area < areaMin && (areaMin = area);
          area > areaMax && (areaMax = area);
        }
      }
      var squareArea = row.area * row.area;
      var f2 = rowFixedLength * rowFixedLength * ratio;
      return squareArea ? mathMax$3(f2 * areaMax / squareArea, squareArea / (f2 * areaMin)) : Infinity;
    }
    function position$1(row, rowFixedLength, rect, halfGapWidth, flush) {
      var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;
      var idx1WhenH = 1 - idx0WhenH;
      var xy = ["x", "y"];
      var wh = ["width", "height"];
      var last2 = rect[xy[idx0WhenH]];
      var rowOtherLength = rowFixedLength ? row.area / rowFixedLength : 0;
      if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {
        rowOtherLength = rect[wh[idx1WhenH]];
      }
      for (var i2 = 0, rowLen = row.length; i2 < rowLen; i2++) {
        var node = row[i2];
        var nodeLayout = {};
        var step = rowOtherLength ? node.getLayout().area / rowOtherLength : 0;
        var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax$3(rowOtherLength - 2 * halfGapWidth, 0);
        var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last2;
        var modWH = i2 === rowLen - 1 || remain < step ? remain : step;
        var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax$3(modWH - 2 * halfGapWidth, 0);
        nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$3(halfGapWidth, wh1 / 2);
        nodeLayout[xy[idx0WhenH]] = last2 + mathMin$3(halfGapWidth, wh0 / 2);
        last2 += modWH;
        node.setLayout(nodeLayout, true);
      }
      rect[xy[idx1WhenH]] += rowOtherLength;
      rect[wh[idx1WhenH]] -= rowOtherLength;
    }
    function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
      var currNode = (targetInfo || {}).node;
      var defaultSize = [containerWidth, containerHeight];
      if (!currNode || currNode === viewRoot) {
        return defaultSize;
      }
      var parent2;
      var viewArea = containerWidth * containerHeight;
      var area = viewArea * seriesModel.option.zoomToNodeRatio;
      while (parent2 = currNode.parentNode) {
        var sum2 = 0;
        var siblings = parent2.children;
        for (var i2 = 0, len2 = siblings.length; i2 < len2; i2++) {
          sum2 += siblings[i2].getValue();
        }
        var currNodeValue = currNode.getValue();
        if (currNodeValue === 0) {
          return defaultSize;
        }
        area *= sum2 / currNodeValue;
        var parentModel = parent2.getModel();
        var borderWidth = parentModel.get(PATH_BORDER_WIDTH);
        var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel));
        area += 4 * borderWidth * borderWidth + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5);
        area > MAX_SAFE_INTEGER && (area = MAX_SAFE_INTEGER);
        currNode = parent2;
      }
      area < viewArea && (area = viewArea);
      var scale2 = Math.pow(area / viewArea, 0.5);
      return [containerWidth * scale2, containerHeight * scale2];
    }
    function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
      if (rootRect) {
        return {
          x: rootRect.x,
          y: rootRect.y
        };
      }
      var defaultPosition = {
        x: 0,
        y: 0
      };
      if (!targetInfo) {
        return defaultPosition;
      }
      var targetNode = targetInfo.node;
      var layout2 = targetNode.getLayout();
      if (!layout2) {
        return defaultPosition;
      }
      var targetCenter = [layout2.width / 2, layout2.height / 2];
      var node = targetNode;
      while (node) {
        var nodeLayout = node.getLayout();
        targetCenter[0] += nodeLayout.x;
        targetCenter[1] += nodeLayout.y;
        node = node.parentNode;
      }
      return {
        x: layoutInfo.width / 2 - targetCenter[0],
        y: layoutInfo.height / 2 - targetCenter[1]
      };
    }
    function prunning(node, clipRect, viewAbovePath, viewRoot, depth) {
      var nodeLayout = node.getLayout();
      var nodeInViewAbovePath = viewAbovePath[depth];
      var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node;
      if (nodeInViewAbovePath && !isAboveViewRoot || depth === viewAbovePath.length && node !== viewRoot) {
        return;
      }
      node.setLayout({
        // isInView means: viewRoot sub tree + viewAbovePath
        isInView: true,
        // invisible only means: outside view clip so that the node can not
        // see but still layout for animation preparation but not render.
        invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout),
        isAboveViewRoot
      }, true);
      var childClipRect = new BoundingRect(clipRect.x - nodeLayout.x, clipRect.y - nodeLayout.y, clipRect.width, clipRect.height);
      each$b(node.viewChildren || [], function(child) {
        prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1);
      });
    }
    function getUpperLabelHeight(model) {
      return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0;
    }
    function install$G(registers) {
      registers.registerSeriesModel(TreemapSeriesModel);
      registers.registerChartView(TreemapView);
      registers.registerVisual(treemapVisual);
      registers.registerLayout(treemapLayout);
      installTreemapAction(registers);
    }
    function categoryFilter(ecModel) {
      var legendModels = ecModel.findComponents({
        mainType: "legend"
      });
      if (!legendModels || !legendModels.length) {
        return;
      }
      ecModel.eachSeriesByType("graph", function(graphSeries) {
        var categoriesData = graphSeries.getCategoriesData();
        var graph = graphSeries.getGraph();
        var data = graph.data;
        var categoryNames = categoriesData.mapArray(categoriesData.getName);
        data.filterSelf(function(idx) {
          var model = data.getItemModel(idx);
          var category = model.getShallow("category");
          if (category != null) {
            if (isNumber$1(category)) {
              category = categoryNames[category];
            }
            for (var i2 = 0; i2 < legendModels.length; i2++) {
              if (!legendModels[i2].isSelected(category)) {
                return false;
              }
            }
          }
          return true;
        });
      });
    }
    function categoryVisual(ecModel) {
      var paletteScope = {};
      ecModel.eachSeriesByType("graph", function(seriesModel) {
        var categoriesData = seriesModel.getCategoriesData();
        var data = seriesModel.getData();
        var categoryNameIdxMap = {};
        categoriesData.each(function(idx) {
          var name = categoriesData.getName(idx);
          categoryNameIdxMap["ec-" + name] = idx;
          var itemModel = categoriesData.getItemModel(idx);
          var style = itemModel.getModel("itemStyle").getItemStyle();
          if (!style.fill) {
            style.fill = seriesModel.getColorFromPalette(name, paletteScope);
          }
          categoriesData.setItemVisual(idx, "style", style);
          var symbolVisualList = ["symbol", "symbolSize", "symbolKeepAspect"];
          for (var i2 = 0; i2 < symbolVisualList.length; i2++) {
            var symbolVisual = itemModel.getShallow(symbolVisualList[i2], true);
            if (symbolVisual != null) {
              categoriesData.setItemVisual(idx, symbolVisualList[i2], symbolVisual);
            }
          }
        });
        if (categoriesData.count()) {
          data.each(function(idx) {
            var model = data.getItemModel(idx);
            var categoryIdx = model.getShallow("category");
            if (categoryIdx != null) {
              if (isString$1(categoryIdx)) {
                categoryIdx = categoryNameIdxMap["ec-" + categoryIdx];
              }
              var categoryStyle = categoriesData.getItemVisual(categoryIdx, "style");
              var style = data.ensureUniqueItemVisual(idx, "style");
              extend$1(style, categoryStyle);
              var visualList = ["symbol", "symbolSize", "symbolKeepAspect"];
              for (var i2 = 0; i2 < visualList.length; i2++) {
                data.setItemVisual(idx, visualList[i2], categoriesData.getItemVisual(categoryIdx, visualList[i2]));
              }
            }
          });
        }
      });
    }
    function normalize$1(a2) {
      if (!(a2 instanceof Array)) {
        a2 = [a2, a2];
      }
      return a2;
    }
    function graphEdgeVisual(ecModel) {
      ecModel.eachSeriesByType("graph", function(seriesModel) {
        var graph = seriesModel.getGraph();
        var edgeData = seriesModel.getEdgeData();
        var symbolType = normalize$1(seriesModel.get("edgeSymbol"));
        var symbolSize = normalize$1(seriesModel.get("edgeSymbolSize"));
        edgeData.setVisual("fromSymbol", symbolType && symbolType[0]);
        edgeData.setVisual("toSymbol", symbolType && symbolType[1]);
        edgeData.setVisual("fromSymbolSize", symbolSize && symbolSize[0]);
        edgeData.setVisual("toSymbolSize", symbolSize && symbolSize[1]);
        edgeData.setVisual("style", seriesModel.getModel("lineStyle").getLineStyle());
        edgeData.each(function(idx) {
          var itemModel = edgeData.getItemModel(idx);
          var edge = graph.getEdgeByIndex(idx);
          var symbolType2 = normalize$1(itemModel.getShallow("symbol", true));
          var symbolSize2 = normalize$1(itemModel.getShallow("symbolSize", true));
          var style = itemModel.getModel("lineStyle").getLineStyle();
          var existsStyle = edgeData.ensureUniqueItemVisual(idx, "style");
          extend$1(existsStyle, style);
          switch (existsStyle.stroke) {
            case "source": {
              var nodeStyle = edge.node1.getVisual("style");
              existsStyle.stroke = nodeStyle && nodeStyle.fill;
              break;
            }
            case "target": {
              var nodeStyle = edge.node2.getVisual("style");
              existsStyle.stroke = nodeStyle && nodeStyle.fill;
              break;
            }
          }
          symbolType2[0] && edge.setVisual("fromSymbol", symbolType2[0]);
          symbolType2[1] && edge.setVisual("toSymbol", symbolType2[1]);
          symbolSize2[0] && edge.setVisual("fromSymbolSize", symbolSize2[0]);
          symbolSize2[1] && edge.setVisual("toSymbolSize", symbolSize2[1]);
        });
      });
    }
    var KEY_DELIMITER = "-->";
    var getAutoCurvenessParams = function(seriesModel) {
      return seriesModel.get("autoCurveness") || null;
    };
    var createCurveness = function(seriesModel, appendLength) {
      var autoCurvenessParmas = getAutoCurvenessParams(seriesModel);
      var length = 20;
      var curvenessList = [];
      if (isNumber$1(autoCurvenessParmas)) {
        length = autoCurvenessParmas;
      } else if (isArray$2(autoCurvenessParmas)) {
        seriesModel.__curvenessList = autoCurvenessParmas;
        return;
      }
      if (appendLength > length) {
        length = appendLength;
      }
      var len2 = length % 2 ? length + 2 : length + 3;
      curvenessList = [];
      for (var i2 = 0; i2 < len2; i2++) {
        curvenessList.push((i2 % 2 ? i2 + 1 : i2) / 10 * (i2 % 2 ? -1 : 1));
      }
      seriesModel.__curvenessList = curvenessList;
    };
    var getKeyOfEdges = function(n1, n2, seriesModel) {
      var source = [n1.id, n1.dataIndex].join(".");
      var target = [n2.id, n2.dataIndex].join(".");
      return [seriesModel.uid, source, target].join(KEY_DELIMITER);
    };
    var getOppositeKey = function(key) {
      var keys2 = key.split(KEY_DELIMITER);
      return [keys2[0], keys2[2], keys2[1]].join(KEY_DELIMITER);
    };
    var getEdgeFromMap = function(edge, seriesModel) {
      var key = getKeyOfEdges(edge.node1, edge.node2, seriesModel);
      return seriesModel.__edgeMap[key];
    };
    var getTotalLengthBetweenNodes = function(edge, seriesModel) {
      var len2 = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node1, edge.node2, seriesModel), seriesModel);
      var lenV = getEdgeMapLengthWithKey(getKeyOfEdges(edge.node2, edge.node1, seriesModel), seriesModel);
      return len2 + lenV;
    };
    var getEdgeMapLengthWithKey = function(key, seriesModel) {
      var edgeMap = seriesModel.__edgeMap;
      return edgeMap[key] ? edgeMap[key].length : 0;
    };
    function initCurvenessList(seriesModel) {
      if (!getAutoCurvenessParams(seriesModel)) {
        return;
      }
      seriesModel.__curvenessList = [];
      seriesModel.__edgeMap = {};
      createCurveness(seriesModel);
    }
    function createEdgeMapForCurveness(n1, n2, seriesModel, index) {
      if (!getAutoCurvenessParams(seriesModel)) {
        return;
      }
      var key = getKeyOfEdges(n1, n2, seriesModel);
      var edgeMap = seriesModel.__edgeMap;
      var oppositeEdges = edgeMap[getOppositeKey(key)];
      if (edgeMap[key] && !oppositeEdges) {
        edgeMap[key].isForward = true;
      } else if (oppositeEdges && edgeMap[key]) {
        oppositeEdges.isForward = true;
        edgeMap[key].isForward = false;
      }
      edgeMap[key] = edgeMap[key] || [];
      edgeMap[key].push(index);
    }
    function getCurvenessForEdge(edge, seriesModel, index, needReverse) {
      var autoCurvenessParams = getAutoCurvenessParams(seriesModel);
      var isArrayParam = isArray$2(autoCurvenessParams);
      if (!autoCurvenessParams) {
        return null;
      }
      var edgeArray = getEdgeFromMap(edge, seriesModel);
      if (!edgeArray) {
        return null;
      }
      var edgeIndex = -1;
      for (var i2 = 0; i2 < edgeArray.length; i2++) {
        if (edgeArray[i2] === index) {
          edgeIndex = i2;
          break;
        }
      }
      var totalLen = getTotalLengthBetweenNodes(edge, seriesModel);
      createCurveness(seriesModel, totalLen);
      edge.lineStyle = edge.lineStyle || {};
      var curKey = getKeyOfEdges(edge.node1, edge.node2, seriesModel);
      var curvenessList = seriesModel.__curvenessList;
      var parityCorrection = isArrayParam ? 0 : totalLen % 2 ? 0 : 1;
      if (!edgeArray.isForward) {
        var oppositeKey = getOppositeKey(curKey);
        var len2 = getEdgeMapLengthWithKey(oppositeKey, seriesModel);
        var resValue = curvenessList[edgeIndex + len2 + parityCorrection];
        if (needReverse) {
          if (isArrayParam) {
            if (autoCurvenessParams && autoCurvenessParams[0] === 0) {
              return (len2 + parityCorrection) % 2 ? resValue : -resValue;
            } else {
              return ((len2 % 2 ? 0 : 1) + parityCorrection) % 2 ? resValue : -resValue;
            }
          } else {
            return (len2 + parityCorrection) % 2 ? resValue : -resValue;
          }
        } else {
          return curvenessList[edgeIndex + len2 + parityCorrection];
        }
      } else {
        return curvenessList[parityCorrection + edgeIndex];
      }
    }
    function simpleLayout(seriesModel) {
      var coordSys = seriesModel.coordinateSystem;
      if (coordSys && coordSys.type !== "view") {
        return;
      }
      var graph = seriesModel.getGraph();
      graph.eachNode(function(node) {
        var model = node.getModel();
        node.setLayout([+model.get("x"), +model.get("y")]);
      });
      simpleLayoutEdge(graph, seriesModel);
    }
    function simpleLayoutEdge(graph, seriesModel) {
      graph.eachEdge(function(edge, index) {
        var curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), -getCurvenessForEdge(edge, seriesModel, index, true), 0);
        var p1 = clone$3(edge.node1.getLayout());
        var p2 = clone$3(edge.node2.getLayout());
        var points2 = [p1, p2];
        if (+curveness) {
          points2.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);
        }
        edge.setLayout(points2);
      });
    }
    function graphSimpleLayout(ecModel, api2) {
      ecModel.eachSeriesByType("graph", function(seriesModel) {
        var layout2 = seriesModel.get("layout");
        var coordSys = seriesModel.coordinateSystem;
        if (coordSys && coordSys.type !== "view") {
          var data_1 = seriesModel.getData();
          var dimensions_1 = [];
          each$f(coordSys.dimensions, function(coordDim) {
            dimensions_1 = dimensions_1.concat(data_1.mapDimensionsAll(coordDim));
          });
          for (var dataIndex = 0; dataIndex < data_1.count(); dataIndex++) {
            var value = [];
            var hasValue = false;
            for (var i2 = 0; i2 < dimensions_1.length; i2++) {
              var val = data_1.get(dimensions_1[i2], dataIndex);
              if (!isNaN(val)) {
                hasValue = true;
              }
              value.push(val);
            }
            if (hasValue) {
              data_1.setItemLayout(dataIndex, coordSys.dataToPoint(value));
            } else {
              data_1.setItemLayout(dataIndex, [NaN, NaN]);
            }
          }
          simpleLayoutEdge(data_1.graph, seriesModel);
        } else if (!layout2 || layout2 === "none") {
          simpleLayout(seriesModel);
        }
      });
    }
    function getNodeGlobalScale(seriesModel) {
      var coordSys = seriesModel.coordinateSystem;
      if (coordSys.type !== "view") {
        return 1;
      }
      var nodeScaleRatio = seriesModel.option.nodeScaleRatio;
      var groupZoom = coordSys.scaleX;
      var roamZoom = coordSys.getZoom();
      var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1;
      return nodeScale / groupZoom;
    }
    function getSymbolSize(node) {
      var symbolSize = node.getVisual("symbolSize");
      if (symbolSize instanceof Array) {
        symbolSize = (symbolSize[0] + symbolSize[1]) / 2;
      }
      return +symbolSize;
    }
    var PI$2 = Math.PI;
    var _symbolRadiansHalf = [];
    function circularLayout(seriesModel, basedOn, draggingNode, pointer) {
      var coordSys = seriesModel.coordinateSystem;
      if (coordSys && coordSys.type !== "view") {
        return;
      }
      var rect = coordSys.getBoundingRect();
      var nodeData = seriesModel.getData();
      var graph = nodeData.graph;
      var cx = rect.width / 2 + rect.x;
      var cy = rect.height / 2 + rect.y;
      var r = Math.min(rect.width, rect.height) / 2;
      var count2 = nodeData.count();
      nodeData.setLayout({
        cx,
        cy
      });
      if (!count2) {
        return;
      }
      if (draggingNode) {
        var _a2 = coordSys.pointToData(pointer), tempX = _a2[0], tempY = _a2[1];
        var v4 = [tempX - cx, tempY - cy];
        normalize$3(v4, v4);
        scale$2(v4, v4, r);
        draggingNode.setLayout([cx + v4[0], cy + v4[1]], true);
        var circularRotateLabel = seriesModel.get(["circular", "rotateLabel"]);
        rotateNodeLabel(draggingNode, circularRotateLabel, cx, cy);
      }
      _layoutNodesBasedOn[basedOn](seriesModel, graph, nodeData, r, cx, cy, count2);
      graph.eachEdge(function(edge, index) {
        var curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), getCurvenessForEdge(edge, seriesModel, index), 0);
        var p1 = clone$3(edge.node1.getLayout());
        var p2 = clone$3(edge.node2.getLayout());
        var cp1;
        var x12 = (p1[0] + p2[0]) / 2;
        var y12 = (p1[1] + p2[1]) / 2;
        if (+curveness) {
          curveness *= 3;
          cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];
        }
        edge.setLayout([p1, p2, cp1]);
      });
    }
    var _layoutNodesBasedOn = {
      value: function(seriesModel, graph, nodeData, r, cx, cy, count2) {
        var angle2 = 0;
        var sum2 = nodeData.getSum("value");
        var unitAngle = Math.PI * 2 / (sum2 || count2);
        graph.eachNode(function(node) {
          var value = node.getValue("value");
          var radianHalf = unitAngle * (sum2 ? value : 1) / 2;
          angle2 += radianHalf;
          node.setLayout([r * Math.cos(angle2) + cx, r * Math.sin(angle2) + cy]);
          angle2 += radianHalf;
        });
      },
      symbolSize: function(seriesModel, graph, nodeData, r, cx, cy, count2) {
        var sumRadian = 0;
        _symbolRadiansHalf.length = count2;
        var nodeScale = getNodeGlobalScale(seriesModel);
        graph.eachNode(function(node) {
          var symbolSize = getSymbolSize(node);
          isNaN(symbolSize) && (symbolSize = 2);
          symbolSize < 0 && (symbolSize = 0);
          symbolSize *= nodeScale;
          var symbolRadianHalf = Math.asin(symbolSize / 2 / r);
          isNaN(symbolRadianHalf) && (symbolRadianHalf = PI$2 / 2);
          _symbolRadiansHalf[node.dataIndex] = symbolRadianHalf;
          sumRadian += symbolRadianHalf * 2;
        });
        var halfRemainRadian = (2 * PI$2 - sumRadian) / count2 / 2;
        var angle2 = 0;
        graph.eachNode(function(node) {
          var radianHalf = halfRemainRadian + _symbolRadiansHalf[node.dataIndex];
          angle2 += radianHalf;
          (!node.getLayout() || !node.getLayout().fixed) && node.setLayout([r * Math.cos(angle2) + cx, r * Math.sin(angle2) + cy]);
          angle2 += radianHalf;
        });
      }
    };
    function rotateNodeLabel(node, circularRotateLabel, cx, cy) {
      var el = node.getGraphicEl();
      if (!el) {
        return;
      }
      var nodeModel = node.getModel();
      var labelRotate = nodeModel.get(["label", "rotate"]) || 0;
      var symbolPath = el.getSymbolPath();
      if (circularRotateLabel) {
        var pos = node.getLayout();
        var rad = Math.atan2(pos[1] - cy, pos[0] - cx);
        if (rad < 0) {
          rad = Math.PI * 2 + rad;
        }
        var isLeft = pos[0] < cx;
        if (isLeft) {
          rad = rad - Math.PI;
        }
        var textPosition = isLeft ? "left" : "right";
        symbolPath.setTextConfig({
          rotation: -rad,
          position: textPosition,
          origin: "center"
        });
        var emphasisState = symbolPath.ensureState("emphasis");
        extend$1(emphasisState.textConfig || (emphasisState.textConfig = {}), {
          position: textPosition
        });
      } else {
        symbolPath.setTextConfig({
          rotation: labelRotate *= Math.PI / 180
        });
      }
    }
    function graphCircularLayout(ecModel) {
      ecModel.eachSeriesByType("graph", function(seriesModel) {
        if (seriesModel.get("layout") === "circular") {
          circularLayout(seriesModel, "symbolSize");
        }
      });
    }
    var scaleAndAdd = scaleAndAdd$1;
    function forceLayout(inNodes, inEdges, opts) {
      var nodes = inNodes;
      var edges = inEdges;
      var rect = opts.rect;
      var width = rect.width;
      var height = rect.height;
      var center2 = [rect.x + width / 2, rect.y + height / 2];
      var gravity = opts.gravity == null ? 0.1 : opts.gravity;
      for (var i2 = 0; i2 < nodes.length; i2++) {
        var n = nodes[i2];
        if (!n.p) {
          n.p = create$2(width * (Math.random() - 0.5) + center2[0], height * (Math.random() - 0.5) + center2[1]);
        }
        n.pp = clone$3(n.p);
        n.edges = null;
      }
      var initialFriction = opts.friction == null ? 0.6 : opts.friction;
      var friction = initialFriction;
      var beforeStepCallback;
      var afterStepCallback;
      return {
        warmUp: function() {
          friction = initialFriction * 0.8;
        },
        setFixed: function(idx) {
          nodes[idx].fixed = true;
        },
        setUnfixed: function(idx) {
          nodes[idx].fixed = false;
        },
        /**
         * Before step hook
         */
        beforeStep: function(cb) {
          beforeStepCallback = cb;
        },
        /**
         * After step hook
         */
        afterStep: function(cb) {
          afterStepCallback = cb;
        },
        /**
         * Some formulas were originally copied from "d3.js"
         * https://github.com/d3/d3/blob/b516d77fb8566b576088e73410437494717ada26/src/layout/force.js
         * with some modifications made for this project.
         * See the license statement at the head of this file.
         */
        step: function(cb) {
          beforeStepCallback && beforeStepCallback(nodes, edges);
          var v12 = [];
          var nLen = nodes.length;
          for (var i3 = 0; i3 < edges.length; i3++) {
            var e2 = edges[i3];
            if (e2.ignoreForceLayout) {
              continue;
            }
            var n1 = e2.n1;
            var n2 = e2.n2;
            sub(v12, n2.p, n1.p);
            var d2 = len(v12) - e2.d;
            var w2 = n2.w / (n1.w + n2.w);
            if (isNaN(w2)) {
              w2 = 0;
            }
            normalize$3(v12, v12);
            !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w2 * d2 * friction);
            !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w2) * d2 * friction);
          }
          for (var i3 = 0; i3 < nLen; i3++) {
            var n3 = nodes[i3];
            if (!n3.fixed) {
              sub(v12, center2, n3.p);
              scaleAndAdd(n3.p, n3.p, v12, gravity * friction);
            }
          }
          for (var i3 = 0; i3 < nLen; i3++) {
            var n1 = nodes[i3];
            for (var j = i3 + 1; j < nLen; j++) {
              var n2 = nodes[j];
              sub(v12, n2.p, n1.p);
              var d2 = len(v12);
              if (d2 === 0) {
                set$1(v12, Math.random() - 0.5, Math.random() - 0.5);
                d2 = 1;
              }
              var repFact = (n1.rep + n2.rep) / d2 / d2;
              !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);
              !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);
            }
          }
          var v4 = [];
          for (var i3 = 0; i3 < nLen; i3++) {
            var n3 = nodes[i3];
            if (!n3.fixed) {
              sub(v4, n3.p, n3.pp);
              scaleAndAdd(n3.p, n3.p, v4, friction);
              copy$1(n3.pp, n3.p);
            }
          }
          friction = friction * 0.992;
          var finished = friction < 0.01;
          afterStepCallback && afterStepCallback(nodes, edges, finished);
          cb && cb(finished);
        }
      };
    }
    function graphForceLayout(ecModel) {
      ecModel.eachSeriesByType("graph", function(graphSeries) {
        var coordSys = graphSeries.coordinateSystem;
        if (coordSys && coordSys.type !== "view") {
          return;
        }
        if (graphSeries.get("layout") === "force") {
          var preservedPoints_1 = graphSeries.preservedPoints || {};
          var graph_1 = graphSeries.getGraph();
          var nodeData_1 = graph_1.data;
          var edgeData = graph_1.edgeData;
          var forceModel = graphSeries.getModel("force");
          var initLayout = forceModel.get("initLayout");
          if (graphSeries.preservedPoints) {
            nodeData_1.each(function(idx) {
              var id = nodeData_1.getId(idx);
              nodeData_1.setItemLayout(idx, preservedPoints_1[id] || [NaN, NaN]);
            });
          } else if (!initLayout || initLayout === "none") {
            simpleLayout(graphSeries);
          } else if (initLayout === "circular") {
            circularLayout(graphSeries, "value");
          }
          var nodeDataExtent_1 = nodeData_1.getDataExtent("value");
          var edgeDataExtent_1 = edgeData.getDataExtent("value");
          var repulsion = forceModel.get("repulsion");
          var edgeLength = forceModel.get("edgeLength");
          var repulsionArr_1 = isArray$2(repulsion) ? repulsion : [repulsion, repulsion];
          var edgeLengthArr_1 = isArray$2(edgeLength) ? edgeLength : [edgeLength, edgeLength];
          edgeLengthArr_1 = [edgeLengthArr_1[1], edgeLengthArr_1[0]];
          var nodes_1 = nodeData_1.mapArray("value", function(value, idx) {
            var point = nodeData_1.getItemLayout(idx);
            var rep = linearMap$2(value, nodeDataExtent_1, repulsionArr_1);
            if (isNaN(rep)) {
              rep = (repulsionArr_1[0] + repulsionArr_1[1]) / 2;
            }
            return {
              w: rep,
              rep,
              fixed: nodeData_1.getItemModel(idx).get("fixed"),
              p: !point || isNaN(point[0]) || isNaN(point[1]) ? null : point
            };
          });
          var edges = edgeData.mapArray("value", function(value, idx) {
            var edge = graph_1.getEdgeByIndex(idx);
            var d2 = linearMap$2(value, edgeDataExtent_1, edgeLengthArr_1);
            if (isNaN(d2)) {
              d2 = (edgeLengthArr_1[0] + edgeLengthArr_1[1]) / 2;
            }
            var edgeModel = edge.getModel();
            var curveness = retrieve3(edge.getModel().get(["lineStyle", "curveness"]), -getCurvenessForEdge(edge, graphSeries, idx, true), 0);
            return {
              n1: nodes_1[edge.node1.dataIndex],
              n2: nodes_1[edge.node2.dataIndex],
              d: d2,
              curveness,
              ignoreForceLayout: edgeModel.get("ignoreForceLayout")
            };
          });
          var rect = coordSys.getBoundingRect();
          var forceInstance = forceLayout(nodes_1, edges, {
            rect,
            gravity: forceModel.get("gravity"),
            friction: forceModel.get("friction")
          });
          forceInstance.beforeStep(function(nodes, edges2) {
            for (var i2 = 0, l2 = nodes.length; i2 < l2; i2++) {
              if (nodes[i2].fixed) {
                copy$1(nodes[i2].p, graph_1.getNodeByIndex(i2).getLayout());
              }
            }
          });
          forceInstance.afterStep(function(nodes, edges2, stopped) {
            for (var i2 = 0, l2 = nodes.length; i2 < l2; i2++) {
              if (!nodes[i2].fixed) {
                graph_1.getNodeByIndex(i2).setLayout(nodes[i2].p);
              }
              preservedPoints_1[nodeData_1.getId(i2)] = nodes[i2].p;
            }
            for (var i2 = 0, l2 = edges2.length; i2 < l2; i2++) {
              var e2 = edges2[i2];
              var edge = graph_1.getEdgeByIndex(i2);
              var p1 = e2.n1.p;
              var p2 = e2.n2.p;
              var points2 = edge.getLayout();
              points2 = points2 ? points2.slice() : [];
              points2[0] = points2[0] || [];
              points2[1] = points2[1] || [];
              copy$1(points2[0], p1);
              copy$1(points2[1], p2);
              if (+e2.curveness) {
                points2[2] = [(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e2.curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e2.curveness];
              }
              edge.setLayout(points2);
            }
          });
          graphSeries.forceLayout = forceInstance;
          graphSeries.preservedPoints = preservedPoints_1;
          forceInstance.step();
        } else {
          graphSeries.forceLayout = null;
        }
      });
    }
    function getViewRect$3(seriesModel, api2, aspect) {
      var option = extend$1(seriesModel.getBoxLayoutParams(), {
        aspect
      });
      return getLayoutRect(option, {
        width: api2.getWidth(),
        height: api2.getHeight()
      });
    }
    function createViewCoordSys(ecModel, api2) {
      var viewList = [];
      ecModel.eachSeriesByType("graph", function(seriesModel) {
        var coordSysType = seriesModel.get("coordinateSystem");
        if (!coordSysType || coordSysType === "view") {
          var data_1 = seriesModel.getData();
          var positions = data_1.mapArray(function(idx) {
            var itemModel = data_1.getItemModel(idx);
            return [+itemModel.get("x"), +itemModel.get("y")];
          });
          var min3 = [];
          var max3 = [];
          fromPoints(positions, min3, max3);
          if (max3[0] - min3[0] === 0) {
            max3[0] += 1;
            min3[0] -= 1;
          }
          if (max3[1] - min3[1] === 0) {
            max3[1] += 1;
            min3[1] -= 1;
          }
          var aspect = (max3[0] - min3[0]) / (max3[1] - min3[1]);
          var viewRect2 = getViewRect$3(seriesModel, api2, aspect);
          if (isNaN(aspect)) {
            min3 = [viewRect2.x, viewRect2.y];
            max3 = [viewRect2.x + viewRect2.width, viewRect2.y + viewRect2.height];
          }
          var bbWidth = max3[0] - min3[0];
          var bbHeight = max3[1] - min3[1];
          var viewWidth = viewRect2.width;
          var viewHeight = viewRect2.height;
          var viewCoordSys = seriesModel.coordinateSystem = new View();
          viewCoordSys.zoomLimit = seriesModel.get("scaleLimit");
          viewCoordSys.setBoundingRect(min3[0], min3[1], bbWidth, bbHeight);
          viewCoordSys.setViewRect(viewRect2.x, viewRect2.y, viewWidth, viewHeight);
          viewCoordSys.setCenter(seriesModel.get("center"), api2);
          viewCoordSys.setZoom(seriesModel.get("zoom"));
          viewList.push(viewCoordSys);
        }
      });
      return viewList;
    }
    var straightLineProto = Line$1.prototype;
    var bezierCurveProto = BezierCurve$1.prototype;
    var StraightLineShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function StraightLineShape2() {
          this.x1 = 0;
          this.y1 = 0;
          this.x2 = 0;
          this.y2 = 0;
          this.percent = 1;
        }
        return StraightLineShape2;
      }()
    );
    (function(_super) {
      __extends$1(CurveShape, _super);
      function CurveShape() {
        return _super !== null && _super.apply(this, arguments) || this;
      }
      return CurveShape;
    })(StraightLineShape);
    function isStraightLine(shape) {
      return isNaN(+shape.cpx1) || isNaN(+shape.cpy1);
    }
    var ECLinePath = (
      /** @class */
      function(_super) {
        __extends$1(ECLinePath2, _super);
        function ECLinePath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "ec-line";
          return _this;
        }
        ECLinePath2.prototype.getDefaultStyle = function() {
          return {
            stroke: "#000",
            fill: null
          };
        };
        ECLinePath2.prototype.getDefaultShape = function() {
          return new StraightLineShape();
        };
        ECLinePath2.prototype.buildPath = function(ctx, shape) {
          if (isStraightLine(shape)) {
            straightLineProto.buildPath.call(this, ctx, shape);
          } else {
            bezierCurveProto.buildPath.call(this, ctx, shape);
          }
        };
        ECLinePath2.prototype.pointAt = function(t) {
          if (isStraightLine(this.shape)) {
            return straightLineProto.pointAt.call(this, t);
          } else {
            return bezierCurveProto.pointAt.call(this, t);
          }
        };
        ECLinePath2.prototype.tangentAt = function(t) {
          var shape = this.shape;
          var p2 = isStraightLine(shape) ? [shape.x2 - shape.x1, shape.y2 - shape.y1] : bezierCurveProto.tangentAt.call(this, t);
          return normalize$3(p2, p2);
        };
        return ECLinePath2;
      }(Path)
    );
    var SYMBOL_CATEGORIES = ["fromSymbol", "toSymbol"];
    function makeSymbolTypeKey(symbolCategory) {
      return "_" + symbolCategory + "Type";
    }
    function makeSymbolTypeValue(name, lineData, idx) {
      var symbolType = lineData.getItemVisual(idx, name);
      if (!symbolType || symbolType === "none") {
        return symbolType;
      }
      var symbolSize = lineData.getItemVisual(idx, name + "Size");
      var symbolRotate = lineData.getItemVisual(idx, name + "Rotate");
      var symbolOffset = lineData.getItemVisual(idx, name + "Offset");
      var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect");
      var symbolSizeArr = normalizeSymbolSize(symbolSize);
      var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);
      return symbolType + symbolSizeArr + symbolOffsetArr + (symbolRotate || "") + (symbolKeepAspect || "");
    }
    function createSymbol(name, lineData, idx) {
      var symbolType = lineData.getItemVisual(idx, name);
      if (!symbolType || symbolType === "none") {
        return;
      }
      var symbolSize = lineData.getItemVisual(idx, name + "Size");
      var symbolRotate = lineData.getItemVisual(idx, name + "Rotate");
      var symbolOffset = lineData.getItemVisual(idx, name + "Offset");
      var symbolKeepAspect = lineData.getItemVisual(idx, name + "KeepAspect");
      var symbolSizeArr = normalizeSymbolSize(symbolSize);
      var symbolOffsetArr = normalizeSymbolOffset(symbolOffset || 0, symbolSizeArr);
      var symbolPath = createSymbol$1(symbolType, -symbolSizeArr[0] / 2 + symbolOffsetArr[0], -symbolSizeArr[1] / 2 + symbolOffsetArr[1], symbolSizeArr[0], symbolSizeArr[1], null, symbolKeepAspect);
      symbolPath.__specifiedRotation = symbolRotate == null || isNaN(symbolRotate) ? void 0 : +symbolRotate * Math.PI / 180 || 0;
      symbolPath.name = name;
      return symbolPath;
    }
    function createLine(points2) {
      var line = new ECLinePath({
        name: "line",
        subPixelOptimize: true
      });
      setLinePoints(line.shape, points2);
      return line;
    }
    function setLinePoints(targetShape, points2) {
      targetShape.x1 = points2[0][0];
      targetShape.y1 = points2[0][1];
      targetShape.x2 = points2[1][0];
      targetShape.y2 = points2[1][1];
      targetShape.percent = 1;
      var cp1 = points2[2];
      if (cp1) {
        targetShape.cpx1 = cp1[0];
        targetShape.cpy1 = cp1[1];
      } else {
        targetShape.cpx1 = NaN;
        targetShape.cpy1 = NaN;
      }
    }
    var Line = (
      /** @class */
      function(_super) {
        __extends$1(Line2, _super);
        function Line2(lineData, idx, seriesScope) {
          var _this = _super.call(this) || this;
          _this._createLine(lineData, idx, seriesScope);
          return _this;
        }
        Line2.prototype._createLine = function(lineData, idx, seriesScope) {
          var seriesModel = lineData.hostModel;
          var linePoints = lineData.getItemLayout(idx);
          var line = createLine(linePoints);
          line.shape.percent = 0;
          initProps(line, {
            shape: {
              percent: 1
            }
          }, seriesModel, idx);
          this.add(line);
          each$f(SYMBOL_CATEGORIES, function(symbolCategory) {
            var symbol = createSymbol(symbolCategory, lineData, idx);
            this.add(symbol);
            this[makeSymbolTypeKey(symbolCategory)] = makeSymbolTypeValue(symbolCategory, lineData, idx);
          }, this);
          this._updateCommonStl(lineData, idx, seriesScope);
        };
        Line2.prototype.updateData = function(lineData, idx, seriesScope) {
          var seriesModel = lineData.hostModel;
          var line = this.childOfName("line");
          var linePoints = lineData.getItemLayout(idx);
          var target = {
            shape: {}
          };
          setLinePoints(target.shape, linePoints);
          updateProps$1(line, target, seriesModel, idx);
          each$f(SYMBOL_CATEGORIES, function(symbolCategory) {
            var symbolType = makeSymbolTypeValue(symbolCategory, lineData, idx);
            var key = makeSymbolTypeKey(symbolCategory);
            if (this[key] !== symbolType) {
              this.remove(this.childOfName(symbolCategory));
              var symbol = createSymbol(symbolCategory, lineData, idx);
              this.add(symbol);
            }
            this[key] = symbolType;
          }, this);
          this._updateCommonStl(lineData, idx, seriesScope);
        };
        Line2.prototype.getLinePath = function() {
          return this.childAt(0);
        };
        Line2.prototype._updateCommonStl = function(lineData, idx, seriesScope) {
          var seriesModel = lineData.hostModel;
          var line = this.childOfName("line");
          var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;
          var blurLineStyle = seriesScope && seriesScope.blurLineStyle;
          var selectLineStyle = seriesScope && seriesScope.selectLineStyle;
          var labelStatesModels = seriesScope && seriesScope.labelStatesModels;
          var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;
          var focus = seriesScope && seriesScope.focus;
          var blurScope = seriesScope && seriesScope.blurScope;
          if (!seriesScope || lineData.hasItemOption) {
            var itemModel = lineData.getItemModel(idx);
            var emphasisModel = itemModel.getModel("emphasis");
            emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle();
            blurLineStyle = itemModel.getModel(["blur", "lineStyle"]).getLineStyle();
            selectLineStyle = itemModel.getModel(["select", "lineStyle"]).getLineStyle();
            emphasisDisabled = emphasisModel.get("disabled");
            focus = emphasisModel.get("focus");
            blurScope = emphasisModel.get("blurScope");
            labelStatesModels = getLabelStatesModels(itemModel);
          }
          var lineStyle = lineData.getItemVisual(idx, "style");
          var visualColor = lineStyle.stroke;
          line.useStyle(lineStyle);
          line.style.fill = null;
          line.style.strokeNoScale = true;
          line.ensureState("emphasis").style = emphasisLineStyle;
          line.ensureState("blur").style = blurLineStyle;
          line.ensureState("select").style = selectLineStyle;
          each$f(SYMBOL_CATEGORIES, function(symbolCategory) {
            var symbol = this.childOfName(symbolCategory);
            if (symbol) {
              symbol.setColor(visualColor);
              symbol.style.opacity = lineStyle.opacity;
              for (var i2 = 0; i2 < SPECIAL_STATES.length; i2++) {
                var stateName = SPECIAL_STATES[i2];
                var lineState = line.getState(stateName);
                if (lineState) {
                  var lineStateStyle = lineState.style || {};
                  var state = symbol.ensureState(stateName);
                  var stateStyle = state.style || (state.style = {});
                  if (lineStateStyle.stroke != null) {
                    stateStyle[symbol.__isEmptyBrush ? "stroke" : "fill"] = lineStateStyle.stroke;
                  }
                  if (lineStateStyle.opacity != null) {
                    stateStyle.opacity = lineStateStyle.opacity;
                  }
                }
              }
              symbol.markRedraw();
            }
          }, this);
          var rawVal = seriesModel.getRawValue(idx);
          setLabelStyle(this, labelStatesModels, {
            labelDataIndex: idx,
            labelFetcher: {
              getFormattedLabel: function(dataIndex, stateName) {
                return seriesModel.getFormattedLabel(dataIndex, stateName, lineData.dataType);
              }
            },
            inheritColor: visualColor || "#000",
            defaultOpacity: lineStyle.opacity,
            defaultText: (rawVal == null ? lineData.getName(idx) : isFinite(rawVal) ? round$3(rawVal) : rawVal) + ""
          });
          var label = this.getTextContent();
          if (label) {
            var labelNormalModel = labelStatesModels.normal;
            label.__align = label.style.align;
            label.__verticalAlign = label.style.verticalAlign;
            label.__position = labelNormalModel.get("position") || "middle";
            var distance2 = labelNormalModel.get("distance");
            if (!isArray$2(distance2)) {
              distance2 = [distance2, distance2];
            }
            label.__labelDistance = distance2;
          }
          this.setTextConfig({
            position: null,
            local: true,
            inside: false
            // Can't be inside for stroke element.
          });
          toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);
        };
        Line2.prototype.highlight = function() {
          enterEmphasis(this);
        };
        Line2.prototype.downplay = function() {
          leaveEmphasis(this);
        };
        Line2.prototype.updateLayout = function(lineData, idx) {
          this.setLinePoints(lineData.getItemLayout(idx));
        };
        Line2.prototype.setLinePoints = function(points2) {
          var linePath = this.childOfName("line");
          setLinePoints(linePath.shape, points2);
          linePath.dirty();
        };
        Line2.prototype.beforeUpdate = function() {
          var lineGroup = this;
          var symbolFrom = lineGroup.childOfName("fromSymbol");
          var symbolTo = lineGroup.childOfName("toSymbol");
          var label = lineGroup.getTextContent();
          if (!symbolFrom && !symbolTo && (!label || label.ignore)) {
            return;
          }
          var invScale = 1;
          var parentNode2 = this.parent;
          while (parentNode2) {
            if (parentNode2.scaleX) {
              invScale /= parentNode2.scaleX;
            }
            parentNode2 = parentNode2.parent;
          }
          var line = lineGroup.childOfName("line");
          if (!this.__dirty && !line.__dirty) {
            return;
          }
          var percent = line.shape.percent;
          var fromPos = line.pointAt(0);
          var toPos = line.pointAt(percent);
          var d2 = sub([], toPos, fromPos);
          normalize$3(d2, d2);
          function setSymbolRotation(symbol, percent2) {
            var specifiedRotation = symbol.__specifiedRotation;
            if (specifiedRotation == null) {
              var tangent2 = line.tangentAt(percent2);
              symbol.attr("rotation", (percent2 === 1 ? -1 : 1) * Math.PI / 2 - Math.atan2(tangent2[1], tangent2[0]));
            } else {
              symbol.attr("rotation", specifiedRotation);
            }
          }
          if (symbolFrom) {
            symbolFrom.setPosition(fromPos);
            setSymbolRotation(symbolFrom, 0);
            symbolFrom.scaleX = symbolFrom.scaleY = invScale * percent;
            symbolFrom.markRedraw();
          }
          if (symbolTo) {
            symbolTo.setPosition(toPos);
            setSymbolRotation(symbolTo, 1);
            symbolTo.scaleX = symbolTo.scaleY = invScale * percent;
            symbolTo.markRedraw();
          }
          if (label && !label.ignore) {
            label.x = label.y = 0;
            label.originX = label.originY = 0;
            var textAlign2 = void 0;
            var textVerticalAlign = void 0;
            var distance2 = label.__labelDistance;
            var distanceX = distance2[0] * invScale;
            var distanceY = distance2[1] * invScale;
            var halfPercent = percent / 2;
            var tangent = line.tangentAt(halfPercent);
            var n = [tangent[1], -tangent[0]];
            var cp = line.pointAt(halfPercent);
            if (n[1] > 0) {
              n[0] = -n[0];
              n[1] = -n[1];
            }
            var dir3 = tangent[0] < 0 ? -1 : 1;
            if (label.__position !== "start" && label.__position !== "end") {
              var rotation = -Math.atan2(tangent[1], tangent[0]);
              if (toPos[0] < fromPos[0]) {
                rotation = Math.PI + rotation;
              }
              label.rotation = rotation;
            }
            var dy = void 0;
            switch (label.__position) {
              case "insideStartTop":
              case "insideMiddleTop":
              case "insideEndTop":
              case "middle":
                dy = -distanceY;
                textVerticalAlign = "bottom";
                break;
              case "insideStartBottom":
              case "insideMiddleBottom":
              case "insideEndBottom":
                dy = distanceY;
                textVerticalAlign = "top";
                break;
              default:
                dy = 0;
                textVerticalAlign = "middle";
            }
            switch (label.__position) {
              case "end":
                label.x = d2[0] * distanceX + toPos[0];
                label.y = d2[1] * distanceY + toPos[1];
                textAlign2 = d2[0] > 0.8 ? "left" : d2[0] < -0.8 ? "right" : "center";
                textVerticalAlign = d2[1] > 0.8 ? "top" : d2[1] < -0.8 ? "bottom" : "middle";
                break;
              case "start":
                label.x = -d2[0] * distanceX + fromPos[0];
                label.y = -d2[1] * distanceY + fromPos[1];
                textAlign2 = d2[0] > 0.8 ? "right" : d2[0] < -0.8 ? "left" : "center";
                textVerticalAlign = d2[1] > 0.8 ? "bottom" : d2[1] < -0.8 ? "top" : "middle";
                break;
              case "insideStartTop":
              case "insideStart":
              case "insideStartBottom":
                label.x = distanceX * dir3 + fromPos[0];
                label.y = fromPos[1] + dy;
                textAlign2 = tangent[0] < 0 ? "right" : "left";
                label.originX = -distanceX * dir3;
                label.originY = -dy;
                break;
              case "insideMiddleTop":
              case "insideMiddle":
              case "insideMiddleBottom":
              case "middle":
                label.x = cp[0];
                label.y = cp[1] + dy;
                textAlign2 = "center";
                label.originY = -dy;
                break;
              case "insideEndTop":
              case "insideEnd":
              case "insideEndBottom":
                label.x = -distanceX * dir3 + toPos[0];
                label.y = toPos[1] + dy;
                textAlign2 = tangent[0] >= 0 ? "right" : "left";
                label.originX = distanceX * dir3;
                label.originY = -dy;
                break;
            }
            label.scaleX = label.scaleY = invScale;
            label.setStyle({
              // Use the user specified text align and baseline first
              verticalAlign: label.__verticalAlign || textVerticalAlign,
              align: label.__align || textAlign2
            });
          }
        };
        return Line2;
      }(Group$3)
    );
    var LineDraw = (
      /** @class */
      function() {
        function LineDraw2(LineCtor) {
          this.group = new Group$3();
          this._LineCtor = LineCtor || Line;
        }
        LineDraw2.prototype.updateData = function(lineData) {
          var _this = this;
          this._progressiveEls = null;
          var lineDraw = this;
          var group = lineDraw.group;
          var oldLineData = lineDraw._lineData;
          lineDraw._lineData = lineData;
          if (!oldLineData) {
            group.removeAll();
          }
          var seriesScope = makeSeriesScope$1(lineData);
          lineData.diff(oldLineData).add(function(idx) {
            _this._doAdd(lineData, idx, seriesScope);
          }).update(function(newIdx, oldIdx) {
            _this._doUpdate(oldLineData, lineData, oldIdx, newIdx, seriesScope);
          }).remove(function(idx) {
            group.remove(oldLineData.getItemGraphicEl(idx));
          }).execute();
        };
        LineDraw2.prototype.updateLayout = function() {
          var lineData = this._lineData;
          if (!lineData) {
            return;
          }
          lineData.eachItemGraphicEl(function(el, idx) {
            el.updateLayout(lineData, idx);
          }, this);
        };
        LineDraw2.prototype.incrementalPrepareUpdate = function(lineData) {
          this._seriesScope = makeSeriesScope$1(lineData);
          this._lineData = null;
          this.group.removeAll();
        };
        LineDraw2.prototype.incrementalUpdate = function(taskParams, lineData) {
          this._progressiveEls = [];
          function updateIncrementalAndHover(el2) {
            if (!el2.isGroup && !isEffectObject(el2)) {
              el2.incremental = true;
              el2.ensureState("emphasis").hoverLayer = true;
            }
          }
          for (var idx = taskParams.start; idx < taskParams.end; idx++) {
            var itemLayout = lineData.getItemLayout(idx);
            if (lineNeedsDraw(itemLayout)) {
              var el = new this._LineCtor(lineData, idx, this._seriesScope);
              el.traverse(updateIncrementalAndHover);
              this.group.add(el);
              lineData.setItemGraphicEl(idx, el);
              this._progressiveEls.push(el);
            }
          }
        };
        LineDraw2.prototype.remove = function() {
          this.group.removeAll();
        };
        LineDraw2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        LineDraw2.prototype._doAdd = function(lineData, idx, seriesScope) {
          var itemLayout = lineData.getItemLayout(idx);
          if (!lineNeedsDraw(itemLayout)) {
            return;
          }
          var el = new this._LineCtor(lineData, idx, seriesScope);
          lineData.setItemGraphicEl(idx, el);
          this.group.add(el);
        };
        LineDraw2.prototype._doUpdate = function(oldLineData, newLineData, oldIdx, newIdx, seriesScope) {
          var itemEl = oldLineData.getItemGraphicEl(oldIdx);
          if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) {
            this.group.remove(itemEl);
            return;
          }
          if (!itemEl) {
            itemEl = new this._LineCtor(newLineData, newIdx, seriesScope);
          } else {
            itemEl.updateData(newLineData, newIdx, seriesScope);
          }
          newLineData.setItemGraphicEl(newIdx, itemEl);
          this.group.add(itemEl);
        };
        return LineDraw2;
      }()
    );
    function isEffectObject(el) {
      return el.animators && el.animators.length > 0;
    }
    function makeSeriesScope$1(lineData) {
      var hostModel = lineData.hostModel;
      var emphasisModel = hostModel.getModel("emphasis");
      return {
        lineStyle: hostModel.getModel("lineStyle").getLineStyle(),
        emphasisLineStyle: emphasisModel.getModel(["lineStyle"]).getLineStyle(),
        blurLineStyle: hostModel.getModel(["blur", "lineStyle"]).getLineStyle(),
        selectLineStyle: hostModel.getModel(["select", "lineStyle"]).getLineStyle(),
        emphasisDisabled: emphasisModel.get("disabled"),
        blurScope: emphasisModel.get("blurScope"),
        focus: emphasisModel.get("focus"),
        labelStatesModels: getLabelStatesModels(hostModel)
      };
    }
    function isPointNaN(pt3) {
      return isNaN(pt3[0]) || isNaN(pt3[1]);
    }
    function lineNeedsDraw(pts) {
      return pts && !isPointNaN(pts[0]) && !isPointNaN(pts[1]);
    }
    var v1 = [];
    var v2 = [];
    var v3 = [];
    var quadraticAt = quadraticAt$1;
    var v2DistSquare = distSquare;
    var mathAbs = Math.abs;
    function intersectCurveCircle(curvePoints, center2, radius) {
      var p0 = curvePoints[0];
      var p1 = curvePoints[1];
      var p2 = curvePoints[2];
      var d2 = Infinity;
      var t;
      var radiusSquare = radius * radius;
      var interval = 0.1;
      for (var _t2 = 0.1; _t2 <= 0.9; _t2 += 0.1) {
        v1[0] = quadraticAt(p0[0], p1[0], p2[0], _t2);
        v1[1] = quadraticAt(p0[1], p1[1], p2[1], _t2);
        var diff = mathAbs(v2DistSquare(v1, center2) - radiusSquare);
        if (diff < d2) {
          d2 = diff;
          t = _t2;
        }
      }
      for (var i2 = 0; i2 < 32; i2++) {
        var next = t + interval;
        v2[0] = quadraticAt(p0[0], p1[0], p2[0], t);
        v2[1] = quadraticAt(p0[1], p1[1], p2[1], t);
        v3[0] = quadraticAt(p0[0], p1[0], p2[0], next);
        v3[1] = quadraticAt(p0[1], p1[1], p2[1], next);
        var diff = v2DistSquare(v2, center2) - radiusSquare;
        if (mathAbs(diff) < 0.01) {
          break;
        }
        var nextDiff = v2DistSquare(v3, center2) - radiusSquare;
        interval /= 2;
        if (diff < 0) {
          if (nextDiff >= 0) {
            t = t + interval;
          } else {
            t = t - interval;
          }
        } else {
          if (nextDiff >= 0) {
            t = t - interval;
          } else {
            t = t + interval;
          }
        }
      }
      return t;
    }
    function adjustEdge(graph, scale2) {
      var tmp0 = [];
      var quadraticSubdivide$1 = quadraticSubdivide;
      var pts = [[], [], []];
      var pts2 = [[], []];
      var v4 = [];
      scale2 /= 2;
      graph.eachEdge(function(edge, idx) {
        var linePoints = edge.getLayout();
        var fromSymbol = edge.getVisual("fromSymbol");
        var toSymbol = edge.getVisual("toSymbol");
        if (!linePoints.__original) {
          linePoints.__original = [clone$3(linePoints[0]), clone$3(linePoints[1])];
          if (linePoints[2]) {
            linePoints.__original.push(clone$3(linePoints[2]));
          }
        }
        var originalPoints = linePoints.__original;
        if (linePoints[2] != null) {
          copy$1(pts[0], originalPoints[0]);
          copy$1(pts[1], originalPoints[2]);
          copy$1(pts[2], originalPoints[1]);
          if (fromSymbol && fromSymbol !== "none") {
            var symbolSize = getSymbolSize(edge.node1);
            var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale2);
            quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);
            pts[0][0] = tmp0[3];
            pts[1][0] = tmp0[4];
            quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);
            pts[0][1] = tmp0[3];
            pts[1][1] = tmp0[4];
          }
          if (toSymbol && toSymbol !== "none") {
            var symbolSize = getSymbolSize(edge.node2);
            var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale2);
            quadraticSubdivide$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0);
            pts[1][0] = tmp0[1];
            pts[2][0] = tmp0[2];
            quadraticSubdivide$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0);
            pts[1][1] = tmp0[1];
            pts[2][1] = tmp0[2];
          }
          copy$1(linePoints[0], pts[0]);
          copy$1(linePoints[1], pts[2]);
          copy$1(linePoints[2], pts[1]);
        } else {
          copy$1(pts2[0], originalPoints[0]);
          copy$1(pts2[1], originalPoints[1]);
          sub(v4, pts2[1], pts2[0]);
          normalize$3(v4, v4);
          if (fromSymbol && fromSymbol !== "none") {
            var symbolSize = getSymbolSize(edge.node1);
            scaleAndAdd$1(pts2[0], pts2[0], v4, symbolSize * scale2);
          }
          if (toSymbol && toSymbol !== "none") {
            var symbolSize = getSymbolSize(edge.node2);
            scaleAndAdd$1(pts2[1], pts2[1], v4, -symbolSize * scale2);
          }
          copy$1(linePoints[0], pts2[0]);
          copy$1(linePoints[1], pts2[1]);
        }
      });
    }
    function isViewCoordSys(coordSys) {
      return coordSys.type === "view";
    }
    var GraphView = (
      /** @class */
      function(_super) {
        __extends$1(GraphView2, _super);
        function GraphView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GraphView2.type;
          return _this;
        }
        GraphView2.prototype.init = function(ecModel, api2) {
          var symbolDraw = new SymbolDraw();
          var lineDraw = new LineDraw();
          var group = this.group;
          this._controller = new RoamController(api2.getZr());
          this._controllerHost = {
            target: group
          };
          group.add(symbolDraw.group);
          group.add(lineDraw.group);
          this._symbolDraw = symbolDraw;
          this._lineDraw = lineDraw;
          this._firstRender = true;
        };
        GraphView2.prototype.render = function(seriesModel, ecModel, api2) {
          var _this = this;
          var coordSys = seriesModel.coordinateSystem;
          this._model = seriesModel;
          var symbolDraw = this._symbolDraw;
          var lineDraw = this._lineDraw;
          var group = this.group;
          if (isViewCoordSys(coordSys)) {
            var groupNewProp = {
              x: coordSys.x,
              y: coordSys.y,
              scaleX: coordSys.scaleX,
              scaleY: coordSys.scaleY
            };
            if (this._firstRender) {
              group.attr(groupNewProp);
            } else {
              updateProps$1(group, groupNewProp, seriesModel);
            }
          }
          adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
          var data = seriesModel.getData();
          symbolDraw.updateData(data);
          var edgeData = seriesModel.getEdgeData();
          lineDraw.updateData(edgeData);
          this._updateNodeAndLinkScale();
          this._updateController(seriesModel, ecModel, api2);
          clearTimeout(this._layoutTimeout);
          var forceLayout2 = seriesModel.forceLayout;
          var layoutAnimation = seriesModel.get(["force", "layoutAnimation"]);
          if (forceLayout2) {
            this._startForceLayoutIteration(forceLayout2, layoutAnimation);
          }
          var layout2 = seriesModel.get("layout");
          data.graph.eachNode(function(node) {
            var idx = node.dataIndex;
            var el = node.getGraphicEl();
            var itemModel = node.getModel();
            if (!el) {
              return;
            }
            el.off("drag").off("dragend");
            var draggable2 = itemModel.get("draggable");
            if (draggable2) {
              el.on("drag", function(e2) {
                switch (layout2) {
                  case "force":
                    forceLayout2.warmUp();
                    !_this._layouting && _this._startForceLayoutIteration(forceLayout2, layoutAnimation);
                    forceLayout2.setFixed(idx);
                    data.setItemLayout(idx, [el.x, el.y]);
                    break;
                  case "circular":
                    data.setItemLayout(idx, [el.x, el.y]);
                    node.setLayout({
                      fixed: true
                    }, true);
                    circularLayout(seriesModel, "symbolSize", node, [e2.offsetX, e2.offsetY]);
                    _this.updateLayout(seriesModel);
                    break;
                  case "none":
                  default:
                    data.setItemLayout(idx, [el.x, el.y]);
                    simpleLayoutEdge(seriesModel.getGraph(), seriesModel);
                    _this.updateLayout(seriesModel);
                    break;
                }
              }).on("dragend", function() {
                if (forceLayout2) {
                  forceLayout2.setUnfixed(idx);
                }
              });
            }
            el.setDraggable(draggable2, !!itemModel.get("cursor"));
            var focus = itemModel.get(["emphasis", "focus"]);
            if (focus === "adjacency") {
              getECData(el).focus = node.getAdjacentDataIndices();
            }
          });
          data.graph.eachEdge(function(edge) {
            var el = edge.getGraphicEl();
            var focus = edge.getModel().get(["emphasis", "focus"]);
            if (!el) {
              return;
            }
            if (focus === "adjacency") {
              getECData(el).focus = {
                edge: [edge.dataIndex],
                node: [edge.node1.dataIndex, edge.node2.dataIndex]
              };
            }
          });
          var circularRotateLabel = seriesModel.get("layout") === "circular" && seriesModel.get(["circular", "rotateLabel"]);
          var cx = data.getLayout("cx");
          var cy = data.getLayout("cy");
          data.graph.eachNode(function(node) {
            rotateNodeLabel(node, circularRotateLabel, cx, cy);
          });
          this._firstRender = false;
        };
        GraphView2.prototype.dispose = function() {
          this.remove();
          this._controller && this._controller.dispose();
          this._controllerHost = null;
        };
        GraphView2.prototype._startForceLayoutIteration = function(forceLayout2, layoutAnimation) {
          var self2 = this;
          (function step() {
            forceLayout2.step(function(stopped) {
              self2.updateLayout(self2._model);
              (self2._layouting = !stopped) && (layoutAnimation ? self2._layoutTimeout = setTimeout(step, 16) : step());
            });
          })();
        };
        GraphView2.prototype._updateController = function(seriesModel, ecModel, api2) {
          var _this = this;
          var controller = this._controller;
          var controllerHost = this._controllerHost;
          var group = this.group;
          controller.setPointerChecker(function(e2, x2, y) {
            var rect = group.getBoundingRect();
            rect.applyTransform(group.transform);
            return rect.contain(x2, y) && !onIrrelevantElement(e2, api2, seriesModel);
          });
          if (!isViewCoordSys(seriesModel.coordinateSystem)) {
            controller.disable();
            return;
          }
          controller.enable(seriesModel.get("roam"));
          controllerHost.zoomLimit = seriesModel.get("scaleLimit");
          controllerHost.zoom = seriesModel.coordinateSystem.getZoom();
          controller.off("pan").off("zoom").on("pan", function(e2) {
            updateViewOnPan(controllerHost, e2.dx, e2.dy);
            api2.dispatchAction({
              seriesId: seriesModel.id,
              type: "graphRoam",
              dx: e2.dx,
              dy: e2.dy
            });
          }).on("zoom", function(e2) {
            updateViewOnZoom(controllerHost, e2.scale, e2.originX, e2.originY);
            api2.dispatchAction({
              seriesId: seriesModel.id,
              type: "graphRoam",
              zoom: e2.scale,
              originX: e2.originX,
              originY: e2.originY
            });
            _this._updateNodeAndLinkScale();
            adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
            _this._lineDraw.updateLayout();
            api2.updateLabelLayout();
          });
        };
        GraphView2.prototype._updateNodeAndLinkScale = function() {
          var seriesModel = this._model;
          var data = seriesModel.getData();
          var nodeScale = getNodeGlobalScale(seriesModel);
          data.eachItemGraphicEl(function(el, idx) {
            el && el.setSymbolScale(nodeScale);
          });
        };
        GraphView2.prototype.updateLayout = function(seriesModel) {
          adjustEdge(seriesModel.getGraph(), getNodeGlobalScale(seriesModel));
          this._symbolDraw.updateLayout();
          this._lineDraw.updateLayout();
        };
        GraphView2.prototype.remove = function() {
          clearTimeout(this._layoutTimeout);
          this._layouting = false;
          this._layoutTimeout = null;
          this._symbolDraw && this._symbolDraw.remove();
          this._lineDraw && this._lineDraw.remove();
        };
        GraphView2.type = "graph";
        return GraphView2;
      }(ChartView)
    );
    function generateNodeKey(id) {
      return "_EC_" + id;
    }
    var Graph = (
      /** @class */
      function() {
        function Graph2(directed) {
          this.type = "graph";
          this.nodes = [];
          this.edges = [];
          this._nodesMap = {};
          this._edgesMap = {};
          this._directed = directed || false;
        }
        Graph2.prototype.isDirected = function() {
          return this._directed;
        };
        Graph2.prototype.addNode = function(id, dataIndex) {
          id = id == null ? "" + dataIndex : "" + id;
          var nodesMap = this._nodesMap;
          if (nodesMap[generateNodeKey(id)]) {
            return;
          }
          var node = new GraphNode(id, dataIndex);
          node.hostGraph = this;
          this.nodes.push(node);
          nodesMap[generateNodeKey(id)] = node;
          return node;
        };
        Graph2.prototype.getNodeByIndex = function(dataIndex) {
          var rawIdx = this.data.getRawIndex(dataIndex);
          return this.nodes[rawIdx];
        };
        Graph2.prototype.getNodeById = function(id) {
          return this._nodesMap[generateNodeKey(id)];
        };
        Graph2.prototype.addEdge = function(n1, n2, dataIndex) {
          var nodesMap = this._nodesMap;
          var edgesMap = this._edgesMap;
          if (isNumber$1(n1)) {
            n1 = this.nodes[n1];
          }
          if (isNumber$1(n2)) {
            n2 = this.nodes[n2];
          }
          if (!(n1 instanceof GraphNode)) {
            n1 = nodesMap[generateNodeKey(n1)];
          }
          if (!(n2 instanceof GraphNode)) {
            n2 = nodesMap[generateNodeKey(n2)];
          }
          if (!n1 || !n2) {
            return;
          }
          var key = n1.id + "-" + n2.id;
          var edge = new GraphEdge(n1, n2, dataIndex);
          edge.hostGraph = this;
          if (this._directed) {
            n1.outEdges.push(edge);
            n2.inEdges.push(edge);
          }
          n1.edges.push(edge);
          if (n1 !== n2) {
            n2.edges.push(edge);
          }
          this.edges.push(edge);
          edgesMap[key] = edge;
          return edge;
        };
        Graph2.prototype.getEdgeByIndex = function(dataIndex) {
          var rawIdx = this.edgeData.getRawIndex(dataIndex);
          return this.edges[rawIdx];
        };
        Graph2.prototype.getEdge = function(n1, n2) {
          if (n1 instanceof GraphNode) {
            n1 = n1.id;
          }
          if (n2 instanceof GraphNode) {
            n2 = n2.id;
          }
          var edgesMap = this._edgesMap;
          if (this._directed) {
            return edgesMap[n1 + "-" + n2];
          } else {
            return edgesMap[n1 + "-" + n2] || edgesMap[n2 + "-" + n1];
          }
        };
        Graph2.prototype.eachNode = function(cb, context) {
          var nodes = this.nodes;
          var len2 = nodes.length;
          for (var i2 = 0; i2 < len2; i2++) {
            if (nodes[i2].dataIndex >= 0) {
              cb.call(context, nodes[i2], i2);
            }
          }
        };
        Graph2.prototype.eachEdge = function(cb, context) {
          var edges = this.edges;
          var len2 = edges.length;
          for (var i2 = 0; i2 < len2; i2++) {
            if (edges[i2].dataIndex >= 0 && edges[i2].node1.dataIndex >= 0 && edges[i2].node2.dataIndex >= 0) {
              cb.call(context, edges[i2], i2);
            }
          }
        };
        Graph2.prototype.breadthFirstTraverse = function(cb, startNode, direction2, context) {
          if (!(startNode instanceof GraphNode)) {
            startNode = this._nodesMap[generateNodeKey(startNode)];
          }
          if (!startNode) {
            return;
          }
          var edgeType = direction2 === "out" ? "outEdges" : direction2 === "in" ? "inEdges" : "edges";
          for (var i2 = 0; i2 < this.nodes.length; i2++) {
            this.nodes[i2].__visited = false;
          }
          if (cb.call(context, startNode, null)) {
            return;
          }
          var queue2 = [startNode];
          while (queue2.length) {
            var currentNode = queue2.shift();
            var edges = currentNode[edgeType];
            for (var i2 = 0; i2 < edges.length; i2++) {
              var e2 = edges[i2];
              var otherNode = e2.node1 === currentNode ? e2.node2 : e2.node1;
              if (!otherNode.__visited) {
                if (cb.call(context, otherNode, currentNode)) {
                  return;
                }
                queue2.push(otherNode);
                otherNode.__visited = true;
              }
            }
          }
        };
        Graph2.prototype.update = function() {
          var data = this.data;
          var edgeData = this.edgeData;
          var nodes = this.nodes;
          var edges = this.edges;
          for (var i2 = 0, len2 = nodes.length; i2 < len2; i2++) {
            nodes[i2].dataIndex = -1;
          }
          for (var i2 = 0, len2 = data.count(); i2 < len2; i2++) {
            nodes[data.getRawIndex(i2)].dataIndex = i2;
          }
          edgeData.filterSelf(function(idx) {
            var edge = edges[edgeData.getRawIndex(idx)];
            return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;
          });
          for (var i2 = 0, len2 = edges.length; i2 < len2; i2++) {
            edges[i2].dataIndex = -1;
          }
          for (var i2 = 0, len2 = edgeData.count(); i2 < len2; i2++) {
            edges[edgeData.getRawIndex(i2)].dataIndex = i2;
          }
        };
        Graph2.prototype.clone = function() {
          var graph = new Graph2(this._directed);
          var nodes = this.nodes;
          var edges = this.edges;
          for (var i2 = 0; i2 < nodes.length; i2++) {
            graph.addNode(nodes[i2].id, nodes[i2].dataIndex);
          }
          for (var i2 = 0; i2 < edges.length; i2++) {
            var e2 = edges[i2];
            graph.addEdge(e2.node1.id, e2.node2.id, e2.dataIndex);
          }
          return graph;
        };
        return Graph2;
      }()
    );
    var GraphNode = (
      /** @class */
      function() {
        function GraphNode2(id, dataIndex) {
          this.inEdges = [];
          this.outEdges = [];
          this.edges = [];
          this.dataIndex = -1;
          this.id = id == null ? "" : id;
          this.dataIndex = dataIndex == null ? -1 : dataIndex;
        }
        GraphNode2.prototype.degree = function() {
          return this.edges.length;
        };
        GraphNode2.prototype.inDegree = function() {
          return this.inEdges.length;
        };
        GraphNode2.prototype.outDegree = function() {
          return this.outEdges.length;
        };
        GraphNode2.prototype.getModel = function(path) {
          if (this.dataIndex < 0) {
            return;
          }
          var graph = this.hostGraph;
          var itemModel = graph.data.getItemModel(this.dataIndex);
          return itemModel.getModel(path);
        };
        GraphNode2.prototype.getAdjacentDataIndices = function() {
          var dataIndices = {
            edge: [],
            node: []
          };
          for (var i2 = 0; i2 < this.edges.length; i2++) {
            var adjacentEdge = this.edges[i2];
            if (adjacentEdge.dataIndex < 0) {
              continue;
            }
            dataIndices.edge.push(adjacentEdge.dataIndex);
            dataIndices.node.push(adjacentEdge.node1.dataIndex, adjacentEdge.node2.dataIndex);
          }
          return dataIndices;
        };
        GraphNode2.prototype.getTrajectoryDataIndices = function() {
          var connectedEdgesMap = createHashMap();
          var connectedNodesMap = createHashMap();
          for (var i2 = 0; i2 < this.edges.length; i2++) {
            var adjacentEdge = this.edges[i2];
            if (adjacentEdge.dataIndex < 0) {
              continue;
            }
            connectedEdgesMap.set(adjacentEdge.dataIndex, true);
            var sourceNodesQueue = [adjacentEdge.node1];
            var targetNodesQueue = [adjacentEdge.node2];
            var nodeIteratorIndex = 0;
            while (nodeIteratorIndex < sourceNodesQueue.length) {
              var sourceNode = sourceNodesQueue[nodeIteratorIndex];
              nodeIteratorIndex++;
              connectedNodesMap.set(sourceNode.dataIndex, true);
              for (var j = 0; j < sourceNode.inEdges.length; j++) {
                connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);
                sourceNodesQueue.push(sourceNode.inEdges[j].node1);
              }
            }
            nodeIteratorIndex = 0;
            while (nodeIteratorIndex < targetNodesQueue.length) {
              var targetNode = targetNodesQueue[nodeIteratorIndex];
              nodeIteratorIndex++;
              connectedNodesMap.set(targetNode.dataIndex, true);
              for (var j = 0; j < targetNode.outEdges.length; j++) {
                connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);
                targetNodesQueue.push(targetNode.outEdges[j].node2);
              }
            }
          }
          return {
            edge: connectedEdgesMap.keys(),
            node: connectedNodesMap.keys()
          };
        };
        return GraphNode2;
      }()
    );
    var GraphEdge = (
      /** @class */
      function() {
        function GraphEdge2(n1, n2, dataIndex) {
          this.dataIndex = -1;
          this.node1 = n1;
          this.node2 = n2;
          this.dataIndex = dataIndex == null ? -1 : dataIndex;
        }
        GraphEdge2.prototype.getModel = function(path) {
          if (this.dataIndex < 0) {
            return;
          }
          var graph = this.hostGraph;
          var itemModel = graph.edgeData.getItemModel(this.dataIndex);
          return itemModel.getModel(path);
        };
        GraphEdge2.prototype.getAdjacentDataIndices = function() {
          return {
            edge: [this.dataIndex],
            node: [this.node1.dataIndex, this.node2.dataIndex]
          };
        };
        GraphEdge2.prototype.getTrajectoryDataIndices = function() {
          var connectedEdgesMap = createHashMap();
          var connectedNodesMap = createHashMap();
          connectedEdgesMap.set(this.dataIndex, true);
          var sourceNodes = [this.node1];
          var targetNodes = [this.node2];
          var nodeIteratorIndex = 0;
          while (nodeIteratorIndex < sourceNodes.length) {
            var sourceNode = sourceNodes[nodeIteratorIndex];
            nodeIteratorIndex++;
            connectedNodesMap.set(sourceNode.dataIndex, true);
            for (var j = 0; j < sourceNode.inEdges.length; j++) {
              connectedEdgesMap.set(sourceNode.inEdges[j].dataIndex, true);
              sourceNodes.push(sourceNode.inEdges[j].node1);
            }
          }
          nodeIteratorIndex = 0;
          while (nodeIteratorIndex < targetNodes.length) {
            var targetNode = targetNodes[nodeIteratorIndex];
            nodeIteratorIndex++;
            connectedNodesMap.set(targetNode.dataIndex, true);
            for (var j = 0; j < targetNode.outEdges.length; j++) {
              connectedEdgesMap.set(targetNode.outEdges[j].dataIndex, true);
              targetNodes.push(targetNode.outEdges[j].node2);
            }
          }
          return {
            edge: connectedEdgesMap.keys(),
            node: connectedNodesMap.keys()
          };
        };
        return GraphEdge2;
      }()
    );
    function createGraphDataProxyMixin(hostName, dataName) {
      return {
        /**
         * @param Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
         */
        getValue: function(dimension) {
          var data = this[hostName][dataName];
          return data.getStore().get(data.getDimensionIndex(dimension || "value"), this.dataIndex);
        },
        // TODO: TYPE stricter type.
        setVisual: function(key, value) {
          this.dataIndex >= 0 && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);
        },
        getVisual: function(key) {
          return this[hostName][dataName].getItemVisual(this.dataIndex, key);
        },
        setLayout: function(layout2, merge2) {
          this.dataIndex >= 0 && this[hostName][dataName].setItemLayout(this.dataIndex, layout2, merge2);
        },
        getLayout: function() {
          return this[hostName][dataName].getItemLayout(this.dataIndex);
        },
        getGraphicEl: function() {
          return this[hostName][dataName].getItemGraphicEl(this.dataIndex);
        },
        getRawIndex: function() {
          return this[hostName][dataName].getRawIndex(this.dataIndex);
        }
      };
    }
    mixin(GraphNode, createGraphDataProxyMixin("hostGraph", "data"));
    mixin(GraphEdge, createGraphDataProxyMixin("hostGraph", "edgeData"));
    function createGraphFromNodeEdge(nodes, edges, seriesModel, directed, beforeLink) {
      var graph = new Graph(directed);
      for (var i2 = 0; i2 < nodes.length; i2++) {
        graph.addNode(retrieve(
          // Id, name, dataIndex
          nodes[i2].id,
          nodes[i2].name,
          i2
        ), i2);
      }
      var linkNameList = [];
      var validEdges = [];
      var linkCount = 0;
      for (var i2 = 0; i2 < edges.length; i2++) {
        var link = edges[i2];
        var source = link.source;
        var target = link.target;
        if (graph.addEdge(source, target, linkCount)) {
          validEdges.push(link);
          linkNameList.push(retrieve(convertOptionIdName(link.id, null), source + " > " + target));
          linkCount++;
        }
      }
      var coordSys = seriesModel.get("coordinateSystem");
      var nodeData;
      if (coordSys === "cartesian2d" || coordSys === "polar") {
        nodeData = createSeriesData(nodes, seriesModel);
      } else {
        var coordSysCtor = CoordinateSystemManager.get(coordSys);
        var coordDimensions = coordSysCtor ? coordSysCtor.dimensions || [] : [];
        if (indexOf(coordDimensions, "value") < 0) {
          coordDimensions.concat(["value"]);
        }
        var dimensions = prepareSeriesDataSchema(nodes, {
          coordDimensions,
          encodeDefine: seriesModel.getEncode()
        }).dimensions;
        nodeData = new SeriesData(dimensions, seriesModel);
        nodeData.initData(nodes);
      }
      var edgeData = new SeriesData(["value"], seriesModel);
      edgeData.initData(validEdges, linkNameList);
      beforeLink && beforeLink(nodeData, edgeData);
      linkSeriesData({
        mainData: nodeData,
        struct: graph,
        structAttr: "graph",
        datas: {
          node: nodeData,
          edge: edgeData
        },
        datasAttr: {
          node: "data",
          edge: "edgeData"
        }
      });
      graph.update();
      return graph;
    }
    var GraphSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(GraphSeriesModel2, _super);
        function GraphSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GraphSeriesModel2.type;
          _this.hasSymbolVisual = true;
          return _this;
        }
        GraphSeriesModel2.prototype.init = function(option) {
          _super.prototype.init.apply(this, arguments);
          var self2 = this;
          function getCategoriesData() {
            return self2._categoriesData;
          }
          this.legendVisualProvider = new LegendVisualProvider(getCategoriesData, getCategoriesData);
          this.fillDataTextStyle(option.edges || option.links);
          this._updateCategoriesData();
        };
        GraphSeriesModel2.prototype.mergeOption = function(option) {
          _super.prototype.mergeOption.apply(this, arguments);
          this.fillDataTextStyle(option.edges || option.links);
          this._updateCategoriesData();
        };
        GraphSeriesModel2.prototype.mergeDefaultAndTheme = function(option) {
          _super.prototype.mergeDefaultAndTheme.apply(this, arguments);
          defaultEmphasis(option, "edgeLabel", ["show"]);
        };
        GraphSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var edges = option.edges || option.links || [];
          var nodes = option.data || option.nodes || [];
          var self2 = this;
          if (nodes && edges) {
            initCurvenessList(this);
            var graph = createGraphFromNodeEdge(nodes, edges, this, true, beforeLink);
            each$f(graph.edges, function(edge) {
              createEdgeMapForCurveness(edge.node1, edge.node2, this, edge.dataIndex);
            }, this);
            return graph.data;
          }
          function beforeLink(nodeData, edgeData) {
            nodeData.wrapMethod("getItemModel", function(model) {
              var categoriesModels = self2._categoriesModels;
              var categoryIdx = model.getShallow("category");
              var categoryModel = categoriesModels[categoryIdx];
              if (categoryModel) {
                categoryModel.parentModel = model.parentModel;
                model.parentModel = categoryModel;
              }
              return model;
            });
            var oldGetModel = Model.prototype.getModel;
            function newGetModel(path, parentModel) {
              var model = oldGetModel.call(this, path, parentModel);
              model.resolveParentPath = resolveParentPath;
              return model;
            }
            edgeData.wrapMethod("getItemModel", function(model) {
              model.resolveParentPath = resolveParentPath;
              model.getModel = newGetModel;
              return model;
            });
            function resolveParentPath(pathArr) {
              if (pathArr && (pathArr[0] === "label" || pathArr[1] === "label")) {
                var newPathArr = pathArr.slice();
                if (pathArr[0] === "label") {
                  newPathArr[0] = "edgeLabel";
                } else if (pathArr[1] === "label") {
                  newPathArr[1] = "edgeLabel";
                }
                return newPathArr;
              }
              return pathArr;
            }
          }
        };
        GraphSeriesModel2.prototype.getGraph = function() {
          return this.getData().graph;
        };
        GraphSeriesModel2.prototype.getEdgeData = function() {
          return this.getGraph().edgeData;
        };
        GraphSeriesModel2.prototype.getCategoriesData = function() {
          return this._categoriesData;
        };
        GraphSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          if (dataType2 === "edge") {
            var nodeData = this.getData();
            var params = this.getDataParams(dataIndex, dataType2);
            var edge = nodeData.graph.getEdgeByIndex(dataIndex);
            var sourceName = nodeData.getName(edge.node1.dataIndex);
            var targetName = nodeData.getName(edge.node2.dataIndex);
            var nameArr = [];
            sourceName != null && nameArr.push(sourceName);
            targetName != null && nameArr.push(targetName);
            return createTooltipMarkup("nameValue", {
              name: nameArr.join(" > "),
              value: params.value,
              noValue: params.value == null
            });
          }
          var nodeMarkup = defaultSeriesFormatTooltip({
            series: this,
            dataIndex,
            multipleSeries
          });
          return nodeMarkup;
        };
        GraphSeriesModel2.prototype._updateCategoriesData = function() {
          var categories = map$1(this.option.categories || [], function(category) {
            return category.value != null ? category : extend$1({
              value: 0
            }, category);
          });
          var categoriesData = new SeriesData(["value"], this);
          categoriesData.initData(categories);
          this._categoriesData = categoriesData;
          this._categoriesModels = categoriesData.mapArray(function(idx) {
            return categoriesData.getItemModel(idx);
          });
        };
        GraphSeriesModel2.prototype.setZoom = function(zoom) {
          this.option.zoom = zoom;
        };
        GraphSeriesModel2.prototype.setCenter = function(center2) {
          this.option.center = center2;
        };
        GraphSeriesModel2.prototype.isAnimationEnabled = function() {
          return _super.prototype.isAnimationEnabled.call(this) && !(this.get("layout") === "force" && this.get(["force", "layoutAnimation"]));
        };
        GraphSeriesModel2.type = "series.graph";
        GraphSeriesModel2.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"];
        GraphSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "view",
          // Default option for all coordinate systems
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          // polarIndex: 0,
          // geoIndex: 0,
          legendHoverLink: true,
          layout: null,
          // Configuration of circular layout
          circular: {
            rotateLabel: false
          },
          // Configuration of force directed layout
          force: {
            initLayout: null,
            // Node repulsion. Can be an array to represent range.
            repulsion: [0, 50],
            gravity: 0.1,
            // Initial friction
            friction: 0.6,
            // Edge length. Can be an array to represent range.
            edgeLength: 30,
            layoutAnimation: true
          },
          left: "center",
          top: "center",
          // right: null,
          // bottom: null,
          // width: '80%',
          // height: '80%',
          symbol: "circle",
          symbolSize: 10,
          edgeSymbol: ["none", "none"],
          edgeSymbolSize: 10,
          edgeLabel: {
            position: "middle",
            distance: 5
          },
          draggable: false,
          roam: false,
          // Default on center of graph
          center: null,
          zoom: 1,
          // Symbol size scale ratio in roam
          nodeScaleRatio: 0.6,
          // cursor: null,
          // categories: [],
          // data: []
          // Or
          // nodes: []
          //
          // links: []
          // Or
          // edges: []
          label: {
            show: false,
            formatter: "{b}"
          },
          itemStyle: {},
          lineStyle: {
            color: "#aaa",
            width: 1,
            opacity: 0.5
          },
          emphasis: {
            scale: true,
            label: {
              show: true
            }
          },
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          }
        };
        return GraphSeriesModel2;
      }(SeriesModel)
    );
    var actionInfo$1 = {
      type: "graphRoam",
      event: "graphRoam",
      update: "none"
    };
    function install$F(registers) {
      registers.registerChartView(GraphView);
      registers.registerSeriesModel(GraphSeriesModel);
      registers.registerProcessor(categoryFilter);
      registers.registerVisual(categoryVisual);
      registers.registerVisual(graphEdgeVisual);
      registers.registerLayout(graphSimpleLayout);
      registers.registerLayout(registers.PRIORITY.VISUAL.POST_CHART_LAYOUT, graphCircularLayout);
      registers.registerLayout(graphForceLayout);
      registers.registerCoordinateSystem("graphView", {
        dimensions: View.dimensions,
        create: createViewCoordSys
      });
      registers.registerAction({
        type: "focusNodeAdjacency",
        event: "focusNodeAdjacency",
        update: "series:focusNodeAdjacency"
      }, noop$1);
      registers.registerAction({
        type: "unfocusNodeAdjacency",
        event: "unfocusNodeAdjacency",
        update: "series:unfocusNodeAdjacency"
      }, noop$1);
      registers.registerAction(actionInfo$1, function(payload, ecModel, api2) {
        ecModel.eachComponent({
          mainType: "series",
          query: payload
        }, function(seriesModel) {
          var coordSys = seriesModel.coordinateSystem;
          var res = updateCenterAndZoom(coordSys, payload, void 0, api2);
          seriesModel.setCenter && seriesModel.setCenter(res.center);
          seriesModel.setZoom && seriesModel.setZoom(res.zoom);
        });
      });
    }
    var PointerShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function PointerShape2() {
          this.angle = 0;
          this.width = 10;
          this.r = 10;
          this.x = 0;
          this.y = 0;
        }
        return PointerShape2;
      }()
    );
    var PointerPath = (
      /** @class */
      function(_super) {
        __extends$1(PointerPath2, _super);
        function PointerPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "pointer";
          return _this;
        }
        PointerPath2.prototype.getDefaultShape = function() {
          return new PointerShape();
        };
        PointerPath2.prototype.buildPath = function(ctx, shape) {
          var mathCos2 = Math.cos;
          var mathSin2 = Math.sin;
          var r = shape.r;
          var width = shape.width;
          var angle2 = shape.angle;
          var x2 = shape.x - mathCos2(angle2) * width * (width >= r / 3 ? 1 : 2);
          var y = shape.y - mathSin2(angle2) * width * (width >= r / 3 ? 1 : 2);
          angle2 = shape.angle - Math.PI / 2;
          ctx.moveTo(x2, y);
          ctx.lineTo(shape.x + mathCos2(angle2) * width, shape.y + mathSin2(angle2) * width);
          ctx.lineTo(shape.x + mathCos2(shape.angle) * r, shape.y + mathSin2(shape.angle) * r);
          ctx.lineTo(shape.x - mathCos2(angle2) * width, shape.y - mathSin2(angle2) * width);
          ctx.lineTo(x2, y);
        };
        return PointerPath2;
      }(Path)
    );
    function parsePosition(seriesModel, api2) {
      var center2 = seriesModel.get("center");
      var width = api2.getWidth();
      var height = api2.getHeight();
      var size = Math.min(width, height);
      var cx = parsePercent(center2[0], api2.getWidth());
      var cy = parsePercent(center2[1], api2.getHeight());
      var r = parsePercent(seriesModel.get("radius"), size / 2);
      return {
        cx,
        cy,
        r
      };
    }
    function formatLabel(value, labelFormatter) {
      var label = value == null ? "" : value + "";
      if (labelFormatter) {
        if (isString$1(labelFormatter)) {
          label = labelFormatter.replace("{value}", label);
        } else if (isFunction$1(labelFormatter)) {
          label = labelFormatter(value);
        }
      }
      return label;
    }
    var GaugeView = (
      /** @class */
      function(_super) {
        __extends$1(GaugeView2, _super);
        function GaugeView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GaugeView2.type;
          return _this;
        }
        GaugeView2.prototype.render = function(seriesModel, ecModel, api2) {
          this.group.removeAll();
          var colorList = seriesModel.get(["axisLine", "lineStyle", "color"]);
          var posInfo = parsePosition(seriesModel, api2);
          this._renderMain(seriesModel, ecModel, api2, colorList, posInfo);
          this._data = seriesModel.getData();
        };
        GaugeView2.prototype.dispose = function() {
        };
        GaugeView2.prototype._renderMain = function(seriesModel, ecModel, api2, colorList, posInfo) {
          var group = this.group;
          var clockwise = seriesModel.get("clockwise");
          var startAngle = -seriesModel.get("startAngle") / 180 * Math.PI;
          var endAngle = -seriesModel.get("endAngle") / 180 * Math.PI;
          var axisLineModel = seriesModel.getModel("axisLine");
          var roundCap = axisLineModel.get("roundCap");
          var MainPath = roundCap ? SausagePath : Sector;
          var showAxis = axisLineModel.get("show");
          var lineStyleModel = axisLineModel.getModel("lineStyle");
          var axisLineWidth = lineStyleModel.get("width");
          var angles = [startAngle, endAngle];
          normalizeArcAngles(angles, !clockwise);
          startAngle = angles[0];
          endAngle = angles[1];
          var angleRangeSpan = endAngle - startAngle;
          var prevEndAngle = startAngle;
          var sectors = [];
          for (var i2 = 0; showAxis && i2 < colorList.length; i2++) {
            var percent = Math.min(Math.max(colorList[i2][0], 0), 1);
            endAngle = startAngle + angleRangeSpan * percent;
            var sector = new MainPath({
              shape: {
                startAngle: prevEndAngle,
                endAngle,
                cx: posInfo.cx,
                cy: posInfo.cy,
                clockwise,
                r0: posInfo.r - axisLineWidth,
                r: posInfo.r
              },
              silent: true
            });
            sector.setStyle({
              fill: colorList[i2][1]
            });
            sector.setStyle(lineStyleModel.getLineStyle(
              // Because we use sector to simulate arc
              // so the properties for stroking are useless
              ["color", "width"]
            ));
            sectors.push(sector);
            prevEndAngle = endAngle;
          }
          sectors.reverse();
          each$f(sectors, function(sector2) {
            return group.add(sector2);
          });
          var getColor2 = function(percent2) {
            if (percent2 <= 0) {
              return colorList[0][1];
            }
            var i3;
            for (i3 = 0; i3 < colorList.length; i3++) {
              if (colorList[i3][0] >= percent2 && (i3 === 0 ? 0 : colorList[i3 - 1][0]) < percent2) {
                return colorList[i3][1];
              }
            }
            return colorList[i3 - 1][1];
          };
          this._renderTicks(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth);
          this._renderTitleAndDetail(seriesModel, ecModel, api2, getColor2, posInfo);
          this._renderAnchor(seriesModel, posInfo);
          this._renderPointer(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth);
        };
        GaugeView2.prototype._renderTicks = function(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {
          var group = this.group;
          var cx = posInfo.cx;
          var cy = posInfo.cy;
          var r = posInfo.r;
          var minVal = +seriesModel.get("min");
          var maxVal = +seriesModel.get("max");
          var splitLineModel = seriesModel.getModel("splitLine");
          var tickModel = seriesModel.getModel("axisTick");
          var labelModel = seriesModel.getModel("axisLabel");
          var splitNumber = seriesModel.get("splitNumber");
          var subSplitNumber = tickModel.get("splitNumber");
          var splitLineLen = parsePercent(splitLineModel.get("length"), r);
          var tickLen = parsePercent(tickModel.get("length"), r);
          var angle2 = startAngle;
          var step = (endAngle - startAngle) / splitNumber;
          var subStep = step / subSplitNumber;
          var splitLineStyle = splitLineModel.getModel("lineStyle").getLineStyle();
          var tickLineStyle = tickModel.getModel("lineStyle").getLineStyle();
          var splitLineDistance = splitLineModel.get("distance");
          var unitX;
          var unitY;
          for (var i2 = 0; i2 <= splitNumber; i2++) {
            unitX = Math.cos(angle2);
            unitY = Math.sin(angle2);
            if (splitLineModel.get("show")) {
              var distance2 = splitLineDistance ? splitLineDistance + axisLineWidth : axisLineWidth;
              var splitLine = new Line$1({
                shape: {
                  x1: unitX * (r - distance2) + cx,
                  y1: unitY * (r - distance2) + cy,
                  x2: unitX * (r - splitLineLen - distance2) + cx,
                  y2: unitY * (r - splitLineLen - distance2) + cy
                },
                style: splitLineStyle,
                silent: true
              });
              if (splitLineStyle.stroke === "auto") {
                splitLine.setStyle({
                  stroke: getColor2(i2 / splitNumber)
                });
              }
              group.add(splitLine);
            }
            if (labelModel.get("show")) {
              var distance2 = labelModel.get("distance") + splitLineDistance;
              var label = formatLabel(round$3(i2 / splitNumber * (maxVal - minVal) + minVal), labelModel.get("formatter"));
              var autoColor = getColor2(i2 / splitNumber);
              var textStyleX = unitX * (r - splitLineLen - distance2) + cx;
              var textStyleY = unitY * (r - splitLineLen - distance2) + cy;
              var rotateType = labelModel.get("rotate");
              var rotate2 = 0;
              if (rotateType === "radial") {
                rotate2 = -angle2 + 2 * Math.PI;
                if (rotate2 > Math.PI / 2) {
                  rotate2 += Math.PI;
                }
              } else if (rotateType === "tangential") {
                rotate2 = -angle2 - Math.PI / 2;
              } else if (isNumber$1(rotateType)) {
                rotate2 = rotateType * Math.PI / 180;
              }
              if (rotate2 === 0) {
                group.add(new ZRText({
                  style: createTextStyle(labelModel, {
                    text: label,
                    x: textStyleX,
                    y: textStyleY,
                    verticalAlign: unitY < -0.8 ? "top" : unitY > 0.8 ? "bottom" : "middle",
                    align: unitX < -0.4 ? "left" : unitX > 0.4 ? "right" : "center"
                  }, {
                    inheritColor: autoColor
                  }),
                  silent: true
                }));
              } else {
                group.add(new ZRText({
                  style: createTextStyle(labelModel, {
                    text: label,
                    x: textStyleX,
                    y: textStyleY,
                    verticalAlign: "middle",
                    align: "center"
                  }, {
                    inheritColor: autoColor
                  }),
                  silent: true,
                  originX: textStyleX,
                  originY: textStyleY,
                  rotation: rotate2
                }));
              }
            }
            if (tickModel.get("show") && i2 !== splitNumber) {
              var distance2 = tickModel.get("distance");
              distance2 = distance2 ? distance2 + axisLineWidth : axisLineWidth;
              for (var j = 0; j <= subSplitNumber; j++) {
                unitX = Math.cos(angle2);
                unitY = Math.sin(angle2);
                var tickLine = new Line$1({
                  shape: {
                    x1: unitX * (r - distance2) + cx,
                    y1: unitY * (r - distance2) + cy,
                    x2: unitX * (r - tickLen - distance2) + cx,
                    y2: unitY * (r - tickLen - distance2) + cy
                  },
                  silent: true,
                  style: tickLineStyle
                });
                if (tickLineStyle.stroke === "auto") {
                  tickLine.setStyle({
                    stroke: getColor2((i2 + j / subSplitNumber) / splitNumber)
                  });
                }
                group.add(tickLine);
                angle2 += subStep;
              }
              angle2 -= subStep;
            } else {
              angle2 += step;
            }
          }
        };
        GaugeView2.prototype._renderPointer = function(seriesModel, ecModel, api2, getColor2, posInfo, startAngle, endAngle, clockwise, axisLineWidth) {
          var group = this.group;
          var oldData = this._data;
          var oldProgressData = this._progressEls;
          var progressList = [];
          var showPointer2 = seriesModel.get(["pointer", "show"]);
          var progressModel = seriesModel.getModel("progress");
          var showProgress = progressModel.get("show");
          var data = seriesModel.getData();
          var valueDim = data.mapDimension("value");
          var minVal = +seriesModel.get("min");
          var maxVal = +seriesModel.get("max");
          var valueExtent = [minVal, maxVal];
          var angleExtent = [startAngle, endAngle];
          function createPointer(idx, angle2) {
            var itemModel = data.getItemModel(idx);
            var pointerModel = itemModel.getModel("pointer");
            var pointerWidth = parsePercent(pointerModel.get("width"), posInfo.r);
            var pointerLength = parsePercent(pointerModel.get("length"), posInfo.r);
            var pointerStr = seriesModel.get(["pointer", "icon"]);
            var pointerOffset = pointerModel.get("offsetCenter");
            var pointerOffsetX = parsePercent(pointerOffset[0], posInfo.r);
            var pointerOffsetY = parsePercent(pointerOffset[1], posInfo.r);
            var pointerKeepAspect = pointerModel.get("keepAspect");
            var pointer;
            if (pointerStr) {
              pointer = createSymbol$1(pointerStr, pointerOffsetX - pointerWidth / 2, pointerOffsetY - pointerLength, pointerWidth, pointerLength, null, pointerKeepAspect);
            } else {
              pointer = new PointerPath({
                shape: {
                  angle: -Math.PI / 2,
                  width: pointerWidth,
                  r: pointerLength,
                  x: pointerOffsetX,
                  y: pointerOffsetY
                }
              });
            }
            pointer.rotation = -(angle2 + Math.PI / 2);
            pointer.x = posInfo.cx;
            pointer.y = posInfo.cy;
            return pointer;
          }
          function createProgress(idx, endAngle2) {
            var roundCap = progressModel.get("roundCap");
            var ProgressPath = roundCap ? SausagePath : Sector;
            var isOverlap = progressModel.get("overlap");
            var progressWidth = isOverlap ? progressModel.get("width") : axisLineWidth / data.count();
            var r0 = isOverlap ? posInfo.r - progressWidth : posInfo.r - (idx + 1) * progressWidth;
            var r = isOverlap ? posInfo.r : posInfo.r - idx * progressWidth;
            var progress = new ProgressPath({
              shape: {
                startAngle,
                endAngle: endAngle2,
                cx: posInfo.cx,
                cy: posInfo.cy,
                clockwise,
                r0,
                r
              }
            });
            isOverlap && (progress.z2 = linearMap$2(data.get(valueDim, idx), [minVal, maxVal], [100, 0], true));
            return progress;
          }
          if (showProgress || showPointer2) {
            data.diff(oldData).add(function(idx) {
              var val = data.get(valueDim, idx);
              if (showPointer2) {
                var pointer = createPointer(idx, startAngle);
                initProps(pointer, {
                  rotation: -((isNaN(+val) ? angleExtent[0] : linearMap$2(val, valueExtent, angleExtent, true)) + Math.PI / 2)
                }, seriesModel);
                group.add(pointer);
                data.setItemGraphicEl(idx, pointer);
              }
              if (showProgress) {
                var progress = createProgress(idx, startAngle);
                var isClip = progressModel.get("clip");
                initProps(progress, {
                  shape: {
                    endAngle: linearMap$2(val, valueExtent, angleExtent, isClip)
                  }
                }, seriesModel);
                group.add(progress);
                setCommonECData(seriesModel.seriesIndex, data.dataType, idx, progress);
                progressList[idx] = progress;
              }
            }).update(function(newIdx, oldIdx) {
              var val = data.get(valueDim, newIdx);
              if (showPointer2) {
                var previousPointer = oldData.getItemGraphicEl(oldIdx);
                var previousRotate = previousPointer ? previousPointer.rotation : startAngle;
                var pointer = createPointer(newIdx, previousRotate);
                pointer.rotation = previousRotate;
                updateProps$1(pointer, {
                  rotation: -((isNaN(+val) ? angleExtent[0] : linearMap$2(val, valueExtent, angleExtent, true)) + Math.PI / 2)
                }, seriesModel);
                group.add(pointer);
                data.setItemGraphicEl(newIdx, pointer);
              }
              if (showProgress) {
                var previousProgress = oldProgressData[oldIdx];
                var previousEndAngle = previousProgress ? previousProgress.shape.endAngle : startAngle;
                var progress = createProgress(newIdx, previousEndAngle);
                var isClip = progressModel.get("clip");
                updateProps$1(progress, {
                  shape: {
                    endAngle: linearMap$2(val, valueExtent, angleExtent, isClip)
                  }
                }, seriesModel);
                group.add(progress);
                setCommonECData(seriesModel.seriesIndex, data.dataType, newIdx, progress);
                progressList[newIdx] = progress;
              }
            }).execute();
            data.each(function(idx) {
              var itemModel = data.getItemModel(idx);
              var emphasisModel = itemModel.getModel("emphasis");
              var focus = emphasisModel.get("focus");
              var blurScope = emphasisModel.get("blurScope");
              var emphasisDisabled = emphasisModel.get("disabled");
              if (showPointer2) {
                var pointer = data.getItemGraphicEl(idx);
                var symbolStyle = data.getItemVisual(idx, "style");
                var visualColor = symbolStyle.fill;
                if (pointer instanceof ZRImage) {
                  var pathStyle = pointer.style;
                  pointer.useStyle(extend$1({
                    image: pathStyle.image,
                    x: pathStyle.x,
                    y: pathStyle.y,
                    width: pathStyle.width,
                    height: pathStyle.height
                  }, symbolStyle));
                } else {
                  pointer.useStyle(symbolStyle);
                  pointer.type !== "pointer" && pointer.setColor(visualColor);
                }
                pointer.setStyle(itemModel.getModel(["pointer", "itemStyle"]).getItemStyle());
                if (pointer.style.fill === "auto") {
                  pointer.setStyle("fill", getColor2(linearMap$2(data.get(valueDim, idx), valueExtent, [0, 1], true)));
                }
                pointer.z2EmphasisLift = 0;
                setStatesStylesFromModel(pointer, itemModel);
                toggleHoverEmphasis(pointer, focus, blurScope, emphasisDisabled);
              }
              if (showProgress) {
                var progress = progressList[idx];
                progress.useStyle(data.getItemVisual(idx, "style"));
                progress.setStyle(itemModel.getModel(["progress", "itemStyle"]).getItemStyle());
                progress.z2EmphasisLift = 0;
                setStatesStylesFromModel(progress, itemModel);
                toggleHoverEmphasis(progress, focus, blurScope, emphasisDisabled);
              }
            });
            this._progressEls = progressList;
          }
        };
        GaugeView2.prototype._renderAnchor = function(seriesModel, posInfo) {
          var anchorModel = seriesModel.getModel("anchor");
          var showAnchor = anchorModel.get("show");
          if (showAnchor) {
            var anchorSize = anchorModel.get("size");
            var anchorType = anchorModel.get("icon");
            var offsetCenter = anchorModel.get("offsetCenter");
            var anchorKeepAspect = anchorModel.get("keepAspect");
            var anchor = createSymbol$1(anchorType, posInfo.cx - anchorSize / 2 + parsePercent(offsetCenter[0], posInfo.r), posInfo.cy - anchorSize / 2 + parsePercent(offsetCenter[1], posInfo.r), anchorSize, anchorSize, null, anchorKeepAspect);
            anchor.z2 = anchorModel.get("showAbove") ? 1 : 0;
            anchor.setStyle(anchorModel.getModel("itemStyle").getItemStyle());
            this.group.add(anchor);
          }
        };
        GaugeView2.prototype._renderTitleAndDetail = function(seriesModel, ecModel, api2, getColor2, posInfo) {
          var _this = this;
          var data = seriesModel.getData();
          var valueDim = data.mapDimension("value");
          var minVal = +seriesModel.get("min");
          var maxVal = +seriesModel.get("max");
          var contentGroup = new Group$3();
          var newTitleEls = [];
          var newDetailEls = [];
          var hasAnimation = seriesModel.isAnimationEnabled();
          var showPointerAbove = seriesModel.get(["pointer", "showAbove"]);
          data.diff(this._data).add(function(idx) {
            newTitleEls[idx] = new ZRText({
              silent: true
            });
            newDetailEls[idx] = new ZRText({
              silent: true
            });
          }).update(function(idx, oldIdx) {
            newTitleEls[idx] = _this._titleEls[oldIdx];
            newDetailEls[idx] = _this._detailEls[oldIdx];
          }).execute();
          data.each(function(idx) {
            var itemModel = data.getItemModel(idx);
            var value = data.get(valueDim, idx);
            var itemGroup = new Group$3();
            var autoColor = getColor2(linearMap$2(value, [minVal, maxVal], [0, 1], true));
            var itemTitleModel = itemModel.getModel("title");
            if (itemTitleModel.get("show")) {
              var titleOffsetCenter = itemTitleModel.get("offsetCenter");
              var titleX = posInfo.cx + parsePercent(titleOffsetCenter[0], posInfo.r);
              var titleY = posInfo.cy + parsePercent(titleOffsetCenter[1], posInfo.r);
              var labelEl = newTitleEls[idx];
              labelEl.attr({
                z2: showPointerAbove ? 0 : 2,
                style: createTextStyle(itemTitleModel, {
                  x: titleX,
                  y: titleY,
                  text: data.getName(idx),
                  align: "center",
                  verticalAlign: "middle"
                }, {
                  inheritColor: autoColor
                })
              });
              itemGroup.add(labelEl);
            }
            var itemDetailModel = itemModel.getModel("detail");
            if (itemDetailModel.get("show")) {
              var detailOffsetCenter = itemDetailModel.get("offsetCenter");
              var detailX = posInfo.cx + parsePercent(detailOffsetCenter[0], posInfo.r);
              var detailY = posInfo.cy + parsePercent(detailOffsetCenter[1], posInfo.r);
              var width = parsePercent(itemDetailModel.get("width"), posInfo.r);
              var height = parsePercent(itemDetailModel.get("height"), posInfo.r);
              var detailColor = seriesModel.get(["progress", "show"]) ? data.getItemVisual(idx, "style").fill : autoColor;
              var labelEl = newDetailEls[idx];
              var formatter_1 = itemDetailModel.get("formatter");
              labelEl.attr({
                z2: showPointerAbove ? 0 : 2,
                style: createTextStyle(itemDetailModel, {
                  x: detailX,
                  y: detailY,
                  text: formatLabel(value, formatter_1),
                  width: isNaN(width) ? null : width,
                  height: isNaN(height) ? null : height,
                  align: "center",
                  verticalAlign: "middle"
                }, {
                  inheritColor: detailColor
                })
              });
              setLabelValueAnimation(labelEl, {
                normal: itemDetailModel
              }, value, function(value2) {
                return formatLabel(value2, formatter_1);
              });
              hasAnimation && animateLabelValue(labelEl, idx, data, seriesModel, {
                getFormattedLabel: function(labelDataIndex, status, dataType2, labelDimIndex, fmt, extendParams) {
                  return formatLabel(extendParams ? extendParams.interpolatedValue : value, formatter_1);
                }
              });
              itemGroup.add(labelEl);
            }
            contentGroup.add(itemGroup);
          });
          this.group.add(contentGroup);
          this._titleEls = newTitleEls;
          this._detailEls = newDetailEls;
        };
        GaugeView2.type = "gauge";
        return GaugeView2;
      }(ChartView)
    );
    var GaugeSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(GaugeSeriesModel2, _super);
        function GaugeSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GaugeSeriesModel2.type;
          _this.visualStyleAccessPath = "itemStyle";
          return _this;
        }
        GaugeSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesDataSimply(this, ["value"]);
        };
        GaugeSeriesModel2.type = "series.gauge";
        GaugeSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          colorBy: "data",
          // 默认全局居中
          center: ["50%", "50%"],
          legendHoverLink: true,
          radius: "75%",
          startAngle: 225,
          endAngle: -45,
          clockwise: true,
          // 最小值
          min: 0,
          // 最大值
          max: 100,
          // 分割段数，默认为10
          splitNumber: 10,
          // 坐标轴线
          axisLine: {
            // 默认显示，属性show控制显示与否
            show: true,
            roundCap: false,
            lineStyle: {
              color: [[1, "#E6EBF8"]],
              width: 10
            }
          },
          // 坐标轴线
          progress: {
            // 默认显示，属性show控制显示与否
            show: false,
            overlap: true,
            width: 10,
            roundCap: false,
            clip: true
          },
          // 分隔线
          splitLine: {
            // 默认显示，属性show控制显示与否
            show: true,
            // 属性length控制线长
            length: 10,
            distance: 10,
            // 属性lineStyle（详见lineStyle）控制线条样式
            lineStyle: {
              color: "#63677A",
              width: 3,
              type: "solid"
            }
          },
          // 坐标轴小标记
          axisTick: {
            // 属性show控制显示与否，默认不显示
            show: true,
            // 每份split细分多少段
            splitNumber: 5,
            // 属性length控制线长
            length: 6,
            distance: 10,
            // 属性lineStyle控制线条样式
            lineStyle: {
              color: "#63677A",
              width: 1,
              type: "solid"
            }
          },
          axisLabel: {
            show: true,
            distance: 15,
            // formatter: null,
            color: "#464646",
            fontSize: 12,
            rotate: 0
          },
          pointer: {
            icon: null,
            offsetCenter: [0, 0],
            show: true,
            showAbove: true,
            length: "60%",
            width: 6,
            keepAspect: false
          },
          anchor: {
            show: false,
            showAbove: false,
            size: 6,
            icon: "circle",
            offsetCenter: [0, 0],
            keepAspect: false,
            itemStyle: {
              color: "#fff",
              borderWidth: 0,
              borderColor: "#5470c6"
            }
          },
          title: {
            show: true,
            // x, y，单位px
            offsetCenter: [0, "20%"],
            // 其余属性默认使用全局文本样式，详见TEXTSTYLE
            color: "#464646",
            fontSize: 16,
            valueAnimation: false
          },
          detail: {
            show: true,
            backgroundColor: "rgba(0,0,0,0)",
            borderWidth: 0,
            borderColor: "#ccc",
            width: 100,
            height: null,
            padding: [5, 10],
            // x, y，单位px
            offsetCenter: [0, "40%"],
            // formatter: null,
            // 其余属性默认使用全局文本样式，详见TEXTSTYLE
            color: "#464646",
            fontSize: 30,
            fontWeight: "bold",
            lineHeight: 30,
            valueAnimation: false
          }
        };
        return GaugeSeriesModel2;
      }(SeriesModel)
    );
    function install$E(registers) {
      registers.registerChartView(GaugeView);
      registers.registerSeriesModel(GaugeSeriesModel);
    }
    var opacityAccessPath$1 = ["itemStyle", "opacity"];
    var FunnelPiece = (
      /** @class */
      function(_super) {
        __extends$1(FunnelPiece2, _super);
        function FunnelPiece2(data, idx) {
          var _this = _super.call(this) || this;
          var polygon = _this;
          var labelLine = new Polyline$1();
          var text = new ZRText();
          polygon.setTextContent(text);
          _this.setTextGuideLine(labelLine);
          _this.updateData(data, idx, true);
          return _this;
        }
        FunnelPiece2.prototype.updateData = function(data, idx, firstCreate) {
          var polygon = this;
          var seriesModel = data.hostModel;
          var itemModel = data.getItemModel(idx);
          var layout2 = data.getItemLayout(idx);
          var emphasisModel = itemModel.getModel("emphasis");
          var opacity2 = itemModel.get(opacityAccessPath$1);
          opacity2 = opacity2 == null ? 1 : opacity2;
          if (!firstCreate) {
            saveOldStyle(polygon);
          }
          polygon.useStyle(data.getItemVisual(idx, "style"));
          polygon.style.lineJoin = "round";
          if (firstCreate) {
            polygon.setShape({
              points: layout2.points
            });
            polygon.style.opacity = 0;
            initProps(polygon, {
              style: {
                opacity: opacity2
              }
            }, seriesModel, idx);
          } else {
            updateProps$1(polygon, {
              style: {
                opacity: opacity2
              },
              shape: {
                points: layout2.points
              }
            }, seriesModel, idx);
          }
          setStatesStylesFromModel(polygon, itemModel);
          this._updateLabel(data, idx);
          toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
        };
        FunnelPiece2.prototype._updateLabel = function(data, idx) {
          var polygon = this;
          var labelLine = this.getTextGuideLine();
          var labelText = polygon.getTextContent();
          var seriesModel = data.hostModel;
          var itemModel = data.getItemModel(idx);
          var layout2 = data.getItemLayout(idx);
          var labelLayout2 = layout2.label;
          var style = data.getItemVisual(idx, "style");
          var visualColor = style.fill;
          setLabelStyle(
            // position will not be used in setLabelStyle
            labelText,
            getLabelStatesModels(itemModel),
            {
              labelFetcher: data.hostModel,
              labelDataIndex: idx,
              defaultOpacity: style.opacity,
              defaultText: data.getName(idx)
            },
            {
              normal: {
                align: labelLayout2.textAlign,
                verticalAlign: labelLayout2.verticalAlign
              }
            }
          );
          polygon.setTextConfig({
            local: true,
            inside: !!labelLayout2.inside,
            insideStroke: visualColor,
            // insideFill: 'auto',
            outsideFill: visualColor
          });
          var linePoints = labelLayout2.linePoints;
          labelLine.setShape({
            points: linePoints
          });
          polygon.textGuideLineConfig = {
            anchor: linePoints ? new Point(linePoints[0][0], linePoints[0][1]) : null
          };
          updateProps$1(labelText, {
            style: {
              x: labelLayout2.x,
              y: labelLayout2.y
            }
          }, seriesModel, idx);
          labelText.attr({
            rotation: labelLayout2.rotation,
            originX: labelLayout2.x,
            originY: labelLayout2.y,
            z2: 10
          });
          setLabelLineStyle(polygon, getLabelLineStatesModels(itemModel), {
            // Default use item visual color
            stroke: visualColor
          });
        };
        return FunnelPiece2;
      }(Polygon)
    );
    var FunnelView = (
      /** @class */
      function(_super) {
        __extends$1(FunnelView2, _super);
        function FunnelView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = FunnelView2.type;
          _this.ignoreLabelLineUpdate = true;
          return _this;
        }
        FunnelView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var oldData = this._data;
          var group = this.group;
          data.diff(oldData).add(function(idx) {
            var funnelPiece = new FunnelPiece(data, idx);
            data.setItemGraphicEl(idx, funnelPiece);
            group.add(funnelPiece);
          }).update(function(newIdx, oldIdx) {
            var piece = oldData.getItemGraphicEl(oldIdx);
            piece.updateData(data, newIdx);
            group.add(piece);
            data.setItemGraphicEl(newIdx, piece);
          }).remove(function(idx) {
            var piece = oldData.getItemGraphicEl(idx);
            removeElementWithFadeOut(piece, seriesModel, idx);
          }).execute();
          this._data = data;
        };
        FunnelView2.prototype.remove = function() {
          this.group.removeAll();
          this._data = null;
        };
        FunnelView2.prototype.dispose = function() {
        };
        FunnelView2.type = "funnel";
        return FunnelView2;
      }(ChartView)
    );
    var FunnelSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(FunnelSeriesModel2, _super);
        function FunnelSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = FunnelSeriesModel2.type;
          return _this;
        }
        FunnelSeriesModel2.prototype.init = function(option) {
          _super.prototype.init.apply(this, arguments);
          this.legendVisualProvider = new LegendVisualProvider(bind$2(this.getData, this), bind$2(this.getRawData, this));
          this._defaultLabelLine(option);
        };
        FunnelSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesDataSimply(this, {
            coordDimensions: ["value"],
            encodeDefaulter: curry$1(makeSeriesEncodeForNameBased, this)
          });
        };
        FunnelSeriesModel2.prototype._defaultLabelLine = function(option) {
          defaultEmphasis(option, "labelLine", ["show"]);
          var labelLineNormalOpt = option.labelLine;
          var labelLineEmphasisOpt = option.emphasis.labelLine;
          labelLineNormalOpt.show = labelLineNormalOpt.show && option.label.show;
          labelLineEmphasisOpt.show = labelLineEmphasisOpt.show && option.emphasis.label.show;
        };
        FunnelSeriesModel2.prototype.getDataParams = function(dataIndex) {
          var data = this.getData();
          var params = _super.prototype.getDataParams.call(this, dataIndex);
          var valueDim = data.mapDimension("value");
          var sum2 = data.getSum(valueDim);
          params.percent = !sum2 ? 0 : +(data.get(valueDim, dataIndex) / sum2 * 100).toFixed(2);
          params.$vars.push("percent");
          return params;
        };
        FunnelSeriesModel2.type = "series.funnel";
        FunnelSeriesModel2.defaultOption = {
          // zlevel: 0,                  // 一级层叠
          z: 2,
          legendHoverLink: true,
          colorBy: "data",
          left: 80,
          top: 60,
          right: 80,
          bottom: 60,
          // width: {totalWidth} - left - right,
          // height: {totalHeight} - top - bottom,
          // 默认取数据最小最大值
          // min: 0,
          // max: 100,
          minSize: "0%",
          maxSize: "100%",
          sort: "descending",
          orient: "vertical",
          gap: 0,
          funnelAlign: "center",
          label: {
            show: true,
            position: "outer"
            // formatter: 标签文本格式器，同Tooltip.formatter，不支持异步回调
          },
          labelLine: {
            show: true,
            length: 20,
            lineStyle: {
              // color: 各异,
              width: 1
            }
          },
          itemStyle: {
            // color: 各异,
            borderColor: "#fff",
            borderWidth: 1
          },
          emphasis: {
            label: {
              show: true
            }
          },
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          }
        };
        return FunnelSeriesModel2;
      }(SeriesModel)
    );
    function getViewRect$2(seriesModel, api2) {
      return getLayoutRect(seriesModel.getBoxLayoutParams(), {
        width: api2.getWidth(),
        height: api2.getHeight()
      });
    }
    function getSortedIndices(data, sort2) {
      var valueDim = data.mapDimension("value");
      var valueArr = data.mapArray(valueDim, function(val) {
        return val;
      });
      var indices = [];
      var isAscending = sort2 === "ascending";
      for (var i2 = 0, len2 = data.count(); i2 < len2; i2++) {
        indices[i2] = i2;
      }
      if (isFunction$1(sort2)) {
        indices.sort(sort2);
      } else if (sort2 !== "none") {
        indices.sort(function(a2, b2) {
          return isAscending ? valueArr[a2] - valueArr[b2] : valueArr[b2] - valueArr[a2];
        });
      }
      return indices;
    }
    function labelLayout(data) {
      var seriesModel = data.hostModel;
      var orient = seriesModel.get("orient");
      data.each(function(idx) {
        var itemModel = data.getItemModel(idx);
        var labelModel = itemModel.getModel("label");
        var labelPosition = labelModel.get("position");
        var labelLineModel = itemModel.getModel("labelLine");
        var layout2 = data.getItemLayout(idx);
        var points2 = layout2.points;
        var isLabelInside = labelPosition === "inner" || labelPosition === "inside" || labelPosition === "center" || labelPosition === "insideLeft" || labelPosition === "insideRight";
        var textAlign2;
        var textX;
        var textY;
        var linePoints;
        if (isLabelInside) {
          if (labelPosition === "insideLeft") {
            textX = (points2[0][0] + points2[3][0]) / 2 + 5;
            textY = (points2[0][1] + points2[3][1]) / 2;
            textAlign2 = "left";
          } else if (labelPosition === "insideRight") {
            textX = (points2[1][0] + points2[2][0]) / 2 - 5;
            textY = (points2[1][1] + points2[2][1]) / 2;
            textAlign2 = "right";
          } else {
            textX = (points2[0][0] + points2[1][0] + points2[2][0] + points2[3][0]) / 4;
            textY = (points2[0][1] + points2[1][1] + points2[2][1] + points2[3][1]) / 4;
            textAlign2 = "center";
          }
          linePoints = [[textX, textY], [textX, textY]];
        } else {
          var x1 = void 0;
          var y1 = void 0;
          var x2 = void 0;
          var y2 = void 0;
          var labelLineLen = labelLineModel.get("length");
          if (labelPosition === "left") {
            x1 = (points2[3][0] + points2[0][0]) / 2;
            y1 = (points2[3][1] + points2[0][1]) / 2;
            x2 = x1 - labelLineLen;
            textX = x2 - 5;
            textAlign2 = "right";
          } else if (labelPosition === "right") {
            x1 = (points2[1][0] + points2[2][0]) / 2;
            y1 = (points2[1][1] + points2[2][1]) / 2;
            x2 = x1 + labelLineLen;
            textX = x2 + 5;
            textAlign2 = "left";
          } else if (labelPosition === "top") {
            x1 = (points2[3][0] + points2[0][0]) / 2;
            y1 = (points2[3][1] + points2[0][1]) / 2;
            y2 = y1 - labelLineLen;
            textY = y2 - 5;
            textAlign2 = "center";
          } else if (labelPosition === "bottom") {
            x1 = (points2[1][0] + points2[2][0]) / 2;
            y1 = (points2[1][1] + points2[2][1]) / 2;
            y2 = y1 + labelLineLen;
            textY = y2 + 5;
            textAlign2 = "center";
          } else if (labelPosition === "rightTop") {
            x1 = orient === "horizontal" ? points2[3][0] : points2[1][0];
            y1 = orient === "horizontal" ? points2[3][1] : points2[1][1];
            if (orient === "horizontal") {
              y2 = y1 - labelLineLen;
              textY = y2 - 5;
              textAlign2 = "center";
            } else {
              x2 = x1 + labelLineLen;
              textX = x2 + 5;
              textAlign2 = "top";
            }
          } else if (labelPosition === "rightBottom") {
            x1 = points2[2][0];
            y1 = points2[2][1];
            if (orient === "horizontal") {
              y2 = y1 + labelLineLen;
              textY = y2 + 5;
              textAlign2 = "center";
            } else {
              x2 = x1 + labelLineLen;
              textX = x2 + 5;
              textAlign2 = "bottom";
            }
          } else if (labelPosition === "leftTop") {
            x1 = points2[0][0];
            y1 = orient === "horizontal" ? points2[0][1] : points2[1][1];
            if (orient === "horizontal") {
              y2 = y1 - labelLineLen;
              textY = y2 - 5;
              textAlign2 = "center";
            } else {
              x2 = x1 - labelLineLen;
              textX = x2 - 5;
              textAlign2 = "right";
            }
          } else if (labelPosition === "leftBottom") {
            x1 = orient === "horizontal" ? points2[1][0] : points2[3][0];
            y1 = orient === "horizontal" ? points2[1][1] : points2[2][1];
            if (orient === "horizontal") {
              y2 = y1 + labelLineLen;
              textY = y2 + 5;
              textAlign2 = "center";
            } else {
              x2 = x1 - labelLineLen;
              textX = x2 - 5;
              textAlign2 = "right";
            }
          } else {
            x1 = (points2[1][0] + points2[2][0]) / 2;
            y1 = (points2[1][1] + points2[2][1]) / 2;
            if (orient === "horizontal") {
              y2 = y1 + labelLineLen;
              textY = y2 + 5;
              textAlign2 = "center";
            } else {
              x2 = x1 + labelLineLen;
              textX = x2 + 5;
              textAlign2 = "left";
            }
          }
          if (orient === "horizontal") {
            x2 = x1;
            textX = x2;
          } else {
            y2 = y1;
            textY = y2;
          }
          linePoints = [[x1, y1], [x2, y2]];
        }
        layout2.label = {
          linePoints,
          x: textX,
          y: textY,
          verticalAlign: "middle",
          textAlign: textAlign2,
          inside: isLabelInside
        };
      });
    }
    function funnelLayout(ecModel, api2) {
      ecModel.eachSeriesByType("funnel", function(seriesModel) {
        var data = seriesModel.getData();
        var valueDim = data.mapDimension("value");
        var sort2 = seriesModel.get("sort");
        var viewRect2 = getViewRect$2(seriesModel, api2);
        var orient = seriesModel.get("orient");
        var viewWidth = viewRect2.width;
        var viewHeight = viewRect2.height;
        var indices = getSortedIndices(data, sort2);
        var x2 = viewRect2.x;
        var y = viewRect2.y;
        var sizeExtent = orient === "horizontal" ? [parsePercent(seriesModel.get("minSize"), viewHeight), parsePercent(seriesModel.get("maxSize"), viewHeight)] : [parsePercent(seriesModel.get("minSize"), viewWidth), parsePercent(seriesModel.get("maxSize"), viewWidth)];
        var dataExtent = data.getDataExtent(valueDim);
        var min3 = seriesModel.get("min");
        var max3 = seriesModel.get("max");
        if (min3 == null) {
          min3 = Math.min(dataExtent[0], 0);
        }
        if (max3 == null) {
          max3 = dataExtent[1];
        }
        var funnelAlign = seriesModel.get("funnelAlign");
        var gap = seriesModel.get("gap");
        var viewSize = orient === "horizontal" ? viewWidth : viewHeight;
        var itemSize2 = (viewSize - gap * (data.count() - 1)) / data.count();
        var getLinePoints = function(idx2, offset2) {
          if (orient === "horizontal") {
            var val_1 = data.get(valueDim, idx2) || 0;
            var itemHeight = linearMap$2(val_1, [min3, max3], sizeExtent, true);
            var y0 = void 0;
            switch (funnelAlign) {
              case "top":
                y0 = y;
                break;
              case "center":
                y0 = y + (viewHeight - itemHeight) / 2;
                break;
              case "bottom":
                y0 = y + (viewHeight - itemHeight);
                break;
            }
            return [[offset2, y0], [offset2, y0 + itemHeight]];
          }
          var val = data.get(valueDim, idx2) || 0;
          var itemWidth = linearMap$2(val, [min3, max3], sizeExtent, true);
          var x0;
          switch (funnelAlign) {
            case "left":
              x0 = x2;
              break;
            case "center":
              x0 = x2 + (viewWidth - itemWidth) / 2;
              break;
            case "right":
              x0 = x2 + viewWidth - itemWidth;
              break;
          }
          return [[x0, offset2], [x0 + itemWidth, offset2]];
        };
        if (sort2 === "ascending") {
          itemSize2 = -itemSize2;
          gap = -gap;
          if (orient === "horizontal") {
            x2 += viewWidth;
          } else {
            y += viewHeight;
          }
          indices = indices.reverse();
        }
        for (var i2 = 0; i2 < indices.length; i2++) {
          var idx = indices[i2];
          var nextIdx = indices[i2 + 1];
          var itemModel = data.getItemModel(idx);
          if (orient === "horizontal") {
            var width = itemModel.get(["itemStyle", "width"]);
            if (width == null) {
              width = itemSize2;
            } else {
              width = parsePercent(width, viewWidth);
              if (sort2 === "ascending") {
                width = -width;
              }
            }
            var start2 = getLinePoints(idx, x2);
            var end2 = getLinePoints(nextIdx, x2 + width);
            x2 += width + gap;
            data.setItemLayout(idx, {
              points: start2.concat(end2.slice().reverse())
            });
          } else {
            var height = itemModel.get(["itemStyle", "height"]);
            if (height == null) {
              height = itemSize2;
            } else {
              height = parsePercent(height, viewHeight);
              if (sort2 === "ascending") {
                height = -height;
              }
            }
            var start2 = getLinePoints(idx, y);
            var end2 = getLinePoints(nextIdx, y + height);
            y += height + gap;
            data.setItemLayout(idx, {
              points: start2.concat(end2.slice().reverse())
            });
          }
        }
        labelLayout(data);
      });
    }
    function install$D(registers) {
      registers.registerChartView(FunnelView);
      registers.registerSeriesModel(FunnelSeriesModel);
      registers.registerLayout(funnelLayout);
      registers.registerProcessor(dataFilter$1("funnel"));
    }
    var DEFAULT_SMOOTH = 0.3;
    var ParallelView$1 = (
      /** @class */
      function(_super) {
        __extends$1(ParallelView2, _super);
        function ParallelView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelView2.type;
          _this._dataGroup = new Group$3();
          _this._initialized = false;
          return _this;
        }
        ParallelView2.prototype.init = function() {
          this.group.add(this._dataGroup);
        };
        ParallelView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
          this._progressiveEls = null;
          var dataGroup = this._dataGroup;
          var data = seriesModel.getData();
          var oldData = this._data;
          var coordSys = seriesModel.coordinateSystem;
          var dimensions = coordSys.dimensions;
          var seriesScope = makeSeriesScope(seriesModel);
          data.diff(oldData).add(add2).update(update).remove(remove2).execute();
          function add2(newDataIndex) {
            var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);
            updateElCommon(line, data, newDataIndex, seriesScope);
          }
          function update(newDataIndex, oldDataIndex) {
            var line = oldData.getItemGraphicEl(oldDataIndex);
            var points2 = createLinePoints(data, newDataIndex, dimensions, coordSys);
            data.setItemGraphicEl(newDataIndex, line);
            updateProps$1(line, {
              shape: {
                points: points2
              }
            }, seriesModel, newDataIndex);
            saveOldStyle(line);
            updateElCommon(line, data, newDataIndex, seriesScope);
          }
          function remove2(oldDataIndex) {
            var line = oldData.getItemGraphicEl(oldDataIndex);
            dataGroup.remove(line);
          }
          if (!this._initialized) {
            this._initialized = true;
            var clipPath = createGridClipShape$2(coordSys, seriesModel, function() {
              setTimeout(function() {
                dataGroup.removeClipPath();
              });
            });
            dataGroup.setClipPath(clipPath);
          }
          this._data = data;
        };
        ParallelView2.prototype.incrementalPrepareRender = function(seriesModel, ecModel, api2) {
          this._initialized = true;
          this._data = null;
          this._dataGroup.removeAll();
        };
        ParallelView2.prototype.incrementalRender = function(taskParams, seriesModel, ecModel) {
          var data = seriesModel.getData();
          var coordSys = seriesModel.coordinateSystem;
          var dimensions = coordSys.dimensions;
          var seriesScope = makeSeriesScope(seriesModel);
          var progressiveEls = this._progressiveEls = [];
          for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) {
            var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys);
            line.incremental = true;
            updateElCommon(line, data, dataIndex, seriesScope);
            progressiveEls.push(line);
          }
        };
        ParallelView2.prototype.remove = function() {
          this._dataGroup && this._dataGroup.removeAll();
          this._data = null;
        };
        ParallelView2.type = "parallel";
        return ParallelView2;
      }(ChartView)
    );
    function createGridClipShape$2(coordSys, seriesModel, cb) {
      var parallelModel = coordSys.model;
      var rect = coordSys.getRect();
      var rectEl = new Rect$2({
        shape: {
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height
        }
      });
      var dim = parallelModel.get("layout") === "horizontal" ? "width" : "height";
      rectEl.setShape(dim, 0);
      initProps(rectEl, {
        shape: {
          width: rect.width,
          height: rect.height
        }
      }, seriesModel, cb);
      return rectEl;
    }
    function createLinePoints(data, dataIndex, dimensions, coordSys) {
      var points2 = [];
      for (var i2 = 0; i2 < dimensions.length; i2++) {
        var dimName = dimensions[i2];
        var value = data.get(data.mapDimension(dimName), dataIndex);
        if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) {
          points2.push(coordSys.dataToPoint(value, dimName));
        }
      }
      return points2;
    }
    function addEl(data, dataGroup, dataIndex, dimensions, coordSys) {
      var points2 = createLinePoints(data, dataIndex, dimensions, coordSys);
      var line = new Polyline$1({
        shape: {
          points: points2
        },
        // silent: true,
        z2: 10
      });
      dataGroup.add(line);
      data.setItemGraphicEl(dataIndex, line);
      return line;
    }
    function makeSeriesScope(seriesModel) {
      var smooth = seriesModel.get("smooth", true);
      smooth === true && (smooth = DEFAULT_SMOOTH);
      smooth = numericToNumber(smooth);
      eqNaN(smooth) && (smooth = 0);
      return {
        smooth
      };
    }
    function updateElCommon(el, data, dataIndex, seriesScope) {
      el.useStyle(data.getItemVisual(dataIndex, "style"));
      el.style.fill = null;
      el.setShape("smooth", seriesScope.smooth);
      var itemModel = data.getItemModel(dataIndex);
      var emphasisModel = itemModel.getModel("emphasis");
      setStatesStylesFromModel(el, itemModel, "lineStyle");
      toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
    }
    function isEmptyValue(val, axisType) {
      return axisType === "category" ? val == null : val == null || isNaN(val);
    }
    var ParallelSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(ParallelSeriesModel2, _super);
        function ParallelSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelSeriesModel2.type;
          _this.visualStyleAccessPath = "lineStyle";
          _this.visualDrawType = "stroke";
          return _this;
        }
        ParallelSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this, {
            useEncodeDefaulter: bind$2(makeDefaultEncode, null, this)
          });
        };
        ParallelSeriesModel2.prototype.getRawIndicesByActiveState = function(activeState) {
          var coordSys = this.coordinateSystem;
          var data = this.getData();
          var indices = [];
          coordSys.eachActiveState(data, function(theActiveState, dataIndex) {
            if (activeState === theActiveState) {
              indices.push(data.getRawIndex(dataIndex));
            }
          });
          return indices;
        };
        ParallelSeriesModel2.type = "series.parallel";
        ParallelSeriesModel2.dependencies = ["parallel"];
        ParallelSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "parallel",
          parallelIndex: 0,
          label: {
            show: false
          },
          inactiveOpacity: 0.05,
          activeOpacity: 1,
          lineStyle: {
            width: 1,
            opacity: 0.45,
            type: "solid"
          },
          emphasis: {
            label: {
              show: false
            }
          },
          progressive: 500,
          smooth: false,
          animationEasing: "linear"
        };
        return ParallelSeriesModel2;
      }(SeriesModel)
    );
    function makeDefaultEncode(seriesModel) {
      var parallelModel = seriesModel.ecModel.getComponent("parallel", seriesModel.get("parallelIndex"));
      if (!parallelModel) {
        return;
      }
      var encodeDefine = {};
      each$f(parallelModel.dimensions, function(axisDim) {
        var dataDimIndex = convertDimNameToNumber(axisDim);
        encodeDefine[axisDim] = dataDimIndex;
      });
      return encodeDefine;
    }
    function convertDimNameToNumber(dimName) {
      return +dimName.replace("dim", "");
    }
    var opacityAccessPath = ["lineStyle", "opacity"];
    var parallelVisual = {
      seriesType: "parallel",
      reset: function(seriesModel, ecModel) {
        var coordSys = seriesModel.coordinateSystem;
        var opacityMap = {
          normal: seriesModel.get(["lineStyle", "opacity"]),
          active: seriesModel.get("activeOpacity"),
          inactive: seriesModel.get("inactiveOpacity")
        };
        return {
          progress: function(params, data) {
            coordSys.eachActiveState(data, function(activeState, dataIndex) {
              var opacity2 = opacityMap[activeState];
              if (activeState === "normal" && data.hasItemOption) {
                var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath, true);
                itemOpacity != null && (opacity2 = itemOpacity);
              }
              var existsStyle = data.ensureUniqueItemVisual(dataIndex, "style");
              existsStyle.opacity = opacity2;
            }, params.start, params.end);
          }
        };
      }
    };
    function parallelPreprocessor(option) {
      createParallelIfNeeded(option);
      mergeAxisOptionFromParallel(option);
    }
    function createParallelIfNeeded(option) {
      if (option.parallel) {
        return;
      }
      var hasParallelSeries = false;
      each$f(option.series, function(seriesOpt) {
        if (seriesOpt && seriesOpt.type === "parallel") {
          hasParallelSeries = true;
        }
      });
      if (hasParallelSeries) {
        option.parallel = [{}];
      }
    }
    function mergeAxisOptionFromParallel(option) {
      var axes = normalizeToArray(option.parallelAxis);
      each$f(axes, function(axisOption) {
        if (!isObject$5(axisOption)) {
          return;
        }
        var parallelIndex = axisOption.parallelIndex || 0;
        var parallelOption = normalizeToArray(option.parallel)[parallelIndex];
        if (parallelOption && parallelOption.parallelAxisDefault) {
          merge$1(axisOption, parallelOption.parallelAxisDefault, false);
        }
      });
    }
    var CLICK_THRESHOLD = 5;
    var ParallelView = (
      /** @class */
      function(_super) {
        __extends$1(ParallelView2, _super);
        function ParallelView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelView2.type;
          return _this;
        }
        ParallelView2.prototype.render = function(parallelModel, ecModel, api2) {
          this._model = parallelModel;
          this._api = api2;
          if (!this._handlers) {
            this._handlers = {};
            each$f(handlers$1, function(handler, eventName) {
              api2.getZr().on(eventName, this._handlers[eventName] = bind$2(handler, this));
            }, this);
          }
          createOrUpdate(this, "_throttledDispatchExpand", parallelModel.get("axisExpandRate"), "fixRate");
        };
        ParallelView2.prototype.dispose = function(ecModel, api2) {
          clear$1(this, "_throttledDispatchExpand");
          each$f(this._handlers, function(handler, eventName) {
            api2.getZr().off(eventName, handler);
          });
          this._handlers = null;
        };
        ParallelView2.prototype._throttledDispatchExpand = function(opt) {
          this._dispatchExpand(opt);
        };
        ParallelView2.prototype._dispatchExpand = function(opt) {
          opt && this._api.dispatchAction(extend$1({
            type: "parallelAxisExpand"
          }, opt));
        };
        ParallelView2.type = "parallel";
        return ParallelView2;
      }(ComponentView)
    );
    var handlers$1 = {
      mousedown: function(e2) {
        if (checkTrigger(this, "click")) {
          this._mouseDownPoint = [e2.offsetX, e2.offsetY];
        }
      },
      mouseup: function(e2) {
        var mouseDownPoint = this._mouseDownPoint;
        if (checkTrigger(this, "click") && mouseDownPoint) {
          var point = [e2.offsetX, e2.offsetY];
          var dist2 = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);
          if (dist2 > CLICK_THRESHOLD) {
            return;
          }
          var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e2.offsetX, e2.offsetY]);
          result.behavior !== "none" && this._dispatchExpand({
            axisExpandWindow: result.axisExpandWindow
          });
        }
        this._mouseDownPoint = null;
      },
      mousemove: function(e2) {
        if (this._mouseDownPoint || !checkTrigger(this, "mousemove")) {
          return;
        }
        var model = this._model;
        var result = model.coordinateSystem.getSlidedAxisExpandWindow([e2.offsetX, e2.offsetY]);
        var behavior = result.behavior;
        behavior === "jump" && this._throttledDispatchExpand.debounceNextCall(model.get("axisExpandDebounce"));
        this._throttledDispatchExpand(behavior === "none" ? null : {
          axisExpandWindow: result.axisExpandWindow,
          // Jumping uses animation, and sliding suppresses animation.
          animation: behavior === "jump" ? null : {
            duration: 0
            // Disable animation.
          }
        });
      }
    };
    function checkTrigger(view, triggerOn) {
      var model = view._model;
      return model.get("axisExpandable") && model.get("axisExpandTriggerOn") === triggerOn;
    }
    var ParallelModel = (
      /** @class */
      function(_super) {
        __extends$1(ParallelModel2, _super);
        function ParallelModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelModel2.type;
          return _this;
        }
        ParallelModel2.prototype.init = function() {
          _super.prototype.init.apply(this, arguments);
          this.mergeOption({});
        };
        ParallelModel2.prototype.mergeOption = function(newOption) {
          var thisOption = this.option;
          newOption && merge$1(thisOption, newOption, true);
          this._initDimensions();
        };
        ParallelModel2.prototype.contains = function(model, ecModel) {
          var parallelIndex = model.get("parallelIndex");
          return parallelIndex != null && ecModel.getComponent("parallel", parallelIndex) === this;
        };
        ParallelModel2.prototype.setAxisExpand = function(opt) {
          each$f(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function(name) {
            if (opt.hasOwnProperty(name)) {
              this.option[name] = opt[name];
            }
          }, this);
        };
        ParallelModel2.prototype._initDimensions = function() {
          var dimensions = this.dimensions = [];
          var parallelAxisIndex = this.parallelAxisIndex = [];
          var axisModels = filter(this.ecModel.queryComponents({
            mainType: "parallelAxis"
          }), function(axisModel) {
            return (axisModel.get("parallelIndex") || 0) === this.componentIndex;
          }, this);
          each$f(axisModels, function(axisModel) {
            dimensions.push("dim" + axisModel.get("dim"));
            parallelAxisIndex.push(axisModel.componentIndex);
          });
        };
        ParallelModel2.type = "parallel";
        ParallelModel2.dependencies = ["parallelAxis"];
        ParallelModel2.layoutMode = "box";
        ParallelModel2.defaultOption = {
          // zlevel: 0,
          z: 0,
          left: 80,
          top: 60,
          right: 80,
          bottom: 60,
          // width: {totalWidth} - left - right,
          // height: {totalHeight} - top - bottom,
          layout: "horizontal",
          // FIXME
          // naming?
          axisExpandable: false,
          axisExpandCenter: null,
          axisExpandCount: 0,
          axisExpandWidth: 50,
          axisExpandRate: 17,
          axisExpandDebounce: 50,
          // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full.
          // Do not doc to user until necessary.
          axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4],
          axisExpandTriggerOn: "click",
          parallelAxisDefault: null
        };
        return ParallelModel2;
      }(ComponentModel)
    );
    var ParallelAxis = (
      /** @class */
      function(_super) {
        __extends$1(ParallelAxis2, _super);
        function ParallelAxis2(dim, scale2, coordExtent, axisType, axisIndex) {
          var _this = _super.call(this, dim, scale2, coordExtent) || this;
          _this.type = axisType || "value";
          _this.axisIndex = axisIndex;
          return _this;
        }
        ParallelAxis2.prototype.isHorizontal = function() {
          return this.coordinateSystem.getModel().get("layout") !== "horizontal";
        };
        return ParallelAxis2;
      }(Axis)
    );
    function sliderMove(delta, handleEnds, extent3, handleIndex, minSpan, maxSpan) {
      delta = delta || 0;
      var extentSpan = extent3[1] - extent3[0];
      if (minSpan != null) {
        minSpan = restrict$1(minSpan, [0, extentSpan]);
      }
      if (maxSpan != null) {
        maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0);
      }
      if (handleIndex === "all") {
        var handleSpan = Math.abs(handleEnds[1] - handleEnds[0]);
        handleSpan = restrict$1(handleSpan, [0, extentSpan]);
        minSpan = maxSpan = restrict$1(handleSpan, [minSpan, maxSpan]);
        handleIndex = 0;
      }
      handleEnds[0] = restrict$1(handleEnds[0], extent3);
      handleEnds[1] = restrict$1(handleEnds[1], extent3);
      var originalDistSign = getSpanSign(handleEnds, handleIndex);
      handleEnds[handleIndex] += delta;
      var extentMinSpan = minSpan || 0;
      var realExtent = extent3.slice();
      originalDistSign.sign < 0 ? realExtent[0] += extentMinSpan : realExtent[1] -= extentMinSpan;
      handleEnds[handleIndex] = restrict$1(handleEnds[handleIndex], realExtent);
      var currDistSign;
      currDistSign = getSpanSign(handleEnds, handleIndex);
      if (minSpan != null && (currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan)) {
        handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan;
      }
      currDistSign = getSpanSign(handleEnds, handleIndex);
      if (maxSpan != null && currDistSign.span > maxSpan) {
        handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan;
      }
      return handleEnds;
    }
    function getSpanSign(handleEnds, handleIndex) {
      var dist2 = handleEnds[handleIndex] - handleEnds[1 - handleIndex];
      return {
        span: Math.abs(dist2),
        sign: dist2 > 0 ? -1 : dist2 < 0 ? 1 : handleIndex ? -1 : 1
      };
    }
    function restrict$1(value, extend2) {
      return Math.min(extend2[1] != null ? extend2[1] : Infinity, Math.max(extend2[0] != null ? extend2[0] : -Infinity, value));
    }
    var each$a = each$f;
    var mathMin$2 = Math.min;
    var mathMax$2 = Math.max;
    var mathFloor = Math.floor;
    var mathCeil = Math.ceil;
    var round = round$3;
    var PI$1 = Math.PI;
    var Parallel = (
      /** @class */
      function() {
        function Parallel2(parallelModel, ecModel, api2) {
          this.type = "parallel";
          this._axesMap = createHashMap();
          this._axesLayout = {};
          this.dimensions = parallelModel.dimensions;
          this._model = parallelModel;
          this._init(parallelModel, ecModel, api2);
        }
        Parallel2.prototype._init = function(parallelModel, ecModel, api2) {
          var dimensions = parallelModel.dimensions;
          var parallelAxisIndex = parallelModel.parallelAxisIndex;
          each$a(dimensions, function(dim, idx) {
            var axisIndex = parallelAxisIndex[idx];
            var axisModel = ecModel.getComponent("parallelAxis", axisIndex);
            var axis = this._axesMap.set(dim, new ParallelAxis(dim, createScaleByModel$1(axisModel), [0, 0], axisModel.get("type"), axisIndex));
            var isCategory2 = axis.type === "category";
            axis.onBand = isCategory2 && axisModel.get("boundaryGap");
            axis.inverse = axisModel.get("inverse");
            axisModel.axis = axis;
            axis.model = axisModel;
            axis.coordinateSystem = axisModel.coordinateSystem = this;
          }, this);
        };
        Parallel2.prototype.update = function(ecModel, api2) {
          this._updateAxesFromSeries(this._model, ecModel);
        };
        Parallel2.prototype.containPoint = function(point) {
          var layoutInfo = this._makeLayoutInfo();
          var axisBase = layoutInfo.axisBase;
          var layoutBase = layoutInfo.layoutBase;
          var pixelDimIndex = layoutInfo.pixelDimIndex;
          var pAxis = point[1 - pixelDimIndex];
          var pLayout = point[pixelDimIndex];
          return pAxis >= axisBase && pAxis <= axisBase + layoutInfo.axisLength && pLayout >= layoutBase && pLayout <= layoutBase + layoutInfo.layoutLength;
        };
        Parallel2.prototype.getModel = function() {
          return this._model;
        };
        Parallel2.prototype._updateAxesFromSeries = function(parallelModel, ecModel) {
          ecModel.eachSeries(function(seriesModel) {
            if (!parallelModel.contains(seriesModel, ecModel)) {
              return;
            }
            var data = seriesModel.getData();
            each$a(this.dimensions, function(dim) {
              var axis = this._axesMap.get(dim);
              axis.scale.unionExtentFromData(data, data.mapDimension(dim));
              niceScaleExtent(axis.scale, axis.model);
            }, this);
          }, this);
        };
        Parallel2.prototype.resize = function(parallelModel, api2) {
          this._rect = getLayoutRect(parallelModel.getBoxLayoutParams(), {
            width: api2.getWidth(),
            height: api2.getHeight()
          });
          this._layoutAxes();
        };
        Parallel2.prototype.getRect = function() {
          return this._rect;
        };
        Parallel2.prototype._makeLayoutInfo = function() {
          var parallelModel = this._model;
          var rect = this._rect;
          var xy = ["x", "y"];
          var wh = ["width", "height"];
          var layout2 = parallelModel.get("layout");
          var pixelDimIndex = layout2 === "horizontal" ? 0 : 1;
          var layoutLength = rect[wh[pixelDimIndex]];
          var layoutExtent = [0, layoutLength];
          var axisCount = this.dimensions.length;
          var axisExpandWidth = restrict(parallelModel.get("axisExpandWidth"), layoutExtent);
          var axisExpandCount = restrict(parallelModel.get("axisExpandCount") || 0, [0, axisCount]);
          var axisExpandable = parallelModel.get("axisExpandable") && axisCount > 3 && axisCount > axisExpandCount && axisExpandCount > 1 && axisExpandWidth > 0 && layoutLength > 0;
          var axisExpandWindow = parallelModel.get("axisExpandWindow");
          var winSize;
          if (!axisExpandWindow) {
            winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent);
            var axisExpandCenter = parallelModel.get("axisExpandCenter") || mathFloor(axisCount / 2);
            axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2];
            axisExpandWindow[1] = axisExpandWindow[0] + winSize;
          } else {
            winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent);
            axisExpandWindow[1] = axisExpandWindow[0] + winSize;
          }
          var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount);
          axisCollapseWidth < 3 && (axisCollapseWidth = 0);
          var winInnerIndices = [mathFloor(round(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, mathCeil(round(axisExpandWindow[1] / axisExpandWidth, 1)) - 1];
          var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0];
          return {
            layout: layout2,
            pixelDimIndex,
            layoutBase: rect[xy[pixelDimIndex]],
            layoutLength,
            axisBase: rect[xy[1 - pixelDimIndex]],
            axisLength: rect[wh[1 - pixelDimIndex]],
            axisExpandable,
            axisExpandWidth,
            axisCollapseWidth,
            axisExpandWindow,
            axisCount,
            winInnerIndices,
            axisExpandWindow0Pos
          };
        };
        Parallel2.prototype._layoutAxes = function() {
          var rect = this._rect;
          var axes = this._axesMap;
          var dimensions = this.dimensions;
          var layoutInfo = this._makeLayoutInfo();
          var layout2 = layoutInfo.layout;
          axes.each(function(axis) {
            var axisExtent = [0, layoutInfo.axisLength];
            var idx = axis.inverse ? 1 : 0;
            axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);
          });
          each$a(dimensions, function(dim, idx) {
            var posInfo = (layoutInfo.axisExpandable ? layoutAxisWithExpand : layoutAxisWithoutExpand)(idx, layoutInfo);
            var positionTable = {
              horizontal: {
                x: posInfo.position,
                y: layoutInfo.axisLength
              },
              vertical: {
                x: 0,
                y: posInfo.position
              }
            };
            var rotationTable = {
              horizontal: PI$1 / 2,
              vertical: 0
            };
            var position2 = [positionTable[layout2].x + rect.x, positionTable[layout2].y + rect.y];
            var rotation = rotationTable[layout2];
            var transform2 = create$1();
            rotate(transform2, transform2, rotation);
            translate(transform2, transform2, position2);
            this._axesLayout[dim] = {
              position: position2,
              rotation,
              transform: transform2,
              axisNameAvailableWidth: posInfo.axisNameAvailableWidth,
              axisLabelShow: posInfo.axisLabelShow,
              nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth,
              tickDirection: 1,
              labelDirection: 1
            };
          }, this);
        };
        Parallel2.prototype.getAxis = function(dim) {
          return this._axesMap.get(dim);
        };
        Parallel2.prototype.dataToPoint = function(value, dim) {
          return this.axisCoordToPoint(this._axesMap.get(dim).dataToCoord(value), dim);
        };
        Parallel2.prototype.eachActiveState = function(data, callback, start2, end2) {
          start2 == null && (start2 = 0);
          end2 == null && (end2 = data.count());
          var axesMap = this._axesMap;
          var dimensions = this.dimensions;
          var dataDimensions = [];
          var axisModels = [];
          each$f(dimensions, function(axisDim) {
            dataDimensions.push(data.mapDimension(axisDim));
            axisModels.push(axesMap.get(axisDim).model);
          });
          var hasActiveSet = this.hasAxisBrushed();
          for (var dataIndex = start2; dataIndex < end2; dataIndex++) {
            var activeState = void 0;
            if (!hasActiveSet) {
              activeState = "normal";
            } else {
              activeState = "active";
              var values = data.getValues(dataDimensions, dataIndex);
              for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
                var state = axisModels[j].getActiveState(values[j]);
                if (state === "inactive") {
                  activeState = "inactive";
                  break;
                }
              }
            }
            callback(activeState, dataIndex);
          }
        };
        Parallel2.prototype.hasAxisBrushed = function() {
          var dimensions = this.dimensions;
          var axesMap = this._axesMap;
          var hasActiveSet = false;
          for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
            if (axesMap.get(dimensions[j]).model.getActiveState() !== "normal") {
              hasActiveSet = true;
            }
          }
          return hasActiveSet;
        };
        Parallel2.prototype.axisCoordToPoint = function(coord, dim) {
          var axisLayout = this._axesLayout[dim];
          return applyTransform([coord, 0], axisLayout.transform);
        };
        Parallel2.prototype.getAxisLayout = function(dim) {
          return clone$4(this._axesLayout[dim]);
        };
        Parallel2.prototype.getSlidedAxisExpandWindow = function(point) {
          var layoutInfo = this._makeLayoutInfo();
          var pixelDimIndex = layoutInfo.pixelDimIndex;
          var axisExpandWindow = layoutInfo.axisExpandWindow.slice();
          var winSize = axisExpandWindow[1] - axisExpandWindow[0];
          var extent3 = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)];
          if (!this.containPoint(point)) {
            return {
              behavior: "none",
              axisExpandWindow
            };
          }
          var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos;
          var delta;
          var behavior = "slide";
          var axisCollapseWidth = layoutInfo.axisCollapseWidth;
          var triggerArea = this._model.get("axisExpandSlideTriggerArea");
          var useJump = triggerArea[0] != null;
          if (axisCollapseWidth) {
            if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) {
              behavior = "jump";
              delta = pointCoord - winSize * triggerArea[2];
            } else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) {
              behavior = "jump";
              delta = pointCoord - winSize * (1 - triggerArea[2]);
            } else {
              (delta = pointCoord - winSize * triggerArea[1]) >= 0 && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 && (delta = 0);
            }
            delta *= layoutInfo.axisExpandWidth / axisCollapseWidth;
            delta ? sliderMove(delta, axisExpandWindow, extent3, "all") : behavior = "none";
          } else {
            var winSize2 = axisExpandWindow[1] - axisExpandWindow[0];
            var pos = extent3[1] * pointCoord / winSize2;
            axisExpandWindow = [mathMax$2(0, pos - winSize2 / 2)];
            axisExpandWindow[1] = mathMin$2(extent3[1], axisExpandWindow[0] + winSize2);
            axisExpandWindow[0] = axisExpandWindow[1] - winSize2;
          }
          return {
            axisExpandWindow,
            behavior
          };
        };
        return Parallel2;
      }()
    );
    function restrict(len2, extent3) {
      return mathMin$2(mathMax$2(len2, extent3[0]), extent3[1]);
    }
    function layoutAxisWithoutExpand(axisIndex, layoutInfo) {
      var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1);
      return {
        position: step * axisIndex,
        axisNameAvailableWidth: step,
        axisLabelShow: true
      };
    }
    function layoutAxisWithExpand(axisIndex, layoutInfo) {
      var layoutLength = layoutInfo.layoutLength;
      var axisExpandWidth = layoutInfo.axisExpandWidth;
      var axisCount = layoutInfo.axisCount;
      var axisCollapseWidth = layoutInfo.axisCollapseWidth;
      var winInnerIndices = layoutInfo.winInnerIndices;
      var position2;
      var axisNameAvailableWidth = axisCollapseWidth;
      var axisLabelShow = false;
      var nameTruncateMaxWidth;
      if (axisIndex < winInnerIndices[0]) {
        position2 = axisIndex * axisCollapseWidth;
        nameTruncateMaxWidth = axisCollapseWidth;
      } else if (axisIndex <= winInnerIndices[1]) {
        position2 = layoutInfo.axisExpandWindow0Pos + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0];
        axisNameAvailableWidth = axisExpandWidth;
        axisLabelShow = true;
      } else {
        position2 = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth;
        nameTruncateMaxWidth = axisCollapseWidth;
      }
      return {
        position: position2,
        axisNameAvailableWidth,
        axisLabelShow,
        nameTruncateMaxWidth
      };
    }
    function createParallelCoordSys(ecModel, api2) {
      var coordSysList = [];
      ecModel.eachComponent("parallel", function(parallelModel, idx) {
        var coordSys = new Parallel(parallelModel, ecModel, api2);
        coordSys.name = "parallel_" + idx;
        coordSys.resize(parallelModel, api2);
        parallelModel.coordinateSystem = coordSys;
        coordSys.model = parallelModel;
        coordSysList.push(coordSys);
      });
      ecModel.eachSeries(function(seriesModel) {
        if (seriesModel.get("coordinateSystem") === "parallel") {
          var parallelModel = seriesModel.getReferringComponents("parallel", SINGLE_REFERRING).models[0];
          seriesModel.coordinateSystem = parallelModel.coordinateSystem;
        }
      });
      return coordSysList;
    }
    var parallelCoordSysCreator = {
      create: createParallelCoordSys
    };
    var ParallelAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(ParallelAxisModel2, _super);
        function ParallelAxisModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelAxisModel2.type;
          _this.activeIntervals = [];
          return _this;
        }
        ParallelAxisModel2.prototype.getAreaSelectStyle = function() {
          return makeStyleMapper([
            ["fill", "color"],
            ["lineWidth", "borderWidth"],
            ["stroke", "borderColor"],
            ["width", "width"],
            ["opacity", "opacity"]
            // Option decal is in `DecalObject` but style.decal is in `PatternObject`.
            // So do not transfer decal directly.
          ])(this.getModel("areaSelectStyle"));
        };
        ParallelAxisModel2.prototype.setActiveIntervals = function(intervals) {
          var activeIntervals = this.activeIntervals = clone$4(intervals);
          if (activeIntervals) {
            for (var i2 = activeIntervals.length - 1; i2 >= 0; i2--) {
              asc$2(activeIntervals[i2]);
            }
          }
        };
        ParallelAxisModel2.prototype.getActiveState = function(value) {
          var activeIntervals = this.activeIntervals;
          if (!activeIntervals.length) {
            return "normal";
          }
          if (value == null || isNaN(+value)) {
            return "inactive";
          }
          if (activeIntervals.length === 1) {
            var interval = activeIntervals[0];
            if (interval[0] <= value && value <= interval[1]) {
              return "active";
            }
          } else {
            for (var i2 = 0, len2 = activeIntervals.length; i2 < len2; i2++) {
              if (activeIntervals[i2][0] <= value && value <= activeIntervals[i2][1]) {
                return "active";
              }
            }
          }
          return "inactive";
        };
        return ParallelAxisModel2;
      }(ComponentModel)
    );
    mixin(ParallelAxisModel, AxisModelCommonMixin);
    var BRUSH_PANEL_GLOBAL = true;
    var mathMin$1 = Math.min;
    var mathMax$1 = Math.max;
    var mathPow = Math.pow;
    var COVER_Z = 1e4;
    var UNSELECT_THRESHOLD = 6;
    var MIN_RESIZE_LINE_WIDTH = 6;
    var MUTEX_RESOURCE_KEY = "globalPan";
    var DIRECTION_MAP = {
      w: [0, 0],
      e: [0, 1],
      n: [1, 0],
      s: [1, 1]
    };
    var CURSOR_MAP = {
      w: "ew",
      e: "ew",
      n: "ns",
      s: "ns",
      ne: "nesw",
      sw: "nesw",
      nw: "nwse",
      se: "nwse"
    };
    var DEFAULT_BRUSH_OPT = {
      brushStyle: {
        lineWidth: 2,
        stroke: "rgba(210,219,238,0.3)",
        fill: "#D2DBEE"
      },
      transformable: true,
      brushMode: "single",
      removeOnClick: false
    };
    var baseUID = 0;
    var BrushController = (
      /** @class */
      function(_super) {
        __extends$1(BrushController2, _super);
        function BrushController2(zr) {
          var _this = _super.call(this) || this;
          _this._track = [];
          _this._covers = [];
          _this._handlers = {};
          _this._zr = zr;
          _this.group = new Group$3();
          _this._uid = "brushController_" + baseUID++;
          each$f(pointerHandlers, function(handler, eventName) {
            this._handlers[eventName] = bind$2(handler, this);
          }, _this);
          return _this;
        }
        BrushController2.prototype.enableBrush = function(brushOption) {
          this._brushType && this._doDisableBrush();
          brushOption.brushType && this._doEnableBrush(brushOption);
          return this;
        };
        BrushController2.prototype._doEnableBrush = function(brushOption) {
          var zr = this._zr;
          if (!this._enableGlobalPan) {
            take(zr, MUTEX_RESOURCE_KEY, this._uid);
          }
          each$f(this._handlers, function(handler, eventName) {
            zr.on(eventName, handler);
          });
          this._brushType = brushOption.brushType;
          this._brushOption = merge$1(clone$4(DEFAULT_BRUSH_OPT), brushOption, true);
        };
        BrushController2.prototype._doDisableBrush = function() {
          var zr = this._zr;
          release(zr, MUTEX_RESOURCE_KEY, this._uid);
          each$f(this._handlers, function(handler, eventName) {
            zr.off(eventName, handler);
          });
          this._brushType = this._brushOption = null;
        };
        BrushController2.prototype.setPanels = function(panelOpts) {
          if (panelOpts && panelOpts.length) {
            var panels_1 = this._panels = {};
            each$f(panelOpts, function(panelOpts2) {
              panels_1[panelOpts2.panelId] = clone$4(panelOpts2);
            });
          } else {
            this._panels = null;
          }
          return this;
        };
        BrushController2.prototype.mount = function(opt) {
          opt = opt || {};
          this._enableGlobalPan = opt.enableGlobalPan;
          var thisGroup = this.group;
          this._zr.add(thisGroup);
          thisGroup.attr({
            x: opt.x || 0,
            y: opt.y || 0,
            rotation: opt.rotation || 0,
            scaleX: opt.scaleX || 1,
            scaleY: opt.scaleY || 1
          });
          this._transform = thisGroup.getLocalTransform();
          return this;
        };
        BrushController2.prototype.updateCovers = function(coverConfigList) {
          coverConfigList = map$1(coverConfigList, function(coverConfig) {
            return merge$1(clone$4(DEFAULT_BRUSH_OPT), coverConfig, true);
          });
          var tmpIdPrefix = "\0-brush-index-";
          var oldCovers = this._covers;
          var newCovers = this._covers = [];
          var controller = this;
          var creatingCover = this._creatingCover;
          new DataDiffer(oldCovers, coverConfigList, oldGetKey, getKey2).add(addOrUpdate).update(addOrUpdate).remove(remove2).execute();
          return this;
          function getKey2(brushOption, index) {
            return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + "-" + brushOption.brushType;
          }
          function oldGetKey(cover, index) {
            return getKey2(cover.__brushOption, index);
          }
          function addOrUpdate(newIndex, oldIndex) {
            var newBrushInternal = coverConfigList[newIndex];
            if (oldIndex != null && oldCovers[oldIndex] === creatingCover) {
              newCovers[newIndex] = oldCovers[oldIndex];
            } else {
              var cover = newCovers[newIndex] = oldIndex != null ? (oldCovers[oldIndex].__brushOption = newBrushInternal, oldCovers[oldIndex]) : endCreating(controller, createCover(controller, newBrushInternal));
              updateCoverAfterCreation(controller, cover);
            }
          }
          function remove2(oldIndex) {
            if (oldCovers[oldIndex] !== creatingCover) {
              controller.group.remove(oldCovers[oldIndex]);
            }
          }
        };
        BrushController2.prototype.unmount = function() {
          this.enableBrush(false);
          clearCovers(this);
          this._zr.remove(this.group);
          return this;
        };
        BrushController2.prototype.dispose = function() {
          this.unmount();
          this.off();
        };
        return BrushController2;
      }(Eventful)
    );
    function createCover(controller, brushOption) {
      var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption);
      cover.__brushOption = brushOption;
      updateZ$1(cover, brushOption);
      controller.group.add(cover);
      return cover;
    }
    function endCreating(controller, creatingCover) {
      var coverRenderer = getCoverRenderer(creatingCover);
      if (coverRenderer.endCreating) {
        coverRenderer.endCreating(controller, creatingCover);
        updateZ$1(creatingCover, creatingCover.__brushOption);
      }
      return creatingCover;
    }
    function updateCoverShape(controller, cover) {
      var brushOption = cover.__brushOption;
      getCoverRenderer(cover).updateCoverShape(controller, cover, brushOption.range, brushOption);
    }
    function updateZ$1(cover, brushOption) {
      var z2 = brushOption.z;
      z2 == null && (z2 = COVER_Z);
      cover.traverse(function(el) {
        el.z = z2;
        el.z2 = z2;
      });
    }
    function updateCoverAfterCreation(controller, cover) {
      getCoverRenderer(cover).updateCommon(controller, cover);
      updateCoverShape(controller, cover);
    }
    function getCoverRenderer(cover) {
      return coverRenderers[cover.__brushOption.brushType];
    }
    function getPanelByPoint(controller, e2, localCursorPoint) {
      var panels = controller._panels;
      if (!panels) {
        return BRUSH_PANEL_GLOBAL;
      }
      var panel;
      var transform2 = controller._transform;
      each$f(panels, function(pn2) {
        pn2.isTargetByCursor(e2, localCursorPoint, transform2) && (panel = pn2);
      });
      return panel;
    }
    function getPanelByCover(controller, cover) {
      var panels = controller._panels;
      if (!panels) {
        return BRUSH_PANEL_GLOBAL;
      }
      var panelId = cover.__brushOption.panelId;
      return panelId != null ? panels[panelId] : BRUSH_PANEL_GLOBAL;
    }
    function clearCovers(controller) {
      var covers = controller._covers;
      var originalLength = covers.length;
      each$f(covers, function(cover) {
        controller.group.remove(cover);
      }, controller);
      covers.length = 0;
      return !!originalLength;
    }
    function trigger(controller, opt) {
      var areas = map$1(controller._covers, function(cover) {
        var brushOption = cover.__brushOption;
        var range2 = clone$4(brushOption.range);
        return {
          brushType: brushOption.brushType,
          panelId: brushOption.panelId,
          range: range2
        };
      });
      controller.trigger("brush", {
        areas,
        isEnd: !!opt.isEnd,
        removeOnClick: !!opt.removeOnClick
      });
    }
    function shouldShowCover(controller) {
      var track2 = controller._track;
      if (!track2.length) {
        return false;
      }
      var p2 = track2[track2.length - 1];
      var p1 = track2[0];
      var dx = p2[0] - p1[0];
      var dy = p2[1] - p1[1];
      var dist2 = mathPow(dx * dx + dy * dy, 0.5);
      return dist2 > UNSELECT_THRESHOLD;
    }
    function getTrackEnds(track2) {
      var tail = track2.length - 1;
      tail < 0 && (tail = 0);
      return [track2[0], track2[tail]];
    }
    function createBaseRectCover(rectRangeConverter, controller, brushOption, edgeNameSequences) {
      var cover = new Group$3();
      cover.add(new Rect$2({
        name: "main",
        style: makeStyle(brushOption),
        silent: true,
        draggable: true,
        cursor: "move",
        drift: curry$1(driftRect, rectRangeConverter, controller, cover, ["n", "s", "w", "e"]),
        ondragend: curry$1(trigger, controller, {
          isEnd: true
        })
      }));
      each$f(edgeNameSequences, function(nameSequence) {
        cover.add(new Rect$2({
          name: nameSequence.join(""),
          style: {
            opacity: 0
          },
          draggable: true,
          silent: true,
          invisible: true,
          drift: curry$1(driftRect, rectRangeConverter, controller, cover, nameSequence),
          ondragend: curry$1(trigger, controller, {
            isEnd: true
          })
        }));
      });
      return cover;
    }
    function updateBaseRect(controller, cover, localRange, brushOption) {
      var lineWidth = brushOption.brushStyle.lineWidth || 0;
      var handleSize = mathMax$1(lineWidth, MIN_RESIZE_LINE_WIDTH);
      var x2 = localRange[0][0];
      var y = localRange[1][0];
      var xa = x2 - lineWidth / 2;
      var ya = y - lineWidth / 2;
      var x22 = localRange[0][1];
      var y2 = localRange[1][1];
      var x2a = x22 - handleSize + lineWidth / 2;
      var y2a = y2 - handleSize + lineWidth / 2;
      var width = x22 - x2;
      var height = y2 - y;
      var widtha = width + lineWidth;
      var heighta = height + lineWidth;
      updateRectShape(controller, cover, "main", x2, y, width, height);
      if (brushOption.transformable) {
        updateRectShape(controller, cover, "w", xa, ya, handleSize, heighta);
        updateRectShape(controller, cover, "e", x2a, ya, handleSize, heighta);
        updateRectShape(controller, cover, "n", xa, ya, widtha, handleSize);
        updateRectShape(controller, cover, "s", xa, y2a, widtha, handleSize);
        updateRectShape(controller, cover, "nw", xa, ya, handleSize, handleSize);
        updateRectShape(controller, cover, "ne", x2a, ya, handleSize, handleSize);
        updateRectShape(controller, cover, "sw", xa, y2a, handleSize, handleSize);
        updateRectShape(controller, cover, "se", x2a, y2a, handleSize, handleSize);
      }
    }
    function updateCommon$1(controller, cover) {
      var brushOption = cover.__brushOption;
      var transformable = brushOption.transformable;
      var mainEl = cover.childAt(0);
      mainEl.useStyle(makeStyle(brushOption));
      mainEl.attr({
        silent: !transformable,
        cursor: transformable ? "move" : "default"
      });
      each$f([["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]], function(nameSequence) {
        var el = cover.childOfName(nameSequence.join(""));
        var globalDir = nameSequence.length === 1 ? getGlobalDirection1(controller, nameSequence[0]) : getGlobalDirection2(controller, nameSequence);
        el && el.attr({
          silent: !transformable,
          invisible: !transformable,
          cursor: transformable ? CURSOR_MAP[globalDir] + "-resize" : null
        });
      });
    }
    function updateRectShape(controller, cover, name, x2, y, w2, h2) {
      var el = cover.childOfName(name);
      el && el.setShape(pointsToRect(clipByPanel(controller, cover, [[x2, y], [x2 + w2, y + h2]])));
    }
    function makeStyle(brushOption) {
      return defaults$1({
        strokeNoScale: true
      }, brushOption.brushStyle);
    }
    function formatRectRange(x2, y, x22, y2) {
      var min3 = [mathMin$1(x2, x22), mathMin$1(y, y2)];
      var max3 = [mathMax$1(x2, x22), mathMax$1(y, y2)];
      return [
        [min3[0], max3[0]],
        [min3[1], max3[1]]
        // y range
      ];
    }
    function getTransform(controller) {
      return getTransform$1(controller.group);
    }
    function getGlobalDirection1(controller, localDirName) {
      var map2 = {
        w: "left",
        e: "right",
        n: "top",
        s: "bottom"
      };
      var inverseMap = {
        left: "w",
        right: "e",
        top: "n",
        bottom: "s"
      };
      var dir3 = transformDirection(map2[localDirName], getTransform(controller));
      return inverseMap[dir3];
    }
    function getGlobalDirection2(controller, localDirNameSeq) {
      var globalDir = [getGlobalDirection1(controller, localDirNameSeq[0]), getGlobalDirection1(controller, localDirNameSeq[1])];
      (globalDir[0] === "e" || globalDir[0] === "w") && globalDir.reverse();
      return globalDir.join("");
    }
    function driftRect(rectRangeConverter, controller, cover, dirNameSequence, dx, dy) {
      var brushOption = cover.__brushOption;
      var rectRange = rectRangeConverter.toRectRange(brushOption.range);
      var localDelta = toLocalDelta(controller, dx, dy);
      each$f(dirNameSequence, function(dirName) {
        var ind = DIRECTION_MAP[dirName];
        rectRange[ind[0]][ind[1]] += localDelta[ind[0]];
      });
      brushOption.range = rectRangeConverter.fromRectRange(formatRectRange(rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1]));
      updateCoverAfterCreation(controller, cover);
      trigger(controller, {
        isEnd: false
      });
    }
    function driftPolygon(controller, cover, dx, dy) {
      var range2 = cover.__brushOption.range;
      var localDelta = toLocalDelta(controller, dx, dy);
      each$f(range2, function(point) {
        point[0] += localDelta[0];
        point[1] += localDelta[1];
      });
      updateCoverAfterCreation(controller, cover);
      trigger(controller, {
        isEnd: false
      });
    }
    function toLocalDelta(controller, dx, dy) {
      var thisGroup = controller.group;
      var localD = thisGroup.transformCoordToLocal(dx, dy);
      var localZero = thisGroup.transformCoordToLocal(0, 0);
      return [localD[0] - localZero[0], localD[1] - localZero[1]];
    }
    function clipByPanel(controller, cover, data) {
      var panel = getPanelByCover(controller, cover);
      return panel && panel !== BRUSH_PANEL_GLOBAL ? panel.clipPath(data, controller._transform) : clone$4(data);
    }
    function pointsToRect(points2) {
      var xmin = mathMin$1(points2[0][0], points2[1][0]);
      var ymin = mathMin$1(points2[0][1], points2[1][1]);
      var xmax = mathMax$1(points2[0][0], points2[1][0]);
      var ymax = mathMax$1(points2[0][1], points2[1][1]);
      return {
        x: xmin,
        y: ymin,
        width: xmax - xmin,
        height: ymax - ymin
      };
    }
    function resetCursor(controller, e2, localCursorPoint) {
      if (
        // Check active
        !controller._brushType || isOutsideZrArea(controller, e2.offsetX, e2.offsetY)
      ) {
        return;
      }
      var zr = controller._zr;
      var covers = controller._covers;
      var currPanel = getPanelByPoint(controller, e2, localCursorPoint);
      if (!controller._dragging) {
        for (var i2 = 0; i2 < covers.length; i2++) {
          var brushOption = covers[i2].__brushOption;
          if (currPanel && (currPanel === BRUSH_PANEL_GLOBAL || brushOption.panelId === currPanel.panelId) && coverRenderers[brushOption.brushType].contain(covers[i2], localCursorPoint[0], localCursorPoint[1])) {
            return;
          }
        }
      }
      currPanel && zr.setCursorStyle("crosshair");
    }
    function preventDefault(e2) {
      var rawE = e2.event;
      rawE.preventDefault && rawE.preventDefault();
    }
    function mainShapeContain(cover, x2, y) {
      return cover.childOfName("main").contain(x2, y);
    }
    function updateCoverByMouse(controller, e2, localCursorPoint, isEnd) {
      var creatingCover = controller._creatingCover;
      var panel = controller._creatingPanel;
      var thisBrushOption = controller._brushOption;
      var eventParams;
      controller._track.push(localCursorPoint.slice());
      if (shouldShowCover(controller) || creatingCover) {
        if (panel && !creatingCover) {
          thisBrushOption.brushMode === "single" && clearCovers(controller);
          var brushOption = clone$4(thisBrushOption);
          brushOption.brushType = determineBrushType(brushOption.brushType, panel);
          brushOption.panelId = panel === BRUSH_PANEL_GLOBAL ? null : panel.panelId;
          creatingCover = controller._creatingCover = createCover(controller, brushOption);
          controller._covers.push(creatingCover);
        }
        if (creatingCover) {
          var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)];
          var coverBrushOption = creatingCover.__brushOption;
          coverBrushOption.range = coverRenderer.getCreatingRange(clipByPanel(controller, creatingCover, controller._track));
          if (isEnd) {
            endCreating(controller, creatingCover);
            coverRenderer.updateCommon(controller, creatingCover);
          }
          updateCoverShape(controller, creatingCover);
          eventParams = {
            isEnd
          };
        }
      } else if (isEnd && thisBrushOption.brushMode === "single" && thisBrushOption.removeOnClick) {
        if (getPanelByPoint(controller, e2, localCursorPoint) && clearCovers(controller)) {
          eventParams = {
            isEnd,
            removeOnClick: true
          };
        }
      }
      return eventParams;
    }
    function determineBrushType(brushType, panel) {
      if (brushType === "auto") {
        return panel.defaultBrushType;
      }
      return brushType;
    }
    var pointerHandlers = {
      mousedown: function(e2) {
        if (this._dragging) {
          handleDragEnd(this, e2);
        } else if (!e2.target || !e2.target.draggable) {
          preventDefault(e2);
          var localCursorPoint = this.group.transformCoordToLocal(e2.offsetX, e2.offsetY);
          this._creatingCover = null;
          var panel = this._creatingPanel = getPanelByPoint(this, e2, localCursorPoint);
          if (panel) {
            this._dragging = true;
            this._track = [localCursorPoint.slice()];
          }
        }
      },
      mousemove: function(e2) {
        var x2 = e2.offsetX;
        var y = e2.offsetY;
        var localCursorPoint = this.group.transformCoordToLocal(x2, y);
        resetCursor(this, e2, localCursorPoint);
        if (this._dragging) {
          preventDefault(e2);
          var eventParams = updateCoverByMouse(this, e2, localCursorPoint, false);
          eventParams && trigger(this, eventParams);
        }
      },
      mouseup: function(e2) {
        handleDragEnd(this, e2);
      }
    };
    function handleDragEnd(controller, e2) {
      if (controller._dragging) {
        preventDefault(e2);
        var x2 = e2.offsetX;
        var y = e2.offsetY;
        var localCursorPoint = controller.group.transformCoordToLocal(x2, y);
        var eventParams = updateCoverByMouse(controller, e2, localCursorPoint, true);
        controller._dragging = false;
        controller._track = [];
        controller._creatingCover = null;
        eventParams && trigger(controller, eventParams);
      }
    }
    function isOutsideZrArea(controller, x2, y) {
      var zr = controller._zr;
      return x2 < 0 || x2 > zr.getWidth() || y < 0 || y > zr.getHeight();
    }
    var coverRenderers = {
      lineX: getLineRenderer(0),
      lineY: getLineRenderer(1),
      rect: {
        createCover: function(controller, brushOption) {
          function returnInput(range2) {
            return range2;
          }
          return createBaseRectCover({
            toRectRange: returnInput,
            fromRectRange: returnInput
          }, controller, brushOption, [["w"], ["e"], ["n"], ["s"], ["s", "e"], ["s", "w"], ["n", "e"], ["n", "w"]]);
        },
        getCreatingRange: function(localTrack) {
          var ends = getTrackEnds(localTrack);
          return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]);
        },
        updateCoverShape: function(controller, cover, localRange, brushOption) {
          updateBaseRect(controller, cover, localRange, brushOption);
        },
        updateCommon: updateCommon$1,
        contain: mainShapeContain
      },
      polygon: {
        createCover: function(controller, brushOption) {
          var cover = new Group$3();
          cover.add(new Polyline$1({
            name: "main",
            style: makeStyle(brushOption),
            silent: true
          }));
          return cover;
        },
        getCreatingRange: function(localTrack) {
          return localTrack;
        },
        endCreating: function(controller, cover) {
          cover.remove(cover.childAt(0));
          cover.add(new Polygon({
            name: "main",
            draggable: true,
            drift: curry$1(driftPolygon, controller, cover),
            ondragend: curry$1(trigger, controller, {
              isEnd: true
            })
          }));
        },
        updateCoverShape: function(controller, cover, localRange, brushOption) {
          cover.childAt(0).setShape({
            points: clipByPanel(controller, cover, localRange)
          });
        },
        updateCommon: updateCommon$1,
        contain: mainShapeContain
      }
    };
    function getLineRenderer(xyIndex) {
      return {
        createCover: function(controller, brushOption) {
          return createBaseRectCover({
            toRectRange: function(range2) {
              var rectRange = [range2, [0, 100]];
              xyIndex && rectRange.reverse();
              return rectRange;
            },
            fromRectRange: function(rectRange) {
              return rectRange[xyIndex];
            }
          }, controller, brushOption, [[["w"], ["e"]], [["n"], ["s"]]][xyIndex]);
        },
        getCreatingRange: function(localTrack) {
          var ends = getTrackEnds(localTrack);
          var min3 = mathMin$1(ends[0][xyIndex], ends[1][xyIndex]);
          var max3 = mathMax$1(ends[0][xyIndex], ends[1][xyIndex]);
          return [min3, max3];
        },
        updateCoverShape: function(controller, cover, localRange, brushOption) {
          var otherExtent;
          var panel = getPanelByCover(controller, cover);
          if (panel !== BRUSH_PANEL_GLOBAL && panel.getLinearBrushOtherExtent) {
            otherExtent = panel.getLinearBrushOtherExtent(xyIndex);
          } else {
            var zr = controller._zr;
            otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]];
          }
          var rectRange = [localRange, otherExtent];
          xyIndex && rectRange.reverse();
          updateBaseRect(controller, cover, rectRange, brushOption);
        },
        updateCommon: updateCommon$1,
        contain: mainShapeContain
      };
    }
    function makeRectPanelClipPath(rect) {
      rect = normalizeRect(rect);
      return function(localPoints) {
        return clipPointsByRect(localPoints, rect);
      };
    }
    function makeLinearBrushOtherExtent(rect, specifiedXYIndex) {
      rect = normalizeRect(rect);
      return function(xyIndex) {
        var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;
        var brushWidth = idx ? rect.width : rect.height;
        var base2 = idx ? rect.x : rect.y;
        return [base2, base2 + (brushWidth || 0)];
      };
    }
    function makeRectIsTargetByCursor(rect, api2, targetModel) {
      var boundingRect = normalizeRect(rect);
      return function(e2, localCursorPoint) {
        return boundingRect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e2, api2, targetModel);
      };
    }
    function normalizeRect(rect) {
      return BoundingRect.create(rect);
    }
    var elementList$1 = ["axisLine", "axisTickLabel", "axisName"];
    var ParallelAxisView = (
      /** @class */
      function(_super) {
        __extends$1(ParallelAxisView2, _super);
        function ParallelAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ParallelAxisView2.type;
          return _this;
        }
        ParallelAxisView2.prototype.init = function(ecModel, api2) {
          _super.prototype.init.apply(this, arguments);
          (this._brushController = new BrushController(api2.getZr())).on("brush", bind$2(this._onBrush, this));
        };
        ParallelAxisView2.prototype.render = function(axisModel, ecModel, api2, payload) {
          if (fromAxisAreaSelect(axisModel, ecModel, payload)) {
            return;
          }
          this.axisModel = axisModel;
          this.api = api2;
          this.group.removeAll();
          var oldAxisGroup = this._axisGroup;
          this._axisGroup = new Group$3();
          this.group.add(this._axisGroup);
          if (!axisModel.get("show")) {
            return;
          }
          var coordSysModel = getCoordSysModel(axisModel, ecModel);
          var coordSys = coordSysModel.coordinateSystem;
          var areaSelectStyle = axisModel.getAreaSelectStyle();
          var areaWidth = areaSelectStyle.width;
          var dim = axisModel.axis.dim;
          var axisLayout = coordSys.getAxisLayout(dim);
          var builderOpt = extend$1({
            strokeContainThreshold: areaWidth
          }, axisLayout);
          var axisBuilder = new AxisBuilder(axisModel, builderOpt);
          each$f(elementList$1, axisBuilder.add, axisBuilder);
          this._axisGroup.add(axisBuilder.getGroup());
          this._refreshBrushController(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api2);
          groupTransition(oldAxisGroup, this._axisGroup, axisModel);
        };
        ParallelAxisView2.prototype._refreshBrushController = function(builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api2) {
          var extent3 = axisModel.axis.getExtent();
          var extentLen = extent3[1] - extent3[0];
          var extra = Math.min(30, Math.abs(extentLen) * 0.1);
          var rect = BoundingRect.create({
            x: extent3[0],
            y: -areaWidth / 2,
            width: extentLen,
            height: areaWidth
          });
          rect.x -= extra;
          rect.width += 2 * extra;
          this._brushController.mount({
            enableGlobalPan: true,
            rotation: builderOpt.rotation,
            x: builderOpt.position[0],
            y: builderOpt.position[1]
          }).setPanels([{
            panelId: "pl",
            clipPath: makeRectPanelClipPath(rect),
            isTargetByCursor: makeRectIsTargetByCursor(rect, api2, coordSysModel),
            getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0)
          }]).enableBrush({
            brushType: "lineX",
            brushStyle: areaSelectStyle,
            removeOnClick: true
          }).updateCovers(getCoverInfoList(axisModel));
        };
        ParallelAxisView2.prototype._onBrush = function(eventParam) {
          var coverInfoList = eventParam.areas;
          var axisModel = this.axisModel;
          var axis = axisModel.axis;
          var intervals = map$1(coverInfoList, function(coverInfo) {
            return [axis.coordToData(coverInfo.range[0], true), axis.coordToData(coverInfo.range[1], true)];
          });
          if (!axisModel.option.realtime === eventParam.isEnd || eventParam.removeOnClick) {
            this.api.dispatchAction({
              type: "axisAreaSelect",
              parallelAxisId: axisModel.id,
              intervals
            });
          }
        };
        ParallelAxisView2.prototype.dispose = function() {
          this._brushController.dispose();
        };
        ParallelAxisView2.type = "parallelAxis";
        return ParallelAxisView2;
      }(ComponentView)
    );
    function fromAxisAreaSelect(axisModel, ecModel, payload) {
      return payload && payload.type === "axisAreaSelect" && ecModel.findComponents({
        mainType: "parallelAxis",
        query: payload
      })[0] === axisModel;
    }
    function getCoverInfoList(axisModel) {
      var axis = axisModel.axis;
      return map$1(axisModel.activeIntervals, function(interval) {
        return {
          brushType: "lineX",
          panelId: "pl",
          range: [axis.dataToCoord(interval[0], true), axis.dataToCoord(interval[1], true)]
        };
      });
    }
    function getCoordSysModel(axisModel, ecModel) {
      return ecModel.getComponent("parallel", axisModel.get("parallelIndex"));
    }
    var actionInfo = {
      type: "axisAreaSelect",
      event: "axisAreaSelected"
      // update: 'updateVisual'
    };
    function installParallelActions(registers) {
      registers.registerAction(actionInfo, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "parallelAxis",
          query: payload
        }, function(parallelAxisModel) {
          parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);
        });
      });
      registers.registerAction("parallelAxisExpand", function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "parallel",
          query: payload
        }, function(parallelModel) {
          parallelModel.setAxisExpand(payload);
        });
      });
    }
    var defaultAxisOption = {
      type: "value",
      areaSelectStyle: {
        width: 20,
        borderWidth: 1,
        borderColor: "rgba(160,197,232)",
        color: "rgba(160,197,232)",
        opacity: 0.3
      },
      realtime: true,
      z: 10
    };
    function install$C(registers) {
      registers.registerComponentView(ParallelView);
      registers.registerComponentModel(ParallelModel);
      registers.registerCoordinateSystem("parallel", parallelCoordSysCreator);
      registers.registerPreprocessor(parallelPreprocessor);
      registers.registerComponentModel(ParallelAxisModel);
      registers.registerComponentView(ParallelAxisView);
      axisModelCreator(registers, "parallel", ParallelAxisModel, defaultAxisOption);
      installParallelActions(registers);
    }
    function install$B(registers) {
      use(install$C);
      registers.registerChartView(ParallelView$1);
      registers.registerSeriesModel(ParallelSeriesModel);
      registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, parallelVisual);
    }
    var SankeyPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function SankeyPathShape2() {
          this.x1 = 0;
          this.y1 = 0;
          this.x2 = 0;
          this.y2 = 0;
          this.cpx1 = 0;
          this.cpy1 = 0;
          this.cpx2 = 0;
          this.cpy2 = 0;
          this.extent = 0;
        }
        return SankeyPathShape2;
      }()
    );
    var SankeyPath = (
      /** @class */
      function(_super) {
        __extends$1(SankeyPath2, _super);
        function SankeyPath2(opts) {
          return _super.call(this, opts) || this;
        }
        SankeyPath2.prototype.getDefaultShape = function() {
          return new SankeyPathShape();
        };
        SankeyPath2.prototype.buildPath = function(ctx, shape) {
          var extent3 = shape.extent;
          ctx.moveTo(shape.x1, shape.y1);
          ctx.bezierCurveTo(shape.cpx1, shape.cpy1, shape.cpx2, shape.cpy2, shape.x2, shape.y2);
          if (shape.orient === "vertical") {
            ctx.lineTo(shape.x2 + extent3, shape.y2);
            ctx.bezierCurveTo(shape.cpx2 + extent3, shape.cpy2, shape.cpx1 + extent3, shape.cpy1, shape.x1 + extent3, shape.y1);
          } else {
            ctx.lineTo(shape.x2, shape.y2 + extent3);
            ctx.bezierCurveTo(shape.cpx2, shape.cpy2 + extent3, shape.cpx1, shape.cpy1 + extent3, shape.x1, shape.y1 + extent3);
          }
          ctx.closePath();
        };
        SankeyPath2.prototype.highlight = function() {
          enterEmphasis(this);
        };
        SankeyPath2.prototype.downplay = function() {
          leaveEmphasis(this);
        };
        return SankeyPath2;
      }(Path)
    );
    var SankeyView = (
      /** @class */
      function(_super) {
        __extends$1(SankeyView2, _super);
        function SankeyView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SankeyView2.type;
          _this._focusAdjacencyDisabled = false;
          return _this;
        }
        SankeyView2.prototype.render = function(seriesModel, ecModel, api2) {
          var sankeyView = this;
          var graph = seriesModel.getGraph();
          var group = this.group;
          var layoutInfo = seriesModel.layoutInfo;
          var width = layoutInfo.width;
          var height = layoutInfo.height;
          var nodeData = seriesModel.getData();
          var edgeData = seriesModel.getData("edge");
          var orient = seriesModel.get("orient");
          this._model = seriesModel;
          group.removeAll();
          group.x = layoutInfo.x;
          group.y = layoutInfo.y;
          graph.eachEdge(function(edge) {
            var curve = new SankeyPath();
            var ecData = getECData(curve);
            ecData.dataIndex = edge.dataIndex;
            ecData.seriesIndex = seriesModel.seriesIndex;
            ecData.dataType = "edge";
            var edgeModel = edge.getModel();
            var lineStyleModel = edgeModel.getModel("lineStyle");
            var curvature = lineStyleModel.get("curveness");
            var n1Layout = edge.node1.getLayout();
            var node1Model = edge.node1.getModel();
            var dragX1 = node1Model.get("localX");
            var dragY1 = node1Model.get("localY");
            var n2Layout = edge.node2.getLayout();
            var node2Model = edge.node2.getModel();
            var dragX2 = node2Model.get("localX");
            var dragY2 = node2Model.get("localY");
            var edgeLayout = edge.getLayout();
            var x1;
            var y1;
            var x2;
            var y2;
            var cpx1;
            var cpy1;
            var cpx2;
            var cpy2;
            curve.shape.extent = Math.max(1, edgeLayout.dy);
            curve.shape.orient = orient;
            if (orient === "vertical") {
              x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + edgeLayout.sy;
              y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + n1Layout.dy;
              x2 = (dragX2 != null ? dragX2 * width : n2Layout.x) + edgeLayout.ty;
              y2 = dragY2 != null ? dragY2 * height : n2Layout.y;
              cpx1 = x1;
              cpy1 = y1 * (1 - curvature) + y2 * curvature;
              cpx2 = x2;
              cpy2 = y1 * curvature + y2 * (1 - curvature);
            } else {
              x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx;
              y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy;
              x2 = dragX2 != null ? dragX2 * width : n2Layout.x;
              y2 = (dragY2 != null ? dragY2 * height : n2Layout.y) + edgeLayout.ty;
              cpx1 = x1 * (1 - curvature) + x2 * curvature;
              cpy1 = y1;
              cpx2 = x1 * curvature + x2 * (1 - curvature);
              cpy2 = y2;
            }
            curve.setShape({
              x1,
              y1,
              x2,
              y2,
              cpx1,
              cpy1,
              cpx2,
              cpy2
            });
            curve.useStyle(lineStyleModel.getItemStyle());
            applyCurveStyle(curve.style, orient, edge);
            var defaultEdgeLabelText = "" + edgeModel.get("value");
            var edgeLabelStateModels = getLabelStatesModels(edgeModel, "edgeLabel");
            setLabelStyle(curve, edgeLabelStateModels, {
              labelFetcher: {
                getFormattedLabel: function(dataIndex, stateName, dataType2, labelDimIndex, formatter2, extendParams) {
                  return seriesModel.getFormattedLabel(
                    dataIndex,
                    stateName,
                    "edge",
                    labelDimIndex,
                    // ensure edgeLabel formatter is provided
                    // to prevent the inheritance from `label.formatter` of the series
                    retrieve3(formatter2, edgeLabelStateModels.normal && edgeLabelStateModels.normal.get("formatter"), defaultEdgeLabelText),
                    extendParams
                  );
                }
              },
              labelDataIndex: edge.dataIndex,
              defaultText: defaultEdgeLabelText
            });
            curve.setTextConfig({
              position: "inside"
            });
            var emphasisModel = edgeModel.getModel("emphasis");
            setStatesStylesFromModel(curve, edgeModel, "lineStyle", function(model) {
              var style = model.getItemStyle();
              applyCurveStyle(style, orient, edge);
              return style;
            });
            group.add(curve);
            edgeData.setItemGraphicEl(edge.dataIndex, curve);
            var focus = emphasisModel.get("focus");
            toggleHoverEmphasis(curve, focus === "adjacency" ? edge.getAdjacentDataIndices() : focus === "trajectory" ? edge.getTrajectoryDataIndices() : focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
          });
          graph.eachNode(function(node) {
            var layout2 = node.getLayout();
            var itemModel = node.getModel();
            var dragX = itemModel.get("localX");
            var dragY = itemModel.get("localY");
            var emphasisModel = itemModel.getModel("emphasis");
            var borderRadius = itemModel.get(["itemStyle", "borderRadius"]) || 0;
            var rect = new Rect$2({
              shape: {
                x: dragX != null ? dragX * width : layout2.x,
                y: dragY != null ? dragY * height : layout2.y,
                width: layout2.dx,
                height: layout2.dy,
                r: borderRadius
              },
              style: itemModel.getModel("itemStyle").getItemStyle(),
              z2: 10
            });
            setLabelStyle(rect, getLabelStatesModels(itemModel), {
              labelFetcher: {
                getFormattedLabel: function(dataIndex, stateName) {
                  return seriesModel.getFormattedLabel(dataIndex, stateName, "node");
                }
              },
              labelDataIndex: node.dataIndex,
              defaultText: node.id
            });
            rect.disableLabelAnimation = true;
            rect.setStyle("fill", node.getVisual("color"));
            rect.setStyle("decal", node.getVisual("style").decal);
            setStatesStylesFromModel(rect, itemModel);
            group.add(rect);
            nodeData.setItemGraphicEl(node.dataIndex, rect);
            getECData(rect).dataType = "node";
            var focus = emphasisModel.get("focus");
            toggleHoverEmphasis(rect, focus === "adjacency" ? node.getAdjacentDataIndices() : focus === "trajectory" ? node.getTrajectoryDataIndices() : focus, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
          });
          nodeData.eachItemGraphicEl(function(el, dataIndex) {
            var itemModel = nodeData.getItemModel(dataIndex);
            if (itemModel.get("draggable")) {
              el.drift = function(dx, dy) {
                sankeyView._focusAdjacencyDisabled = true;
                this.shape.x += dx;
                this.shape.y += dy;
                this.dirty();
                api2.dispatchAction({
                  type: "dragNode",
                  seriesId: seriesModel.id,
                  dataIndex: nodeData.getRawIndex(dataIndex),
                  localX: this.shape.x / width,
                  localY: this.shape.y / height
                });
              };
              el.ondragend = function() {
                sankeyView._focusAdjacencyDisabled = false;
              };
              el.draggable = true;
              el.cursor = "move";
            }
          });
          if (!this._data && seriesModel.isAnimationEnabled()) {
            group.setClipPath(createGridClipShape$1(group.getBoundingRect(), seriesModel, function() {
              group.removeClipPath();
            }));
          }
          this._data = seriesModel.getData();
        };
        SankeyView2.prototype.dispose = function() {
        };
        SankeyView2.type = "sankey";
        return SankeyView2;
      }(ChartView)
    );
    function applyCurveStyle(curveProps, orient, edge) {
      switch (curveProps.fill) {
        case "source":
          curveProps.fill = edge.node1.getVisual("color");
          curveProps.decal = edge.node1.getVisual("style").decal;
          break;
        case "target":
          curveProps.fill = edge.node2.getVisual("color");
          curveProps.decal = edge.node2.getVisual("style").decal;
          break;
        case "gradient":
          var sourceColor = edge.node1.getVisual("color");
          var targetColor = edge.node2.getVisual("color");
          if (isString$1(sourceColor) && isString$1(targetColor)) {
            curveProps.fill = new LinearGradient(0, 0, +(orient === "horizontal"), +(orient === "vertical"), [{
              color: sourceColor,
              offset: 0
            }, {
              color: targetColor,
              offset: 1
            }]);
          }
      }
    }
    function createGridClipShape$1(rect, seriesModel, cb) {
      var rectEl = new Rect$2({
        shape: {
          x: rect.x - 10,
          y: rect.y - 10,
          width: 0,
          height: rect.height + 20
        }
      });
      initProps(rectEl, {
        shape: {
          width: rect.width + 20
        }
      }, seriesModel, cb);
      return rectEl;
    }
    var SankeySeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(SankeySeriesModel2, _super);
        function SankeySeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SankeySeriesModel2.type;
          return _this;
        }
        SankeySeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var links = option.edges || option.links || [];
          var nodes = option.data || option.nodes || [];
          var levels = option.levels || [];
          this.levelModels = [];
          var levelModels = this.levelModels;
          for (var i2 = 0; i2 < levels.length; i2++) {
            if (levels[i2].depth != null && levels[i2].depth >= 0) {
              levelModels[levels[i2].depth] = new Model(levels[i2], this, ecModel);
            }
          }
          var graph = createGraphFromNodeEdge(nodes, links, this, true, beforeLink);
          return graph.data;
          function beforeLink(nodeData, edgeData) {
            nodeData.wrapMethod("getItemModel", function(model, idx) {
              var seriesModel = model.parentModel;
              var layout2 = seriesModel.getData().getItemLayout(idx);
              if (layout2) {
                var nodeDepth = layout2.depth;
                var levelModel = seriesModel.levelModels[nodeDepth];
                if (levelModel) {
                  model.parentModel = levelModel;
                }
              }
              return model;
            });
            edgeData.wrapMethod("getItemModel", function(model, idx) {
              var seriesModel = model.parentModel;
              var edge = seriesModel.getGraph().getEdgeByIndex(idx);
              var layout2 = edge.node1.getLayout();
              if (layout2) {
                var depth = layout2.depth;
                var levelModel = seriesModel.levelModels[depth];
                if (levelModel) {
                  model.parentModel = levelModel;
                }
              }
              return model;
            });
          }
        };
        SankeySeriesModel2.prototype.setNodePosition = function(dataIndex, localPosition) {
          var nodes = this.option.data || this.option.nodes;
          var dataItem = nodes[dataIndex];
          dataItem.localX = localPosition[0];
          dataItem.localY = localPosition[1];
        };
        SankeySeriesModel2.prototype.getGraph = function() {
          return this.getData().graph;
        };
        SankeySeriesModel2.prototype.getEdgeData = function() {
          return this.getGraph().edgeData;
        };
        SankeySeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          function noValue(val) {
            return isNaN(val) || val == null;
          }
          if (dataType2 === "edge") {
            var params = this.getDataParams(dataIndex, dataType2);
            var rawDataOpt = params.data;
            var edgeValue = params.value;
            var edgeName = rawDataOpt.source + " -- " + rawDataOpt.target;
            return createTooltipMarkup("nameValue", {
              name: edgeName,
              value: edgeValue,
              noValue: noValue(edgeValue)
            });
          } else {
            var node = this.getGraph().getNodeByIndex(dataIndex);
            var value = node.getLayout().value;
            var name_1 = this.getDataParams(dataIndex, dataType2).data.name;
            return createTooltipMarkup("nameValue", {
              name: name_1 != null ? name_1 + "" : null,
              value,
              noValue: noValue(value)
            });
          }
        };
        SankeySeriesModel2.prototype.optionUpdated = function() {
        };
        SankeySeriesModel2.prototype.getDataParams = function(dataIndex, dataType2) {
          var params = _super.prototype.getDataParams.call(this, dataIndex, dataType2);
          if (params.value == null && dataType2 === "node") {
            var node = this.getGraph().getNodeByIndex(dataIndex);
            var nodeValue = node.getLayout().value;
            params.value = nodeValue;
          }
          return params;
        };
        SankeySeriesModel2.type = "series.sankey";
        SankeySeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "view",
          left: "5%",
          top: "5%",
          right: "20%",
          bottom: "5%",
          orient: "horizontal",
          nodeWidth: 20,
          nodeGap: 8,
          draggable: true,
          layoutIterations: 32,
          label: {
            show: true,
            position: "right",
            fontSize: 12
          },
          edgeLabel: {
            show: false,
            fontSize: 12
          },
          levels: [],
          nodeAlign: "justify",
          lineStyle: {
            color: "#314656",
            opacity: 0.2,
            curveness: 0.5
          },
          emphasis: {
            label: {
              show: true
            },
            lineStyle: {
              opacity: 0.5
            }
          },
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          },
          animationEasing: "linear",
          animationDuration: 1e3
        };
        return SankeySeriesModel2;
      }(SeriesModel)
    );
    function sankeyLayout(ecModel, api2) {
      ecModel.eachSeriesByType("sankey", function(seriesModel) {
        var nodeWidth = seriesModel.get("nodeWidth");
        var nodeGap = seriesModel.get("nodeGap");
        var layoutInfo = getViewRect$1(seriesModel, api2);
        seriesModel.layoutInfo = layoutInfo;
        var width = layoutInfo.width;
        var height = layoutInfo.height;
        var graph = seriesModel.getGraph();
        var nodes = graph.nodes;
        var edges = graph.edges;
        computeNodeValues(nodes);
        var filteredNodes = filter(nodes, function(node) {
          return node.getLayout().value === 0;
        });
        var iterations = filteredNodes.length !== 0 ? 0 : seriesModel.get("layoutIterations");
        var orient = seriesModel.get("orient");
        var nodeAlign = seriesModel.get("nodeAlign");
        layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign);
      });
    }
    function getViewRect$1(seriesModel, api2) {
      return getLayoutRect(seriesModel.getBoxLayoutParams(), {
        width: api2.getWidth(),
        height: api2.getHeight()
      });
    }
    function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations, orient, nodeAlign) {
      computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign);
      computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient);
      computeEdgeDepths(nodes, orient);
    }
    function computeNodeValues(nodes) {
      each$f(nodes, function(node) {
        var value1 = sum(node.outEdges, getEdgeValue);
        var value2 = sum(node.inEdges, getEdgeValue);
        var nodeRawValue = node.getValue() || 0;
        var value = Math.max(value1, value2, nodeRawValue);
        node.setLayout({
          value
        }, true);
      });
    }
    function computeNodeBreadths(nodes, edges, nodeWidth, width, height, orient, nodeAlign) {
      var remainEdges = [];
      var indegreeArr = [];
      var zeroIndegrees = [];
      var nextTargetNode = [];
      var x2 = 0;
      for (var i2 = 0; i2 < edges.length; i2++) {
        remainEdges[i2] = 1;
      }
      for (var i2 = 0; i2 < nodes.length; i2++) {
        indegreeArr[i2] = nodes[i2].inEdges.length;
        if (indegreeArr[i2] === 0) {
          zeroIndegrees.push(nodes[i2]);
        }
      }
      var maxNodeDepth = -1;
      while (zeroIndegrees.length) {
        for (var idx = 0; idx < zeroIndegrees.length; idx++) {
          var node = zeroIndegrees[idx];
          var item = node.hostGraph.data.getRawDataItem(node.dataIndex);
          var isItemDepth = item.depth != null && item.depth >= 0;
          if (isItemDepth && item.depth > maxNodeDepth) {
            maxNodeDepth = item.depth;
          }
          node.setLayout({
            depth: isItemDepth ? item.depth : x2
          }, true);
          orient === "vertical" ? node.setLayout({
            dy: nodeWidth
          }, true) : node.setLayout({
            dx: nodeWidth
          }, true);
          for (var edgeIdx = 0; edgeIdx < node.outEdges.length; edgeIdx++) {
            var edge = node.outEdges[edgeIdx];
            var indexEdge = edges.indexOf(edge);
            remainEdges[indexEdge] = 0;
            var targetNode = edge.node2;
            var nodeIndex = nodes.indexOf(targetNode);
            if (--indegreeArr[nodeIndex] === 0 && nextTargetNode.indexOf(targetNode) < 0) {
              nextTargetNode.push(targetNode);
            }
          }
        }
        ++x2;
        zeroIndegrees = nextTargetNode;
        nextTargetNode = [];
      }
      for (var i2 = 0; i2 < remainEdges.length; i2++) {
        if (remainEdges[i2] === 1) {
          throw new Error("Sankey is a DAG, the original data has cycle!");
        }
      }
      var maxDepth = maxNodeDepth > x2 - 1 ? maxNodeDepth : x2 - 1;
      if (nodeAlign && nodeAlign !== "left") {
        adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth);
      }
      var kx = orient === "vertical" ? (height - nodeWidth) / maxDepth : (width - nodeWidth) / maxDepth;
      scaleNodeBreadths(nodes, kx, orient);
    }
    function isNodeDepth(node) {
      var item = node.hostGraph.data.getRawDataItem(node.dataIndex);
      return item.depth != null && item.depth >= 0;
    }
    function adjustNodeWithNodeAlign(nodes, nodeAlign, orient, maxDepth) {
      if (nodeAlign === "right") {
        var nextSourceNode = [];
        var remainNodes = nodes;
        var nodeHeight = 0;
        while (remainNodes.length) {
          for (var i2 = 0; i2 < remainNodes.length; i2++) {
            var node = remainNodes[i2];
            node.setLayout({
              skNodeHeight: nodeHeight
            }, true);
            for (var j = 0; j < node.inEdges.length; j++) {
              var edge = node.inEdges[j];
              if (nextSourceNode.indexOf(edge.node1) < 0) {
                nextSourceNode.push(edge.node1);
              }
            }
          }
          remainNodes = nextSourceNode;
          nextSourceNode = [];
          ++nodeHeight;
        }
        each$f(nodes, function(node2) {
          if (!isNodeDepth(node2)) {
            node2.setLayout({
              depth: Math.max(0, maxDepth - node2.getLayout().skNodeHeight)
            }, true);
          }
        });
      } else if (nodeAlign === "justify") {
        moveSinksRight(nodes, maxDepth);
      }
    }
    function moveSinksRight(nodes, maxDepth) {
      each$f(nodes, function(node) {
        if (!isNodeDepth(node) && !node.outEdges.length) {
          node.setLayout({
            depth: maxDepth
          }, true);
        }
      });
    }
    function scaleNodeBreadths(nodes, kx, orient) {
      each$f(nodes, function(node) {
        var nodeDepth = node.getLayout().depth * kx;
        orient === "vertical" ? node.setLayout({
          y: nodeDepth
        }, true) : node.setLayout({
          x: nodeDepth
        }, true);
      });
    }
    function computeNodeDepths(nodes, edges, height, width, nodeGap, iterations, orient) {
      var nodesByBreadth = prepareNodesByBreadth(nodes, orient);
      initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient);
      resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);
      for (var alpha = 1; iterations > 0; iterations--) {
        alpha *= 0.99;
        relaxRightToLeft(nodesByBreadth, alpha, orient);
        resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);
        relaxLeftToRight(nodesByBreadth, alpha, orient);
        resolveCollisions(nodesByBreadth, nodeGap, height, width, orient);
      }
    }
    function prepareNodesByBreadth(nodes, orient) {
      var nodesByBreadth = [];
      var keyAttr = orient === "vertical" ? "y" : "x";
      var groupResult = groupData(nodes, function(node) {
        return node.getLayout()[keyAttr];
      });
      groupResult.keys.sort(function(a2, b2) {
        return a2 - b2;
      });
      each$f(groupResult.keys, function(key) {
        nodesByBreadth.push(groupResult.buckets.get(key));
      });
      return nodesByBreadth;
    }
    function initializeNodeDepth(nodesByBreadth, edges, height, width, nodeGap, orient) {
      var minKy = Infinity;
      each$f(nodesByBreadth, function(nodes) {
        var n = nodes.length;
        var sum2 = 0;
        each$f(nodes, function(node) {
          sum2 += node.getLayout().value;
        });
        var ky = orient === "vertical" ? (width - (n - 1) * nodeGap) / sum2 : (height - (n - 1) * nodeGap) / sum2;
        if (ky < minKy) {
          minKy = ky;
        }
      });
      each$f(nodesByBreadth, function(nodes) {
        each$f(nodes, function(node, i2) {
          var nodeDy = node.getLayout().value * minKy;
          if (orient === "vertical") {
            node.setLayout({
              x: i2
            }, true);
            node.setLayout({
              dx: nodeDy
            }, true);
          } else {
            node.setLayout({
              y: i2
            }, true);
            node.setLayout({
              dy: nodeDy
            }, true);
          }
        });
      });
      each$f(edges, function(edge) {
        var edgeDy = +edge.getValue() * minKy;
        edge.setLayout({
          dy: edgeDy
        }, true);
      });
    }
    function resolveCollisions(nodesByBreadth, nodeGap, height, width, orient) {
      var keyAttr = orient === "vertical" ? "x" : "y";
      each$f(nodesByBreadth, function(nodes) {
        nodes.sort(function(a2, b2) {
          return a2.getLayout()[keyAttr] - b2.getLayout()[keyAttr];
        });
        var nodeX;
        var node;
        var dy;
        var y0 = 0;
        var n = nodes.length;
        var nodeDyAttr = orient === "vertical" ? "dx" : "dy";
        for (var i2 = 0; i2 < n; i2++) {
          node = nodes[i2];
          dy = y0 - node.getLayout()[keyAttr];
          if (dy > 0) {
            nodeX = node.getLayout()[keyAttr] + dy;
            orient === "vertical" ? node.setLayout({
              x: nodeX
            }, true) : node.setLayout({
              y: nodeX
            }, true);
          }
          y0 = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap;
        }
        var viewWidth = orient === "vertical" ? width : height;
        dy = y0 - nodeGap - viewWidth;
        if (dy > 0) {
          nodeX = node.getLayout()[keyAttr] - dy;
          orient === "vertical" ? node.setLayout({
            x: nodeX
          }, true) : node.setLayout({
            y: nodeX
          }, true);
          y0 = nodeX;
          for (var i2 = n - 2; i2 >= 0; --i2) {
            node = nodes[i2];
            dy = node.getLayout()[keyAttr] + node.getLayout()[nodeDyAttr] + nodeGap - y0;
            if (dy > 0) {
              nodeX = node.getLayout()[keyAttr] - dy;
              orient === "vertical" ? node.setLayout({
                x: nodeX
              }, true) : node.setLayout({
                y: nodeX
              }, true);
            }
            y0 = node.getLayout()[keyAttr];
          }
        }
      });
    }
    function relaxRightToLeft(nodesByBreadth, alpha, orient) {
      each$f(nodesByBreadth.slice().reverse(), function(nodes) {
        each$f(nodes, function(node) {
          if (node.outEdges.length) {
            var y = sum(node.outEdges, weightedTarget, orient) / sum(node.outEdges, getEdgeValue);
            if (isNaN(y)) {
              var len2 = node.outEdges.length;
              y = len2 ? sum(node.outEdges, centerTarget, orient) / len2 : 0;
            }
            if (orient === "vertical") {
              var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;
              node.setLayout({
                x: nodeX
              }, true);
            } else {
              var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;
              node.setLayout({
                y: nodeY
              }, true);
            }
          }
        });
      });
    }
    function weightedTarget(edge, orient) {
      return center(edge.node2, orient) * edge.getValue();
    }
    function centerTarget(edge, orient) {
      return center(edge.node2, orient);
    }
    function weightedSource(edge, orient) {
      return center(edge.node1, orient) * edge.getValue();
    }
    function centerSource(edge, orient) {
      return center(edge.node1, orient);
    }
    function center(node, orient) {
      return orient === "vertical" ? node.getLayout().x + node.getLayout().dx / 2 : node.getLayout().y + node.getLayout().dy / 2;
    }
    function getEdgeValue(edge) {
      return edge.getValue();
    }
    function sum(array, cb, orient) {
      var sum2 = 0;
      var len2 = array.length;
      var i2 = -1;
      while (++i2 < len2) {
        var value = +cb(array[i2], orient);
        if (!isNaN(value)) {
          sum2 += value;
        }
      }
      return sum2;
    }
    function relaxLeftToRight(nodesByBreadth, alpha, orient) {
      each$f(nodesByBreadth, function(nodes) {
        each$f(nodes, function(node) {
          if (node.inEdges.length) {
            var y = sum(node.inEdges, weightedSource, orient) / sum(node.inEdges, getEdgeValue);
            if (isNaN(y)) {
              var len2 = node.inEdges.length;
              y = len2 ? sum(node.inEdges, centerSource, orient) / len2 : 0;
            }
            if (orient === "vertical") {
              var nodeX = node.getLayout().x + (y - center(node, orient)) * alpha;
              node.setLayout({
                x: nodeX
              }, true);
            } else {
              var nodeY = node.getLayout().y + (y - center(node, orient)) * alpha;
              node.setLayout({
                y: nodeY
              }, true);
            }
          }
        });
      });
    }
    function computeEdgeDepths(nodes, orient) {
      var keyAttr = orient === "vertical" ? "x" : "y";
      each$f(nodes, function(node) {
        node.outEdges.sort(function(a2, b2) {
          return a2.node2.getLayout()[keyAttr] - b2.node2.getLayout()[keyAttr];
        });
        node.inEdges.sort(function(a2, b2) {
          return a2.node1.getLayout()[keyAttr] - b2.node1.getLayout()[keyAttr];
        });
      });
      each$f(nodes, function(node) {
        var sy = 0;
        var ty = 0;
        each$f(node.outEdges, function(edge) {
          edge.setLayout({
            sy
          }, true);
          sy += edge.getLayout().dy;
        });
        each$f(node.inEdges, function(edge) {
          edge.setLayout({
            ty
          }, true);
          ty += edge.getLayout().dy;
        });
      });
    }
    function sankeyVisual(ecModel) {
      ecModel.eachSeriesByType("sankey", function(seriesModel) {
        var graph = seriesModel.getGraph();
        var nodes = graph.nodes;
        var edges = graph.edges;
        if (nodes.length) {
          var minValue_1 = Infinity;
          var maxValue_1 = -Infinity;
          each$f(nodes, function(node) {
            var nodeValue = node.getLayout().value;
            if (nodeValue < minValue_1) {
              minValue_1 = nodeValue;
            }
            if (nodeValue > maxValue_1) {
              maxValue_1 = nodeValue;
            }
          });
          each$f(nodes, function(node) {
            var mapping = new VisualMapping({
              type: "color",
              mappingMethod: "linear",
              dataExtent: [minValue_1, maxValue_1],
              visual: seriesModel.get("color")
            });
            var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);
            var customColor = node.getModel().get(["itemStyle", "color"]);
            if (customColor != null) {
              node.setVisual("color", customColor);
              node.setVisual("style", {
                fill: customColor
              });
            } else {
              node.setVisual("color", mapValueToColor);
              node.setVisual("style", {
                fill: mapValueToColor
              });
            }
          });
        }
        if (edges.length) {
          each$f(edges, function(edge) {
            var edgeStyle = edge.getModel().get("lineStyle");
            edge.setVisual("style", edgeStyle);
          });
        }
      });
    }
    function install$A(registers) {
      registers.registerChartView(SankeyView);
      registers.registerSeriesModel(SankeySeriesModel);
      registers.registerLayout(sankeyLayout);
      registers.registerVisual(sankeyVisual);
      registers.registerAction({
        type: "dragNode",
        event: "dragnode",
        // here can only use 'update' now, other value is not support in echarts.
        update: "update"
      }, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "sankey",
          query: payload
        }, function(seriesModel) {
          seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]);
        });
      });
    }
    var WhiskerBoxCommonMixin = (
      /** @class */
      function() {
        function WhiskerBoxCommonMixin2() {
        }
        WhiskerBoxCommonMixin2.prototype._hasEncodeRule = function(key) {
          var encodeRules = this.getEncode();
          return encodeRules && encodeRules.get(key) != null;
        };
        WhiskerBoxCommonMixin2.prototype.getInitialData = function(option, ecModel) {
          var ordinalMeta;
          var xAxisModel = ecModel.getComponent("xAxis", this.get("xAxisIndex"));
          var yAxisModel = ecModel.getComponent("yAxis", this.get("yAxisIndex"));
          var xAxisType = xAxisModel.get("type");
          var yAxisType = yAxisModel.get("type");
          var addOrdinal;
          if (xAxisType === "category") {
            option.layout = "horizontal";
            ordinalMeta = xAxisModel.getOrdinalMeta();
            addOrdinal = !this._hasEncodeRule("x");
          } else if (yAxisType === "category") {
            option.layout = "vertical";
            ordinalMeta = yAxisModel.getOrdinalMeta();
            addOrdinal = !this._hasEncodeRule("y");
          } else {
            option.layout = option.layout || "horizontal";
          }
          var coordDims = ["x", "y"];
          var baseAxisDimIndex = option.layout === "horizontal" ? 0 : 1;
          var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];
          var otherAxisDim = coordDims[1 - baseAxisDimIndex];
          var axisModels = [xAxisModel, yAxisModel];
          var baseAxisType = axisModels[baseAxisDimIndex].get("type");
          var otherAxisType = axisModels[1 - baseAxisDimIndex].get("type");
          var data = option.data;
          if (data && addOrdinal) {
            var newOptionData_1 = [];
            each$f(data, function(item, index) {
              var newItem;
              if (isArray$2(item)) {
                newItem = item.slice();
                item.unshift(index);
              } else if (isArray$2(item.value)) {
                newItem = extend$1({}, item);
                newItem.value = newItem.value.slice();
                item.value.unshift(index);
              } else {
                newItem = item;
              }
              newOptionData_1.push(newItem);
            });
            option.data = newOptionData_1;
          }
          var defaultValueDimensions = this.defaultValueDimensions;
          var coordDimensions = [{
            name: baseAxisDim,
            type: getDimensionTypeByAxis(baseAxisType),
            ordinalMeta,
            otherDims: {
              tooltip: false,
              itemName: 0
            },
            dimsDef: ["base"]
          }, {
            name: otherAxisDim,
            type: getDimensionTypeByAxis(otherAxisType),
            dimsDef: defaultValueDimensions.slice()
          }];
          return createSeriesDataSimply(this, {
            coordDimensions,
            dimensionsCount: defaultValueDimensions.length + 1,
            encodeDefaulter: curry$1(makeSeriesEncodeForAxisCoordSys, coordDimensions, this)
          });
        };
        WhiskerBoxCommonMixin2.prototype.getBaseAxis = function() {
          var dim = this._baseAxisDim;
          return this.ecModel.getComponent(dim + "Axis", this.get(dim + "AxisIndex")).axis;
        };
        return WhiskerBoxCommonMixin2;
      }()
    );
    var BoxplotSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(BoxplotSeriesModel2, _super);
        function BoxplotSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BoxplotSeriesModel2.type;
          _this.defaultValueDimensions = [{
            name: "min",
            defaultTooltip: true
          }, {
            name: "Q1",
            defaultTooltip: true
          }, {
            name: "median",
            defaultTooltip: true
          }, {
            name: "Q3",
            defaultTooltip: true
          }, {
            name: "max",
            defaultTooltip: true
          }];
          _this.visualDrawType = "stroke";
          return _this;
        }
        BoxplotSeriesModel2.type = "series.boxplot";
        BoxplotSeriesModel2.dependencies = ["xAxis", "yAxis", "grid"];
        BoxplotSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "cartesian2d",
          legendHoverLink: true,
          layout: null,
          boxWidth: [7, 50],
          itemStyle: {
            color: "#fff",
            borderWidth: 1
          },
          emphasis: {
            scale: true,
            itemStyle: {
              borderWidth: 2,
              shadowBlur: 5,
              shadowOffsetX: 1,
              shadowOffsetY: 1,
              shadowColor: "rgba(0,0,0,0.2)"
            }
          },
          animationDuration: 800
        };
        return BoxplotSeriesModel2;
      }(SeriesModel)
    );
    mixin(BoxplotSeriesModel, WhiskerBoxCommonMixin, true);
    var BoxplotView = (
      /** @class */
      function(_super) {
        __extends$1(BoxplotView2, _super);
        function BoxplotView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BoxplotView2.type;
          return _this;
        }
        BoxplotView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var group = this.group;
          var oldData = this._data;
          if (!this._data) {
            group.removeAll();
          }
          var constDim = seriesModel.get("layout") === "horizontal" ? 1 : 0;
          data.diff(oldData).add(function(newIdx) {
            if (data.hasValue(newIdx)) {
              var itemLayout = data.getItemLayout(newIdx);
              var symbolEl = createNormalBox$1(itemLayout, data, newIdx, constDim, true);
              data.setItemGraphicEl(newIdx, symbolEl);
              group.add(symbolEl);
            }
          }).update(function(newIdx, oldIdx) {
            var symbolEl = oldData.getItemGraphicEl(oldIdx);
            if (!data.hasValue(newIdx)) {
              group.remove(symbolEl);
              return;
            }
            var itemLayout = data.getItemLayout(newIdx);
            if (!symbolEl) {
              symbolEl = createNormalBox$1(itemLayout, data, newIdx, constDim);
            } else {
              saveOldStyle(symbolEl);
              updateNormalBoxData(itemLayout, symbolEl, data, newIdx);
            }
            group.add(symbolEl);
            data.setItemGraphicEl(newIdx, symbolEl);
          }).remove(function(oldIdx) {
            var el = oldData.getItemGraphicEl(oldIdx);
            el && group.remove(el);
          }).execute();
          this._data = data;
        };
        BoxplotView2.prototype.remove = function(ecModel) {
          var group = this.group;
          var data = this._data;
          this._data = null;
          data && data.eachItemGraphicEl(function(el) {
            el && group.remove(el);
          });
        };
        BoxplotView2.type = "boxplot";
        return BoxplotView2;
      }(ChartView)
    );
    var BoxPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function BoxPathShape2() {
        }
        return BoxPathShape2;
      }()
    );
    var BoxPath = (
      /** @class */
      function(_super) {
        __extends$1(BoxPath2, _super);
        function BoxPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "boxplotBoxPath";
          return _this;
        }
        BoxPath2.prototype.getDefaultShape = function() {
          return new BoxPathShape();
        };
        BoxPath2.prototype.buildPath = function(ctx, shape) {
          var ends = shape.points;
          var i2 = 0;
          ctx.moveTo(ends[i2][0], ends[i2][1]);
          i2++;
          for (; i2 < 4; i2++) {
            ctx.lineTo(ends[i2][0], ends[i2][1]);
          }
          ctx.closePath();
          for (; i2 < ends.length; i2++) {
            ctx.moveTo(ends[i2][0], ends[i2][1]);
            i2++;
            ctx.lineTo(ends[i2][0], ends[i2][1]);
          }
        };
        return BoxPath2;
      }(Path)
    );
    function createNormalBox$1(itemLayout, data, dataIndex, constDim, isInit) {
      var ends = itemLayout.ends;
      var el = new BoxPath({
        shape: {
          points: isInit ? transInit$1(ends, constDim, itemLayout) : ends
        }
      });
      updateNormalBoxData(itemLayout, el, data, dataIndex, isInit);
      return el;
    }
    function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) {
      var seriesModel = data.hostModel;
      var updateMethod = graphic[isInit ? "initProps" : "updateProps"];
      updateMethod(el, {
        shape: {
          points: itemLayout.ends
        }
      }, seriesModel, dataIndex);
      el.useStyle(data.getItemVisual(dataIndex, "style"));
      el.style.strokeNoScale = true;
      el.z2 = 100;
      var itemModel = data.getItemModel(dataIndex);
      var emphasisModel = itemModel.getModel("emphasis");
      setStatesStylesFromModel(el, itemModel);
      toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
    }
    function transInit$1(points2, dim, itemLayout) {
      return map$1(points2, function(point) {
        point = point.slice();
        point[dim] = itemLayout.initBaseline;
        return point;
      });
    }
    var each$9 = each$f;
    function boxplotLayout(ecModel) {
      var groupResult = groupSeriesByAxis(ecModel);
      each$9(groupResult, function(groupItem) {
        var seriesModels = groupItem.seriesModels;
        if (!seriesModels.length) {
          return;
        }
        calculateBase(groupItem);
        each$9(seriesModels, function(seriesModel, idx) {
          layoutSingleSeries(seriesModel, groupItem.boxOffsetList[idx], groupItem.boxWidthList[idx]);
        });
      });
    }
    function groupSeriesByAxis(ecModel) {
      var result = [];
      var axisList = [];
      ecModel.eachSeriesByType("boxplot", function(seriesModel) {
        var baseAxis = seriesModel.getBaseAxis();
        var idx = indexOf(axisList, baseAxis);
        if (idx < 0) {
          idx = axisList.length;
          axisList[idx] = baseAxis;
          result[idx] = {
            axis: baseAxis,
            seriesModels: []
          };
        }
        result[idx].seriesModels.push(seriesModel);
      });
      return result;
    }
    function calculateBase(groupItem) {
      var baseAxis = groupItem.axis;
      var seriesModels = groupItem.seriesModels;
      var seriesCount = seriesModels.length;
      var boxWidthList = groupItem.boxWidthList = [];
      var boxOffsetList = groupItem.boxOffsetList = [];
      var boundList = [];
      var bandWidth;
      if (baseAxis.type === "category") {
        bandWidth = baseAxis.getBandWidth();
      } else {
        var maxDataCount_1 = 0;
        each$9(seriesModels, function(seriesModel) {
          maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());
        });
        var extent3 = baseAxis.getExtent();
        bandWidth = Math.abs(extent3[1] - extent3[0]) / maxDataCount_1;
      }
      each$9(seriesModels, function(seriesModel) {
        var boxWidthBound = seriesModel.get("boxWidth");
        if (!isArray$2(boxWidthBound)) {
          boxWidthBound = [boxWidthBound, boxWidthBound];
        }
        boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);
      });
      var availableWidth = bandWidth * 0.8 - 2;
      var boxGap = availableWidth / seriesCount * 0.3;
      var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;
      var base2 = boxWidth / 2 - availableWidth / 2;
      each$9(seriesModels, function(seriesModel, idx) {
        boxOffsetList.push(base2);
        base2 += boxGap + boxWidth;
        boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));
      });
    }
    function layoutSingleSeries(seriesModel, offset2, boxWidth) {
      var coordSys = seriesModel.coordinateSystem;
      var data = seriesModel.getData();
      var halfWidth = boxWidth / 2;
      var cDimIdx = seriesModel.get("layout") === "horizontal" ? 0 : 1;
      var vDimIdx = 1 - cDimIdx;
      var coordDims = ["x", "y"];
      var cDim = data.mapDimension(coordDims[cDimIdx]);
      var vDims = data.mapDimensionsAll(coordDims[vDimIdx]);
      if (cDim == null || vDims.length < 5) {
        return;
      }
      for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) {
        var axisDimVal = data.get(cDim, dataIndex);
        var median = getPoint(axisDimVal, vDims[2], dataIndex);
        var end1 = getPoint(axisDimVal, vDims[0], dataIndex);
        var end2 = getPoint(axisDimVal, vDims[1], dataIndex);
        var end4 = getPoint(axisDimVal, vDims[3], dataIndex);
        var end5 = getPoint(axisDimVal, vDims[4], dataIndex);
        var ends = [];
        addBodyEnd(ends, end2, false);
        addBodyEnd(ends, end4, true);
        ends.push(end1, end2, end5, end4);
        layEndLine(ends, end1);
        layEndLine(ends, end5);
        layEndLine(ends, median);
        data.setItemLayout(dataIndex, {
          initBaseline: median[vDimIdx],
          ends
        });
      }
      function getPoint(axisDimVal2, dim, dataIndex2) {
        var val = data.get(dim, dataIndex2);
        var p2 = [];
        p2[cDimIdx] = axisDimVal2;
        p2[vDimIdx] = val;
        var point;
        if (isNaN(axisDimVal2) || isNaN(val)) {
          point = [NaN, NaN];
        } else {
          point = coordSys.dataToPoint(p2);
          point[cDimIdx] += offset2;
        }
        return point;
      }
      function addBodyEnd(ends2, point, start2) {
        var point1 = point.slice();
        var point2 = point.slice();
        point1[cDimIdx] += halfWidth;
        point2[cDimIdx] -= halfWidth;
        start2 ? ends2.push(point1, point2) : ends2.push(point2, point1);
      }
      function layEndLine(ends2, endCenter) {
        var from = endCenter.slice();
        var to = endCenter.slice();
        from[cDimIdx] -= halfWidth;
        to[cDimIdx] += halfWidth;
        ends2.push(from, to);
      }
    }
    function prepareBoxplotData(rawData, opt) {
      opt = opt || {};
      var boxData = [];
      var outliers = [];
      var boundIQR = opt.boundIQR;
      var useExtreme = boundIQR === "none" || boundIQR === 0;
      for (var i2 = 0; i2 < rawData.length; i2++) {
        var ascList = asc$2(rawData[i2].slice());
        var Q1 = quantile(ascList, 0.25);
        var Q2 = quantile(ascList, 0.5);
        var Q3 = quantile(ascList, 0.75);
        var min3 = ascList[0];
        var max3 = ascList[ascList.length - 1];
        var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);
        var low = useExtreme ? min3 : Math.max(min3, Q1 - bound);
        var high = useExtreme ? max3 : Math.min(max3, Q3 + bound);
        var itemNameFormatter = opt.itemNameFormatter;
        var itemName = isFunction$1(itemNameFormatter) ? itemNameFormatter({
          value: i2
        }) : isString$1(itemNameFormatter) ? itemNameFormatter.replace("{value}", i2 + "") : i2 + "";
        boxData.push([itemName, low, Q1, Q2, Q3, high]);
        for (var j = 0; j < ascList.length; j++) {
          var dataItem = ascList[j];
          if (dataItem < low || dataItem > high) {
            var outlier = [itemName, dataItem];
            outliers.push(outlier);
          }
        }
      }
      return {
        boxData,
        outliers
      };
    }
    var boxplotTransform = {
      type: "echarts:boxplot",
      transform: function transform2(params) {
        var upstream = params.upstream;
        if (upstream.sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS) {
          var errMsg = "";
          throwError(errMsg);
        }
        var result = prepareBoxplotData(upstream.getRawData(), params.config);
        return [{
          dimensions: ["ItemName", "Low", "Q1", "Q2", "Q3", "High"],
          data: result.boxData
        }, {
          data: result.outliers
        }];
      }
    };
    function install$z(registers) {
      registers.registerSeriesModel(BoxplotSeriesModel);
      registers.registerChartView(BoxplotView);
      registers.registerLayout(boxplotLayout);
      registers.registerTransform(boxplotTransform);
    }
    var positiveBorderColorQuery = ["itemStyle", "borderColor"];
    var negativeBorderColorQuery = ["itemStyle", "borderColor0"];
    var dojiBorderColorQuery = ["itemStyle", "borderColorDoji"];
    var positiveColorQuery = ["itemStyle", "color"];
    var negativeColorQuery = ["itemStyle", "color0"];
    function getColor(sign, model) {
      return model.get(sign > 0 ? positiveColorQuery : negativeColorQuery);
    }
    function getBorderColor(sign, model) {
      return model.get(sign === 0 ? dojiBorderColorQuery : sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery);
    }
    var candlestickVisual = {
      seriesType: "candlestick",
      plan: createRenderPlanner(),
      // For legend.
      performRawSeries: true,
      reset: function(seriesModel, ecModel) {
        if (ecModel.isSeriesFiltered(seriesModel)) {
          return;
        }
        var isLargeRender = seriesModel.pipelineContext.large;
        return !isLargeRender && {
          progress: function(params, data) {
            var dataIndex;
            while ((dataIndex = params.next()) != null) {
              var itemModel = data.getItemModel(dataIndex);
              var sign = data.getItemLayout(dataIndex).sign;
              var style = itemModel.getItemStyle();
              style.fill = getColor(sign, itemModel);
              style.stroke = getBorderColor(sign, itemModel) || style.fill;
              var existsStyle = data.ensureUniqueItemVisual(dataIndex, "style");
              extend$1(existsStyle, style);
            }
          }
        };
      }
    };
    var SKIP_PROPS = ["color", "borderColor"];
    var CandlestickView = (
      /** @class */
      function(_super) {
        __extends$1(CandlestickView2, _super);
        function CandlestickView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CandlestickView2.type;
          return _this;
        }
        CandlestickView2.prototype.render = function(seriesModel, ecModel, api2) {
          this.group.removeClipPath();
          this._progressiveEls = null;
          this._updateDrawMode(seriesModel);
          this._isLargeDraw ? this._renderLarge(seriesModel) : this._renderNormal(seriesModel);
        };
        CandlestickView2.prototype.incrementalPrepareRender = function(seriesModel, ecModel, api2) {
          this._clear();
          this._updateDrawMode(seriesModel);
        };
        CandlestickView2.prototype.incrementalRender = function(params, seriesModel, ecModel, api2) {
          this._progressiveEls = [];
          this._isLargeDraw ? this._incrementalRenderLarge(params, seriesModel) : this._incrementalRenderNormal(params, seriesModel);
        };
        CandlestickView2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        CandlestickView2.prototype._updateDrawMode = function(seriesModel) {
          var isLargeDraw = seriesModel.pipelineContext.large;
          if (this._isLargeDraw == null || isLargeDraw !== this._isLargeDraw) {
            this._isLargeDraw = isLargeDraw;
            this._clear();
          }
        };
        CandlestickView2.prototype._renderNormal = function(seriesModel) {
          var data = seriesModel.getData();
          var oldData = this._data;
          var group = this.group;
          var isSimpleBox = data.getLayout("isSimpleBox");
          var needsClip = seriesModel.get("clip", true);
          var coord = seriesModel.coordinateSystem;
          var clipArea = coord.getArea && coord.getArea();
          if (!this._data) {
            group.removeAll();
          }
          data.diff(oldData).add(function(newIdx) {
            if (data.hasValue(newIdx)) {
              var itemLayout = data.getItemLayout(newIdx);
              if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {
                return;
              }
              var el = createNormalBox(itemLayout, newIdx, true);
              initProps(el, {
                shape: {
                  points: itemLayout.ends
                }
              }, seriesModel, newIdx);
              setBoxCommon(el, data, newIdx, isSimpleBox);
              group.add(el);
              data.setItemGraphicEl(newIdx, el);
            }
          }).update(function(newIdx, oldIdx) {
            var el = oldData.getItemGraphicEl(oldIdx);
            if (!data.hasValue(newIdx)) {
              group.remove(el);
              return;
            }
            var itemLayout = data.getItemLayout(newIdx);
            if (needsClip && isNormalBoxClipped(clipArea, itemLayout)) {
              group.remove(el);
              return;
            }
            if (!el) {
              el = createNormalBox(itemLayout);
            } else {
              updateProps$1(el, {
                shape: {
                  points: itemLayout.ends
                }
              }, seriesModel, newIdx);
              saveOldStyle(el);
            }
            setBoxCommon(el, data, newIdx, isSimpleBox);
            group.add(el);
            data.setItemGraphicEl(newIdx, el);
          }).remove(function(oldIdx) {
            var el = oldData.getItemGraphicEl(oldIdx);
            el && group.remove(el);
          }).execute();
          this._data = data;
        };
        CandlestickView2.prototype._renderLarge = function(seriesModel) {
          this._clear();
          createLarge(seriesModel, this.group);
          var clipPath = seriesModel.get("clip", true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;
          if (clipPath) {
            this.group.setClipPath(clipPath);
          } else {
            this.group.removeClipPath();
          }
        };
        CandlestickView2.prototype._incrementalRenderNormal = function(params, seriesModel) {
          var data = seriesModel.getData();
          var isSimpleBox = data.getLayout("isSimpleBox");
          var dataIndex;
          while ((dataIndex = params.next()) != null) {
            var itemLayout = data.getItemLayout(dataIndex);
            var el = createNormalBox(itemLayout);
            setBoxCommon(el, data, dataIndex, isSimpleBox);
            el.incremental = true;
            this.group.add(el);
            this._progressiveEls.push(el);
          }
        };
        CandlestickView2.prototype._incrementalRenderLarge = function(params, seriesModel) {
          createLarge(seriesModel, this.group, this._progressiveEls, true);
        };
        CandlestickView2.prototype.remove = function(ecModel) {
          this._clear();
        };
        CandlestickView2.prototype._clear = function() {
          this.group.removeAll();
          this._data = null;
        };
        CandlestickView2.type = "candlestick";
        return CandlestickView2;
      }(ChartView)
    );
    var NormalBoxPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function NormalBoxPathShape2() {
        }
        return NormalBoxPathShape2;
      }()
    );
    var NormalBoxPath = (
      /** @class */
      function(_super) {
        __extends$1(NormalBoxPath2, _super);
        function NormalBoxPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "normalCandlestickBox";
          return _this;
        }
        NormalBoxPath2.prototype.getDefaultShape = function() {
          return new NormalBoxPathShape();
        };
        NormalBoxPath2.prototype.buildPath = function(ctx, shape) {
          var ends = shape.points;
          if (this.__simpleBox) {
            ctx.moveTo(ends[4][0], ends[4][1]);
            ctx.lineTo(ends[6][0], ends[6][1]);
          } else {
            ctx.moveTo(ends[0][0], ends[0][1]);
            ctx.lineTo(ends[1][0], ends[1][1]);
            ctx.lineTo(ends[2][0], ends[2][1]);
            ctx.lineTo(ends[3][0], ends[3][1]);
            ctx.closePath();
            ctx.moveTo(ends[4][0], ends[4][1]);
            ctx.lineTo(ends[5][0], ends[5][1]);
            ctx.moveTo(ends[6][0], ends[6][1]);
            ctx.lineTo(ends[7][0], ends[7][1]);
          }
        };
        return NormalBoxPath2;
      }(Path)
    );
    function createNormalBox(itemLayout, dataIndex, isInit) {
      var ends = itemLayout.ends;
      return new NormalBoxPath({
        shape: {
          points: isInit ? transInit(ends, itemLayout) : ends
        },
        z2: 100
      });
    }
    function isNormalBoxClipped(clipArea, itemLayout) {
      var clipped = true;
      for (var i2 = 0; i2 < itemLayout.ends.length; i2++) {
        if (clipArea.contain(itemLayout.ends[i2][0], itemLayout.ends[i2][1])) {
          clipped = false;
          break;
        }
      }
      return clipped;
    }
    function setBoxCommon(el, data, dataIndex, isSimpleBox) {
      var itemModel = data.getItemModel(dataIndex);
      el.useStyle(data.getItemVisual(dataIndex, "style"));
      el.style.strokeNoScale = true;
      el.__simpleBox = isSimpleBox;
      setStatesStylesFromModel(el, itemModel);
      var sign = data.getItemLayout(dataIndex).sign;
      each$f(el.states, function(state, stateName) {
        var stateModel = itemModel.getModel(stateName);
        var color2 = getColor(sign, stateModel);
        var borderColor = getBorderColor(sign, stateModel) || color2;
        var stateStyle = state.style || (state.style = {});
        color2 && (stateStyle.fill = color2);
        borderColor && (stateStyle.stroke = borderColor);
      });
      var emphasisModel = itemModel.getModel("emphasis");
      toggleHoverEmphasis(el, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
    }
    function transInit(points2, itemLayout) {
      return map$1(points2, function(point) {
        point = point.slice();
        point[1] = itemLayout.initBaseline;
        return point;
      });
    }
    var LargeBoxPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function LargeBoxPathShape2() {
        }
        return LargeBoxPathShape2;
      }()
    );
    var LargeBoxPath = (
      /** @class */
      function(_super) {
        __extends$1(LargeBoxPath2, _super);
        function LargeBoxPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this.type = "largeCandlestickBox";
          return _this;
        }
        LargeBoxPath2.prototype.getDefaultShape = function() {
          return new LargeBoxPathShape();
        };
        LargeBoxPath2.prototype.buildPath = function(ctx, shape) {
          var points2 = shape.points;
          for (var i2 = 0; i2 < points2.length; ) {
            if (this.__sign === points2[i2++]) {
              var x2 = points2[i2++];
              ctx.moveTo(x2, points2[i2++]);
              ctx.lineTo(x2, points2[i2++]);
            } else {
              i2 += 3;
            }
          }
        };
        return LargeBoxPath2;
      }(Path)
    );
    function createLarge(seriesModel, group, progressiveEls, incremental) {
      var data = seriesModel.getData();
      var largePoints = data.getLayout("largePoints");
      var elP = new LargeBoxPath({
        shape: {
          points: largePoints
        },
        __sign: 1,
        ignoreCoarsePointer: true
      });
      group.add(elP);
      var elN = new LargeBoxPath({
        shape: {
          points: largePoints
        },
        __sign: -1,
        ignoreCoarsePointer: true
      });
      group.add(elN);
      var elDoji = new LargeBoxPath({
        shape: {
          points: largePoints
        },
        __sign: 0,
        ignoreCoarsePointer: true
      });
      group.add(elDoji);
      setLargeStyle(1, elP, seriesModel);
      setLargeStyle(-1, elN, seriesModel);
      setLargeStyle(0, elDoji, seriesModel);
      if (incremental) {
        elP.incremental = true;
        elN.incremental = true;
      }
      if (progressiveEls) {
        progressiveEls.push(elP, elN);
      }
    }
    function setLargeStyle(sign, el, seriesModel, data) {
      var borderColor = getBorderColor(sign, seriesModel) || getColor(sign, seriesModel);
      var itemStyle = seriesModel.getModel("itemStyle").getItemStyle(SKIP_PROPS);
      el.useStyle(itemStyle);
      el.style.fill = null;
      el.style.stroke = borderColor;
    }
    var CandlestickSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(CandlestickSeriesModel2, _super);
        function CandlestickSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CandlestickSeriesModel2.type;
          _this.defaultValueDimensions = [{
            name: "open",
            defaultTooltip: true
          }, {
            name: "close",
            defaultTooltip: true
          }, {
            name: "lowest",
            defaultTooltip: true
          }, {
            name: "highest",
            defaultTooltip: true
          }];
          return _this;
        }
        CandlestickSeriesModel2.prototype.getShadowDim = function() {
          return "open";
        };
        CandlestickSeriesModel2.prototype.brushSelector = function(dataIndex, data, selectors) {
          var itemLayout = data.getItemLayout(dataIndex);
          return itemLayout && selectors.rect(itemLayout.brushRect);
        };
        CandlestickSeriesModel2.type = "series.candlestick";
        CandlestickSeriesModel2.dependencies = ["xAxis", "yAxis", "grid"];
        CandlestickSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          coordinateSystem: "cartesian2d",
          legendHoverLink: true,
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          layout: null,
          clip: true,
          itemStyle: {
            color: "#eb5454",
            color0: "#47b262",
            borderColor: "#eb5454",
            borderColor0: "#47b262",
            borderColorDoji: null,
            // borderColor: '#d24040',
            // borderColor0: '#398f4f',
            borderWidth: 1
          },
          emphasis: {
            itemStyle: {
              borderWidth: 2
            }
          },
          barMaxWidth: null,
          barMinWidth: null,
          barWidth: null,
          large: true,
          largeThreshold: 600,
          progressive: 3e3,
          progressiveThreshold: 1e4,
          progressiveChunkMode: "mod",
          animationEasing: "linear",
          animationDuration: 300
        };
        return CandlestickSeriesModel2;
      }(SeriesModel)
    );
    mixin(CandlestickSeriesModel, WhiskerBoxCommonMixin, true);
    function candlestickPreprocessor(option) {
      if (!option || !isArray$2(option.series)) {
        return;
      }
      each$f(option.series, function(seriesItem) {
        if (isObject$5(seriesItem) && seriesItem.type === "k") {
          seriesItem.type = "candlestick";
        }
      });
    }
    var candlestickLayout = {
      seriesType: "candlestick",
      plan: createRenderPlanner(),
      reset: function(seriesModel) {
        var coordSys = seriesModel.coordinateSystem;
        var data = seriesModel.getData();
        var candleWidth = calculateCandleWidth(seriesModel, data);
        var cDimIdx = 0;
        var vDimIdx = 1;
        var coordDims = ["x", "y"];
        var cDimI = data.getDimensionIndex(data.mapDimension(coordDims[cDimIdx]));
        var vDimsI = map$1(data.mapDimensionsAll(coordDims[vDimIdx]), data.getDimensionIndex, data);
        var openDimI = vDimsI[0];
        var closeDimI = vDimsI[1];
        var lowestDimI = vDimsI[2];
        var highestDimI = vDimsI[3];
        data.setLayout({
          candleWidth,
          // The value is experimented visually.
          isSimpleBox: candleWidth <= 1.3
        });
        if (cDimI < 0 || vDimsI.length < 4) {
          return;
        }
        return {
          progress: seriesModel.pipelineContext.large ? largeProgress : normalProgress
        };
        function normalProgress(params, data2) {
          var dataIndex;
          var store2 = data2.getStore();
          while ((dataIndex = params.next()) != null) {
            var axisDimVal = store2.get(cDimI, dataIndex);
            var openVal = store2.get(openDimI, dataIndex);
            var closeVal = store2.get(closeDimI, dataIndex);
            var lowestVal = store2.get(lowestDimI, dataIndex);
            var highestVal = store2.get(highestDimI, dataIndex);
            var ocLow = Math.min(openVal, closeVal);
            var ocHigh = Math.max(openVal, closeVal);
            var ocLowPoint = getPoint(ocLow, axisDimVal);
            var ocHighPoint = getPoint(ocHigh, axisDimVal);
            var lowestPoint = getPoint(lowestVal, axisDimVal);
            var highestPoint = getPoint(highestVal, axisDimVal);
            var ends = [];
            addBodyEnd(ends, ocHighPoint, 0);
            addBodyEnd(ends, ocLowPoint, 1);
            ends.push(subPixelOptimizePoint(highestPoint), subPixelOptimizePoint(ocHighPoint), subPixelOptimizePoint(lowestPoint), subPixelOptimizePoint(ocLowPoint));
            var itemModel = data2.getItemModel(dataIndex);
            var hasDojiColor = !!itemModel.get(["itemStyle", "borderColorDoji"]);
            data2.setItemLayout(dataIndex, {
              sign: getSign(store2, dataIndex, openVal, closeVal, closeDimI, hasDojiColor),
              initBaseline: openVal > closeVal ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx],
              ends,
              brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal)
            });
          }
          function getPoint(val, axisDimVal2) {
            var p2 = [];
            p2[cDimIdx] = axisDimVal2;
            p2[vDimIdx] = val;
            return isNaN(axisDimVal2) || isNaN(val) ? [NaN, NaN] : coordSys.dataToPoint(p2);
          }
          function addBodyEnd(ends2, point, start2) {
            var point1 = point.slice();
            var point2 = point.slice();
            point1[cDimIdx] = subPixelOptimize(point1[cDimIdx] + candleWidth / 2, 1, false);
            point2[cDimIdx] = subPixelOptimize(point2[cDimIdx] - candleWidth / 2, 1, true);
            start2 ? ends2.push(point1, point2) : ends2.push(point2, point1);
          }
          function makeBrushRect(lowestVal2, highestVal2, axisDimVal2) {
            var pmin = getPoint(lowestVal2, axisDimVal2);
            var pmax = getPoint(highestVal2, axisDimVal2);
            pmin[cDimIdx] -= candleWidth / 2;
            pmax[cDimIdx] -= candleWidth / 2;
            return {
              x: pmin[0],
              y: pmin[1],
              width: candleWidth,
              height: pmax[1] - pmin[1]
            };
          }
          function subPixelOptimizePoint(point) {
            point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1);
            return point;
          }
        }
        function largeProgress(params, data2) {
          var points2 = createFloat32Array(params.count * 4);
          var offset2 = 0;
          var point;
          var tmpIn = [];
          var tmpOut = [];
          var dataIndex;
          var store2 = data2.getStore();
          var hasDojiColor = !!seriesModel.get(["itemStyle", "borderColorDoji"]);
          while ((dataIndex = params.next()) != null) {
            var axisDimVal = store2.get(cDimI, dataIndex);
            var openVal = store2.get(openDimI, dataIndex);
            var closeVal = store2.get(closeDimI, dataIndex);
            var lowestVal = store2.get(lowestDimI, dataIndex);
            var highestVal = store2.get(highestDimI, dataIndex);
            if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) {
              points2[offset2++] = NaN;
              offset2 += 3;
              continue;
            }
            points2[offset2++] = getSign(store2, dataIndex, openVal, closeVal, closeDimI, hasDojiColor);
            tmpIn[cDimIdx] = axisDimVal;
            tmpIn[vDimIdx] = lowestVal;
            point = coordSys.dataToPoint(tmpIn, null, tmpOut);
            points2[offset2++] = point ? point[0] : NaN;
            points2[offset2++] = point ? point[1] : NaN;
            tmpIn[vDimIdx] = highestVal;
            point = coordSys.dataToPoint(tmpIn, null, tmpOut);
            points2[offset2++] = point ? point[1] : NaN;
          }
          data2.setLayout("largePoints", points2);
        }
      }
    };
    function getSign(store2, dataIndex, openVal, closeVal, closeDimI, hasDojiColor) {
      var sign;
      if (openVal > closeVal) {
        sign = -1;
      } else if (openVal < closeVal) {
        sign = 1;
      } else {
        sign = hasDojiColor ? 0 : dataIndex > 0 ? store2.get(closeDimI, dataIndex - 1) <= closeVal ? 1 : -1 : 1;
      }
      return sign;
    }
    function calculateCandleWidth(seriesModel, data) {
      var baseAxis = seriesModel.getBaseAxis();
      var extent3;
      var bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : (extent3 = baseAxis.getExtent(), Math.abs(extent3[1] - extent3[0]) / data.count());
      var barMaxWidth = parsePercent(retrieve2(seriesModel.get("barMaxWidth"), bandWidth), bandWidth);
      var barMinWidth = parsePercent(retrieve2(seriesModel.get("barMinWidth"), 1), bandWidth);
      var barWidth = seriesModel.get("barWidth");
      return barWidth != null ? parsePercent(barWidth, bandWidth) : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth);
    }
    function install$y(registers) {
      registers.registerChartView(CandlestickView);
      registers.registerSeriesModel(CandlestickSeriesModel);
      registers.registerPreprocessor(candlestickPreprocessor);
      registers.registerVisual(candlestickVisual);
      registers.registerLayout(candlestickLayout);
    }
    function updateRipplePath(rippleGroup, effectCfg) {
      var color2 = effectCfg.rippleEffectColor || effectCfg.color;
      rippleGroup.eachChild(function(ripplePath) {
        ripplePath.attr({
          z: effectCfg.z,
          zlevel: effectCfg.zlevel,
          style: {
            stroke: effectCfg.brushType === "stroke" ? color2 : null,
            fill: effectCfg.brushType === "fill" ? color2 : null
          }
        });
      });
    }
    var EffectSymbol = (
      /** @class */
      function(_super) {
        __extends$1(EffectSymbol2, _super);
        function EffectSymbol2(data, idx) {
          var _this = _super.call(this) || this;
          var symbol = new Symbol$1(data, idx);
          var rippleGroup = new Group$3();
          _this.add(symbol);
          _this.add(rippleGroup);
          _this.updateData(data, idx);
          return _this;
        }
        EffectSymbol2.prototype.stopEffectAnimation = function() {
          this.childAt(1).removeAll();
        };
        EffectSymbol2.prototype.startEffectAnimation = function(effectCfg) {
          var symbolType = effectCfg.symbolType;
          var color2 = effectCfg.color;
          var rippleNumber = effectCfg.rippleNumber;
          var rippleGroup = this.childAt(1);
          for (var i2 = 0; i2 < rippleNumber; i2++) {
            var ripplePath = createSymbol$1(symbolType, -1, -1, 2, 2, color2);
            ripplePath.attr({
              style: {
                strokeNoScale: true
              },
              z2: 99,
              silent: true,
              scaleX: 0.5,
              scaleY: 0.5
            });
            var delay = -i2 / rippleNumber * effectCfg.period + effectCfg.effectOffset;
            ripplePath.animate("", true).when(effectCfg.period, {
              scaleX: effectCfg.rippleScale / 2,
              scaleY: effectCfg.rippleScale / 2
            }).delay(delay).start();
            ripplePath.animateStyle(true).when(effectCfg.period, {
              opacity: 0
            }).delay(delay).start();
            rippleGroup.add(ripplePath);
          }
          updateRipplePath(rippleGroup, effectCfg);
        };
        EffectSymbol2.prototype.updateEffectAnimation = function(effectCfg) {
          var oldEffectCfg = this._effectCfg;
          var rippleGroup = this.childAt(1);
          var DIFFICULT_PROPS = ["symbolType", "period", "rippleScale", "rippleNumber"];
          for (var i2 = 0; i2 < DIFFICULT_PROPS.length; i2++) {
            var propName = DIFFICULT_PROPS[i2];
            if (oldEffectCfg[propName] !== effectCfg[propName]) {
              this.stopEffectAnimation();
              this.startEffectAnimation(effectCfg);
              return;
            }
          }
          updateRipplePath(rippleGroup, effectCfg);
        };
        EffectSymbol2.prototype.highlight = function() {
          enterEmphasis(this);
        };
        EffectSymbol2.prototype.downplay = function() {
          leaveEmphasis(this);
        };
        EffectSymbol2.prototype.getSymbolType = function() {
          var symbol = this.childAt(0);
          return symbol && symbol.getSymbolType();
        };
        EffectSymbol2.prototype.updateData = function(data, idx) {
          var _this = this;
          var seriesModel = data.hostModel;
          this.childAt(0).updateData(data, idx);
          var rippleGroup = this.childAt(1);
          var itemModel = data.getItemModel(idx);
          var symbolType = data.getItemVisual(idx, "symbol");
          var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, "symbolSize"));
          var symbolStyle = data.getItemVisual(idx, "style");
          var color2 = symbolStyle && symbolStyle.fill;
          var emphasisModel = itemModel.getModel("emphasis");
          rippleGroup.setScale(symbolSize);
          rippleGroup.traverse(function(ripplePath) {
            ripplePath.setStyle("fill", color2);
          });
          var symbolOffset = normalizeSymbolOffset(data.getItemVisual(idx, "symbolOffset"), symbolSize);
          if (symbolOffset) {
            rippleGroup.x = symbolOffset[0];
            rippleGroup.y = symbolOffset[1];
          }
          var symbolRotate = data.getItemVisual(idx, "symbolRotate");
          rippleGroup.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
          var effectCfg = {};
          effectCfg.showEffectOn = seriesModel.get("showEffectOn");
          effectCfg.rippleScale = itemModel.get(["rippleEffect", "scale"]);
          effectCfg.brushType = itemModel.get(["rippleEffect", "brushType"]);
          effectCfg.period = itemModel.get(["rippleEffect", "period"]) * 1e3;
          effectCfg.effectOffset = idx / data.count();
          effectCfg.z = seriesModel.getShallow("z") || 0;
          effectCfg.zlevel = seriesModel.getShallow("zlevel") || 0;
          effectCfg.symbolType = symbolType;
          effectCfg.color = color2;
          effectCfg.rippleEffectColor = itemModel.get(["rippleEffect", "color"]);
          effectCfg.rippleNumber = itemModel.get(["rippleEffect", "number"]);
          if (effectCfg.showEffectOn === "render") {
            this._effectCfg ? this.updateEffectAnimation(effectCfg) : this.startEffectAnimation(effectCfg);
            this._effectCfg = effectCfg;
          } else {
            this._effectCfg = null;
            this.stopEffectAnimation();
            this.onHoverStateChange = function(toState) {
              if (toState === "emphasis") {
                if (effectCfg.showEffectOn !== "render") {
                  _this.startEffectAnimation(effectCfg);
                }
              } else if (toState === "normal") {
                if (effectCfg.showEffectOn !== "render") {
                  _this.stopEffectAnimation();
                }
              }
            };
          }
          this._effectCfg = effectCfg;
          toggleHoverEmphasis(this, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
        };
        EffectSymbol2.prototype.fadeOut = function(cb) {
          cb && cb();
        };
        return EffectSymbol2;
      }(Group$3)
    );
    var EffectScatterView = (
      /** @class */
      function(_super) {
        __extends$1(EffectScatterView2, _super);
        function EffectScatterView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = EffectScatterView2.type;
          return _this;
        }
        EffectScatterView2.prototype.init = function() {
          this._symbolDraw = new SymbolDraw(EffectSymbol);
        };
        EffectScatterView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var effectSymbolDraw = this._symbolDraw;
          effectSymbolDraw.updateData(data, {
            clipShape: this._getClipShape(seriesModel)
          });
          this.group.add(effectSymbolDraw.group);
        };
        EffectScatterView2.prototype._getClipShape = function(seriesModel) {
          var coordSys = seriesModel.coordinateSystem;
          var clipArea = coordSys && coordSys.getArea && coordSys.getArea();
          return seriesModel.get("clip", true) ? clipArea : null;
        };
        EffectScatterView2.prototype.updateTransform = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          this.group.dirty();
          var res = pointsLayout("").reset(seriesModel, ecModel, api2);
          if (res.progress) {
            res.progress({
              start: 0,
              end: data.count(),
              count: data.count()
            }, data);
          }
          this._symbolDraw.updateLayout();
        };
        EffectScatterView2.prototype._updateGroupTransform = function(seriesModel) {
          var coordSys = seriesModel.coordinateSystem;
          if (coordSys && coordSys.getRoamTransform) {
            this.group.transform = clone$2(coordSys.getRoamTransform());
            this.group.decomposeTransform();
          }
        };
        EffectScatterView2.prototype.remove = function(ecModel, api2) {
          this._symbolDraw && this._symbolDraw.remove(true);
        };
        EffectScatterView2.type = "effectScatter";
        return EffectScatterView2;
      }(ChartView)
    );
    var EffectScatterSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(EffectScatterSeriesModel2, _super);
        function EffectScatterSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = EffectScatterSeriesModel2.type;
          _this.hasSymbolVisual = true;
          return _this;
        }
        EffectScatterSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this, {
            useEncodeDefaulter: true
          });
        };
        EffectScatterSeriesModel2.prototype.brushSelector = function(dataIndex, data, selectors) {
          return selectors.point(data.getItemLayout(dataIndex));
        };
        EffectScatterSeriesModel2.type = "series.effectScatter";
        EffectScatterSeriesModel2.dependencies = ["grid", "polar"];
        EffectScatterSeriesModel2.defaultOption = {
          coordinateSystem: "cartesian2d",
          // zlevel: 0,
          z: 2,
          legendHoverLink: true,
          effectType: "ripple",
          progressive: 0,
          // When to show the effect, option: 'render'|'emphasis'
          showEffectOn: "render",
          clip: true,
          // Ripple effect config
          rippleEffect: {
            period: 4,
            // Scale of ripple
            scale: 2.5,
            // Brush type can be fill or stroke
            brushType: "fill",
            // Ripple number
            number: 3
          },
          universalTransition: {
            divideShape: "clone"
          },
          // Cartesian coordinate system
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          // Polar coordinate system
          // polarIndex: 0,
          // Geo coordinate system
          // geoIndex: 0,
          // symbol: null,        // 图形类型
          symbolSize: 10
          // 图形大小，半宽（半径）参数，当图形为方向或菱形则总宽度为symbolSize * 2
          // symbolRotate: null,  // 图形旋转控制
          // itemStyle: {
          //     opacity: 1
          // }
        };
        return EffectScatterSeriesModel2;
      }(SeriesModel)
    );
    function install$x(registers) {
      registers.registerChartView(EffectScatterView);
      registers.registerSeriesModel(EffectScatterSeriesModel);
      registers.registerLayout(pointsLayout("effectScatter"));
    }
    var EffectLine = (
      /** @class */
      function(_super) {
        __extends$1(EffectLine2, _super);
        function EffectLine2(lineData, idx, seriesScope) {
          var _this = _super.call(this) || this;
          _this.add(_this.createLine(lineData, idx, seriesScope));
          _this._updateEffectSymbol(lineData, idx);
          return _this;
        }
        EffectLine2.prototype.createLine = function(lineData, idx, seriesScope) {
          return new Line(lineData, idx, seriesScope);
        };
        EffectLine2.prototype._updateEffectSymbol = function(lineData, idx) {
          var itemModel = lineData.getItemModel(idx);
          var effectModel = itemModel.getModel("effect");
          var size = effectModel.get("symbolSize");
          var symbolType = effectModel.get("symbol");
          if (!isArray$2(size)) {
            size = [size, size];
          }
          var lineStyle = lineData.getItemVisual(idx, "style");
          var color2 = effectModel.get("color") || lineStyle && lineStyle.stroke;
          var symbol = this.childAt(1);
          if (this._symbolType !== symbolType) {
            this.remove(symbol);
            symbol = createSymbol$1(symbolType, -0.5, -0.5, 1, 1, color2);
            symbol.z2 = 100;
            symbol.culling = true;
            this.add(symbol);
          }
          if (!symbol) {
            return;
          }
          symbol.setStyle("shadowColor", color2);
          symbol.setStyle(effectModel.getItemStyle(["color"]));
          symbol.scaleX = size[0];
          symbol.scaleY = size[1];
          symbol.setColor(color2);
          this._symbolType = symbolType;
          this._symbolScale = size;
          this._updateEffectAnimation(lineData, effectModel, idx);
        };
        EffectLine2.prototype._updateEffectAnimation = function(lineData, effectModel, idx) {
          var symbol = this.childAt(1);
          if (!symbol) {
            return;
          }
          var points2 = lineData.getItemLayout(idx);
          var period = effectModel.get("period") * 1e3;
          var loop = effectModel.get("loop");
          var roundTrip = effectModel.get("roundTrip");
          var constantSpeed = effectModel.get("constantSpeed");
          var delayExpr = retrieve(effectModel.get("delay"), function(idx2) {
            return idx2 / lineData.count() * period / 3;
          });
          symbol.ignore = true;
          this._updateAnimationPoints(symbol, points2);
          if (constantSpeed > 0) {
            period = this._getLineLength(symbol) / constantSpeed * 1e3;
          }
          if (period !== this._period || loop !== this._loop || roundTrip !== this._roundTrip) {
            symbol.stopAnimation();
            var delayNum = void 0;
            if (isFunction$1(delayExpr)) {
              delayNum = delayExpr(idx);
            } else {
              delayNum = delayExpr;
            }
            if (symbol.__t > 0) {
              delayNum = -period * symbol.__t;
            }
            this._animateSymbol(symbol, period, delayNum, loop, roundTrip);
          }
          this._period = period;
          this._loop = loop;
          this._roundTrip = roundTrip;
        };
        EffectLine2.prototype._animateSymbol = function(symbol, period, delayNum, loop, roundTrip) {
          if (period > 0) {
            symbol.__t = 0;
            var self_1 = this;
            var animator = symbol.animate("", loop).when(roundTrip ? period * 2 : period, {
              __t: roundTrip ? 2 : 1
            }).delay(delayNum).during(function() {
              self_1._updateSymbolPosition(symbol);
            });
            if (!loop) {
              animator.done(function() {
                self_1.remove(symbol);
              });
            }
            animator.start();
          }
        };
        EffectLine2.prototype._getLineLength = function(symbol) {
          return dist$1(symbol.__p1, symbol.__cp1) + dist$1(symbol.__cp1, symbol.__p2);
        };
        EffectLine2.prototype._updateAnimationPoints = function(symbol, points2) {
          symbol.__p1 = points2[0];
          symbol.__p2 = points2[1];
          symbol.__cp1 = points2[2] || [(points2[0][0] + points2[1][0]) / 2, (points2[0][1] + points2[1][1]) / 2];
        };
        EffectLine2.prototype.updateData = function(lineData, idx, seriesScope) {
          this.childAt(0).updateData(lineData, idx, seriesScope);
          this._updateEffectSymbol(lineData, idx);
        };
        EffectLine2.prototype._updateSymbolPosition = function(symbol) {
          var p1 = symbol.__p1;
          var p2 = symbol.__p2;
          var cp1 = symbol.__cp1;
          var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;
          var pos = [symbol.x, symbol.y];
          var lastPos = pos.slice();
          var quadraticAt2 = quadraticAt$1;
          var quadraticDerivativeAt$1 = quadraticDerivativeAt;
          pos[0] = quadraticAt2(p1[0], cp1[0], p2[0], t);
          pos[1] = quadraticAt2(p1[1], cp1[1], p2[1], t);
          var tx = symbol.__t < 1 ? quadraticDerivativeAt$1(p1[0], cp1[0], p2[0], t) : quadraticDerivativeAt$1(p2[0], cp1[0], p1[0], 1 - t);
          var ty = symbol.__t < 1 ? quadraticDerivativeAt$1(p1[1], cp1[1], p2[1], t) : quadraticDerivativeAt$1(p2[1], cp1[1], p1[1], 1 - t);
          symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;
          if (this._symbolType === "line" || this._symbolType === "rect" || this._symbolType === "roundRect") {
            if (symbol.__lastT !== void 0 && symbol.__lastT < symbol.__t) {
              symbol.scaleY = dist$1(lastPos, pos) * 1.05;
              if (t === 1) {
                pos[0] = lastPos[0] + (pos[0] - lastPos[0]) / 2;
                pos[1] = lastPos[1] + (pos[1] - lastPos[1]) / 2;
              }
            } else if (symbol.__lastT === 1) {
              symbol.scaleY = 2 * dist$1(p1, pos);
            } else {
              symbol.scaleY = this._symbolScale[1];
            }
          }
          symbol.__lastT = symbol.__t;
          symbol.ignore = false;
          symbol.x = pos[0];
          symbol.y = pos[1];
        };
        EffectLine2.prototype.updateLayout = function(lineData, idx) {
          this.childAt(0).updateLayout(lineData, idx);
          var effectModel = lineData.getItemModel(idx).getModel("effect");
          this._updateEffectAnimation(lineData, effectModel, idx);
        };
        return EffectLine2;
      }(Group$3)
    );
    var Polyline = (
      /** @class */
      function(_super) {
        __extends$1(Polyline2, _super);
        function Polyline2(lineData, idx, seriesScope) {
          var _this = _super.call(this) || this;
          _this._createPolyline(lineData, idx, seriesScope);
          return _this;
        }
        Polyline2.prototype._createPolyline = function(lineData, idx, seriesScope) {
          var points2 = lineData.getItemLayout(idx);
          var line = new Polyline$1({
            shape: {
              points: points2
            }
          });
          this.add(line);
          this._updateCommonStl(lineData, idx, seriesScope);
        };
        Polyline2.prototype.updateData = function(lineData, idx, seriesScope) {
          var seriesModel = lineData.hostModel;
          var line = this.childAt(0);
          var target = {
            shape: {
              points: lineData.getItemLayout(idx)
            }
          };
          updateProps$1(line, target, seriesModel, idx);
          this._updateCommonStl(lineData, idx, seriesScope);
        };
        Polyline2.prototype._updateCommonStl = function(lineData, idx, seriesScope) {
          var line = this.childAt(0);
          var itemModel = lineData.getItemModel(idx);
          var emphasisLineStyle = seriesScope && seriesScope.emphasisLineStyle;
          var focus = seriesScope && seriesScope.focus;
          var blurScope = seriesScope && seriesScope.blurScope;
          var emphasisDisabled = seriesScope && seriesScope.emphasisDisabled;
          if (!seriesScope || lineData.hasItemOption) {
            var emphasisModel = itemModel.getModel("emphasis");
            emphasisLineStyle = emphasisModel.getModel("lineStyle").getLineStyle();
            emphasisDisabled = emphasisModel.get("disabled");
            focus = emphasisModel.get("focus");
            blurScope = emphasisModel.get("blurScope");
          }
          line.useStyle(lineData.getItemVisual(idx, "style"));
          line.style.fill = null;
          line.style.strokeNoScale = true;
          var lineEmphasisState = line.ensureState("emphasis");
          lineEmphasisState.style = emphasisLineStyle;
          toggleHoverEmphasis(this, focus, blurScope, emphasisDisabled);
        };
        Polyline2.prototype.updateLayout = function(lineData, idx) {
          var polyline = this.childAt(0);
          polyline.setShape("points", lineData.getItemLayout(idx));
        };
        return Polyline2;
      }(Group$3)
    );
    var EffectPolyline = (
      /** @class */
      function(_super) {
        __extends$1(EffectPolyline2, _super);
        function EffectPolyline2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this._lastFrame = 0;
          _this._lastFramePercent = 0;
          return _this;
        }
        EffectPolyline2.prototype.createLine = function(lineData, idx, seriesScope) {
          return new Polyline(lineData, idx, seriesScope);
        };
        EffectPolyline2.prototype._updateAnimationPoints = function(symbol, points2) {
          this._points = points2;
          var accLenArr = [0];
          var len2 = 0;
          for (var i2 = 1; i2 < points2.length; i2++) {
            var p1 = points2[i2 - 1];
            var p2 = points2[i2];
            len2 += dist$1(p1, p2);
            accLenArr.push(len2);
          }
          if (len2 === 0) {
            this._length = 0;
            return;
          }
          for (var i2 = 0; i2 < accLenArr.length; i2++) {
            accLenArr[i2] /= len2;
          }
          this._offsets = accLenArr;
          this._length = len2;
        };
        EffectPolyline2.prototype._getLineLength = function() {
          return this._length;
        };
        EffectPolyline2.prototype._updateSymbolPosition = function(symbol) {
          var t = symbol.__t < 1 ? symbol.__t : 2 - symbol.__t;
          var points2 = this._points;
          var offsets = this._offsets;
          var len2 = points2.length;
          if (!offsets) {
            return;
          }
          var lastFrame = this._lastFrame;
          var frame;
          if (t < this._lastFramePercent) {
            var start2 = Math.min(lastFrame + 1, len2 - 1);
            for (frame = start2; frame >= 0; frame--) {
              if (offsets[frame] <= t) {
                break;
              }
            }
            frame = Math.min(frame, len2 - 2);
          } else {
            for (frame = lastFrame; frame < len2; frame++) {
              if (offsets[frame] > t) {
                break;
              }
            }
            frame = Math.min(frame - 1, len2 - 2);
          }
          var p2 = (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]);
          var p0 = points2[frame];
          var p1 = points2[frame + 1];
          symbol.x = p0[0] * (1 - p2) + p2 * p1[0];
          symbol.y = p0[1] * (1 - p2) + p2 * p1[1];
          var tx = symbol.__t < 1 ? p1[0] - p0[0] : p0[0] - p1[0];
          var ty = symbol.__t < 1 ? p1[1] - p0[1] : p0[1] - p1[1];
          symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;
          this._lastFrame = frame;
          this._lastFramePercent = t;
          symbol.ignore = false;
        };
        return EffectPolyline2;
      }(EffectLine)
    );
    var LargeLinesPathShape = (
      /** @class */
      /* @__PURE__ */ function() {
        function LargeLinesPathShape2() {
          this.polyline = false;
          this.curveness = 0;
          this.segs = [];
        }
        return LargeLinesPathShape2;
      }()
    );
    var LargeLinesPath = (
      /** @class */
      function(_super) {
        __extends$1(LargeLinesPath2, _super);
        function LargeLinesPath2(opts) {
          var _this = _super.call(this, opts) || this;
          _this._off = 0;
          _this.hoverDataIdx = -1;
          return _this;
        }
        LargeLinesPath2.prototype.reset = function() {
          this.notClear = false;
          this._off = 0;
        };
        LargeLinesPath2.prototype.getDefaultStyle = function() {
          return {
            stroke: "#000",
            fill: null
          };
        };
        LargeLinesPath2.prototype.getDefaultShape = function() {
          return new LargeLinesPathShape();
        };
        LargeLinesPath2.prototype.buildPath = function(ctx, shape) {
          var segs = shape.segs;
          var curveness = shape.curveness;
          var i2;
          if (shape.polyline) {
            for (i2 = this._off; i2 < segs.length; ) {
              var count2 = segs[i2++];
              if (count2 > 0) {
                ctx.moveTo(segs[i2++], segs[i2++]);
                for (var k2 = 1; k2 < count2; k2++) {
                  ctx.lineTo(segs[i2++], segs[i2++]);
                }
              }
            }
          } else {
            for (i2 = this._off; i2 < segs.length; ) {
              var x0 = segs[i2++];
              var y0 = segs[i2++];
              var x1 = segs[i2++];
              var y1 = segs[i2++];
              ctx.moveTo(x0, y0);
              if (curveness > 0) {
                var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness;
                var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;
                ctx.quadraticCurveTo(x2, y2, x1, y1);
              } else {
                ctx.lineTo(x1, y1);
              }
            }
          }
          if (this.incremental) {
            this._off = i2;
            this.notClear = true;
          }
        };
        LargeLinesPath2.prototype.findDataIndex = function(x2, y) {
          var shape = this.shape;
          var segs = shape.segs;
          var curveness = shape.curveness;
          var lineWidth = this.style.lineWidth;
          if (shape.polyline) {
            var dataIndex = 0;
            for (var i2 = 0; i2 < segs.length; ) {
              var count2 = segs[i2++];
              if (count2 > 0) {
                var x0 = segs[i2++];
                var y0 = segs[i2++];
                for (var k2 = 1; k2 < count2; k2++) {
                  var x1 = segs[i2++];
                  var y1 = segs[i2++];
                  if (containStroke$4(x0, y0, x1, y1, lineWidth, x2, y)) {
                    return dataIndex;
                  }
                }
              }
              dataIndex++;
            }
          } else {
            var dataIndex = 0;
            for (var i2 = 0; i2 < segs.length; ) {
              var x0 = segs[i2++];
              var y0 = segs[i2++];
              var x1 = segs[i2++];
              var y1 = segs[i2++];
              if (curveness > 0) {
                var x22 = (x0 + x1) / 2 - (y0 - y1) * curveness;
                var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness;
                if (containStroke$2(x0, y0, x22, y2, x1, y1, lineWidth, x2, y)) {
                  return dataIndex;
                }
              } else {
                if (containStroke$4(x0, y0, x1, y1, lineWidth, x2, y)) {
                  return dataIndex;
                }
              }
              dataIndex++;
            }
          }
          return -1;
        };
        LargeLinesPath2.prototype.contain = function(x2, y) {
          var localPos = this.transformCoordToLocal(x2, y);
          var rect = this.getBoundingRect();
          x2 = localPos[0];
          y = localPos[1];
          if (rect.contain(x2, y)) {
            var dataIdx = this.hoverDataIdx = this.findDataIndex(x2, y);
            return dataIdx >= 0;
          }
          this.hoverDataIdx = -1;
          return false;
        };
        LargeLinesPath2.prototype.getBoundingRect = function() {
          var rect = this._rect;
          if (!rect) {
            var shape = this.shape;
            var points2 = shape.segs;
            var minX = Infinity;
            var minY = Infinity;
            var maxX = -Infinity;
            var maxY = -Infinity;
            for (var i2 = 0; i2 < points2.length; ) {
              var x2 = points2[i2++];
              var y = points2[i2++];
              minX = Math.min(x2, minX);
              maxX = Math.max(x2, maxX);
              minY = Math.min(y, minY);
              maxY = Math.max(y, maxY);
            }
            rect = this._rect = new BoundingRect(minX, minY, maxX, maxY);
          }
          return rect;
        };
        return LargeLinesPath2;
      }(Path)
    );
    var LargeLineDraw = (
      /** @class */
      function() {
        function LargeLineDraw2() {
          this.group = new Group$3();
        }
        LargeLineDraw2.prototype.updateData = function(data) {
          this._clear();
          var lineEl = this._create();
          lineEl.setShape({
            segs: data.getLayout("linesPoints")
          });
          this._setCommon(lineEl, data);
        };
        LargeLineDraw2.prototype.incrementalPrepareUpdate = function(data) {
          this.group.removeAll();
          this._clear();
        };
        LargeLineDraw2.prototype.incrementalUpdate = function(taskParams, data) {
          var lastAdded = this._newAdded[0];
          var linePoints = data.getLayout("linesPoints");
          var oldSegs = lastAdded && lastAdded.shape.segs;
          if (oldSegs && oldSegs.length < 2e4) {
            var oldLen = oldSegs.length;
            var newSegs = new Float32Array(oldLen + linePoints.length);
            newSegs.set(oldSegs);
            newSegs.set(linePoints, oldLen);
            lastAdded.setShape({
              segs: newSegs
            });
          } else {
            this._newAdded = [];
            var lineEl = this._create();
            lineEl.incremental = true;
            lineEl.setShape({
              segs: linePoints
            });
            this._setCommon(lineEl, data);
            lineEl.__startIndex = taskParams.start;
          }
        };
        LargeLineDraw2.prototype.remove = function() {
          this._clear();
        };
        LargeLineDraw2.prototype.eachRendered = function(cb) {
          this._newAdded[0] && cb(this._newAdded[0]);
        };
        LargeLineDraw2.prototype._create = function() {
          var lineEl = new LargeLinesPath({
            cursor: "default",
            ignoreCoarsePointer: true
          });
          this._newAdded.push(lineEl);
          this.group.add(lineEl);
          return lineEl;
        };
        LargeLineDraw2.prototype._setCommon = function(lineEl, data, isIncremental) {
          var hostModel = data.hostModel;
          lineEl.setShape({
            polyline: hostModel.get("polyline"),
            curveness: hostModel.get(["lineStyle", "curveness"])
          });
          lineEl.useStyle(hostModel.getModel("lineStyle").getLineStyle());
          lineEl.style.strokeNoScale = true;
          var style = data.getVisual("style");
          if (style && style.stroke) {
            lineEl.setStyle("stroke", style.stroke);
          }
          lineEl.setStyle("fill", null);
          var ecData = getECData(lineEl);
          ecData.seriesIndex = hostModel.seriesIndex;
          lineEl.on("mousemove", function(e2) {
            ecData.dataIndex = null;
            var dataIndex = lineEl.hoverDataIdx;
            if (dataIndex > 0) {
              ecData.dataIndex = dataIndex + lineEl.__startIndex;
            }
          });
        };
        LargeLineDraw2.prototype._clear = function() {
          this._newAdded = [];
          this.group.removeAll();
        };
        return LargeLineDraw2;
      }()
    );
    var linesLayout = {
      seriesType: "lines",
      plan: createRenderPlanner(),
      reset: function(seriesModel) {
        var coordSys = seriesModel.coordinateSystem;
        if (!coordSys) {
          return;
        }
        var isPolyline = seriesModel.get("polyline");
        var isLarge = seriesModel.pipelineContext.large;
        return {
          progress: function(params, lineData) {
            var lineCoords = [];
            if (isLarge) {
              var points2 = void 0;
              var segCount = params.end - params.start;
              if (isPolyline) {
                var totalCoordsCount = 0;
                for (var i2 = params.start; i2 < params.end; i2++) {
                  totalCoordsCount += seriesModel.getLineCoordsCount(i2);
                }
                points2 = new Float32Array(segCount + totalCoordsCount * 2);
              } else {
                points2 = new Float32Array(segCount * 4);
              }
              var offset2 = 0;
              var pt3 = [];
              for (var i2 = params.start; i2 < params.end; i2++) {
                var len2 = seriesModel.getLineCoords(i2, lineCoords);
                if (isPolyline) {
                  points2[offset2++] = len2;
                }
                for (var k2 = 0; k2 < len2; k2++) {
                  pt3 = coordSys.dataToPoint(lineCoords[k2], false, pt3);
                  points2[offset2++] = pt3[0];
                  points2[offset2++] = pt3[1];
                }
              }
              lineData.setLayout("linesPoints", points2);
            } else {
              for (var i2 = params.start; i2 < params.end; i2++) {
                var itemModel = lineData.getItemModel(i2);
                var len2 = seriesModel.getLineCoords(i2, lineCoords);
                var pts = [];
                if (isPolyline) {
                  for (var j = 0; j < len2; j++) {
                    pts.push(coordSys.dataToPoint(lineCoords[j]));
                  }
                } else {
                  pts[0] = coordSys.dataToPoint(lineCoords[0]);
                  pts[1] = coordSys.dataToPoint(lineCoords[1]);
                  var curveness = itemModel.get(["lineStyle", "curveness"]);
                  if (+curveness) {
                    pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];
                  }
                }
                lineData.setItemLayout(i2, pts);
              }
            }
          }
        };
      }
    };
    var LinesView = (
      /** @class */
      function(_super) {
        __extends$1(LinesView2, _super);
        function LinesView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = LinesView2.type;
          return _this;
        }
        LinesView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var lineDraw = this._updateLineDraw(data, seriesModel);
          var zlevel = seriesModel.get("zlevel");
          var trailLength = seriesModel.get(["effect", "trailLength"]);
          var zr = api2.getZr();
          var isSvg = zr.painter.getType() === "svg";
          if (!isSvg) {
            zr.painter.getLayer(zlevel).clear(true);
          }
          if (this._lastZlevel != null && !isSvg) {
            zr.configLayer(this._lastZlevel, {
              motionBlur: false
            });
          }
          if (this._showEffect(seriesModel) && trailLength > 0) {
            if (!isSvg) {
              zr.configLayer(zlevel, {
                motionBlur: true,
                lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
              });
            }
          }
          lineDraw.updateData(data);
          var clipPath = seriesModel.get("clip", true) && createClipPath(seriesModel.coordinateSystem, false, seriesModel);
          if (clipPath) {
            this.group.setClipPath(clipPath);
          } else {
            this.group.removeClipPath();
          }
          this._lastZlevel = zlevel;
          this._finished = true;
        };
        LinesView2.prototype.incrementalPrepareRender = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var lineDraw = this._updateLineDraw(data, seriesModel);
          lineDraw.incrementalPrepareUpdate(data);
          this._clearLayer(api2);
          this._finished = false;
        };
        LinesView2.prototype.incrementalRender = function(taskParams, seriesModel, ecModel) {
          this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData());
          this._finished = taskParams.end === seriesModel.getData().count();
        };
        LinesView2.prototype.eachRendered = function(cb) {
          this._lineDraw && this._lineDraw.eachRendered(cb);
        };
        LinesView2.prototype.updateTransform = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var pipelineContext = seriesModel.pipelineContext;
          if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) {
            return {
              update: true
            };
          } else {
            var res = linesLayout.reset(seriesModel, ecModel, api2);
            if (res.progress) {
              res.progress({
                start: 0,
                end: data.count(),
                count: data.count()
              }, data);
            }
            this._lineDraw.updateLayout();
            this._clearLayer(api2);
          }
        };
        LinesView2.prototype._updateLineDraw = function(data, seriesModel) {
          var lineDraw = this._lineDraw;
          var hasEffect = this._showEffect(seriesModel);
          var isPolyline = !!seriesModel.get("polyline");
          var pipelineContext = seriesModel.pipelineContext;
          var isLargeDraw = pipelineContext.large;
          if (!lineDraw || hasEffect !== this._hasEffet || isPolyline !== this._isPolyline || isLargeDraw !== this._isLargeDraw) {
            if (lineDraw) {
              lineDraw.remove();
            }
            lineDraw = this._lineDraw = isLargeDraw ? new LargeLineDraw() : new LineDraw(isPolyline ? hasEffect ? EffectPolyline : Polyline : hasEffect ? EffectLine : Line);
            this._hasEffet = hasEffect;
            this._isPolyline = isPolyline;
            this._isLargeDraw = isLargeDraw;
          }
          this.group.add(lineDraw.group);
          return lineDraw;
        };
        LinesView2.prototype._showEffect = function(seriesModel) {
          return !!seriesModel.get(["effect", "show"]);
        };
        LinesView2.prototype._clearLayer = function(api2) {
          var zr = api2.getZr();
          var isSvg = zr.painter.getType() === "svg";
          if (!isSvg && this._lastZlevel != null) {
            zr.painter.getLayer(this._lastZlevel).clear(true);
          }
        };
        LinesView2.prototype.remove = function(ecModel, api2) {
          this._lineDraw && this._lineDraw.remove();
          this._lineDraw = null;
          this._clearLayer(api2);
        };
        LinesView2.prototype.dispose = function(ecModel, api2) {
          this.remove(ecModel, api2);
        };
        LinesView2.type = "lines";
        return LinesView2;
      }(ChartView)
    );
    var Uint32Arr = typeof Uint32Array === "undefined" ? Array : Uint32Array;
    var Float64Arr = typeof Float64Array === "undefined" ? Array : Float64Array;
    function compatEc2(seriesOpt) {
      var data = seriesOpt.data;
      if (data && data[0] && data[0][0] && data[0][0].coord) {
        seriesOpt.data = map$1(data, function(itemOpt) {
          var coords = [itemOpt[0].coord, itemOpt[1].coord];
          var target = {
            coords
          };
          if (itemOpt[0].name) {
            target.fromName = itemOpt[0].name;
          }
          if (itemOpt[1].name) {
            target.toName = itemOpt[1].name;
          }
          return mergeAll([target, itemOpt[0], itemOpt[1]]);
        });
      }
    }
    var LinesSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(LinesSeriesModel2, _super);
        function LinesSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = LinesSeriesModel2.type;
          _this.visualStyleAccessPath = "lineStyle";
          _this.visualDrawType = "stroke";
          return _this;
        }
        LinesSeriesModel2.prototype.init = function(option) {
          option.data = option.data || [];
          compatEc2(option);
          var result = this._processFlatCoordsArray(option.data);
          this._flatCoords = result.flatCoords;
          this._flatCoordsOffset = result.flatCoordsOffset;
          if (result.flatCoords) {
            option.data = new Float32Array(result.count);
          }
          _super.prototype.init.apply(this, arguments);
        };
        LinesSeriesModel2.prototype.mergeOption = function(option) {
          compatEc2(option);
          if (option.data) {
            var result = this._processFlatCoordsArray(option.data);
            this._flatCoords = result.flatCoords;
            this._flatCoordsOffset = result.flatCoordsOffset;
            if (result.flatCoords) {
              option.data = new Float32Array(result.count);
            }
          }
          _super.prototype.mergeOption.apply(this, arguments);
        };
        LinesSeriesModel2.prototype.appendData = function(params) {
          var result = this._processFlatCoordsArray(params.data);
          if (result.flatCoords) {
            if (!this._flatCoords) {
              this._flatCoords = result.flatCoords;
              this._flatCoordsOffset = result.flatCoordsOffset;
            } else {
              this._flatCoords = concatArray(this._flatCoords, result.flatCoords);
              this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset);
            }
            params.data = new Float32Array(result.count);
          }
          this.getRawData().appendData(params.data);
        };
        LinesSeriesModel2.prototype._getCoordsFromItemModel = function(idx) {
          var itemModel = this.getData().getItemModel(idx);
          var coords = itemModel.option instanceof Array ? itemModel.option : itemModel.getShallow("coords");
          return coords;
        };
        LinesSeriesModel2.prototype.getLineCoordsCount = function(idx) {
          if (this._flatCoordsOffset) {
            return this._flatCoordsOffset[idx * 2 + 1];
          } else {
            return this._getCoordsFromItemModel(idx).length;
          }
        };
        LinesSeriesModel2.prototype.getLineCoords = function(idx, out2) {
          if (this._flatCoordsOffset) {
            var offset2 = this._flatCoordsOffset[idx * 2];
            var len2 = this._flatCoordsOffset[idx * 2 + 1];
            for (var i2 = 0; i2 < len2; i2++) {
              out2[i2] = out2[i2] || [];
              out2[i2][0] = this._flatCoords[offset2 + i2 * 2];
              out2[i2][1] = this._flatCoords[offset2 + i2 * 2 + 1];
            }
            return len2;
          } else {
            var coords = this._getCoordsFromItemModel(idx);
            for (var i2 = 0; i2 < coords.length; i2++) {
              out2[i2] = out2[i2] || [];
              out2[i2][0] = coords[i2][0];
              out2[i2][1] = coords[i2][1];
            }
            return coords.length;
          }
        };
        LinesSeriesModel2.prototype._processFlatCoordsArray = function(data) {
          var startOffset = 0;
          if (this._flatCoords) {
            startOffset = this._flatCoords.length;
          }
          if (isNumber$1(data[0])) {
            var len2 = data.length;
            var coordsOffsetAndLenStorage = new Uint32Arr(len2);
            var coordsStorage = new Float64Arr(len2);
            var coordsCursor = 0;
            var offsetCursor = 0;
            var dataCount = 0;
            for (var i2 = 0; i2 < len2; ) {
              dataCount++;
              var count2 = data[i2++];
              coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset;
              coordsOffsetAndLenStorage[offsetCursor++] = count2;
              for (var k2 = 0; k2 < count2; k2++) {
                var x2 = data[i2++];
                var y = data[i2++];
                coordsStorage[coordsCursor++] = x2;
                coordsStorage[coordsCursor++] = y;
              }
            }
            return {
              flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor),
              flatCoords: coordsStorage,
              count: dataCount
            };
          }
          return {
            flatCoordsOffset: null,
            flatCoords: null,
            count: data.length
          };
        };
        LinesSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var lineData = new SeriesData(["value"], this);
          lineData.hasItemOption = false;
          lineData.initData(option.data, [], function(dataItem, dimName, dataIndex, dimIndex) {
            if (dataItem instanceof Array) {
              return NaN;
            } else {
              lineData.hasItemOption = true;
              var value = dataItem.value;
              if (value != null) {
                return value instanceof Array ? value[dimIndex] : value;
              }
            }
          });
          return lineData;
        };
        LinesSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var itemModel = data.getItemModel(dataIndex);
          var name = itemModel.get("name");
          if (name) {
            return name;
          }
          var fromName = itemModel.get("fromName");
          var toName = itemModel.get("toName");
          var nameArr = [];
          fromName != null && nameArr.push(fromName);
          toName != null && nameArr.push(toName);
          return createTooltipMarkup("nameValue", {
            name: nameArr.join(" > ")
          });
        };
        LinesSeriesModel2.prototype.preventIncremental = function() {
          return !!this.get(["effect", "show"]);
        };
        LinesSeriesModel2.prototype.getProgressive = function() {
          var progressive = this.option.progressive;
          if (progressive == null) {
            return this.option.large ? 1e4 : this.get("progressive");
          }
          return progressive;
        };
        LinesSeriesModel2.prototype.getProgressiveThreshold = function() {
          var progressiveThreshold = this.option.progressiveThreshold;
          if (progressiveThreshold == null) {
            return this.option.large ? 2e4 : this.get("progressiveThreshold");
          }
          return progressiveThreshold;
        };
        LinesSeriesModel2.prototype.getZLevelKey = function() {
          var effectModel = this.getModel("effect");
          var trailLength = effectModel.get("trailLength");
          return this.getData().count() > this.getProgressiveThreshold() ? this.id : effectModel.get("show") && trailLength > 0 ? trailLength + "" : "";
        };
        LinesSeriesModel2.type = "series.lines";
        LinesSeriesModel2.dependencies = ["grid", "polar", "geo", "calendar"];
        LinesSeriesModel2.defaultOption = {
          coordinateSystem: "geo",
          // zlevel: 0,
          z: 2,
          legendHoverLink: true,
          // Cartesian coordinate system
          xAxisIndex: 0,
          yAxisIndex: 0,
          symbol: ["none", "none"],
          symbolSize: [10, 10],
          // Geo coordinate system
          geoIndex: 0,
          effect: {
            show: false,
            period: 4,
            constantSpeed: 0,
            symbol: "circle",
            symbolSize: 3,
            loop: true,
            trailLength: 0.2
          },
          large: false,
          // Available when large is true
          largeThreshold: 2e3,
          polyline: false,
          clip: true,
          label: {
            show: false,
            position: "end"
            // distance: 5,
            // formatter: 标签文本格式器，同Tooltip.formatter，不支持异步回调
          },
          lineStyle: {
            opacity: 0.5
          }
        };
        return LinesSeriesModel2;
      }(SeriesModel)
    );
    function normalize(a2) {
      if (!(a2 instanceof Array)) {
        a2 = [a2, a2];
      }
      return a2;
    }
    var linesVisual = {
      seriesType: "lines",
      reset: function(seriesModel) {
        var symbolType = normalize(seriesModel.get("symbol"));
        var symbolSize = normalize(seriesModel.get("symbolSize"));
        var data = seriesModel.getData();
        data.setVisual("fromSymbol", symbolType && symbolType[0]);
        data.setVisual("toSymbol", symbolType && symbolType[1]);
        data.setVisual("fromSymbolSize", symbolSize && symbolSize[0]);
        data.setVisual("toSymbolSize", symbolSize && symbolSize[1]);
        function dataEach(data2, idx) {
          var itemModel = data2.getItemModel(idx);
          var symbolType2 = normalize(itemModel.getShallow("symbol", true));
          var symbolSize2 = normalize(itemModel.getShallow("symbolSize", true));
          symbolType2[0] && data2.setItemVisual(idx, "fromSymbol", symbolType2[0]);
          symbolType2[1] && data2.setItemVisual(idx, "toSymbol", symbolType2[1]);
          symbolSize2[0] && data2.setItemVisual(idx, "fromSymbolSize", symbolSize2[0]);
          symbolSize2[1] && data2.setItemVisual(idx, "toSymbolSize", symbolSize2[1]);
        }
        return {
          dataEach: data.hasItemOption ? dataEach : null
        };
      }
    };
    function install$w(registers) {
      registers.registerChartView(LinesView);
      registers.registerSeriesModel(LinesSeriesModel);
      registers.registerLayout(linesLayout);
      registers.registerVisual(linesVisual);
    }
    var GRADIENT_LEVELS = 256;
    var HeatmapLayer = (
      /** @class */
      function() {
        function HeatmapLayer2() {
          this.blurSize = 30;
          this.pointSize = 20;
          this.maxOpacity = 1;
          this.minOpacity = 0;
          this._gradientPixels = {
            inRange: null,
            outOfRange: null
          };
          var canvas = platformApi.createCanvas();
          this.canvas = canvas;
        }
        HeatmapLayer2.prototype.update = function(data, width, height, normalize2, colorFunc, isInRange) {
          var brush2 = this._getBrush();
          var gradientInRange = this._getGradient(colorFunc, "inRange");
          var gradientOutOfRange = this._getGradient(colorFunc, "outOfRange");
          var r = this.pointSize + this.blurSize;
          var canvas = this.canvas;
          var ctx = canvas.getContext("2d");
          var len2 = data.length;
          canvas.width = width;
          canvas.height = height;
          for (var i2 = 0; i2 < len2; ++i2) {
            var p2 = data[i2];
            var x2 = p2[0];
            var y = p2[1];
            var value = p2[2];
            var alpha = normalize2(value);
            ctx.globalAlpha = alpha;
            ctx.drawImage(brush2, x2 - r, y - r);
          }
          if (!canvas.width || !canvas.height) {
            return canvas;
          }
          var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
          var pixels = imageData.data;
          var offset2 = 0;
          var pixelLen = pixels.length;
          var minOpacity = this.minOpacity;
          var maxOpacity = this.maxOpacity;
          var diffOpacity = maxOpacity - minOpacity;
          while (offset2 < pixelLen) {
            var alpha = pixels[offset2 + 3] / 256;
            var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;
            if (alpha > 0) {
              var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;
              alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);
              pixels[offset2++] = gradient[gradientOffset];
              pixels[offset2++] = gradient[gradientOffset + 1];
              pixels[offset2++] = gradient[gradientOffset + 2];
              pixels[offset2++] = gradient[gradientOffset + 3] * alpha * 256;
            } else {
              offset2 += 4;
            }
          }
          ctx.putImageData(imageData, 0, 0);
          return canvas;
        };
        HeatmapLayer2.prototype._getBrush = function() {
          var brushCanvas = this._brushCanvas || (this._brushCanvas = platformApi.createCanvas());
          var r = this.pointSize + this.blurSize;
          var d2 = r * 2;
          brushCanvas.width = d2;
          brushCanvas.height = d2;
          var ctx = brushCanvas.getContext("2d");
          ctx.clearRect(0, 0, d2, d2);
          ctx.shadowOffsetX = d2;
          ctx.shadowBlur = this.blurSize;
          ctx.shadowColor = "#000";
          ctx.beginPath();
          ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);
          ctx.closePath();
          ctx.fill();
          return brushCanvas;
        };
        HeatmapLayer2.prototype._getGradient = function(colorFunc, state) {
          var gradientPixels = this._gradientPixels;
          var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));
          var color2 = [0, 0, 0, 0];
          var off = 0;
          for (var i2 = 0; i2 < 256; i2++) {
            colorFunc[state](i2 / 255, true, color2);
            pixelsSingleState[off++] = color2[0];
            pixelsSingleState[off++] = color2[1];
            pixelsSingleState[off++] = color2[2];
            pixelsSingleState[off++] = color2[3];
          }
          return pixelsSingleState;
        };
        return HeatmapLayer2;
      }()
    );
    function getIsInPiecewiseRange(dataExtent, pieceList, selected) {
      var dataSpan = dataExtent[1] - dataExtent[0];
      pieceList = map$1(pieceList, function(piece) {
        return {
          interval: [(piece.interval[0] - dataExtent[0]) / dataSpan, (piece.interval[1] - dataExtent[0]) / dataSpan]
        };
      });
      var len2 = pieceList.length;
      var lastIndex = 0;
      return function(val) {
        var i2;
        for (i2 = lastIndex; i2 < len2; i2++) {
          var interval = pieceList[i2].interval;
          if (interval[0] <= val && val <= interval[1]) {
            lastIndex = i2;
            break;
          }
        }
        if (i2 === len2) {
          for (i2 = lastIndex - 1; i2 >= 0; i2--) {
            var interval = pieceList[i2].interval;
            if (interval[0] <= val && val <= interval[1]) {
              lastIndex = i2;
              break;
            }
          }
        }
        return i2 >= 0 && i2 < len2 && selected[i2];
      };
    }
    function getIsInContinuousRange(dataExtent, range2) {
      var dataSpan = dataExtent[1] - dataExtent[0];
      range2 = [(range2[0] - dataExtent[0]) / dataSpan, (range2[1] - dataExtent[0]) / dataSpan];
      return function(val) {
        return val >= range2[0] && val <= range2[1];
      };
    }
    function isGeoCoordSys(coordSys) {
      var dimensions = coordSys.dimensions;
      return dimensions[0] === "lng" && dimensions[1] === "lat";
    }
    var HeatmapView = (
      /** @class */
      function(_super) {
        __extends$1(HeatmapView2, _super);
        function HeatmapView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = HeatmapView2.type;
          return _this;
        }
        HeatmapView2.prototype.render = function(seriesModel, ecModel, api2) {
          var visualMapOfThisSeries;
          ecModel.eachComponent("visualMap", function(visualMap) {
            visualMap.eachTargetSeries(function(targetSeries) {
              if (targetSeries === seriesModel) {
                visualMapOfThisSeries = visualMap;
              }
            });
          });
          this._progressiveEls = null;
          this.group.removeAll();
          var coordSys = seriesModel.coordinateSystem;
          if (coordSys.type === "cartesian2d" || coordSys.type === "calendar") {
            this._renderOnCartesianAndCalendar(seriesModel, api2, 0, seriesModel.getData().count());
          } else if (isGeoCoordSys(coordSys)) {
            this._renderOnGeo(coordSys, seriesModel, visualMapOfThisSeries, api2);
          }
        };
        HeatmapView2.prototype.incrementalPrepareRender = function(seriesModel, ecModel, api2) {
          this.group.removeAll();
        };
        HeatmapView2.prototype.incrementalRender = function(params, seriesModel, ecModel, api2) {
          var coordSys = seriesModel.coordinateSystem;
          if (coordSys) {
            if (isGeoCoordSys(coordSys)) {
              this.render(seriesModel, ecModel, api2);
            } else {
              this._progressiveEls = [];
              this._renderOnCartesianAndCalendar(seriesModel, api2, params.start, params.end, true);
            }
          }
        };
        HeatmapView2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        HeatmapView2.prototype._renderOnCartesianAndCalendar = function(seriesModel, api2, start2, end2, incremental) {
          var coordSys = seriesModel.coordinateSystem;
          var isCartesian2d = isCoordinateSystemType(coordSys, "cartesian2d");
          var width;
          var height;
          var xAxisExtent;
          var yAxisExtent;
          if (isCartesian2d) {
            var xAxis = coordSys.getAxis("x");
            var yAxis = coordSys.getAxis("y");
            width = xAxis.getBandWidth() + 0.5;
            height = yAxis.getBandWidth() + 0.5;
            xAxisExtent = xAxis.scale.getExtent();
            yAxisExtent = yAxis.scale.getExtent();
          }
          var group = this.group;
          var data = seriesModel.getData();
          var emphasisStyle = seriesModel.getModel(["emphasis", "itemStyle"]).getItemStyle();
          var blurStyle = seriesModel.getModel(["blur", "itemStyle"]).getItemStyle();
          var selectStyle = seriesModel.getModel(["select", "itemStyle"]).getItemStyle();
          var borderRadius = seriesModel.get(["itemStyle", "borderRadius"]);
          var labelStatesModels = getLabelStatesModels(seriesModel);
          var emphasisModel = seriesModel.getModel("emphasis");
          var focus = emphasisModel.get("focus");
          var blurScope = emphasisModel.get("blurScope");
          var emphasisDisabled = emphasisModel.get("disabled");
          var dataDims = isCartesian2d ? [data.mapDimension("x"), data.mapDimension("y"), data.mapDimension("value")] : [data.mapDimension("time"), data.mapDimension("value")];
          for (var idx = start2; idx < end2; idx++) {
            var rect = void 0;
            var style = data.getItemVisual(idx, "style");
            if (isCartesian2d) {
              var dataDimX = data.get(dataDims[0], idx);
              var dataDimY = data.get(dataDims[1], idx);
              if (isNaN(data.get(dataDims[2], idx)) || isNaN(dataDimX) || isNaN(dataDimY) || dataDimX < xAxisExtent[0] || dataDimX > xAxisExtent[1] || dataDimY < yAxisExtent[0] || dataDimY > yAxisExtent[1]) {
                continue;
              }
              var point = coordSys.dataToPoint([dataDimX, dataDimY]);
              rect = new Rect$2({
                shape: {
                  x: point[0] - width / 2,
                  y: point[1] - height / 2,
                  width,
                  height
                },
                style
              });
            } else {
              if (isNaN(data.get(dataDims[1], idx))) {
                continue;
              }
              rect = new Rect$2({
                z2: 1,
                shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape,
                style
              });
            }
            if (data.hasItemOption) {
              var itemModel = data.getItemModel(idx);
              var emphasisModel_1 = itemModel.getModel("emphasis");
              emphasisStyle = emphasisModel_1.getModel("itemStyle").getItemStyle();
              blurStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle();
              selectStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle();
              borderRadius = itemModel.get(["itemStyle", "borderRadius"]);
              focus = emphasisModel_1.get("focus");
              blurScope = emphasisModel_1.get("blurScope");
              emphasisDisabled = emphasisModel_1.get("disabled");
              labelStatesModels = getLabelStatesModels(itemModel);
            }
            rect.shape.r = borderRadius;
            var rawValue = seriesModel.getRawValue(idx);
            var defaultText = "-";
            if (rawValue && rawValue[2] != null) {
              defaultText = rawValue[2] + "";
            }
            setLabelStyle(rect, labelStatesModels, {
              labelFetcher: seriesModel,
              labelDataIndex: idx,
              defaultOpacity: style.opacity,
              defaultText
            });
            rect.ensureState("emphasis").style = emphasisStyle;
            rect.ensureState("blur").style = blurStyle;
            rect.ensureState("select").style = selectStyle;
            toggleHoverEmphasis(rect, focus, blurScope, emphasisDisabled);
            rect.incremental = incremental;
            if (incremental) {
              rect.states.emphasis.hoverLayer = true;
            }
            group.add(rect);
            data.setItemGraphicEl(idx, rect);
            if (this._progressiveEls) {
              this._progressiveEls.push(rect);
            }
          }
        };
        HeatmapView2.prototype._renderOnGeo = function(geo, seriesModel, visualMapModel, api2) {
          var inRangeVisuals = visualMapModel.targetVisuals.inRange;
          var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;
          var data = seriesModel.getData();
          var hmLayer = this._hmLayer || this._hmLayer || new HeatmapLayer();
          hmLayer.blurSize = seriesModel.get("blurSize");
          hmLayer.pointSize = seriesModel.get("pointSize");
          hmLayer.minOpacity = seriesModel.get("minOpacity");
          hmLayer.maxOpacity = seriesModel.get("maxOpacity");
          var rect = geo.getViewRect().clone();
          var roamTransform = geo.getRoamTransform();
          rect.applyTransform(roamTransform);
          var x2 = Math.max(rect.x, 0);
          var y = Math.max(rect.y, 0);
          var x22 = Math.min(rect.width + rect.x, api2.getWidth());
          var y2 = Math.min(rect.height + rect.y, api2.getHeight());
          var width = x22 - x2;
          var height = y2 - y;
          var dims = [data.mapDimension("lng"), data.mapDimension("lat"), data.mapDimension("value")];
          var points2 = data.mapArray(dims, function(lng, lat, value) {
            var pt3 = geo.dataToPoint([lng, lat]);
            pt3[0] -= x2;
            pt3[1] -= y;
            pt3.push(value);
            return pt3;
          });
          var dataExtent = visualMapModel.getExtent();
          var isInRange = visualMapModel.type === "visualMap.continuous" ? getIsInContinuousRange(dataExtent, visualMapModel.option.range) : getIsInPiecewiseRange(dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected);
          hmLayer.update(points2, width, height, inRangeVisuals.color.getNormalizer(), {
            inRange: inRangeVisuals.color.getColorMapper(),
            outOfRange: outOfRangeVisuals.color.getColorMapper()
          }, isInRange);
          var img = new ZRImage({
            style: {
              width,
              height,
              x: x2,
              y,
              image: hmLayer.canvas
            },
            silent: true
          });
          this.group.add(img);
        };
        HeatmapView2.type = "heatmap";
        return HeatmapView2;
      }(ChartView)
    );
    var HeatmapSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(HeatmapSeriesModel2, _super);
        function HeatmapSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = HeatmapSeriesModel2.type;
          return _this;
        }
        HeatmapSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this, {
            generateCoord: "value"
          });
        };
        HeatmapSeriesModel2.prototype.preventIncremental = function() {
          var coordSysCreator = CoordinateSystemManager.get(this.get("coordinateSystem"));
          if (coordSysCreator && coordSysCreator.dimensions) {
            return coordSysCreator.dimensions[0] === "lng" && coordSysCreator.dimensions[1] === "lat";
          }
        };
        HeatmapSeriesModel2.type = "series.heatmap";
        HeatmapSeriesModel2.dependencies = ["grid", "geo", "calendar"];
        HeatmapSeriesModel2.defaultOption = {
          coordinateSystem: "cartesian2d",
          // zlevel: 0,
          z: 2,
          // Cartesian coordinate system
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          // Geo coordinate system
          geoIndex: 0,
          blurSize: 30,
          pointSize: 20,
          maxOpacity: 1,
          minOpacity: 0,
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          }
        };
        return HeatmapSeriesModel2;
      }(SeriesModel)
    );
    function install$v(registers) {
      registers.registerChartView(HeatmapView);
      registers.registerSeriesModel(HeatmapSeriesModel);
    }
    var BAR_BORDER_WIDTH_QUERY = ["itemStyle", "borderWidth"];
    var LAYOUT_ATTRS = [{
      xy: "x",
      wh: "width",
      index: 0,
      posDesc: ["left", "right"]
    }, {
      xy: "y",
      wh: "height",
      index: 1,
      posDesc: ["top", "bottom"]
    }];
    var pathForLineWidth = new Circle();
    var PictorialBarView = (
      /** @class */
      function(_super) {
        __extends$1(PictorialBarView2, _super);
        function PictorialBarView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PictorialBarView2.type;
          return _this;
        }
        PictorialBarView2.prototype.render = function(seriesModel, ecModel, api2) {
          var group = this.group;
          var data = seriesModel.getData();
          var oldData = this._data;
          var cartesian = seriesModel.coordinateSystem;
          var baseAxis = cartesian.getBaseAxis();
          var isHorizontal2 = baseAxis.isHorizontal();
          var coordSysRect = cartesian.master.getRect();
          var opt = {
            ecSize: {
              width: api2.getWidth(),
              height: api2.getHeight()
            },
            seriesModel,
            coordSys: cartesian,
            coordSysExtent: [[coordSysRect.x, coordSysRect.x + coordSysRect.width], [coordSysRect.y, coordSysRect.y + coordSysRect.height]],
            isHorizontal: isHorizontal2,
            valueDim: LAYOUT_ATTRS[+isHorizontal2],
            categoryDim: LAYOUT_ATTRS[1 - +isHorizontal2]
          };
          data.diff(oldData).add(function(dataIndex) {
            if (!data.hasValue(dataIndex)) {
              return;
            }
            var itemModel = getItemModel(data, dataIndex);
            var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt);
            var bar = createBar(data, opt, symbolMeta);
            data.setItemGraphicEl(dataIndex, bar);
            group.add(bar);
            updateCommon(bar, opt, symbolMeta);
          }).update(function(newIndex, oldIndex) {
            var bar = oldData.getItemGraphicEl(oldIndex);
            if (!data.hasValue(newIndex)) {
              group.remove(bar);
              return;
            }
            var itemModel = getItemModel(data, newIndex);
            var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt);
            var pictorialShapeStr = getShapeStr(data, symbolMeta);
            if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) {
              group.remove(bar);
              data.setItemGraphicEl(newIndex, null);
              bar = null;
            }
            if (bar) {
              updateBar(bar, opt, symbolMeta);
            } else {
              bar = createBar(data, opt, symbolMeta, true);
            }
            data.setItemGraphicEl(newIndex, bar);
            bar.__pictorialSymbolMeta = symbolMeta;
            group.add(bar);
            updateCommon(bar, opt, symbolMeta);
          }).remove(function(dataIndex) {
            var bar = oldData.getItemGraphicEl(dataIndex);
            bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar);
          }).execute();
          var clipPath = seriesModel.get("clip", true) ? createClipPath(seriesModel.coordinateSystem, false, seriesModel) : null;
          if (clipPath) {
            group.setClipPath(clipPath);
          } else {
            group.removeClipPath();
          }
          this._data = data;
          return this.group;
        };
        PictorialBarView2.prototype.remove = function(ecModel, api2) {
          var group = this.group;
          var data = this._data;
          if (ecModel.get("animation")) {
            if (data) {
              data.eachItemGraphicEl(function(bar) {
                removeBar(data, getECData(bar).dataIndex, ecModel, bar);
              });
            }
          } else {
            group.removeAll();
          }
        };
        PictorialBarView2.type = "pictorialBar";
        return PictorialBarView2;
      }(ChartView)
    );
    function getSymbolMeta(data, dataIndex, itemModel, opt) {
      var layout2 = data.getItemLayout(dataIndex);
      var symbolRepeat = itemModel.get("symbolRepeat");
      var symbolClip = itemModel.get("symbolClip");
      var symbolPosition = itemModel.get("symbolPosition") || "start";
      var symbolRotate = itemModel.get("symbolRotate");
      var rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
      var symbolPatternSize = itemModel.get("symbolPatternSize") || 2;
      var isAnimationEnabled2 = itemModel.isAnimationEnabled();
      var symbolMeta = {
        dataIndex,
        layout: layout2,
        itemModel,
        symbolType: data.getItemVisual(dataIndex, "symbol") || "circle",
        style: data.getItemVisual(dataIndex, "style"),
        symbolClip,
        symbolRepeat,
        symbolRepeatDirection: itemModel.get("symbolRepeatDirection"),
        symbolPatternSize,
        rotation,
        animationModel: isAnimationEnabled2 ? itemModel : null,
        hoverScale: isAnimationEnabled2 && itemModel.get(["emphasis", "scale"]),
        z2: itemModel.getShallow("z", true) || 0
      };
      prepareBarLength(itemModel, symbolRepeat, layout2, opt, symbolMeta);
      prepareSymbolSize(data, dataIndex, layout2, symbolRepeat, symbolClip, symbolMeta.boundingLength, symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta);
      prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta);
      var symbolSize = symbolMeta.symbolSize;
      var symbolOffset = normalizeSymbolOffset(itemModel.get("symbolOffset"), symbolSize);
      prepareLayoutInfo(itemModel, symbolSize, layout2, symbolRepeat, symbolClip, symbolOffset, symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, opt, symbolMeta);
      return symbolMeta;
    }
    function prepareBarLength(itemModel, symbolRepeat, layout2, opt, outputSymbolMeta) {
      var valueDim = opt.valueDim;
      var symbolBoundingData = itemModel.get("symbolBoundingData");
      var valueAxis2 = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());
      var zeroPx = valueAxis2.toGlobalCoord(valueAxis2.dataToCoord(0));
      var pxSignIdx = 1 - +(layout2[valueDim.wh] <= 0);
      var boundingLength;
      if (isArray$2(symbolBoundingData)) {
        var symbolBoundingExtent = [convertToCoordOnAxis(valueAxis2, symbolBoundingData[0]) - zeroPx, convertToCoordOnAxis(valueAxis2, symbolBoundingData[1]) - zeroPx];
        symbolBoundingExtent[1] < symbolBoundingExtent[0] && symbolBoundingExtent.reverse();
        boundingLength = symbolBoundingExtent[pxSignIdx];
      } else if (symbolBoundingData != null) {
        boundingLength = convertToCoordOnAxis(valueAxis2, symbolBoundingData) - zeroPx;
      } else if (symbolRepeat) {
        boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;
      } else {
        boundingLength = layout2[valueDim.wh];
      }
      outputSymbolMeta.boundingLength = boundingLength;
      if (symbolRepeat) {
        outputSymbolMeta.repeatCutLength = layout2[valueDim.wh];
      }
      var isXAxis = valueDim.xy === "x";
      var isInverse = valueAxis2.inverse;
      outputSymbolMeta.pxSign = isXAxis && !isInverse || !isXAxis && isInverse ? boundingLength >= 0 ? 1 : -1 : boundingLength > 0 ? 1 : -1;
    }
    function convertToCoordOnAxis(axis, value) {
      return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value)));
    }
    function prepareSymbolSize(data, dataIndex, layout2, symbolRepeat, symbolClip, boundingLength, pxSign, symbolPatternSize, opt, outputSymbolMeta) {
      var valueDim = opt.valueDim;
      var categoryDim = opt.categoryDim;
      var categorySize = Math.abs(layout2[categoryDim.wh]);
      var symbolSize = data.getItemVisual(dataIndex, "symbolSize");
      var parsedSymbolSize;
      if (isArray$2(symbolSize)) {
        parsedSymbolSize = symbolSize.slice();
      } else {
        if (symbolSize == null) {
          parsedSymbolSize = ["100%", "100%"];
        } else {
          parsedSymbolSize = [symbolSize, symbolSize];
        }
      }
      parsedSymbolSize[categoryDim.index] = parsePercent(parsedSymbolSize[categoryDim.index], categorySize);
      parsedSymbolSize[valueDim.index] = parsePercent(parsedSymbolSize[valueDim.index], symbolRepeat ? categorySize : Math.abs(boundingLength));
      outputSymbolMeta.symbolSize = parsedSymbolSize;
      var symbolScale = outputSymbolMeta.symbolScale = [parsedSymbolSize[0] / symbolPatternSize, parsedSymbolSize[1] / symbolPatternSize];
      symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign;
    }
    function prepareLineWidth(itemModel, symbolScale, rotation, opt, outputSymbolMeta) {
      var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0;
      if (valueLineWidth) {
        pathForLineWidth.attr({
          scaleX: symbolScale[0],
          scaleY: symbolScale[1],
          rotation
        });
        pathForLineWidth.updateTransform();
        valueLineWidth /= pathForLineWidth.getLineScale();
        valueLineWidth *= symbolScale[opt.valueDim.index];
      }
      outputSymbolMeta.valueLineWidth = valueLineWidth || 0;
    }
    function prepareLayoutInfo(itemModel, symbolSize, layout2, symbolRepeat, symbolClip, symbolOffset, symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, outputSymbolMeta) {
      var categoryDim = opt.categoryDim;
      var valueDim = opt.valueDim;
      var pxSign = outputSymbolMeta.pxSign;
      var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0);
      var pathLen = unitLength;
      if (symbolRepeat) {
        var absBoundingLength = Math.abs(boundingLength);
        var symbolMargin = retrieve(itemModel.get("symbolMargin"), "15%") + "";
        var hasEndGap = false;
        if (symbolMargin.lastIndexOf("!") === symbolMargin.length - 1) {
          hasEndGap = true;
          symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1);
        }
        var symbolMarginNumeric = parsePercent(symbolMargin, symbolSize[valueDim.index]);
        var uLenWithMargin = Math.max(unitLength + symbolMarginNumeric * 2, 0);
        var endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;
        var repeatSpecified = isNumeric(symbolRepeat);
        var repeatTimes = repeatSpecified ? symbolRepeat : toIntTimes((absBoundingLength + endFix) / uLenWithMargin);
        var mDiff = absBoundingLength - repeatTimes * unitLength;
        symbolMarginNumeric = mDiff / 2 / (hasEndGap ? repeatTimes : Math.max(repeatTimes - 1, 1));
        uLenWithMargin = unitLength + symbolMarginNumeric * 2;
        endFix = hasEndGap ? 0 : symbolMarginNumeric * 2;
        if (!repeatSpecified && symbolRepeat !== "fixed") {
          repeatTimes = repeatCutLength ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) : 0;
        }
        pathLen = repeatTimes * uLenWithMargin - endFix;
        outputSymbolMeta.repeatTimes = repeatTimes;
        outputSymbolMeta.symbolMargin = symbolMarginNumeric;
      }
      var sizeFix = pxSign * (pathLen / 2);
      var pathPosition = outputSymbolMeta.pathPosition = [];
      pathPosition[categoryDim.index] = layout2[categoryDim.wh] / 2;
      pathPosition[valueDim.index] = symbolPosition === "start" ? sizeFix : symbolPosition === "end" ? boundingLength - sizeFix : boundingLength / 2;
      if (symbolOffset) {
        pathPosition[0] += symbolOffset[0];
        pathPosition[1] += symbolOffset[1];
      }
      var bundlePosition = outputSymbolMeta.bundlePosition = [];
      bundlePosition[categoryDim.index] = layout2[categoryDim.xy];
      bundlePosition[valueDim.index] = layout2[valueDim.xy];
      var barRectShape = outputSymbolMeta.barRectShape = extend$1({}, layout2);
      barRectShape[valueDim.wh] = pxSign * Math.max(Math.abs(layout2[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix));
      barRectShape[categoryDim.wh] = layout2[categoryDim.wh];
      var clipShape = outputSymbolMeta.clipShape = {};
      clipShape[categoryDim.xy] = -layout2[categoryDim.xy];
      clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh];
      clipShape[valueDim.xy] = 0;
      clipShape[valueDim.wh] = layout2[valueDim.wh];
    }
    function createPath(symbolMeta) {
      var symbolPatternSize = symbolMeta.symbolPatternSize;
      var path = createSymbol$1(
        // Consider texture img, make a big size.
        symbolMeta.symbolType,
        -symbolPatternSize / 2,
        -symbolPatternSize / 2,
        symbolPatternSize,
        symbolPatternSize
      );
      path.attr({
        culling: true
      });
      path.type !== "image" && path.setStyle({
        strokeNoScale: true
      });
      return path;
    }
    function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) {
      var bundle = bar.__pictorialBundle;
      var symbolSize = symbolMeta.symbolSize;
      var valueLineWidth = symbolMeta.valueLineWidth;
      var pathPosition = symbolMeta.pathPosition;
      var valueDim = opt.valueDim;
      var repeatTimes = symbolMeta.repeatTimes || 0;
      var index = 0;
      var unit2 = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2;
      eachPath(bar, function(path2) {
        path2.__pictorialAnimationIndex = index;
        path2.__pictorialRepeatTimes = repeatTimes;
        if (index < repeatTimes) {
          updateAttr(path2, null, makeTarget(index), symbolMeta, isUpdate);
        } else {
          updateAttr(path2, null, {
            scaleX: 0,
            scaleY: 0
          }, symbolMeta, isUpdate, function() {
            bundle.remove(path2);
          });
        }
        index++;
      });
      for (; index < repeatTimes; index++) {
        var path = createPath(symbolMeta);
        path.__pictorialAnimationIndex = index;
        path.__pictorialRepeatTimes = repeatTimes;
        bundle.add(path);
        var target = makeTarget(index);
        updateAttr(path, {
          x: target.x,
          y: target.y,
          scaleX: 0,
          scaleY: 0
        }, {
          scaleX: target.scaleX,
          scaleY: target.scaleY,
          rotation: target.rotation
        }, symbolMeta, isUpdate);
      }
      function makeTarget(index2) {
        var position2 = pathPosition.slice();
        var pxSign = symbolMeta.pxSign;
        var i2 = index2;
        if (symbolMeta.symbolRepeatDirection === "start" ? pxSign > 0 : pxSign < 0) {
          i2 = repeatTimes - 1 - index2;
        }
        position2[valueDim.index] = unit2 * (i2 - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index];
        return {
          x: position2[0],
          y: position2[1],
          scaleX: symbolMeta.symbolScale[0],
          scaleY: symbolMeta.symbolScale[1],
          rotation: symbolMeta.rotation
        };
      }
    }
    function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) {
      var bundle = bar.__pictorialBundle;
      var mainPath = bar.__pictorialMainPath;
      if (!mainPath) {
        mainPath = bar.__pictorialMainPath = createPath(symbolMeta);
        bundle.add(mainPath);
        updateAttr(mainPath, {
          x: symbolMeta.pathPosition[0],
          y: symbolMeta.pathPosition[1],
          scaleX: 0,
          scaleY: 0,
          rotation: symbolMeta.rotation
        }, {
          scaleX: symbolMeta.symbolScale[0],
          scaleY: symbolMeta.symbolScale[1]
        }, symbolMeta, isUpdate);
      } else {
        updateAttr(mainPath, null, {
          x: symbolMeta.pathPosition[0],
          y: symbolMeta.pathPosition[1],
          scaleX: symbolMeta.symbolScale[0],
          scaleY: symbolMeta.symbolScale[1],
          rotation: symbolMeta.rotation
        }, symbolMeta, isUpdate);
      }
    }
    function createOrUpdateBarRect(bar, symbolMeta, isUpdate) {
      var rectShape = extend$1({}, symbolMeta.barRectShape);
      var barRect = bar.__pictorialBarRect;
      if (!barRect) {
        barRect = bar.__pictorialBarRect = new Rect$2({
          z2: 2,
          shape: rectShape,
          silent: true,
          style: {
            stroke: "transparent",
            fill: "transparent",
            lineWidth: 0
          }
        });
        barRect.disableMorphing = true;
        bar.add(barRect);
      } else {
        updateAttr(barRect, null, {
          shape: rectShape
        }, symbolMeta, isUpdate);
      }
    }
    function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) {
      if (symbolMeta.symbolClip) {
        var clipPath = bar.__pictorialClipPath;
        var clipShape = extend$1({}, symbolMeta.clipShape);
        var valueDim = opt.valueDim;
        var animationModel = symbolMeta.animationModel;
        var dataIndex = symbolMeta.dataIndex;
        if (clipPath) {
          updateProps$1(clipPath, {
            shape: clipShape
          }, animationModel, dataIndex);
        } else {
          clipShape[valueDim.wh] = 0;
          clipPath = new Rect$2({
            shape: clipShape
          });
          bar.__pictorialBundle.setClipPath(clipPath);
          bar.__pictorialClipPath = clipPath;
          var target = {};
          target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh];
          graphic[isUpdate ? "updateProps" : "initProps"](clipPath, {
            shape: target
          }, animationModel, dataIndex);
        }
      }
    }
    function getItemModel(data, dataIndex) {
      var itemModel = data.getItemModel(dataIndex);
      itemModel.getAnimationDelayParams = getAnimationDelayParams;
      itemModel.isAnimationEnabled = isAnimationEnabled;
      return itemModel;
    }
    function getAnimationDelayParams(path) {
      return {
        index: path.__pictorialAnimationIndex,
        count: path.__pictorialRepeatTimes
      };
    }
    function isAnimationEnabled() {
      return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation");
    }
    function createBar(data, opt, symbolMeta, isUpdate) {
      var bar = new Group$3();
      var bundle = new Group$3();
      bar.add(bundle);
      bar.__pictorialBundle = bundle;
      bundle.x = symbolMeta.bundlePosition[0];
      bundle.y = symbolMeta.bundlePosition[1];
      if (symbolMeta.symbolRepeat) {
        createOrUpdateRepeatSymbols(bar, opt, symbolMeta);
      } else {
        createOrUpdateSingleSymbol(bar, opt, symbolMeta);
      }
      createOrUpdateBarRect(bar, symbolMeta, isUpdate);
      createOrUpdateClip(bar, opt, symbolMeta, isUpdate);
      bar.__pictorialShapeStr = getShapeStr(data, symbolMeta);
      bar.__pictorialSymbolMeta = symbolMeta;
      return bar;
    }
    function updateBar(bar, opt, symbolMeta) {
      var animationModel = symbolMeta.animationModel;
      var dataIndex = symbolMeta.dataIndex;
      var bundle = bar.__pictorialBundle;
      updateProps$1(bundle, {
        x: symbolMeta.bundlePosition[0],
        y: symbolMeta.bundlePosition[1]
      }, animationModel, dataIndex);
      if (symbolMeta.symbolRepeat) {
        createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true);
      } else {
        createOrUpdateSingleSymbol(bar, opt, symbolMeta, true);
      }
      createOrUpdateBarRect(bar, symbolMeta, true);
      createOrUpdateClip(bar, opt, symbolMeta, true);
    }
    function removeBar(data, dataIndex, animationModel, bar) {
      var labelRect = bar.__pictorialBarRect;
      labelRect && labelRect.removeTextContent();
      var paths = [];
      eachPath(bar, function(path) {
        paths.push(path);
      });
      bar.__pictorialMainPath && paths.push(bar.__pictorialMainPath);
      bar.__pictorialClipPath && (animationModel = null);
      each$f(paths, function(path) {
        removeElement(path, {
          scaleX: 0,
          scaleY: 0
        }, animationModel, dataIndex, function() {
          bar.parent && bar.parent.remove(bar);
        });
      });
      data.setItemGraphicEl(dataIndex, null);
    }
    function getShapeStr(data, symbolMeta) {
      return [data.getItemVisual(symbolMeta.dataIndex, "symbol") || "none", !!symbolMeta.symbolRepeat, !!symbolMeta.symbolClip].join(":");
    }
    function eachPath(bar, cb, context) {
      each$f(bar.__pictorialBundle.children(), function(el) {
        el !== bar.__pictorialBarRect && cb.call(context, el);
      });
    }
    function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) {
      immediateAttrs && el.attr(immediateAttrs);
      if (symbolMeta.symbolClip && !isUpdate) {
        animationAttrs && el.attr(animationAttrs);
      } else {
        animationAttrs && graphic[isUpdate ? "updateProps" : "initProps"](el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb);
      }
    }
    function updateCommon(bar, opt, symbolMeta) {
      var dataIndex = symbolMeta.dataIndex;
      var itemModel = symbolMeta.itemModel;
      var emphasisModel = itemModel.getModel("emphasis");
      var emphasisStyle = emphasisModel.getModel("itemStyle").getItemStyle();
      var blurStyle = itemModel.getModel(["blur", "itemStyle"]).getItemStyle();
      var selectStyle = itemModel.getModel(["select", "itemStyle"]).getItemStyle();
      var cursorStyle = itemModel.getShallow("cursor");
      var focus = emphasisModel.get("focus");
      var blurScope = emphasisModel.get("blurScope");
      var hoverScale = emphasisModel.get("scale");
      eachPath(bar, function(path) {
        if (path instanceof ZRImage) {
          var pathStyle = path.style;
          path.useStyle(extend$1({
            // TODO other properties like dx, dy ?
            image: pathStyle.image,
            x: pathStyle.x,
            y: pathStyle.y,
            width: pathStyle.width,
            height: pathStyle.height
          }, symbolMeta.style));
        } else {
          path.useStyle(symbolMeta.style);
        }
        var emphasisState = path.ensureState("emphasis");
        emphasisState.style = emphasisStyle;
        if (hoverScale) {
          emphasisState.scaleX = path.scaleX * 1.1;
          emphasisState.scaleY = path.scaleY * 1.1;
        }
        path.ensureState("blur").style = blurStyle;
        path.ensureState("select").style = selectStyle;
        cursorStyle && (path.cursor = cursorStyle);
        path.z2 = symbolMeta.z2;
      });
      var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)];
      var barRect = bar.__pictorialBarRect;
      barRect.ignoreClip = true;
      setLabelStyle(barRect, getLabelStatesModels(itemModel), {
        labelFetcher: opt.seriesModel,
        labelDataIndex: dataIndex,
        defaultText: getDefaultLabel(opt.seriesModel.getData(), dataIndex),
        inheritColor: symbolMeta.style.fill,
        defaultOpacity: symbolMeta.style.opacity,
        defaultOutsidePosition: barPositionOutside
      });
      toggleHoverEmphasis(bar, focus, blurScope, emphasisModel.get("disabled"));
    }
    function toIntTimes(times) {
      var roundedTimes = Math.round(times);
      return Math.abs(times - roundedTimes) < 1e-4 ? roundedTimes : Math.ceil(times);
    }
    var PictorialBarSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(PictorialBarSeriesModel2, _super);
        function PictorialBarSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PictorialBarSeriesModel2.type;
          _this.hasSymbolVisual = true;
          _this.defaultSymbol = "roundRect";
          return _this;
        }
        PictorialBarSeriesModel2.prototype.getInitialData = function(option) {
          option.stack = null;
          return _super.prototype.getInitialData.apply(this, arguments);
        };
        PictorialBarSeriesModel2.type = "series.pictorialBar";
        PictorialBarSeriesModel2.dependencies = ["grid"];
        PictorialBarSeriesModel2.defaultOption = inheritDefaultOption(BaseBarSeriesModel.defaultOption, {
          symbol: "circle",
          symbolSize: null,
          symbolRotate: null,
          symbolPosition: null,
          symbolOffset: null,
          symbolMargin: null,
          symbolRepeat: false,
          symbolRepeatDirection: "end",
          symbolClip: false,
          symbolBoundingData: null,
          symbolPatternSize: 400,
          barGap: "-100%",
          // Pictorial bar do not clip by default because in many cases
          // xAxis and yAxis are not displayed and it's expected not to clip
          clip: false,
          // z can be set in data item, which is z2 actually.
          // Disable progressive
          progressive: 0,
          emphasis: {
            // By default pictorialBar do not hover scale. Hover scale is not suitable
            // for the case that both has foreground and background.
            scale: false
          },
          select: {
            itemStyle: {
              borderColor: "#212121"
            }
          }
        });
        return PictorialBarSeriesModel2;
      }(BaseBarSeriesModel)
    );
    function install$u(registers) {
      registers.registerChartView(PictorialBarView);
      registers.registerSeriesModel(PictorialBarSeriesModel);
      registers.registerLayout(registers.PRIORITY.VISUAL.LAYOUT, curry$1(layout$3, "pictorialBar"));
      registers.registerLayout(registers.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT, createProgressiveLayout("pictorialBar"));
    }
    var ThemeRiverView = (
      /** @class */
      function(_super) {
        __extends$1(ThemeRiverView2, _super);
        function ThemeRiverView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ThemeRiverView2.type;
          _this._layers = [];
          return _this;
        }
        ThemeRiverView2.prototype.render = function(seriesModel, ecModel, api2) {
          var data = seriesModel.getData();
          var self2 = this;
          var group = this.group;
          var layersSeries = seriesModel.getLayerSeries();
          var layoutInfo = data.getLayout("layoutInfo");
          var rect = layoutInfo.rect;
          var boundaryGap = layoutInfo.boundaryGap;
          group.x = 0;
          group.y = rect.y + boundaryGap[0];
          function keyGetter(item) {
            return item.name;
          }
          var dataDiffer = new DataDiffer(this._layersSeries || [], layersSeries, keyGetter, keyGetter);
          var newLayersGroups = [];
          dataDiffer.add(bind$2(process2, this, "add")).update(bind$2(process2, this, "update")).remove(bind$2(process2, this, "remove")).execute();
          function process2(status, idx, oldIdx) {
            var oldLayersGroups = self2._layers;
            if (status === "remove") {
              group.remove(oldLayersGroups[idx]);
              return;
            }
            var points0 = [];
            var points1 = [];
            var style;
            var indices = layersSeries[idx].indices;
            var j = 0;
            for (; j < indices.length; j++) {
              var layout2 = data.getItemLayout(indices[j]);
              var x2 = layout2.x;
              var y0 = layout2.y0;
              var y = layout2.y;
              points0.push(x2, y0);
              points1.push(x2, y0 + y);
              style = data.getItemVisual(indices[j], "style");
            }
            var polygon;
            var textLayout = data.getItemLayout(indices[0]);
            var labelModel = seriesModel.getModel("label");
            var margin = labelModel.get("margin");
            var emphasisModel = seriesModel.getModel("emphasis");
            if (status === "add") {
              var layerGroup = newLayersGroups[idx] = new Group$3();
              polygon = new ECPolygon({
                shape: {
                  points: points0,
                  stackedOnPoints: points1,
                  smooth: 0.4,
                  stackedOnSmooth: 0.4,
                  smoothConstraint: false
                },
                z2: 0
              });
              layerGroup.add(polygon);
              group.add(layerGroup);
              if (seriesModel.isAnimationEnabled()) {
                polygon.setClipPath(createGridClipShape(polygon.getBoundingRect(), seriesModel, function() {
                  polygon.removeClipPath();
                }));
              }
            } else {
              var layerGroup = oldLayersGroups[oldIdx];
              polygon = layerGroup.childAt(0);
              group.add(layerGroup);
              newLayersGroups[idx] = layerGroup;
              updateProps$1(polygon, {
                shape: {
                  points: points0,
                  stackedOnPoints: points1
                }
              }, seriesModel);
              saveOldStyle(polygon);
            }
            setLabelStyle(polygon, getLabelStatesModels(seriesModel), {
              labelDataIndex: indices[j - 1],
              defaultText: data.getName(indices[j - 1]),
              inheritColor: style.fill
            }, {
              normal: {
                verticalAlign: "middle"
                // align: 'right'
              }
            });
            polygon.setTextConfig({
              position: null,
              local: true
            });
            var labelEl = polygon.getTextContent();
            if (labelEl) {
              labelEl.x = textLayout.x - margin;
              labelEl.y = textLayout.y0 + textLayout.y / 2;
            }
            polygon.useStyle(style);
            data.setItemGraphicEl(idx, polygon);
            setStatesStylesFromModel(polygon, seriesModel);
            toggleHoverEmphasis(polygon, emphasisModel.get("focus"), emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
          }
          this._layersSeries = layersSeries;
          this._layers = newLayersGroups;
        };
        ThemeRiverView2.type = "themeRiver";
        return ThemeRiverView2;
      }(ChartView)
    );
    function createGridClipShape(rect, seriesModel, cb) {
      var rectEl = new Rect$2({
        shape: {
          x: rect.x - 10,
          y: rect.y - 10,
          width: 0,
          height: rect.height + 20
        }
      });
      initProps(rectEl, {
        shape: {
          x: rect.x - 50,
          width: rect.width + 100,
          height: rect.height + 20
        }
      }, seriesModel, cb);
      return rectEl;
    }
    var DATA_NAME_INDEX = 2;
    var ThemeRiverSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(ThemeRiverSeriesModel2, _super);
        function ThemeRiverSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ThemeRiverSeriesModel2.type;
          return _this;
        }
        ThemeRiverSeriesModel2.prototype.init = function(option) {
          _super.prototype.init.apply(this, arguments);
          this.legendVisualProvider = new LegendVisualProvider(bind$2(this.getData, this), bind$2(this.getRawData, this));
        };
        ThemeRiverSeriesModel2.prototype.fixData = function(data) {
          var rawDataLength = data.length;
          var timeValueKeys = {};
          var groupResult = groupData(data, function(item) {
            if (!timeValueKeys.hasOwnProperty(item[0] + "")) {
              timeValueKeys[item[0] + ""] = -1;
            }
            return item[2];
          });
          var layerData = [];
          groupResult.buckets.each(function(items, key) {
            layerData.push({
              name: key,
              dataList: items
            });
          });
          var layerNum = layerData.length;
          for (var k2 = 0; k2 < layerNum; ++k2) {
            var name_1 = layerData[k2].name;
            for (var j = 0; j < layerData[k2].dataList.length; ++j) {
              var timeValue = layerData[k2].dataList[j][0] + "";
              timeValueKeys[timeValue] = k2;
            }
            for (var timeValue in timeValueKeys) {
              if (timeValueKeys.hasOwnProperty(timeValue) && timeValueKeys[timeValue] !== k2) {
                timeValueKeys[timeValue] = k2;
                data[rawDataLength] = [timeValue, 0, name_1];
                rawDataLength++;
              }
            }
          }
          return data;
        };
        ThemeRiverSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var singleAxisModel = this.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
          var axisType = singleAxisModel.get("type");
          var filterData = filter(option.data, function(dataItem) {
            return dataItem[2] !== void 0;
          });
          var data = this.fixData(filterData || []);
          var nameList = [];
          var nameMap = this.nameMap = createHashMap();
          var count2 = 0;
          for (var i2 = 0; i2 < data.length; ++i2) {
            nameList.push(data[i2][DATA_NAME_INDEX]);
            if (!nameMap.get(data[i2][DATA_NAME_INDEX])) {
              nameMap.set(data[i2][DATA_NAME_INDEX], count2);
              count2++;
            }
          }
          var dimensions = prepareSeriesDataSchema(data, {
            coordDimensions: ["single"],
            dimensionsDefine: [{
              name: "time",
              type: getDimensionTypeByAxis(axisType)
            }, {
              name: "value",
              type: "float"
            }, {
              name: "name",
              type: "ordinal"
            }],
            encodeDefine: {
              single: 0,
              value: 1,
              itemName: 2
            }
          }).dimensions;
          var list = new SeriesData(dimensions, this);
          list.initData(data);
          return list;
        };
        ThemeRiverSeriesModel2.prototype.getLayerSeries = function() {
          var data = this.getData();
          var lenCount = data.count();
          var indexArr = [];
          for (var i2 = 0; i2 < lenCount; ++i2) {
            indexArr[i2] = i2;
          }
          var timeDim = data.mapDimension("single");
          var groupResult = groupData(indexArr, function(index) {
            return data.get("name", index);
          });
          var layerSeries = [];
          groupResult.buckets.each(function(items, key) {
            items.sort(function(index1, index2) {
              return data.get(timeDim, index1) - data.get(timeDim, index2);
            });
            layerSeries.push({
              name: key,
              indices: items
            });
          });
          return layerSeries;
        };
        ThemeRiverSeriesModel2.prototype.getAxisTooltipData = function(dim, value, baseAxis) {
          if (!isArray$2(dim)) {
            dim = dim ? [dim] : [];
          }
          var data = this.getData();
          var layerSeries = this.getLayerSeries();
          var indices = [];
          var layerNum = layerSeries.length;
          var nestestValue;
          for (var i2 = 0; i2 < layerNum; ++i2) {
            var minDist = Number.MAX_VALUE;
            var nearestIdx = -1;
            var pointNum = layerSeries[i2].indices.length;
            for (var j = 0; j < pointNum; ++j) {
              var theValue = data.get(dim[0], layerSeries[i2].indices[j]);
              var dist2 = Math.abs(theValue - value);
              if (dist2 <= minDist) {
                nestestValue = theValue;
                minDist = dist2;
                nearestIdx = layerSeries[i2].indices[j];
              }
            }
            indices.push(nearestIdx);
          }
          return {
            dataIndices: indices,
            nestestValue
          };
        };
        ThemeRiverSeriesModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var name = data.getName(dataIndex);
          var value = data.get(data.mapDimension("value"), dataIndex);
          return createTooltipMarkup("nameValue", {
            name,
            value
          });
        };
        ThemeRiverSeriesModel2.type = "series.themeRiver";
        ThemeRiverSeriesModel2.dependencies = ["singleAxis"];
        ThemeRiverSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          colorBy: "data",
          coordinateSystem: "singleAxis",
          // gap in axis's orthogonal orientation
          boundaryGap: ["10%", "10%"],
          // legendHoverLink: true,
          singleAxisIndex: 0,
          animationEasing: "linear",
          label: {
            margin: 4,
            show: true,
            position: "left",
            fontSize: 11
          },
          emphasis: {
            label: {
              show: true
            }
          }
        };
        return ThemeRiverSeriesModel2;
      }(SeriesModel)
    );
    function themeRiverLayout(ecModel, api2) {
      ecModel.eachSeriesByType("themeRiver", function(seriesModel) {
        var data = seriesModel.getData();
        var single = seriesModel.coordinateSystem;
        var layoutInfo = {};
        var rect = single.getRect();
        layoutInfo.rect = rect;
        var boundaryGap = seriesModel.get("boundaryGap");
        var axis = single.getAxis();
        layoutInfo.boundaryGap = boundaryGap;
        if (axis.orient === "horizontal") {
          boundaryGap[0] = parsePercent(boundaryGap[0], rect.height);
          boundaryGap[1] = parsePercent(boundaryGap[1], rect.height);
          var height = rect.height - boundaryGap[0] - boundaryGap[1];
          doThemeRiverLayout(data, seriesModel, height);
        } else {
          boundaryGap[0] = parsePercent(boundaryGap[0], rect.width);
          boundaryGap[1] = parsePercent(boundaryGap[1], rect.width);
          var width = rect.width - boundaryGap[0] - boundaryGap[1];
          doThemeRiverLayout(data, seriesModel, width);
        }
        data.setLayout("layoutInfo", layoutInfo);
      });
    }
    function doThemeRiverLayout(data, seriesModel, height) {
      if (!data.count()) {
        return;
      }
      var coordSys = seriesModel.coordinateSystem;
      var layerSeries = seriesModel.getLayerSeries();
      var timeDim = data.mapDimension("single");
      var valueDim = data.mapDimension("value");
      var layerPoints = map$1(layerSeries, function(singleLayer) {
        return map$1(singleLayer.indices, function(idx) {
          var pt3 = coordSys.dataToPoint(data.get(timeDim, idx));
          pt3[1] = data.get(valueDim, idx);
          return pt3;
        });
      });
      var base2 = computeBaseline(layerPoints);
      var baseLine = base2.y0;
      var ky = height / base2.max;
      var n = layerSeries.length;
      var m2 = layerSeries[0].indices.length;
      var baseY0;
      for (var j = 0; j < m2; ++j) {
        baseY0 = baseLine[j] * ky;
        data.setItemLayout(layerSeries[0].indices[j], {
          layerIndex: 0,
          x: layerPoints[0][j][0],
          y0: baseY0,
          y: layerPoints[0][j][1] * ky
        });
        for (var i2 = 1; i2 < n; ++i2) {
          baseY0 += layerPoints[i2 - 1][j][1] * ky;
          data.setItemLayout(layerSeries[i2].indices[j], {
            layerIndex: i2,
            x: layerPoints[i2][j][0],
            y0: baseY0,
            y: layerPoints[i2][j][1] * ky
          });
        }
      }
    }
    function computeBaseline(data) {
      var layerNum = data.length;
      var pointNum = data[0].length;
      var sums = [];
      var y0 = [];
      var max3 = 0;
      for (var i2 = 0; i2 < pointNum; ++i2) {
        var temp = 0;
        for (var j = 0; j < layerNum; ++j) {
          temp += data[j][i2][1];
        }
        if (temp > max3) {
          max3 = temp;
        }
        sums.push(temp);
      }
      for (var k2 = 0; k2 < pointNum; ++k2) {
        y0[k2] = (max3 - sums[k2]) / 2;
      }
      max3 = 0;
      for (var l2 = 0; l2 < pointNum; ++l2) {
        var sum2 = sums[l2] + y0[l2];
        if (sum2 > max3) {
          max3 = sum2;
        }
      }
      return {
        y0,
        max: max3
      };
    }
    function install$t(registers) {
      registers.registerChartView(ThemeRiverView);
      registers.registerSeriesModel(ThemeRiverSeriesModel);
      registers.registerLayout(themeRiverLayout);
      registers.registerProcessor(dataFilter$1("themeRiver"));
    }
    var DEFAULT_SECTOR_Z = 2;
    var DEFAULT_TEXT_Z = 4;
    var SunburstPiece = (
      /** @class */
      function(_super) {
        __extends$1(SunburstPiece2, _super);
        function SunburstPiece2(node, seriesModel, ecModel, api2) {
          var _this = _super.call(this) || this;
          _this.z2 = DEFAULT_SECTOR_Z;
          _this.textConfig = {
            inside: true
          };
          getECData(_this).seriesIndex = seriesModel.seriesIndex;
          var text = new ZRText({
            z2: DEFAULT_TEXT_Z,
            silent: node.getModel().get(["label", "silent"])
          });
          _this.setTextContent(text);
          _this.updateData(true, node, seriesModel, ecModel, api2);
          return _this;
        }
        SunburstPiece2.prototype.updateData = function(firstCreate, node, seriesModel, ecModel, api2) {
          this.node = node;
          node.piece = this;
          seriesModel = seriesModel || this._seriesModel;
          ecModel = ecModel || this._ecModel;
          var sector = this;
          getECData(sector).dataIndex = node.dataIndex;
          var itemModel = node.getModel();
          var emphasisModel = itemModel.getModel("emphasis");
          var layout2 = node.getLayout();
          var sectorShape = extend$1({}, layout2);
          sectorShape.label = null;
          var normalStyle = node.getVisual("style");
          normalStyle.lineJoin = "bevel";
          var decal = node.getVisual("decal");
          if (decal) {
            normalStyle.decal = createOrUpdatePatternFromDecal(decal, api2);
          }
          var cornerRadius = getSectorCornerRadius(itemModel.getModel("itemStyle"), sectorShape, true);
          extend$1(sectorShape, cornerRadius);
          each$f(SPECIAL_STATES, function(stateName) {
            var state = sector.ensureState(stateName);
            var itemStyleModel = itemModel.getModel([stateName, "itemStyle"]);
            state.style = itemStyleModel.getItemStyle();
            var cornerRadius2 = getSectorCornerRadius(itemStyleModel, sectorShape);
            if (cornerRadius2) {
              state.shape = cornerRadius2;
            }
          });
          if (firstCreate) {
            sector.setShape(sectorShape);
            sector.shape.r = layout2.r0;
            initProps(sector, {
              shape: {
                r: layout2.r
              }
            }, seriesModel, node.dataIndex);
          } else {
            updateProps$1(sector, {
              shape: sectorShape
            }, seriesModel);
            saveOldStyle(sector);
          }
          sector.useStyle(normalStyle);
          this._updateLabel(seriesModel);
          var cursorStyle = itemModel.getShallow("cursor");
          cursorStyle && sector.attr("cursor", cursorStyle);
          this._seriesModel = seriesModel || this._seriesModel;
          this._ecModel = ecModel || this._ecModel;
          var focus = emphasisModel.get("focus");
          var focusOrIndices = focus === "relative" ? concatArray(node.getAncestorsIndices(), node.getDescendantIndices()) : focus === "ancestor" ? node.getAncestorsIndices() : focus === "descendant" ? node.getDescendantIndices() : focus;
          toggleHoverEmphasis(this, focusOrIndices, emphasisModel.get("blurScope"), emphasisModel.get("disabled"));
        };
        SunburstPiece2.prototype._updateLabel = function(seriesModel) {
          var _this = this;
          var itemModel = this.node.getModel();
          var normalLabelModel = itemModel.getModel("label");
          var layout2 = this.node.getLayout();
          var angle2 = layout2.endAngle - layout2.startAngle;
          var midAngle = (layout2.startAngle + layout2.endAngle) / 2;
          var dx = Math.cos(midAngle);
          var dy = Math.sin(midAngle);
          var sector = this;
          var label = sector.getTextContent();
          var dataIndex = this.node.dataIndex;
          var labelMinAngle = normalLabelModel.get("minAngle") / 180 * Math.PI;
          var isNormalShown = normalLabelModel.get("show") && !(labelMinAngle != null && Math.abs(angle2) < labelMinAngle);
          label.ignore = !isNormalShown;
          each$f(DISPLAY_STATES, function(stateName) {
            var labelStateModel = stateName === "normal" ? itemModel.getModel("label") : itemModel.getModel([stateName, "label"]);
            var isNormal = stateName === "normal";
            var state = isNormal ? label : label.ensureState(stateName);
            var text = seriesModel.getFormattedLabel(dataIndex, stateName);
            if (isNormal) {
              text = text || _this.node.name;
            }
            state.style = createTextStyle(labelStateModel, {}, null, stateName !== "normal", true);
            if (text) {
              state.style.text = text;
            }
            var isShown = labelStateModel.get("show");
            if (isShown != null && !isNormal) {
              state.ignore = !isShown;
            }
            var labelPosition = getLabelAttr(labelStateModel, "position");
            var sectorState = isNormal ? sector : sector.states[stateName];
            var labelColor = sectorState.style.fill;
            sectorState.textConfig = {
              outsideFill: labelStateModel.get("color") === "inherit" ? labelColor : null,
              inside: labelPosition !== "outside"
            };
            var r;
            var labelPadding = getLabelAttr(labelStateModel, "distance") || 0;
            var textAlign2 = getLabelAttr(labelStateModel, "align");
            var rotateType = getLabelAttr(labelStateModel, "rotate");
            var flipStartAngle = Math.PI * 0.5;
            var flipEndAngle = Math.PI * 1.5;
            var midAngleNormal = normalizeRadian(rotateType === "tangential" ? Math.PI / 2 - midAngle : midAngle);
            var needsFlip = midAngleNormal > flipStartAngle && !isRadianAroundZero(midAngleNormal - flipStartAngle) && midAngleNormal < flipEndAngle;
            if (labelPosition === "outside") {
              r = layout2.r + labelPadding;
              textAlign2 = needsFlip ? "right" : "left";
            } else {
              if (!textAlign2 || textAlign2 === "center") {
                if (angle2 === 2 * Math.PI && layout2.r0 === 0) {
                  r = 0;
                } else {
                  r = (layout2.r + layout2.r0) / 2;
                }
                textAlign2 = "center";
              } else if (textAlign2 === "left") {
                r = layout2.r0 + labelPadding;
                textAlign2 = needsFlip ? "right" : "left";
              } else if (textAlign2 === "right") {
                r = layout2.r - labelPadding;
                textAlign2 = needsFlip ? "left" : "right";
              }
            }
            state.style.align = textAlign2;
            state.style.verticalAlign = getLabelAttr(labelStateModel, "verticalAlign") || "middle";
            state.x = r * dx + layout2.cx;
            state.y = r * dy + layout2.cy;
            var rotate2 = 0;
            if (rotateType === "radial") {
              rotate2 = normalizeRadian(-midAngle) + (needsFlip ? Math.PI : 0);
            } else if (rotateType === "tangential") {
              rotate2 = normalizeRadian(Math.PI / 2 - midAngle) + (needsFlip ? Math.PI : 0);
            } else if (isNumber$1(rotateType)) {
              rotate2 = rotateType * Math.PI / 180;
            }
            state.rotation = normalizeRadian(rotate2);
          });
          function getLabelAttr(model, name) {
            var stateAttr = model.get(name);
            if (stateAttr == null) {
              return normalLabelModel.get(name);
            }
            return stateAttr;
          }
          label.dirtyStyle();
        };
        return SunburstPiece2;
      }(Sector)
    );
    var ROOT_TO_NODE_ACTION = "sunburstRootToNode";
    var HIGHLIGHT_ACTION = "sunburstHighlight";
    var UNHIGHLIGHT_ACTION = "sunburstUnhighlight";
    function installSunburstAction(registers) {
      registers.registerAction({
        type: ROOT_TO_NODE_ACTION,
        update: "updateView"
      }, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "series",
          subType: "sunburst",
          query: payload
        }, handleRootToNode);
        function handleRootToNode(model, index) {
          var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION], model);
          if (targetInfo) {
            var originViewRoot = model.getViewRoot();
            if (originViewRoot) {
              payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) ? "rollUp" : "drillDown";
            }
            model.resetViewRoot(targetInfo.node);
          }
        }
      });
      registers.registerAction({
        type: HIGHLIGHT_ACTION,
        update: "none"
      }, function(payload, ecModel, api2) {
        payload = extend$1({}, payload);
        ecModel.eachComponent({
          mainType: "series",
          subType: "sunburst",
          query: payload
        }, handleHighlight);
        function handleHighlight(model) {
          var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model);
          if (targetInfo) {
            payload.dataIndex = targetInfo.node.dataIndex;
          }
        }
        api2.dispatchAction(extend$1(payload, {
          type: "highlight"
        }));
      });
      registers.registerAction({
        type: UNHIGHLIGHT_ACTION,
        update: "updateView"
      }, function(payload, ecModel, api2) {
        payload = extend$1({}, payload);
        api2.dispatchAction(extend$1(payload, {
          type: "downplay"
        }));
      });
    }
    var SunburstView = (
      /** @class */
      function(_super) {
        __extends$1(SunburstView2, _super);
        function SunburstView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SunburstView2.type;
          return _this;
        }
        SunburstView2.prototype.render = function(seriesModel, ecModel, api2, payload) {
          var self2 = this;
          this.seriesModel = seriesModel;
          this.api = api2;
          this.ecModel = ecModel;
          var data = seriesModel.getData();
          var virtualRoot = data.tree.root;
          var newRoot = seriesModel.getViewRoot();
          var group = this.group;
          var renderLabelForZeroData = seriesModel.get("renderLabelForZeroData");
          var newChildren = [];
          newRoot.eachNode(function(node) {
            newChildren.push(node);
          });
          var oldChildren = this._oldChildren || [];
          dualTravel(newChildren, oldChildren);
          renderRollUp(virtualRoot, newRoot);
          this._initEvents();
          this._oldChildren = newChildren;
          function dualTravel(newChildren2, oldChildren2) {
            if (newChildren2.length === 0 && oldChildren2.length === 0) {
              return;
            }
            new DataDiffer(oldChildren2, newChildren2, getKey2, getKey2).add(processNode).update(processNode).remove(curry$1(processNode, null)).execute();
            function getKey2(node) {
              return node.getId();
            }
            function processNode(newIdx, oldIdx) {
              var newNode = newIdx == null ? null : newChildren2[newIdx];
              var oldNode = oldIdx == null ? null : oldChildren2[oldIdx];
              doRenderNode(newNode, oldNode);
            }
          }
          function doRenderNode(newNode, oldNode) {
            if (!renderLabelForZeroData && newNode && !newNode.getValue()) {
              newNode = null;
            }
            if (newNode !== virtualRoot && oldNode !== virtualRoot) {
              if (oldNode && oldNode.piece) {
                if (newNode) {
                  oldNode.piece.updateData(false, newNode, seriesModel, ecModel, api2);
                  data.setItemGraphicEl(newNode.dataIndex, oldNode.piece);
                } else {
                  removeNode2(oldNode);
                }
              } else if (newNode) {
                var piece = new SunburstPiece(newNode, seriesModel, ecModel, api2);
                group.add(piece);
                data.setItemGraphicEl(newNode.dataIndex, piece);
              }
            }
          }
          function removeNode2(node) {
            if (!node) {
              return;
            }
            if (node.piece) {
              group.remove(node.piece);
              node.piece = null;
            }
          }
          function renderRollUp(virtualRoot2, viewRoot) {
            if (viewRoot.depth > 0) {
              if (self2.virtualPiece) {
                self2.virtualPiece.updateData(false, virtualRoot2, seriesModel, ecModel, api2);
              } else {
                self2.virtualPiece = new SunburstPiece(virtualRoot2, seriesModel, ecModel, api2);
                group.add(self2.virtualPiece);
              }
              viewRoot.piece.off("click");
              self2.virtualPiece.on("click", function(e2) {
                self2._rootToNode(viewRoot.parentNode);
              });
            } else if (self2.virtualPiece) {
              group.remove(self2.virtualPiece);
              self2.virtualPiece = null;
            }
          }
        };
        SunburstView2.prototype._initEvents = function() {
          var _this = this;
          this.group.off("click");
          this.group.on("click", function(e2) {
            var targetFound = false;
            var viewRoot = _this.seriesModel.getViewRoot();
            viewRoot.eachNode(function(node) {
              if (!targetFound && node.piece && node.piece === e2.target) {
                var nodeClick = node.getModel().get("nodeClick");
                if (nodeClick === "rootToNode") {
                  _this._rootToNode(node);
                } else if (nodeClick === "link") {
                  var itemModel = node.getModel();
                  var link = itemModel.get("link");
                  if (link) {
                    var linkTarget = itemModel.get("target", true) || "_blank";
                    windowOpen(link, linkTarget);
                  }
                }
                targetFound = true;
              }
            });
          });
        };
        SunburstView2.prototype._rootToNode = function(node) {
          if (node !== this.seriesModel.getViewRoot()) {
            this.api.dispatchAction({
              type: ROOT_TO_NODE_ACTION,
              from: this.uid,
              seriesId: this.seriesModel.id,
              targetNode: node
            });
          }
        };
        SunburstView2.prototype.containPoint = function(point, seriesModel) {
          var treeRoot = seriesModel.getData();
          var itemLayout = treeRoot.getItemLayout(0);
          if (itemLayout) {
            var dx = point[0] - itemLayout.cx;
            var dy = point[1] - itemLayout.cy;
            var radius = Math.sqrt(dx * dx + dy * dy);
            return radius <= itemLayout.r && radius >= itemLayout.r0;
          }
        };
        SunburstView2.type = "sunburst";
        return SunburstView2;
      }(ChartView)
    );
    var SunburstSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(SunburstSeriesModel2, _super);
        function SunburstSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SunburstSeriesModel2.type;
          _this.ignoreStyleOnData = true;
          return _this;
        }
        SunburstSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          var root2 = {
            name: option.name,
            children: option.data
          };
          completeTreeValue(root2);
          var levelModels = this._levelModels = map$1(option.levels || [], function(levelDefine) {
            return new Model(levelDefine, this, ecModel);
          }, this);
          var tree = Tree.createTree(root2, this, beforeLink);
          function beforeLink(nodeData) {
            nodeData.wrapMethod("getItemModel", function(model, idx) {
              var node = tree.getNodeByDataIndex(idx);
              var levelModel = levelModels[node.depth];
              levelModel && (model.parentModel = levelModel);
              return model;
            });
          }
          return tree.data;
        };
        SunburstSeriesModel2.prototype.optionUpdated = function() {
          this.resetViewRoot();
        };
        SunburstSeriesModel2.prototype.getDataParams = function(dataIndex) {
          var params = _super.prototype.getDataParams.apply(this, arguments);
          var node = this.getData().tree.getNodeByDataIndex(dataIndex);
          params.treePathInfo = wrapTreePathInfo(node, this);
          return params;
        };
        SunburstSeriesModel2.prototype.getLevelModel = function(node) {
          return this._levelModels && this._levelModels[node.depth];
        };
        SunburstSeriesModel2.prototype.getViewRoot = function() {
          return this._viewRoot;
        };
        SunburstSeriesModel2.prototype.resetViewRoot = function(viewRoot) {
          viewRoot ? this._viewRoot = viewRoot : viewRoot = this._viewRoot;
          var root2 = this.getRawData().tree.root;
          if (!viewRoot || viewRoot !== root2 && !root2.contains(viewRoot)) {
            this._viewRoot = root2;
          }
        };
        SunburstSeriesModel2.prototype.enableAriaDecal = function() {
          enableAriaDecalForTree(this);
        };
        SunburstSeriesModel2.type = "series.sunburst";
        SunburstSeriesModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          // 默认全局居中
          center: ["50%", "50%"],
          radius: [0, "75%"],
          // 默认顺时针
          clockwise: true,
          startAngle: 90,
          // 最小角度改为0
          minAngle: 0,
          // If still show when all data zero.
          stillShowZeroSum: true,
          // 'rootToNode', 'link', or false
          nodeClick: "rootToNode",
          renderLabelForZeroData: false,
          label: {
            // could be: 'radial', 'tangential', or 'none'
            rotate: "radial",
            show: true,
            opacity: 1,
            // 'left' is for inner side of inside, and 'right' is for outer
            // side for inside
            align: "center",
            position: "inside",
            distance: 5,
            silent: true
          },
          itemStyle: {
            borderWidth: 1,
            borderColor: "white",
            borderType: "solid",
            shadowBlur: 0,
            shadowColor: "rgba(0, 0, 0, 0.2)",
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            opacity: 1
          },
          emphasis: {
            focus: "descendant"
          },
          blur: {
            itemStyle: {
              opacity: 0.2
            },
            label: {
              opacity: 0.1
            }
          },
          // Animation type can be expansion, scale.
          animationType: "expansion",
          animationDuration: 1e3,
          animationDurationUpdate: 500,
          data: [],
          /**
           * Sort order.
           *
           * Valid values: 'desc', 'asc', null, or callback function.
           * 'desc' and 'asc' for descend and ascendant order;
           * null for not sorting;
           * example of callback function:
           * function(nodeA, nodeB) {
           *     return nodeA.getValue() - nodeB.getValue();
           * }
           */
          sort: "desc"
        };
        return SunburstSeriesModel2;
      }(SeriesModel)
    );
    function completeTreeValue(dataNode) {
      var sum2 = 0;
      each$f(dataNode.children, function(child) {
        completeTreeValue(child);
        var childValue = child.value;
        isArray$2(childValue) && (childValue = childValue[0]);
        sum2 += childValue;
      });
      var thisValue = dataNode.value;
      if (isArray$2(thisValue)) {
        thisValue = thisValue[0];
      }
      if (thisValue == null || isNaN(thisValue)) {
        thisValue = sum2;
      }
      if (thisValue < 0) {
        thisValue = 0;
      }
      isArray$2(dataNode.value) ? dataNode.value[0] = thisValue : dataNode.value = thisValue;
    }
    var RADIAN = Math.PI / 180;
    function sunburstLayout(seriesType2, ecModel, api2) {
      ecModel.eachSeriesByType(seriesType2, function(seriesModel) {
        var center2 = seriesModel.get("center");
        var radius = seriesModel.get("radius");
        if (!isArray$2(radius)) {
          radius = [0, radius];
        }
        if (!isArray$2(center2)) {
          center2 = [center2, center2];
        }
        var width = api2.getWidth();
        var height = api2.getHeight();
        var size = Math.min(width, height);
        var cx = parsePercent(center2[0], width);
        var cy = parsePercent(center2[1], height);
        var r0 = parsePercent(radius[0], size / 2);
        var r = parsePercent(radius[1], size / 2);
        var startAngle = -seriesModel.get("startAngle") * RADIAN;
        var minAngle = seriesModel.get("minAngle") * RADIAN;
        var virtualRoot = seriesModel.getData().tree.root;
        var treeRoot = seriesModel.getViewRoot();
        var rootDepth = treeRoot.depth;
        var sort2 = seriesModel.get("sort");
        if (sort2 != null) {
          initChildren(treeRoot, sort2);
        }
        var validDataCount = 0;
        each$f(treeRoot.children, function(child) {
          !isNaN(child.getValue()) && validDataCount++;
        });
        var sum2 = treeRoot.getValue();
        var unitRadian = Math.PI / (sum2 || validDataCount) * 2;
        var renderRollupNode = treeRoot.depth > 0;
        var levels = treeRoot.height - (renderRollupNode ? -1 : 1);
        var rPerLevel = (r - r0) / (levels || 1);
        var clockwise = seriesModel.get("clockwise");
        var stillShowZeroSum = seriesModel.get("stillShowZeroSum");
        var dir3 = clockwise ? 1 : -1;
        var renderNode2 = function(node, startAngle2) {
          if (!node) {
            return;
          }
          var endAngle = startAngle2;
          if (node !== virtualRoot) {
            var value = node.getValue();
            var angle3 = sum2 === 0 && stillShowZeroSum ? unitRadian : value * unitRadian;
            if (angle3 < minAngle) {
              angle3 = minAngle;
            }
            endAngle = startAngle2 + dir3 * angle3;
            var depth = node.depth - rootDepth - (renderRollupNode ? -1 : 1);
            var rStart2 = r0 + rPerLevel * depth;
            var rEnd2 = r0 + rPerLevel * (depth + 1);
            var levelModel = seriesModel.getLevelModel(node);
            if (levelModel) {
              var r0_1 = levelModel.get("r0", true);
              var r_1 = levelModel.get("r", true);
              var radius_1 = levelModel.get("radius", true);
              if (radius_1 != null) {
                r0_1 = radius_1[0];
                r_1 = radius_1[1];
              }
              r0_1 != null && (rStart2 = parsePercent(r0_1, size / 2));
              r_1 != null && (rEnd2 = parsePercent(r_1, size / 2));
            }
            node.setLayout({
              angle: angle3,
              startAngle: startAngle2,
              endAngle,
              clockwise,
              cx,
              cy,
              r0: rStart2,
              r: rEnd2
            });
          }
          if (node.children && node.children.length) {
            var siblingAngle_1 = 0;
            each$f(node.children, function(node2) {
              siblingAngle_1 += renderNode2(node2, startAngle2 + siblingAngle_1);
            });
          }
          return endAngle - startAngle2;
        };
        if (renderRollupNode) {
          var rStart = r0;
          var rEnd = r0 + rPerLevel;
          var angle2 = Math.PI * 2;
          virtualRoot.setLayout({
            angle: angle2,
            startAngle,
            endAngle: startAngle + angle2,
            clockwise,
            cx,
            cy,
            r0: rStart,
            r: rEnd
          });
        }
        renderNode2(treeRoot, startAngle);
      });
    }
    function initChildren(node, sortOrder) {
      var children = node.children || [];
      node.children = sort(children, sortOrder);
      if (children.length) {
        each$f(node.children, function(child) {
          initChildren(child, sortOrder);
        });
      }
    }
    function sort(children, sortOrder) {
      if (isFunction$1(sortOrder)) {
        var sortTargets = map$1(children, function(child, idx) {
          var value = child.getValue();
          return {
            params: {
              depth: child.depth,
              height: child.height,
              dataIndex: child.dataIndex,
              getValue: function() {
                return value;
              }
            },
            index: idx
          };
        });
        sortTargets.sort(function(a2, b2) {
          return sortOrder(a2.params, b2.params);
        });
        return map$1(sortTargets, function(target) {
          return children[target.index];
        });
      } else {
        var isAsc_1 = sortOrder === "asc";
        return children.sort(function(a2, b2) {
          var diff = (a2.getValue() - b2.getValue()) * (isAsc_1 ? 1 : -1);
          return diff === 0 ? (a2.dataIndex - b2.dataIndex) * (isAsc_1 ? -1 : 1) : diff;
        });
      }
    }
    function sunburstVisual(ecModel) {
      var paletteScope = {};
      function pickColor(node, seriesModel, treeHeight) {
        var current = node;
        while (current && current.depth > 1) {
          current = current.parentNode;
        }
        var color2 = seriesModel.getColorFromPalette(current.name || current.dataIndex + "", paletteScope);
        if (node.depth > 1 && isString$1(color2)) {
          color2 = lift(color2, (node.depth - 1) / (treeHeight - 1) * 0.5);
        }
        return color2;
      }
      ecModel.eachSeriesByType("sunburst", function(seriesModel) {
        var data = seriesModel.getData();
        var tree = data.tree;
        tree.eachNode(function(node) {
          var model = node.getModel();
          var style = model.getModel("itemStyle").getItemStyle();
          if (!style.fill) {
            style.fill = pickColor(node, seriesModel, tree.root.height);
          }
          var existsStyle = data.ensureUniqueItemVisual(node.dataIndex, "style");
          extend$1(existsStyle, style);
        });
      });
    }
    function install$s(registers) {
      registers.registerChartView(SunburstView);
      registers.registerSeriesModel(SunburstSeriesModel);
      registers.registerLayout(curry$1(sunburstLayout, "sunburst"));
      registers.registerProcessor(curry$1(dataFilter$1, "sunburst"));
      registers.registerVisual(sunburstVisual);
      installSunburstAction(registers);
    }
    var STYLE_VISUAL_TYPE = {
      color: "fill",
      borderColor: "stroke"
    };
    var NON_STYLE_VISUAL_PROPS = {
      symbol: 1,
      symbolSize: 1,
      symbolKeepAspect: 1,
      legendIcon: 1,
      visualMeta: 1,
      liftZ: 1,
      decal: 1
    };
    var customInnerStore = makeInner();
    var CustomSeriesModel = (
      /** @class */
      function(_super) {
        __extends$1(CustomSeriesModel2, _super);
        function CustomSeriesModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CustomSeriesModel2.type;
          return _this;
        }
        CustomSeriesModel2.prototype.optionUpdated = function() {
          this.currentZLevel = this.get("zlevel", true);
          this.currentZ = this.get("z", true);
        };
        CustomSeriesModel2.prototype.getInitialData = function(option, ecModel) {
          return createSeriesData(null, this);
        };
        CustomSeriesModel2.prototype.getDataParams = function(dataIndex, dataType2, el) {
          var params = _super.prototype.getDataParams.call(this, dataIndex, dataType2);
          el && (params.info = customInnerStore(el).info);
          return params;
        };
        CustomSeriesModel2.type = "series.custom";
        CustomSeriesModel2.dependencies = ["grid", "polar", "geo", "singleAxis", "calendar"];
        CustomSeriesModel2.defaultOption = {
          coordinateSystem: "cartesian2d",
          // zlevel: 0,
          z: 2,
          legendHoverLink: true,
          // Custom series will not clip by default.
          // Some case will use custom series to draw label
          // For example https://echarts.apache.org/examples/en/editor.html?c=custom-gantt-flight
          clip: false
          // Cartesian coordinate system
          // xAxisIndex: 0,
          // yAxisIndex: 0,
          // Polar coordinate system
          // polarIndex: 0,
          // Geo coordinate system
          // geoIndex: 0,
        };
        return CustomSeriesModel2;
      }(SeriesModel)
    );
    function dataToCoordSize$3(dataSize, dataItem) {
      dataItem = dataItem || [0, 0];
      return map$1(["x", "y"], function(dim, dimIdx) {
        var axis = this.getAxis(dim);
        var val = dataItem[dimIdx];
        var halfSize = dataSize[dimIdx] / 2;
        return axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));
      }, this);
    }
    function cartesianPrepareCustom(coordSys) {
      var rect = coordSys.master.getRect();
      return {
        coordSys: {
          // The name exposed to user is always 'cartesian2d' but not 'grid'.
          type: "cartesian2d",
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height
        },
        api: {
          coord: function(data) {
            return coordSys.dataToPoint(data);
          },
          size: bind$2(dataToCoordSize$3, coordSys)
        }
      };
    }
    function dataToCoordSize$2(dataSize, dataItem) {
      dataItem = dataItem || [0, 0];
      return map$1([0, 1], function(dimIdx) {
        var val = dataItem[dimIdx];
        var halfSize = dataSize[dimIdx] / 2;
        var p1 = [];
        var p2 = [];
        p1[dimIdx] = val - halfSize;
        p2[dimIdx] = val + halfSize;
        p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
        return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
      }, this);
    }
    function geoPrepareCustom(coordSys) {
      var rect = coordSys.getBoundingRect();
      return {
        coordSys: {
          type: "geo",
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height,
          zoom: coordSys.getZoom()
        },
        api: {
          coord: function(data) {
            return coordSys.dataToPoint(data);
          },
          size: bind$2(dataToCoordSize$2, coordSys)
        }
      };
    }
    function dataToCoordSize$1(dataSize, dataItem) {
      var axis = this.getAxis();
      var val = dataItem instanceof Array ? dataItem[0] : dataItem;
      var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2;
      return axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));
    }
    function singlePrepareCustom(coordSys) {
      var rect = coordSys.getRect();
      return {
        coordSys: {
          type: "singleAxis",
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height
        },
        api: {
          coord: function(val) {
            return coordSys.dataToPoint(val);
          },
          size: bind$2(dataToCoordSize$1, coordSys)
        }
      };
    }
    function dataToCoordSize(dataSize, dataItem) {
      dataItem = dataItem || [0, 0];
      return map$1(["Radius", "Angle"], function(dim, dimIdx) {
        var getterName = "get" + dim + "Axis";
        var axis = this[getterName]();
        var val = dataItem[dimIdx];
        var halfSize = dataSize[dimIdx] / 2;
        var result = axis.type === "category" ? axis.getBandWidth() : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize));
        if (dim === "Angle") {
          result = result * Math.PI / 180;
        }
        return result;
      }, this);
    }
    function polarPrepareCustom(coordSys) {
      var radiusAxis = coordSys.getRadiusAxis();
      var angleAxis = coordSys.getAngleAxis();
      var radius = radiusAxis.getExtent();
      radius[0] > radius[1] && radius.reverse();
      return {
        coordSys: {
          type: "polar",
          cx: coordSys.cx,
          cy: coordSys.cy,
          r: radius[1],
          r0: radius[0]
        },
        api: {
          coord: function(data) {
            var radius2 = radiusAxis.dataToRadius(data[0]);
            var angle2 = angleAxis.dataToAngle(data[1]);
            var coord = coordSys.coordToPoint([radius2, angle2]);
            coord.push(radius2, angle2 * Math.PI / 180);
            return coord;
          },
          size: bind$2(dataToCoordSize, coordSys)
        }
      };
    }
    function calendarPrepareCustom(coordSys) {
      var rect = coordSys.getRect();
      var rangeInfo = coordSys.getRangeInfo();
      return {
        coordSys: {
          type: "calendar",
          x: rect.x,
          y: rect.y,
          width: rect.width,
          height: rect.height,
          cellWidth: coordSys.getCellWidth(),
          cellHeight: coordSys.getCellHeight(),
          rangeInfo: {
            start: rangeInfo.start,
            end: rangeInfo.end,
            weeks: rangeInfo.weeks,
            dayCount: rangeInfo.allDay
          }
        },
        api: {
          coord: function(data, clamp2) {
            return coordSys.dataToPoint(data, clamp2);
          }
        }
      };
    }
    function isEC4CompatibleStyle(style, elType, hasOwnTextContentOption, hasOwnTextConfig) {
      return style && (style.legacy || style.legacy !== false && !hasOwnTextContentOption && !hasOwnTextConfig && elType !== "tspan" && (elType === "text" || hasOwn(style, "text")));
    }
    function convertFromEC4CompatibleStyle(hostStyle, elType, isNormal) {
      var srcStyle = hostStyle;
      var textConfig;
      var textContent;
      var textContentStyle;
      if (elType === "text") {
        textContentStyle = srcStyle;
      } else {
        textContentStyle = {};
        hasOwn(srcStyle, "text") && (textContentStyle.text = srcStyle.text);
        hasOwn(srcStyle, "rich") && (textContentStyle.rich = srcStyle.rich);
        hasOwn(srcStyle, "textFill") && (textContentStyle.fill = srcStyle.textFill);
        hasOwn(srcStyle, "textStroke") && (textContentStyle.stroke = srcStyle.textStroke);
        hasOwn(srcStyle, "fontFamily") && (textContentStyle.fontFamily = srcStyle.fontFamily);
        hasOwn(srcStyle, "fontSize") && (textContentStyle.fontSize = srcStyle.fontSize);
        hasOwn(srcStyle, "fontStyle") && (textContentStyle.fontStyle = srcStyle.fontStyle);
        hasOwn(srcStyle, "fontWeight") && (textContentStyle.fontWeight = srcStyle.fontWeight);
        textContent = {
          type: "text",
          style: textContentStyle,
          // ec4 does not support rectText trigger.
          // And when text position is different in normal and emphasis
          // => hover text trigger emphasis;
          // => text position changed, leave mouse pointer immediately;
          // That might cause incorrect state.
          silent: true
        };
        textConfig = {};
        var hasOwnPos = hasOwn(srcStyle, "textPosition");
        if (isNormal) {
          textConfig.position = hasOwnPos ? srcStyle.textPosition : "inside";
        } else {
          hasOwnPos && (textConfig.position = srcStyle.textPosition);
        }
        hasOwn(srcStyle, "textPosition") && (textConfig.position = srcStyle.textPosition);
        hasOwn(srcStyle, "textOffset") && (textConfig.offset = srcStyle.textOffset);
        hasOwn(srcStyle, "textRotation") && (textConfig.rotation = srcStyle.textRotation);
        hasOwn(srcStyle, "textDistance") && (textConfig.distance = srcStyle.textDistance);
      }
      convertEC4CompatibleRichItem(textContentStyle, hostStyle);
      each$f(textContentStyle.rich, function(richItem) {
        convertEC4CompatibleRichItem(richItem, richItem);
      });
      return {
        textConfig,
        textContent
      };
    }
    function convertEC4CompatibleRichItem(out2, richItem) {
      if (!richItem) {
        return;
      }
      richItem.font = richItem.textFont || richItem.font;
      hasOwn(richItem, "textStrokeWidth") && (out2.lineWidth = richItem.textStrokeWidth);
      hasOwn(richItem, "textAlign") && (out2.align = richItem.textAlign);
      hasOwn(richItem, "textVerticalAlign") && (out2.verticalAlign = richItem.textVerticalAlign);
      hasOwn(richItem, "textLineHeight") && (out2.lineHeight = richItem.textLineHeight);
      hasOwn(richItem, "textWidth") && (out2.width = richItem.textWidth);
      hasOwn(richItem, "textHeight") && (out2.height = richItem.textHeight);
      hasOwn(richItem, "textBackgroundColor") && (out2.backgroundColor = richItem.textBackgroundColor);
      hasOwn(richItem, "textPadding") && (out2.padding = richItem.textPadding);
      hasOwn(richItem, "textBorderColor") && (out2.borderColor = richItem.textBorderColor);
      hasOwn(richItem, "textBorderWidth") && (out2.borderWidth = richItem.textBorderWidth);
      hasOwn(richItem, "textBorderRadius") && (out2.borderRadius = richItem.textBorderRadius);
      hasOwn(richItem, "textBoxShadowColor") && (out2.shadowColor = richItem.textBoxShadowColor);
      hasOwn(richItem, "textBoxShadowBlur") && (out2.shadowBlur = richItem.textBoxShadowBlur);
      hasOwn(richItem, "textBoxShadowOffsetX") && (out2.shadowOffsetX = richItem.textBoxShadowOffsetX);
      hasOwn(richItem, "textBoxShadowOffsetY") && (out2.shadowOffsetY = richItem.textBoxShadowOffsetY);
    }
    function convertToEC4StyleForCustomSerise(itemStl, txStl, txCfg) {
      var out2 = itemStl;
      out2.textPosition = out2.textPosition || txCfg.position || "inside";
      txCfg.offset != null && (out2.textOffset = txCfg.offset);
      txCfg.rotation != null && (out2.textRotation = txCfg.rotation);
      txCfg.distance != null && (out2.textDistance = txCfg.distance);
      var isInside = out2.textPosition.indexOf("inside") >= 0;
      var hostFill = itemStl.fill || "#000";
      convertToEC4RichItem(out2, txStl);
      var textFillNotSet = out2.textFill == null;
      if (isInside) {
        if (textFillNotSet) {
          out2.textFill = txCfg.insideFill || "#fff";
          !out2.textStroke && txCfg.insideStroke && (out2.textStroke = txCfg.insideStroke);
          !out2.textStroke && (out2.textStroke = hostFill);
          out2.textStrokeWidth == null && (out2.textStrokeWidth = 2);
        }
      } else {
        if (textFillNotSet) {
          out2.textFill = itemStl.fill || txCfg.outsideFill || "#000";
        }
        !out2.textStroke && txCfg.outsideStroke && (out2.textStroke = txCfg.outsideStroke);
      }
      out2.text = txStl.text;
      out2.rich = txStl.rich;
      each$f(txStl.rich, function(richItem) {
        convertToEC4RichItem(richItem, richItem);
      });
      return out2;
    }
    function convertToEC4RichItem(out2, richItem) {
      if (!richItem) {
        return;
      }
      hasOwn(richItem, "fill") && (out2.textFill = richItem.fill);
      hasOwn(richItem, "stroke") && (out2.textStroke = richItem.fill);
      hasOwn(richItem, "lineWidth") && (out2.textStrokeWidth = richItem.lineWidth);
      hasOwn(richItem, "font") && (out2.font = richItem.font);
      hasOwn(richItem, "fontStyle") && (out2.fontStyle = richItem.fontStyle);
      hasOwn(richItem, "fontWeight") && (out2.fontWeight = richItem.fontWeight);
      hasOwn(richItem, "fontSize") && (out2.fontSize = richItem.fontSize);
      hasOwn(richItem, "fontFamily") && (out2.fontFamily = richItem.fontFamily);
      hasOwn(richItem, "align") && (out2.textAlign = richItem.align);
      hasOwn(richItem, "verticalAlign") && (out2.textVerticalAlign = richItem.verticalAlign);
      hasOwn(richItem, "lineHeight") && (out2.textLineHeight = richItem.lineHeight);
      hasOwn(richItem, "width") && (out2.textWidth = richItem.width);
      hasOwn(richItem, "height") && (out2.textHeight = richItem.height);
      hasOwn(richItem, "backgroundColor") && (out2.textBackgroundColor = richItem.backgroundColor);
      hasOwn(richItem, "padding") && (out2.textPadding = richItem.padding);
      hasOwn(richItem, "borderColor") && (out2.textBorderColor = richItem.borderColor);
      hasOwn(richItem, "borderWidth") && (out2.textBorderWidth = richItem.borderWidth);
      hasOwn(richItem, "borderRadius") && (out2.textBorderRadius = richItem.borderRadius);
      hasOwn(richItem, "shadowColor") && (out2.textBoxShadowColor = richItem.shadowColor);
      hasOwn(richItem, "shadowBlur") && (out2.textBoxShadowBlur = richItem.shadowBlur);
      hasOwn(richItem, "shadowOffsetX") && (out2.textBoxShadowOffsetX = richItem.shadowOffsetX);
      hasOwn(richItem, "shadowOffsetY") && (out2.textBoxShadowOffsetY = richItem.shadowOffsetY);
      hasOwn(richItem, "textShadowColor") && (out2.textShadowColor = richItem.textShadowColor);
      hasOwn(richItem, "textShadowBlur") && (out2.textShadowBlur = richItem.textShadowBlur);
      hasOwn(richItem, "textShadowOffsetX") && (out2.textShadowOffsetX = richItem.textShadowOffsetX);
      hasOwn(richItem, "textShadowOffsetY") && (out2.textShadowOffsetY = richItem.textShadowOffsetY);
    }
    var LEGACY_TRANSFORM_PROPS_MAP = {
      position: ["x", "y"],
      scale: ["scaleX", "scaleY"],
      origin: ["originX", "originY"]
    };
    var LEGACY_TRANSFORM_PROPS = keys$1(LEGACY_TRANSFORM_PROPS_MAP);
    reduce(TRANSFORMABLE_PROPS, function(obj, key) {
      obj[key] = 1;
      return obj;
    }, {});
    TRANSFORMABLE_PROPS.join(", ");
    var ELEMENT_ANIMATABLE_PROPS = ["", "style", "shape", "extra"];
    var transitionInnerStore = makeInner();
    function getElementAnimationConfig(animationType, el, elOption, parentModel, dataIndex) {
      var animationProp = animationType + "Animation";
      var config = getAnimationConfig(animationType, parentModel, dataIndex) || {};
      var userDuring = transitionInnerStore(el).userDuring;
      if (config.duration > 0) {
        config.during = userDuring ? bind$2(duringCall, {
          el,
          userDuring
        }) : null;
        config.setToFinal = true;
        config.scope = animationType;
      }
      extend$1(config, elOption[animationProp]);
      return config;
    }
    function applyUpdateTransition(el, elOption, animatableModel, opts) {
      opts = opts || {};
      var dataIndex = opts.dataIndex, isInit = opts.isInit, clearStyle = opts.clearStyle;
      var hasAnimation = animatableModel.isAnimationEnabled();
      var store2 = transitionInnerStore(el);
      var styleOpt = elOption.style;
      store2.userDuring = elOption.during;
      var transFromProps = {};
      var propsToSet = {};
      prepareTransformAllPropsFinal(el, elOption, propsToSet);
      prepareShapeOrExtraAllPropsFinal("shape", elOption, propsToSet);
      prepareShapeOrExtraAllPropsFinal("extra", elOption, propsToSet);
      if (!isInit && hasAnimation) {
        prepareTransformTransitionFrom(el, elOption, transFromProps);
        prepareShapeOrExtraTransitionFrom("shape", el, elOption, transFromProps);
        prepareShapeOrExtraTransitionFrom("extra", el, elOption, transFromProps);
        prepareStyleTransitionFrom(el, elOption, styleOpt, transFromProps);
      }
      propsToSet.style = styleOpt;
      applyPropsDirectly(el, propsToSet, clearStyle);
      applyMiscProps(el, elOption);
      if (hasAnimation) {
        if (isInit) {
          var enterFromProps_1 = {};
          each$f(ELEMENT_ANIMATABLE_PROPS, function(propName) {
            var prop = propName ? elOption[propName] : elOption;
            if (prop && prop.enterFrom) {
              if (propName) {
                enterFromProps_1[propName] = enterFromProps_1[propName] || {};
              }
              extend$1(propName ? enterFromProps_1[propName] : enterFromProps_1, prop.enterFrom);
            }
          });
          var config = getElementAnimationConfig("enter", el, elOption, animatableModel, dataIndex);
          if (config.duration > 0) {
            el.animateFrom(enterFromProps_1, config);
          }
        } else {
          applyPropsTransition(el, elOption, dataIndex || 0, animatableModel, transFromProps);
        }
      }
      updateLeaveTo(el, elOption);
      styleOpt ? el.dirty() : el.markRedraw();
    }
    function updateLeaveTo(el, elOption) {
      var leaveToProps = transitionInnerStore(el).leaveToProps;
      for (var i2 = 0; i2 < ELEMENT_ANIMATABLE_PROPS.length; i2++) {
        var propName = ELEMENT_ANIMATABLE_PROPS[i2];
        var prop = propName ? elOption[propName] : elOption;
        if (prop && prop.leaveTo) {
          if (!leaveToProps) {
            leaveToProps = transitionInnerStore(el).leaveToProps = {};
          }
          if (propName) {
            leaveToProps[propName] = leaveToProps[propName] || {};
          }
          extend$1(propName ? leaveToProps[propName] : leaveToProps, prop.leaveTo);
        }
      }
    }
    function applyLeaveTransition(el, elOption, animatableModel, onRemove) {
      if (el) {
        var parent_1 = el.parent;
        var leaveToProps = transitionInnerStore(el).leaveToProps;
        if (leaveToProps) {
          var config = getElementAnimationConfig("update", el, elOption, animatableModel, 0);
          config.done = function() {
            parent_1.remove(el);
          };
          el.animateTo(leaveToProps, config);
        } else {
          parent_1.remove(el);
        }
      }
    }
    function isTransitionAll(transition) {
      return transition === "all";
    }
    function applyPropsDirectly(el, allPropsFinal, clearStyle) {
      var styleOpt = allPropsFinal.style;
      if (!el.isGroup && styleOpt) {
        if (clearStyle) {
          el.useStyle({});
          var animators = el.animators;
          for (var i2 = 0; i2 < animators.length; i2++) {
            var animator = animators[i2];
            if (animator.targetName === "style") {
              animator.changeTarget(el.style);
            }
          }
        }
        el.setStyle(styleOpt);
      }
      if (allPropsFinal) {
        allPropsFinal.style = null;
        allPropsFinal && el.attr(allPropsFinal);
        allPropsFinal.style = styleOpt;
      }
    }
    function applyPropsTransition(el, elOption, dataIndex, model, transFromProps) {
      if (transFromProps) {
        var config = getElementAnimationConfig("update", el, elOption, model, dataIndex);
        if (config.duration > 0) {
          el.animateFrom(transFromProps, config);
        }
      }
    }
    function applyMiscProps(el, elOption) {
      hasOwn(elOption, "silent") && (el.silent = elOption.silent);
      hasOwn(elOption, "ignore") && (el.ignore = elOption.ignore);
      if (el instanceof Displayable) {
        hasOwn(elOption, "invisible") && (el.invisible = elOption.invisible);
      }
      if (el instanceof Path) {
        hasOwn(elOption, "autoBatch") && (el.autoBatch = elOption.autoBatch);
      }
    }
    var tmpDuringScope = {};
    var transitionDuringAPI = {
      // Usually other props do not need to be changed in animation during.
      setTransform: function(key, val) {
        tmpDuringScope.el[key] = val;
        return this;
      },
      getTransform: function(key) {
        return tmpDuringScope.el[key];
      },
      setShape: function(key, val) {
        var el = tmpDuringScope.el;
        var shape = el.shape || (el.shape = {});
        shape[key] = val;
        el.dirtyShape && el.dirtyShape();
        return this;
      },
      getShape: function(key) {
        var shape = tmpDuringScope.el.shape;
        if (shape) {
          return shape[key];
        }
      },
      setStyle: function(key, val) {
        var el = tmpDuringScope.el;
        var style = el.style;
        if (style) {
          style[key] = val;
          el.dirtyStyle && el.dirtyStyle();
        }
        return this;
      },
      getStyle: function(key) {
        var style = tmpDuringScope.el.style;
        if (style) {
          return style[key];
        }
      },
      setExtra: function(key, val) {
        var extra = tmpDuringScope.el.extra || (tmpDuringScope.el.extra = {});
        extra[key] = val;
        return this;
      },
      getExtra: function(key) {
        var extra = tmpDuringScope.el.extra;
        if (extra) {
          return extra[key];
        }
      }
    };
    function duringCall() {
      var scope = this;
      var el = scope.el;
      if (!el) {
        return;
      }
      var latestUserDuring = transitionInnerStore(el).userDuring;
      var scopeUserDuring = scope.userDuring;
      if (latestUserDuring !== scopeUserDuring) {
        scope.el = scope.userDuring = null;
        return;
      }
      tmpDuringScope.el = el;
      scopeUserDuring(transitionDuringAPI);
    }
    function prepareShapeOrExtraTransitionFrom(mainAttr, fromEl, elOption, transFromProps) {
      var attrOpt = elOption[mainAttr];
      if (!attrOpt) {
        return;
      }
      var elPropsInAttr = fromEl[mainAttr];
      var transFromPropsInAttr;
      if (elPropsInAttr) {
        var transition = elOption.transition;
        var attrTransition = attrOpt.transition;
        if (attrTransition) {
          !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
          if (isTransitionAll(attrTransition)) {
            extend$1(transFromPropsInAttr, elPropsInAttr);
          } else {
            var transitionKeys = normalizeToArray(attrTransition);
            for (var i2 = 0; i2 < transitionKeys.length; i2++) {
              var key = transitionKeys[i2];
              var elVal = elPropsInAttr[key];
              transFromPropsInAttr[key] = elVal;
            }
          }
        } else if (isTransitionAll(transition) || indexOf(transition, mainAttr) >= 0) {
          !transFromPropsInAttr && (transFromPropsInAttr = transFromProps[mainAttr] = {});
          var elPropsInAttrKeys = keys$1(elPropsInAttr);
          for (var i2 = 0; i2 < elPropsInAttrKeys.length; i2++) {
            var key = elPropsInAttrKeys[i2];
            var elVal = elPropsInAttr[key];
            if (isNonStyleTransitionEnabled(attrOpt[key], elVal)) {
              transFromPropsInAttr[key] = elVal;
            }
          }
        }
      }
    }
    function prepareShapeOrExtraAllPropsFinal(mainAttr, elOption, allProps) {
      var attrOpt = elOption[mainAttr];
      if (!attrOpt) {
        return;
      }
      var allPropsInAttr = allProps[mainAttr] = {};
      var keysInAttr = keys$1(attrOpt);
      for (var i2 = 0; i2 < keysInAttr.length; i2++) {
        var key = keysInAttr[i2];
        allPropsInAttr[key] = cloneValue(attrOpt[key]);
      }
    }
    function prepareTransformTransitionFrom(el, elOption, transFromProps) {
      var transition = elOption.transition;
      var transitionKeys = isTransitionAll(transition) ? TRANSFORMABLE_PROPS : normalizeToArray(transition || []);
      for (var i2 = 0; i2 < transitionKeys.length; i2++) {
        var key = transitionKeys[i2];
        if (key === "style" || key === "shape" || key === "extra") {
          continue;
        }
        var elVal = el[key];
        transFromProps[key] = elVal;
      }
    }
    function prepareTransformAllPropsFinal(el, elOption, allProps) {
      for (var i2 = 0; i2 < LEGACY_TRANSFORM_PROPS.length; i2++) {
        var legacyName = LEGACY_TRANSFORM_PROPS[i2];
        var xyName = LEGACY_TRANSFORM_PROPS_MAP[legacyName];
        var legacyArr = elOption[legacyName];
        if (legacyArr) {
          allProps[xyName[0]] = legacyArr[0];
          allProps[xyName[1]] = legacyArr[1];
        }
      }
      for (var i2 = 0; i2 < TRANSFORMABLE_PROPS.length; i2++) {
        var key = TRANSFORMABLE_PROPS[i2];
        if (elOption[key] != null) {
          allProps[key] = elOption[key];
        }
      }
    }
    function prepareStyleTransitionFrom(fromEl, elOption, styleOpt, transFromProps) {
      if (!styleOpt) {
        return;
      }
      var fromElStyle = fromEl.style;
      var transFromStyleProps;
      if (fromElStyle) {
        var styleTransition = styleOpt.transition;
        var elTransition = elOption.transition;
        if (styleTransition && !isTransitionAll(styleTransition)) {
          var transitionKeys = normalizeToArray(styleTransition);
          !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
          for (var i2 = 0; i2 < transitionKeys.length; i2++) {
            var key = transitionKeys[i2];
            var elVal = fromElStyle[key];
            transFromStyleProps[key] = elVal;
          }
        } else if (fromEl.getAnimationStyleProps && (isTransitionAll(elTransition) || isTransitionAll(styleTransition) || indexOf(elTransition, "style") >= 0)) {
          var animationProps = fromEl.getAnimationStyleProps();
          var animationStyleProps = animationProps ? animationProps.style : null;
          if (animationStyleProps) {
            !transFromStyleProps && (transFromStyleProps = transFromProps.style = {});
            var styleKeys = keys$1(styleOpt);
            for (var i2 = 0; i2 < styleKeys.length; i2++) {
              var key = styleKeys[i2];
              if (animationStyleProps[key]) {
                var elVal = fromElStyle[key];
                transFromStyleProps[key] = elVal;
              }
            }
          }
        }
      }
    }
    function isNonStyleTransitionEnabled(optVal, elVal) {
      return !isArrayLike(optVal) ? optVal != null && isFinite(optVal) : optVal !== elVal;
    }
    var getStateToRestore = makeInner();
    var KEYFRAME_EXCLUDE_KEYS = ["percent", "easing", "shape", "style", "extra"];
    function stopPreviousKeyframeAnimationAndRestore(el) {
      el.stopAnimation("keyframe");
      el.attr(getStateToRestore(el));
    }
    function applyKeyframeAnimation(el, animationOpts, animatableModel) {
      if (!animatableModel.isAnimationEnabled() || !animationOpts) {
        return;
      }
      if (isArray$2(animationOpts)) {
        each$f(animationOpts, function(singleAnimationOpts) {
          applyKeyframeAnimation(el, singleAnimationOpts, animatableModel);
        });
        return;
      }
      var keyframes = animationOpts.keyframes;
      var duration2 = animationOpts.duration;
      if (animatableModel && duration2 == null) {
        var config = getAnimationConfig("enter", animatableModel, 0);
        duration2 = config && config.duration;
      }
      if (!keyframes || !duration2) {
        return;
      }
      var stateToRestore = getStateToRestore(el);
      each$f(ELEMENT_ANIMATABLE_PROPS, function(targetPropName) {
        if (targetPropName && !el[targetPropName]) {
          return;
        }
        var animator;
        keyframes.sort(function(a2, b2) {
          return a2.percent - b2.percent;
        });
        each$f(keyframes, function(kf) {
          var animators = el.animators;
          var kfValues = targetPropName ? kf[targetPropName] : kf;
          if (!kfValues) {
            return;
          }
          var propKeys = keys$1(kfValues);
          if (!targetPropName) {
            propKeys = filter(propKeys, function(key) {
              return indexOf(KEYFRAME_EXCLUDE_KEYS, key) < 0;
            });
          }
          if (!propKeys.length) {
            return;
          }
          if (!animator) {
            animator = el.animate(targetPropName, animationOpts.loop, true);
            animator.scope = "keyframe";
          }
          for (var i2 = 0; i2 < animators.length; i2++) {
            if (animators[i2] !== animator && animators[i2].targetName === animator.targetName) {
              animators[i2].stopTracks(propKeys);
            }
          }
          targetPropName && (stateToRestore[targetPropName] = stateToRestore[targetPropName] || {});
          var savedTarget = targetPropName ? stateToRestore[targetPropName] : stateToRestore;
          each$f(propKeys, function(key) {
            savedTarget[key] = ((targetPropName ? el[targetPropName] : el) || {})[key];
          });
          animator.whenWithKeys(duration2 * kf.percent, kfValues, propKeys, kf.easing);
        });
        if (!animator) {
          return;
        }
        animator.delay(animationOpts.delay || 0).duration(duration2).start(animationOpts.easing);
      });
    }
    var EMPHASIS = "emphasis";
    var NORMAL = "normal";
    var BLUR = "blur";
    var SELECT = "select";
    var STATES = [NORMAL, EMPHASIS, BLUR, SELECT];
    var PATH_ITEM_STYLE = {
      normal: ["itemStyle"],
      emphasis: [EMPHASIS, "itemStyle"],
      blur: [BLUR, "itemStyle"],
      select: [SELECT, "itemStyle"]
    };
    var PATH_LABEL = {
      normal: ["label"],
      emphasis: [EMPHASIS, "label"],
      blur: [BLUR, "label"],
      select: [SELECT, "label"]
    };
    var DEFAULT_TRANSITION = ["x", "y"];
    var GROUP_DIFF_PREFIX = "e\0\0";
    var attachedTxInfoTmp = {
      normal: {},
      emphasis: {},
      blur: {},
      select: {}
    };
    var prepareCustoms = {
      cartesian2d: cartesianPrepareCustom,
      geo: geoPrepareCustom,
      single: singlePrepareCustom,
      polar: polarPrepareCustom,
      calendar: calendarPrepareCustom
    };
    function isPath(el) {
      return el instanceof Path;
    }
    function isDisplayable(el) {
      return el instanceof Displayable;
    }
    function copyElement(sourceEl, targetEl) {
      targetEl.copyTransform(sourceEl);
      if (isDisplayable(targetEl) && isDisplayable(sourceEl)) {
        targetEl.setStyle(sourceEl.style);
        targetEl.z = sourceEl.z;
        targetEl.z2 = sourceEl.z2;
        targetEl.zlevel = sourceEl.zlevel;
        targetEl.invisible = sourceEl.invisible;
        targetEl.ignore = sourceEl.ignore;
        if (isPath(targetEl) && isPath(sourceEl)) {
          targetEl.setShape(sourceEl.shape);
        }
      }
    }
    var CustomChartView = (
      /** @class */
      function(_super) {
        __extends$1(CustomChartView2, _super);
        function CustomChartView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CustomChartView2.type;
          return _this;
        }
        CustomChartView2.prototype.render = function(customSeries, ecModel, api2, payload) {
          this._progressiveEls = null;
          var oldData = this._data;
          var data = customSeries.getData();
          var group = this.group;
          var renderItem = makeRenderItem(customSeries, data, ecModel, api2);
          if (!oldData) {
            group.removeAll();
          }
          data.diff(oldData).add(function(newIdx) {
            createOrUpdateItem(api2, null, newIdx, renderItem(newIdx, payload), customSeries, group, data);
          }).remove(function(oldIdx) {
            var el = oldData.getItemGraphicEl(oldIdx);
            el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);
          }).update(function(newIdx, oldIdx) {
            var oldEl = oldData.getItemGraphicEl(oldIdx);
            createOrUpdateItem(api2, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group, data);
          }).execute();
          var clipPath = customSeries.get("clip", true) ? createClipPath(customSeries.coordinateSystem, false, customSeries) : null;
          if (clipPath) {
            group.setClipPath(clipPath);
          } else {
            group.removeClipPath();
          }
          this._data = data;
        };
        CustomChartView2.prototype.incrementalPrepareRender = function(customSeries, ecModel, api2) {
          this.group.removeAll();
          this._data = null;
        };
        CustomChartView2.prototype.incrementalRender = function(params, customSeries, ecModel, api2, payload) {
          var data = customSeries.getData();
          var renderItem = makeRenderItem(customSeries, data, ecModel, api2);
          var progressiveEls = this._progressiveEls = [];
          function setIncrementalAndHoverLayer(el2) {
            if (!el2.isGroup) {
              el2.incremental = true;
              el2.ensureState("emphasis").hoverLayer = true;
            }
          }
          for (var idx = params.start; idx < params.end; idx++) {
            var el = createOrUpdateItem(null, null, idx, renderItem(idx, payload), customSeries, this.group, data);
            if (el) {
              el.traverse(setIncrementalAndHoverLayer);
              progressiveEls.push(el);
            }
          }
        };
        CustomChartView2.prototype.eachRendered = function(cb) {
          traverseElements(this._progressiveEls || this.group, cb);
        };
        CustomChartView2.prototype.filterForExposedEvent = function(eventType, query, targetEl, packedEvent) {
          var elementName = query.element;
          if (elementName == null || targetEl.name === elementName) {
            return true;
          }
          while ((targetEl = targetEl.__hostTarget || targetEl.parent) && targetEl !== this.group) {
            if (targetEl.name === elementName) {
              return true;
            }
          }
          return false;
        };
        CustomChartView2.type = "custom";
        return CustomChartView2;
      }(ChartView)
    );
    function createEl$1(elOption) {
      var graphicType = elOption.type;
      var el;
      if (graphicType === "path") {
        var shape = elOption.shape;
        var pathRect = shape.width != null && shape.height != null ? {
          x: shape.x || 0,
          y: shape.y || 0,
          width: shape.width,
          height: shape.height
        } : null;
        var pathData = getPathData(shape);
        el = makePath(pathData, null, pathRect, shape.layout || "center");
        customInnerStore(el).customPathData = pathData;
      } else if (graphicType === "image") {
        el = new ZRImage({});
        customInnerStore(el).customImagePath = elOption.style.image;
      } else if (graphicType === "text") {
        el = new ZRText({});
      } else if (graphicType === "group") {
        el = new Group$3();
      } else if (graphicType === "compoundPath") {
        throw new Error('"compoundPath" is not supported yet.');
      } else {
        var Clz = getShapeClass(graphicType);
        if (!Clz) {
          var errMsg = "";
          throwError(errMsg);
        }
        el = new Clz();
      }
      customInnerStore(el).customGraphicType = graphicType;
      el.name = elOption.name;
      el.z2EmphasisLift = 1;
      el.z2SelectLift = 1;
      return el;
    }
    function updateElNormal(api2, el, dataIndex, elOption, attachedTxInfo, seriesModel, isInit) {
      stopPreviousKeyframeAnimationAndRestore(el);
      var txCfgOpt = attachedTxInfo && attachedTxInfo.normal.cfg;
      if (txCfgOpt) {
        el.setTextConfig(txCfgOpt);
      }
      if (elOption && elOption.transition == null) {
        elOption.transition = DEFAULT_TRANSITION;
      }
      var styleOpt = elOption && elOption.style;
      if (styleOpt) {
        if (el.type === "text") {
          var textOptionStyle = styleOpt;
          hasOwn(textOptionStyle, "textFill") && (textOptionStyle.fill = textOptionStyle.textFill);
          hasOwn(textOptionStyle, "textStroke") && (textOptionStyle.stroke = textOptionStyle.textStroke);
        }
        var decalPattern = void 0;
        var decalObj = isPath(el) ? styleOpt.decal : null;
        if (api2 && decalObj) {
          decalObj.dirty = true;
          decalPattern = createOrUpdatePatternFromDecal(decalObj, api2);
        }
        styleOpt.__decalPattern = decalPattern;
      }
      if (isDisplayable(el)) {
        if (styleOpt) {
          var decalPattern = styleOpt.__decalPattern;
          if (decalPattern) {
            styleOpt.decal = decalPattern;
          }
        }
      }
      applyUpdateTransition(el, elOption, seriesModel, {
        dataIndex,
        isInit,
        clearStyle: true
      });
      applyKeyframeAnimation(el, elOption.keyframeAnimation, seriesModel);
    }
    function updateElOnState(state, el, elStateOpt, styleOpt, attachedTxInfo) {
      var elDisplayable = el.isGroup ? null : el;
      var txCfgOpt = attachedTxInfo && attachedTxInfo[state].cfg;
      if (elDisplayable) {
        var stateObj = elDisplayable.ensureState(state);
        if (styleOpt === false) {
          var existingEmphasisState = elDisplayable.getState(state);
          if (existingEmphasisState) {
            existingEmphasisState.style = null;
          }
        } else {
          stateObj.style = styleOpt || null;
        }
        if (txCfgOpt) {
          stateObj.textConfig = txCfgOpt;
        }
        setDefaultStateProxy(elDisplayable);
      }
    }
    function updateZ(el, elOption, seriesModel) {
      if (el.isGroup) {
        return;
      }
      var elDisplayable = el;
      var currentZ = seriesModel.currentZ;
      var currentZLevel = seriesModel.currentZLevel;
      elDisplayable.z = currentZ;
      elDisplayable.zlevel = currentZLevel;
      var optZ2 = elOption.z2;
      optZ2 != null && (elDisplayable.z2 = optZ2 || 0);
      for (var i2 = 0; i2 < STATES.length; i2++) {
        updateZForEachState(elDisplayable, elOption, STATES[i2]);
      }
    }
    function updateZForEachState(elDisplayable, elOption, state) {
      var isNormal = state === NORMAL;
      var elStateOpt = isNormal ? elOption : retrieveStateOption(elOption, state);
      var optZ2 = elStateOpt ? elStateOpt.z2 : null;
      var stateObj;
      if (optZ2 != null) {
        stateObj = isNormal ? elDisplayable : elDisplayable.ensureState(state);
        stateObj.z2 = optZ2 || 0;
      }
    }
    function makeRenderItem(customSeries, data, ecModel, api2) {
      var renderItem = customSeries.get("renderItem");
      var coordSys = customSeries.coordinateSystem;
      var prepareResult2 = {};
      if (coordSys) {
        prepareResult2 = coordSys.prepareCustoms ? coordSys.prepareCustoms(coordSys) : prepareCustoms[coordSys.type](coordSys);
      }
      var userAPI = defaults$1({
        getWidth: api2.getWidth,
        getHeight: api2.getHeight,
        getZr: api2.getZr,
        getDevicePixelRatio: api2.getDevicePixelRatio,
        value,
        style,
        ordinalRawValue,
        styleEmphasis,
        visual,
        barLayout,
        currentSeriesIndices,
        font
      }, prepareResult2.api || {});
      var userParams = {
        // The life cycle of context: current round of rendering.
        // The global life cycle is probably not necessary, because
        // user can store global status by themselves.
        context: {},
        seriesId: customSeries.id,
        seriesName: customSeries.name,
        seriesIndex: customSeries.seriesIndex,
        coordSys: prepareResult2.coordSys,
        dataInsideLength: data.count(),
        encode: wrapEncodeDef(customSeries.getData())
      };
      var currDataIndexInside;
      var currItemModel;
      var currItemStyleModels = {};
      var currLabelModels = {};
      var seriesItemStyleModels = {};
      var seriesLabelModels = {};
      for (var i2 = 0; i2 < STATES.length; i2++) {
        var stateName = STATES[i2];
        seriesItemStyleModels[stateName] = customSeries.getModel(PATH_ITEM_STYLE[stateName]);
        seriesLabelModels[stateName] = customSeries.getModel(PATH_LABEL[stateName]);
      }
      function getItemModel2(dataIndexInside) {
        return dataIndexInside === currDataIndexInside ? currItemModel || (currItemModel = data.getItemModel(dataIndexInside)) : data.getItemModel(dataIndexInside);
      }
      function getItemStyleModel(dataIndexInside, state) {
        return !data.hasItemOption ? seriesItemStyleModels[state] : dataIndexInside === currDataIndexInside ? currItemStyleModels[state] || (currItemStyleModels[state] = getItemModel2(dataIndexInside).getModel(PATH_ITEM_STYLE[state])) : getItemModel2(dataIndexInside).getModel(PATH_ITEM_STYLE[state]);
      }
      function getLabelModel(dataIndexInside, state) {
        return !data.hasItemOption ? seriesLabelModels[state] : dataIndexInside === currDataIndexInside ? currLabelModels[state] || (currLabelModels[state] = getItemModel2(dataIndexInside).getModel(PATH_LABEL[state])) : getItemModel2(dataIndexInside).getModel(PATH_LABEL[state]);
      }
      return function(dataIndexInside, payload) {
        currDataIndexInside = dataIndexInside;
        currItemModel = null;
        currItemStyleModels = {};
        currLabelModels = {};
        return renderItem && renderItem(defaults$1({
          dataIndexInside,
          dataIndex: data.getRawIndex(dataIndexInside),
          // Can be used for optimization when zoom or roam.
          actionType: payload ? payload.type : null
        }, userParams), userAPI);
      };
      function value(dim, dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        return data.getStore().get(data.getDimensionIndex(dim || 0), dataIndexInside);
      }
      function ordinalRawValue(dim, dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        dim = dim || 0;
        var dimInfo = data.getDimensionInfo(dim);
        if (!dimInfo) {
          var dimIndex = data.getDimensionIndex(dim);
          return dimIndex >= 0 ? data.getStore().get(dimIndex, dataIndexInside) : void 0;
        }
        var val = data.get(dimInfo.name, dataIndexInside);
        var ordinalMeta = dimInfo && dimInfo.ordinalMeta;
        return ordinalMeta ? ordinalMeta.categories[val] : val;
      }
      function style(userProps, dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        var style2 = data.getItemVisual(dataIndexInside, "style");
        var visualColor = style2 && style2.fill;
        var opacity2 = style2 && style2.opacity;
        var itemStyle = getItemStyleModel(dataIndexInside, NORMAL).getItemStyle();
        visualColor != null && (itemStyle.fill = visualColor);
        opacity2 != null && (itemStyle.opacity = opacity2);
        var opt = {
          inheritColor: isString$1(visualColor) ? visualColor : "#000"
        };
        var labelModel = getLabelModel(dataIndexInside, NORMAL);
        var textStyle = createTextStyle(labelModel, null, opt, false, true);
        textStyle.text = labelModel.getShallow("show") ? retrieve2(customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;
        var textConfig = createTextConfig(labelModel, opt, false);
        preFetchFromExtra(userProps, itemStyle);
        itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);
        userProps && applyUserPropsAfter(itemStyle, userProps);
        itemStyle.legacy = true;
        return itemStyle;
      }
      function styleEmphasis(userProps, dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        var itemStyle = getItemStyleModel(dataIndexInside, EMPHASIS).getItemStyle();
        var labelModel = getLabelModel(dataIndexInside, EMPHASIS);
        var textStyle = createTextStyle(labelModel, null, null, true, true);
        textStyle.text = labelModel.getShallow("show") ? retrieve3(customSeries.getFormattedLabel(dataIndexInside, EMPHASIS), customSeries.getFormattedLabel(dataIndexInside, NORMAL), getDefaultLabel(data, dataIndexInside)) : null;
        var textConfig = createTextConfig(labelModel, null, true);
        preFetchFromExtra(userProps, itemStyle);
        itemStyle = convertToEC4StyleForCustomSerise(itemStyle, textStyle, textConfig);
        userProps && applyUserPropsAfter(itemStyle, userProps);
        itemStyle.legacy = true;
        return itemStyle;
      }
      function applyUserPropsAfter(itemStyle, extra) {
        for (var key in extra) {
          if (hasOwn(extra, key)) {
            itemStyle[key] = extra[key];
          }
        }
      }
      function preFetchFromExtra(extra, itemStyle) {
        if (extra) {
          extra.textFill && (itemStyle.textFill = extra.textFill);
          extra.textPosition && (itemStyle.textPosition = extra.textPosition);
        }
      }
      function visual(visualType, dataIndexInside) {
        dataIndexInside == null && (dataIndexInside = currDataIndexInside);
        if (hasOwn(STYLE_VISUAL_TYPE, visualType)) {
          var style_1 = data.getItemVisual(dataIndexInside, "style");
          return style_1 ? style_1[STYLE_VISUAL_TYPE[visualType]] : null;
        }
        if (hasOwn(NON_STYLE_VISUAL_PROPS, visualType)) {
          return data.getItemVisual(dataIndexInside, visualType);
        }
      }
      function barLayout(opt) {
        if (coordSys.type === "cartesian2d") {
          var baseAxis = coordSys.getBaseAxis();
          return getLayoutOnAxis(defaults$1({
            axis: baseAxis
          }, opt));
        }
      }
      function currentSeriesIndices() {
        return ecModel.getCurrentSeriesIndices();
      }
      function font(opt) {
        return getFont(opt, ecModel);
      }
    }
    function wrapEncodeDef(data) {
      var encodeDef = {};
      each$f(data.dimensions, function(dimName) {
        var dimInfo = data.getDimensionInfo(dimName);
        if (!dimInfo.isExtraCoord) {
          var coordDim = dimInfo.coordDim;
          var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || [];
          dataDims[dimInfo.coordDimIndex] = data.getDimensionIndex(dimName);
        }
      });
      return encodeDef;
    }
    function createOrUpdateItem(api2, existsEl, dataIndex, elOption, seriesModel, group, data) {
      if (!elOption) {
        group.remove(existsEl);
        return;
      }
      var el = doCreateOrUpdateEl(api2, existsEl, dataIndex, elOption, seriesModel, group);
      el && data.setItemGraphicEl(dataIndex, el);
      el && toggleHoverEmphasis(el, elOption.focus, elOption.blurScope, elOption.emphasisDisabled);
      return el;
    }
    function doCreateOrUpdateEl(api2, existsEl, dataIndex, elOption, seriesModel, group) {
      var toBeReplacedIdx = -1;
      var oldEl = existsEl;
      if (existsEl && doesElNeedRecreate(existsEl, elOption, seriesModel)) {
        toBeReplacedIdx = indexOf(group.childrenRef(), existsEl);
        existsEl = null;
      }
      var isInit = !existsEl;
      var el = existsEl;
      if (!el) {
        el = createEl$1(elOption);
        if (oldEl) {
          copyElement(oldEl, el);
        }
      } else {
        el.clearStates();
      }
      if (elOption.morph === false) {
        el.disableMorphing = true;
      } else if (el.disableMorphing) {
        el.disableMorphing = false;
      }
      attachedTxInfoTmp.normal.cfg = attachedTxInfoTmp.normal.conOpt = attachedTxInfoTmp.emphasis.cfg = attachedTxInfoTmp.emphasis.conOpt = attachedTxInfoTmp.blur.cfg = attachedTxInfoTmp.blur.conOpt = attachedTxInfoTmp.select.cfg = attachedTxInfoTmp.select.conOpt = null;
      attachedTxInfoTmp.isLegacy = false;
      doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfoTmp);
      doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit);
      updateElNormal(api2, el, dataIndex, elOption, attachedTxInfoTmp, seriesModel, isInit);
      hasOwn(elOption, "info") && (customInnerStore(el).info = elOption.info);
      for (var i2 = 0; i2 < STATES.length; i2++) {
        var stateName = STATES[i2];
        if (stateName !== NORMAL) {
          var otherStateOpt = retrieveStateOption(elOption, stateName);
          var otherStyleOpt = retrieveStyleOptionOnState(elOption, otherStateOpt, stateName);
          updateElOnState(stateName, el, otherStateOpt, otherStyleOpt, attachedTxInfoTmp);
        }
      }
      updateZ(el, elOption, seriesModel);
      if (elOption.type === "group") {
        mergeChildren(api2, el, dataIndex, elOption, seriesModel);
      }
      if (toBeReplacedIdx >= 0) {
        group.replaceAt(el, toBeReplacedIdx);
      } else {
        group.add(el);
      }
      return el;
    }
    function doesElNeedRecreate(el, elOption, seriesModel) {
      var elInner = customInnerStore(el);
      var elOptionType = elOption.type;
      var elOptionShape = elOption.shape;
      var elOptionStyle = elOption.style;
      return (
        // Always create new if universal transition is enabled.
        // Because we do transition after render. It needs to know what old element is. Replacement will loose it.
        seriesModel.isUniversalTransitionEnabled() || elOptionType != null && elOptionType !== elInner.customGraphicType || elOptionType === "path" && hasOwnPathData(elOptionShape) && getPathData(elOptionShape) !== elInner.customPathData || elOptionType === "image" && hasOwn(elOptionStyle, "image") && elOptionStyle.image !== elInner.customImagePath
      );
    }
    function doCreateOrUpdateClipPath(el, dataIndex, elOption, seriesModel, isInit) {
      var clipPathOpt = elOption.clipPath;
      if (clipPathOpt === false) {
        if (el && el.getClipPath()) {
          el.removeClipPath();
        }
      } else if (clipPathOpt) {
        var clipPath = el.getClipPath();
        if (clipPath && doesElNeedRecreate(clipPath, clipPathOpt, seriesModel)) {
          clipPath = null;
        }
        if (!clipPath) {
          clipPath = createEl$1(clipPathOpt);
          el.setClipPath(clipPath);
        }
        updateElNormal(null, clipPath, dataIndex, clipPathOpt, null, seriesModel, isInit);
      }
    }
    function doCreateOrUpdateAttachedTx(el, dataIndex, elOption, seriesModel, isInit, attachedTxInfo) {
      if (el.isGroup) {
        return;
      }
      processTxInfo(elOption, null, attachedTxInfo);
      processTxInfo(elOption, EMPHASIS, attachedTxInfo);
      var txConOptNormal = attachedTxInfo.normal.conOpt;
      var txConOptEmphasis = attachedTxInfo.emphasis.conOpt;
      var txConOptBlur = attachedTxInfo.blur.conOpt;
      var txConOptSelect = attachedTxInfo.select.conOpt;
      if (txConOptNormal != null || txConOptEmphasis != null || txConOptSelect != null || txConOptBlur != null) {
        var textContent = el.getTextContent();
        if (txConOptNormal === false) {
          textContent && el.removeTextContent();
        } else {
          txConOptNormal = attachedTxInfo.normal.conOpt = txConOptNormal || {
            type: "text"
          };
          if (!textContent) {
            textContent = createEl$1(txConOptNormal);
            el.setTextContent(textContent);
          } else {
            textContent.clearStates();
          }
          updateElNormal(null, textContent, dataIndex, txConOptNormal, null, seriesModel, isInit);
          var txConStlOptNormal = txConOptNormal && txConOptNormal.style;
          for (var i2 = 0; i2 < STATES.length; i2++) {
            var stateName = STATES[i2];
            if (stateName !== NORMAL) {
              var txConOptOtherState = attachedTxInfo[stateName].conOpt;
              updateElOnState(stateName, textContent, txConOptOtherState, retrieveStyleOptionOnState(txConOptNormal, txConOptOtherState, stateName), null);
            }
          }
          txConStlOptNormal ? textContent.dirty() : textContent.markRedraw();
        }
      }
    }
    function processTxInfo(elOption, state, attachedTxInfo) {
      var stateOpt = !state ? elOption : retrieveStateOption(elOption, state);
      var styleOpt = !state ? elOption.style : retrieveStyleOptionOnState(elOption, stateOpt, EMPHASIS);
      var elType = elOption.type;
      var txCfg = stateOpt ? stateOpt.textConfig : null;
      var txConOptNormal = elOption.textContent;
      var txConOpt = !txConOptNormal ? null : !state ? txConOptNormal : retrieveStateOption(txConOptNormal, state);
      if (styleOpt && // Because emphasis style has little info to detect legacy,
      // if normal is legacy, emphasis is trade as legacy.
      (attachedTxInfo.isLegacy || isEC4CompatibleStyle(styleOpt, elType, !!txCfg, !!txConOpt))) {
        attachedTxInfo.isLegacy = true;
        var convertResult = convertFromEC4CompatibleStyle(styleOpt, elType, !state);
        if (!txCfg && convertResult.textConfig) {
          txCfg = convertResult.textConfig;
        }
        if (!txConOpt && convertResult.textContent) {
          txConOpt = convertResult.textContent;
        }
      }
      if (!state && txConOpt) {
        var txConOptNormal_1 = txConOpt;
        !txConOptNormal_1.type && (txConOptNormal_1.type = "text");
      }
      var info = !state ? attachedTxInfo.normal : attachedTxInfo[state];
      info.cfg = txCfg;
      info.conOpt = txConOpt;
    }
    function retrieveStateOption(elOption, state) {
      return !state ? elOption : elOption ? elOption[state] : null;
    }
    function retrieveStyleOptionOnState(stateOptionNormal, stateOption, state) {
      var style = stateOption && stateOption.style;
      if (style == null && state === EMPHASIS && stateOptionNormal) {
        style = stateOptionNormal.styleEmphasis;
      }
      return style;
    }
    function mergeChildren(api2, el, dataIndex, elOption, seriesModel) {
      var newChildren = elOption.children;
      var newLen = newChildren ? newChildren.length : 0;
      var mergeChildren2 = elOption.$mergeChildren;
      var byName = mergeChildren2 === "byName" || elOption.diffChildrenByName;
      var notMerge = mergeChildren2 === false;
      if (!newLen && !byName && !notMerge) {
        return;
      }
      if (byName) {
        diffGroupChildren({
          api: api2,
          oldChildren: el.children() || [],
          newChildren: newChildren || [],
          dataIndex,
          seriesModel,
          group: el
        });
        return;
      }
      notMerge && el.removeAll();
      var index = 0;
      for (; index < newLen; index++) {
        var newChild = newChildren[index];
        var oldChild = el.childAt(index);
        if (newChild) {
          if (newChild.ignore == null) {
            newChild.ignore = false;
          }
          doCreateOrUpdateEl(api2, oldChild, dataIndex, newChild, seriesModel, el);
        } else {
          oldChild.ignore = true;
        }
      }
      for (var i2 = el.childCount() - 1; i2 >= index; i2--) {
        var child = el.childAt(i2);
        removeChildFromGroup(el, child, seriesModel);
      }
    }
    function removeChildFromGroup(group, child, seriesModel) {
      child && applyLeaveTransition(child, customInnerStore(group).option, seriesModel);
    }
    function diffGroupChildren(context) {
      new DataDiffer(context.oldChildren, context.newChildren, getKey, getKey, context).add(processAddUpdate).update(processAddUpdate).remove(processRemove).execute();
    }
    function getKey(item, idx) {
      var name = item && item.name;
      return name != null ? name : GROUP_DIFF_PREFIX + idx;
    }
    function processAddUpdate(newIndex, oldIndex) {
      var context = this.context;
      var childOption = newIndex != null ? context.newChildren[newIndex] : null;
      var child = oldIndex != null ? context.oldChildren[oldIndex] : null;
      doCreateOrUpdateEl(context.api, child, context.dataIndex, childOption, context.seriesModel, context.group);
    }
    function processRemove(oldIndex) {
      var context = this.context;
      var child = context.oldChildren[oldIndex];
      child && applyLeaveTransition(child, customInnerStore(child).option, context.seriesModel);
    }
    function getPathData(shape) {
      return shape && (shape.pathData || shape.d);
    }
    function hasOwnPathData(shape) {
      return shape && (hasOwn(shape, "pathData") || hasOwn(shape, "d"));
    }
    function install$r(registers) {
      registers.registerChartView(CustomChartView);
      registers.registerSeriesModel(CustomSeriesModel);
    }
    var inner$b = makeInner();
    var clone$1 = clone$4;
    var bind$1 = bind$2;
    var BaseAxisPointer = (
      /** @class */
      function() {
        function BaseAxisPointer2() {
          this._dragging = false;
          this.animationThreshold = 15;
        }
        BaseAxisPointer2.prototype.render = function(axisModel, axisPointerModel, api2, forceRender) {
          var value = axisPointerModel.get("value");
          var status = axisPointerModel.get("status");
          this._axisModel = axisModel;
          this._axisPointerModel = axisPointerModel;
          this._api = api2;
          if (!forceRender && this._lastValue === value && this._lastStatus === status) {
            return;
          }
          this._lastValue = value;
          this._lastStatus = status;
          var group = this._group;
          var handle = this._handle;
          if (!status || status === "hide") {
            group && group.hide();
            handle && handle.hide();
            return;
          }
          group && group.show();
          handle && handle.show();
          var elOption = {};
          this.makeElOption(elOption, value, axisModel, axisPointerModel, api2);
          var graphicKey = elOption.graphicKey;
          if (graphicKey !== this._lastGraphicKey) {
            this.clear(api2);
          }
          this._lastGraphicKey = graphicKey;
          var moveAnimation = this._moveAnimation = this.determineAnimation(axisModel, axisPointerModel);
          if (!group) {
            group = this._group = new Group$3();
            this.createPointerEl(group, elOption, axisModel, axisPointerModel);
            this.createLabelEl(group, elOption, axisModel, axisPointerModel);
            api2.getZr().add(group);
          } else {
            var doUpdateProps = curry$1(updateProps, axisPointerModel, moveAnimation);
            this.updatePointerEl(group, elOption, doUpdateProps);
            this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel);
          }
          updateMandatoryProps(group, axisPointerModel, true);
          this._renderHandle(value);
        };
        BaseAxisPointer2.prototype.remove = function(api2) {
          this.clear(api2);
        };
        BaseAxisPointer2.prototype.dispose = function(api2) {
          this.clear(api2);
        };
        BaseAxisPointer2.prototype.determineAnimation = function(axisModel, axisPointerModel) {
          var animation = axisPointerModel.get("animation");
          var axis = axisModel.axis;
          var isCategoryAxis = axis.type === "category";
          var useSnap = axisPointerModel.get("snap");
          if (!useSnap && !isCategoryAxis) {
            return false;
          }
          if (animation === "auto" || animation == null) {
            var animationThreshold = this.animationThreshold;
            if (isCategoryAxis && axis.getBandWidth() > animationThreshold) {
              return true;
            }
            if (useSnap) {
              var seriesDataCount = getAxisInfo$1(axisModel).seriesDataCount;
              var axisExtent = axis.getExtent();
              return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold;
            }
            return false;
          }
          return animation === true;
        };
        BaseAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api2) {
        };
        BaseAxisPointer2.prototype.createPointerEl = function(group, elOption, axisModel, axisPointerModel) {
          var pointerOption = elOption.pointer;
          if (pointerOption) {
            var pointerEl = inner$b(group).pointerEl = new graphic[pointerOption.type](clone$1(elOption.pointer));
            group.add(pointerEl);
          }
        };
        BaseAxisPointer2.prototype.createLabelEl = function(group, elOption, axisModel, axisPointerModel) {
          if (elOption.label) {
            var labelEl = inner$b(group).labelEl = new ZRText(clone$1(elOption.label));
            group.add(labelEl);
            updateLabelShowHide(labelEl, axisPointerModel);
          }
        };
        BaseAxisPointer2.prototype.updatePointerEl = function(group, elOption, updateProps2) {
          var pointerEl = inner$b(group).pointerEl;
          if (pointerEl && elOption.pointer) {
            pointerEl.setStyle(elOption.pointer.style);
            updateProps2(pointerEl, {
              shape: elOption.pointer.shape
            });
          }
        };
        BaseAxisPointer2.prototype.updateLabelEl = function(group, elOption, updateProps2, axisPointerModel) {
          var labelEl = inner$b(group).labelEl;
          if (labelEl) {
            labelEl.setStyle(elOption.label.style);
            updateProps2(labelEl, {
              // Consider text length change in vertical axis, animation should
              // be used on shape, otherwise the effect will be weird.
              // TODOTODO
              // shape: elOption.label.shape,
              x: elOption.label.x,
              y: elOption.label.y
            });
            updateLabelShowHide(labelEl, axisPointerModel);
          }
        };
        BaseAxisPointer2.prototype._renderHandle = function(value) {
          if (this._dragging || !this.updateHandleTransform) {
            return;
          }
          var axisPointerModel = this._axisPointerModel;
          var zr = this._api.getZr();
          var handle = this._handle;
          var handleModel = axisPointerModel.getModel("handle");
          var status = axisPointerModel.get("status");
          if (!handleModel.get("show") || !status || status === "hide") {
            handle && zr.remove(handle);
            this._handle = null;
            return;
          }
          var isInit;
          if (!this._handle) {
            isInit = true;
            handle = this._handle = createIcon(handleModel.get("icon"), {
              cursor: "move",
              draggable: true,
              onmousemove: function(e2) {
                stop(e2.event);
              },
              onmousedown: bind$1(this._onHandleDragMove, this, 0, 0),
              drift: bind$1(this._onHandleDragMove, this),
              ondragend: bind$1(this._onHandleDragEnd, this)
            });
            zr.add(handle);
          }
          updateMandatoryProps(handle, axisPointerModel, false);
          handle.setStyle(handleModel.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
          var handleSize = handleModel.get("size");
          if (!isArray$2(handleSize)) {
            handleSize = [handleSize, handleSize];
          }
          handle.scaleX = handleSize[0] / 2;
          handle.scaleY = handleSize[1] / 2;
          createOrUpdate(this, "_doDispatchAxisPointer", handleModel.get("throttle") || 0, "fixRate");
          this._moveHandleToValue(value, isInit);
        };
        BaseAxisPointer2.prototype._moveHandleToValue = function(value, isInit) {
          updateProps(this._axisPointerModel, !isInit && this._moveAnimation, this._handle, getHandleTransProps(this.getHandleTransform(value, this._axisModel, this._axisPointerModel)));
        };
        BaseAxisPointer2.prototype._onHandleDragMove = function(dx, dy) {
          var handle = this._handle;
          if (!handle) {
            return;
          }
          this._dragging = true;
          var trans = this.updateHandleTransform(getHandleTransProps(handle), [dx, dy], this._axisModel, this._axisPointerModel);
          this._payloadInfo = trans;
          handle.stopAnimation();
          handle.attr(getHandleTransProps(trans));
          inner$b(handle).lastProp = null;
          this._doDispatchAxisPointer();
        };
        BaseAxisPointer2.prototype._doDispatchAxisPointer = function() {
          var handle = this._handle;
          if (!handle) {
            return;
          }
          var payloadInfo = this._payloadInfo;
          var axisModel = this._axisModel;
          this._api.dispatchAction({
            type: "updateAxisPointer",
            x: payloadInfo.cursorPoint[0],
            y: payloadInfo.cursorPoint[1],
            tooltipOption: payloadInfo.tooltipOption,
            axesInfo: [{
              axisDim: axisModel.axis.dim,
              axisIndex: axisModel.componentIndex
            }]
          });
        };
        BaseAxisPointer2.prototype._onHandleDragEnd = function() {
          this._dragging = false;
          var handle = this._handle;
          if (!handle) {
            return;
          }
          var value = this._axisPointerModel.get("value");
          this._moveHandleToValue(value);
          this._api.dispatchAction({
            type: "hideTip"
          });
        };
        BaseAxisPointer2.prototype.clear = function(api2) {
          this._lastValue = null;
          this._lastStatus = null;
          var zr = api2.getZr();
          var group = this._group;
          var handle = this._handle;
          if (zr && group) {
            this._lastGraphicKey = null;
            group && zr.remove(group);
            handle && zr.remove(handle);
            this._group = null;
            this._handle = null;
            this._payloadInfo = null;
          }
          clear$1(this, "_doDispatchAxisPointer");
        };
        BaseAxisPointer2.prototype.doClear = function() {
        };
        BaseAxisPointer2.prototype.buildLabel = function(xy, wh, xDimIndex) {
          xDimIndex = xDimIndex || 0;
          return {
            x: xy[xDimIndex],
            y: xy[1 - xDimIndex],
            width: wh[xDimIndex],
            height: wh[1 - xDimIndex]
          };
        };
        return BaseAxisPointer2;
      }()
    );
    function updateProps(animationModel, moveAnimation, el, props2) {
      if (!propsEqual(inner$b(el).lastProp, props2)) {
        inner$b(el).lastProp = props2;
        moveAnimation ? updateProps$1(el, props2, animationModel) : (el.stopAnimation(), el.attr(props2));
      }
    }
    function propsEqual(lastProps, newProps) {
      if (isObject$5(lastProps) && isObject$5(newProps)) {
        var equals_1 = true;
        each$f(newProps, function(item, key) {
          equals_1 = equals_1 && propsEqual(lastProps[key], item);
        });
        return !!equals_1;
      } else {
        return lastProps === newProps;
      }
    }
    function updateLabelShowHide(labelEl, axisPointerModel) {
      labelEl[axisPointerModel.get(["label", "show"]) ? "show" : "hide"]();
    }
    function getHandleTransProps(trans) {
      return {
        x: trans.x || 0,
        y: trans.y || 0,
        rotation: trans.rotation || 0
      };
    }
    function updateMandatoryProps(group, axisPointerModel, silent) {
      var z2 = axisPointerModel.get("z");
      var zlevel = axisPointerModel.get("zlevel");
      group && group.traverse(function(el) {
        if (el.type !== "group") {
          z2 != null && (el.z = z2);
          zlevel != null && (el.zlevel = zlevel);
          el.silent = silent;
        }
      });
    }
    function buildElStyle(axisPointerModel) {
      var axisPointerType = axisPointerModel.get("type");
      var styleModel = axisPointerModel.getModel(axisPointerType + "Style");
      var style;
      if (axisPointerType === "line") {
        style = styleModel.getLineStyle();
        style.fill = null;
      } else if (axisPointerType === "shadow") {
        style = styleModel.getAreaStyle();
        style.stroke = null;
      }
      return style;
    }
    function buildLabelElOption(elOption, axisModel, axisPointerModel, api2, labelPos) {
      var value = axisPointerModel.get("value");
      var text = getValueLabel(value, axisModel.axis, axisModel.ecModel, axisPointerModel.get("seriesDataIndices"), {
        precision: axisPointerModel.get(["label", "precision"]),
        formatter: axisPointerModel.get(["label", "formatter"])
      });
      var labelModel = axisPointerModel.getModel("label");
      var paddings = normalizeCssArray(labelModel.get("padding") || 0);
      var font = labelModel.getFont();
      var textRect = getBoundingRect(text, font);
      var position2 = labelPos.position;
      var width = textRect.width + paddings[1] + paddings[3];
      var height = textRect.height + paddings[0] + paddings[2];
      var align = labelPos.align;
      align === "right" && (position2[0] -= width);
      align === "center" && (position2[0] -= width / 2);
      var verticalAlign = labelPos.verticalAlign;
      verticalAlign === "bottom" && (position2[1] -= height);
      verticalAlign === "middle" && (position2[1] -= height / 2);
      confineInContainer(position2, width, height, api2);
      var bgColor = labelModel.get("backgroundColor");
      if (!bgColor || bgColor === "auto") {
        bgColor = axisModel.get(["axisLine", "lineStyle", "color"]);
      }
      elOption.label = {
        // shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')},
        x: position2[0],
        y: position2[1],
        style: createTextStyle(labelModel, {
          text,
          font,
          fill: labelModel.getTextColor(),
          padding: paddings,
          backgroundColor: bgColor
        }),
        // Label should be over axisPointer.
        z2: 10
      };
    }
    function confineInContainer(position2, width, height, api2) {
      var viewWidth = api2.getWidth();
      var viewHeight = api2.getHeight();
      position2[0] = Math.min(position2[0] + width, viewWidth) - width;
      position2[1] = Math.min(position2[1] + height, viewHeight) - height;
      position2[0] = Math.max(position2[0], 0);
      position2[1] = Math.max(position2[1], 0);
    }
    function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) {
      value = axis.scale.parse(value);
      var text = axis.scale.getLabel({
        value
      }, {
        // If `precision` is set, width can be fixed (like '12.00500'), which
        // helps to debounce when when moving label.
        precision: opt.precision
      });
      var formatter2 = opt.formatter;
      if (formatter2) {
        var params_1 = {
          value: getAxisRawValue(axis, {
            value
          }),
          axisDimension: axis.dim,
          axisIndex: axis.index,
          seriesData: []
        };
        each$f(seriesDataIndices, function(idxItem) {
          var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
          var dataIndex = idxItem.dataIndexInside;
          var dataParams = series && series.getDataParams(dataIndex);
          dataParams && params_1.seriesData.push(dataParams);
        });
        if (isString$1(formatter2)) {
          text = formatter2.replace("{value}", text);
        } else if (isFunction$1(formatter2)) {
          text = formatter2(params_1);
        }
      }
      return text;
    }
    function getTransformedPosition(axis, value, layoutInfo) {
      var transform2 = create$1();
      rotate(transform2, transform2, layoutInfo.rotation);
      translate(transform2, transform2, layoutInfo.position);
      return applyTransform([axis.dataToCoord(value), (layoutInfo.labelOffset || 0) + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0)], transform2);
    }
    function buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api2) {
      var textLayout = AxisBuilder.innerTextLayout(layoutInfo.rotation, 0, layoutInfo.labelDirection);
      layoutInfo.labelMargin = axisPointerModel.get(["label", "margin"]);
      buildLabelElOption(elOption, axisModel, axisPointerModel, api2, {
        position: getTransformedPosition(axisModel.axis, value, layoutInfo),
        align: textLayout.textAlign,
        verticalAlign: textLayout.textVerticalAlign
      });
    }
    function makeLineShape(p1, p2, xDimIndex) {
      xDimIndex = xDimIndex || 0;
      return {
        x1: p1[xDimIndex],
        y1: p1[1 - xDimIndex],
        x2: p2[xDimIndex],
        y2: p2[1 - xDimIndex]
      };
    }
    function makeRectShape(xy, wh, xDimIndex) {
      xDimIndex = xDimIndex || 0;
      return {
        x: xy[xDimIndex],
        y: xy[1 - xDimIndex],
        width: wh[xDimIndex],
        height: wh[1 - xDimIndex]
      };
    }
    function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {
      return {
        cx,
        cy,
        r0,
        r,
        startAngle,
        endAngle,
        clockwise: true
      };
    }
    var CartesianAxisPointer = (
      /** @class */
      function(_super) {
        __extends$1(CartesianAxisPointer2, _super);
        function CartesianAxisPointer2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        CartesianAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api2) {
          var axis = axisModel.axis;
          var grid = axis.grid;
          var axisPointerType = axisPointerModel.get("type");
          var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
          var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));
          if (axisPointerType && axisPointerType !== "none") {
            var elStyle = buildElStyle(axisPointerModel);
            var pointerOption = pointerShapeBuilder$2[axisPointerType](axis, pixelValue, otherExtent);
            pointerOption.style = elStyle;
            elOption.graphicKey = pointerOption.type;
            elOption.pointer = pointerOption;
          }
          var layoutInfo = layout$2(grid.model, axisModel);
          buildCartesianSingleLabelElOption(
            // @ts-ignore
            value,
            elOption,
            layoutInfo,
            axisModel,
            axisPointerModel,
            api2
          );
        };
        CartesianAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
          var layoutInfo = layout$2(axisModel.axis.grid.model, axisModel, {
            labelInside: false
          });
          layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
          var pos = getTransformedPosition(axisModel.axis, value, layoutInfo);
          return {
            x: pos[0],
            y: pos[1],
            rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
          };
        };
        CartesianAxisPointer2.prototype.updateHandleTransform = function(transform2, delta, axisModel, axisPointerModel) {
          var axis = axisModel.axis;
          var grid = axis.grid;
          var axisExtent = axis.getGlobalExtent(true);
          var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();
          var dimIndex = axis.dim === "x" ? 0 : 1;
          var currPosition = [transform2.x, transform2.y];
          currPosition[dimIndex] += delta[dimIndex];
          currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
          currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
          var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
          var cursorPoint = [cursorOtherValue, cursorOtherValue];
          cursorPoint[dimIndex] = currPosition[dimIndex];
          var tooltipOptions = [{
            verticalAlign: "middle"
          }, {
            align: "center"
          }];
          return {
            x: currPosition[0],
            y: currPosition[1],
            rotation: transform2.rotation,
            cursorPoint,
            tooltipOption: tooltipOptions[dimIndex]
          };
        };
        return CartesianAxisPointer2;
      }(BaseAxisPointer)
    );
    function getCartesian(grid, axis) {
      var opt = {};
      opt[axis.dim + "AxisIndex"] = axis.index;
      return grid.getCartesian(opt);
    }
    var pointerShapeBuilder$2 = {
      line: function(axis, pixelValue, otherExtent) {
        var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));
        return {
          type: "Line",
          subPixelOptimize: true,
          shape: targetShape
        };
      },
      shadow: function(axis, pixelValue, otherExtent) {
        var bandWidth = Math.max(1, axis.getBandWidth());
        var span = otherExtent[1] - otherExtent[0];
        return {
          type: "Rect",
          shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))
        };
      }
    };
    function getAxisDimIndex(axis) {
      return axis.dim === "x" ? 0 : 1;
    }
    var AxisPointerModel = (
      /** @class */
      function(_super) {
        __extends$1(AxisPointerModel2, _super);
        function AxisPointerModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = AxisPointerModel2.type;
          return _this;
        }
        AxisPointerModel2.type = "axisPointer";
        AxisPointerModel2.defaultOption = {
          // 'auto' means that show when triggered by tooltip or handle.
          show: "auto",
          // zlevel: 0,
          z: 50,
          type: "line",
          // axispointer triggered by tootip determine snap automatically,
          // see `modelHelper`.
          snap: false,
          triggerTooltip: true,
          triggerEmphasis: true,
          value: null,
          status: null,
          link: [],
          // Do not set 'auto' here, otherwise global animation: false
          // will not effect at this axispointer.
          animation: null,
          animationDurationUpdate: 200,
          lineStyle: {
            color: "#B9BEC9",
            width: 1,
            type: "dashed"
          },
          shadowStyle: {
            color: "rgba(210,219,238,0.2)"
          },
          label: {
            show: true,
            formatter: null,
            precision: "auto",
            margin: 3,
            color: "#fff",
            padding: [5, 7, 5, 7],
            backgroundColor: "auto",
            borderColor: null,
            borderWidth: 0,
            borderRadius: 3
          },
          handle: {
            show: false,
            // eslint-disable-next-line
            icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
            size: 45,
            // handle margin is from symbol center to axis, which is stable when circular move.
            margin: 50,
            // color: '#1b8bbd'
            // color: '#2f4554'
            color: "#333",
            shadowBlur: 3,
            shadowColor: "#aaa",
            shadowOffsetX: 0,
            shadowOffsetY: 2,
            // For mobile performance
            throttle: 40
          }
        };
        return AxisPointerModel2;
      }(ComponentModel)
    );
    var inner$a = makeInner();
    var each$8 = each$f;
    function register(key, api2, handler) {
      if (env.node) {
        return;
      }
      var zr = api2.getZr();
      inner$a(zr).records || (inner$a(zr).records = {});
      initGlobalListeners(zr, api2);
      var record = inner$a(zr).records[key] || (inner$a(zr).records[key] = {});
      record.handler = handler;
    }
    function initGlobalListeners(zr, api2) {
      if (inner$a(zr).initialized) {
        return;
      }
      inner$a(zr).initialized = true;
      useHandler("click", curry$1(doEnter, "click"));
      useHandler("mousemove", curry$1(doEnter, "mousemove"));
      useHandler("globalout", onLeave);
      function useHandler(eventType, cb) {
        zr.on(eventType, function(e2) {
          var dis = makeDispatchAction$1(api2);
          each$8(inner$a(zr).records, function(record) {
            record && cb(record, e2, dis.dispatchAction);
          });
          dispatchTooltipFinally(dis.pendings, api2);
        });
      }
    }
    function dispatchTooltipFinally(pendings, api2) {
      var showLen = pendings.showTip.length;
      var hideLen = pendings.hideTip.length;
      var actuallyPayload;
      if (showLen) {
        actuallyPayload = pendings.showTip[showLen - 1];
      } else if (hideLen) {
        actuallyPayload = pendings.hideTip[hideLen - 1];
      }
      if (actuallyPayload) {
        actuallyPayload.dispatchAction = null;
        api2.dispatchAction(actuallyPayload);
      }
    }
    function onLeave(record, e2, dispatchAction2) {
      record.handler("leave", null, dispatchAction2);
    }
    function doEnter(currTrigger, record, e2, dispatchAction2) {
      record.handler(currTrigger, e2, dispatchAction2);
    }
    function makeDispatchAction$1(api2) {
      var pendings = {
        showTip: [],
        hideTip: []
      };
      var dispatchAction2 = function(payload) {
        var pendingList = pendings[payload.type];
        if (pendingList) {
          pendingList.push(payload);
        } else {
          payload.dispatchAction = dispatchAction2;
          api2.dispatchAction(payload);
        }
      };
      return {
        dispatchAction: dispatchAction2,
        pendings
      };
    }
    function unregister(key, api2) {
      if (env.node) {
        return;
      }
      var zr = api2.getZr();
      var record = (inner$a(zr).records || {})[key];
      if (record) {
        inner$a(zr).records[key] = null;
      }
    }
    var AxisPointerView = (
      /** @class */
      function(_super) {
        __extends$1(AxisPointerView2, _super);
        function AxisPointerView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = AxisPointerView2.type;
          return _this;
        }
        AxisPointerView2.prototype.render = function(globalAxisPointerModel, ecModel, api2) {
          var globalTooltipModel = ecModel.getComponent("tooltip");
          var triggerOn = globalAxisPointerModel.get("triggerOn") || globalTooltipModel && globalTooltipModel.get("triggerOn") || "mousemove|click";
          register("axisPointer", api2, function(currTrigger, e2, dispatchAction2) {
            if (triggerOn !== "none" && (currTrigger === "leave" || triggerOn.indexOf(currTrigger) >= 0)) {
              dispatchAction2({
                type: "updateAxisPointer",
                currTrigger,
                x: e2 && e2.offsetX,
                y: e2 && e2.offsetY
              });
            }
          });
        };
        AxisPointerView2.prototype.remove = function(ecModel, api2) {
          unregister("axisPointer", api2);
        };
        AxisPointerView2.prototype.dispose = function(ecModel, api2) {
          unregister("axisPointer", api2);
        };
        AxisPointerView2.type = "axisPointer";
        return AxisPointerView2;
      }(ComponentView)
    );
    function findPointFromSeries(finder, ecModel) {
      var point = [];
      var seriesIndex = finder.seriesIndex;
      var seriesModel;
      if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {
        return {
          point: []
        };
      }
      var data = seriesModel.getData();
      var dataIndex = queryDataIndex(data, finder);
      if (dataIndex == null || dataIndex < 0 || isArray$2(dataIndex)) {
        return {
          point: []
        };
      }
      var el = data.getItemGraphicEl(dataIndex);
      var coordSys = seriesModel.coordinateSystem;
      if (seriesModel.getTooltipPosition) {
        point = seriesModel.getTooltipPosition(dataIndex) || [];
      } else if (coordSys && coordSys.dataToPoint) {
        if (finder.isStacked) {
          var baseAxis = coordSys.getBaseAxis();
          var valueAxis2 = coordSys.getOtherAxis(baseAxis);
          var valueAxisDim = valueAxis2.dim;
          var baseAxisDim = baseAxis.dim;
          var baseDataOffset = valueAxisDim === "x" || valueAxisDim === "radius" ? 1 : 0;
          var baseDim = data.mapDimension(baseAxisDim);
          var stackedData = [];
          stackedData[baseDataOffset] = data.get(baseDim, dataIndex);
          stackedData[1 - baseDataOffset] = data.get(data.getCalculationInfo("stackResultDimension"), dataIndex);
          point = coordSys.dataToPoint(stackedData) || [];
        } else {
          point = coordSys.dataToPoint(data.getValues(map$1(coordSys.dimensions, function(dim) {
            return data.mapDimension(dim);
          }), dataIndex)) || [];
        }
      } else if (el) {
        var rect = el.getBoundingRect().clone();
        rect.applyTransform(el.transform);
        point = [rect.x + rect.width / 2, rect.y + rect.height / 2];
      }
      return {
        point,
        el
      };
    }
    var inner$9 = makeInner();
    function axisTrigger(payload, ecModel, api2) {
      var currTrigger = payload.currTrigger;
      var point = [payload.x, payload.y];
      var finder = payload;
      var dispatchAction2 = payload.dispatchAction || bind$2(api2.dispatchAction, api2);
      var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
      if (!coordSysAxesInfo) {
        return;
      }
      if (illegalPoint(point)) {
        point = findPointFromSeries({
          seriesIndex: finder.seriesIndex,
          // Do not use dataIndexInside from other ec instance.
          // FIXME: auto detect it?
          dataIndex: finder.dataIndex
        }, ecModel).point;
      }
      var isIllegalPoint = illegalPoint(point);
      var inputAxesInfo = finder.axesInfo;
      var axesInfo = coordSysAxesInfo.axesInfo;
      var shouldHide = currTrigger === "leave" || illegalPoint(point);
      var outputPayload = {};
      var showValueMap = {};
      var dataByCoordSys = {
        list: [],
        map: {}
      };
      var updaters = {
        showPointer: curry$1(showPointer, showValueMap),
        showTooltip: curry$1(showTooltip, dataByCoordSys)
      };
      each$f(coordSysAxesInfo.coordSysMap, function(coordSys, coordSysKey) {
        var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point);
        each$f(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function(axisInfo, key) {
          var axis = axisInfo.axis;
          var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo);
          if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) {
            var val = inputAxisInfo && inputAxisInfo.value;
            if (val == null && !isIllegalPoint) {
              val = axis.pointToData(point);
            }
            val != null && processOnAxis(axisInfo, val, updaters, false, outputPayload);
          }
        });
      });
      var linkTriggers = {};
      each$f(axesInfo, function(tarAxisInfo, tarKey) {
        var linkGroup = tarAxisInfo.linkGroup;
        if (linkGroup && !showValueMap[tarKey]) {
          each$f(linkGroup.axesInfo, function(srcAxisInfo, srcKey) {
            var srcValItem = showValueMap[srcKey];
            if (srcAxisInfo !== tarAxisInfo && srcValItem) {
              var val = srcValItem.value;
              linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper(val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo))));
              linkTriggers[tarAxisInfo.key] = val;
            }
          });
        }
      });
      each$f(linkTriggers, function(val, tarKey) {
        processOnAxis(axesInfo[tarKey], val, updaters, true, outputPayload);
      });
      updateModelActually(showValueMap, axesInfo, outputPayload);
      dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction2);
      dispatchHighDownActually(axesInfo, dispatchAction2, api2);
      return outputPayload;
    }
    function processOnAxis(axisInfo, newValue, updaters, noSnap, outputFinder) {
      var axis = axisInfo.axis;
      if (axis.scale.isBlank() || !axis.containData(newValue)) {
        return;
      }
      if (!axisInfo.involveSeries) {
        updaters.showPointer(axisInfo, newValue);
        return;
      }
      var payloadInfo = buildPayloadsBySeries(newValue, axisInfo);
      var payloadBatch = payloadInfo.payloadBatch;
      var snapToValue = payloadInfo.snapToValue;
      if (payloadBatch[0] && outputFinder.seriesIndex == null) {
        extend$1(outputFinder, payloadBatch[0]);
      }
      if (!noSnap && axisInfo.snap) {
        if (axis.containData(snapToValue) && snapToValue != null) {
          newValue = snapToValue;
        }
      }
      updaters.showPointer(axisInfo, newValue, payloadBatch);
      updaters.showTooltip(axisInfo, payloadInfo, snapToValue);
    }
    function buildPayloadsBySeries(value, axisInfo) {
      var axis = axisInfo.axis;
      var dim = axis.dim;
      var snapToValue = value;
      var payloadBatch = [];
      var minDist = Number.MAX_VALUE;
      var minDiff = -1;
      each$f(axisInfo.seriesModels, function(series, idx) {
        var dataDim = series.getData().mapDimensionsAll(dim);
        var seriesNestestValue;
        var dataIndices;
        if (series.getAxisTooltipData) {
          var result = series.getAxisTooltipData(dataDim, value, axis);
          dataIndices = result.dataIndices;
          seriesNestestValue = result.nestestValue;
        } else {
          dataIndices = series.getData().indicesOfNearest(
            dataDim[0],
            value,
            // Add a threshold to avoid find the wrong dataIndex
            // when data length is not same.
            // false,
            axis.type === "category" ? 0.5 : null
          );
          if (!dataIndices.length) {
            return;
          }
          seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]);
        }
        if (seriesNestestValue == null || !isFinite(seriesNestestValue)) {
          return;
        }
        var diff = value - seriesNestestValue;
        var dist2 = Math.abs(diff);
        if (dist2 <= minDist) {
          if (dist2 < minDist || diff >= 0 && minDiff < 0) {
            minDist = dist2;
            minDiff = diff;
            snapToValue = seriesNestestValue;
            payloadBatch.length = 0;
          }
          each$f(dataIndices, function(dataIndex) {
            payloadBatch.push({
              seriesIndex: series.seriesIndex,
              dataIndexInside: dataIndex,
              dataIndex: series.getData().getRawIndex(dataIndex)
            });
          });
        }
      });
      return {
        payloadBatch,
        snapToValue
      };
    }
    function showPointer(showValueMap, axisInfo, value, payloadBatch) {
      showValueMap[axisInfo.key] = {
        value,
        payloadBatch
      };
    }
    function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) {
      var payloadBatch = payloadInfo.payloadBatch;
      var axis = axisInfo.axis;
      var axisModel = axis.model;
      var axisPointerModel = axisInfo.axisPointerModel;
      if (!axisInfo.triggerTooltip || !payloadBatch.length) {
        return;
      }
      var coordSysModel = axisInfo.coordSys.model;
      var coordSysKey = makeKey(coordSysModel);
      var coordSysItem = dataByCoordSys.map[coordSysKey];
      if (!coordSysItem) {
        coordSysItem = dataByCoordSys.map[coordSysKey] = {
          coordSysId: coordSysModel.id,
          coordSysIndex: coordSysModel.componentIndex,
          coordSysType: coordSysModel.type,
          coordSysMainType: coordSysModel.mainType,
          dataByAxis: []
        };
        dataByCoordSys.list.push(coordSysItem);
      }
      coordSysItem.dataByAxis.push({
        axisDim: axis.dim,
        axisIndex: axisModel.componentIndex,
        axisType: axisModel.type,
        axisId: axisModel.id,
        value,
        // Caustion: viewHelper.getValueLabel is actually on "view stage", which
        // depends that all models have been updated. So it should not be performed
        // here. Considering axisPointerModel used here is volatile, which is hard
        // to be retrieve in TooltipView, we prepare parameters here.
        valueLabelOpt: {
          precision: axisPointerModel.get(["label", "precision"]),
          formatter: axisPointerModel.get(["label", "formatter"])
        },
        seriesDataIndices: payloadBatch.slice()
      });
    }
    function updateModelActually(showValueMap, axesInfo, outputPayload) {
      var outputAxesInfo = outputPayload.axesInfo = [];
      each$f(axesInfo, function(axisInfo, key) {
        var option = axisInfo.axisPointerModel.option;
        var valItem = showValueMap[key];
        if (valItem) {
          !axisInfo.useHandle && (option.status = "show");
          option.value = valItem.value;
          option.seriesDataIndices = (valItem.payloadBatch || []).slice();
        } else {
          !axisInfo.useHandle && (option.status = "hide");
        }
        option.status === "show" && outputAxesInfo.push({
          axisDim: axisInfo.axis.dim,
          axisIndex: axisInfo.axis.model.componentIndex,
          value: option.value
        });
      });
    }
    function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction2) {
      if (illegalPoint(point) || !dataByCoordSys.list.length) {
        dispatchAction2({
          type: "hideTip"
        });
        return;
      }
      var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
      dispatchAction2({
        type: "showTip",
        escapeConnect: true,
        x: point[0],
        y: point[1],
        tooltipOption: payload.tooltipOption,
        position: payload.position,
        dataIndexInside: sampleItem.dataIndexInside,
        dataIndex: sampleItem.dataIndex,
        seriesIndex: sampleItem.seriesIndex,
        dataByCoordSys: dataByCoordSys.list
      });
    }
    function dispatchHighDownActually(axesInfo, dispatchAction2, api2) {
      var zr = api2.getZr();
      var highDownKey = "axisPointerLastHighlights";
      var lastHighlights = inner$9(zr)[highDownKey] || {};
      var newHighlights = inner$9(zr)[highDownKey] = {};
      each$f(axesInfo, function(axisInfo, key) {
        var option = axisInfo.axisPointerModel.option;
        option.status === "show" && axisInfo.triggerEmphasis && each$f(option.seriesDataIndices, function(batchItem) {
          var key2 = batchItem.seriesIndex + " | " + batchItem.dataIndex;
          newHighlights[key2] = batchItem;
        });
      });
      var toHighlight = [];
      var toDownplay = [];
      each$f(lastHighlights, function(batchItem, key) {
        !newHighlights[key] && toDownplay.push(batchItem);
      });
      each$f(newHighlights, function(batchItem, key) {
        !lastHighlights[key] && toHighlight.push(batchItem);
      });
      toDownplay.length && api2.dispatchAction({
        type: "downplay",
        escapeConnect: true,
        // Not blur others when highlight in axisPointer.
        notBlur: true,
        batch: toDownplay
      });
      toHighlight.length && api2.dispatchAction({
        type: "highlight",
        escapeConnect: true,
        // Not blur others when highlight in axisPointer.
        notBlur: true,
        batch: toHighlight
      });
    }
    function findInputAxisInfo(inputAxesInfo, axisInfo) {
      for (var i2 = 0; i2 < (inputAxesInfo || []).length; i2++) {
        var inputAxisInfo = inputAxesInfo[i2];
        if (axisInfo.axis.dim === inputAxisInfo.axisDim && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex) {
          return inputAxisInfo;
        }
      }
    }
    function makeMapperParam(axisInfo) {
      var axisModel = axisInfo.axis.model;
      var item = {};
      var dim = item.axisDim = axisInfo.axis.dim;
      item.axisIndex = item[dim + "AxisIndex"] = axisModel.componentIndex;
      item.axisName = item[dim + "AxisName"] = axisModel.name;
      item.axisId = item[dim + "AxisId"] = axisModel.id;
      return item;
    }
    function illegalPoint(point) {
      return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]);
    }
    function install$q(registers) {
      AxisView.registerAxisPointerClass("CartesianAxisPointer", CartesianAxisPointer);
      registers.registerComponentModel(AxisPointerModel);
      registers.registerComponentView(AxisPointerView);
      registers.registerPreprocessor(function(option) {
        if (option) {
          (!option.axisPointer || option.axisPointer.length === 0) && (option.axisPointer = {});
          var link = option.axisPointer.link;
          if (link && !isArray$2(link)) {
            option.axisPointer.link = [link];
          }
        }
      });
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.STATISTIC, function(ecModel, api2) {
        ecModel.getComponent("axisPointer").coordSysAxesInfo = collect(ecModel, api2);
      });
      registers.registerAction({
        type: "updateAxisPointer",
        event: "updateAxisPointer",
        update: ":updateAxisPointer"
      }, axisTrigger);
    }
    function install$p(registers) {
      use(install$N);
      use(install$q);
    }
    var PolarAxisPointer = (
      /** @class */
      function(_super) {
        __extends$1(PolarAxisPointer2, _super);
        function PolarAxisPointer2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        PolarAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api2) {
          var axis = axisModel.axis;
          if (axis.dim === "angle") {
            this.animationThreshold = Math.PI / 18;
          }
          var polar = axis.polar;
          var otherAxis = polar.getOtherAxis(axis);
          var otherExtent = otherAxis.getExtent();
          var coordValue = axis.dataToCoord(value);
          var axisPointerType = axisPointerModel.get("type");
          if (axisPointerType && axisPointerType !== "none") {
            var elStyle = buildElStyle(axisPointerModel);
            var pointerOption = pointerShapeBuilder$1[axisPointerType](axis, polar, coordValue, otherExtent);
            pointerOption.style = elStyle;
            elOption.graphicKey = pointerOption.type;
            elOption.pointer = pointerOption;
          }
          var labelMargin = axisPointerModel.get(["label", "margin"]);
          var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin);
          buildLabelElOption(elOption, axisModel, axisPointerModel, api2, labelPos);
        };
        return PolarAxisPointer2;
      }(BaseAxisPointer)
    );
    function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) {
      var axis = axisModel.axis;
      var coord = axis.dataToCoord(value);
      var axisAngle = polar.getAngleAxis().getExtent()[0];
      axisAngle = axisAngle / 180 * Math.PI;
      var radiusExtent = polar.getRadiusAxis().getExtent();
      var position2;
      var align;
      var verticalAlign;
      if (axis.dim === "radius") {
        var transform2 = create$1();
        rotate(transform2, transform2, axisAngle);
        translate(transform2, transform2, [polar.cx, polar.cy]);
        position2 = applyTransform([coord, -labelMargin], transform2);
        var labelRotation = axisModel.getModel("axisLabel").get("rotate") || 0;
        var labelLayout2 = AxisBuilder.innerTextLayout(axisAngle, labelRotation * Math.PI / 180, -1);
        align = labelLayout2.textAlign;
        verticalAlign = labelLayout2.textVerticalAlign;
      } else {
        var r = radiusExtent[1];
        position2 = polar.coordToPoint([r + labelMargin, coord]);
        var cx = polar.cx;
        var cy = polar.cy;
        align = Math.abs(position2[0] - cx) / r < 0.3 ? "center" : position2[0] > cx ? "left" : "right";
        verticalAlign = Math.abs(position2[1] - cy) / r < 0.3 ? "middle" : position2[1] > cy ? "top" : "bottom";
      }
      return {
        position: position2,
        align,
        verticalAlign
      };
    }
    var pointerShapeBuilder$1 = {
      line: function(axis, polar, coordValue, otherExtent) {
        return axis.dim === "angle" ? {
          type: "Line",
          shape: makeLineShape(polar.coordToPoint([otherExtent[0], coordValue]), polar.coordToPoint([otherExtent[1], coordValue]))
        } : {
          type: "Circle",
          shape: {
            cx: polar.cx,
            cy: polar.cy,
            r: coordValue
          }
        };
      },
      shadow: function(axis, polar, coordValue, otherExtent) {
        var bandWidth = Math.max(1, axis.getBandWidth());
        var radian = Math.PI / 180;
        return axis.dim === "angle" ? {
          type: "Sector",
          shape: makeSectorShape(
            polar.cx,
            polar.cy,
            otherExtent[0],
            otherExtent[1],
            // In ECharts y is negative if angle is positive
            (-coordValue - bandWidth / 2) * radian,
            (-coordValue + bandWidth / 2) * radian
          )
        } : {
          type: "Sector",
          shape: makeSectorShape(polar.cx, polar.cy, coordValue - bandWidth / 2, coordValue + bandWidth / 2, 0, Math.PI * 2)
        };
      }
    };
    var PolarModel = (
      /** @class */
      function(_super) {
        __extends$1(PolarModel2, _super);
        function PolarModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PolarModel2.type;
          return _this;
        }
        PolarModel2.prototype.findAxisModel = function(axisType) {
          var foundAxisModel;
          var ecModel = this.ecModel;
          ecModel.eachComponent(axisType, function(axisModel) {
            if (axisModel.getCoordSysModel() === this) {
              foundAxisModel = axisModel;
            }
          }, this);
          return foundAxisModel;
        };
        PolarModel2.type = "polar";
        PolarModel2.dependencies = ["radiusAxis", "angleAxis"];
        PolarModel2.defaultOption = {
          // zlevel: 0,
          z: 0,
          center: ["50%", "50%"],
          radius: "80%"
        };
        return PolarModel2;
      }(ComponentModel)
    );
    var PolarAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(PolarAxisModel2, _super);
        function PolarAxisModel2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        PolarAxisModel2.prototype.getCoordSysModel = function() {
          return this.getReferringComponents("polar", SINGLE_REFERRING).models[0];
        };
        PolarAxisModel2.type = "polarAxis";
        return PolarAxisModel2;
      }(ComponentModel)
    );
    mixin(PolarAxisModel, AxisModelCommonMixin);
    var AngleAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(AngleAxisModel2, _super);
        function AngleAxisModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = AngleAxisModel2.type;
          return _this;
        }
        AngleAxisModel2.type = "angleAxis";
        return AngleAxisModel2;
      }(PolarAxisModel)
    );
    var RadiusAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(RadiusAxisModel2, _super);
        function RadiusAxisModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadiusAxisModel2.type;
          return _this;
        }
        RadiusAxisModel2.type = "radiusAxis";
        return RadiusAxisModel2;
      }(PolarAxisModel)
    );
    var RadiusAxis = (
      /** @class */
      function(_super) {
        __extends$1(RadiusAxis2, _super);
        function RadiusAxis2(scale2, radiusExtent) {
          return _super.call(this, "radius", scale2, radiusExtent) || this;
        }
        RadiusAxis2.prototype.pointToData = function(point, clamp2) {
          return this.polar.pointToData(point, clamp2)[this.dim === "radius" ? 0 : 1];
        };
        return RadiusAxis2;
      }(Axis)
    );
    RadiusAxis.prototype.dataToRadius = Axis.prototype.dataToCoord;
    RadiusAxis.prototype.radiusToData = Axis.prototype.coordToData;
    var inner$8 = makeInner();
    var AngleAxis = (
      /** @class */
      function(_super) {
        __extends$1(AngleAxis2, _super);
        function AngleAxis2(scale2, angleExtent) {
          return _super.call(this, "angle", scale2, angleExtent || [0, 360]) || this;
        }
        AngleAxis2.prototype.pointToData = function(point, clamp2) {
          return this.polar.pointToData(point, clamp2)[this.dim === "radius" ? 0 : 1];
        };
        AngleAxis2.prototype.calculateCategoryInterval = function() {
          var axis = this;
          var labelModel = axis.getLabelModel();
          var ordinalScale = axis.scale;
          var ordinalExtent = ordinalScale.getExtent();
          var tickCount = ordinalScale.count();
          if (ordinalExtent[1] - ordinalExtent[0] < 1) {
            return 0;
          }
          var tickValue = ordinalExtent[0];
          var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);
          var unitH = Math.abs(unitSpan);
          var rect = getBoundingRect(tickValue == null ? "" : tickValue + "", labelModel.getFont(), "center", "top");
          var maxH = Math.max(rect.height, 7);
          var dh = maxH / unitH;
          isNaN(dh) && (dh = Infinity);
          var interval = Math.max(0, Math.floor(dh));
          var cache2 = inner$8(axis.model);
          var lastAutoInterval = cache2.lastAutoInterval;
          var lastTickCount = cache2.lastTickCount;
          if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 && lastAutoInterval > interval) {
            interval = lastAutoInterval;
          } else {
            cache2.lastTickCount = tickCount;
            cache2.lastAutoInterval = interval;
          }
          return interval;
        };
        return AngleAxis2;
      }(Axis)
    );
    AngleAxis.prototype.dataToAngle = Axis.prototype.dataToCoord;
    AngleAxis.prototype.angleToData = Axis.prototype.coordToData;
    var polarDimensions = ["radius", "angle"];
    var Polar = (
      /** @class */
      function() {
        function Polar2(name) {
          this.dimensions = polarDimensions;
          this.type = "polar";
          this.cx = 0;
          this.cy = 0;
          this._radiusAxis = new RadiusAxis();
          this._angleAxis = new AngleAxis();
          this.axisPointerEnabled = true;
          this.name = name || "";
          this._radiusAxis.polar = this._angleAxis.polar = this;
        }
        Polar2.prototype.containPoint = function(point) {
          var coord = this.pointToCoord(point);
          return this._radiusAxis.contain(coord[0]) && this._angleAxis.contain(coord[1]);
        };
        Polar2.prototype.containData = function(data) {
          return this._radiusAxis.containData(data[0]) && this._angleAxis.containData(data[1]);
        };
        Polar2.prototype.getAxis = function(dim) {
          var key = "_" + dim + "Axis";
          return this[key];
        };
        Polar2.prototype.getAxes = function() {
          return [this._radiusAxis, this._angleAxis];
        };
        Polar2.prototype.getAxesByScale = function(scaleType) {
          var axes = [];
          var angleAxis = this._angleAxis;
          var radiusAxis = this._radiusAxis;
          angleAxis.scale.type === scaleType && axes.push(angleAxis);
          radiusAxis.scale.type === scaleType && axes.push(radiusAxis);
          return axes;
        };
        Polar2.prototype.getAngleAxis = function() {
          return this._angleAxis;
        };
        Polar2.prototype.getRadiusAxis = function() {
          return this._radiusAxis;
        };
        Polar2.prototype.getOtherAxis = function(axis) {
          var angleAxis = this._angleAxis;
          return axis === angleAxis ? this._radiusAxis : angleAxis;
        };
        Polar2.prototype.getBaseAxis = function() {
          return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis();
        };
        Polar2.prototype.getTooltipAxes = function(dim) {
          var baseAxis = dim != null && dim !== "auto" ? this.getAxis(dim) : this.getBaseAxis();
          return {
            baseAxes: [baseAxis],
            otherAxes: [this.getOtherAxis(baseAxis)]
          };
        };
        Polar2.prototype.dataToPoint = function(data, clamp2) {
          return this.coordToPoint([this._radiusAxis.dataToRadius(data[0], clamp2), this._angleAxis.dataToAngle(data[1], clamp2)]);
        };
        Polar2.prototype.pointToData = function(point, clamp2) {
          var coord = this.pointToCoord(point);
          return [this._radiusAxis.radiusToData(coord[0], clamp2), this._angleAxis.angleToData(coord[1], clamp2)];
        };
        Polar2.prototype.pointToCoord = function(point) {
          var dx = point[0] - this.cx;
          var dy = point[1] - this.cy;
          var angleAxis = this.getAngleAxis();
          var extent3 = angleAxis.getExtent();
          var minAngle = Math.min(extent3[0], extent3[1]);
          var maxAngle = Math.max(extent3[0], extent3[1]);
          angleAxis.inverse ? minAngle = maxAngle - 360 : maxAngle = minAngle + 360;
          var radius = Math.sqrt(dx * dx + dy * dy);
          dx /= radius;
          dy /= radius;
          var radian = Math.atan2(-dy, dx) / Math.PI * 180;
          var dir3 = radian < minAngle ? 1 : -1;
          while (radian < minAngle || radian > maxAngle) {
            radian += dir3 * 360;
          }
          return [radius, radian];
        };
        Polar2.prototype.coordToPoint = function(coord) {
          var radius = coord[0];
          var radian = coord[1] / 180 * Math.PI;
          var x2 = Math.cos(radian) * radius + this.cx;
          var y = -Math.sin(radian) * radius + this.cy;
          return [x2, y];
        };
        Polar2.prototype.getArea = function() {
          var angleAxis = this.getAngleAxis();
          var radiusAxis = this.getRadiusAxis();
          var radiusExtent = radiusAxis.getExtent().slice();
          radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse();
          var angleExtent = angleAxis.getExtent();
          var RADIAN2 = Math.PI / 180;
          var EPSILON2 = 1e-4;
          return {
            cx: this.cx,
            cy: this.cy,
            r0: radiusExtent[0],
            r: radiusExtent[1],
            startAngle: -angleExtent[0] * RADIAN2,
            endAngle: -angleExtent[1] * RADIAN2,
            clockwise: angleAxis.inverse,
            contain: function(x2, y) {
              var dx = x2 - this.cx;
              var dy = y - this.cy;
              var d2 = dx * dx + dy * dy;
              var r = this.r;
              var r0 = this.r0;
              return r !== r0 && d2 - EPSILON2 <= r * r && d2 + EPSILON2 >= r0 * r0;
            }
          };
        };
        Polar2.prototype.convertToPixel = function(ecModel, finder, value) {
          var coordSys = getCoordSys$2(finder);
          return coordSys === this ? this.dataToPoint(value) : null;
        };
        Polar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          var coordSys = getCoordSys$2(finder);
          return coordSys === this ? this.pointToData(pixel) : null;
        };
        return Polar2;
      }()
    );
    function getCoordSys$2(finder) {
      var seriesModel = finder.seriesModel;
      var polarModel = finder.polarModel;
      return polarModel && polarModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
    }
    function resizePolar(polar, polarModel, api2) {
      var center2 = polarModel.get("center");
      var width = api2.getWidth();
      var height = api2.getHeight();
      polar.cx = parsePercent(center2[0], width);
      polar.cy = parsePercent(center2[1], height);
      var radiusAxis = polar.getRadiusAxis();
      var size = Math.min(width, height) / 2;
      var radius = polarModel.get("radius");
      if (radius == null) {
        radius = [0, "100%"];
      } else if (!isArray$2(radius)) {
        radius = [0, radius];
      }
      var parsedRadius = [parsePercent(radius[0], size), parsePercent(radius[1], size)];
      radiusAxis.inverse ? radiusAxis.setExtent(parsedRadius[1], parsedRadius[0]) : radiusAxis.setExtent(parsedRadius[0], parsedRadius[1]);
    }
    function updatePolarScale(ecModel, api2) {
      var polar = this;
      var angleAxis = polar.getAngleAxis();
      var radiusAxis = polar.getRadiusAxis();
      angleAxis.scale.setExtent(Infinity, -Infinity);
      radiusAxis.scale.setExtent(Infinity, -Infinity);
      ecModel.eachSeries(function(seriesModel) {
        if (seriesModel.coordinateSystem === polar) {
          var data_1 = seriesModel.getData();
          each$f(getDataDimensionsOnAxis(data_1, "radius"), function(dim) {
            radiusAxis.scale.unionExtentFromData(data_1, dim);
          });
          each$f(getDataDimensionsOnAxis(data_1, "angle"), function(dim) {
            angleAxis.scale.unionExtentFromData(data_1, dim);
          });
        }
      });
      niceScaleExtent(angleAxis.scale, angleAxis.model);
      niceScaleExtent(radiusAxis.scale, radiusAxis.model);
      if (angleAxis.type === "category" && !angleAxis.onBand) {
        var extent3 = angleAxis.getExtent();
        var diff = 360 / angleAxis.scale.count();
        angleAxis.inverse ? extent3[1] += diff : extent3[1] -= diff;
        angleAxis.setExtent(extent3[0], extent3[1]);
      }
    }
    function isAngleAxisModel(axisModel) {
      return axisModel.mainType === "angleAxis";
    }
    function setAxis(axis, axisModel) {
      var _a2;
      axis.type = axisModel.get("type");
      axis.scale = createScaleByModel$1(axisModel);
      axis.onBand = axisModel.get("boundaryGap") && axis.type === "category";
      axis.inverse = axisModel.get("inverse");
      if (isAngleAxisModel(axisModel)) {
        axis.inverse = axis.inverse !== axisModel.get("clockwise");
        var startAngle = axisModel.get("startAngle");
        var endAngle = (_a2 = axisModel.get("endAngle")) !== null && _a2 !== void 0 ? _a2 : startAngle + (axis.inverse ? -360 : 360);
        axis.setExtent(startAngle, endAngle);
      }
      axisModel.axis = axis;
      axis.model = axisModel;
    }
    var polarCreator = {
      dimensions: polarDimensions,
      create: function(ecModel, api2) {
        var polarList = [];
        ecModel.eachComponent("polar", function(polarModel, idx) {
          var polar = new Polar(idx + "");
          polar.update = updatePolarScale;
          var radiusAxis = polar.getRadiusAxis();
          var angleAxis = polar.getAngleAxis();
          var radiusAxisModel = polarModel.findAxisModel("radiusAxis");
          var angleAxisModel = polarModel.findAxisModel("angleAxis");
          setAxis(radiusAxis, radiusAxisModel);
          setAxis(angleAxis, angleAxisModel);
          resizePolar(polar, polarModel, api2);
          polarList.push(polar);
          polarModel.coordinateSystem = polar;
          polar.model = polarModel;
        });
        ecModel.eachSeries(function(seriesModel) {
          if (seriesModel.get("coordinateSystem") === "polar") {
            var polarModel = seriesModel.getReferringComponents("polar", SINGLE_REFERRING).models[0];
            seriesModel.coordinateSystem = polarModel.coordinateSystem;
          }
        });
        return polarList;
      }
    };
    var elementList = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];
    function getAxisLineShape(polar, rExtent, angle2) {
      rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse());
      var start2 = polar.coordToPoint([rExtent[0], angle2]);
      var end2 = polar.coordToPoint([rExtent[1], angle2]);
      return {
        x1: start2[0],
        y1: start2[1],
        x2: end2[0],
        y2: end2[1]
      };
    }
    function getRadiusIdx(polar) {
      var radiusAxis = polar.getRadiusAxis();
      return radiusAxis.inverse ? 0 : 1;
    }
    function fixAngleOverlap(list) {
      var firstItem = list[0];
      var lastItem = list[list.length - 1];
      if (firstItem && lastItem && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4) {
        list.pop();
      }
    }
    var AngleAxisView = (
      /** @class */
      function(_super) {
        __extends$1(AngleAxisView2, _super);
        function AngleAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = AngleAxisView2.type;
          _this.axisPointerClass = "PolarAxisPointer";
          return _this;
        }
        AngleAxisView2.prototype.render = function(angleAxisModel, ecModel) {
          this.group.removeAll();
          if (!angleAxisModel.get("show")) {
            return;
          }
          var angleAxis = angleAxisModel.axis;
          var polar = angleAxis.polar;
          var radiusExtent = polar.getRadiusAxis().getExtent();
          var ticksAngles = angleAxis.getTicksCoords();
          var minorTickAngles = angleAxis.getMinorTicksCoords();
          var labels = map$1(angleAxis.getViewLabels(), function(labelItem) {
            labelItem = clone$4(labelItem);
            var scale2 = angleAxis.scale;
            var tickValue = scale2.type === "ordinal" ? scale2.getRawOrdinalNumber(labelItem.tickValue) : labelItem.tickValue;
            labelItem.coord = angleAxis.dataToCoord(tickValue);
            return labelItem;
          });
          fixAngleOverlap(labels);
          fixAngleOverlap(ticksAngles);
          each$f(elementList, function(name) {
            if (angleAxisModel.get([name, "show"]) && (!angleAxis.scale.isBlank() || name === "axisLine")) {
              angelAxisElementsBuilders[name](this.group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels);
            }
          }, this);
        };
        AngleAxisView2.type = "angleAxis";
        return AngleAxisView2;
      }(AxisView)
    );
    var angelAxisElementsBuilders = {
      axisLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
        var lineStyleModel = angleAxisModel.getModel(["axisLine", "lineStyle"]);
        var angleAxis = polar.getAngleAxis();
        var RADIAN2 = Math.PI / 180;
        var angleExtent = angleAxis.getExtent();
        var rId = getRadiusIdx(polar);
        var r0Id = rId ? 0 : 1;
        var shape;
        var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? "Circle" : "Arc";
        if (radiusExtent[r0Id] === 0) {
          shape = new graphic[shapeType]({
            shape: {
              cx: polar.cx,
              cy: polar.cy,
              r: radiusExtent[rId],
              startAngle: -angleExtent[0] * RADIAN2,
              endAngle: -angleExtent[1] * RADIAN2,
              clockwise: angleAxis.inverse
            },
            style: lineStyleModel.getLineStyle(),
            z2: 1,
            silent: true
          });
        } else {
          shape = new Ring({
            shape: {
              cx: polar.cx,
              cy: polar.cy,
              r: radiusExtent[rId],
              r0: radiusExtent[r0Id]
            },
            style: lineStyleModel.getLineStyle(),
            z2: 1,
            silent: true
          });
        }
        shape.style.fill = null;
        group.add(shape);
      },
      axisTick: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
        var tickModel = angleAxisModel.getModel("axisTick");
        var tickLen = (tickModel.get("inside") ? -1 : 1) * tickModel.get("length");
        var radius = radiusExtent[getRadiusIdx(polar)];
        var lines = map$1(ticksAngles, function(tickAngleItem) {
          return new Line$1({
            shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord)
          });
        });
        group.add(mergePath(lines, {
          style: defaults$1(tickModel.getModel("lineStyle").getLineStyle(), {
            stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
          })
        }));
      },
      minorTick: function(group, angleAxisModel, polar, tickAngles, minorTickAngles, radiusExtent) {
        if (!minorTickAngles.length) {
          return;
        }
        var tickModel = angleAxisModel.getModel("axisTick");
        var minorTickModel = angleAxisModel.getModel("minorTick");
        var tickLen = (tickModel.get("inside") ? -1 : 1) * minorTickModel.get("length");
        var radius = radiusExtent[getRadiusIdx(polar)];
        var lines = [];
        for (var i2 = 0; i2 < minorTickAngles.length; i2++) {
          for (var k2 = 0; k2 < minorTickAngles[i2].length; k2++) {
            lines.push(new Line$1({
              shape: getAxisLineShape(polar, [radius, radius + tickLen], minorTickAngles[i2][k2].coord)
            }));
          }
        }
        group.add(mergePath(lines, {
          style: defaults$1(minorTickModel.getModel("lineStyle").getLineStyle(), defaults$1(tickModel.getLineStyle(), {
            stroke: angleAxisModel.get(["axisLine", "lineStyle", "color"])
          }))
        }));
      },
      axisLabel: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent, labels) {
        var rawCategoryData = angleAxisModel.getCategories(true);
        var commonLabelModel = angleAxisModel.getModel("axisLabel");
        var labelMargin = commonLabelModel.get("margin");
        var triggerEvent2 = angleAxisModel.get("triggerEvent");
        each$f(labels, function(labelItem, idx) {
          var labelModel = commonLabelModel;
          var tickValue = labelItem.tickValue;
          var r = radiusExtent[getRadiusIdx(polar)];
          var p2 = polar.coordToPoint([r + labelMargin, labelItem.coord]);
          var cx = polar.cx;
          var cy = polar.cy;
          var labelTextAlign = Math.abs(p2[0] - cx) / r < 0.3 ? "center" : p2[0] > cx ? "left" : "right";
          var labelTextVerticalAlign = Math.abs(p2[1] - cy) / r < 0.3 ? "middle" : p2[1] > cy ? "top" : "bottom";
          if (rawCategoryData && rawCategoryData[tickValue]) {
            var rawCategoryItem = rawCategoryData[tickValue];
            if (isObject$5(rawCategoryItem) && rawCategoryItem.textStyle) {
              labelModel = new Model(rawCategoryItem.textStyle, commonLabelModel, commonLabelModel.ecModel);
            }
          }
          var textEl = new ZRText({
            silent: AxisBuilder.isLabelSilent(angleAxisModel),
            style: createTextStyle(labelModel, {
              x: p2[0],
              y: p2[1],
              fill: labelModel.getTextColor() || angleAxisModel.get(["axisLine", "lineStyle", "color"]),
              text: labelItem.formattedLabel,
              align: labelTextAlign,
              verticalAlign: labelTextVerticalAlign
            })
          });
          group.add(textEl);
          if (triggerEvent2) {
            var eventData = AxisBuilder.makeAxisEventDataBase(angleAxisModel);
            eventData.targetType = "axisLabel";
            eventData.value = labelItem.rawLabel;
            getECData(textEl).eventData = eventData;
          }
        }, this);
      },
      splitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
        var splitLineModel = angleAxisModel.getModel("splitLine");
        var lineStyleModel = splitLineModel.getModel("lineStyle");
        var lineColors = lineStyleModel.get("color");
        var lineCount = 0;
        lineColors = lineColors instanceof Array ? lineColors : [lineColors];
        var splitLines = [];
        for (var i2 = 0; i2 < ticksAngles.length; i2++) {
          var colorIndex = lineCount++ % lineColors.length;
          splitLines[colorIndex] = splitLines[colorIndex] || [];
          splitLines[colorIndex].push(new Line$1({
            shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i2].coord)
          }));
        }
        for (var i2 = 0; i2 < splitLines.length; i2++) {
          group.add(mergePath(splitLines[i2], {
            style: defaults$1({
              stroke: lineColors[i2 % lineColors.length]
            }, lineStyleModel.getLineStyle()),
            silent: true,
            z: angleAxisModel.get("z")
          }));
        }
      },
      minorSplitLine: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
        if (!minorTickAngles.length) {
          return;
        }
        var minorSplitLineModel = angleAxisModel.getModel("minorSplitLine");
        var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
        var lines = [];
        for (var i2 = 0; i2 < minorTickAngles.length; i2++) {
          for (var k2 = 0; k2 < minorTickAngles[i2].length; k2++) {
            lines.push(new Line$1({
              shape: getAxisLineShape(polar, radiusExtent, minorTickAngles[i2][k2].coord)
            }));
          }
        }
        group.add(mergePath(lines, {
          style: lineStyleModel.getLineStyle(),
          silent: true,
          z: angleAxisModel.get("z")
        }));
      },
      splitArea: function(group, angleAxisModel, polar, ticksAngles, minorTickAngles, radiusExtent) {
        if (!ticksAngles.length) {
          return;
        }
        var splitAreaModel = angleAxisModel.getModel("splitArea");
        var areaStyleModel = splitAreaModel.getModel("areaStyle");
        var areaColors = areaStyleModel.get("color");
        var lineCount = 0;
        areaColors = areaColors instanceof Array ? areaColors : [areaColors];
        var splitAreas = [];
        var RADIAN2 = Math.PI / 180;
        var prevAngle = -ticksAngles[0].coord * RADIAN2;
        var r0 = Math.min(radiusExtent[0], radiusExtent[1]);
        var r1 = Math.max(radiusExtent[0], radiusExtent[1]);
        var clockwise = angleAxisModel.get("clockwise");
        for (var i2 = 1, len2 = ticksAngles.length; i2 <= len2; i2++) {
          var coord = i2 === len2 ? ticksAngles[0].coord : ticksAngles[i2].coord;
          var colorIndex = lineCount++ % areaColors.length;
          splitAreas[colorIndex] = splitAreas[colorIndex] || [];
          splitAreas[colorIndex].push(new Sector({
            shape: {
              cx: polar.cx,
              cy: polar.cy,
              r0,
              r: r1,
              startAngle: prevAngle,
              endAngle: -coord * RADIAN2,
              clockwise
            },
            silent: true
          }));
          prevAngle = -coord * RADIAN2;
        }
        for (var i2 = 0; i2 < splitAreas.length; i2++) {
          group.add(mergePath(splitAreas[i2], {
            style: defaults$1({
              fill: areaColors[i2 % areaColors.length]
            }, areaStyleModel.getAreaStyle()),
            silent: true
          }));
        }
      }
    };
    var axisBuilderAttrs$1 = ["axisLine", "axisTickLabel", "axisName"];
    var selfBuilderAttrs$1 = ["splitLine", "splitArea", "minorSplitLine"];
    var RadiusAxisView = (
      /** @class */
      function(_super) {
        __extends$1(RadiusAxisView2, _super);
        function RadiusAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = RadiusAxisView2.type;
          _this.axisPointerClass = "PolarAxisPointer";
          return _this;
        }
        RadiusAxisView2.prototype.render = function(radiusAxisModel, ecModel) {
          this.group.removeAll();
          if (!radiusAxisModel.get("show")) {
            return;
          }
          var oldAxisGroup = this._axisGroup;
          var newAxisGroup = this._axisGroup = new Group$3();
          this.group.add(newAxisGroup);
          var radiusAxis = radiusAxisModel.axis;
          var polar = radiusAxis.polar;
          var angleAxis = polar.getAngleAxis();
          var ticksCoords = radiusAxis.getTicksCoords();
          var minorTicksCoords = radiusAxis.getMinorTicksCoords();
          var axisAngle = angleAxis.getExtent()[0];
          var radiusExtent = radiusAxis.getExtent();
          var layout2 = layoutAxis(polar, radiusAxisModel, axisAngle);
          var axisBuilder = new AxisBuilder(radiusAxisModel, layout2);
          each$f(axisBuilderAttrs$1, axisBuilder.add, axisBuilder);
          newAxisGroup.add(axisBuilder.getGroup());
          groupTransition(oldAxisGroup, newAxisGroup, radiusAxisModel);
          each$f(selfBuilderAttrs$1, function(name) {
            if (radiusAxisModel.get([name, "show"]) && !radiusAxis.scale.isBlank()) {
              axisElementBuilders$1[name](this.group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords);
            }
          }, this);
        };
        RadiusAxisView2.type = "radiusAxis";
        return RadiusAxisView2;
      }(AxisView)
    );
    var axisElementBuilders$1 = {
      splitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
        var splitLineModel = radiusAxisModel.getModel("splitLine");
        var lineStyleModel = splitLineModel.getModel("lineStyle");
        var lineColors = lineStyleModel.get("color");
        var lineCount = 0;
        var angleAxis = polar.getAngleAxis();
        var RADIAN2 = Math.PI / 180;
        var angleExtent = angleAxis.getExtent();
        var shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? "Circle" : "Arc";
        lineColors = lineColors instanceof Array ? lineColors : [lineColors];
        var splitLines = [];
        for (var i2 = 0; i2 < ticksCoords.length; i2++) {
          var colorIndex = lineCount++ % lineColors.length;
          splitLines[colorIndex] = splitLines[colorIndex] || [];
          splitLines[colorIndex].push(new graphic[shapeType]({
            shape: {
              cx: polar.cx,
              cy: polar.cy,
              // ensure circle radius >= 0
              r: Math.max(ticksCoords[i2].coord, 0),
              startAngle: -angleExtent[0] * RADIAN2,
              endAngle: -angleExtent[1] * RADIAN2,
              clockwise: angleAxis.inverse
            }
          }));
        }
        for (var i2 = 0; i2 < splitLines.length; i2++) {
          group.add(mergePath(splitLines[i2], {
            style: defaults$1({
              stroke: lineColors[i2 % lineColors.length],
              fill: null
            }, lineStyleModel.getLineStyle()),
            silent: true
          }));
        }
      },
      minorSplitLine: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords, minorTicksCoords) {
        if (!minorTicksCoords.length) {
          return;
        }
        var minorSplitLineModel = radiusAxisModel.getModel("minorSplitLine");
        var lineStyleModel = minorSplitLineModel.getModel("lineStyle");
        var lines = [];
        for (var i2 = 0; i2 < minorTicksCoords.length; i2++) {
          for (var k2 = 0; k2 < minorTicksCoords[i2].length; k2++) {
            lines.push(new Circle({
              shape: {
                cx: polar.cx,
                cy: polar.cy,
                r: minorTicksCoords[i2][k2].coord
              }
            }));
          }
        }
        group.add(mergePath(lines, {
          style: defaults$1({
            fill: null
          }, lineStyleModel.getLineStyle()),
          silent: true
        }));
      },
      splitArea: function(group, radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
        if (!ticksCoords.length) {
          return;
        }
        var splitAreaModel = radiusAxisModel.getModel("splitArea");
        var areaStyleModel = splitAreaModel.getModel("areaStyle");
        var areaColors = areaStyleModel.get("color");
        var lineCount = 0;
        areaColors = areaColors instanceof Array ? areaColors : [areaColors];
        var splitAreas = [];
        var prevRadius = ticksCoords[0].coord;
        for (var i2 = 1; i2 < ticksCoords.length; i2++) {
          var colorIndex = lineCount++ % areaColors.length;
          splitAreas[colorIndex] = splitAreas[colorIndex] || [];
          splitAreas[colorIndex].push(new Sector({
            shape: {
              cx: polar.cx,
              cy: polar.cy,
              r0: prevRadius,
              r: ticksCoords[i2].coord,
              startAngle: 0,
              endAngle: Math.PI * 2
            },
            silent: true
          }));
          prevRadius = ticksCoords[i2].coord;
        }
        for (var i2 = 0; i2 < splitAreas.length; i2++) {
          group.add(mergePath(splitAreas[i2], {
            style: defaults$1({
              fill: areaColors[i2 % areaColors.length]
            }, areaStyleModel.getAreaStyle()),
            silent: true
          }));
        }
      }
    };
    function layoutAxis(polar, radiusAxisModel, axisAngle) {
      return {
        position: [polar.cx, polar.cy],
        rotation: axisAngle / 180 * Math.PI,
        labelDirection: -1,
        tickDirection: -1,
        nameDirection: 1,
        labelRotate: radiusAxisModel.getModel("axisLabel").get("rotate"),
        // Over splitLine and splitArea
        z2: 1
      };
    }
    function getSeriesStackId(seriesModel) {
      return seriesModel.get("stack") || "__ec_stack_" + seriesModel.seriesIndex;
    }
    function getAxisKey(polar, axis) {
      return axis.dim + polar.model.componentIndex;
    }
    function barLayoutPolar(seriesType2, ecModel, api2) {
      var lastStackCoords = {};
      var barWidthAndOffset = calRadialBar(filter(ecModel.getSeriesByType(seriesType2), function(seriesModel) {
        return !ecModel.isSeriesFiltered(seriesModel) && seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === "polar";
      }));
      ecModel.eachSeriesByType(seriesType2, function(seriesModel) {
        if (seriesModel.coordinateSystem.type !== "polar") {
          return;
        }
        var data = seriesModel.getData();
        var polar = seriesModel.coordinateSystem;
        var baseAxis = polar.getBaseAxis();
        var axisKey = getAxisKey(polar, baseAxis);
        var stackId = getSeriesStackId(seriesModel);
        var columnLayoutInfo = barWidthAndOffset[axisKey][stackId];
        var columnOffset = columnLayoutInfo.offset;
        var columnWidth = columnLayoutInfo.width;
        var valueAxis2 = polar.getOtherAxis(baseAxis);
        var cx = seriesModel.coordinateSystem.cx;
        var cy = seriesModel.coordinateSystem.cy;
        var barMinHeight = seriesModel.get("barMinHeight") || 0;
        var barMinAngle = seriesModel.get("barMinAngle") || 0;
        lastStackCoords[stackId] = lastStackCoords[stackId] || [];
        var valueDim = data.mapDimension(valueAxis2.dim);
        var baseDim = data.mapDimension(baseAxis.dim);
        var stacked = isDimensionStacked(
          data,
          valueDim
          /* , baseDim */
        );
        var clampLayout = baseAxis.dim !== "radius" || !seriesModel.get("roundCap", true);
        var valueAxisModel = valueAxis2.model;
        var startValue = valueAxisModel.get("startValue");
        var valueAxisStart = valueAxis2.dataToCoord(startValue || 0);
        for (var idx = 0, len2 = data.count(); idx < len2; idx++) {
          var value = data.get(valueDim, idx);
          var baseValue = data.get(baseDim, idx);
          var sign = value >= 0 ? "p" : "n";
          var baseCoord = valueAxisStart;
          if (stacked) {
            if (!lastStackCoords[stackId][baseValue]) {
              lastStackCoords[stackId][baseValue] = {
                p: valueAxisStart,
                n: valueAxisStart
                // Negative stack
              };
            }
            baseCoord = lastStackCoords[stackId][baseValue][sign];
          }
          var r0 = void 0;
          var r = void 0;
          var startAngle = void 0;
          var endAngle = void 0;
          if (valueAxis2.dim === "radius") {
            var radiusSpan = valueAxis2.dataToCoord(value) - valueAxisStart;
            var angle2 = baseAxis.dataToCoord(baseValue);
            if (Math.abs(radiusSpan) < barMinHeight) {
              radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight;
            }
            r0 = baseCoord;
            r = baseCoord + radiusSpan;
            startAngle = angle2 - columnOffset;
            endAngle = startAngle - columnWidth;
            stacked && (lastStackCoords[stackId][baseValue][sign] = r);
          } else {
            var angleSpan = valueAxis2.dataToCoord(value, clampLayout) - valueAxisStart;
            var radius = baseAxis.dataToCoord(baseValue);
            if (Math.abs(angleSpan) < barMinAngle) {
              angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle;
            }
            r0 = radius + columnOffset;
            r = r0 + columnWidth;
            startAngle = baseCoord;
            endAngle = baseCoord + angleSpan;
            stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle);
          }
          data.setItemLayout(idx, {
            cx,
            cy,
            r0,
            r,
            // Consider that positive angle is anti-clockwise,
            // while positive radian of sector is clockwise
            startAngle: -startAngle * Math.PI / 180,
            endAngle: -endAngle * Math.PI / 180,
            /**
             * Keep the same logic with bar in catesion: use end value to
             * control direction. Notice that if clockwise is true (by
             * default), the sector will always draw clockwisely, no matter
             * whether endAngle is greater or less than startAngle.
             */
            clockwise: startAngle >= endAngle
          });
        }
      });
    }
    function calRadialBar(barSeries) {
      var columnsMap = {};
      each$f(barSeries, function(seriesModel, idx) {
        var data = seriesModel.getData();
        var polar = seriesModel.coordinateSystem;
        var baseAxis = polar.getBaseAxis();
        var axisKey = getAxisKey(polar, baseAxis);
        var axisExtent = baseAxis.getExtent();
        var bandWidth = baseAxis.type === "category" ? baseAxis.getBandWidth() : Math.abs(axisExtent[1] - axisExtent[0]) / data.count();
        var columnsOnAxis = columnsMap[axisKey] || {
          bandWidth,
          remainedWidth: bandWidth,
          autoWidthCount: 0,
          categoryGap: "20%",
          gap: "30%",
          stacks: {}
        };
        var stacks = columnsOnAxis.stacks;
        columnsMap[axisKey] = columnsOnAxis;
        var stackId = getSeriesStackId(seriesModel);
        if (!stacks[stackId]) {
          columnsOnAxis.autoWidthCount++;
        }
        stacks[stackId] = stacks[stackId] || {
          width: 0,
          maxWidth: 0
        };
        var barWidth = parsePercent(seriesModel.get("barWidth"), bandWidth);
        var barMaxWidth = parsePercent(seriesModel.get("barMaxWidth"), bandWidth);
        var barGap = seriesModel.get("barGap");
        var barCategoryGap = seriesModel.get("barCategoryGap");
        if (barWidth && !stacks[stackId].width) {
          barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
          stacks[stackId].width = barWidth;
          columnsOnAxis.remainedWidth -= barWidth;
        }
        barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);
        barGap != null && (columnsOnAxis.gap = barGap);
        barCategoryGap != null && (columnsOnAxis.categoryGap = barCategoryGap);
      });
      var result = {};
      each$f(columnsMap, function(columnsOnAxis, coordSysName) {
        result[coordSysName] = {};
        var stacks = columnsOnAxis.stacks;
        var bandWidth = columnsOnAxis.bandWidth;
        var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);
        var barGapPercent = parsePercent(columnsOnAxis.gap, 1);
        var remainedWidth = columnsOnAxis.remainedWidth;
        var autoWidthCount = columnsOnAxis.autoWidthCount;
        var autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
        autoWidth = Math.max(autoWidth, 0);
        each$f(stacks, function(column, stack2) {
          var maxWidth = column.maxWidth;
          if (maxWidth && maxWidth < autoWidth) {
            maxWidth = Math.min(maxWidth, remainedWidth);
            if (column.width) {
              maxWidth = Math.min(maxWidth, column.width);
            }
            remainedWidth -= maxWidth;
            column.width = maxWidth;
            autoWidthCount--;
          }
        });
        autoWidth = (remainedWidth - categoryGap) / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
        autoWidth = Math.max(autoWidth, 0);
        var widthSum = 0;
        var lastColumn;
        each$f(stacks, function(column, idx) {
          if (!column.width) {
            column.width = autoWidth;
          }
          lastColumn = column;
          widthSum += column.width * (1 + barGapPercent);
        });
        if (lastColumn) {
          widthSum -= lastColumn.width * barGapPercent;
        }
        var offset2 = -widthSum / 2;
        each$f(stacks, function(column, stackId) {
          result[coordSysName][stackId] = result[coordSysName][stackId] || {
            offset: offset2,
            width: column.width
          };
          offset2 += column.width * (1 + barGapPercent);
        });
      });
      return result;
    }
    var angleAxisExtraOption = {
      startAngle: 90,
      clockwise: true,
      splitNumber: 12,
      axisLabel: {
        rotate: 0
      }
    };
    var radiusAxisExtraOption = {
      splitNumber: 5
    };
    var PolarView = (
      /** @class */
      function(_super) {
        __extends$1(PolarView2, _super);
        function PolarView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PolarView2.type;
          return _this;
        }
        PolarView2.type = "polar";
        return PolarView2;
      }(ComponentView)
    );
    function install$o(registers) {
      use(install$q);
      AxisView.registerAxisPointerClass("PolarAxisPointer", PolarAxisPointer);
      registers.registerCoordinateSystem("polar", polarCreator);
      registers.registerComponentModel(PolarModel);
      registers.registerComponentView(PolarView);
      axisModelCreator(registers, "angle", AngleAxisModel, angleAxisExtraOption);
      axisModelCreator(registers, "radius", RadiusAxisModel, radiusAxisExtraOption);
      registers.registerComponentView(AngleAxisView);
      registers.registerComponentView(RadiusAxisView);
      registers.registerLayout(curry$1(barLayoutPolar, "bar"));
    }
    function layout$1(axisModel, opt) {
      opt = opt || {};
      var single = axisModel.coordinateSystem;
      var axis = axisModel.axis;
      var layout2 = {};
      var axisPosition = axis.position;
      var orient = axis.orient;
      var rect = single.getRect();
      var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
      var positionMap2 = {
        horizontal: {
          top: rectBound[2],
          bottom: rectBound[3]
        },
        vertical: {
          left: rectBound[0],
          right: rectBound[1]
        }
      };
      layout2.position = [orient === "vertical" ? positionMap2.vertical[axisPosition] : rectBound[0], orient === "horizontal" ? positionMap2.horizontal[axisPosition] : rectBound[3]];
      var r = {
        horizontal: 0,
        vertical: 1
      };
      layout2.rotation = Math.PI / 2 * r[orient];
      var directionMap = {
        top: -1,
        bottom: 1,
        right: 1,
        left: -1
      };
      layout2.labelDirection = layout2.tickDirection = layout2.nameDirection = directionMap[axisPosition];
      if (axisModel.get(["axisTick", "inside"])) {
        layout2.tickDirection = -layout2.tickDirection;
      }
      if (retrieve(opt.labelInside, axisModel.get(["axisLabel", "inside"]))) {
        layout2.labelDirection = -layout2.labelDirection;
      }
      var labelRotation = opt.rotate;
      labelRotation == null && (labelRotation = axisModel.get(["axisLabel", "rotate"]));
      layout2.labelRotation = axisPosition === "top" ? -labelRotation : labelRotation;
      layout2.z2 = 1;
      return layout2;
    }
    var axisBuilderAttrs = ["axisLine", "axisTickLabel", "axisName"];
    var selfBuilderAttrs = ["splitArea", "splitLine"];
    var SingleAxisView = (
      /** @class */
      function(_super) {
        __extends$1(SingleAxisView2, _super);
        function SingleAxisView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SingleAxisView2.type;
          _this.axisPointerClass = "SingleAxisPointer";
          return _this;
        }
        SingleAxisView2.prototype.render = function(axisModel, ecModel, api2, payload) {
          var group = this.group;
          group.removeAll();
          var oldAxisGroup = this._axisGroup;
          this._axisGroup = new Group$3();
          var layout2 = layout$1(axisModel);
          var axisBuilder = new AxisBuilder(axisModel, layout2);
          each$f(axisBuilderAttrs, axisBuilder.add, axisBuilder);
          group.add(this._axisGroup);
          group.add(axisBuilder.getGroup());
          each$f(selfBuilderAttrs, function(name) {
            if (axisModel.get([name, "show"])) {
              axisElementBuilders[name](this, this.group, this._axisGroup, axisModel);
            }
          }, this);
          groupTransition(oldAxisGroup, this._axisGroup, axisModel);
          _super.prototype.render.call(this, axisModel, ecModel, api2, payload);
        };
        SingleAxisView2.prototype.remove = function() {
          rectCoordAxisHandleRemove(this);
        };
        SingleAxisView2.type = "singleAxis";
        return SingleAxisView2;
      }(AxisView)
    );
    var axisElementBuilders = {
      splitLine: function(axisView, group, axisGroup, axisModel) {
        var axis = axisModel.axis;
        if (axis.scale.isBlank()) {
          return;
        }
        var splitLineModel = axisModel.getModel("splitLine");
        var lineStyleModel = splitLineModel.getModel("lineStyle");
        var lineColors = lineStyleModel.get("color");
        lineColors = lineColors instanceof Array ? lineColors : [lineColors];
        var lineWidth = lineStyleModel.get("width");
        var gridRect = axisModel.coordinateSystem.getRect();
        var isHorizontal2 = axis.isHorizontal();
        var splitLines = [];
        var lineCount = 0;
        var ticksCoords = axis.getTicksCoords({
          tickModel: splitLineModel
        });
        var p1 = [];
        var p2 = [];
        for (var i2 = 0; i2 < ticksCoords.length; ++i2) {
          var tickCoord = axis.toGlobalCoord(ticksCoords[i2].coord);
          if (isHorizontal2) {
            p1[0] = tickCoord;
            p1[1] = gridRect.y;
            p2[0] = tickCoord;
            p2[1] = gridRect.y + gridRect.height;
          } else {
            p1[0] = gridRect.x;
            p1[1] = tickCoord;
            p2[0] = gridRect.x + gridRect.width;
            p2[1] = tickCoord;
          }
          var line = new Line$1({
            shape: {
              x1: p1[0],
              y1: p1[1],
              x2: p2[0],
              y2: p2[1]
            },
            silent: true
          });
          subPixelOptimizeLine(line.shape, lineWidth);
          var colorIndex = lineCount++ % lineColors.length;
          splitLines[colorIndex] = splitLines[colorIndex] || [];
          splitLines[colorIndex].push(line);
        }
        var lineStyle = lineStyleModel.getLineStyle(["color"]);
        for (var i2 = 0; i2 < splitLines.length; ++i2) {
          group.add(mergePath(splitLines[i2], {
            style: defaults$1({
              stroke: lineColors[i2 % lineColors.length]
            }, lineStyle),
            silent: true
          }));
        }
      },
      splitArea: function(axisView, group, axisGroup, axisModel) {
        rectCoordAxisBuildSplitArea(axisView, axisGroup, axisModel, axisModel);
      }
    };
    var SingleAxisModel = (
      /** @class */
      function(_super) {
        __extends$1(SingleAxisModel2, _super);
        function SingleAxisModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SingleAxisModel2.type;
          return _this;
        }
        SingleAxisModel2.prototype.getCoordSysModel = function() {
          return this;
        };
        SingleAxisModel2.type = "singleAxis";
        SingleAxisModel2.layoutMode = "box";
        SingleAxisModel2.defaultOption = {
          left: "5%",
          top: "5%",
          right: "5%",
          bottom: "5%",
          type: "value",
          position: "bottom",
          orient: "horizontal",
          axisLine: {
            show: true,
            lineStyle: {
              width: 1,
              type: "solid"
            }
          },
          // Single coordinate system and single axis is the,
          // which is used as the parent tooltip model.
          // same model, so we set default tooltip show as true.
          tooltip: {
            show: true
          },
          axisTick: {
            show: true,
            length: 6,
            lineStyle: {
              width: 1
            }
          },
          axisLabel: {
            show: true,
            interval: "auto"
          },
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
              opacity: 0.2
            }
          }
        };
        return SingleAxisModel2;
      }(ComponentModel)
    );
    mixin(SingleAxisModel, AxisModelCommonMixin.prototype);
    var SingleAxis = (
      /** @class */
      function(_super) {
        __extends$1(SingleAxis2, _super);
        function SingleAxis2(dim, scale2, coordExtent, axisType, position2) {
          var _this = _super.call(this, dim, scale2, coordExtent) || this;
          _this.type = axisType || "value";
          _this.position = position2 || "bottom";
          return _this;
        }
        SingleAxis2.prototype.isHorizontal = function() {
          var position2 = this.position;
          return position2 === "top" || position2 === "bottom";
        };
        SingleAxis2.prototype.pointToData = function(point, clamp2) {
          return this.coordinateSystem.pointToData(point)[0];
        };
        return SingleAxis2;
      }(Axis)
    );
    var singleDimensions = ["single"];
    var Single = (
      /** @class */
      function() {
        function Single2(axisModel, ecModel, api2) {
          this.type = "single";
          this.dimension = "single";
          this.dimensions = singleDimensions;
          this.axisPointerEnabled = true;
          this.model = axisModel;
          this._init(axisModel, ecModel, api2);
        }
        Single2.prototype._init = function(axisModel, ecModel, api2) {
          var dim = this.dimension;
          var axis = new SingleAxis(dim, createScaleByModel$1(axisModel), [0, 0], axisModel.get("type"), axisModel.get("position"));
          var isCategory2 = axis.type === "category";
          axis.onBand = isCategory2 && axisModel.get("boundaryGap");
          axis.inverse = axisModel.get("inverse");
          axis.orient = axisModel.get("orient");
          axisModel.axis = axis;
          axis.model = axisModel;
          axis.coordinateSystem = this;
          this._axis = axis;
        };
        Single2.prototype.update = function(ecModel, api2) {
          ecModel.eachSeries(function(seriesModel) {
            if (seriesModel.coordinateSystem === this) {
              var data_1 = seriesModel.getData();
              each$f(data_1.mapDimensionsAll(this.dimension), function(dim) {
                this._axis.scale.unionExtentFromData(data_1, dim);
              }, this);
              niceScaleExtent(this._axis.scale, this._axis.model);
            }
          }, this);
        };
        Single2.prototype.resize = function(axisModel, api2) {
          this._rect = getLayoutRect({
            left: axisModel.get("left"),
            top: axisModel.get("top"),
            right: axisModel.get("right"),
            bottom: axisModel.get("bottom"),
            width: axisModel.get("width"),
            height: axisModel.get("height")
          }, {
            width: api2.getWidth(),
            height: api2.getHeight()
          });
          this._adjustAxis();
        };
        Single2.prototype.getRect = function() {
          return this._rect;
        };
        Single2.prototype._adjustAxis = function() {
          var rect = this._rect;
          var axis = this._axis;
          var isHorizontal2 = axis.isHorizontal();
          var extent3 = isHorizontal2 ? [0, rect.width] : [0, rect.height];
          var idx = axis.inverse ? 1 : 0;
          axis.setExtent(extent3[idx], extent3[1 - idx]);
          this._updateAxisTransform(axis, isHorizontal2 ? rect.x : rect.y);
        };
        Single2.prototype._updateAxisTransform = function(axis, coordBase) {
          var axisExtent = axis.getExtent();
          var extentSum = axisExtent[0] + axisExtent[1];
          var isHorizontal2 = axis.isHorizontal();
          axis.toGlobalCoord = isHorizontal2 ? function(coord) {
            return coord + coordBase;
          } : function(coord) {
            return extentSum - coord + coordBase;
          };
          axis.toLocalCoord = isHorizontal2 ? function(coord) {
            return coord - coordBase;
          } : function(coord) {
            return extentSum - coord + coordBase;
          };
        };
        Single2.prototype.getAxis = function() {
          return this._axis;
        };
        Single2.prototype.getBaseAxis = function() {
          return this._axis;
        };
        Single2.prototype.getAxes = function() {
          return [this._axis];
        };
        Single2.prototype.getTooltipAxes = function() {
          return {
            baseAxes: [this.getAxis()],
            // Empty otherAxes
            otherAxes: []
          };
        };
        Single2.prototype.containPoint = function(point) {
          var rect = this.getRect();
          var axis = this.getAxis();
          var orient = axis.orient;
          if (orient === "horizontal") {
            return axis.contain(axis.toLocalCoord(point[0])) && point[1] >= rect.y && point[1] <= rect.y + rect.height;
          } else {
            return axis.contain(axis.toLocalCoord(point[1])) && point[0] >= rect.y && point[0] <= rect.y + rect.height;
          }
        };
        Single2.prototype.pointToData = function(point) {
          var axis = this.getAxis();
          return [axis.coordToData(axis.toLocalCoord(point[axis.orient === "horizontal" ? 0 : 1]))];
        };
        Single2.prototype.dataToPoint = function(val) {
          var axis = this.getAxis();
          var rect = this.getRect();
          var pt3 = [];
          var idx = axis.orient === "horizontal" ? 0 : 1;
          if (val instanceof Array) {
            val = val[0];
          }
          pt3[idx] = axis.toGlobalCoord(axis.dataToCoord(+val));
          pt3[1 - idx] = idx === 0 ? rect.y + rect.height / 2 : rect.x + rect.width / 2;
          return pt3;
        };
        Single2.prototype.convertToPixel = function(ecModel, finder, value) {
          var coordSys = getCoordSys$1(finder);
          return coordSys === this ? this.dataToPoint(value) : null;
        };
        Single2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          var coordSys = getCoordSys$1(finder);
          return coordSys === this ? this.pointToData(pixel) : null;
        };
        return Single2;
      }()
    );
    function getCoordSys$1(finder) {
      var seriesModel = finder.seriesModel;
      var singleModel = finder.singleAxisModel;
      return singleModel && singleModel.coordinateSystem || seriesModel && seriesModel.coordinateSystem;
    }
    function create(ecModel, api2) {
      var singles = [];
      ecModel.eachComponent("singleAxis", function(axisModel, idx) {
        var single = new Single(axisModel, ecModel, api2);
        single.name = "single_" + idx;
        single.resize(axisModel, api2);
        axisModel.coordinateSystem = single;
        singles.push(single);
      });
      ecModel.eachSeries(function(seriesModel) {
        if (seriesModel.get("coordinateSystem") === "singleAxis") {
          var singleAxisModel = seriesModel.getReferringComponents("singleAxis", SINGLE_REFERRING).models[0];
          seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem;
        }
      });
      return singles;
    }
    var singleCreator = {
      create,
      dimensions: singleDimensions
    };
    var XY$1 = ["x", "y"];
    var WH$1 = ["width", "height"];
    var SingleAxisPointer = (
      /** @class */
      function(_super) {
        __extends$1(SingleAxisPointer2, _super);
        function SingleAxisPointer2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SingleAxisPointer2.prototype.makeElOption = function(elOption, value, axisModel, axisPointerModel, api2) {
          var axis = axisModel.axis;
          var coordSys = axis.coordinateSystem;
          var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis));
          var pixelValue = coordSys.dataToPoint(value)[0];
          var axisPointerType = axisPointerModel.get("type");
          if (axisPointerType && axisPointerType !== "none") {
            var elStyle = buildElStyle(axisPointerModel);
            var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent);
            pointerOption.style = elStyle;
            elOption.graphicKey = pointerOption.type;
            elOption.pointer = pointerOption;
          }
          var layoutInfo = layout$1(axisModel);
          buildCartesianSingleLabelElOption(
            // @ts-ignore
            value,
            elOption,
            layoutInfo,
            axisModel,
            axisPointerModel,
            api2
          );
        };
        SingleAxisPointer2.prototype.getHandleTransform = function(value, axisModel, axisPointerModel) {
          var layoutInfo = layout$1(axisModel, {
            labelInside: false
          });
          layoutInfo.labelMargin = axisPointerModel.get(["handle", "margin"]);
          var position2 = getTransformedPosition(axisModel.axis, value, layoutInfo);
          return {
            x: position2[0],
            y: position2[1],
            rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)
          };
        };
        SingleAxisPointer2.prototype.updateHandleTransform = function(transform2, delta, axisModel, axisPointerModel) {
          var axis = axisModel.axis;
          var coordSys = axis.coordinateSystem;
          var dimIndex = getPointDimIndex(axis);
          var axisExtent = getGlobalExtent(coordSys, dimIndex);
          var currPosition = [transform2.x, transform2.y];
          currPosition[dimIndex] += delta[dimIndex];
          currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);
          currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);
          var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex);
          var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;
          var cursorPoint = [cursorOtherValue, cursorOtherValue];
          cursorPoint[dimIndex] = currPosition[dimIndex];
          return {
            x: currPosition[0],
            y: currPosition[1],
            rotation: transform2.rotation,
            cursorPoint,
            tooltipOption: {
              verticalAlign: "middle"
            }
          };
        };
        return SingleAxisPointer2;
      }(BaseAxisPointer)
    );
    var pointerShapeBuilder = {
      line: function(axis, pixelValue, otherExtent) {
        var targetShape = makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getPointDimIndex(axis));
        return {
          type: "Line",
          subPixelOptimize: true,
          shape: targetShape
        };
      },
      shadow: function(axis, pixelValue, otherExtent) {
        var bandWidth = axis.getBandWidth();
        var span = otherExtent[1] - otherExtent[0];
        return {
          type: "Rect",
          shape: makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getPointDimIndex(axis))
        };
      }
    };
    function getPointDimIndex(axis) {
      return axis.isHorizontal() ? 0 : 1;
    }
    function getGlobalExtent(coordSys, dimIndex) {
      var rect = coordSys.getRect();
      return [rect[XY$1[dimIndex]], rect[XY$1[dimIndex]] + rect[WH$1[dimIndex]]];
    }
    var SingleView = (
      /** @class */
      function(_super) {
        __extends$1(SingleView2, _super);
        function SingleView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SingleView2.type;
          return _this;
        }
        SingleView2.type = "single";
        return SingleView2;
      }(ComponentView)
    );
    function install$n(registers) {
      use(install$q);
      AxisView.registerAxisPointerClass("SingleAxisPointer", SingleAxisPointer);
      registers.registerComponentView(SingleView);
      registers.registerComponentView(SingleAxisView);
      registers.registerComponentModel(SingleAxisModel);
      axisModelCreator(registers, "single", SingleAxisModel, SingleAxisModel.defaultOption);
      registers.registerCoordinateSystem("single", singleCreator);
    }
    var CalendarModel = (
      /** @class */
      function(_super) {
        __extends$1(CalendarModel2, _super);
        function CalendarModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CalendarModel2.type;
          return _this;
        }
        CalendarModel2.prototype.init = function(option, parentModel, ecModel) {
          var inputPositionParams = getLayoutParams(option);
          _super.prototype.init.apply(this, arguments);
          mergeAndNormalizeLayoutParams$1(option, inputPositionParams);
        };
        CalendarModel2.prototype.mergeOption = function(option) {
          _super.prototype.mergeOption.apply(this, arguments);
          mergeAndNormalizeLayoutParams$1(this.option, option);
        };
        CalendarModel2.prototype.getCellSize = function() {
          return this.option.cellSize;
        };
        CalendarModel2.type = "calendar";
        CalendarModel2.defaultOption = {
          // zlevel: 0,
          z: 2,
          left: 80,
          top: 60,
          cellSize: 20,
          // horizontal vertical
          orient: "horizontal",
          // month separate line style
          splitLine: {
            show: true,
            lineStyle: {
              color: "#000",
              width: 1,
              type: "solid"
            }
          },
          // rect style  temporarily unused emphasis
          itemStyle: {
            color: "#fff",
            borderWidth: 1,
            borderColor: "#ccc"
          },
          // week text style
          dayLabel: {
            show: true,
            firstDay: 0,
            // start end
            position: "start",
            margin: "50%",
            color: "#000"
          },
          // month text style
          monthLabel: {
            show: true,
            // start end
            position: "start",
            margin: 5,
            // center or left
            align: "center",
            formatter: null,
            color: "#000"
          },
          // year text style
          yearLabel: {
            show: true,
            // top bottom left right
            position: null,
            margin: 30,
            formatter: null,
            color: "#ccc",
            fontFamily: "sans-serif",
            fontWeight: "bolder",
            fontSize: 20
          }
        };
        return CalendarModel2;
      }(ComponentModel)
    );
    function mergeAndNormalizeLayoutParams$1(target, raw) {
      var cellSize = target.cellSize;
      var cellSizeArr;
      if (!isArray$2(cellSize)) {
        cellSizeArr = target.cellSize = [cellSize, cellSize];
      } else {
        cellSizeArr = cellSize;
      }
      if (cellSizeArr.length === 1) {
        cellSizeArr[1] = cellSizeArr[0];
      }
      var ignoreSize = map$1([0, 1], function(hvIdx) {
        if (sizeCalculable(raw, hvIdx)) {
          cellSizeArr[hvIdx] = "auto";
        }
        return cellSizeArr[hvIdx] != null && cellSizeArr[hvIdx] !== "auto";
      });
      mergeLayoutParam(target, raw, {
        type: "box",
        ignoreSize
      });
    }
    var CalendarView = (
      /** @class */
      function(_super) {
        __extends$1(CalendarView2, _super);
        function CalendarView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = CalendarView2.type;
          return _this;
        }
        CalendarView2.prototype.render = function(calendarModel, ecModel, api2) {
          var group = this.group;
          group.removeAll();
          var coordSys = calendarModel.coordinateSystem;
          var rangeData = coordSys.getRangeInfo();
          var orient = coordSys.getOrient();
          var localeModel = ecModel.getLocaleModel();
          this._renderDayRect(calendarModel, rangeData, group);
          this._renderLines(calendarModel, rangeData, orient, group);
          this._renderYearText(calendarModel, rangeData, orient, group);
          this._renderMonthText(calendarModel, localeModel, orient, group);
          this._renderWeekText(calendarModel, localeModel, rangeData, orient, group);
        };
        CalendarView2.prototype._renderDayRect = function(calendarModel, rangeData, group) {
          var coordSys = calendarModel.coordinateSystem;
          var itemRectStyleModel = calendarModel.getModel("itemStyle").getItemStyle();
          var sw = coordSys.getCellWidth();
          var sh = coordSys.getCellHeight();
          for (var i2 = rangeData.start.time; i2 <= rangeData.end.time; i2 = coordSys.getNextNDay(i2, 1).time) {
            var point = coordSys.dataToRect([i2], false).tl;
            var rect = new Rect$2({
              shape: {
                x: point[0],
                y: point[1],
                width: sw,
                height: sh
              },
              cursor: "default",
              style: itemRectStyleModel
            });
            group.add(rect);
          }
        };
        CalendarView2.prototype._renderLines = function(calendarModel, rangeData, orient, group) {
          var self2 = this;
          var coordSys = calendarModel.coordinateSystem;
          var lineStyleModel = calendarModel.getModel(["splitLine", "lineStyle"]).getLineStyle();
          var show = calendarModel.get(["splitLine", "show"]);
          var lineWidth = lineStyleModel.lineWidth;
          this._tlpoints = [];
          this._blpoints = [];
          this._firstDayOfMonth = [];
          this._firstDayPoints = [];
          var firstDay = rangeData.start;
          for (var i2 = 0; firstDay.time <= rangeData.end.time; i2++) {
            addPoints(firstDay.formatedDate);
            if (i2 === 0) {
              firstDay = coordSys.getDateInfo(rangeData.start.y + "-" + rangeData.start.m);
            }
            var date = firstDay.date;
            date.setMonth(date.getMonth() + 1);
            firstDay = coordSys.getDateInfo(date);
          }
          addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate);
          function addPoints(date3) {
            self2._firstDayOfMonth.push(coordSys.getDateInfo(date3));
            self2._firstDayPoints.push(coordSys.dataToRect([date3], false).tl);
            var points2 = self2._getLinePointsOfOneWeek(calendarModel, date3, orient);
            self2._tlpoints.push(points2[0]);
            self2._blpoints.push(points2[points2.length - 1]);
            show && self2._drawSplitline(points2, lineStyleModel, group);
          }
          show && this._drawSplitline(self2._getEdgesPoints(self2._tlpoints, lineWidth, orient), lineStyleModel, group);
          show && this._drawSplitline(self2._getEdgesPoints(self2._blpoints, lineWidth, orient), lineStyleModel, group);
        };
        CalendarView2.prototype._getEdgesPoints = function(points2, lineWidth, orient) {
          var rs = [points2[0].slice(), points2[points2.length - 1].slice()];
          var idx = orient === "horizontal" ? 0 : 1;
          rs[0][idx] = rs[0][idx] - lineWidth / 2;
          rs[1][idx] = rs[1][idx] + lineWidth / 2;
          return rs;
        };
        CalendarView2.prototype._drawSplitline = function(points2, lineStyle, group) {
          var poyline = new Polyline$1({
            z2: 20,
            shape: {
              points: points2
            },
            style: lineStyle
          });
          group.add(poyline);
        };
        CalendarView2.prototype._getLinePointsOfOneWeek = function(calendarModel, date, orient) {
          var coordSys = calendarModel.coordinateSystem;
          var parsedDate = coordSys.getDateInfo(date);
          var points2 = [];
          for (var i2 = 0; i2 < 7; i2++) {
            var tmpD = coordSys.getNextNDay(parsedDate.time, i2);
            var point = coordSys.dataToRect([tmpD.time], false);
            points2[2 * tmpD.day] = point.tl;
            points2[2 * tmpD.day + 1] = point[orient === "horizontal" ? "bl" : "tr"];
          }
          return points2;
        };
        CalendarView2.prototype._formatterLabel = function(formatter2, params) {
          if (isString$1(formatter2) && formatter2) {
            return formatTplSimple(formatter2, params);
          }
          if (isFunction$1(formatter2)) {
            return formatter2(params);
          }
          return params.nameMap;
        };
        CalendarView2.prototype._yearTextPositionControl = function(textEl, point, orient, position2, margin) {
          var x2 = point[0];
          var y = point[1];
          var aligns = ["center", "bottom"];
          if (position2 === "bottom") {
            y += margin;
            aligns = ["center", "top"];
          } else if (position2 === "left") {
            x2 -= margin;
          } else if (position2 === "right") {
            x2 += margin;
            aligns = ["center", "top"];
          } else {
            y -= margin;
          }
          var rotate2 = 0;
          if (position2 === "left" || position2 === "right") {
            rotate2 = Math.PI / 2;
          }
          return {
            rotation: rotate2,
            x: x2,
            y,
            style: {
              align: aligns[0],
              verticalAlign: aligns[1]
            }
          };
        };
        CalendarView2.prototype._renderYearText = function(calendarModel, rangeData, orient, group) {
          var yearLabel = calendarModel.getModel("yearLabel");
          if (!yearLabel.get("show")) {
            return;
          }
          var margin = yearLabel.get("margin");
          var pos = yearLabel.get("position");
          if (!pos) {
            pos = orient !== "horizontal" ? "top" : "left";
          }
          var points2 = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]];
          var xc = (points2[0][0] + points2[1][0]) / 2;
          var yc = (points2[0][1] + points2[1][1]) / 2;
          var idx = orient === "horizontal" ? 0 : 1;
          var posPoints = {
            top: [xc, points2[idx][1]],
            bottom: [xc, points2[1 - idx][1]],
            left: [points2[1 - idx][0], yc],
            right: [points2[idx][0], yc]
          };
          var name = rangeData.start.y;
          if (+rangeData.end.y > +rangeData.start.y) {
            name = name + "-" + rangeData.end.y;
          }
          var formatter2 = yearLabel.get("formatter");
          var params = {
            start: rangeData.start.y,
            end: rangeData.end.y,
            nameMap: name
          };
          var content2 = this._formatterLabel(formatter2, params);
          var yearText = new ZRText({
            z2: 30,
            style: createTextStyle(yearLabel, {
              text: content2
            }),
            silent: yearLabel.get("silent")
          });
          yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
          group.add(yearText);
        };
        CalendarView2.prototype._monthTextPositionControl = function(point, isCenter, orient, position2, margin) {
          var align = "left";
          var vAlign = "top";
          var x2 = point[0];
          var y = point[1];
          if (orient === "horizontal") {
            y = y + margin;
            if (isCenter) {
              align = "center";
            }
            if (position2 === "start") {
              vAlign = "bottom";
            }
          } else {
            x2 = x2 + margin;
            if (isCenter) {
              vAlign = "middle";
            }
            if (position2 === "start") {
              align = "right";
            }
          }
          return {
            x: x2,
            y,
            align,
            verticalAlign: vAlign
          };
        };
        CalendarView2.prototype._renderMonthText = function(calendarModel, localeModel, orient, group) {
          var monthLabel = calendarModel.getModel("monthLabel");
          if (!monthLabel.get("show")) {
            return;
          }
          var nameMap = monthLabel.get("nameMap");
          var margin = monthLabel.get("margin");
          var pos = monthLabel.get("position");
          var align = monthLabel.get("align");
          var termPoints = [this._tlpoints, this._blpoints];
          if (!nameMap || isString$1(nameMap)) {
            if (nameMap) {
              localeModel = getLocaleModel(nameMap) || localeModel;
            }
            nameMap = localeModel.get(["time", "monthAbbr"]) || [];
          }
          var idx = pos === "start" ? 0 : 1;
          var axis = orient === "horizontal" ? 0 : 1;
          margin = pos === "start" ? -margin : margin;
          var isCenter = align === "center";
          var labelSilent = monthLabel.get("silent");
          for (var i2 = 0; i2 < termPoints[idx].length - 1; i2++) {
            var tmp = termPoints[idx][i2].slice();
            var firstDay = this._firstDayOfMonth[i2];
            if (isCenter) {
              var firstDayPoints = this._firstDayPoints[i2];
              tmp[axis] = (firstDayPoints[axis] + termPoints[0][i2 + 1][axis]) / 2;
            }
            var formatter2 = monthLabel.get("formatter");
            var name_1 = nameMap[+firstDay.m - 1];
            var params = {
              yyyy: firstDay.y,
              yy: (firstDay.y + "").slice(2),
              MM: firstDay.m,
              M: +firstDay.m,
              nameMap: name_1
            };
            var content2 = this._formatterLabel(formatter2, params);
            var monthText = new ZRText({
              z2: 30,
              style: extend$1(createTextStyle(monthLabel, {
                text: content2
              }), this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)),
              silent: labelSilent
            });
            group.add(monthText);
          }
        };
        CalendarView2.prototype._weekTextPositionControl = function(point, orient, position2, margin, cellSize) {
          var align = "center";
          var vAlign = "middle";
          var x2 = point[0];
          var y = point[1];
          var isStart = position2 === "start";
          if (orient === "horizontal") {
            x2 = x2 + margin + (isStart ? 1 : -1) * cellSize[0] / 2;
            align = isStart ? "right" : "left";
          } else {
            y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2;
            vAlign = isStart ? "bottom" : "top";
          }
          return {
            x: x2,
            y,
            align,
            verticalAlign: vAlign
          };
        };
        CalendarView2.prototype._renderWeekText = function(calendarModel, localeModel, rangeData, orient, group) {
          var dayLabel = calendarModel.getModel("dayLabel");
          if (!dayLabel.get("show")) {
            return;
          }
          var coordSys = calendarModel.coordinateSystem;
          var pos = dayLabel.get("position");
          var nameMap = dayLabel.get("nameMap");
          var margin = dayLabel.get("margin");
          var firstDayOfWeek = coordSys.getFirstDayOfWeek();
          if (!nameMap || isString$1(nameMap)) {
            if (nameMap) {
              localeModel = getLocaleModel(nameMap) || localeModel;
            }
            var dayOfWeekShort = localeModel.get(["time", "dayOfWeekShort"]);
            nameMap = dayOfWeekShort || map$1(localeModel.get(["time", "dayOfWeekAbbr"]), function(val) {
              return val[0];
            });
          }
          var start2 = coordSys.getNextNDay(rangeData.end.time, 7 - rangeData.lweek).time;
          var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()];
          margin = parsePercent(margin, Math.min(cellSize[1], cellSize[0]));
          if (pos === "start") {
            start2 = coordSys.getNextNDay(rangeData.start.time, -(7 + rangeData.fweek)).time;
            margin = -margin;
          }
          var labelSilent = dayLabel.get("silent");
          for (var i2 = 0; i2 < 7; i2++) {
            var tmpD = coordSys.getNextNDay(start2, i2);
            var point = coordSys.dataToRect([tmpD.time], false).center;
            var day = i2;
            day = Math.abs((i2 + firstDayOfWeek) % 7);
            var weekText = new ZRText({
              z2: 30,
              style: extend$1(createTextStyle(dayLabel, {
                text: nameMap[day]
              }), this._weekTextPositionControl(point, orient, pos, margin, cellSize)),
              silent: labelSilent
            });
            group.add(weekText);
          }
        };
        CalendarView2.type = "calendar";
        return CalendarView2;
      }(ComponentView)
    );
    var PROXIMATE_ONE_DAY = 864e5;
    var Calendar = (
      /** @class */
      function() {
        function Calendar2(calendarModel, ecModel, api2) {
          this.type = "calendar";
          this.dimensions = Calendar2.dimensions;
          this.getDimensionsInfo = Calendar2.getDimensionsInfo;
          this._model = calendarModel;
        }
        Calendar2.getDimensionsInfo = function() {
          return [{
            name: "time",
            type: "time"
          }, "value"];
        };
        Calendar2.prototype.getRangeInfo = function() {
          return this._rangeInfo;
        };
        Calendar2.prototype.getModel = function() {
          return this._model;
        };
        Calendar2.prototype.getRect = function() {
          return this._rect;
        };
        Calendar2.prototype.getCellWidth = function() {
          return this._sw;
        };
        Calendar2.prototype.getCellHeight = function() {
          return this._sh;
        };
        Calendar2.prototype.getOrient = function() {
          return this._orient;
        };
        Calendar2.prototype.getFirstDayOfWeek = function() {
          return this._firstDayOfWeek;
        };
        Calendar2.prototype.getDateInfo = function(date) {
          date = parseDate$1(date);
          var y = date.getFullYear();
          var m2 = date.getMonth() + 1;
          var mStr = m2 < 10 ? "0" + m2 : "" + m2;
          var d2 = date.getDate();
          var dStr = d2 < 10 ? "0" + d2 : "" + d2;
          var day = date.getDay();
          day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7);
          return {
            y: y + "",
            m: mStr,
            d: dStr,
            day,
            time: date.getTime(),
            formatedDate: y + "-" + mStr + "-" + dStr,
            date
          };
        };
        Calendar2.prototype.getNextNDay = function(date, n) {
          n = n || 0;
          if (n === 0) {
            return this.getDateInfo(date);
          }
          date = new Date(this.getDateInfo(date).time);
          date.setDate(date.getDate() + n);
          return this.getDateInfo(date);
        };
        Calendar2.prototype.update = function(ecModel, api2) {
          this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay");
          this._orient = this._model.get("orient");
          this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0;
          this._rangeInfo = this._getRangeInfo(this._initRangeOption());
          var weeks = this._rangeInfo.weeks || 1;
          var whNames = ["width", "height"];
          var cellSize = this._model.getCellSize().slice();
          var layoutParams = this._model.getBoxLayoutParams();
          var cellNumbers = this._orient === "horizontal" ? [weeks, 7] : [7, weeks];
          each$f([0, 1], function(idx) {
            if (cellSizeSpecified(cellSize, idx)) {
              layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx];
            }
          });
          var whGlobal = {
            width: api2.getWidth(),
            height: api2.getHeight()
          };
          var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal);
          each$f([0, 1], function(idx) {
            if (!cellSizeSpecified(cellSize, idx)) {
              cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx];
            }
          });
          function cellSizeSpecified(cellSize2, idx) {
            return cellSize2[idx] != null && cellSize2[idx] !== "auto";
          }
          this._sw = cellSize[0];
          this._sh = cellSize[1];
        };
        Calendar2.prototype.dataToPoint = function(data, clamp2) {
          isArray$2(data) && (data = data[0]);
          clamp2 == null && (clamp2 = true);
          var dayInfo = this.getDateInfo(data);
          var range2 = this._rangeInfo;
          var date = dayInfo.formatedDate;
          if (clamp2 && !(dayInfo.time >= range2.start.time && dayInfo.time < range2.end.time + PROXIMATE_ONE_DAY)) {
            return [NaN, NaN];
          }
          var week = dayInfo.day;
          var nthWeek = this._getRangeInfo([range2.start.time, date]).nthWeek;
          if (this._orient === "vertical") {
            return [this._rect.x + week * this._sw + this._sw / 2, this._rect.y + nthWeek * this._sh + this._sh / 2];
          }
          return [this._rect.x + nthWeek * this._sw + this._sw / 2, this._rect.y + week * this._sh + this._sh / 2];
        };
        Calendar2.prototype.pointToData = function(point) {
          var date = this.pointToDate(point);
          return date && date.time;
        };
        Calendar2.prototype.dataToRect = function(data, clamp2) {
          var point = this.dataToPoint(data, clamp2);
          return {
            contentShape: {
              x: point[0] - (this._sw - this._lineWidth) / 2,
              y: point[1] - (this._sh - this._lineWidth) / 2,
              width: this._sw - this._lineWidth,
              height: this._sh - this._lineWidth
            },
            center: point,
            tl: [point[0] - this._sw / 2, point[1] - this._sh / 2],
            tr: [point[0] + this._sw / 2, point[1] - this._sh / 2],
            br: [point[0] + this._sw / 2, point[1] + this._sh / 2],
            bl: [point[0] - this._sw / 2, point[1] + this._sh / 2]
          };
        };
        Calendar2.prototype.pointToDate = function(point) {
          var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1;
          var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1;
          var range2 = this._rangeInfo.range;
          if (this._orient === "vertical") {
            return this._getDateByWeeksAndDay(nthY, nthX - 1, range2);
          }
          return this._getDateByWeeksAndDay(nthX, nthY - 1, range2);
        };
        Calendar2.prototype.convertToPixel = function(ecModel, finder, value) {
          var coordSys = getCoordSys(finder);
          return coordSys === this ? coordSys.dataToPoint(value) : null;
        };
        Calendar2.prototype.convertFromPixel = function(ecModel, finder, pixel) {
          var coordSys = getCoordSys(finder);
          return coordSys === this ? coordSys.pointToData(pixel) : null;
        };
        Calendar2.prototype.containPoint = function(point) {
          console.warn("Not implemented.");
          return false;
        };
        Calendar2.prototype._initRangeOption = function() {
          var range2 = this._model.get("range");
          var normalizedRange;
          if (isArray$2(range2) && range2.length === 1) {
            range2 = range2[0];
          }
          if (!isArray$2(range2)) {
            var rangeStr = range2.toString();
            if (/^\d{4}$/.test(rangeStr)) {
              normalizedRange = [rangeStr + "-01-01", rangeStr + "-12-31"];
            }
            if (/^\d{4}[\/|-]\d{1,2}$/.test(rangeStr)) {
              var start2 = this.getDateInfo(rangeStr);
              var firstDay = start2.date;
              firstDay.setMonth(firstDay.getMonth() + 1);
              var end2 = this.getNextNDay(firstDay, -1);
              normalizedRange = [start2.formatedDate, end2.formatedDate];
            }
            if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rangeStr)) {
              normalizedRange = [rangeStr, rangeStr];
            }
          } else {
            normalizedRange = range2;
          }
          if (!normalizedRange) {
            return range2;
          }
          var tmp = this._getRangeInfo(normalizedRange);
          if (tmp.start.time > tmp.end.time) {
            normalizedRange.reverse();
          }
          return normalizedRange;
        };
        Calendar2.prototype._getRangeInfo = function(range2) {
          var parsedRange = [this.getDateInfo(range2[0]), this.getDateInfo(range2[1])];
          var reversed;
          if (parsedRange[0].time > parsedRange[1].time) {
            reversed = true;
            parsedRange.reverse();
          }
          var allDay = Math.floor(parsedRange[1].time / PROXIMATE_ONE_DAY) - Math.floor(parsedRange[0].time / PROXIMATE_ONE_DAY) + 1;
          var date = new Date(parsedRange[0].time);
          var startDateNum = date.getDate();
          var endDateNum = parsedRange[1].date.getDate();
          date.setDate(startDateNum + allDay - 1);
          var dateNum = date.getDate();
          if (dateNum !== endDateNum) {
            var sign = date.getTime() - parsedRange[1].time > 0 ? 1 : -1;
            while ((dateNum = date.getDate()) !== endDateNum && (date.getTime() - parsedRange[1].time) * sign > 0) {
              allDay -= sign;
              date.setDate(dateNum - sign);
            }
          }
          var weeks = Math.floor((allDay + parsedRange[0].day + 6) / 7);
          var nthWeek = reversed ? -weeks + 1 : weeks - 1;
          reversed && parsedRange.reverse();
          return {
            range: [parsedRange[0].formatedDate, parsedRange[1].formatedDate],
            start: parsedRange[0],
            end: parsedRange[1],
            allDay,
            weeks,
            // From 0.
            nthWeek,
            fweek: parsedRange[0].day,
            lweek: parsedRange[1].day
          };
        };
        Calendar2.prototype._getDateByWeeksAndDay = function(nthWeek, day, range2) {
          var rangeInfo = this._getRangeInfo(range2);
          if (nthWeek > rangeInfo.weeks || nthWeek === 0 && day < rangeInfo.fweek || nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) {
            return null;
          }
          var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day;
          var date = new Date(rangeInfo.start.time);
          date.setDate(+rangeInfo.start.d + nthDay);
          return this.getDateInfo(date);
        };
        Calendar2.create = function(ecModel, api2) {
          var calendarList = [];
          ecModel.eachComponent("calendar", function(calendarModel) {
            var calendar = new Calendar2(calendarModel);
            calendarList.push(calendar);
            calendarModel.coordinateSystem = calendar;
          });
          ecModel.eachSeries(function(calendarSeries) {
            if (calendarSeries.get("coordinateSystem") === "calendar") {
              calendarSeries.coordinateSystem = calendarList[calendarSeries.get("calendarIndex") || 0];
            }
          });
          return calendarList;
        };
        Calendar2.dimensions = ["time", "value"];
        return Calendar2;
      }()
    );
    function getCoordSys(finder) {
      var calendarModel = finder.calendarModel;
      var seriesModel = finder.seriesModel;
      var coordSys = calendarModel ? calendarModel.coordinateSystem : seriesModel ? seriesModel.coordinateSystem : null;
      return coordSys;
    }
    function install$m(registers) {
      registers.registerComponentModel(CalendarModel);
      registers.registerComponentView(CalendarView);
      registers.registerCoordinateSystem("calendar", Calendar);
    }
    function setKeyInfoToNewElOption(resultItem, newElOption) {
      var existElOption = resultItem.existing;
      newElOption.id = resultItem.keyInfo.id;
      !newElOption.type && existElOption && (newElOption.type = existElOption.type);
      if (newElOption.parentId == null) {
        var newElParentOption = newElOption.parentOption;
        if (newElParentOption) {
          newElOption.parentId = newElParentOption.id;
        } else if (existElOption) {
          newElOption.parentId = existElOption.parentId;
        }
      }
      newElOption.parentOption = null;
    }
    function isSetLoc(obj, props2) {
      var isSet2;
      each$f(props2, function(prop) {
        obj[prop] != null && obj[prop] !== "auto" && (isSet2 = true);
      });
      return isSet2;
    }
    function mergeNewElOptionToExist(existList, index, newElOption) {
      var newElOptCopy = extend$1({}, newElOption);
      var existElOption = existList[index];
      var $action = newElOption.$action || "merge";
      if ($action === "merge") {
        if (existElOption) {
          merge$1(existElOption, newElOptCopy, true);
          mergeLayoutParam(existElOption, newElOptCopy, {
            ignoreSize: true
          });
          copyLayoutParams(newElOption, existElOption);
          copyTransitionInfo(newElOption, existElOption);
          copyTransitionInfo(newElOption, existElOption, "shape");
          copyTransitionInfo(newElOption, existElOption, "style");
          copyTransitionInfo(newElOption, existElOption, "extra");
          newElOption.clipPath = existElOption.clipPath;
        } else {
          existList[index] = newElOptCopy;
        }
      } else if ($action === "replace") {
        existList[index] = newElOptCopy;
      } else if ($action === "remove") {
        existElOption && (existList[index] = null);
      }
    }
    var TRANSITION_PROPS_TO_COPY = ["transition", "enterFrom", "leaveTo"];
    var ROOT_TRANSITION_PROPS_TO_COPY = TRANSITION_PROPS_TO_COPY.concat(["enterAnimation", "updateAnimation", "leaveAnimation"]);
    function copyTransitionInfo(target, source, targetProp) {
      if (targetProp) {
        if (!target[targetProp] && source[targetProp]) {
          target[targetProp] = {};
        }
        target = target[targetProp];
        source = source[targetProp];
      }
      if (!target || !source) {
        return;
      }
      var props2 = targetProp ? TRANSITION_PROPS_TO_COPY : ROOT_TRANSITION_PROPS_TO_COPY;
      for (var i2 = 0; i2 < props2.length; i2++) {
        var prop = props2[i2];
        if (target[prop] == null && source[prop] != null) {
          target[prop] = source[prop];
        }
      }
    }
    function setLayoutInfoToExist(existItem, newElOption) {
      if (!existItem) {
        return;
      }
      existItem.hv = newElOption.hv = [
        // Rigid body, don't care about `width`.
        isSetLoc(newElOption, ["left", "right"]),
        // Rigid body, don't care about `height`.
        isSetLoc(newElOption, ["top", "bottom"])
      ];
      if (existItem.type === "group") {
        var existingGroupOpt = existItem;
        var newGroupOpt = newElOption;
        existingGroupOpt.width == null && (existingGroupOpt.width = newGroupOpt.width = 0);
        existingGroupOpt.height == null && (existingGroupOpt.height = newGroupOpt.height = 0);
      }
    }
    var GraphicComponentModel = (
      /** @class */
      function(_super) {
        __extends$1(GraphicComponentModel2, _super);
        function GraphicComponentModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GraphicComponentModel2.type;
          _this.preventAutoZ = true;
          return _this;
        }
        GraphicComponentModel2.prototype.mergeOption = function(option, ecModel) {
          var elements = this.option.elements;
          this.option.elements = null;
          _super.prototype.mergeOption.call(this, option, ecModel);
          this.option.elements = elements;
        };
        GraphicComponentModel2.prototype.optionUpdated = function(newOption, isInit) {
          var thisOption = this.option;
          var newList = (isInit ? thisOption : newOption).elements;
          var existList = thisOption.elements = isInit ? [] : thisOption.elements;
          var flattenedList = [];
          this._flatten(newList, flattenedList, null);
          var mappingResult = mappingToExists(existList, flattenedList, "normalMerge");
          var elOptionsToUpdate = this._elOptionsToUpdate = [];
          each$f(mappingResult, function(resultItem, index) {
            var newElOption = resultItem.newOption;
            if (!newElOption) {
              return;
            }
            elOptionsToUpdate.push(newElOption);
            setKeyInfoToNewElOption(resultItem, newElOption);
            mergeNewElOptionToExist(existList, index, newElOption);
            setLayoutInfoToExist(existList[index], newElOption);
          }, this);
          thisOption.elements = filter(existList, function(item) {
            item && delete item.$action;
            return item != null;
          });
        };
        GraphicComponentModel2.prototype._flatten = function(optionList, result, parentOption) {
          each$f(optionList, function(option) {
            if (!option) {
              return;
            }
            if (parentOption) {
              option.parentOption = parentOption;
            }
            result.push(option);
            var children = option.children;
            if (children && children.length) {
              this._flatten(children, result, option);
            }
            delete option.children;
          }, this);
        };
        GraphicComponentModel2.prototype.useElOptionsToUpdate = function() {
          var els = this._elOptionsToUpdate;
          this._elOptionsToUpdate = null;
          return els;
        };
        GraphicComponentModel2.type = "graphic";
        GraphicComponentModel2.defaultOption = {
          elements: []
          // parentId: null
        };
        return GraphicComponentModel2;
      }(ComponentModel)
    );
    var nonShapeGraphicElements = {
      // Reserved but not supported in graphic component.
      path: null,
      compoundPath: null,
      // Supported in graphic component.
      group: Group$3,
      image: ZRImage,
      text: ZRText
    };
    var inner$7 = makeInner();
    var GraphicComponentView = (
      /** @class */
      function(_super) {
        __extends$1(GraphicComponentView2, _super);
        function GraphicComponentView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = GraphicComponentView2.type;
          return _this;
        }
        GraphicComponentView2.prototype.init = function() {
          this._elMap = createHashMap();
        };
        GraphicComponentView2.prototype.render = function(graphicModel, ecModel, api2) {
          if (graphicModel !== this._lastGraphicModel) {
            this._clear();
          }
          this._lastGraphicModel = graphicModel;
          this._updateElements(graphicModel);
          this._relocate(graphicModel, api2);
        };
        GraphicComponentView2.prototype._updateElements = function(graphicModel) {
          var elOptionsToUpdate = graphicModel.useElOptionsToUpdate();
          if (!elOptionsToUpdate) {
            return;
          }
          var elMap = this._elMap;
          var rootGroup = this.group;
          var globalZ = graphicModel.get("z");
          var globalZLevel = graphicModel.get("zlevel");
          each$f(elOptionsToUpdate, function(elOption) {
            var id = convertOptionIdName(elOption.id, null);
            var elExisting = id != null ? elMap.get(id) : null;
            var parentId = convertOptionIdName(elOption.parentId, null);
            var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup;
            var elType = elOption.type;
            var elOptionStyle = elOption.style;
            if (elType === "text" && elOptionStyle) {
              if (elOption.hv && elOption.hv[1]) {
                elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = elOptionStyle.verticalAlign = elOptionStyle.align = null;
              }
            }
            var textContentOption = elOption.textContent;
            var textConfig = elOption.textConfig;
            if (elOptionStyle && isEC4CompatibleStyle(elOptionStyle, elType, !!textConfig, !!textContentOption)) {
              var convertResult = convertFromEC4CompatibleStyle(elOptionStyle, elType, true);
              if (!textConfig && convertResult.textConfig) {
                textConfig = elOption.textConfig = convertResult.textConfig;
              }
              if (!textContentOption && convertResult.textContent) {
                textContentOption = convertResult.textContent;
              }
            }
            var elOptionCleaned = getCleanedElOption(elOption);
            var $action = elOption.$action || "merge";
            var isMerge = $action === "merge";
            var isReplace = $action === "replace";
            if (isMerge) {
              var isInit = !elExisting;
              var el_1 = elExisting;
              if (isInit) {
                el_1 = createEl(id, targetElParent, elOption.type, elMap);
              } else {
                el_1 && (inner$7(el_1).isNew = false);
                stopPreviousKeyframeAnimationAndRestore(el_1);
              }
              if (el_1) {
                applyUpdateTransition(el_1, elOptionCleaned, graphicModel, {
                  isInit
                });
                updateCommonAttrs(el_1, elOption, globalZ, globalZLevel);
              }
            } else if (isReplace) {
              removeEl$1(elExisting, elOption, elMap, graphicModel);
              var el_2 = createEl(id, targetElParent, elOption.type, elMap);
              if (el_2) {
                applyUpdateTransition(el_2, elOptionCleaned, graphicModel, {
                  isInit: true
                });
                updateCommonAttrs(el_2, elOption, globalZ, globalZLevel);
              }
            } else if ($action === "remove") {
              updateLeaveTo(elExisting, elOption);
              removeEl$1(elExisting, elOption, elMap, graphicModel);
            }
            var el = elMap.get(id);
            if (el && textContentOption) {
              if (isMerge) {
                var textContentExisting = el.getTextContent();
                textContentExisting ? textContentExisting.attr(textContentOption) : el.setTextContent(new ZRText(textContentOption));
              } else if (isReplace) {
                el.setTextContent(new ZRText(textContentOption));
              }
            }
            if (el) {
              var clipPathOption = elOption.clipPath;
              if (clipPathOption) {
                var clipPathType = clipPathOption.type;
                var clipPath = void 0;
                var isInit = false;
                if (isMerge) {
                  var oldClipPath = el.getClipPath();
                  isInit = !oldClipPath || inner$7(oldClipPath).type !== clipPathType;
                  clipPath = isInit ? newEl(clipPathType) : oldClipPath;
                } else if (isReplace) {
                  isInit = true;
                  clipPath = newEl(clipPathType);
                }
                el.setClipPath(clipPath);
                applyUpdateTransition(clipPath, clipPathOption, graphicModel, {
                  isInit
                });
                applyKeyframeAnimation(clipPath, clipPathOption.keyframeAnimation, graphicModel);
              }
              var elInner = inner$7(el);
              el.setTextConfig(textConfig);
              elInner.option = elOption;
              setEventData(el, graphicModel, elOption);
              setTooltipConfig({
                el,
                componentModel: graphicModel,
                itemName: el.name,
                itemTooltipOption: elOption.tooltip
              });
              applyKeyframeAnimation(el, elOption.keyframeAnimation, graphicModel);
            }
          });
        };
        GraphicComponentView2.prototype._relocate = function(graphicModel, api2) {
          var elOptions = graphicModel.option.elements;
          var rootGroup = this.group;
          var elMap = this._elMap;
          var apiWidth = api2.getWidth();
          var apiHeight = api2.getHeight();
          var xy = ["x", "y"];
          for (var i2 = 0; i2 < elOptions.length; i2++) {
            var elOption = elOptions[i2];
            var id = convertOptionIdName(elOption.id, null);
            var el = id != null ? elMap.get(id) : null;
            if (!el || !el.isGroup) {
              continue;
            }
            var parentEl = el.parent;
            var isParentRoot = parentEl === rootGroup;
            var elInner = inner$7(el);
            var parentElInner = inner$7(parentEl);
            elInner.width = parsePercent(elInner.option.width, isParentRoot ? apiWidth : parentElInner.width) || 0;
            elInner.height = parsePercent(elInner.option.height, isParentRoot ? apiHeight : parentElInner.height) || 0;
          }
          for (var i2 = elOptions.length - 1; i2 >= 0; i2--) {
            var elOption = elOptions[i2];
            var id = convertOptionIdName(elOption.id, null);
            var el = id != null ? elMap.get(id) : null;
            if (!el) {
              continue;
            }
            var parentEl = el.parent;
            var parentElInner = inner$7(parentEl);
            var containerInfo = parentEl === rootGroup ? {
              width: apiWidth,
              height: apiHeight
            } : {
              width: parentElInner.width,
              height: parentElInner.height
            };
            var layoutPos = {};
            var layouted = positionElement(el, elOption, containerInfo, null, {
              hv: elOption.hv,
              boundingMode: elOption.bounding
            }, layoutPos);
            if (!inner$7(el).isNew && layouted) {
              var transition = elOption.transition;
              var animatePos = {};
              for (var k2 = 0; k2 < xy.length; k2++) {
                var key = xy[k2];
                var val = layoutPos[key];
                if (transition && (isTransitionAll(transition) || indexOf(transition, key) >= 0)) {
                  animatePos[key] = val;
                } else {
                  el[key] = val;
                }
              }
              updateProps$1(el, animatePos, graphicModel, 0);
            } else {
              el.attr(layoutPos);
            }
          }
        };
        GraphicComponentView2.prototype._clear = function() {
          var _this = this;
          var elMap = this._elMap;
          elMap.each(function(el) {
            removeEl$1(el, inner$7(el).option, elMap, _this._lastGraphicModel);
          });
          this._elMap = createHashMap();
        };
        GraphicComponentView2.prototype.dispose = function() {
          this._clear();
        };
        GraphicComponentView2.type = "graphic";
        return GraphicComponentView2;
      }(ComponentView)
    );
    function newEl(graphicType) {
      var Clz = hasOwn(nonShapeGraphicElements, graphicType) ? nonShapeGraphicElements[graphicType] : getShapeClass(graphicType);
      var el = new Clz({});
      inner$7(el).type = graphicType;
      return el;
    }
    function createEl(id, targetElParent, graphicType, elMap) {
      var el = newEl(graphicType);
      targetElParent.add(el);
      elMap.set(id, el);
      inner$7(el).id = id;
      inner$7(el).isNew = true;
      return el;
    }
    function removeEl$1(elExisting, elOption, elMap, graphicModel) {
      var existElParent = elExisting && elExisting.parent;
      if (existElParent) {
        elExisting.type === "group" && elExisting.traverse(function(el) {
          removeEl$1(el, elOption, elMap, graphicModel);
        });
        applyLeaveTransition(elExisting, elOption, graphicModel);
        elMap.removeKey(inner$7(elExisting).id);
      }
    }
    function updateCommonAttrs(el, elOption, defaultZ, defaultZlevel) {
      if (!el.isGroup) {
        each$f([
          ["cursor", Displayable.prototype.cursor],
          // We should not support configure z and zlevel in the element level.
          // But seems we didn't limit it previously. So here still use it to avoid breaking.
          ["zlevel", defaultZlevel || 0],
          ["z", defaultZ || 0],
          // z2 must not be null/undefined, otherwise sort error may occur.
          ["z2", 0]
        ], function(item) {
          var prop = item[0];
          if (hasOwn(elOption, prop)) {
            el[prop] = retrieve2(elOption[prop], item[1]);
          } else if (el[prop] == null) {
            el[prop] = item[1];
          }
        });
      }
      each$f(keys$1(elOption), function(key) {
        if (key.indexOf("on") === 0) {
          var val = elOption[key];
          el[key] = isFunction$1(val) ? val : null;
        }
      });
      if (hasOwn(elOption, "draggable")) {
        el.draggable = elOption.draggable;
      }
      elOption.name != null && (el.name = elOption.name);
      elOption.id != null && (el.id = elOption.id);
    }
    function getCleanedElOption(elOption) {
      elOption = extend$1({}, elOption);
      each$f(["id", "parentId", "$action", "hv", "bounding", "textContent", "clipPath"].concat(LOCATION_PARAMS), function(name) {
        delete elOption[name];
      });
      return elOption;
    }
    function setEventData(el, graphicModel, elOption) {
      var eventData = getECData(el).eventData;
      if (!el.silent && !el.ignore && !eventData) {
        eventData = getECData(el).eventData = {
          componentType: "graphic",
          componentIndex: graphicModel.componentIndex,
          name: el.name
        };
      }
      if (eventData) {
        eventData.info = elOption.info;
      }
    }
    function install$l(registers) {
      registers.registerComponentModel(GraphicComponentModel);
      registers.registerComponentView(GraphicComponentView);
      registers.registerPreprocessor(function(option) {
        var graphicOption = option.graphic;
        if (isArray$2(graphicOption)) {
          if (!graphicOption[0] || !graphicOption[0].elements) {
            option.graphic = [{
              elements: graphicOption
            }];
          } else {
            option.graphic = [option.graphic[0]];
          }
        } else if (graphicOption && !graphicOption.elements) {
          option.graphic = [{
            elements: [graphicOption]
          }];
        }
      });
    }
    var DATA_ZOOM_AXIS_DIMENSIONS = ["x", "y", "radius", "angle", "single"];
    var SERIES_COORDS = ["cartesian2d", "polar", "singleAxis"];
    function isCoordSupported(seriesModel) {
      var coordType = seriesModel.get("coordinateSystem");
      return indexOf(SERIES_COORDS, coordType) >= 0;
    }
    function getAxisMainType(axisDim) {
      return axisDim + "Axis";
    }
    function findEffectedDataZooms(ecModel, payload) {
      var axisRecords = createHashMap();
      var effectedModels = [];
      var effectedModelMap = createHashMap();
      ecModel.eachComponent({
        mainType: "dataZoom",
        query: payload
      }, function(dataZoomModel) {
        if (!effectedModelMap.get(dataZoomModel.uid)) {
          addToEffected(dataZoomModel);
        }
      });
      var foundNewLink;
      do {
        foundNewLink = false;
        ecModel.eachComponent("dataZoom", processSingle);
      } while (foundNewLink);
      function processSingle(dataZoomModel) {
        if (!effectedModelMap.get(dataZoomModel.uid) && isLinked(dataZoomModel)) {
          addToEffected(dataZoomModel);
          foundNewLink = true;
        }
      }
      function addToEffected(dataZoom) {
        effectedModelMap.set(dataZoom.uid, true);
        effectedModels.push(dataZoom);
        markAxisControlled(dataZoom);
      }
      function isLinked(dataZoomModel) {
        var isLink = false;
        dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
          var axisIdxArr = axisRecords.get(axisDim);
          if (axisIdxArr && axisIdxArr[axisIndex]) {
            isLink = true;
          }
        });
        return isLink;
      }
      function markAxisControlled(dataZoomModel) {
        dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
          (axisRecords.get(axisDim) || axisRecords.set(axisDim, []))[axisIndex] = true;
        });
      }
      return effectedModels;
    }
    function collectReferCoordSysModelInfo(dataZoomModel) {
      var ecModel = dataZoomModel.ecModel;
      var coordSysInfoWrap = {
        infoList: [],
        infoMap: createHashMap()
      };
      dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
        var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
        if (!axisModel) {
          return;
        }
        var coordSysModel = axisModel.getCoordSysModel();
        if (!coordSysModel) {
          return;
        }
        var coordSysUid = coordSysModel.uid;
        var coordSysInfo = coordSysInfoWrap.infoMap.get(coordSysUid);
        if (!coordSysInfo) {
          coordSysInfo = {
            model: coordSysModel,
            axisModels: []
          };
          coordSysInfoWrap.infoList.push(coordSysInfo);
          coordSysInfoWrap.infoMap.set(coordSysUid, coordSysInfo);
        }
        coordSysInfo.axisModels.push(axisModel);
      });
      return coordSysInfoWrap;
    }
    var DataZoomAxisInfo = (
      /** @class */
      function() {
        function DataZoomAxisInfo2() {
          this.indexList = [];
          this.indexMap = [];
        }
        DataZoomAxisInfo2.prototype.add = function(axisCmptIdx) {
          if (!this.indexMap[axisCmptIdx]) {
            this.indexList.push(axisCmptIdx);
            this.indexMap[axisCmptIdx] = true;
          }
        };
        return DataZoomAxisInfo2;
      }()
    );
    var DataZoomModel = (
      /** @class */
      function(_super) {
        __extends$1(DataZoomModel2, _super);
        function DataZoomModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = DataZoomModel2.type;
          _this._autoThrottle = true;
          _this._noTarget = true;
          _this._rangePropMode = ["percent", "percent"];
          return _this;
        }
        DataZoomModel2.prototype.init = function(option, parentModel, ecModel) {
          var inputRawOption = retrieveRawOption(option);
          this.settledOption = inputRawOption;
          this.mergeDefaultAndTheme(option, ecModel);
          this._doInit(inputRawOption);
        };
        DataZoomModel2.prototype.mergeOption = function(newOption) {
          var inputRawOption = retrieveRawOption(newOption);
          merge$1(this.option, newOption, true);
          merge$1(this.settledOption, inputRawOption, true);
          this._doInit(inputRawOption);
        };
        DataZoomModel2.prototype._doInit = function(inputRawOption) {
          var thisOption = this.option;
          this._setDefaultThrottle(inputRawOption);
          this._updateRangeUse(inputRawOption);
          var settledOption = this.settledOption;
          each$f([["start", "startValue"], ["end", "endValue"]], function(names2, index) {
            if (this._rangePropMode[index] === "value") {
              thisOption[names2[0]] = settledOption[names2[0]] = null;
            }
          }, this);
          this._resetTarget();
        };
        DataZoomModel2.prototype._resetTarget = function() {
          var optionOrient = this.get("orient", true);
          var targetAxisIndexMap = this._targetAxisInfoMap = createHashMap();
          var hasAxisSpecified = this._fillSpecifiedTargetAxis(targetAxisIndexMap);
          if (hasAxisSpecified) {
            this._orient = optionOrient || this._makeAutoOrientByTargetAxis();
          } else {
            this._orient = optionOrient || "horizontal";
            this._fillAutoTargetAxisByOrient(targetAxisIndexMap, this._orient);
          }
          this._noTarget = true;
          targetAxisIndexMap.each(function(axisInfo) {
            if (axisInfo.indexList.length) {
              this._noTarget = false;
            }
          }, this);
        };
        DataZoomModel2.prototype._fillSpecifiedTargetAxis = function(targetAxisIndexMap) {
          var hasAxisSpecified = false;
          each$f(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim) {
            var refering = this.getReferringComponents(getAxisMainType(axisDim), MULTIPLE_REFERRING);
            if (!refering.specified) {
              return;
            }
            hasAxisSpecified = true;
            var axisInfo = new DataZoomAxisInfo();
            each$f(refering.models, function(axisModel) {
              axisInfo.add(axisModel.componentIndex);
            });
            targetAxisIndexMap.set(axisDim, axisInfo);
          }, this);
          return hasAxisSpecified;
        };
        DataZoomModel2.prototype._fillAutoTargetAxisByOrient = function(targetAxisIndexMap, orient) {
          var ecModel = this.ecModel;
          var needAuto = true;
          if (needAuto) {
            var axisDim = orient === "vertical" ? "y" : "x";
            var axisModels = ecModel.findComponents({
              mainType: axisDim + "Axis"
            });
            setParallelAxis(axisModels, axisDim);
          }
          if (needAuto) {
            var axisModels = ecModel.findComponents({
              mainType: "singleAxis",
              filter: function(axisModel) {
                return axisModel.get("orient", true) === orient;
              }
            });
            setParallelAxis(axisModels, "single");
          }
          function setParallelAxis(axisModels2, axisDim2) {
            var axisModel = axisModels2[0];
            if (!axisModel) {
              return;
            }
            var axisInfo = new DataZoomAxisInfo();
            axisInfo.add(axisModel.componentIndex);
            targetAxisIndexMap.set(axisDim2, axisInfo);
            needAuto = false;
            if (axisDim2 === "x" || axisDim2 === "y") {
              var gridModel_1 = axisModel.getReferringComponents("grid", SINGLE_REFERRING).models[0];
              gridModel_1 && each$f(axisModels2, function(axModel) {
                if (axisModel.componentIndex !== axModel.componentIndex && gridModel_1 === axModel.getReferringComponents("grid", SINGLE_REFERRING).models[0]) {
                  axisInfo.add(axModel.componentIndex);
                }
              });
            }
          }
          if (needAuto) {
            each$f(DATA_ZOOM_AXIS_DIMENSIONS, function(axisDim2) {
              if (!needAuto) {
                return;
              }
              var axisModels2 = ecModel.findComponents({
                mainType: getAxisMainType(axisDim2),
                filter: function(axisModel) {
                  return axisModel.get("type", true) === "category";
                }
              });
              if (axisModels2[0]) {
                var axisInfo = new DataZoomAxisInfo();
                axisInfo.add(axisModels2[0].componentIndex);
                targetAxisIndexMap.set(axisDim2, axisInfo);
                needAuto = false;
              }
            }, this);
          }
        };
        DataZoomModel2.prototype._makeAutoOrientByTargetAxis = function() {
          var dim;
          this.eachTargetAxis(function(axisDim) {
            !dim && (dim = axisDim);
          }, this);
          return dim === "y" ? "vertical" : "horizontal";
        };
        DataZoomModel2.prototype._setDefaultThrottle = function(inputRawOption) {
          if (inputRawOption.hasOwnProperty("throttle")) {
            this._autoThrottle = false;
          }
          if (this._autoThrottle) {
            var globalOption = this.ecModel.option;
            this.option.throttle = globalOption.animation && globalOption.animationDurationUpdate > 0 ? 100 : 20;
          }
        };
        DataZoomModel2.prototype._updateRangeUse = function(inputRawOption) {
          var rangePropMode = this._rangePropMode;
          var rangeModeInOption = this.get("rangeMode");
          each$f([["start", "startValue"], ["end", "endValue"]], function(names2, index) {
            var percentSpecified = inputRawOption[names2[0]] != null;
            var valueSpecified = inputRawOption[names2[1]] != null;
            if (percentSpecified && !valueSpecified) {
              rangePropMode[index] = "percent";
            } else if (!percentSpecified && valueSpecified) {
              rangePropMode[index] = "value";
            } else if (rangeModeInOption) {
              rangePropMode[index] = rangeModeInOption[index];
            } else if (percentSpecified) {
              rangePropMode[index] = "percent";
            }
          });
        };
        DataZoomModel2.prototype.noTarget = function() {
          return this._noTarget;
        };
        DataZoomModel2.prototype.getFirstTargetAxisModel = function() {
          var firstAxisModel;
          this.eachTargetAxis(function(axisDim, axisIndex) {
            if (firstAxisModel == null) {
              firstAxisModel = this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
            }
          }, this);
          return firstAxisModel;
        };
        DataZoomModel2.prototype.eachTargetAxis = function(callback, context) {
          this._targetAxisInfoMap.each(function(axisInfo, axisDim) {
            each$f(axisInfo.indexList, function(axisIndex) {
              callback.call(context, axisDim, axisIndex);
            });
          });
        };
        DataZoomModel2.prototype.getAxisProxy = function(axisDim, axisIndex) {
          var axisModel = this.getAxisModel(axisDim, axisIndex);
          if (axisModel) {
            return axisModel.__dzAxisProxy;
          }
        };
        DataZoomModel2.prototype.getAxisModel = function(axisDim, axisIndex) {
          var axisInfo = this._targetAxisInfoMap.get(axisDim);
          if (axisInfo && axisInfo.indexMap[axisIndex]) {
            return this.ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
          }
        };
        DataZoomModel2.prototype.setRawRange = function(opt) {
          var thisOption = this.option;
          var settledOption = this.settledOption;
          each$f([["start", "startValue"], ["end", "endValue"]], function(names2) {
            if (opt[names2[0]] != null || opt[names2[1]] != null) {
              thisOption[names2[0]] = settledOption[names2[0]] = opt[names2[0]];
              thisOption[names2[1]] = settledOption[names2[1]] = opt[names2[1]];
            }
          }, this);
          this._updateRangeUse(opt);
        };
        DataZoomModel2.prototype.setCalculatedRange = function(opt) {
          var option = this.option;
          each$f(["start", "startValue", "end", "endValue"], function(name) {
            option[name] = opt[name];
          });
        };
        DataZoomModel2.prototype.getPercentRange = function() {
          var axisProxy = this.findRepresentativeAxisProxy();
          if (axisProxy) {
            return axisProxy.getDataPercentWindow();
          }
        };
        DataZoomModel2.prototype.getValueRange = function(axisDim, axisIndex) {
          if (axisDim == null && axisIndex == null) {
            var axisProxy = this.findRepresentativeAxisProxy();
            if (axisProxy) {
              return axisProxy.getDataValueWindow();
            }
          } else {
            return this.getAxisProxy(axisDim, axisIndex).getDataValueWindow();
          }
        };
        DataZoomModel2.prototype.findRepresentativeAxisProxy = function(axisModel) {
          if (axisModel) {
            return axisModel.__dzAxisProxy;
          }
          var firstProxy;
          var axisDimList = this._targetAxisInfoMap.keys();
          for (var i2 = 0; i2 < axisDimList.length; i2++) {
            var axisDim = axisDimList[i2];
            var axisInfo = this._targetAxisInfoMap.get(axisDim);
            for (var j = 0; j < axisInfo.indexList.length; j++) {
              var proxy = this.getAxisProxy(axisDim, axisInfo.indexList[j]);
              if (proxy.hostedBy(this)) {
                return proxy;
              }
              if (!firstProxy) {
                firstProxy = proxy;
              }
            }
          }
          return firstProxy;
        };
        DataZoomModel2.prototype.getRangePropMode = function() {
          return this._rangePropMode.slice();
        };
        DataZoomModel2.prototype.getOrient = function() {
          return this._orient;
        };
        DataZoomModel2.type = "dataZoom";
        DataZoomModel2.dependencies = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "series", "toolbox"];
        DataZoomModel2.defaultOption = {
          // zlevel: 0,
          z: 4,
          filterMode: "filter",
          start: 0,
          end: 100
        };
        return DataZoomModel2;
      }(ComponentModel)
    );
    function retrieveRawOption(option) {
      var ret = {};
      each$f(["start", "end", "startValue", "endValue", "throttle"], function(name) {
        option.hasOwnProperty(name) && (ret[name] = option[name]);
      });
      return ret;
    }
    var SelectDataZoomModel = (
      /** @class */
      function(_super) {
        __extends$1(SelectDataZoomModel2, _super);
        function SelectDataZoomModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SelectDataZoomModel2.type;
          return _this;
        }
        SelectDataZoomModel2.type = "dataZoom.select";
        return SelectDataZoomModel2;
      }(DataZoomModel)
    );
    var DataZoomView = (
      /** @class */
      function(_super) {
        __extends$1(DataZoomView2, _super);
        function DataZoomView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = DataZoomView2.type;
          return _this;
        }
        DataZoomView2.prototype.render = function(dataZoomModel, ecModel, api2, payload) {
          this.dataZoomModel = dataZoomModel;
          this.ecModel = ecModel;
          this.api = api2;
        };
        DataZoomView2.type = "dataZoom";
        return DataZoomView2;
      }(ComponentView)
    );
    var SelectDataZoomView = (
      /** @class */
      function(_super) {
        __extends$1(SelectDataZoomView2, _super);
        function SelectDataZoomView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SelectDataZoomView2.type;
          return _this;
        }
        SelectDataZoomView2.type = "dataZoom.select";
        return SelectDataZoomView2;
      }(DataZoomView)
    );
    var each$7 = each$f;
    var asc$1 = asc$2;
    var AxisProxy = (
      /** @class */
      function() {
        function AxisProxy2(dimName, axisIndex, dataZoomModel, ecModel) {
          this._dimName = dimName;
          this._axisIndex = axisIndex;
          this.ecModel = ecModel;
          this._dataZoomModel = dataZoomModel;
        }
        AxisProxy2.prototype.hostedBy = function(dataZoomModel) {
          return this._dataZoomModel === dataZoomModel;
        };
        AxisProxy2.prototype.getDataValueWindow = function() {
          return this._valueWindow.slice();
        };
        AxisProxy2.prototype.getDataPercentWindow = function() {
          return this._percentWindow.slice();
        };
        AxisProxy2.prototype.getTargetSeriesModels = function() {
          var seriesModels = [];
          this.ecModel.eachSeries(function(seriesModel) {
            if (isCoordSupported(seriesModel)) {
              var axisMainType = getAxisMainType(this._dimName);
              var axisModel = seriesModel.getReferringComponents(axisMainType, SINGLE_REFERRING).models[0];
              if (axisModel && this._axisIndex === axisModel.componentIndex) {
                seriesModels.push(seriesModel);
              }
            }
          }, this);
          return seriesModels;
        };
        AxisProxy2.prototype.getAxisModel = function() {
          return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex);
        };
        AxisProxy2.prototype.getMinMaxSpan = function() {
          return clone$4(this._minMaxSpan);
        };
        AxisProxy2.prototype.calculateDataWindow = function(opt) {
          var dataExtent = this._dataExtent;
          var axisModel = this.getAxisModel();
          var scale2 = axisModel.axis.scale;
          var rangePropMode = this._dataZoomModel.getRangePropMode();
          var percentExtent = [0, 100];
          var percentWindow = [];
          var valueWindow = [];
          var hasPropModeValue;
          each$7(["start", "end"], function(prop, idx) {
            var boundPercent = opt[prop];
            var boundValue = opt[prop + "Value"];
            if (rangePropMode[idx] === "percent") {
              boundPercent == null && (boundPercent = percentExtent[idx]);
              boundValue = scale2.parse(linearMap$2(boundPercent, percentExtent, dataExtent));
            } else {
              hasPropModeValue = true;
              boundValue = boundValue == null ? dataExtent[idx] : scale2.parse(boundValue);
              boundPercent = linearMap$2(boundValue, dataExtent, percentExtent);
            }
            valueWindow[idx] = boundValue == null || isNaN(boundValue) ? dataExtent[idx] : boundValue;
            percentWindow[idx] = boundPercent == null || isNaN(boundPercent) ? percentExtent[idx] : boundPercent;
          });
          asc$1(valueWindow);
          asc$1(percentWindow);
          var spans = this._minMaxSpan;
          hasPropModeValue ? restrictSet(valueWindow, percentWindow, dataExtent, percentExtent, false) : restrictSet(percentWindow, valueWindow, percentExtent, dataExtent, true);
          function restrictSet(fromWindow, toWindow, fromExtent, toExtent, toValue) {
            var suffix = toValue ? "Span" : "ValueSpan";
            sliderMove(0, fromWindow, fromExtent, "all", spans["min" + suffix], spans["max" + suffix]);
            for (var i2 = 0; i2 < 2; i2++) {
              toWindow[i2] = linearMap$2(fromWindow[i2], fromExtent, toExtent, true);
              toValue && (toWindow[i2] = scale2.parse(toWindow[i2]));
            }
          }
          return {
            valueWindow,
            percentWindow
          };
        };
        AxisProxy2.prototype.reset = function(dataZoomModel) {
          if (dataZoomModel !== this._dataZoomModel) {
            return;
          }
          var targetSeries = this.getTargetSeriesModels();
          this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries);
          this._updateMinMaxSpan();
          var dataWindow = this.calculateDataWindow(dataZoomModel.settledOption);
          this._valueWindow = dataWindow.valueWindow;
          this._percentWindow = dataWindow.percentWindow;
          this._setAxisModel();
        };
        AxisProxy2.prototype.filterData = function(dataZoomModel, api2) {
          if (dataZoomModel !== this._dataZoomModel) {
            return;
          }
          var axisDim = this._dimName;
          var seriesModels = this.getTargetSeriesModels();
          var filterMode = dataZoomModel.get("filterMode");
          var valueWindow = this._valueWindow;
          if (filterMode === "none") {
            return;
          }
          each$7(seriesModels, function(seriesModel) {
            var seriesData = seriesModel.getData();
            var dataDims = seriesData.mapDimensionsAll(axisDim);
            if (!dataDims.length) {
              return;
            }
            if (filterMode === "weakFilter") {
              var store_1 = seriesData.getStore();
              var dataDimIndices_1 = map$1(dataDims, function(dim) {
                return seriesData.getDimensionIndex(dim);
              }, seriesData);
              seriesData.filterSelf(function(dataIndex) {
                var leftOut;
                var rightOut;
                var hasValue;
                for (var i2 = 0; i2 < dataDims.length; i2++) {
                  var value = store_1.get(dataDimIndices_1[i2], dataIndex);
                  var thisHasValue = !isNaN(value);
                  var thisLeftOut = value < valueWindow[0];
                  var thisRightOut = value > valueWindow[1];
                  if (thisHasValue && !thisLeftOut && !thisRightOut) {
                    return true;
                  }
                  thisHasValue && (hasValue = true);
                  thisLeftOut && (leftOut = true);
                  thisRightOut && (rightOut = true);
                }
                return hasValue && leftOut && rightOut;
              });
            } else {
              each$7(dataDims, function(dim) {
                if (filterMode === "empty") {
                  seriesModel.setData(seriesData = seriesData.map(dim, function(value) {
                    return !isInWindow(value) ? NaN : value;
                  }));
                } else {
                  var range2 = {};
                  range2[dim] = valueWindow;
                  seriesData.selectRange(range2);
                }
              });
            }
            each$7(dataDims, function(dim) {
              seriesData.setApproximateExtent(valueWindow, dim);
            });
          });
          function isInWindow(value) {
            return value >= valueWindow[0] && value <= valueWindow[1];
          }
        };
        AxisProxy2.prototype._updateMinMaxSpan = function() {
          var minMaxSpan = this._minMaxSpan = {};
          var dataZoomModel = this._dataZoomModel;
          var dataExtent = this._dataExtent;
          each$7(["min", "max"], function(minMax) {
            var percentSpan = dataZoomModel.get(minMax + "Span");
            var valueSpan = dataZoomModel.get(minMax + "ValueSpan");
            valueSpan != null && (valueSpan = this.getAxisModel().axis.scale.parse(valueSpan));
            if (valueSpan != null) {
              percentSpan = linearMap$2(dataExtent[0] + valueSpan, dataExtent, [0, 100], true);
            } else if (percentSpan != null) {
              valueSpan = linearMap$2(percentSpan, [0, 100], dataExtent, true) - dataExtent[0];
            }
            minMaxSpan[minMax + "Span"] = percentSpan;
            minMaxSpan[minMax + "ValueSpan"] = valueSpan;
          }, this);
        };
        AxisProxy2.prototype._setAxisModel = function() {
          var axisModel = this.getAxisModel();
          var percentWindow = this._percentWindow;
          var valueWindow = this._valueWindow;
          if (!percentWindow) {
            return;
          }
          var precision = getPixelPrecision(valueWindow, [0, 500]);
          precision = Math.min(precision, 20);
          var rawExtentInfo = axisModel.axis.scale.rawExtentInfo;
          if (percentWindow[0] !== 0) {
            rawExtentInfo.setDeterminedMinMax("min", +valueWindow[0].toFixed(precision));
          }
          if (percentWindow[1] !== 100) {
            rawExtentInfo.setDeterminedMinMax("max", +valueWindow[1].toFixed(precision));
          }
          rawExtentInfo.freeze();
        };
        return AxisProxy2;
      }()
    );
    function calculateDataExtent(axisProxy, axisDim, seriesModels) {
      var dataExtent = [Infinity, -Infinity];
      each$7(seriesModels, function(seriesModel) {
        unionAxisExtentFromData(dataExtent, seriesModel.getData(), axisDim);
      });
      var axisModel = axisProxy.getAxisModel();
      var rawExtentResult = ensureScaleRawExtentInfo(axisModel.axis.scale, axisModel, dataExtent).calculate();
      return [rawExtentResult.min, rawExtentResult.max];
    }
    var dataZoomProcessor = {
      // `dataZoomProcessor` will only be performed in needed series. Consider if
      // there is a line series and a pie series, it is better not to update the
      // line series if only pie series is needed to be updated.
      getTargetSeries: function(ecModel) {
        function eachAxisModel(cb) {
          ecModel.eachComponent("dataZoom", function(dataZoomModel) {
            dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
              var axisModel = ecModel.getComponent(getAxisMainType(axisDim), axisIndex);
              cb(axisDim, axisIndex, axisModel, dataZoomModel);
            });
          });
        }
        eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
          axisModel.__dzAxisProxy = null;
        });
        var proxyList = [];
        eachAxisModel(function(axisDim, axisIndex, axisModel, dataZoomModel) {
          if (!axisModel.__dzAxisProxy) {
            axisModel.__dzAxisProxy = new AxisProxy(axisDim, axisIndex, dataZoomModel, ecModel);
            proxyList.push(axisModel.__dzAxisProxy);
          }
        });
        var seriesModelMap = createHashMap();
        each$f(proxyList, function(axisProxy) {
          each$f(axisProxy.getTargetSeriesModels(), function(seriesModel) {
            seriesModelMap.set(seriesModel.uid, seriesModel);
          });
        });
        return seriesModelMap;
      },
      // Consider appendData, where filter should be performed. Because data process is
      // in block mode currently, it is not need to worry about that the overallProgress
      // execute every frame.
      overallReset: function(ecModel, api2) {
        ecModel.eachComponent("dataZoom", function(dataZoomModel) {
          dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
            dataZoomModel.getAxisProxy(axisDim, axisIndex).reset(dataZoomModel);
          });
          dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
            dataZoomModel.getAxisProxy(axisDim, axisIndex).filterData(dataZoomModel, api2);
          });
        });
        ecModel.eachComponent("dataZoom", function(dataZoomModel) {
          var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
          if (axisProxy) {
            var percentRange = axisProxy.getDataPercentWindow();
            var valueRange = axisProxy.getDataValueWindow();
            dataZoomModel.setCalculatedRange({
              start: percentRange[0],
              end: percentRange[1],
              startValue: valueRange[0],
              endValue: valueRange[1]
            });
          }
        });
      }
    };
    function installDataZoomAction(registers) {
      registers.registerAction("dataZoom", function(payload, ecModel) {
        var effectedModels = findEffectedDataZooms(ecModel, payload);
        each$f(effectedModels, function(dataZoomModel) {
          dataZoomModel.setRawRange({
            start: payload.start,
            end: payload.end,
            startValue: payload.startValue,
            endValue: payload.endValue
          });
        });
      });
    }
    var installed$1 = false;
    function installCommon$1(registers) {
      if (installed$1) {
        return;
      }
      installed$1 = true;
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, dataZoomProcessor);
      installDataZoomAction(registers);
      registers.registerSubTypeDefaulter("dataZoom", function() {
        return "slider";
      });
    }
    function install$k(registers) {
      registers.registerComponentModel(SelectDataZoomModel);
      registers.registerComponentView(SelectDataZoomView);
      installCommon$1(registers);
    }
    var ToolboxFeature = (
      /** @class */
      /* @__PURE__ */ function() {
        function ToolboxFeature2() {
        }
        return ToolboxFeature2;
      }()
    );
    var features = {};
    function registerFeature(name, ctor) {
      features[name] = ctor;
    }
    function getFeature(name) {
      return features[name];
    }
    var ToolboxModel = (
      /** @class */
      function(_super) {
        __extends$1(ToolboxModel2, _super);
        function ToolboxModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ToolboxModel2.type;
          return _this;
        }
        ToolboxModel2.prototype.optionUpdated = function() {
          _super.prototype.optionUpdated.apply(this, arguments);
          var ecModel = this.ecModel;
          each$f(this.option.feature, function(featureOpt, featureName) {
            var Feature = getFeature(featureName);
            if (Feature) {
              if (Feature.getDefaultOption) {
                Feature.defaultOption = Feature.getDefaultOption(ecModel);
              }
              merge$1(featureOpt, Feature.defaultOption);
            }
          });
        };
        ToolboxModel2.type = "toolbox";
        ToolboxModel2.layoutMode = {
          type: "box",
          ignoreSize: true
        };
        ToolboxModel2.defaultOption = {
          show: true,
          z: 6,
          // zlevel: 0,
          orient: "horizontal",
          left: "right",
          top: "top",
          // right
          // bottom
          backgroundColor: "transparent",
          borderColor: "#ccc",
          borderRadius: 0,
          borderWidth: 0,
          padding: 5,
          itemSize: 15,
          itemGap: 8,
          showTitle: true,
          iconStyle: {
            borderColor: "#666",
            color: "none"
          },
          emphasis: {
            iconStyle: {
              borderColor: "#3E98C5"
            }
          },
          // textStyle: {},
          // feature
          tooltip: {
            show: false,
            position: "bottom"
          }
        };
        return ToolboxModel2;
      }(ComponentModel)
    );
    function layout(group, componentModel, api2) {
      var boxLayoutParams = componentModel.getBoxLayoutParams();
      var padding = componentModel.get("padding");
      var viewportSize = {
        width: api2.getWidth(),
        height: api2.getHeight()
      };
      var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);
      box(componentModel.get("orient"), group, componentModel.get("itemGap"), rect.width, rect.height);
      positionElement(group, boxLayoutParams, viewportSize, padding);
    }
    function makeBackground(rect, componentModel) {
      var padding = normalizeCssArray(componentModel.get("padding"));
      var style = componentModel.getItemStyle(["color", "opacity"]);
      style.fill = componentModel.get("backgroundColor");
      rect = new Rect$2({
        shape: {
          x: rect.x - padding[3],
          y: rect.y - padding[0],
          width: rect.width + padding[1] + padding[3],
          height: rect.height + padding[0] + padding[2],
          r: componentModel.get("borderRadius")
        },
        style,
        silent: true,
        z2: -1
      });
      return rect;
    }
    var ToolboxView = (
      /** @class */
      function(_super) {
        __extends$1(ToolboxView2, _super);
        function ToolboxView2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        ToolboxView2.prototype.render = function(toolboxModel, ecModel, api2, payload) {
          var group = this.group;
          group.removeAll();
          if (!toolboxModel.get("show")) {
            return;
          }
          var itemSize2 = +toolboxModel.get("itemSize");
          var isVertical = toolboxModel.get("orient") === "vertical";
          var featureOpts = toolboxModel.get("feature") || {};
          var features2 = this._features || (this._features = {});
          var featureNames = [];
          each$f(featureOpts, function(opt, name) {
            featureNames.push(name);
          });
          new DataDiffer(this._featureNames || [], featureNames).add(processFeature).update(processFeature).remove(curry$1(processFeature, null)).execute();
          this._featureNames = featureNames;
          function processFeature(newIndex, oldIndex) {
            var featureName = featureNames[newIndex];
            var oldName = featureNames[oldIndex];
            var featureOpt = featureOpts[featureName];
            var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
            var feature;
            if (payload && payload.newTitle != null && payload.featureName === featureName) {
              featureOpt.title = payload.newTitle;
            }
            if (featureName && !oldName) {
              if (isUserFeatureName(featureName)) {
                feature = {
                  onclick: featureModel.option.onclick,
                  featureName
                };
              } else {
                var Feature = getFeature(featureName);
                if (!Feature) {
                  return;
                }
                feature = new Feature();
              }
              features2[featureName] = feature;
            } else {
              feature = features2[oldName];
              if (!feature) {
                return;
              }
            }
            feature.uid = getUID("toolbox-feature");
            feature.model = featureModel;
            feature.ecModel = ecModel;
            feature.api = api2;
            var isToolboxFeature = feature instanceof ToolboxFeature;
            if (!featureName && oldName) {
              isToolboxFeature && feature.dispose && feature.dispose(ecModel, api2);
              return;
            }
            if (!featureModel.get("show") || isToolboxFeature && feature.unusable) {
              isToolboxFeature && feature.remove && feature.remove(ecModel, api2);
              return;
            }
            createIconPaths(featureModel, feature, featureName);
            featureModel.setIconStatus = function(iconName, status) {
              var option = this.option;
              var iconPaths = this.iconPaths;
              option.iconStatus = option.iconStatus || {};
              option.iconStatus[iconName] = status;
              if (iconPaths[iconName]) {
                (status === "emphasis" ? enterEmphasis : leaveEmphasis)(iconPaths[iconName]);
              }
            };
            if (feature instanceof ToolboxFeature) {
              if (feature.render) {
                feature.render(featureModel, ecModel, api2, payload);
              }
            }
          }
          function createIconPaths(featureModel, feature, featureName) {
            var iconStyleModel = featureModel.getModel("iconStyle");
            var iconStyleEmphasisModel = featureModel.getModel(["emphasis", "iconStyle"]);
            var icons = feature instanceof ToolboxFeature && feature.getIcons ? feature.getIcons() : featureModel.get("icon");
            var titles = featureModel.get("title") || {};
            var iconsMap;
            var titlesMap;
            if (isString$1(icons)) {
              iconsMap = {};
              iconsMap[featureName] = icons;
            } else {
              iconsMap = icons;
            }
            if (isString$1(titles)) {
              titlesMap = {};
              titlesMap[featureName] = titles;
            } else {
              titlesMap = titles;
            }
            var iconPaths = featureModel.iconPaths = {};
            each$f(iconsMap, function(iconStr, iconName) {
              var path = createIcon(iconStr, {}, {
                x: -itemSize2 / 2,
                y: -itemSize2 / 2,
                width: itemSize2,
                height: itemSize2
              });
              path.setStyle(iconStyleModel.getItemStyle());
              var pathEmphasisState = path.ensureState("emphasis");
              pathEmphasisState.style = iconStyleEmphasisModel.getItemStyle();
              var textContent = new ZRText({
                style: {
                  text: titlesMap[iconName],
                  align: iconStyleEmphasisModel.get("textAlign"),
                  borderRadius: iconStyleEmphasisModel.get("textBorderRadius"),
                  padding: iconStyleEmphasisModel.get("textPadding"),
                  fill: null,
                  font: getFont({
                    fontStyle: iconStyleEmphasisModel.get("textFontStyle"),
                    fontFamily: iconStyleEmphasisModel.get("textFontFamily"),
                    fontSize: iconStyleEmphasisModel.get("textFontSize"),
                    fontWeight: iconStyleEmphasisModel.get("textFontWeight")
                  }, ecModel)
                },
                ignore: true
              });
              path.setTextContent(textContent);
              setTooltipConfig({
                el: path,
                componentModel: toolboxModel,
                itemName: iconName,
                formatterParamsExtra: {
                  title: titlesMap[iconName]
                }
              });
              path.__title = titlesMap[iconName];
              path.on("mouseover", function() {
                var hoverStyle = iconStyleEmphasisModel.getItemStyle();
                var defaultTextPosition = isVertical ? toolboxModel.get("right") == null && toolboxModel.get("left") !== "right" ? "right" : "left" : toolboxModel.get("bottom") == null && toolboxModel.get("top") !== "bottom" ? "bottom" : "top";
                textContent.setStyle({
                  fill: iconStyleEmphasisModel.get("textFill") || hoverStyle.fill || hoverStyle.stroke || "#000",
                  backgroundColor: iconStyleEmphasisModel.get("textBackgroundColor")
                });
                path.setTextConfig({
                  position: iconStyleEmphasisModel.get("textPosition") || defaultTextPosition
                });
                textContent.ignore = !toolboxModel.get("showTitle");
                api2.enterEmphasis(this);
              }).on("mouseout", function() {
                if (featureModel.get(["iconStatus", iconName]) !== "emphasis") {
                  api2.leaveEmphasis(this);
                }
                textContent.hide();
              });
              (featureModel.get(["iconStatus", iconName]) === "emphasis" ? enterEmphasis : leaveEmphasis)(path);
              group.add(path);
              path.on("click", bind$2(feature.onclick, feature, ecModel, api2, iconName));
              iconPaths[iconName] = path;
            });
          }
          layout(group, toolboxModel, api2);
          group.add(makeBackground(group.getBoundingRect(), toolboxModel));
          isVertical || group.eachChild(function(icon) {
            var titleText = icon.__title;
            var emphasisState = icon.ensureState("emphasis");
            var emphasisTextConfig = emphasisState.textConfig || (emphasisState.textConfig = {});
            var textContent = icon.getTextContent();
            var emphasisTextState = textContent && textContent.ensureState("emphasis");
            if (emphasisTextState && !isFunction$1(emphasisTextState) && titleText) {
              var emphasisTextStyle = emphasisTextState.style || (emphasisTextState.style = {});
              var rect = getBoundingRect(titleText, ZRText.makeFont(emphasisTextStyle));
              var offsetX = icon.x + group.x;
              var offsetY = icon.y + group.y + itemSize2;
              var needPutOnTop = false;
              if (offsetY + rect.height > api2.getHeight()) {
                emphasisTextConfig.position = "top";
                needPutOnTop = true;
              }
              var topOffset = needPutOnTop ? -5 - rect.height : itemSize2 + 10;
              if (offsetX + rect.width / 2 > api2.getWidth()) {
                emphasisTextConfig.position = ["100%", topOffset];
                emphasisTextStyle.align = "right";
              } else if (offsetX - rect.width / 2 < 0) {
                emphasisTextConfig.position = [0, topOffset];
                emphasisTextStyle.align = "left";
              }
            }
          });
        };
        ToolboxView2.prototype.updateView = function(toolboxModel, ecModel, api2, payload) {
          each$f(this._features, function(feature) {
            feature instanceof ToolboxFeature && feature.updateView && feature.updateView(feature.model, ecModel, api2, payload);
          });
        };
        ToolboxView2.prototype.remove = function(ecModel, api2) {
          each$f(this._features, function(feature) {
            feature instanceof ToolboxFeature && feature.remove && feature.remove(ecModel, api2);
          });
          this.group.removeAll();
        };
        ToolboxView2.prototype.dispose = function(ecModel, api2) {
          each$f(this._features, function(feature) {
            feature instanceof ToolboxFeature && feature.dispose && feature.dispose(ecModel, api2);
          });
        };
        ToolboxView2.type = "toolbox";
        return ToolboxView2;
      }(ComponentView)
    );
    function isUserFeatureName(featureName) {
      return featureName.indexOf("my") === 0;
    }
    var SaveAsImage = (
      /** @class */
      function(_super) {
        __extends$1(SaveAsImage2, _super);
        function SaveAsImage2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        SaveAsImage2.prototype.onclick = function(ecModel, api2) {
          var model = this.model;
          var title = model.get("name") || ecModel.get("title.0.text") || "echarts";
          var isSvg = api2.getZr().painter.getType() === "svg";
          var type = isSvg ? "svg" : model.get("type", true) || "png";
          var url = api2.getConnectedDataURL({
            type,
            backgroundColor: model.get("backgroundColor", true) || ecModel.get("backgroundColor") || "#fff",
            connectedBackgroundColor: model.get("connectedBackgroundColor"),
            excludeComponents: model.get("excludeComponents"),
            pixelRatio: model.get("pixelRatio")
          });
          var browser = env.browser;
          if (typeof MouseEvent === "function" && (browser.newEdge || !browser.ie && !browser.edge)) {
            var $a = document.createElement("a");
            $a.download = title + "." + type;
            $a.target = "_blank";
            $a.href = url;
            var evt = new MouseEvent("click", {
              // some micro front-end framework， window maybe is a Proxy
              view: document.defaultView,
              bubbles: true,
              cancelable: false
            });
            $a.dispatchEvent(evt);
          } else {
            if (window.navigator.msSaveOrOpenBlob || isSvg) {
              var parts = url.split(",");
              var base64Encoded = parts[0].indexOf("base64") > -1;
              var bstr = isSvg ? decodeURIComponent(parts[1]) : parts[1];
              base64Encoded && (bstr = window.atob(bstr));
              var filename = title + "." + type;
              if (window.navigator.msSaveOrOpenBlob) {
                var n = bstr.length;
                var u8arr = new Uint8Array(n);
                while (n--) {
                  u8arr[n] = bstr.charCodeAt(n);
                }
                var blob = new Blob([u8arr]);
                window.navigator.msSaveOrOpenBlob(blob, filename);
              } else {
                var frame = document.createElement("iframe");
                document.body.appendChild(frame);
                var cw = frame.contentWindow;
                var doc2 = cw.document;
                doc2.open("image/svg+xml", "replace");
                doc2.write(bstr);
                doc2.close();
                cw.focus();
                doc2.execCommand("SaveAs", true, filename);
                document.body.removeChild(frame);
              }
            } else {
              var lang = model.get("lang");
              var html = '<body style="margin:0;"><img src="' + url + '" style="max-width:100%;" title="' + (lang && lang[0] || "") + '" /></body>';
              var tab = window.open();
              tab.document.write(html);
              tab.document.title = title;
            }
          }
        };
        SaveAsImage2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
            title: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "title"]),
            type: "png",
            // Default use option.backgroundColor
            // backgroundColor: '#fff',
            connectedBackgroundColor: "#fff",
            name: "",
            excludeComponents: ["toolbox"],
            // use current pixel ratio of device by default
            // pixelRatio: 1,
            lang: ecModel.getLocaleModel().get(["toolbox", "saveAsImage", "lang"])
          };
          return defaultOption2;
        };
        return SaveAsImage2;
      }(ToolboxFeature)
    );
    var INNER_STACK_KEYWORD = "__ec_magicType_stack__";
    var radioTypes = [["line", "bar"], ["stack"]];
    var MagicType = (
      /** @class */
      function(_super) {
        __extends$1(MagicType2, _super);
        function MagicType2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        MagicType2.prototype.getIcons = function() {
          var model = this.model;
          var availableIcons = model.get("icon");
          var icons = {};
          each$f(model.get("type"), function(type) {
            if (availableIcons[type]) {
              icons[type] = availableIcons[type];
            }
          });
          return icons;
        };
        MagicType2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            type: [],
            // Icon group
            icon: {
              line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
              bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
              // eslint-disable-next-line
              stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
              // jshint ignore:line
            },
            // `line`, `bar`, `stack`, `tiled`
            title: ecModel.getLocaleModel().get(["toolbox", "magicType", "title"]),
            option: {},
            seriesIndex: {}
          };
          return defaultOption2;
        };
        MagicType2.prototype.onclick = function(ecModel, api2, type) {
          var model = this.model;
          var seriesIndex = model.get(["seriesIndex", type]);
          if (!seriesOptGenreator[type]) {
            return;
          }
          var newOption = {
            series: []
          };
          var generateNewSeriesTypes = function(seriesModel) {
            var seriesType2 = seriesModel.subType;
            var seriesId = seriesModel.id;
            var newSeriesOpt = seriesOptGenreator[type](seriesType2, seriesId, seriesModel, model);
            if (newSeriesOpt) {
              defaults$1(newSeriesOpt, seriesModel.option);
              newOption.series.push(newSeriesOpt);
            }
            var coordSys = seriesModel.coordinateSystem;
            if (coordSys && coordSys.type === "cartesian2d" && (type === "line" || type === "bar")) {
              var categoryAxis2 = coordSys.getAxesByScale("ordinal")[0];
              if (categoryAxis2) {
                var axisDim = categoryAxis2.dim;
                var axisType = axisDim + "Axis";
                var axisModel = seriesModel.getReferringComponents(axisType, SINGLE_REFERRING).models[0];
                var axisIndex = axisModel.componentIndex;
                newOption[axisType] = newOption[axisType] || [];
                for (var i2 = 0; i2 <= axisIndex; i2++) {
                  newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {};
                }
                newOption[axisType][axisIndex].boundaryGap = type === "bar";
              }
            }
          };
          each$f(radioTypes, function(radio) {
            if (indexOf(radio, type) >= 0) {
              each$f(radio, function(item) {
                model.setIconStatus(item, "normal");
              });
            }
          });
          model.setIconStatus(type, "emphasis");
          ecModel.eachComponent({
            mainType: "series",
            query: seriesIndex == null ? null : {
              seriesIndex
            }
          }, generateNewSeriesTypes);
          var newTitle;
          var currentType = type;
          if (type === "stack") {
            newTitle = merge$1({
              stack: model.option.title.tiled,
              tiled: model.option.title.stack
            }, model.option.title);
            if (model.get(["iconStatus", type]) !== "emphasis") {
              currentType = "tiled";
            }
          }
          api2.dispatchAction({
            type: "changeMagicType",
            currentType,
            newOption,
            newTitle,
            featureName: "magicType"
          });
        };
        return MagicType2;
      }(ToolboxFeature)
    );
    var seriesOptGenreator = {
      "line": function(seriesType2, seriesId, seriesModel, model) {
        if (seriesType2 === "bar") {
          return merge$1({
            id: seriesId,
            type: "line",
            // Preserve data related option
            data: seriesModel.get("data"),
            stack: seriesModel.get("stack"),
            markPoint: seriesModel.get("markPoint"),
            markLine: seriesModel.get("markLine")
          }, model.get(["option", "line"]) || {}, true);
        }
      },
      "bar": function(seriesType2, seriesId, seriesModel, model) {
        if (seriesType2 === "line") {
          return merge$1({
            id: seriesId,
            type: "bar",
            // Preserve data related option
            data: seriesModel.get("data"),
            stack: seriesModel.get("stack"),
            markPoint: seriesModel.get("markPoint"),
            markLine: seriesModel.get("markLine")
          }, model.get(["option", "bar"]) || {}, true);
        }
      },
      "stack": function(seriesType2, seriesId, seriesModel, model) {
        var isStack = seriesModel.get("stack") === INNER_STACK_KEYWORD;
        if (seriesType2 === "line" || seriesType2 === "bar") {
          model.setIconStatus("stack", isStack ? "normal" : "emphasis");
          return merge$1({
            id: seriesId,
            stack: isStack ? "" : INNER_STACK_KEYWORD
          }, model.get(["option", "stack"]) || {}, true);
        }
      }
    };
    registerAction$1({
      type: "changeMagicType",
      event: "magicTypeChanged",
      update: "prepareAndUpdate"
    }, function(payload, ecModel) {
      ecModel.mergeOption(payload.newOption);
    });
    var BLOCK_SPLITER = new Array(60).join("-");
    var ITEM_SPLITER = "	";
    function groupSeries(ecModel) {
      var seriesGroupByCategoryAxis = {};
      var otherSeries = [];
      var meta = [];
      ecModel.eachRawSeries(function(seriesModel) {
        var coordSys = seriesModel.coordinateSystem;
        if (coordSys && (coordSys.type === "cartesian2d" || coordSys.type === "polar")) {
          var baseAxis = coordSys.getBaseAxis();
          if (baseAxis.type === "category") {
            var key = baseAxis.dim + "_" + baseAxis.index;
            if (!seriesGroupByCategoryAxis[key]) {
              seriesGroupByCategoryAxis[key] = {
                categoryAxis: baseAxis,
                valueAxis: coordSys.getOtherAxis(baseAxis),
                series: []
              };
              meta.push({
                axisDim: baseAxis.dim,
                axisIndex: baseAxis.index
              });
            }
            seriesGroupByCategoryAxis[key].series.push(seriesModel);
          } else {
            otherSeries.push(seriesModel);
          }
        } else {
          otherSeries.push(seriesModel);
        }
      });
      return {
        seriesGroupByCategoryAxis,
        other: otherSeries,
        meta
      };
    }
    function assembleSeriesWithCategoryAxis(groups) {
      var tables = [];
      each$f(groups, function(group, key) {
        var categoryAxis2 = group.categoryAxis;
        var valueAxis2 = group.valueAxis;
        var valueAxisDim = valueAxis2.dim;
        var headers = [" "].concat(map$1(group.series, function(series) {
          return series.name;
        }));
        var columns2 = [categoryAxis2.model.getCategories()];
        each$f(group.series, function(series) {
          var rawData = series.getRawData();
          columns2.push(series.getRawData().mapArray(rawData.mapDimension(valueAxisDim), function(val) {
            return val;
          }));
        });
        var lines = [headers.join(ITEM_SPLITER)];
        for (var i2 = 0; i2 < columns2[0].length; i2++) {
          var items = [];
          for (var j = 0; j < columns2.length; j++) {
            items.push(columns2[j][i2]);
          }
          lines.push(items.join(ITEM_SPLITER));
        }
        tables.push(lines.join("\n"));
      });
      return tables.join("\n\n" + BLOCK_SPLITER + "\n\n");
    }
    function assembleOtherSeries(series) {
      return map$1(series, function(series2) {
        var data = series2.getRawData();
        var lines = [series2.name];
        var vals = [];
        data.each(data.dimensions, function() {
          var argLen = arguments.length;
          var dataIndex = arguments[argLen - 1];
          var name = data.getName(dataIndex);
          for (var i2 = 0; i2 < argLen - 1; i2++) {
            vals[i2] = arguments[i2];
          }
          lines.push((name ? name + ITEM_SPLITER : "") + vals.join(ITEM_SPLITER));
        });
        return lines.join("\n");
      }).join("\n\n" + BLOCK_SPLITER + "\n\n");
    }
    function getContentFromModel(ecModel) {
      var result = groupSeries(ecModel);
      return {
        value: filter([assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis), assembleOtherSeries(result.other)], function(str) {
          return !!str.replace(/[\n\t\s]/g, "");
        }).join("\n\n" + BLOCK_SPLITER + "\n\n"),
        meta: result.meta
      };
    }
    function trim$1(str) {
      return str.replace(/^\s\s*/, "").replace(/\s\s*$/, "");
    }
    function isTSVFormat(block) {
      var firstLine = block.slice(0, block.indexOf("\n"));
      if (firstLine.indexOf(ITEM_SPLITER) >= 0) {
        return true;
      }
    }
    var itemSplitRegex = new RegExp("[" + ITEM_SPLITER + "]+", "g");
    function parseTSVContents(tsv) {
      var tsvLines = tsv.split(/\n+/g);
      var headers = trim$1(tsvLines.shift()).split(itemSplitRegex);
      var categories = [];
      var series = map$1(headers, function(header) {
        return {
          name: header,
          data: []
        };
      });
      for (var i2 = 0; i2 < tsvLines.length; i2++) {
        var items = trim$1(tsvLines[i2]).split(itemSplitRegex);
        categories.push(items.shift());
        for (var j = 0; j < items.length; j++) {
          series[j] && (series[j].data[i2] = items[j]);
        }
      }
      return {
        series,
        categories
      };
    }
    function parseListContents(str) {
      var lines = str.split(/\n+/g);
      var seriesName = trim$1(lines.shift());
      var data = [];
      for (var i2 = 0; i2 < lines.length; i2++) {
        var line = trim$1(lines[i2]);
        if (!line) {
          continue;
        }
        var items = line.split(itemSplitRegex);
        var name_1 = "";
        var value = void 0;
        var hasName = false;
        if (isNaN(items[0])) {
          hasName = true;
          name_1 = items[0];
          items = items.slice(1);
          data[i2] = {
            name: name_1,
            value: []
          };
          value = data[i2].value;
        } else {
          value = data[i2] = [];
        }
        for (var j = 0; j < items.length; j++) {
          value.push(+items[j]);
        }
        if (value.length === 1) {
          hasName ? data[i2].value = value[0] : data[i2] = value[0];
        }
      }
      return {
        name: seriesName,
        data
      };
    }
    function parseContents(str, blockMetaList) {
      var blocks = str.split(new RegExp("\n*" + BLOCK_SPLITER + "\n*", "g"));
      var newOption = {
        series: []
      };
      each$f(blocks, function(block, idx) {
        if (isTSVFormat(block)) {
          var result = parseTSVContents(block);
          var blockMeta = blockMetaList[idx];
          var axisKey = blockMeta.axisDim + "Axis";
          if (blockMeta) {
            newOption[axisKey] = newOption[axisKey] || [];
            newOption[axisKey][blockMeta.axisIndex] = {
              data: result.categories
            };
            newOption.series = newOption.series.concat(result.series);
          }
        } else {
          var result = parseListContents(block);
          newOption.series.push(result);
        }
      });
      return newOption;
    }
    var DataView$1 = (
      /** @class */
      function(_super) {
        __extends$1(DataView2, _super);
        function DataView2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        DataView2.prototype.onclick = function(ecModel, api2) {
          setTimeout(function() {
            api2.dispatchAction({
              type: "hideTip"
            });
          });
          var container = api2.getDom();
          var model = this.model;
          if (this._dom) {
            container.removeChild(this._dom);
          }
          var root2 = document.createElement("div");
          root2.style.cssText = "position:absolute;top:0;bottom:0;left:0;right:0;padding:5px";
          root2.style.backgroundColor = model.get("backgroundColor") || "#fff";
          var header = document.createElement("h4");
          var lang = model.get("lang") || [];
          header.innerHTML = lang[0] || model.get("title");
          header.style.cssText = "margin:10px 20px";
          header.style.color = model.get("textColor");
          var viewMain = document.createElement("div");
          var textarea = document.createElement("textarea");
          viewMain.style.cssText = "overflow:auto";
          var optionToContent = model.get("optionToContent");
          var contentToOption = model.get("contentToOption");
          var result = getContentFromModel(ecModel);
          if (isFunction$1(optionToContent)) {
            var htmlOrDom = optionToContent(api2.getOption());
            if (isString$1(htmlOrDom)) {
              viewMain.innerHTML = htmlOrDom;
            } else if (isDom(htmlOrDom)) {
              viewMain.appendChild(htmlOrDom);
            }
          } else {
            textarea.readOnly = model.get("readOnly");
            var style = textarea.style;
            style.cssText = "display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none";
            style.color = model.get("textColor");
            style.borderColor = model.get("textareaBorderColor");
            style.backgroundColor = model.get("textareaColor");
            textarea.value = result.value;
            viewMain.appendChild(textarea);
          }
          var blockMetaList = result.meta;
          var buttonContainer = document.createElement("div");
          buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
          var buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px";
          var closeButton = document.createElement("div");
          var refreshButton = document.createElement("div");
          buttonStyle += ";background-color:" + model.get("buttonColor");
          buttonStyle += ";color:" + model.get("buttonTextColor");
          var self2 = this;
          function close2() {
            container.removeChild(root2);
            self2._dom = null;
          }
          addEventListener(closeButton, "click", close2);
          addEventListener(refreshButton, "click", function() {
            if (contentToOption == null && optionToContent != null || contentToOption != null && optionToContent == null) {
              close2();
              return;
            }
            var newOption;
            try {
              if (isFunction$1(contentToOption)) {
                newOption = contentToOption(viewMain, api2.getOption());
              } else {
                newOption = parseContents(textarea.value, blockMetaList);
              }
            } catch (e2) {
              close2();
              throw new Error("Data view format error " + e2);
            }
            if (newOption) {
              api2.dispatchAction({
                type: "changeDataView",
                newOption
              });
            }
            close2();
          });
          closeButton.innerHTML = lang[1];
          refreshButton.innerHTML = lang[2];
          refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;
          !model.get("readOnly") && buttonContainer.appendChild(refreshButton);
          buttonContainer.appendChild(closeButton);
          root2.appendChild(header);
          root2.appendChild(viewMain);
          root2.appendChild(buttonContainer);
          viewMain.style.height = container.clientHeight - 80 + "px";
          container.appendChild(root2);
          this._dom = root2;
        };
        DataView2.prototype.remove = function(ecModel, api2) {
          this._dom && api2.getDom().removeChild(this._dom);
        };
        DataView2.prototype.dispose = function(ecModel, api2) {
          this.remove(ecModel, api2);
        };
        DataView2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            readOnly: false,
            optionToContent: null,
            contentToOption: null,
            // eslint-disable-next-line
            icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
            title: ecModel.getLocaleModel().get(["toolbox", "dataView", "title"]),
            lang: ecModel.getLocaleModel().get(["toolbox", "dataView", "lang"]),
            backgroundColor: "#fff",
            textColor: "#000",
            textareaColor: "#fff",
            textareaBorderColor: "#333",
            buttonColor: "#c23531",
            buttonTextColor: "#fff"
          };
          return defaultOption2;
        };
        return DataView2;
      }(ToolboxFeature)
    );
    function tryMergeDataOption(newData, originalData) {
      return map$1(newData, function(newVal, idx) {
        var original = originalData && originalData[idx];
        if (isObject$5(original) && !isArray$2(original)) {
          var newValIsObject = isObject$5(newVal) && !isArray$2(newVal);
          if (!newValIsObject) {
            newVal = {
              value: newVal
            };
          }
          var shouldDeleteName = original.name != null && newVal.name == null;
          newVal = defaults$1(newVal, original);
          shouldDeleteName && delete newVal.name;
          return newVal;
        } else {
          return newVal;
        }
      });
    }
    registerAction$1({
      type: "changeDataView",
      event: "dataViewChanged",
      update: "prepareAndUpdate"
    }, function(payload, ecModel) {
      var newSeriesOptList = [];
      each$f(payload.newOption.series, function(seriesOpt) {
        var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];
        if (!seriesModel) {
          newSeriesOptList.push(extend$1({
            // Default is scatter
            type: "scatter"
          }, seriesOpt));
        } else {
          var originalData = seriesModel.get("data");
          newSeriesOptList.push({
            name: seriesOpt.name,
            data: tryMergeDataOption(seriesOpt.data, originalData)
          });
        }
      });
      ecModel.mergeOption(defaults$1({
        series: newSeriesOptList
      }, payload.newOption));
    });
    var each$6 = each$f;
    var inner$6 = makeInner();
    function push(ecModel, newSnapshot) {
      var storedSnapshots = getStoreSnapshots(ecModel);
      each$6(newSnapshot, function(batchItem, dataZoomId) {
        var i2 = storedSnapshots.length - 1;
        for (; i2 >= 0; i2--) {
          var snapshot = storedSnapshots[i2];
          if (snapshot[dataZoomId]) {
            break;
          }
        }
        if (i2 < 0) {
          var dataZoomModel = ecModel.queryComponents({
            mainType: "dataZoom",
            subType: "select",
            id: dataZoomId
          })[0];
          if (dataZoomModel) {
            var percentRange = dataZoomModel.getPercentRange();
            storedSnapshots[0][dataZoomId] = {
              dataZoomId,
              start: percentRange[0],
              end: percentRange[1]
            };
          }
        }
      });
      storedSnapshots.push(newSnapshot);
    }
    function pop(ecModel) {
      var storedSnapshots = getStoreSnapshots(ecModel);
      var head = storedSnapshots[storedSnapshots.length - 1];
      storedSnapshots.length > 1 && storedSnapshots.pop();
      var snapshot = {};
      each$6(head, function(batchItem, dataZoomId) {
        for (var i2 = storedSnapshots.length - 1; i2 >= 0; i2--) {
          batchItem = storedSnapshots[i2][dataZoomId];
          if (batchItem) {
            snapshot[dataZoomId] = batchItem;
            break;
          }
        }
      });
      return snapshot;
    }
    function clear(ecModel) {
      inner$6(ecModel).snapshots = null;
    }
    function count(ecModel) {
      return getStoreSnapshots(ecModel).length;
    }
    function getStoreSnapshots(ecModel) {
      var store2 = inner$6(ecModel);
      if (!store2.snapshots) {
        store2.snapshots = [{}];
      }
      return store2.snapshots;
    }
    var RestoreOption = (
      /** @class */
      function(_super) {
        __extends$1(RestoreOption2, _super);
        function RestoreOption2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        RestoreOption2.prototype.onclick = function(ecModel, api2) {
          clear(ecModel);
          api2.dispatchAction({
            type: "restore",
            from: this.uid
          });
        };
        RestoreOption2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            // eslint-disable-next-line
            icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
            title: ecModel.getLocaleModel().get(["toolbox", "restore", "title"])
          };
          return defaultOption2;
        };
        return RestoreOption2;
      }(ToolboxFeature)
    );
    registerAction$1({
      type: "restore",
      event: "restore",
      update: "prepareAndUpdate"
    }, function(payload, ecModel) {
      ecModel.resetOption("recreate");
    });
    var INCLUDE_FINDER_MAIN_TYPES = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];
    var BrushTargetManager = (
      /** @class */
      function() {
        function BrushTargetManager2(finder, ecModel, opt) {
          var _this = this;
          this._targetInfoList = [];
          var foundCpts = parseFinder(ecModel, finder);
          each$f(targetInfoBuilders, function(builder, type) {
            if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {
              builder(foundCpts, _this._targetInfoList);
            }
          });
        }
        BrushTargetManager2.prototype.setOutputRanges = function(areas, ecModel) {
          this.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
            (area.coordRanges || (area.coordRanges = [])).push(coordRange);
            if (!area.coordRange) {
              area.coordRange = coordRange;
              var result = coordConvert[area.brushType](0, coordSys, coordRange);
              area.__rangeOffset = {
                offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),
                xyMinMax: result.xyMinMax
              };
            }
          });
          return areas;
        };
        BrushTargetManager2.prototype.matchOutputRanges = function(areas, ecModel, cb) {
          each$f(areas, function(area) {
            var targetInfo = this.findTargetInfo(area, ecModel);
            if (targetInfo && targetInfo !== true) {
              each$f(targetInfo.coordSyses, function(coordSys) {
                var result = coordConvert[area.brushType](1, coordSys, area.range, true);
                cb(area, result.values, coordSys, ecModel);
              });
            }
          }, this);
        };
        BrushTargetManager2.prototype.setInputRanges = function(areas, ecModel) {
          each$f(areas, function(area) {
            var targetInfo = this.findTargetInfo(area, ecModel);
            area.range = area.range || [];
            if (targetInfo && targetInfo !== true) {
              area.panelId = targetInfo.panelId;
              var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);
              var rangeOffset = area.__rangeOffset;
              area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;
            }
          }, this);
        };
        BrushTargetManager2.prototype.makePanelOpts = function(api2, getDefaultBrushType) {
          return map$1(this._targetInfoList, function(targetInfo) {
            var rect = targetInfo.getPanelRect();
            return {
              panelId: targetInfo.panelId,
              defaultBrushType: getDefaultBrushType ? getDefaultBrushType(targetInfo) : null,
              clipPath: makeRectPanelClipPath(rect),
              isTargetByCursor: makeRectIsTargetByCursor(rect, api2, targetInfo.coordSysModel),
              getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect)
            };
          });
        };
        BrushTargetManager2.prototype.controlSeries = function(area, seriesModel, ecModel) {
          var targetInfo = this.findTargetInfo(area, ecModel);
          return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;
        };
        BrushTargetManager2.prototype.findTargetInfo = function(area, ecModel) {
          var targetInfoList = this._targetInfoList;
          var foundCpts = parseFinder(ecModel, area);
          for (var i2 = 0; i2 < targetInfoList.length; i2++) {
            var targetInfo = targetInfoList[i2];
            var areaPanelId = area.panelId;
            if (areaPanelId) {
              if (targetInfo.panelId === areaPanelId) {
                return targetInfo;
              }
            } else {
              for (var j = 0; j < targetInfoMatchers.length; j++) {
                if (targetInfoMatchers[j](foundCpts, targetInfo)) {
                  return targetInfo;
                }
              }
            }
          }
          return true;
        };
        return BrushTargetManager2;
      }()
    );
    function formatMinMax(minMax) {
      minMax[0] > minMax[1] && minMax.reverse();
      return minMax;
    }
    function parseFinder(ecModel, finder) {
      return parseFinder$1(ecModel, finder, {
        includeMainTypes: INCLUDE_FINDER_MAIN_TYPES
      });
    }
    var targetInfoBuilders = {
      grid: function(foundCpts, targetInfoList) {
        var xAxisModels = foundCpts.xAxisModels;
        var yAxisModels = foundCpts.yAxisModels;
        var gridModels = foundCpts.gridModels;
        var gridModelMap = createHashMap();
        var xAxesHas = {};
        var yAxesHas = {};
        if (!xAxisModels && !yAxisModels && !gridModels) {
          return;
        }
        each$f(xAxisModels, function(axisModel) {
          var gridModel = axisModel.axis.grid.model;
          gridModelMap.set(gridModel.id, gridModel);
          xAxesHas[gridModel.id] = true;
        });
        each$f(yAxisModels, function(axisModel) {
          var gridModel = axisModel.axis.grid.model;
          gridModelMap.set(gridModel.id, gridModel);
          yAxesHas[gridModel.id] = true;
        });
        each$f(gridModels, function(gridModel) {
          gridModelMap.set(gridModel.id, gridModel);
          xAxesHas[gridModel.id] = true;
          yAxesHas[gridModel.id] = true;
        });
        gridModelMap.each(function(gridModel) {
          var grid = gridModel.coordinateSystem;
          var cartesians = [];
          each$f(grid.getCartesians(), function(cartesian, index) {
            if (indexOf(xAxisModels, cartesian.getAxis("x").model) >= 0 || indexOf(yAxisModels, cartesian.getAxis("y").model) >= 0) {
              cartesians.push(cartesian);
            }
          });
          targetInfoList.push({
            panelId: "grid--" + gridModel.id,
            gridModel,
            coordSysModel: gridModel,
            // Use the first one as the representitive coordSys.
            coordSys: cartesians[0],
            coordSyses: cartesians,
            getPanelRect: panelRectBuilders.grid,
            xAxisDeclared: xAxesHas[gridModel.id],
            yAxisDeclared: yAxesHas[gridModel.id]
          });
        });
      },
      geo: function(foundCpts, targetInfoList) {
        each$f(foundCpts.geoModels, function(geoModel) {
          var coordSys = geoModel.coordinateSystem;
          targetInfoList.push({
            panelId: "geo--" + geoModel.id,
            geoModel,
            coordSysModel: geoModel,
            coordSys,
            coordSyses: [coordSys],
            getPanelRect: panelRectBuilders.geo
          });
        });
      }
    };
    var targetInfoMatchers = [
      // grid
      function(foundCpts, targetInfo) {
        var xAxisModel = foundCpts.xAxisModel;
        var yAxisModel = foundCpts.yAxisModel;
        var gridModel = foundCpts.gridModel;
        !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);
        !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);
        return gridModel && gridModel === targetInfo.gridModel;
      },
      // geo
      function(foundCpts, targetInfo) {
        var geoModel = foundCpts.geoModel;
        return geoModel && geoModel === targetInfo.geoModel;
      }
    ];
    var panelRectBuilders = {
      grid: function() {
        return this.coordSys.master.getRect().clone();
      },
      geo: function() {
        var coordSys = this.coordSys;
        var rect = coordSys.getBoundingRect().clone();
        rect.applyTransform(getTransform$1(coordSys));
        return rect;
      }
    };
    var coordConvert = {
      lineX: curry$1(axisConvert, 0),
      lineY: curry$1(axisConvert, 1),
      rect: function(to, coordSys, rangeOrCoordRange, clamp2) {
        var xminymin = to ? coordSys.pointToData([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp2) : coordSys.dataToPoint([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]], clamp2);
        var xmaxymax = to ? coordSys.pointToData([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp2) : coordSys.dataToPoint([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]], clamp2);
        var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];
        return {
          values,
          xyMinMax: values
        };
      },
      polygon: function(to, coordSys, rangeOrCoordRange, clamp2) {
        var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];
        var values = map$1(rangeOrCoordRange, function(item) {
          var p2 = to ? coordSys.pointToData(item, clamp2) : coordSys.dataToPoint(item, clamp2);
          xyMinMax[0][0] = Math.min(xyMinMax[0][0], p2[0]);
          xyMinMax[1][0] = Math.min(xyMinMax[1][0], p2[1]);
          xyMinMax[0][1] = Math.max(xyMinMax[0][1], p2[0]);
          xyMinMax[1][1] = Math.max(xyMinMax[1][1], p2[1]);
          return p2;
        });
        return {
          values,
          xyMinMax
        };
      }
    };
    function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {
      var axis = coordSys.getAxis(["x", "y"][axisNameIndex]);
      var values = formatMinMax(map$1([0, 1], function(i2) {
        return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i2]), true) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i2]));
      }));
      var xyMinMax = [];
      xyMinMax[axisNameIndex] = values;
      xyMinMax[1 - axisNameIndex] = [NaN, NaN];
      return {
        values,
        xyMinMax
      };
    }
    var diffProcessor = {
      lineX: curry$1(axisDiffProcessor, 0),
      lineY: curry$1(axisDiffProcessor, 1),
      rect: function(values, refer, scales) {
        return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];
      },
      polygon: function(values, refer, scales) {
        return map$1(values, function(item, idx) {
          return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];
        });
      }
    };
    function axisDiffProcessor(axisNameIndex, values, refer, scales) {
      return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];
    }
    function getScales(xyMinMaxCurr, xyMinMaxOrigin) {
      var sizeCurr = getSize(xyMinMaxCurr);
      var sizeOrigin = getSize(xyMinMaxOrigin);
      var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];
      isNaN(scales[0]) && (scales[0] = 1);
      isNaN(scales[1]) && (scales[1] = 1);
      return scales;
    }
    function getSize(xyMinMax) {
      return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];
    }
    var each$5 = each$f;
    var DATA_ZOOM_ID_BASE = makeInternalComponentId("toolbox-dataZoom_");
    var DataZoomFeature = (
      /** @class */
      function(_super) {
        __extends$1(DataZoomFeature2, _super);
        function DataZoomFeature2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        DataZoomFeature2.prototype.render = function(featureModel, ecModel, api2, payload) {
          if (!this._brushController) {
            this._brushController = new BrushController(api2.getZr());
            this._brushController.on("brush", bind$2(this._onBrush, this)).mount();
          }
          updateZoomBtnStatus(featureModel, ecModel, this, payload, api2);
          updateBackBtnStatus(featureModel, ecModel);
        };
        DataZoomFeature2.prototype.onclick = function(ecModel, api2, type) {
          handlers[type].call(this);
        };
        DataZoomFeature2.prototype.remove = function(ecModel, api2) {
          this._brushController && this._brushController.unmount();
        };
        DataZoomFeature2.prototype.dispose = function(ecModel, api2) {
          this._brushController && this._brushController.dispose();
        };
        DataZoomFeature2.prototype._onBrush = function(eventParam) {
          var areas = eventParam.areas;
          if (!eventParam.isEnd || !areas.length) {
            return;
          }
          var snapshot = {};
          var ecModel = this.ecModel;
          this._brushController.updateCovers([]);
          var brushTargetManager = new BrushTargetManager(makeAxisFinder(this.model), ecModel, {
            include: ["grid"]
          });
          brushTargetManager.matchOutputRanges(areas, ecModel, function(area, coordRange, coordSys) {
            if (coordSys.type !== "cartesian2d") {
              return;
            }
            var brushType = area.brushType;
            if (brushType === "rect") {
              setBatch("x", coordSys, coordRange[0]);
              setBatch("y", coordSys, coordRange[1]);
            } else {
              setBatch({
                lineX: "x",
                lineY: "y"
              }[brushType], coordSys, coordRange);
            }
          });
          push(ecModel, snapshot);
          this._dispatchZoomAction(snapshot);
          function setBatch(dimName, coordSys, minMax) {
            var axis = coordSys.getAxis(dimName);
            var axisModel = axis.model;
            var dataZoomModel = findDataZoom(dimName, axisModel, ecModel);
            var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan();
            if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) {
              minMax = sliderMove(0, minMax.slice(), axis.scale.getExtent(), 0, minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan);
            }
            dataZoomModel && (snapshot[dataZoomModel.id] = {
              dataZoomId: dataZoomModel.id,
              startValue: minMax[0],
              endValue: minMax[1]
            });
          }
          function findDataZoom(dimName, axisModel, ecModel2) {
            var found;
            ecModel2.eachComponent({
              mainType: "dataZoom",
              subType: "select"
            }, function(dzModel) {
              var has2 = dzModel.getAxisModel(dimName, axisModel.componentIndex);
              has2 && (found = dzModel);
            });
            return found;
          }
        };
        DataZoomFeature2.prototype._dispatchZoomAction = function(snapshot) {
          var batch2 = [];
          each$5(snapshot, function(batchItem, dataZoomId) {
            batch2.push(clone$4(batchItem));
          });
          batch2.length && this.api.dispatchAction({
            type: "dataZoom",
            from: this.uid,
            batch: batch2
          });
        };
        DataZoomFeature2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            filterMode: "filter",
            // Icon group
            icon: {
              zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
              back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
            },
            // `zoom`, `back`
            title: ecModel.getLocaleModel().get(["toolbox", "dataZoom", "title"]),
            brushStyle: {
              borderWidth: 0,
              color: "rgba(210,219,238,0.2)"
            }
          };
          return defaultOption2;
        };
        return DataZoomFeature2;
      }(ToolboxFeature)
    );
    var handlers = {
      zoom: function() {
        var nextActive = !this._isZoomActive;
        this.api.dispatchAction({
          type: "takeGlobalCursor",
          key: "dataZoomSelect",
          dataZoomSelectActive: nextActive
        });
      },
      back: function() {
        this._dispatchZoomAction(pop(this.ecModel));
      }
    };
    function makeAxisFinder(dzFeatureModel) {
      var setting = {
        xAxisIndex: dzFeatureModel.get("xAxisIndex", true),
        yAxisIndex: dzFeatureModel.get("yAxisIndex", true),
        xAxisId: dzFeatureModel.get("xAxisId", true),
        yAxisId: dzFeatureModel.get("yAxisId", true)
      };
      if (setting.xAxisIndex == null && setting.xAxisId == null) {
        setting.xAxisIndex = "all";
      }
      if (setting.yAxisIndex == null && setting.yAxisId == null) {
        setting.yAxisIndex = "all";
      }
      return setting;
    }
    function updateBackBtnStatus(featureModel, ecModel) {
      featureModel.setIconStatus("back", count(ecModel) > 1 ? "emphasis" : "normal");
    }
    function updateZoomBtnStatus(featureModel, ecModel, view, payload, api2) {
      var zoomActive = view._isZoomActive;
      if (payload && payload.type === "takeGlobalCursor") {
        zoomActive = payload.key === "dataZoomSelect" ? payload.dataZoomSelectActive : false;
      }
      view._isZoomActive = zoomActive;
      featureModel.setIconStatus("zoom", zoomActive ? "emphasis" : "normal");
      var brushTargetManager = new BrushTargetManager(makeAxisFinder(featureModel), ecModel, {
        include: ["grid"]
      });
      var panels = brushTargetManager.makePanelOpts(api2, function(targetInfo) {
        return targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared ? "lineX" : !targetInfo.xAxisDeclared && targetInfo.yAxisDeclared ? "lineY" : "rect";
      });
      view._brushController.setPanels(panels).enableBrush(zoomActive && panels.length ? {
        brushType: "auto",
        brushStyle: featureModel.getModel("brushStyle").getItemStyle()
      } : false);
    }
    registerInternalOptionCreator("dataZoom", function(ecModel) {
      var toolboxModel = ecModel.getComponent("toolbox", 0);
      var featureDataZoomPath = ["feature", "dataZoom"];
      if (!toolboxModel || toolboxModel.get(featureDataZoomPath) == null) {
        return;
      }
      var dzFeatureModel = toolboxModel.getModel(featureDataZoomPath);
      var dzOptions = [];
      var finder = makeAxisFinder(dzFeatureModel);
      var finderResult = parseFinder$1(ecModel, finder);
      each$5(finderResult.xAxisModels, function(axisModel) {
        return buildInternalOptions(axisModel, "xAxis", "xAxisIndex");
      });
      each$5(finderResult.yAxisModels, function(axisModel) {
        return buildInternalOptions(axisModel, "yAxis", "yAxisIndex");
      });
      function buildInternalOptions(axisModel, axisMainType, axisIndexPropName) {
        var axisIndex = axisModel.componentIndex;
        var newOpt = {
          type: "select",
          $fromToolbox: true,
          // Default to be filter
          filterMode: dzFeatureModel.get("filterMode", true) || "filter",
          // Id for merge mapping.
          id: DATA_ZOOM_ID_BASE + axisMainType + axisIndex
        };
        newOpt[axisIndexPropName] = axisIndex;
        dzOptions.push(newOpt);
      }
      return dzOptions;
    });
    function install$j(registers) {
      registers.registerComponentModel(ToolboxModel);
      registers.registerComponentView(ToolboxView);
      registerFeature("saveAsImage", SaveAsImage);
      registerFeature("magicType", MagicType);
      registerFeature("dataView", DataView$1);
      registerFeature("dataZoom", DataZoomFeature);
      registerFeature("restore", RestoreOption);
      use(install$k);
    }
    var TooltipModel = (
      /** @class */
      function(_super) {
        __extends$1(TooltipModel2, _super);
        function TooltipModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TooltipModel2.type;
          return _this;
        }
        TooltipModel2.type = "tooltip";
        TooltipModel2.dependencies = ["axisPointer"];
        TooltipModel2.defaultOption = {
          // zlevel: 0,
          z: 60,
          show: true,
          // tooltip main content
          showContent: true,
          // 'trigger' only works on coordinate system.
          // 'item' | 'axis' | 'none'
          trigger: "item",
          // 'click' | 'mousemove' | 'none'
          triggerOn: "mousemove|click",
          alwaysShowContent: false,
          displayMode: "single",
          renderMode: "auto",
          // whether restraint content inside viewRect.
          // If renderMode: 'richText', default true.
          // If renderMode: 'html', defaut false (for backward compat).
          confine: null,
          showDelay: 0,
          hideDelay: 100,
          // Animation transition time, unit is second
          transitionDuration: 0.4,
          enterable: false,
          backgroundColor: "#fff",
          // box shadow
          shadowBlur: 10,
          shadowColor: "rgba(0, 0, 0, .2)",
          shadowOffsetX: 1,
          shadowOffsetY: 2,
          // tooltip border radius, unit is px, default is 4
          borderRadius: 4,
          // tooltip border width, unit is px, default is 0 (no border)
          borderWidth: 1,
          // Tooltip inside padding, default is 5 for all direction
          // Array is allowed to set up, right, bottom, left, same with css
          // The default value: See `tooltip/tooltipMarkup.ts#getPaddingFromTooltipModel`.
          padding: null,
          // Extra css text
          extraCssText: "",
          // axis indicator, trigger by axis
          axisPointer: {
            // default is line
            // legal values: 'line' | 'shadow' | 'cross'
            type: "line",
            // Valid when type is line, appoint tooltip line locate on which line. Optional
            // legal values: 'x' | 'y' | 'angle' | 'radius' | 'auto'
            // default is 'auto', chose the axis which type is category.
            // for multiply y axis, cartesian coord chose x axis, polar chose angle axis
            axis: "auto",
            animation: "auto",
            animationDurationUpdate: 200,
            animationEasingUpdate: "exponentialOut",
            crossStyle: {
              color: "#999",
              width: 1,
              type: "dashed",
              // TODO formatter
              textStyle: {}
            }
            // lineStyle and shadowStyle should not be specified here,
            // otherwise it will always override those styles on option.axisPointer.
          },
          textStyle: {
            color: "#666",
            fontSize: 14
          }
        };
        return TooltipModel2;
      }(ComponentModel)
    );
    function shouldTooltipConfine(tooltipModel) {
      var confineOption = tooltipModel.get("confine");
      return confineOption != null ? !!confineOption : tooltipModel.get("renderMode") === "richText";
    }
    function testStyle(styleProps) {
      if (!env.domSupported) {
        return;
      }
      var style = document.documentElement.style;
      for (var i2 = 0, len2 = styleProps.length; i2 < len2; i2++) {
        if (styleProps[i2] in style) {
          return styleProps[i2];
        }
      }
    }
    var TRANSFORM_VENDOR = testStyle(["transform", "webkitTransform", "OTransform", "MozTransform", "msTransform"]);
    var TRANSITION_VENDOR = testStyle(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]);
    function toCSSVendorPrefix(styleVendor, styleProp) {
      if (!styleVendor) {
        return styleProp;
      }
      styleProp = toCamelCase$1(styleProp, true);
      var idx = styleVendor.indexOf(styleProp);
      styleVendor = idx === -1 ? styleProp : "-" + styleVendor.slice(0, idx) + "-" + styleProp;
      return styleVendor.toLowerCase();
    }
    function getComputedStyle$1(el, style) {
      var stl = el.currentStyle || document.defaultView && document.defaultView.getComputedStyle(el);
      return stl ? stl[style] : null;
    }
    var CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, "transition");
    var CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, "transform");
    var gCssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + (env.transform3dSupported ? "will-change:transform;" : "");
    function mirrorPos(pos) {
      pos = pos === "left" ? "right" : pos === "right" ? "left" : pos === "top" ? "bottom" : "top";
      return pos;
    }
    function assembleArrow(tooltipModel, borderColor, arrowPosition) {
      if (!isString$1(arrowPosition) || arrowPosition === "inside") {
        return "";
      }
      var backgroundColor2 = tooltipModel.get("backgroundColor");
      var borderWidth = tooltipModel.get("borderWidth");
      borderColor = convertToColorString(borderColor);
      var arrowPos = mirrorPos(arrowPosition);
      var arrowSize = Math.max(Math.round(borderWidth) * 1.5, 6);
      var positionStyle = "";
      var transformStyle = CSS_TRANSFORM_VENDOR + ":";
      var rotateDeg;
      if (indexOf(["left", "right"], arrowPos) > -1) {
        positionStyle += "top:50%";
        transformStyle += "translateY(-50%) rotate(" + (rotateDeg = arrowPos === "left" ? -225 : -45) + "deg)";
      } else {
        positionStyle += "left:50%";
        transformStyle += "translateX(-50%) rotate(" + (rotateDeg = arrowPos === "top" ? 225 : 45) + "deg)";
      }
      var rotateRadian = rotateDeg * Math.PI / 180;
      var arrowWH = arrowSize + borderWidth;
      var rotatedWH = arrowWH * Math.abs(Math.cos(rotateRadian)) + arrowWH * Math.abs(Math.sin(rotateRadian));
      var arrowOffset = Math.round(((rotatedWH - Math.SQRT2 * borderWidth) / 2 + Math.SQRT2 * borderWidth - (rotatedWH - arrowWH) / 2) * 100) / 100;
      positionStyle += ";" + arrowPos + ":-" + arrowOffset + "px";
      var borderStyle = borderColor + " solid " + borderWidth + "px;";
      var styleCss = ["position:absolute;width:" + arrowSize + "px;height:" + arrowSize + "px;z-index:-1;", positionStyle + ";" + transformStyle + ";", "border-bottom:" + borderStyle, "border-right:" + borderStyle, "background-color:" + backgroundColor2 + ";"];
      return '<div style="' + styleCss.join("") + '"></div>';
    }
    function assembleTransition(duration2, onlyFade) {
      var transitionCurve = "cubic-bezier(0.23,1,0.32,1)";
      var transitionOption = " " + duration2 / 2 + "s " + transitionCurve;
      var transitionText = "opacity" + transitionOption + ",visibility" + transitionOption;
      if (!onlyFade) {
        transitionOption = " " + duration2 + "s " + transitionCurve;
        transitionText += env.transformSupported ? "," + CSS_TRANSFORM_VENDOR + transitionOption : ",left" + transitionOption + ",top" + transitionOption;
      }
      return CSS_TRANSITION_VENDOR + ":" + transitionText;
    }
    function assembleTransform(x2, y, toString2) {
      var x0 = x2.toFixed(0) + "px";
      var y0 = y.toFixed(0) + "px";
      if (!env.transformSupported) {
        return toString2 ? "top:" + y0 + ";left:" + x0 + ";" : [["top", y0], ["left", x0]];
      }
      var is3d = env.transform3dSupported;
      var translate2 = "translate" + (is3d ? "3d" : "") + "(" + x0 + "," + y0 + (is3d ? ",0" : "") + ")";
      return toString2 ? "top:0;left:0;" + CSS_TRANSFORM_VENDOR + ":" + translate2 + ";" : [["top", 0], ["left", 0], [TRANSFORM_VENDOR, translate2]];
    }
    function assembleFont(textStyleModel) {
      var cssText = [];
      var fontSize2 = textStyleModel.get("fontSize");
      var color2 = textStyleModel.getTextColor();
      color2 && cssText.push("color:" + color2);
      cssText.push("font:" + textStyleModel.getFont());
      var lineHeight2 = retrieve2(textStyleModel.get("lineHeight"), Math.round(fontSize2 * 3 / 2));
      fontSize2 && cssText.push("line-height:" + lineHeight2 + "px");
      var shadowColor = textStyleModel.get("textShadowColor");
      var shadowBlur = textStyleModel.get("textShadowBlur") || 0;
      var shadowOffsetX = textStyleModel.get("textShadowOffsetX") || 0;
      var shadowOffsetY = textStyleModel.get("textShadowOffsetY") || 0;
      shadowColor && shadowBlur && cssText.push("text-shadow:" + shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor);
      each$f(["decoration", "align"], function(name) {
        var val = textStyleModel.get(name);
        val && cssText.push("text-" + name + ":" + val);
      });
      return cssText.join(";");
    }
    function assembleCssText(tooltipModel, enableTransition, onlyFade) {
      var cssText = [];
      var transitionDuration = tooltipModel.get("transitionDuration");
      var backgroundColor2 = tooltipModel.get("backgroundColor");
      var shadowBlur = tooltipModel.get("shadowBlur");
      var shadowColor = tooltipModel.get("shadowColor");
      var shadowOffsetX = tooltipModel.get("shadowOffsetX");
      var shadowOffsetY = tooltipModel.get("shadowOffsetY");
      var textStyleModel = tooltipModel.getModel("textStyle");
      var padding = getPaddingFromTooltipModel(tooltipModel, "html");
      var boxShadow2 = shadowOffsetX + "px " + shadowOffsetY + "px " + shadowBlur + "px " + shadowColor;
      cssText.push("box-shadow:" + boxShadow2);
      enableTransition && transitionDuration && cssText.push(assembleTransition(transitionDuration, onlyFade));
      if (backgroundColor2) {
        cssText.push("background-color:" + backgroundColor2);
      }
      each$f(["width", "color", "radius"], function(name) {
        var borderName = "border-" + name;
        var camelCase = toCamelCase$1(borderName);
        var val = tooltipModel.get(camelCase);
        val != null && cssText.push(borderName + ":" + val + (name === "color" ? "" : "px"));
      });
      cssText.push(assembleFont(textStyleModel));
      if (padding != null) {
        cssText.push("padding:" + normalizeCssArray(padding).join("px ") + "px");
      }
      return cssText.join(";") + ";";
    }
    function makeStyleCoord$1(out2, zr, container, zrX, zrY) {
      var zrPainter = zr && zr.painter;
      if (container) {
        var zrViewportRoot = zrPainter && zrPainter.getViewportRoot();
        if (zrViewportRoot) {
          transformLocalCoord(out2, zrViewportRoot, container, zrX, zrY);
        }
      } else {
        out2[0] = zrX;
        out2[1] = zrY;
        var viewportRootOffset = zrPainter && zrPainter.getViewportRootOffset();
        if (viewportRootOffset) {
          out2[0] += viewportRootOffset.offsetLeft;
          out2[1] += viewportRootOffset.offsetTop;
        }
      }
      out2[2] = out2[0] / zr.getWidth();
      out2[3] = out2[1] / zr.getHeight();
    }
    var TooltipHTMLContent = (
      /** @class */
      function() {
        function TooltipHTMLContent2(api2, opt) {
          this._show = false;
          this._styleCoord = [0, 0, 0, 0];
          this._enterable = true;
          this._alwaysShowContent = false;
          this._firstShow = true;
          this._longHide = true;
          if (env.wxa) {
            return null;
          }
          var el = document.createElement("div");
          el.domBelongToZr = true;
          this.el = el;
          var zr = this._zr = api2.getZr();
          var appendTo = opt.appendTo;
          var container = appendTo && (isString$1(appendTo) ? document.querySelector(appendTo) : isDom(appendTo) ? appendTo : isFunction$1(appendTo) && appendTo(api2.getDom()));
          makeStyleCoord$1(this._styleCoord, zr, container, api2.getWidth() / 2, api2.getHeight() / 2);
          (container || api2.getDom()).appendChild(el);
          this._api = api2;
          this._container = container;
          var self2 = this;
          el.onmouseenter = function() {
            if (self2._enterable) {
              clearTimeout(self2._hideTimeout);
              self2._show = true;
            }
            self2._inContent = true;
          };
          el.onmousemove = function(e2) {
            e2 = e2 || window.event;
            if (!self2._enterable) {
              var handler = zr.handler;
              var zrViewportRoot = zr.painter.getViewportRoot();
              normalizeEvent(zrViewportRoot, e2, true);
              handler.dispatch("mousemove", e2);
            }
          };
          el.onmouseleave = function() {
            self2._inContent = false;
            if (self2._enterable) {
              if (self2._show) {
                self2.hideLater(self2._hideDelay);
              }
            }
          };
        }
        TooltipHTMLContent2.prototype.update = function(tooltipModel) {
          if (!this._container) {
            var container = this._api.getDom();
            var position2 = getComputedStyle$1(container, "position");
            var domStyle = container.style;
            if (domStyle.position !== "absolute" && position2 !== "absolute") {
              domStyle.position = "relative";
            }
          }
          var alwaysShowContent = tooltipModel.get("alwaysShowContent");
          alwaysShowContent && this._moveIfResized();
          this._alwaysShowContent = alwaysShowContent;
          this.el.className = tooltipModel.get("className") || "";
        };
        TooltipHTMLContent2.prototype.show = function(tooltipModel, nearPointColor) {
          clearTimeout(this._hideTimeout);
          clearTimeout(this._longHideTimeout);
          var el = this.el;
          var style = el.style;
          var styleCoord = this._styleCoord;
          if (!el.innerHTML) {
            style.display = "none";
          } else {
            style.cssText = gCssText + assembleCssText(tooltipModel, !this._firstShow, this._longHide) + assembleTransform(styleCoord[0], styleCoord[1], true) + ("border-color:" + convertToColorString(nearPointColor) + ";") + (tooltipModel.get("extraCssText") || "") + (";pointer-events:" + (this._enterable ? "auto" : "none"));
          }
          this._show = true;
          this._firstShow = false;
          this._longHide = false;
        };
        TooltipHTMLContent2.prototype.setContent = function(content2, markers, tooltipModel, borderColor, arrowPosition) {
          var el = this.el;
          if (content2 == null) {
            el.innerHTML = "";
            return;
          }
          var arrow2 = "";
          if (isString$1(arrowPosition) && tooltipModel.get("trigger") === "item" && !shouldTooltipConfine(tooltipModel)) {
            arrow2 = assembleArrow(tooltipModel, borderColor, arrowPosition);
          }
          if (isString$1(content2)) {
            el.innerHTML = content2 + arrow2;
          } else if (content2) {
            el.innerHTML = "";
            if (!isArray$2(content2)) {
              content2 = [content2];
            }
            for (var i2 = 0; i2 < content2.length; i2++) {
              if (isDom(content2[i2]) && content2[i2].parentNode !== el) {
                el.appendChild(content2[i2]);
              }
            }
            if (arrow2 && el.childNodes.length) {
              var arrowEl = document.createElement("div");
              arrowEl.innerHTML = arrow2;
              el.appendChild(arrowEl);
            }
          }
        };
        TooltipHTMLContent2.prototype.setEnterable = function(enterable) {
          this._enterable = enterable;
        };
        TooltipHTMLContent2.prototype.getSize = function() {
          var el = this.el;
          return el ? [el.offsetWidth, el.offsetHeight] : [0, 0];
        };
        TooltipHTMLContent2.prototype.moveTo = function(zrX, zrY) {
          if (!this.el) {
            return;
          }
          var styleCoord = this._styleCoord;
          makeStyleCoord$1(styleCoord, this._zr, this._container, zrX, zrY);
          if (styleCoord[0] != null && styleCoord[1] != null) {
            var style_1 = this.el.style;
            var transforms = assembleTransform(styleCoord[0], styleCoord[1]);
            each$f(transforms, function(transform2) {
              style_1[transform2[0]] = transform2[1];
            });
          }
        };
        TooltipHTMLContent2.prototype._moveIfResized = function() {
          var ratioX = this._styleCoord[2];
          var ratioY = this._styleCoord[3];
          this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
        };
        TooltipHTMLContent2.prototype.hide = function() {
          var _this = this;
          var style = this.el.style;
          style.visibility = "hidden";
          style.opacity = "0";
          env.transform3dSupported && (style.willChange = "");
          this._show = false;
          this._longHideTimeout = setTimeout(function() {
            return _this._longHide = true;
          }, 500);
        };
        TooltipHTMLContent2.prototype.hideLater = function(time2) {
          if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {
            if (time2) {
              this._hideDelay = time2;
              this._show = false;
              this._hideTimeout = setTimeout(bind$2(this.hide, this), time2);
            } else {
              this.hide();
            }
          }
        };
        TooltipHTMLContent2.prototype.isShow = function() {
          return this._show;
        };
        TooltipHTMLContent2.prototype.dispose = function() {
          clearTimeout(this._hideTimeout);
          clearTimeout(this._longHideTimeout);
          var parentNode2 = this.el.parentNode;
          parentNode2 && parentNode2.removeChild(this.el);
          this.el = this._container = null;
        };
        return TooltipHTMLContent2;
      }()
    );
    var TooltipRichContent = (
      /** @class */
      function() {
        function TooltipRichContent2(api2) {
          this._show = false;
          this._styleCoord = [0, 0, 0, 0];
          this._alwaysShowContent = false;
          this._enterable = true;
          this._zr = api2.getZr();
          makeStyleCoord(this._styleCoord, this._zr, api2.getWidth() / 2, api2.getHeight() / 2);
        }
        TooltipRichContent2.prototype.update = function(tooltipModel) {
          var alwaysShowContent = tooltipModel.get("alwaysShowContent");
          alwaysShowContent && this._moveIfResized();
          this._alwaysShowContent = alwaysShowContent;
        };
        TooltipRichContent2.prototype.show = function() {
          if (this._hideTimeout) {
            clearTimeout(this._hideTimeout);
          }
          this.el.show();
          this._show = true;
        };
        TooltipRichContent2.prototype.setContent = function(content2, markupStyleCreator, tooltipModel, borderColor, arrowPosition) {
          var _this = this;
          if (isObject$5(content2)) {
            throwError("");
          }
          if (this.el) {
            this._zr.remove(this.el);
          }
          var textStyleModel = tooltipModel.getModel("textStyle");
          this.el = new ZRText({
            style: {
              rich: markupStyleCreator.richTextStyles,
              text: content2,
              lineHeight: 22,
              borderWidth: 1,
              borderColor,
              textShadowColor: textStyleModel.get("textShadowColor"),
              fill: tooltipModel.get(["textStyle", "color"]),
              padding: getPaddingFromTooltipModel(tooltipModel, "richText"),
              verticalAlign: "top",
              align: "left"
            },
            z: tooltipModel.get("z")
          });
          each$f(["backgroundColor", "borderRadius", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"], function(propName) {
            _this.el.style[propName] = tooltipModel.get(propName);
          });
          each$f(["textShadowBlur", "textShadowOffsetX", "textShadowOffsetY"], function(propName) {
            _this.el.style[propName] = textStyleModel.get(propName) || 0;
          });
          this._zr.add(this.el);
          var self2 = this;
          this.el.on("mouseover", function() {
            if (self2._enterable) {
              clearTimeout(self2._hideTimeout);
              self2._show = true;
            }
            self2._inContent = true;
          });
          this.el.on("mouseout", function() {
            if (self2._enterable) {
              if (self2._show) {
                self2.hideLater(self2._hideDelay);
              }
            }
            self2._inContent = false;
          });
        };
        TooltipRichContent2.prototype.setEnterable = function(enterable) {
          this._enterable = enterable;
        };
        TooltipRichContent2.prototype.getSize = function() {
          var el = this.el;
          var bounding = this.el.getBoundingRect();
          var shadowOuterSize = calcShadowOuterSize(el.style);
          return [bounding.width + shadowOuterSize.left + shadowOuterSize.right, bounding.height + shadowOuterSize.top + shadowOuterSize.bottom];
        };
        TooltipRichContent2.prototype.moveTo = function(x2, y) {
          var el = this.el;
          if (el) {
            var styleCoord = this._styleCoord;
            makeStyleCoord(styleCoord, this._zr, x2, y);
            x2 = styleCoord[0];
            y = styleCoord[1];
            var style = el.style;
            var borderWidth = mathMaxWith0(style.borderWidth || 0);
            var shadowOuterSize = calcShadowOuterSize(style);
            el.x = x2 + borderWidth + shadowOuterSize.left;
            el.y = y + borderWidth + shadowOuterSize.top;
            el.markRedraw();
          }
        };
        TooltipRichContent2.prototype._moveIfResized = function() {
          var ratioX = this._styleCoord[2];
          var ratioY = this._styleCoord[3];
          this.moveTo(ratioX * this._zr.getWidth(), ratioY * this._zr.getHeight());
        };
        TooltipRichContent2.prototype.hide = function() {
          if (this.el) {
            this.el.hide();
          }
          this._show = false;
        };
        TooltipRichContent2.prototype.hideLater = function(time2) {
          if (this._show && !(this._inContent && this._enterable) && !this._alwaysShowContent) {
            if (time2) {
              this._hideDelay = time2;
              this._show = false;
              this._hideTimeout = setTimeout(bind$2(this.hide, this), time2);
            } else {
              this.hide();
            }
          }
        };
        TooltipRichContent2.prototype.isShow = function() {
          return this._show;
        };
        TooltipRichContent2.prototype.dispose = function() {
          this._zr.remove(this.el);
        };
        return TooltipRichContent2;
      }()
    );
    function mathMaxWith0(val) {
      return Math.max(0, val);
    }
    function calcShadowOuterSize(style) {
      var shadowBlur = mathMaxWith0(style.shadowBlur || 0);
      var shadowOffsetX = mathMaxWith0(style.shadowOffsetX || 0);
      var shadowOffsetY = mathMaxWith0(style.shadowOffsetY || 0);
      return {
        left: mathMaxWith0(shadowBlur - shadowOffsetX),
        right: mathMaxWith0(shadowBlur + shadowOffsetX),
        top: mathMaxWith0(shadowBlur - shadowOffsetY),
        bottom: mathMaxWith0(shadowBlur + shadowOffsetY)
      };
    }
    function makeStyleCoord(out2, zr, zrX, zrY) {
      out2[0] = zrX;
      out2[1] = zrY;
      out2[2] = out2[0] / zr.getWidth();
      out2[3] = out2[1] / zr.getHeight();
    }
    var proxyRect = new Rect$2({
      shape: {
        x: -1,
        y: -1,
        width: 2,
        height: 2
      }
    });
    var TooltipView = (
      /** @class */
      function(_super) {
        __extends$1(TooltipView2, _super);
        function TooltipView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TooltipView2.type;
          return _this;
        }
        TooltipView2.prototype.init = function(ecModel, api2) {
          if (env.node || !api2.getDom()) {
            return;
          }
          var tooltipModel = ecModel.getComponent("tooltip");
          var renderMode = this._renderMode = getTooltipRenderMode(tooltipModel.get("renderMode"));
          this._tooltipContent = renderMode === "richText" ? new TooltipRichContent(api2) : new TooltipHTMLContent(api2, {
            appendTo: tooltipModel.get("appendToBody", true) ? "body" : tooltipModel.get("appendTo", true)
          });
        };
        TooltipView2.prototype.render = function(tooltipModel, ecModel, api2) {
          if (env.node || !api2.getDom()) {
            return;
          }
          this.group.removeAll();
          this._tooltipModel = tooltipModel;
          this._ecModel = ecModel;
          this._api = api2;
          var tooltipContent = this._tooltipContent;
          tooltipContent.update(tooltipModel);
          tooltipContent.setEnterable(tooltipModel.get("enterable"));
          this._initGlobalListener();
          this._keepShow();
          if (this._renderMode !== "richText" && tooltipModel.get("transitionDuration")) {
            createOrUpdate(this, "_updatePosition", 50, "fixRate");
          } else {
            clear$1(this, "_updatePosition");
          }
        };
        TooltipView2.prototype._initGlobalListener = function() {
          var tooltipModel = this._tooltipModel;
          var triggerOn = tooltipModel.get("triggerOn");
          register("itemTooltip", this._api, bind$2(function(currTrigger, e2, dispatchAction2) {
            if (triggerOn !== "none") {
              if (triggerOn.indexOf(currTrigger) >= 0) {
                this._tryShow(e2, dispatchAction2);
              } else if (currTrigger === "leave") {
                this._hide(dispatchAction2);
              }
            }
          }, this));
        };
        TooltipView2.prototype._keepShow = function() {
          var tooltipModel = this._tooltipModel;
          var ecModel = this._ecModel;
          var api2 = this._api;
          var triggerOn = tooltipModel.get("triggerOn");
          if (this._lastX != null && this._lastY != null && triggerOn !== "none" && triggerOn !== "click") {
            var self_1 = this;
            clearTimeout(this._refreshUpdateTimeout);
            this._refreshUpdateTimeout = setTimeout(function() {
              !api2.isDisposed() && self_1.manuallyShowTip(tooltipModel, ecModel, api2, {
                x: self_1._lastX,
                y: self_1._lastY,
                dataByCoordSys: self_1._lastDataByCoordSys
              });
            });
          }
        };
        TooltipView2.prototype.manuallyShowTip = function(tooltipModel, ecModel, api2, payload) {
          if (payload.from === this.uid || env.node || !api2.getDom()) {
            return;
          }
          var dispatchAction2 = makeDispatchAction(payload, api2);
          this._ticket = "";
          var dataByCoordSys = payload.dataByCoordSys;
          var cmptRef = findComponentReference(payload, ecModel, api2);
          if (cmptRef) {
            var rect = cmptRef.el.getBoundingRect().clone();
            rect.applyTransform(cmptRef.el.transform);
            this._tryShow({
              offsetX: rect.x + rect.width / 2,
              offsetY: rect.y + rect.height / 2,
              target: cmptRef.el,
              position: payload.position,
              // When manully trigger, the mouse is not on the el, so we'd better to
              // position tooltip on the bottom of the el and display arrow is possible.
              positionDefault: "bottom"
            }, dispatchAction2);
          } else if (payload.tooltip && payload.x != null && payload.y != null) {
            var el = proxyRect;
            el.x = payload.x;
            el.y = payload.y;
            el.update();
            getECData(el).tooltipConfig = {
              name: null,
              option: payload.tooltip
            };
            this._tryShow({
              offsetX: payload.x,
              offsetY: payload.y,
              target: el
            }, dispatchAction2);
          } else if (dataByCoordSys) {
            this._tryShow({
              offsetX: payload.x,
              offsetY: payload.y,
              position: payload.position,
              dataByCoordSys,
              tooltipOption: payload.tooltipOption
            }, dispatchAction2);
          } else if (payload.seriesIndex != null) {
            if (this._manuallyAxisShowTip(tooltipModel, ecModel, api2, payload)) {
              return;
            }
            var pointInfo = findPointFromSeries(payload, ecModel);
            var cx = pointInfo.point[0];
            var cy = pointInfo.point[1];
            if (cx != null && cy != null) {
              this._tryShow({
                offsetX: cx,
                offsetY: cy,
                target: pointInfo.el,
                position: payload.position,
                // When manully trigger, the mouse is not on the el, so we'd better to
                // position tooltip on the bottom of the el and display arrow is possible.
                positionDefault: "bottom"
              }, dispatchAction2);
            }
          } else if (payload.x != null && payload.y != null) {
            api2.dispatchAction({
              type: "updateAxisPointer",
              x: payload.x,
              y: payload.y
            });
            this._tryShow({
              offsetX: payload.x,
              offsetY: payload.y,
              position: payload.position,
              target: api2.getZr().findHover(payload.x, payload.y).target
            }, dispatchAction2);
          }
        };
        TooltipView2.prototype.manuallyHideTip = function(tooltipModel, ecModel, api2, payload) {
          var tooltipContent = this._tooltipContent;
          if (this._tooltipModel) {
            tooltipContent.hideLater(this._tooltipModel.get("hideDelay"));
          }
          this._lastX = this._lastY = this._lastDataByCoordSys = null;
          if (payload.from !== this.uid) {
            this._hide(makeDispatchAction(payload, api2));
          }
        };
        TooltipView2.prototype._manuallyAxisShowTip = function(tooltipModel, ecModel, api2, payload) {
          var seriesIndex = payload.seriesIndex;
          var dataIndex = payload.dataIndex;
          var coordSysAxesInfo = ecModel.getComponent("axisPointer").coordSysAxesInfo;
          if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) {
            return;
          }
          var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
          if (!seriesModel) {
            return;
          }
          var data = seriesModel.getData();
          var tooltipCascadedModel = buildTooltipModel([data.getItemModel(dataIndex), seriesModel, (seriesModel.coordinateSystem || {}).model], this._tooltipModel);
          if (tooltipCascadedModel.get("trigger") !== "axis") {
            return;
          }
          api2.dispatchAction({
            type: "updateAxisPointer",
            seriesIndex,
            dataIndex,
            position: payload.position
          });
          return true;
        };
        TooltipView2.prototype._tryShow = function(e2, dispatchAction2) {
          var el = e2.target;
          var tooltipModel = this._tooltipModel;
          if (!tooltipModel) {
            return;
          }
          this._lastX = e2.offsetX;
          this._lastY = e2.offsetY;
          var dataByCoordSys = e2.dataByCoordSys;
          if (dataByCoordSys && dataByCoordSys.length) {
            this._showAxisTooltip(dataByCoordSys, e2);
          } else if (el) {
            var ecData = getECData(el);
            if (ecData.ssrType === "legend") {
              return;
            }
            this._lastDataByCoordSys = null;
            var seriesDispatcher_1;
            var cmptDispatcher_1;
            findEventDispatcher(el, function(target) {
              if (getECData(target).dataIndex != null) {
                seriesDispatcher_1 = target;
                return true;
              }
              if (getECData(target).tooltipConfig != null) {
                cmptDispatcher_1 = target;
                return true;
              }
            }, true);
            if (seriesDispatcher_1) {
              this._showSeriesItemTooltip(e2, seriesDispatcher_1, dispatchAction2);
            } else if (cmptDispatcher_1) {
              this._showComponentItemTooltip(e2, cmptDispatcher_1, dispatchAction2);
            } else {
              this._hide(dispatchAction2);
            }
          } else {
            this._lastDataByCoordSys = null;
            this._hide(dispatchAction2);
          }
        };
        TooltipView2.prototype._showOrMove = function(tooltipModel, cb) {
          var delay = tooltipModel.get("showDelay");
          cb = bind$2(cb, this);
          clearTimeout(this._showTimout);
          delay > 0 ? this._showTimout = setTimeout(cb, delay) : cb();
        };
        TooltipView2.prototype._showAxisTooltip = function(dataByCoordSys, e2) {
          var ecModel = this._ecModel;
          var globalTooltipModel = this._tooltipModel;
          var point = [e2.offsetX, e2.offsetY];
          var singleTooltipModel = buildTooltipModel([e2.tooltipOption], globalTooltipModel);
          var renderMode = this._renderMode;
          var cbParamsList = [];
          var articleMarkup = createTooltipMarkup("section", {
            blocks: [],
            noHeader: true
          });
          var markupTextArrLegacy = [];
          var markupStyleCreator = new TooltipMarkupStyleCreator();
          each$f(dataByCoordSys, function(itemCoordSys) {
            each$f(itemCoordSys.dataByAxis, function(axisItem) {
              var axisModel = ecModel.getComponent(axisItem.axisDim + "Axis", axisItem.axisIndex);
              var axisValue = axisItem.value;
              if (!axisModel || axisValue == null) {
                return;
              }
              var axisValueLabel = getValueLabel(axisValue, axisModel.axis, ecModel, axisItem.seriesDataIndices, axisItem.valueLabelOpt);
              var axisSectionMarkup = createTooltipMarkup("section", {
                header: axisValueLabel,
                noHeader: !trim$2(axisValueLabel),
                sortBlocks: true,
                blocks: []
              });
              articleMarkup.blocks.push(axisSectionMarkup);
              each$f(axisItem.seriesDataIndices, function(idxItem) {
                var series = ecModel.getSeriesByIndex(idxItem.seriesIndex);
                var dataIndex = idxItem.dataIndexInside;
                var cbParams = series.getDataParams(dataIndex);
                if (cbParams.dataIndex < 0) {
                  return;
                }
                cbParams.axisDim = axisItem.axisDim;
                cbParams.axisIndex = axisItem.axisIndex;
                cbParams.axisType = axisItem.axisType;
                cbParams.axisId = axisItem.axisId;
                cbParams.axisValue = getAxisRawValue(axisModel.axis, {
                  value: axisValue
                });
                cbParams.axisValueLabel = axisValueLabel;
                cbParams.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(cbParams.color), renderMode);
                var seriesTooltipResult = normalizeTooltipFormatResult(series.formatTooltip(dataIndex, true, null));
                var frag = seriesTooltipResult.frag;
                if (frag) {
                  var valueFormatter = buildTooltipModel([series], globalTooltipModel).get("valueFormatter");
                  axisSectionMarkup.blocks.push(valueFormatter ? extend$1({
                    valueFormatter
                  }, frag) : frag);
                }
                if (seriesTooltipResult.text) {
                  markupTextArrLegacy.push(seriesTooltipResult.text);
                }
                cbParamsList.push(cbParams);
              });
            });
          });
          articleMarkup.blocks.reverse();
          markupTextArrLegacy.reverse();
          var positionExpr = e2.position;
          var orderMode = singleTooltipModel.get("order");
          var builtMarkupText = buildTooltipMarkup(articleMarkup, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), singleTooltipModel.get("textStyle"));
          builtMarkupText && markupTextArrLegacy.unshift(builtMarkupText);
          var blockBreak = renderMode === "richText" ? "\n\n" : "<br/>";
          var allMarkupText = markupTextArrLegacy.join(blockBreak);
          this._showOrMove(singleTooltipModel, function() {
            if (this._updateContentNotChangedOnAxis(dataByCoordSys, cbParamsList)) {
              this._updatePosition(singleTooltipModel, positionExpr, point[0], point[1], this._tooltipContent, cbParamsList);
            } else {
              this._showTooltipContent(singleTooltipModel, allMarkupText, cbParamsList, Math.random() + "", point[0], point[1], positionExpr, null, markupStyleCreator);
            }
          });
        };
        TooltipView2.prototype._showSeriesItemTooltip = function(e2, dispatcher, dispatchAction2) {
          var ecModel = this._ecModel;
          var ecData = getECData(dispatcher);
          var seriesIndex = ecData.seriesIndex;
          var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
          var dataModel = ecData.dataModel || seriesModel;
          var dataIndex = ecData.dataIndex;
          var dataType2 = ecData.dataType;
          var data = dataModel.getData(dataType2);
          var renderMode = this._renderMode;
          var positionDefault = e2.positionDefault;
          var tooltipModel = buildTooltipModel([data.getItemModel(dataIndex), dataModel, seriesModel && (seriesModel.coordinateSystem || {}).model], this._tooltipModel, positionDefault ? {
            position: positionDefault
          } : null);
          var tooltipTrigger = tooltipModel.get("trigger");
          if (tooltipTrigger != null && tooltipTrigger !== "item") {
            return;
          }
          var params = dataModel.getDataParams(dataIndex, dataType2);
          var markupStyleCreator = new TooltipMarkupStyleCreator();
          params.marker = markupStyleCreator.makeTooltipMarker("item", convertToColorString(params.color), renderMode);
          var seriesTooltipResult = normalizeTooltipFormatResult(dataModel.formatTooltip(dataIndex, false, dataType2));
          var orderMode = tooltipModel.get("order");
          var valueFormatter = tooltipModel.get("valueFormatter");
          var frag = seriesTooltipResult.frag;
          var markupText = frag ? buildTooltipMarkup(valueFormatter ? extend$1({
            valueFormatter
          }, frag) : frag, markupStyleCreator, renderMode, orderMode, ecModel.get("useUTC"), tooltipModel.get("textStyle")) : seriesTooltipResult.text;
          var asyncTicket = "item_" + dataModel.name + "_" + dataIndex;
          this._showOrMove(tooltipModel, function() {
            this._showTooltipContent(tooltipModel, markupText, params, asyncTicket, e2.offsetX, e2.offsetY, e2.position, e2.target, markupStyleCreator);
          });
          dispatchAction2({
            type: "showTip",
            dataIndexInside: dataIndex,
            dataIndex: data.getRawIndex(dataIndex),
            seriesIndex,
            from: this.uid
          });
        };
        TooltipView2.prototype._showComponentItemTooltip = function(e2, el, dispatchAction2) {
          var isHTMLRenderMode = this._renderMode === "html";
          var ecData = getECData(el);
          var tooltipConfig = ecData.tooltipConfig;
          var tooltipOpt = tooltipConfig.option || {};
          var encodeHTMLContent = tooltipOpt.encodeHTMLContent;
          if (isString$1(tooltipOpt)) {
            var content2 = tooltipOpt;
            tooltipOpt = {
              content: content2,
              // Fixed formatter
              formatter: content2
            };
            encodeHTMLContent = true;
          }
          if (encodeHTMLContent && isHTMLRenderMode && tooltipOpt.content) {
            tooltipOpt = clone$4(tooltipOpt);
            tooltipOpt.content = encodeHTML(tooltipOpt.content);
          }
          var tooltipModelCascade = [tooltipOpt];
          var cmpt = this._ecModel.getComponent(ecData.componentMainType, ecData.componentIndex);
          if (cmpt) {
            tooltipModelCascade.push(cmpt);
          }
          tooltipModelCascade.push({
            formatter: tooltipOpt.content
          });
          var positionDefault = e2.positionDefault;
          var subTooltipModel = buildTooltipModel(tooltipModelCascade, this._tooltipModel, positionDefault ? {
            position: positionDefault
          } : null);
          var defaultHtml = subTooltipModel.get("content");
          var asyncTicket = Math.random() + "";
          var markupStyleCreator = new TooltipMarkupStyleCreator();
          this._showOrMove(subTooltipModel, function() {
            var formatterParams = clone$4(subTooltipModel.get("formatterParams") || {});
            this._showTooltipContent(subTooltipModel, defaultHtml, formatterParams, asyncTicket, e2.offsetX, e2.offsetY, e2.position, el, markupStyleCreator);
          });
          dispatchAction2({
            type: "showTip",
            from: this.uid
          });
        };
        TooltipView2.prototype._showTooltipContent = function(tooltipModel, defaultHtml, params, asyncTicket, x2, y, positionExpr, el, markupStyleCreator) {
          this._ticket = "";
          if (!tooltipModel.get("showContent") || !tooltipModel.get("show")) {
            return;
          }
          var tooltipContent = this._tooltipContent;
          tooltipContent.setEnterable(tooltipModel.get("enterable"));
          var formatter2 = tooltipModel.get("formatter");
          positionExpr = positionExpr || tooltipModel.get("position");
          var html = defaultHtml;
          var nearPoint = this._getNearestPoint([x2, y], params, tooltipModel.get("trigger"), tooltipModel.get("borderColor"));
          var nearPointColor = nearPoint.color;
          if (formatter2) {
            if (isString$1(formatter2)) {
              var useUTC = tooltipModel.ecModel.get("useUTC");
              var params0 = isArray$2(params) ? params[0] : params;
              var isTimeAxis = params0 && params0.axisType && params0.axisType.indexOf("time") >= 0;
              html = formatter2;
              if (isTimeAxis) {
                html = format(params0.axisValue, html, useUTC);
              }
              html = formatTpl(html, params, true);
            } else if (isFunction$1(formatter2)) {
              var callback = bind$2(function(cbTicket, html2) {
                if (cbTicket === this._ticket) {
                  tooltipContent.setContent(html2, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
                  this._updatePosition(tooltipModel, positionExpr, x2, y, tooltipContent, params, el);
                }
              }, this);
              this._ticket = asyncTicket;
              html = formatter2(params, asyncTicket, callback);
            } else {
              html = formatter2;
            }
          }
          tooltipContent.setContent(html, markupStyleCreator, tooltipModel, nearPointColor, positionExpr);
          tooltipContent.show(tooltipModel, nearPointColor);
          this._updatePosition(tooltipModel, positionExpr, x2, y, tooltipContent, params, el);
        };
        TooltipView2.prototype._getNearestPoint = function(point, tooltipDataParams, trigger2, borderColor) {
          if (trigger2 === "axis" || isArray$2(tooltipDataParams)) {
            return {
              color: borderColor || (this._renderMode === "html" ? "#fff" : "none")
            };
          }
          if (!isArray$2(tooltipDataParams)) {
            return {
              color: borderColor || tooltipDataParams.color || tooltipDataParams.borderColor
            };
          }
        };
        TooltipView2.prototype._updatePosition = function(tooltipModel, positionExpr, x2, y, content2, params, el) {
          var viewWidth = this._api.getWidth();
          var viewHeight = this._api.getHeight();
          positionExpr = positionExpr || tooltipModel.get("position");
          var contentSize = content2.getSize();
          var align = tooltipModel.get("align");
          var vAlign = tooltipModel.get("verticalAlign");
          var rect = el && el.getBoundingRect().clone();
          el && rect.applyTransform(el.transform);
          if (isFunction$1(positionExpr)) {
            positionExpr = positionExpr([x2, y], params, content2.el, rect, {
              viewSize: [viewWidth, viewHeight],
              contentSize: contentSize.slice()
            });
          }
          if (isArray$2(positionExpr)) {
            x2 = parsePercent(positionExpr[0], viewWidth);
            y = parsePercent(positionExpr[1], viewHeight);
          } else if (isObject$5(positionExpr)) {
            var boxLayoutPosition = positionExpr;
            boxLayoutPosition.width = contentSize[0];
            boxLayoutPosition.height = contentSize[1];
            var layoutRect = getLayoutRect(boxLayoutPosition, {
              width: viewWidth,
              height: viewHeight
            });
            x2 = layoutRect.x;
            y = layoutRect.y;
            align = null;
            vAlign = null;
          } else if (isString$1(positionExpr) && el) {
            var pos = calcTooltipPosition(positionExpr, rect, contentSize, tooltipModel.get("borderWidth"));
            x2 = pos[0];
            y = pos[1];
          } else {
            var pos = refixTooltipPosition(x2, y, content2, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20);
            x2 = pos[0];
            y = pos[1];
          }
          align && (x2 -= isCenterAlign(align) ? contentSize[0] / 2 : align === "right" ? contentSize[0] : 0);
          vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === "bottom" ? contentSize[1] : 0);
          if (shouldTooltipConfine(tooltipModel)) {
            var pos = confineTooltipPosition(x2, y, content2, viewWidth, viewHeight);
            x2 = pos[0];
            y = pos[1];
          }
          content2.moveTo(x2, y);
        };
        TooltipView2.prototype._updateContentNotChangedOnAxis = function(dataByCoordSys, cbParamsList) {
          var lastCoordSys = this._lastDataByCoordSys;
          var lastCbParamsList = this._cbParamsList;
          var contentNotChanged = !!lastCoordSys && lastCoordSys.length === dataByCoordSys.length;
          contentNotChanged && each$f(lastCoordSys, function(lastItemCoordSys, indexCoordSys) {
            var lastDataByAxis = lastItemCoordSys.dataByAxis || [];
            var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {};
            var thisDataByAxis = thisItemCoordSys.dataByAxis || [];
            contentNotChanged = contentNotChanged && lastDataByAxis.length === thisDataByAxis.length;
            contentNotChanged && each$f(lastDataByAxis, function(lastItem, indexAxis) {
              var thisItem = thisDataByAxis[indexAxis] || {};
              var lastIndices = lastItem.seriesDataIndices || [];
              var newIndices = thisItem.seriesDataIndices || [];
              contentNotChanged = contentNotChanged && lastItem.value === thisItem.value && lastItem.axisType === thisItem.axisType && lastItem.axisId === thisItem.axisId && lastIndices.length === newIndices.length;
              contentNotChanged && each$f(lastIndices, function(lastIdxItem, j) {
                var newIdxItem = newIndices[j];
                contentNotChanged = contentNotChanged && lastIdxItem.seriesIndex === newIdxItem.seriesIndex && lastIdxItem.dataIndex === newIdxItem.dataIndex;
              });
              lastCbParamsList && each$f(lastItem.seriesDataIndices, function(idxItem) {
                var seriesIdx = idxItem.seriesIndex;
                var cbParams = cbParamsList[seriesIdx];
                var lastCbParams = lastCbParamsList[seriesIdx];
                if (cbParams && lastCbParams && lastCbParams.data !== cbParams.data) {
                  contentNotChanged = false;
                }
              });
            });
          });
          this._lastDataByCoordSys = dataByCoordSys;
          this._cbParamsList = cbParamsList;
          return !!contentNotChanged;
        };
        TooltipView2.prototype._hide = function(dispatchAction2) {
          this._lastDataByCoordSys = null;
          dispatchAction2({
            type: "hideTip",
            from: this.uid
          });
        };
        TooltipView2.prototype.dispose = function(ecModel, api2) {
          if (env.node || !api2.getDom()) {
            return;
          }
          clear$1(this, "_updatePosition");
          this._tooltipContent.dispose();
          unregister("itemTooltip", api2);
        };
        TooltipView2.type = "tooltip";
        return TooltipView2;
      }(ComponentView)
    );
    function buildTooltipModel(modelCascade, globalTooltipModel, defaultTooltipOption) {
      var ecModel = globalTooltipModel.ecModel;
      var resultModel;
      if (defaultTooltipOption) {
        resultModel = new Model(defaultTooltipOption, ecModel, ecModel);
        resultModel = new Model(globalTooltipModel.option, resultModel, ecModel);
      } else {
        resultModel = globalTooltipModel;
      }
      for (var i2 = modelCascade.length - 1; i2 >= 0; i2--) {
        var tooltipOpt = modelCascade[i2];
        if (tooltipOpt) {
          if (tooltipOpt instanceof Model) {
            tooltipOpt = tooltipOpt.get("tooltip", true);
          }
          if (isString$1(tooltipOpt)) {
            tooltipOpt = {
              formatter: tooltipOpt
            };
          }
          if (tooltipOpt) {
            resultModel = new Model(tooltipOpt, resultModel, ecModel);
          }
        }
      }
      return resultModel;
    }
    function makeDispatchAction(payload, api2) {
      return payload.dispatchAction || bind$2(api2.dispatchAction, api2);
    }
    function refixTooltipPosition(x2, y, content2, viewWidth, viewHeight, gapH, gapV) {
      var size = content2.getSize();
      var width = size[0];
      var height = size[1];
      if (gapH != null) {
        if (x2 + width + gapH + 2 > viewWidth) {
          x2 -= width + gapH;
        } else {
          x2 += gapH;
        }
      }
      if (gapV != null) {
        if (y + height + gapV > viewHeight) {
          y -= height + gapV;
        } else {
          y += gapV;
        }
      }
      return [x2, y];
    }
    function confineTooltipPosition(x2, y, content2, viewWidth, viewHeight) {
      var size = content2.getSize();
      var width = size[0];
      var height = size[1];
      x2 = Math.min(x2 + width, viewWidth) - width;
      y = Math.min(y + height, viewHeight) - height;
      x2 = Math.max(x2, 0);
      y = Math.max(y, 0);
      return [x2, y];
    }
    function calcTooltipPosition(position2, rect, contentSize, borderWidth) {
      var domWidth = contentSize[0];
      var domHeight = contentSize[1];
      var offset2 = Math.ceil(Math.SQRT2 * borderWidth) + 8;
      var x2 = 0;
      var y = 0;
      var rectWidth = rect.width;
      var rectHeight = rect.height;
      switch (position2) {
        case "inside":
          x2 = rect.x + rectWidth / 2 - domWidth / 2;
          y = rect.y + rectHeight / 2 - domHeight / 2;
          break;
        case "top":
          x2 = rect.x + rectWidth / 2 - domWidth / 2;
          y = rect.y - domHeight - offset2;
          break;
        case "bottom":
          x2 = rect.x + rectWidth / 2 - domWidth / 2;
          y = rect.y + rectHeight + offset2;
          break;
        case "left":
          x2 = rect.x - domWidth - offset2;
          y = rect.y + rectHeight / 2 - domHeight / 2;
          break;
        case "right":
          x2 = rect.x + rectWidth + offset2;
          y = rect.y + rectHeight / 2 - domHeight / 2;
      }
      return [x2, y];
    }
    function isCenterAlign(align) {
      return align === "center" || align === "middle";
    }
    function findComponentReference(payload, ecModel, api2) {
      var queryOptionMap = preParseFinder(payload).queryOptionMap;
      var componentMainType = queryOptionMap.keys()[0];
      if (!componentMainType || componentMainType === "series") {
        return;
      }
      var queryResult = queryReferringComponents(ecModel, componentMainType, queryOptionMap.get(componentMainType), {
        useDefault: false,
        enableAll: false,
        enableNone: false
      });
      var model = queryResult.models[0];
      if (!model) {
        return;
      }
      var view = api2.getViewOfComponentModel(model);
      var el;
      view.group.traverse(function(subEl) {
        var tooltipConfig = getECData(subEl).tooltipConfig;
        if (tooltipConfig && tooltipConfig.name === payload.name) {
          el = subEl;
          return true;
        }
      });
      if (el) {
        return {
          componentMainType,
          componentIndex: model.componentIndex,
          el
        };
      }
    }
    function install$i(registers) {
      use(install$q);
      registers.registerComponentModel(TooltipModel);
      registers.registerComponentView(TooltipView);
      registers.registerAction({
        type: "showTip",
        event: "showTip",
        update: "tooltip:manuallyShowTip"
      }, noop$1);
      registers.registerAction({
        type: "hideTip",
        event: "hideTip",
        update: "tooltip:manuallyHideTip"
      }, noop$1);
    }
    var DEFAULT_TOOLBOX_BTNS = ["rect", "polygon", "keep", "clear"];
    function brushPreprocessor(option, isNew) {
      var brushComponents = normalizeToArray(option ? option.brush : []);
      if (!brushComponents.length) {
        return;
      }
      var brushComponentSpecifiedBtns = [];
      each$f(brushComponents, function(brushOpt) {
        var tbs = brushOpt.hasOwnProperty("toolbox") ? brushOpt.toolbox : [];
        if (tbs instanceof Array) {
          brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs);
        }
      });
      var toolbox = option && option.toolbox;
      if (isArray$2(toolbox)) {
        toolbox = toolbox[0];
      }
      if (!toolbox) {
        toolbox = {
          feature: {}
        };
        option.toolbox = [toolbox];
      }
      var toolboxFeature = toolbox.feature || (toolbox.feature = {});
      var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {});
      var brushTypes = toolboxBrush.type || (toolboxBrush.type = []);
      brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns);
      removeDuplicate(brushTypes);
      if (isNew && !brushTypes.length) {
        brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS);
      }
    }
    function removeDuplicate(arr) {
      var map2 = {};
      each$f(arr, function(val) {
        map2[val] = 1;
      });
      arr.length = 0;
      each$f(map2, function(flag, val) {
        arr.push(val);
      });
    }
    var each$4 = each$f;
    function hasKeys(obj) {
      if (obj) {
        for (var name_1 in obj) {
          if (obj.hasOwnProperty(name_1)) {
            return true;
          }
        }
      }
    }
    function createVisualMappings(option, stateList, supplementVisualOption) {
      var visualMappings = {};
      each$4(stateList, function(state) {
        var mappings = visualMappings[state] = createMappings();
        each$4(option[state], function(visualData, visualType) {
          if (!VisualMapping.isValidType(visualType)) {
            return;
          }
          var mappingOption = {
            type: visualType,
            visual: visualData
          };
          supplementVisualOption && supplementVisualOption(mappingOption, state);
          mappings[visualType] = new VisualMapping(mappingOption);
          if (visualType === "opacity") {
            mappingOption = clone$4(mappingOption);
            mappingOption.type = "colorAlpha";
            mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption);
          }
        });
      });
      return visualMappings;
      function createMappings() {
        var Creater = function() {
        };
        Creater.prototype.__hidden = Creater.prototype;
        var obj = new Creater();
        return obj;
      }
    }
    function replaceVisualOption(thisOption, newOption, keys2) {
      var has2;
      each$f(keys2, function(key) {
        if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
          has2 = true;
        }
      });
      has2 && each$f(keys2, function(key) {
        if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) {
          thisOption[key] = clone$4(newOption[key]);
        } else {
          delete thisOption[key];
        }
      });
    }
    function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) {
      var visualTypesMap = {};
      each$f(stateList, function(state) {
        var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);
        visualTypesMap[state] = visualTypes;
      });
      var dataIndex;
      function getVisual(key) {
        return getItemVisualFromData(data, dataIndex, key);
      }
      function setVisual(key, value) {
        setItemVisualFromData(data, dataIndex, key, value);
      }
      {
        data.each(eachItem);
      }
      function eachItem(valueOrIndex, index) {
        dataIndex = valueOrIndex;
        var rawDataItem = data.getRawDataItem(dataIndex);
        if (rawDataItem && rawDataItem.visualMap === false) {
          return;
        }
        var valueState = getValueState.call(scope, valueOrIndex);
        var mappings = visualMappings[valueState];
        var visualTypes = visualTypesMap[valueState];
        for (var i2 = 0, len2 = visualTypes.length; i2 < len2; i2++) {
          var type = visualTypes[i2];
          mappings[type] && mappings[type].applyVisual(valueOrIndex, getVisual, setVisual);
        }
      }
    }
    function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) {
      var visualTypesMap = {};
      each$f(stateList, function(state) {
        var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);
        visualTypesMap[state] = visualTypes;
      });
      return {
        progress: function progress(params, data) {
          var dimIndex;
          if (dim != null) {
            dimIndex = data.getDimensionIndex(dim);
          }
          function getVisual(key) {
            return getItemVisualFromData(data, dataIndex, key);
          }
          function setVisual(key, value2) {
            setItemVisualFromData(data, dataIndex, key, value2);
          }
          var dataIndex;
          var store2 = data.getStore();
          while ((dataIndex = params.next()) != null) {
            var rawDataItem = data.getRawDataItem(dataIndex);
            if (rawDataItem && rawDataItem.visualMap === false) {
              continue;
            }
            var value = dim != null ? store2.get(dimIndex, dataIndex) : dataIndex;
            var valueState = getValueState(value);
            var mappings = visualMappings[valueState];
            var visualTypes = visualTypesMap[valueState];
            for (var i2 = 0, len2 = visualTypes.length; i2 < len2; i2++) {
              var type = visualTypes[i2];
              mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);
            }
          }
        }
      };
    }
    function makeBrushCommonSelectorForSeries(area) {
      var brushType = area.brushType;
      var selectors = {
        point: function(itemLayout) {
          return selector[brushType].point(itemLayout, selectors, area);
        },
        rect: function(itemLayout) {
          return selector[brushType].rect(itemLayout, selectors, area);
        }
      };
      return selectors;
    }
    var selector = {
      lineX: getLineSelectors(0),
      lineY: getLineSelectors(1),
      rect: {
        point: function(itemLayout, selectors, area) {
          return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]);
        },
        rect: function(itemLayout, selectors, area) {
          return itemLayout && area.boundingRect.intersect(itemLayout);
        }
      },
      polygon: {
        point: function(itemLayout, selectors, area) {
          return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]) && contain(area.range, itemLayout[0], itemLayout[1]);
        },
        rect: function(itemLayout, selectors, area) {
          var points2 = area.range;
          if (!itemLayout || points2.length <= 1) {
            return false;
          }
          var x2 = itemLayout.x;
          var y = itemLayout.y;
          var width = itemLayout.width;
          var height = itemLayout.height;
          var p2 = points2[0];
          if (contain(points2, x2, y) || contain(points2, x2 + width, y) || contain(points2, x2, y + height) || contain(points2, x2 + width, y + height) || BoundingRect.create(itemLayout).contain(p2[0], p2[1]) || linePolygonIntersect(x2, y, x2 + width, y, points2) || linePolygonIntersect(x2, y, x2, y + height, points2) || linePolygonIntersect(x2 + width, y, x2 + width, y + height, points2) || linePolygonIntersect(x2, y + height, x2 + width, y + height, points2)) {
            return true;
          }
        }
      }
    };
    function getLineSelectors(xyIndex) {
      var xy = ["x", "y"];
      var wh = ["width", "height"];
      return {
        point: function(itemLayout, selectors, area) {
          if (itemLayout) {
            var range2 = area.range;
            var p2 = itemLayout[xyIndex];
            return inLineRange(p2, range2);
          }
        },
        rect: function(itemLayout, selectors, area) {
          if (itemLayout) {
            var range2 = area.range;
            var layoutRange = [itemLayout[xy[xyIndex]], itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]]];
            layoutRange[1] < layoutRange[0] && layoutRange.reverse();
            return inLineRange(layoutRange[0], range2) || inLineRange(layoutRange[1], range2) || inLineRange(range2[0], layoutRange) || inLineRange(range2[1], layoutRange);
          }
        }
      };
    }
    function inLineRange(p2, range2) {
      return range2[0] <= p2 && p2 <= range2[1];
    }
    var STATE_LIST = ["inBrush", "outOfBrush"];
    var DISPATCH_METHOD = "__ecBrushSelect";
    var DISPATCH_FLAG = "__ecInBrushSelectEvent";
    function layoutCovers(ecModel) {
      ecModel.eachComponent({
        mainType: "brush"
      }, function(brushModel) {
        var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel);
        brushTargetManager.setInputRanges(brushModel.areas, ecModel);
      });
    }
    function brushVisual(ecModel, api2, payload) {
      var brushSelected = [];
      var throttleType;
      var throttleDelay;
      ecModel.eachComponent({
        mainType: "brush"
      }, function(brushModel) {
        payload && payload.type === "takeGlobalCursor" && brushModel.setBrushOption(payload.key === "brush" ? payload.brushOption : {
          brushType: false
        });
      });
      layoutCovers(ecModel);
      ecModel.eachComponent({
        mainType: "brush"
      }, function(brushModel, brushIndex) {
        var thisBrushSelected = {
          brushId: brushModel.id,
          brushIndex,
          brushName: brushModel.name,
          areas: clone$4(brushModel.areas),
          selected: []
        };
        brushSelected.push(thisBrushSelected);
        var brushOption = brushModel.option;
        var brushLink = brushOption.brushLink;
        var linkedSeriesMap = [];
        var selectedDataIndexForLink = [];
        var rangeInfoBySeries = [];
        var hasBrushExists = false;
        if (!brushIndex) {
          throttleType = brushOption.throttleType;
          throttleDelay = brushOption.throttleDelay;
        }
        var areas = map$1(brushModel.areas, function(area) {
          var builder = boundingRectBuilders[area.brushType];
          var selectableArea = defaults$1({
            boundingRect: builder ? builder(area) : void 0
          }, area);
          selectableArea.selectors = makeBrushCommonSelectorForSeries(selectableArea);
          return selectableArea;
        });
        var visualMappings = createVisualMappings(brushModel.option, STATE_LIST, function(mappingOption) {
          mappingOption.mappingMethod = "fixed";
        });
        isArray$2(brushLink) && each$f(brushLink, function(seriesIndex) {
          linkedSeriesMap[seriesIndex] = 1;
        });
        function linkOthers(seriesIndex) {
          return brushLink === "all" || !!linkedSeriesMap[seriesIndex];
        }
        function brushed(rangeInfoList) {
          return !!rangeInfoList.length;
        }
        ecModel.eachSeries(function(seriesModel, seriesIndex) {
          var rangeInfoList = rangeInfoBySeries[seriesIndex] = [];
          seriesModel.subType === "parallel" ? stepAParallel(seriesModel, seriesIndex) : stepAOthers(seriesModel, seriesIndex, rangeInfoList);
        });
        function stepAParallel(seriesModel, seriesIndex) {
          var coordSys = seriesModel.coordinateSystem;
          hasBrushExists = hasBrushExists || coordSys.hasAxisBrushed();
          linkOthers(seriesIndex) && coordSys.eachActiveState(seriesModel.getData(), function(activeState, dataIndex) {
            activeState === "active" && (selectedDataIndexForLink[dataIndex] = 1);
          });
        }
        function stepAOthers(seriesModel, seriesIndex, rangeInfoList) {
          if (!seriesModel.brushSelector || brushModelNotControll(brushModel, seriesIndex)) {
            return;
          }
          each$f(areas, function(area) {
            if (brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel)) {
              rangeInfoList.push(area);
            }
            hasBrushExists = hasBrushExists || brushed(rangeInfoList);
          });
          if (linkOthers(seriesIndex) && brushed(rangeInfoList)) {
            var data_1 = seriesModel.getData();
            data_1.each(function(dataIndex) {
              if (checkInRange(seriesModel, rangeInfoList, data_1, dataIndex)) {
                selectedDataIndexForLink[dataIndex] = 1;
              }
            });
          }
        }
        ecModel.eachSeries(function(seriesModel, seriesIndex) {
          var seriesBrushSelected = {
            seriesId: seriesModel.id,
            seriesIndex,
            seriesName: seriesModel.name,
            dataIndex: []
          };
          thisBrushSelected.selected.push(seriesBrushSelected);
          var rangeInfoList = rangeInfoBySeries[seriesIndex];
          var data = seriesModel.getData();
          var getValueState = linkOthers(seriesIndex) ? function(dataIndex) {
            return selectedDataIndexForLink[dataIndex] ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
          } : function(dataIndex) {
            return checkInRange(seriesModel, rangeInfoList, data, dataIndex) ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), "inBrush") : "outOfBrush";
          };
          (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) && applyVisual(STATE_LIST, visualMappings, data, getValueState);
        });
      });
      dispatchAction$1(api2, throttleType, throttleDelay, brushSelected, payload);
    }
    function dispatchAction$1(api2, throttleType, throttleDelay, brushSelected, payload) {
      if (!payload) {
        return;
      }
      var zr = api2.getZr();
      if (zr[DISPATCH_FLAG]) {
        return;
      }
      if (!zr[DISPATCH_METHOD]) {
        zr[DISPATCH_METHOD] = doDispatch;
      }
      var fn2 = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType);
      fn2(api2, brushSelected);
    }
    function doDispatch(api2, brushSelected) {
      if (!api2.isDisposed()) {
        var zr = api2.getZr();
        zr[DISPATCH_FLAG] = true;
        api2.dispatchAction({
          type: "brushSelect",
          batch: brushSelected
        });
        zr[DISPATCH_FLAG] = false;
      }
    }
    function checkInRange(seriesModel, rangeInfoList, data, dataIndex) {
      for (var i2 = 0, len2 = rangeInfoList.length; i2 < len2; i2++) {
        var area = rangeInfoList[i2];
        if (seriesModel.brushSelector(dataIndex, data, area.selectors, area)) {
          return true;
        }
      }
    }
    function brushModelNotControll(brushModel, seriesIndex) {
      var seriesIndices = brushModel.option.seriesIndex;
      return seriesIndices != null && seriesIndices !== "all" && (isArray$2(seriesIndices) ? indexOf(seriesIndices, seriesIndex) < 0 : seriesIndex !== seriesIndices);
    }
    var boundingRectBuilders = {
      rect: function(area) {
        return getBoundingRectFromMinMax(area.range);
      },
      polygon: function(area) {
        var minMax;
        var range2 = area.range;
        for (var i2 = 0, len2 = range2.length; i2 < len2; i2++) {
          minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]];
          var rg = range2[i2];
          rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]);
          rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]);
          rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]);
          rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]);
        }
        return minMax && getBoundingRectFromMinMax(minMax);
      }
    };
    function getBoundingRectFromMinMax(minMax) {
      return new BoundingRect(minMax[0][0], minMax[1][0], minMax[0][1] - minMax[0][0], minMax[1][1] - minMax[1][0]);
    }
    var BrushView = (
      /** @class */
      function(_super) {
        __extends$1(BrushView2, _super);
        function BrushView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BrushView2.type;
          return _this;
        }
        BrushView2.prototype.init = function(ecModel, api2) {
          this.ecModel = ecModel;
          this.api = api2;
          this.model;
          (this._brushController = new BrushController(api2.getZr())).on("brush", bind$2(this._onBrush, this)).mount();
        };
        BrushView2.prototype.render = function(brushModel, ecModel, api2, payload) {
          this.model = brushModel;
          this._updateController(brushModel, ecModel, api2, payload);
        };
        BrushView2.prototype.updateTransform = function(brushModel, ecModel, api2, payload) {
          layoutCovers(ecModel);
          this._updateController(brushModel, ecModel, api2, payload);
        };
        BrushView2.prototype.updateVisual = function(brushModel, ecModel, api2, payload) {
          this.updateTransform(brushModel, ecModel, api2, payload);
        };
        BrushView2.prototype.updateView = function(brushModel, ecModel, api2, payload) {
          this._updateController(brushModel, ecModel, api2, payload);
        };
        BrushView2.prototype._updateController = function(brushModel, ecModel, api2, payload) {
          (!payload || payload.$from !== brushModel.id) && this._brushController.setPanels(brushModel.brushTargetManager.makePanelOpts(api2)).enableBrush(brushModel.brushOption).updateCovers(brushModel.areas.slice());
        };
        BrushView2.prototype.dispose = function() {
          this._brushController.dispose();
        };
        BrushView2.prototype._onBrush = function(eventParam) {
          var modelId = this.model.id;
          var areas = this.model.brushTargetManager.setOutputRanges(eventParam.areas, this.ecModel);
          (!eventParam.isEnd || eventParam.removeOnClick) && this.api.dispatchAction({
            type: "brush",
            brushId: modelId,
            areas: clone$4(areas),
            $from: modelId
          });
          eventParam.isEnd && this.api.dispatchAction({
            type: "brushEnd",
            brushId: modelId,
            areas: clone$4(areas),
            $from: modelId
          });
        };
        BrushView2.type = "brush";
        return BrushView2;
      }(ComponentView)
    );
    var DEFAULT_OUT_OF_BRUSH_COLOR = "#ddd";
    var BrushModel = (
      /** @class */
      function(_super) {
        __extends$1(BrushModel2, _super);
        function BrushModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = BrushModel2.type;
          _this.areas = [];
          _this.brushOption = {};
          return _this;
        }
        BrushModel2.prototype.optionUpdated = function(newOption, isInit) {
          var thisOption = this.option;
          !isInit && replaceVisualOption(thisOption, newOption, ["inBrush", "outOfBrush"]);
          var inBrush = thisOption.inBrush = thisOption.inBrush || {};
          thisOption.outOfBrush = thisOption.outOfBrush || {
            color: DEFAULT_OUT_OF_BRUSH_COLOR
          };
          if (!inBrush.hasOwnProperty("liftZ")) {
            inBrush.liftZ = 5;
          }
        };
        BrushModel2.prototype.setAreas = function(areas) {
          if (!areas) {
            return;
          }
          this.areas = map$1(areas, function(area) {
            return generateBrushOption(this.option, area);
          }, this);
        };
        BrushModel2.prototype.setBrushOption = function(brushOption) {
          this.brushOption = generateBrushOption(this.option, brushOption);
          this.brushType = this.brushOption.brushType;
        };
        BrushModel2.type = "brush";
        BrushModel2.dependencies = ["geo", "grid", "xAxis", "yAxis", "parallel", "series"];
        BrushModel2.defaultOption = {
          seriesIndex: "all",
          brushType: "rect",
          brushMode: "single",
          transformable: true,
          brushStyle: {
            borderWidth: 1,
            color: "rgba(210,219,238,0.3)",
            borderColor: "#D2DBEE"
          },
          throttleType: "fixRate",
          throttleDelay: 0,
          removeOnClick: true,
          z: 1e4
        };
        return BrushModel2;
      }(ComponentModel)
    );
    function generateBrushOption(option, brushOption) {
      return merge$1({
        brushType: option.brushType,
        brushMode: option.brushMode,
        transformable: option.transformable,
        brushStyle: new Model(option.brushStyle).getItemStyle(),
        removeOnClick: option.removeOnClick,
        z: option.z
      }, brushOption, true);
    }
    var ICON_TYPES = ["rect", "polygon", "lineX", "lineY", "keep", "clear"];
    var BrushFeature = (
      /** @class */
      function(_super) {
        __extends$1(BrushFeature2, _super);
        function BrushFeature2() {
          return _super !== null && _super.apply(this, arguments) || this;
        }
        BrushFeature2.prototype.render = function(featureModel, ecModel, api2) {
          var brushType;
          var brushMode;
          var isBrushed;
          ecModel.eachComponent({
            mainType: "brush"
          }, function(brushModel) {
            brushType = brushModel.brushType;
            brushMode = brushModel.brushOption.brushMode || "single";
            isBrushed = isBrushed || !!brushModel.areas.length;
          });
          this._brushType = brushType;
          this._brushMode = brushMode;
          each$f(featureModel.get("type", true), function(type) {
            featureModel.setIconStatus(type, (type === "keep" ? brushMode === "multiple" : type === "clear" ? isBrushed : type === brushType) ? "emphasis" : "normal");
          });
        };
        BrushFeature2.prototype.updateView = function(featureModel, ecModel, api2) {
          this.render(featureModel, ecModel, api2);
        };
        BrushFeature2.prototype.getIcons = function() {
          var model = this.model;
          var availableIcons = model.get("icon", true);
          var icons = {};
          each$f(model.get("type", true), function(type) {
            if (availableIcons[type]) {
              icons[type] = availableIcons[type];
            }
          });
          return icons;
        };
        BrushFeature2.prototype.onclick = function(ecModel, api2, type) {
          var brushType = this._brushType;
          var brushMode = this._brushMode;
          if (type === "clear") {
            api2.dispatchAction({
              type: "axisAreaSelect",
              intervals: []
            });
            api2.dispatchAction({
              type: "brush",
              command: "clear",
              // Clear all areas of all brush components.
              areas: []
            });
          } else {
            api2.dispatchAction({
              type: "takeGlobalCursor",
              key: "brush",
              brushOption: {
                brushType: type === "keep" ? brushType : brushType === type ? false : type,
                brushMode: type === "keep" ? brushMode === "multiple" ? "single" : "multiple" : brushMode
              }
            });
          }
        };
        BrushFeature2.getDefaultOption = function(ecModel) {
          var defaultOption2 = {
            show: true,
            type: ICON_TYPES.slice(),
            icon: {
              /* eslint-disable */
              rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
              polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
              lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
              lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
              keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
              clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
              // jshint ignore:line
              /* eslint-enable */
            },
            // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear`
            title: ecModel.getLocaleModel().get(["toolbox", "brush", "title"])
          };
          return defaultOption2;
        };
        return BrushFeature2;
      }(ToolboxFeature)
    );
    function install$h(registers) {
      registers.registerComponentView(BrushView);
      registers.registerComponentModel(BrushModel);
      registers.registerPreprocessor(brushPreprocessor);
      registers.registerVisual(registers.PRIORITY.VISUAL.BRUSH, brushVisual);
      registers.registerAction({
        type: "brush",
        event: "brush",
        update: "updateVisual"
      }, function(payload, ecModel) {
        ecModel.eachComponent({
          mainType: "brush",
          query: payload
        }, function(brushModel) {
          brushModel.setAreas(payload.areas);
        });
      });
      registers.registerAction({
        type: "brushSelect",
        event: "brushSelected",
        update: "none"
      }, noop$1);
      registers.registerAction({
        type: "brushEnd",
        event: "brushEnd",
        update: "none"
      }, noop$1);
      registerFeature("brush", BrushFeature);
    }
    var TitleModel = (
      /** @class */
      function(_super) {
        __extends$1(TitleModel2, _super);
        function TitleModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TitleModel2.type;
          _this.layoutMode = {
            type: "box",
            ignoreSize: true
          };
          return _this;
        }
        TitleModel2.type = "title";
        TitleModel2.defaultOption = {
          // zlevel: 0,
          z: 6,
          show: true,
          text: "",
          target: "blank",
          subtext: "",
          subtarget: "blank",
          left: 0,
          top: 0,
          backgroundColor: "rgba(0,0,0,0)",
          borderColor: "#ccc",
          borderWidth: 0,
          padding: 5,
          itemGap: 10,
          textStyle: {
            fontSize: 18,
            fontWeight: "bold",
            color: "#464646"
          },
          subtextStyle: {
            fontSize: 12,
            color: "#6E7079"
          }
        };
        return TitleModel2;
      }(ComponentModel)
    );
    var TitleView = (
      /** @class */
      function(_super) {
        __extends$1(TitleView2, _super);
        function TitleView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TitleView2.type;
          return _this;
        }
        TitleView2.prototype.render = function(titleModel, ecModel, api2) {
          this.group.removeAll();
          if (!titleModel.get("show")) {
            return;
          }
          var group = this.group;
          var textStyleModel = titleModel.getModel("textStyle");
          var subtextStyleModel = titleModel.getModel("subtextStyle");
          var textAlign2 = titleModel.get("textAlign");
          var textVerticalAlign = retrieve2(titleModel.get("textBaseline"), titleModel.get("textVerticalAlign"));
          var textEl = new ZRText({
            style: createTextStyle(textStyleModel, {
              text: titleModel.get("text"),
              fill: textStyleModel.getTextColor()
            }, {
              disableBox: true
            }),
            z2: 10
          });
          var textRect = textEl.getBoundingRect();
          var subText = titleModel.get("subtext");
          var subTextEl = new ZRText({
            style: createTextStyle(subtextStyleModel, {
              text: subText,
              fill: subtextStyleModel.getTextColor(),
              y: textRect.height + titleModel.get("itemGap"),
              verticalAlign: "top"
            }, {
              disableBox: true
            }),
            z2: 10
          });
          var link = titleModel.get("link");
          var sublink = titleModel.get("sublink");
          var triggerEvent2 = titleModel.get("triggerEvent", true);
          textEl.silent = !link && !triggerEvent2;
          subTextEl.silent = !sublink && !triggerEvent2;
          if (link) {
            textEl.on("click", function() {
              windowOpen(link, "_" + titleModel.get("target"));
            });
          }
          if (sublink) {
            subTextEl.on("click", function() {
              windowOpen(sublink, "_" + titleModel.get("subtarget"));
            });
          }
          getECData(textEl).eventData = getECData(subTextEl).eventData = triggerEvent2 ? {
            componentType: "title",
            componentIndex: titleModel.componentIndex
          } : null;
          group.add(textEl);
          subText && group.add(subTextEl);
          var groupRect = group.getBoundingRect();
          var layoutOption = titleModel.getBoxLayoutParams();
          layoutOption.width = groupRect.width;
          layoutOption.height = groupRect.height;
          var layoutRect = getLayoutRect(layoutOption, {
            width: api2.getWidth(),
            height: api2.getHeight()
          }, titleModel.get("padding"));
          if (!textAlign2) {
            textAlign2 = titleModel.get("left") || titleModel.get("right");
            if (textAlign2 === "middle") {
              textAlign2 = "center";
            }
            if (textAlign2 === "right") {
              layoutRect.x += layoutRect.width;
            } else if (textAlign2 === "center") {
              layoutRect.x += layoutRect.width / 2;
            }
          }
          if (!textVerticalAlign) {
            textVerticalAlign = titleModel.get("top") || titleModel.get("bottom");
            if (textVerticalAlign === "center") {
              textVerticalAlign = "middle";
            }
            if (textVerticalAlign === "bottom") {
              layoutRect.y += layoutRect.height;
            } else if (textVerticalAlign === "middle") {
              layoutRect.y += layoutRect.height / 2;
            }
            textVerticalAlign = textVerticalAlign || "top";
          }
          group.x = layoutRect.x;
          group.y = layoutRect.y;
          group.markRedraw();
          var alignStyle = {
            align: textAlign2,
            verticalAlign: textVerticalAlign
          };
          textEl.setStyle(alignStyle);
          subTextEl.setStyle(alignStyle);
          groupRect = group.getBoundingRect();
          var padding = layoutRect.margin;
          var style = titleModel.getItemStyle(["color", "opacity"]);
          style.fill = titleModel.get("backgroundColor");
          var rect = new Rect$2({
            shape: {
              x: groupRect.x - padding[3],
              y: groupRect.y - padding[0],
              width: groupRect.width + padding[1] + padding[3],
              height: groupRect.height + padding[0] + padding[2],
              r: titleModel.get("borderRadius")
            },
            style,
            subPixelOptimize: true,
            silent: true
          });
          group.add(rect);
        };
        TitleView2.type = "title";
        return TitleView2;
      }(ComponentView)
    );
    function install$g(registers) {
      registers.registerComponentModel(TitleModel);
      registers.registerComponentView(TitleView);
    }
    var TimelineModel = (
      /** @class */
      function(_super) {
        __extends$1(TimelineModel2, _super);
        function TimelineModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TimelineModel2.type;
          _this.layoutMode = "box";
          return _this;
        }
        TimelineModel2.prototype.init = function(option, parentModel, ecModel) {
          this.mergeDefaultAndTheme(option, ecModel);
          this._initData();
        };
        TimelineModel2.prototype.mergeOption = function(option) {
          _super.prototype.mergeOption.apply(this, arguments);
          this._initData();
        };
        TimelineModel2.prototype.setCurrentIndex = function(currentIndex) {
          if (currentIndex == null) {
            currentIndex = this.option.currentIndex;
          }
          var count2 = this._data.count();
          if (this.option.loop) {
            currentIndex = (currentIndex % count2 + count2) % count2;
          } else {
            currentIndex >= count2 && (currentIndex = count2 - 1);
            currentIndex < 0 && (currentIndex = 0);
          }
          this.option.currentIndex = currentIndex;
        };
        TimelineModel2.prototype.getCurrentIndex = function() {
          return this.option.currentIndex;
        };
        TimelineModel2.prototype.isIndexMax = function() {
          return this.getCurrentIndex() >= this._data.count() - 1;
        };
        TimelineModel2.prototype.setPlayState = function(state) {
          this.option.autoPlay = !!state;
        };
        TimelineModel2.prototype.getPlayState = function() {
          return !!this.option.autoPlay;
        };
        TimelineModel2.prototype._initData = function() {
          var thisOption = this.option;
          var dataArr = thisOption.data || [];
          var axisType = thisOption.axisType;
          var names2 = this._names = [];
          var processedDataArr;
          if (axisType === "category") {
            processedDataArr = [];
            each$f(dataArr, function(item, index) {
              var value = convertOptionIdName(getDataItemValue(item), "");
              var newItem;
              if (isObject$5(item)) {
                newItem = clone$4(item);
                newItem.value = index;
              } else {
                newItem = index;
              }
              processedDataArr.push(newItem);
              names2.push(value);
            });
          } else {
            processedDataArr = dataArr;
          }
          var dimType = {
            category: "ordinal",
            time: "time",
            value: "number"
          }[axisType] || "number";
          var data = this._data = new SeriesData([{
            name: "value",
            type: dimType
          }], this);
          data.initData(processedDataArr, names2);
        };
        TimelineModel2.prototype.getData = function() {
          return this._data;
        };
        TimelineModel2.prototype.getCategories = function() {
          if (this.get("axisType") === "category") {
            return this._names.slice();
          }
        };
        TimelineModel2.type = "timeline";
        TimelineModel2.defaultOption = {
          // zlevel: 0,                  // 一级层叠
          z: 4,
          show: true,
          axisType: "time",
          realtime: true,
          left: "20%",
          top: null,
          right: "20%",
          bottom: 0,
          width: null,
          height: 40,
          padding: 5,
          controlPosition: "left",
          autoPlay: false,
          rewind: false,
          loop: true,
          playInterval: 2e3,
          currentIndex: 0,
          itemStyle: {},
          label: {
            color: "#000"
          },
          data: []
        };
        return TimelineModel2;
      }(ComponentModel)
    );
    var SliderTimelineModel = (
      /** @class */
      function(_super) {
        __extends$1(SliderTimelineModel2, _super);
        function SliderTimelineModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SliderTimelineModel2.type;
          return _this;
        }
        SliderTimelineModel2.type = "timeline.slider";
        SliderTimelineModel2.defaultOption = inheritDefaultOption(TimelineModel.defaultOption, {
          backgroundColor: "rgba(0,0,0,0)",
          borderColor: "#ccc",
          borderWidth: 0,
          orient: "horizontal",
          inverse: false,
          tooltip: {
            trigger: "item"
            // data item may also have tootip attr.
          },
          symbol: "circle",
          symbolSize: 12,
          lineStyle: {
            show: true,
            width: 2,
            color: "#DAE1F5"
          },
          label: {
            position: "auto",
            // When using number, label position is not
            // restricted by viewRect.
            // positive: right/bottom, negative: left/top
            show: true,
            interval: "auto",
            rotate: 0,
            // formatter: null,
            // 其余属性默认使用全局文本样式，详见TEXTSTYLE
            color: "#A4B1D7"
          },
          itemStyle: {
            color: "#A4B1D7",
            borderWidth: 1
          },
          checkpointStyle: {
            symbol: "circle",
            symbolSize: 15,
            color: "#316bf3",
            borderColor: "#fff",
            borderWidth: 2,
            shadowBlur: 2,
            shadowOffsetX: 1,
            shadowOffsetY: 1,
            shadowColor: "rgba(0, 0, 0, 0.3)",
            // borderColor: 'rgba(194,53,49, 0.5)',
            animation: true,
            animationDuration: 300,
            animationEasing: "quinticInOut"
          },
          controlStyle: {
            show: true,
            showPlayBtn: true,
            showPrevBtn: true,
            showNextBtn: true,
            itemSize: 24,
            itemGap: 12,
            position: "left",
            playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
            stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
            // eslint-disable-next-line max-len
            nextIcon: "M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",
            // eslint-disable-next-line max-len
            prevIcon: "M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",
            prevBtnSize: 18,
            nextBtnSize: 18,
            color: "#A4B1D7",
            borderColor: "#A4B1D7",
            borderWidth: 1
          },
          emphasis: {
            label: {
              show: true,
              // 其余属性默认使用全局文本样式，详见TEXTSTYLE
              color: "#6f778d"
            },
            itemStyle: {
              color: "#316BF3"
            },
            controlStyle: {
              color: "#316BF3",
              borderColor: "#316BF3",
              borderWidth: 2
            }
          },
          progress: {
            lineStyle: {
              color: "#316BF3"
            },
            itemStyle: {
              color: "#316BF3"
            },
            label: {
              color: "#6f778d"
            }
          },
          data: []
        });
        return SliderTimelineModel2;
      }(TimelineModel)
    );
    mixin(SliderTimelineModel, DataFormatMixin.prototype);
    var TimelineView = (
      /** @class */
      function(_super) {
        __extends$1(TimelineView2, _super);
        function TimelineView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = TimelineView2.type;
          return _this;
        }
        TimelineView2.type = "timeline";
        return TimelineView2;
      }(ComponentView)
    );
    var TimelineAxis = (
      /** @class */
      function(_super) {
        __extends$1(TimelineAxis2, _super);
        function TimelineAxis2(dim, scale2, coordExtent, axisType) {
          var _this = _super.call(this, dim, scale2, coordExtent) || this;
          _this.type = axisType || "value";
          return _this;
        }
        TimelineAxis2.prototype.getLabelModel = function() {
          return this.model.getModel("label");
        };
        TimelineAxis2.prototype.isHorizontal = function() {
          return this.model.get("orient") === "horizontal";
        };
        return TimelineAxis2;
      }(Axis)
    );
    var PI = Math.PI;
    var labelDataIndexStore = makeInner();
    var SliderTimelineView = (
      /** @class */
      function(_super) {
        __extends$1(SliderTimelineView2, _super);
        function SliderTimelineView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SliderTimelineView2.type;
          return _this;
        }
        SliderTimelineView2.prototype.init = function(ecModel, api2) {
          this.api = api2;
        };
        SliderTimelineView2.prototype.render = function(timelineModel, ecModel, api2) {
          this.model = timelineModel;
          this.api = api2;
          this.ecModel = ecModel;
          this.group.removeAll();
          if (timelineModel.get("show", true)) {
            var layoutInfo_1 = this._layout(timelineModel, api2);
            var mainGroup_1 = this._createGroup("_mainGroup");
            var labelGroup = this._createGroup("_labelGroup");
            var axis_1 = this._axis = this._createAxis(layoutInfo_1, timelineModel);
            timelineModel.formatTooltip = function(dataIndex) {
              var name = axis_1.scale.getLabel({
                value: dataIndex
              });
              return createTooltipMarkup("nameValue", {
                noName: true,
                value: name
              });
            };
            each$f(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function(name) {
              this["_render" + name](layoutInfo_1, mainGroup_1, axis_1, timelineModel);
            }, this);
            this._renderAxisLabel(layoutInfo_1, labelGroup, axis_1, timelineModel);
            this._position(layoutInfo_1, timelineModel);
          }
          this._doPlayStop();
          this._updateTicksStatus();
        };
        SliderTimelineView2.prototype.remove = function() {
          this._clearTimer();
          this.group.removeAll();
        };
        SliderTimelineView2.prototype.dispose = function() {
          this._clearTimer();
        };
        SliderTimelineView2.prototype._layout = function(timelineModel, api2) {
          var labelPosOpt = timelineModel.get(["label", "position"]);
          var orient = timelineModel.get("orient");
          var viewRect2 = getViewRect(timelineModel, api2);
          var parsedLabelPos;
          if (labelPosOpt == null || labelPosOpt === "auto") {
            parsedLabelPos = orient === "horizontal" ? viewRect2.y + viewRect2.height / 2 < api2.getHeight() / 2 ? "-" : "+" : viewRect2.x + viewRect2.width / 2 < api2.getWidth() / 2 ? "+" : "-";
          } else if (isString$1(labelPosOpt)) {
            parsedLabelPos = {
              horizontal: {
                top: "-",
                bottom: "+"
              },
              vertical: {
                left: "-",
                right: "+"
              }
            }[orient][labelPosOpt];
          } else {
            parsedLabelPos = labelPosOpt;
          }
          var labelAlignMap = {
            horizontal: "center",
            vertical: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "left" : "right"
          };
          var labelBaselineMap = {
            horizontal: parsedLabelPos >= 0 || parsedLabelPos === "+" ? "top" : "bottom",
            vertical: "middle"
          };
          var rotationMap = {
            horizontal: 0,
            vertical: PI / 2
          };
          var mainLength = orient === "vertical" ? viewRect2.height : viewRect2.width;
          var controlModel = timelineModel.getModel("controlStyle");
          var showControl = controlModel.get("show", true);
          var controlSize = showControl ? controlModel.get("itemSize") : 0;
          var controlGap = showControl ? controlModel.get("itemGap") : 0;
          var sizePlusGap = controlSize + controlGap;
          var labelRotation = timelineModel.get(["label", "rotate"]) || 0;
          labelRotation = labelRotation * PI / 180;
          var playPosition;
          var prevBtnPosition;
          var nextBtnPosition;
          var controlPosition = controlModel.get("position", true);
          var showPlayBtn = showControl && controlModel.get("showPlayBtn", true);
          var showPrevBtn = showControl && controlModel.get("showPrevBtn", true);
          var showNextBtn = showControl && controlModel.get("showNextBtn", true);
          var xLeft = 0;
          var xRight = mainLength;
          if (controlPosition === "left" || controlPosition === "bottom") {
            showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);
            showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);
            showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
          } else {
            showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
            showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);
            showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
          }
          var axisExtent = [xLeft, xRight];
          if (timelineModel.get("inverse")) {
            axisExtent.reverse();
          }
          return {
            viewRect: viewRect2,
            mainLength,
            orient,
            rotation: rotationMap[orient],
            labelRotation,
            labelPosOpt: parsedLabelPos,
            labelAlign: timelineModel.get(["label", "align"]) || labelAlignMap[orient],
            labelBaseline: timelineModel.get(["label", "verticalAlign"]) || timelineModel.get(["label", "baseline"]) || labelBaselineMap[orient],
            // Based on mainGroup.
            playPosition,
            prevBtnPosition,
            nextBtnPosition,
            axisExtent,
            controlSize,
            controlGap
          };
        };
        SliderTimelineView2.prototype._position = function(layoutInfo, timelineModel) {
          var mainGroup = this._mainGroup;
          var labelGroup = this._labelGroup;
          var viewRect2 = layoutInfo.viewRect;
          if (layoutInfo.orient === "vertical") {
            var m2 = create$1();
            var rotateOriginX = viewRect2.x;
            var rotateOriginY = viewRect2.y + viewRect2.height;
            translate(m2, m2, [-rotateOriginX, -rotateOriginY]);
            rotate(m2, m2, -PI / 2);
            translate(m2, m2, [rotateOriginX, rotateOriginY]);
            viewRect2 = viewRect2.clone();
            viewRect2.applyTransform(m2);
          }
          var viewBound = getBound(viewRect2);
          var mainBound = getBound(mainGroup.getBoundingRect());
          var labelBound = getBound(labelGroup.getBoundingRect());
          var mainPosition = [mainGroup.x, mainGroup.y];
          var labelsPosition = [labelGroup.x, labelGroup.y];
          labelsPosition[0] = mainPosition[0] = viewBound[0][0];
          var labelPosOpt = layoutInfo.labelPosOpt;
          if (labelPosOpt == null || isString$1(labelPosOpt)) {
            var mainBoundIdx = labelPosOpt === "+" ? 0 : 1;
            toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
            toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);
          } else {
            var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;
            toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
            labelsPosition[1] = mainPosition[1] + labelPosOpt;
          }
          mainGroup.setPosition(mainPosition);
          labelGroup.setPosition(labelsPosition);
          mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;
          setOrigin(mainGroup);
          setOrigin(labelGroup);
          function setOrigin(targetGroup) {
            targetGroup.originX = viewBound[0][0] - targetGroup.x;
            targetGroup.originY = viewBound[1][0] - targetGroup.y;
          }
          function getBound(rect) {
            return [[rect.x, rect.x + rect.width], [rect.y, rect.y + rect.height]];
          }
          function toBound(fromPos, from, to, dimIdx, boundIdx) {
            fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];
          }
        };
        SliderTimelineView2.prototype._createAxis = function(layoutInfo, timelineModel) {
          var data = timelineModel.getData();
          var axisType = timelineModel.get("axisType");
          var scale2 = createScaleByModel(timelineModel, axisType);
          scale2.getTicks = function() {
            return data.mapArray(["value"], function(value) {
              return {
                value
              };
            });
          };
          var dataExtent = data.getDataExtent("value");
          scale2.setExtent(dataExtent[0], dataExtent[1]);
          scale2.calcNiceTicks();
          var axis = new TimelineAxis("value", scale2, layoutInfo.axisExtent, axisType);
          axis.model = timelineModel;
          return axis;
        };
        SliderTimelineView2.prototype._createGroup = function(key) {
          var newGroup = this[key] = new Group$3();
          this.group.add(newGroup);
          return newGroup;
        };
        SliderTimelineView2.prototype._renderAxisLine = function(layoutInfo, group, axis, timelineModel) {
          var axisExtent = axis.getExtent();
          if (!timelineModel.get(["lineStyle", "show"])) {
            return;
          }
          var line = new Line$1({
            shape: {
              x1: axisExtent[0],
              y1: 0,
              x2: axisExtent[1],
              y2: 0
            },
            style: extend$1({
              lineCap: "round"
            }, timelineModel.getModel("lineStyle").getLineStyle()),
            silent: true,
            z2: 1
          });
          group.add(line);
          var progressLine = this._progressLine = new Line$1({
            shape: {
              x1: axisExtent[0],
              x2: this._currentPointer ? this._currentPointer.x : axisExtent[0],
              y1: 0,
              y2: 0
            },
            style: defaults$1({
              lineCap: "round",
              lineWidth: line.style.lineWidth
            }, timelineModel.getModel(["progress", "lineStyle"]).getLineStyle()),
            silent: true,
            z2: 1
          });
          group.add(progressLine);
        };
        SliderTimelineView2.prototype._renderAxisTick = function(layoutInfo, group, axis, timelineModel) {
          var _this = this;
          var data = timelineModel.getData();
          var ticks = axis.scale.getTicks();
          this._tickSymbols = [];
          each$f(ticks, function(tick) {
            var tickCoord = axis.dataToCoord(tick.value);
            var itemModel = data.getItemModel(tick.value);
            var itemStyleModel = itemModel.getModel("itemStyle");
            var hoverStyleModel = itemModel.getModel(["emphasis", "itemStyle"]);
            var progressStyleModel = itemModel.getModel(["progress", "itemStyle"]);
            var symbolOpt = {
              x: tickCoord,
              y: 0,
              onclick: bind$2(_this._changeTimeline, _this, tick.value)
            };
            var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);
            el.ensureState("emphasis").style = hoverStyleModel.getItemStyle();
            el.ensureState("progress").style = progressStyleModel.getItemStyle();
            enableHoverEmphasis(el);
            var ecData = getECData(el);
            if (itemModel.get("tooltip")) {
              ecData.dataIndex = tick.value;
              ecData.dataModel = timelineModel;
            } else {
              ecData.dataIndex = ecData.dataModel = null;
            }
            _this._tickSymbols.push(el);
          });
        };
        SliderTimelineView2.prototype._renderAxisLabel = function(layoutInfo, group, axis, timelineModel) {
          var _this = this;
          var labelModel = axis.getLabelModel();
          if (!labelModel.get("show")) {
            return;
          }
          var data = timelineModel.getData();
          var labels = axis.getViewLabels();
          this._tickLabels = [];
          each$f(labels, function(labelItem) {
            var dataIndex = labelItem.tickValue;
            var itemModel = data.getItemModel(dataIndex);
            var normalLabelModel = itemModel.getModel("label");
            var hoverLabelModel = itemModel.getModel(["emphasis", "label"]);
            var progressLabelModel = itemModel.getModel(["progress", "label"]);
            var tickCoord = axis.dataToCoord(labelItem.tickValue);
            var textEl = new ZRText({
              x: tickCoord,
              y: 0,
              rotation: layoutInfo.labelRotation - layoutInfo.rotation,
              onclick: bind$2(_this._changeTimeline, _this, dataIndex),
              silent: false,
              style: createTextStyle(normalLabelModel, {
                text: labelItem.formattedLabel,
                align: layoutInfo.labelAlign,
                verticalAlign: layoutInfo.labelBaseline
              })
            });
            textEl.ensureState("emphasis").style = createTextStyle(hoverLabelModel);
            textEl.ensureState("progress").style = createTextStyle(progressLabelModel);
            group.add(textEl);
            enableHoverEmphasis(textEl);
            labelDataIndexStore(textEl).dataIndex = dataIndex;
            _this._tickLabels.push(textEl);
          });
        };
        SliderTimelineView2.prototype._renderControl = function(layoutInfo, group, axis, timelineModel) {
          var controlSize = layoutInfo.controlSize;
          var rotation = layoutInfo.rotation;
          var itemStyle = timelineModel.getModel("controlStyle").getItemStyle();
          var hoverStyle = timelineModel.getModel(["emphasis", "controlStyle"]).getItemStyle();
          var playState = timelineModel.getPlayState();
          var inverse = timelineModel.get("inverse", true);
          makeBtn(layoutInfo.nextBtnPosition, "next", bind$2(this._changeTimeline, this, inverse ? "-" : "+"));
          makeBtn(layoutInfo.prevBtnPosition, "prev", bind$2(this._changeTimeline, this, inverse ? "+" : "-"));
          makeBtn(layoutInfo.playPosition, playState ? "stop" : "play", bind$2(this._handlePlayClick, this, !playState), true);
          function makeBtn(position2, iconName, onclick, willRotate) {
            if (!position2) {
              return;
            }
            var iconSize = parsePercent$1(retrieve2(timelineModel.get(["controlStyle", iconName + "BtnSize"]), controlSize), controlSize);
            var rect = [0, -iconSize / 2, iconSize, iconSize];
            var btn = makeControlIcon(timelineModel, iconName + "Icon", rect, {
              x: position2[0],
              y: position2[1],
              originX: controlSize / 2,
              originY: 0,
              rotation: willRotate ? -rotation : 0,
              rectHover: true,
              style: itemStyle,
              onclick
            });
            btn.ensureState("emphasis").style = hoverStyle;
            group.add(btn);
            enableHoverEmphasis(btn);
          }
        };
        SliderTimelineView2.prototype._renderCurrentPointer = function(layoutInfo, group, axis, timelineModel) {
          var data = timelineModel.getData();
          var currentIndex = timelineModel.getCurrentIndex();
          var pointerModel = data.getItemModel(currentIndex).getModel("checkpointStyle");
          var me2 = this;
          var callback = {
            onCreate: function(pointer) {
              pointer.draggable = true;
              pointer.drift = bind$2(me2._handlePointerDrag, me2);
              pointer.ondragend = bind$2(me2._handlePointerDragend, me2);
              pointerMoveTo(pointer, me2._progressLine, currentIndex, axis, timelineModel, true);
            },
            onUpdate: function(pointer) {
              pointerMoveTo(pointer, me2._progressLine, currentIndex, axis, timelineModel);
            }
          };
          this._currentPointer = giveSymbol(pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback);
        };
        SliderTimelineView2.prototype._handlePlayClick = function(nextState) {
          this._clearTimer();
          this.api.dispatchAction({
            type: "timelinePlayChange",
            playState: nextState,
            from: this.uid
          });
        };
        SliderTimelineView2.prototype._handlePointerDrag = function(dx, dy, e2) {
          this._clearTimer();
          this._pointerChangeTimeline([e2.offsetX, e2.offsetY]);
        };
        SliderTimelineView2.prototype._handlePointerDragend = function(e2) {
          this._pointerChangeTimeline([e2.offsetX, e2.offsetY], true);
        };
        SliderTimelineView2.prototype._pointerChangeTimeline = function(mousePos, trigger2) {
          var toCoord = this._toAxisCoord(mousePos)[0];
          var axis = this._axis;
          var axisExtent = asc$2(axis.getExtent().slice());
          toCoord > axisExtent[1] && (toCoord = axisExtent[1]);
          toCoord < axisExtent[0] && (toCoord = axisExtent[0]);
          this._currentPointer.x = toCoord;
          this._currentPointer.markRedraw();
          var progressLine = this._progressLine;
          if (progressLine) {
            progressLine.shape.x2 = toCoord;
            progressLine.dirty();
          }
          var targetDataIndex = this._findNearestTick(toCoord);
          var timelineModel = this.model;
          if (trigger2 || targetDataIndex !== timelineModel.getCurrentIndex() && timelineModel.get("realtime")) {
            this._changeTimeline(targetDataIndex);
          }
        };
        SliderTimelineView2.prototype._doPlayStop = function() {
          var _this = this;
          this._clearTimer();
          if (this.model.getPlayState()) {
            this._timer = setTimeout(function() {
              var timelineModel = _this.model;
              _this._changeTimeline(timelineModel.getCurrentIndex() + (timelineModel.get("rewind", true) ? -1 : 1));
            }, this.model.get("playInterval"));
          }
        };
        SliderTimelineView2.prototype._toAxisCoord = function(vertex) {
          var trans = this._mainGroup.getLocalTransform();
          return applyTransform(vertex, trans, true);
        };
        SliderTimelineView2.prototype._findNearestTick = function(axisCoord) {
          var data = this.model.getData();
          var dist2 = Infinity;
          var targetDataIndex;
          var axis = this._axis;
          data.each(["value"], function(value, dataIndex) {
            var coord = axis.dataToCoord(value);
            var d2 = Math.abs(coord - axisCoord);
            if (d2 < dist2) {
              dist2 = d2;
              targetDataIndex = dataIndex;
            }
          });
          return targetDataIndex;
        };
        SliderTimelineView2.prototype._clearTimer = function() {
          if (this._timer) {
            clearTimeout(this._timer);
            this._timer = null;
          }
        };
        SliderTimelineView2.prototype._changeTimeline = function(nextIndex) {
          var currentIndex = this.model.getCurrentIndex();
          if (nextIndex === "+") {
            nextIndex = currentIndex + 1;
          } else if (nextIndex === "-") {
            nextIndex = currentIndex - 1;
          }
          this.api.dispatchAction({
            type: "timelineChange",
            currentIndex: nextIndex,
            from: this.uid
          });
        };
        SliderTimelineView2.prototype._updateTicksStatus = function() {
          var currentIndex = this.model.getCurrentIndex();
          var tickSymbols = this._tickSymbols;
          var tickLabels = this._tickLabels;
          if (tickSymbols) {
            for (var i2 = 0; i2 < tickSymbols.length; i2++) {
              tickSymbols && tickSymbols[i2] && tickSymbols[i2].toggleState("progress", i2 < currentIndex);
            }
          }
          if (tickLabels) {
            for (var i2 = 0; i2 < tickLabels.length; i2++) {
              tickLabels && tickLabels[i2] && tickLabels[i2].toggleState("progress", labelDataIndexStore(tickLabels[i2]).dataIndex <= currentIndex);
            }
          }
        };
        SliderTimelineView2.type = "timeline.slider";
        return SliderTimelineView2;
      }(TimelineView)
    );
    function createScaleByModel(model, axisType) {
      axisType = axisType || model.get("type");
      if (axisType) {
        switch (axisType) {
          // Buildin scale
          case "category":
            return new OrdinalScale({
              ordinalMeta: model.getCategories(),
              extent: [Infinity, -Infinity]
            });
          case "time":
            return new TimeScale({
              locale: model.ecModel.getLocaleModel(),
              useUTC: model.ecModel.get("useUTC")
            });
          default:
            return new IntervalScale();
        }
      }
    }
    function getViewRect(model, api2) {
      return getLayoutRect(model.getBoxLayoutParams(), {
        width: api2.getWidth(),
        height: api2.getHeight()
      }, model.get("padding"));
    }
    function makeControlIcon(timelineModel, objPath, rect, opts) {
      var style = opts.style;
      var icon = createIcon(timelineModel.get(["controlStyle", objPath]), opts || {}, new BoundingRect(rect[0], rect[1], rect[2], rect[3]));
      if (style) {
        icon.setStyle(style);
      }
      return icon;
    }
    function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {
      var color2 = itemStyleModel.get("color");
      if (!symbol) {
        var symbolType = hostModel.get("symbol");
        symbol = createSymbol$1(symbolType, -1, -1, 2, 2, color2);
        symbol.setStyle("strokeNoScale", true);
        group.add(symbol);
        callback && callback.onCreate(symbol);
      } else {
        symbol.setColor(color2);
        group.add(symbol);
        callback && callback.onUpdate(symbol);
      }
      var itemStyle = itemStyleModel.getItemStyle(["color"]);
      symbol.setStyle(itemStyle);
      opt = merge$1({
        rectHover: true,
        z2: 100
      }, opt, true);
      var symbolSize = normalizeSymbolSize(hostModel.get("symbolSize"));
      opt.scaleX = symbolSize[0] / 2;
      opt.scaleY = symbolSize[1] / 2;
      var symbolOffset = normalizeSymbolOffset(hostModel.get("symbolOffset"), symbolSize);
      if (symbolOffset) {
        opt.x = (opt.x || 0) + symbolOffset[0];
        opt.y = (opt.y || 0) + symbolOffset[1];
      }
      var symbolRotate = hostModel.get("symbolRotate");
      opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0;
      symbol.attr(opt);
      symbol.updateTransform();
      return symbol;
    }
    function pointerMoveTo(pointer, progressLine, dataIndex, axis, timelineModel, noAnimation) {
      if (pointer.dragging) {
        return;
      }
      var pointerModel = timelineModel.getModel("checkpointStyle");
      var toCoord = axis.dataToCoord(timelineModel.getData().get("value", dataIndex));
      if (noAnimation || !pointerModel.get("animation", true)) {
        pointer.attr({
          x: toCoord,
          y: 0
        });
        progressLine && progressLine.attr({
          shape: {
            x2: toCoord
          }
        });
      } else {
        var animationCfg = {
          duration: pointerModel.get("animationDuration", true),
          easing: pointerModel.get("animationEasing", true)
        };
        pointer.stopAnimation(null, true);
        pointer.animateTo({
          x: toCoord,
          y: 0
        }, animationCfg);
        progressLine && progressLine.animateTo({
          shape: {
            x2: toCoord
          }
        }, animationCfg);
      }
    }
    function installTimelineAction(registers) {
      registers.registerAction({
        type: "timelineChange",
        event: "timelineChanged",
        update: "prepareAndUpdate"
      }, function(payload, ecModel, api2) {
        var timelineModel = ecModel.getComponent("timeline");
        if (timelineModel && payload.currentIndex != null) {
          timelineModel.setCurrentIndex(payload.currentIndex);
          if (!timelineModel.get("loop", true) && timelineModel.isIndexMax() && timelineModel.getPlayState()) {
            timelineModel.setPlayState(false);
            api2.dispatchAction({
              type: "timelinePlayChange",
              playState: false,
              from: payload.from
            });
          }
        }
        ecModel.resetOption("timeline", {
          replaceMerge: timelineModel.get("replaceMerge", true)
        });
        return defaults$1({
          currentIndex: timelineModel.option.currentIndex
        }, payload);
      });
      registers.registerAction({
        type: "timelinePlayChange",
        event: "timelinePlayChanged",
        update: "update"
      }, function(payload, ecModel) {
        var timelineModel = ecModel.getComponent("timeline");
        if (timelineModel && payload.playState != null) {
          timelineModel.setPlayState(payload.playState);
        }
      });
    }
    function timelinePreprocessor(option) {
      var timelineOpt = option && option.timeline;
      if (!isArray$2(timelineOpt)) {
        timelineOpt = timelineOpt ? [timelineOpt] : [];
      }
      each$f(timelineOpt, function(opt) {
        if (!opt) {
          return;
        }
        compatibleEC2(opt);
      });
    }
    function compatibleEC2(opt) {
      var type = opt.type;
      var ec2Types = {
        "number": "value",
        "time": "time"
      };
      if (ec2Types[type]) {
        opt.axisType = ec2Types[type];
        delete opt.type;
      }
      transferItem(opt);
      if (has$1(opt, "controlPosition")) {
        var controlStyle = opt.controlStyle || (opt.controlStyle = {});
        if (!has$1(controlStyle, "position")) {
          controlStyle.position = opt.controlPosition;
        }
        if (controlStyle.position === "none" && !has$1(controlStyle, "show")) {
          controlStyle.show = false;
          delete controlStyle.position;
        }
        delete opt.controlPosition;
      }
      each$f(opt.data || [], function(dataItem) {
        if (isObject$5(dataItem) && !isArray$2(dataItem)) {
          if (!has$1(dataItem, "value") && has$1(dataItem, "name")) {
            dataItem.value = dataItem.name;
          }
          transferItem(dataItem);
        }
      });
    }
    function transferItem(opt) {
      var itemStyle = opt.itemStyle || (opt.itemStyle = {});
      var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});
      var label = opt.label || opt.label || {};
      var labelNormal = label.normal || (label.normal = {});
      var excludeLabelAttr = {
        normal: 1,
        emphasis: 1
      };
      each$f(label, function(value, name) {
        if (!excludeLabelAttr[name] && !has$1(labelNormal, name)) {
          labelNormal[name] = value;
        }
      });
      if (itemStyleEmphasis.label && !has$1(label, "emphasis")) {
        label.emphasis = itemStyleEmphasis.label;
        delete itemStyleEmphasis.label;
      }
    }
    function has$1(obj, attr) {
      return obj.hasOwnProperty(attr);
    }
    function install$f(registers) {
      registers.registerComponentModel(SliderTimelineModel);
      registers.registerComponentView(SliderTimelineView);
      registers.registerSubTypeDefaulter("timeline", function() {
        return "slider";
      });
      installTimelineAction(registers);
      registers.registerPreprocessor(timelinePreprocessor);
    }
    function checkMarkerInSeries(seriesOpts, markerType) {
      if (!seriesOpts) {
        return false;
      }
      var seriesOptArr = isArray$2(seriesOpts) ? seriesOpts : [seriesOpts];
      for (var idx = 0; idx < seriesOptArr.length; idx++) {
        if (seriesOptArr[idx] && seriesOptArr[idx][markerType]) {
          return true;
        }
      }
      return false;
    }
    function fillLabel(opt) {
      defaultEmphasis(opt, "label", ["show"]);
    }
    var inner$5 = makeInner();
    var MarkerModel = (
      /** @class */
      function(_super) {
        __extends$1(MarkerModel2, _super);
        function MarkerModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkerModel2.type;
          _this.createdBySelf = false;
          return _this;
        }
        MarkerModel2.prototype.init = function(option, parentModel, ecModel) {
          this.mergeDefaultAndTheme(option, ecModel);
          this._mergeOption(option, ecModel, false, true);
        };
        MarkerModel2.prototype.isAnimationEnabled = function() {
          if (env.node) {
            return false;
          }
          var hostSeries = this.__hostSeries;
          return this.getShallow("animation") && hostSeries && hostSeries.isAnimationEnabled();
        };
        MarkerModel2.prototype.mergeOption = function(newOpt, ecModel) {
          this._mergeOption(newOpt, ecModel, false, false);
        };
        MarkerModel2.prototype._mergeOption = function(newOpt, ecModel, createdBySelf, isInit) {
          var componentType = this.mainType;
          if (!createdBySelf) {
            ecModel.eachSeries(function(seriesModel) {
              var markerOpt = seriesModel.get(this.mainType, true);
              var markerModel = inner$5(seriesModel)[componentType];
              if (!markerOpt || !markerOpt.data) {
                inner$5(seriesModel)[componentType] = null;
                return;
              }
              if (!markerModel) {
                if (isInit) {
                  fillLabel(markerOpt);
                }
                each$f(markerOpt.data, function(item) {
                  if (item instanceof Array) {
                    fillLabel(item[0]);
                    fillLabel(item[1]);
                  } else {
                    fillLabel(item);
                  }
                });
                markerModel = this.createMarkerModelFromSeries(markerOpt, this, ecModel);
                extend$1(markerModel, {
                  mainType: this.mainType,
                  // Use the same series index and name
                  seriesIndex: seriesModel.seriesIndex,
                  name: seriesModel.name,
                  createdBySelf: true
                });
                markerModel.__hostSeries = seriesModel;
              } else {
                markerModel._mergeOption(markerOpt, ecModel, true);
              }
              inner$5(seriesModel)[componentType] = markerModel;
            }, this);
          }
        };
        MarkerModel2.prototype.formatTooltip = function(dataIndex, multipleSeries, dataType2) {
          var data = this.getData();
          var value = this.getRawValue(dataIndex);
          var itemName = data.getName(dataIndex);
          return createTooltipMarkup("section", {
            header: this.name,
            blocks: [createTooltipMarkup("nameValue", {
              name: itemName,
              value,
              noName: !itemName,
              noValue: value == null
            })]
          });
        };
        MarkerModel2.prototype.getData = function() {
          return this._data;
        };
        MarkerModel2.prototype.setData = function(data) {
          this._data = data;
        };
        MarkerModel2.prototype.getDataParams = function(dataIndex, dataType2) {
          var params = DataFormatMixin.prototype.getDataParams.call(this, dataIndex, dataType2);
          var hostSeries = this.__hostSeries;
          if (hostSeries) {
            params.seriesId = hostSeries.id;
            params.seriesName = hostSeries.name;
            params.seriesType = hostSeries.subType;
          }
          return params;
        };
        MarkerModel2.getMarkerModelFromSeries = function(seriesModel, componentType) {
          return inner$5(seriesModel)[componentType];
        };
        MarkerModel2.type = "marker";
        MarkerModel2.dependencies = ["series", "grid", "polar", "geo"];
        return MarkerModel2;
      }(ComponentModel)
    );
    mixin(MarkerModel, DataFormatMixin.prototype);
    var MarkPointModel = (
      /** @class */
      function(_super) {
        __extends$1(MarkPointModel2, _super);
        function MarkPointModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkPointModel2.type;
          return _this;
        }
        MarkPointModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
          return new MarkPointModel2(markerOpt, masterMarkerModel, ecModel);
        };
        MarkPointModel2.type = "markPoint";
        MarkPointModel2.defaultOption = {
          // zlevel: 0,
          z: 5,
          symbol: "pin",
          symbolSize: 50,
          // symbolRotate: 0,
          // symbolOffset: [0, 0]
          tooltip: {
            trigger: "item"
          },
          label: {
            show: true,
            position: "inside"
          },
          itemStyle: {
            borderWidth: 2
          },
          emphasis: {
            label: {
              show: true
            }
          }
        };
        return MarkPointModel2;
      }(MarkerModel)
    );
    function hasXOrY(item) {
      return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));
    }
    function hasXAndY(item) {
      return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y));
    }
    function markerTypeCalculatorWithExtent(markerType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex) {
      var coordArr = [];
      var stacked = isDimensionStacked(
        data,
        targetDataDim
        /* , otherDataDim */
      );
      var calcDataDim = stacked ? data.getCalculationInfo("stackResultDimension") : targetDataDim;
      var value = numCalculate(data, calcDataDim, markerType);
      var dataIndex = data.indicesOfNearest(calcDataDim, value)[0];
      coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex);
      coordArr[targetCoordIndex] = data.get(calcDataDim, dataIndex);
      var coordArrValue = data.get(targetDataDim, dataIndex);
      var precision = getPrecision(data.get(targetDataDim, dataIndex));
      precision = Math.min(precision, 20);
      if (precision >= 0) {
        coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision);
      }
      return [coordArr, coordArrValue];
    }
    var markerTypeCalculator = {
      min: curry$1(markerTypeCalculatorWithExtent, "min"),
      max: curry$1(markerTypeCalculatorWithExtent, "max"),
      average: curry$1(markerTypeCalculatorWithExtent, "average"),
      median: curry$1(markerTypeCalculatorWithExtent, "median")
    };
    function dataTransform(seriesModel, item) {
      if (!item) {
        return;
      }
      var data = seriesModel.getData();
      var coordSys = seriesModel.coordinateSystem;
      var dims = coordSys && coordSys.dimensions;
      if (!hasXAndY(item) && !isArray$2(item.coord) && isArray$2(dims)) {
        var axisInfo = getAxisInfo(item, data, coordSys, seriesModel);
        item = clone$4(item);
        if (item.type && markerTypeCalculator[item.type] && axisInfo.baseAxis && axisInfo.valueAxis) {
          var otherCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
          var targetCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
          var coordInfo = markerTypeCalculator[item.type](data, axisInfo.baseDataDim, axisInfo.valueDataDim, otherCoordIndex, targetCoordIndex);
          item.coord = coordInfo[0];
          item.value = coordInfo[1];
        } else {
          item.coord = [item.xAxis != null ? item.xAxis : item.radiusAxis, item.yAxis != null ? item.yAxis : item.angleAxis];
        }
      }
      if (item.coord == null || !isArray$2(dims)) {
        item.coord = [];
      } else {
        var coord = item.coord;
        for (var i2 = 0; i2 < 2; i2++) {
          if (markerTypeCalculator[coord[i2]]) {
            coord[i2] = numCalculate(data, data.mapDimension(dims[i2]), coord[i2]);
          }
        }
      }
      return item;
    }
    function getAxisInfo(item, data, coordSys, seriesModel) {
      var ret = {};
      if (item.valueIndex != null || item.valueDim != null) {
        ret.valueDataDim = item.valueIndex != null ? data.getDimension(item.valueIndex) : item.valueDim;
        ret.valueAxis = coordSys.getAxis(dataDimToCoordDim(seriesModel, ret.valueDataDim));
        ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);
        ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
      } else {
        ret.baseAxis = seriesModel.getBaseAxis();
        ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);
        ret.baseDataDim = data.mapDimension(ret.baseAxis.dim);
        ret.valueDataDim = data.mapDimension(ret.valueAxis.dim);
      }
      return ret;
    }
    function dataDimToCoordDim(seriesModel, dataDim) {
      var dimItem = seriesModel.getData().getDimensionInfo(dataDim);
      return dimItem && dimItem.coordDim;
    }
    function dataFilter(coordSys, item) {
      return coordSys && coordSys.containData && item.coord && !hasXOrY(item) ? coordSys.containData(item.coord) : true;
    }
    function zoneFilter(coordSys, item1, item2) {
      return coordSys && coordSys.containZone && item1.coord && item2.coord && !hasXOrY(item1) && !hasXOrY(item2) ? coordSys.containZone(item1.coord, item2.coord) : true;
    }
    function createMarkerDimValueGetter(inCoordSys, dims) {
      return inCoordSys ? function(item, dimName, dataIndex, dimIndex) {
        var rawVal = dimIndex < 2 ? item.coord && item.coord[dimIndex] : item.value;
        return parseDataValue(rawVal, dims[dimIndex]);
      } : function(item, dimName, dataIndex, dimIndex) {
        return parseDataValue(item.value, dims[dimIndex]);
      };
    }
    function numCalculate(data, valueDataDim, type) {
      if (type === "average") {
        var sum_1 = 0;
        var count_1 = 0;
        data.each(valueDataDim, function(val, idx) {
          if (!isNaN(val)) {
            sum_1 += val;
            count_1++;
          }
        });
        return sum_1 / count_1;
      } else if (type === "median") {
        return data.getMedian(valueDataDim);
      } else {
        return data.getDataExtent(valueDataDim)[type === "max" ? 1 : 0];
      }
    }
    var inner$4 = makeInner();
    var MarkerView = (
      /** @class */
      function(_super) {
        __extends$1(MarkerView2, _super);
        function MarkerView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkerView2.type;
          return _this;
        }
        MarkerView2.prototype.init = function() {
          this.markerGroupMap = createHashMap();
        };
        MarkerView2.prototype.render = function(markerModel, ecModel, api2) {
          var _this = this;
          var markerGroupMap = this.markerGroupMap;
          markerGroupMap.each(function(item) {
            inner$4(item).keep = false;
          });
          ecModel.eachSeries(function(seriesModel) {
            var markerModel2 = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);
            markerModel2 && _this.renderSeries(seriesModel, markerModel2, ecModel, api2);
          });
          markerGroupMap.each(function(item) {
            !inner$4(item).keep && _this.group.remove(item.group);
          });
        };
        MarkerView2.prototype.markKeep = function(drawGroup) {
          inner$4(drawGroup).keep = true;
        };
        MarkerView2.prototype.toggleBlurSeries = function(seriesModelList, isBlur) {
          var _this = this;
          each$f(seriesModelList, function(seriesModel) {
            var markerModel = MarkerModel.getMarkerModelFromSeries(seriesModel, _this.type);
            if (markerModel) {
              var data = markerModel.getData();
              data.eachItemGraphicEl(function(el) {
                if (el) {
                  isBlur ? enterBlur(el) : leaveBlur(el);
                }
              });
            }
          });
        };
        MarkerView2.type = "marker";
        return MarkerView2;
      }(ComponentView)
    );
    function updateMarkerLayout(mpData, seriesModel, api2) {
      var coordSys = seriesModel.coordinateSystem;
      mpData.each(function(idx) {
        var itemModel = mpData.getItemModel(idx);
        var point;
        var xPx = parsePercent(itemModel.get("x"), api2.getWidth());
        var yPx = parsePercent(itemModel.get("y"), api2.getHeight());
        if (!isNaN(xPx) && !isNaN(yPx)) {
          point = [xPx, yPx];
        } else if (seriesModel.getMarkerPosition) {
          point = seriesModel.getMarkerPosition(mpData.getValues(mpData.dimensions, idx));
        } else if (coordSys) {
          var x2 = mpData.get(coordSys.dimensions[0], idx);
          var y = mpData.get(coordSys.dimensions[1], idx);
          point = coordSys.dataToPoint([x2, y]);
        }
        if (!isNaN(xPx)) {
          point[0] = xPx;
        }
        if (!isNaN(yPx)) {
          point[1] = yPx;
        }
        mpData.setItemLayout(idx, point);
      });
    }
    var MarkPointView = (
      /** @class */
      function(_super) {
        __extends$1(MarkPointView2, _super);
        function MarkPointView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkPointView2.type;
          return _this;
        }
        MarkPointView2.prototype.updateTransform = function(markPointModel, ecModel, api2) {
          ecModel.eachSeries(function(seriesModel) {
            var mpModel = MarkerModel.getMarkerModelFromSeries(seriesModel, "markPoint");
            if (mpModel) {
              updateMarkerLayout(mpModel.getData(), seriesModel, api2);
              this.markerGroupMap.get(seriesModel.id).updateLayout();
            }
          }, this);
        };
        MarkPointView2.prototype.renderSeries = function(seriesModel, mpModel, ecModel, api2) {
          var coordSys = seriesModel.coordinateSystem;
          var seriesId = seriesModel.id;
          var seriesData = seriesModel.getData();
          var symbolDrawMap = this.markerGroupMap;
          var symbolDraw = symbolDrawMap.get(seriesId) || symbolDrawMap.set(seriesId, new SymbolDraw());
          var mpData = createData(coordSys, seriesModel, mpModel);
          mpModel.setData(mpData);
          updateMarkerLayout(mpModel.getData(), seriesModel, api2);
          mpData.each(function(idx) {
            var itemModel = mpData.getItemModel(idx);
            var symbol = itemModel.getShallow("symbol");
            var symbolSize = itemModel.getShallow("symbolSize");
            var symbolRotate = itemModel.getShallow("symbolRotate");
            var symbolOffset = itemModel.getShallow("symbolOffset");
            var symbolKeepAspect = itemModel.getShallow("symbolKeepAspect");
            if (isFunction$1(symbol) || isFunction$1(symbolSize) || isFunction$1(symbolRotate) || isFunction$1(symbolOffset)) {
              var rawIdx = mpModel.getRawValue(idx);
              var dataParams = mpModel.getDataParams(idx);
              if (isFunction$1(symbol)) {
                symbol = symbol(rawIdx, dataParams);
              }
              if (isFunction$1(symbolSize)) {
                symbolSize = symbolSize(rawIdx, dataParams);
              }
              if (isFunction$1(symbolRotate)) {
                symbolRotate = symbolRotate(rawIdx, dataParams);
              }
              if (isFunction$1(symbolOffset)) {
                symbolOffset = symbolOffset(rawIdx, dataParams);
              }
            }
            var style = itemModel.getModel("itemStyle").getItemStyle();
            var color2 = getVisualFromData(seriesData, "color");
            if (!style.fill) {
              style.fill = color2;
            }
            mpData.setItemVisual(idx, {
              symbol,
              symbolSize,
              symbolRotate,
              symbolOffset,
              symbolKeepAspect,
              style
            });
          });
          symbolDraw.updateData(mpData);
          this.group.add(symbolDraw.group);
          mpData.eachItemGraphicEl(function(el) {
            el.traverse(function(child) {
              getECData(child).dataModel = mpModel;
            });
          });
          this.markKeep(symbolDraw);
          symbolDraw.group.silent = mpModel.get("silent") || seriesModel.get("silent");
        };
        MarkPointView2.type = "markPoint";
        return MarkPointView2;
      }(MarkerView)
    );
    function createData(coordSys, seriesModel, mpModel) {
      var coordDimsInfos;
      if (coordSys) {
        coordDimsInfos = map$1(coordSys && coordSys.dimensions, function(coordDim) {
          var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
          return extend$1(extend$1({}, info), {
            name: coordDim,
            // DON'T use ordinalMeta to parse and collect ordinal.
            ordinalMeta: null
          });
        });
      } else {
        coordDimsInfos = [{
          name: "value",
          type: "float"
        }];
      }
      var mpData = new SeriesData(coordDimsInfos, mpModel);
      var dataOpt = map$1(mpModel.get("data"), curry$1(dataTransform, seriesModel));
      if (coordSys) {
        dataOpt = filter(dataOpt, curry$1(dataFilter, coordSys));
      }
      var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
      mpData.initData(dataOpt, null, dimValueGetter);
      return mpData;
    }
    function install$e(registers) {
      registers.registerComponentModel(MarkPointModel);
      registers.registerComponentView(MarkPointView);
      registers.registerPreprocessor(function(opt) {
        if (checkMarkerInSeries(opt.series, "markPoint")) {
          opt.markPoint = opt.markPoint || {};
        }
      });
    }
    var MarkLineModel = (
      /** @class */
      function(_super) {
        __extends$1(MarkLineModel2, _super);
        function MarkLineModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkLineModel2.type;
          return _this;
        }
        MarkLineModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
          return new MarkLineModel2(markerOpt, masterMarkerModel, ecModel);
        };
        MarkLineModel2.type = "markLine";
        MarkLineModel2.defaultOption = {
          // zlevel: 0,
          z: 5,
          symbol: ["circle", "arrow"],
          symbolSize: [8, 16],
          // symbolRotate: 0,
          symbolOffset: 0,
          precision: 2,
          tooltip: {
            trigger: "item"
          },
          label: {
            show: true,
            position: "end",
            distance: 5
          },
          lineStyle: {
            type: "dashed"
          },
          emphasis: {
            label: {
              show: true
            },
            lineStyle: {
              width: 3
            }
          },
          animationEasing: "linear"
        };
        return MarkLineModel2;
      }(MarkerModel)
    );
    var inner$3 = makeInner();
    var markLineTransform = function(seriesModel, coordSys, mlModel, item) {
      var data = seriesModel.getData();
      var itemArray;
      if (!isArray$2(item)) {
        var mlType = item.type;
        if (mlType === "min" || mlType === "max" || mlType === "average" || mlType === "median" || item.xAxis != null || item.yAxis != null) {
          var valueAxis2 = void 0;
          var value = void 0;
          if (item.yAxis != null || item.xAxis != null) {
            valueAxis2 = coordSys.getAxis(item.yAxis != null ? "y" : "x");
            value = retrieve(item.yAxis, item.xAxis);
          } else {
            var axisInfo = getAxisInfo(item, data, coordSys, seriesModel);
            valueAxis2 = axisInfo.valueAxis;
            var valueDataDim = getStackedDimension(data, axisInfo.valueDataDim);
            value = numCalculate(data, valueDataDim, mlType);
          }
          var valueIndex = valueAxis2.dim === "x" ? 0 : 1;
          var baseIndex = 1 - valueIndex;
          var mlFrom = clone$4(item);
          var mlTo = {
            coord: []
          };
          mlFrom.type = null;
          mlFrom.coord = [];
          mlFrom.coord[baseIndex] = -Infinity;
          mlTo.coord[baseIndex] = Infinity;
          var precision = mlModel.get("precision");
          if (precision >= 0 && isNumber$1(value)) {
            value = +value.toFixed(Math.min(precision, 20));
          }
          mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = value;
          itemArray = [mlFrom, mlTo, {
            type: mlType,
            valueIndex: item.valueIndex,
            // Force to use the value of calculated value.
            value
          }];
        } else {
          itemArray = [];
        }
      } else {
        itemArray = item;
      }
      var normalizedItem = [dataTransform(seriesModel, itemArray[0]), dataTransform(seriesModel, itemArray[1]), extend$1({}, itemArray[2])];
      normalizedItem[2].type = normalizedItem[2].type || null;
      merge$1(normalizedItem[2], normalizedItem[0]);
      merge$1(normalizedItem[2], normalizedItem[1]);
      return normalizedItem;
    };
    function isInfinity$1(val) {
      return !isNaN(val) && !isFinite(val);
    }
    function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
      var otherDimIndex = 1 - dimIndex;
      var dimName = coordSys.dimensions[dimIndex];
      return isInfinity$1(fromCoord[otherDimIndex]) && isInfinity$1(toCoord[otherDimIndex]) && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]);
    }
    function markLineFilter(coordSys, item) {
      if (coordSys.type === "cartesian2d") {
        var fromCoord = item[0].coord;
        var toCoord = item[1].coord;
        if (fromCoord && toCoord && (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys))) {
          return true;
        }
      }
      return dataFilter(coordSys, item[0]) && dataFilter(coordSys, item[1]);
    }
    function updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api2) {
      var coordSys = seriesModel.coordinateSystem;
      var itemModel = data.getItemModel(idx);
      var point;
      var xPx = parsePercent(itemModel.get("x"), api2.getWidth());
      var yPx = parsePercent(itemModel.get("y"), api2.getHeight());
      if (!isNaN(xPx) && !isNaN(yPx)) {
        point = [xPx, yPx];
      } else {
        if (seriesModel.getMarkerPosition) {
          point = seriesModel.getMarkerPosition(data.getValues(data.dimensions, idx));
        } else {
          var dims = coordSys.dimensions;
          var x2 = data.get(dims[0], idx);
          var y = data.get(dims[1], idx);
          point = coordSys.dataToPoint([x2, y]);
        }
        if (isCoordinateSystemType(coordSys, "cartesian2d")) {
          var xAxis = coordSys.getAxis("x");
          var yAxis = coordSys.getAxis("y");
          var dims = coordSys.dimensions;
          if (isInfinity$1(data.get(dims[0], idx))) {
            point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]);
          } else if (isInfinity$1(data.get(dims[1], idx))) {
            point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]);
          }
        }
        if (!isNaN(xPx)) {
          point[0] = xPx;
        }
        if (!isNaN(yPx)) {
          point[1] = yPx;
        }
      }
      data.setItemLayout(idx, point);
    }
    var MarkLineView = (
      /** @class */
      function(_super) {
        __extends$1(MarkLineView2, _super);
        function MarkLineView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkLineView2.type;
          return _this;
        }
        MarkLineView2.prototype.updateTransform = function(markLineModel, ecModel, api2) {
          ecModel.eachSeries(function(seriesModel) {
            var mlModel = MarkerModel.getMarkerModelFromSeries(seriesModel, "markLine");
            if (mlModel) {
              var mlData_1 = mlModel.getData();
              var fromData_1 = inner$3(mlModel).from;
              var toData_1 = inner$3(mlModel).to;
              fromData_1.each(function(idx) {
                updateSingleMarkerEndLayout(fromData_1, idx, true, seriesModel, api2);
                updateSingleMarkerEndLayout(toData_1, idx, false, seriesModel, api2);
              });
              mlData_1.each(function(idx) {
                mlData_1.setItemLayout(idx, [fromData_1.getItemLayout(idx), toData_1.getItemLayout(idx)]);
              });
              this.markerGroupMap.get(seriesModel.id).updateLayout();
            }
          }, this);
        };
        MarkLineView2.prototype.renderSeries = function(seriesModel, mlModel, ecModel, api2) {
          var coordSys = seriesModel.coordinateSystem;
          var seriesId = seriesModel.id;
          var seriesData = seriesModel.getData();
          var lineDrawMap = this.markerGroupMap;
          var lineDraw = lineDrawMap.get(seriesId) || lineDrawMap.set(seriesId, new LineDraw());
          this.group.add(lineDraw.group);
          var mlData = createList$1(coordSys, seriesModel, mlModel);
          var fromData = mlData.from;
          var toData = mlData.to;
          var lineData = mlData.line;
          inner$3(mlModel).from = fromData;
          inner$3(mlModel).to = toData;
          mlModel.setData(lineData);
          var symbolType = mlModel.get("symbol");
          var symbolSize = mlModel.get("symbolSize");
          var symbolRotate = mlModel.get("symbolRotate");
          var symbolOffset = mlModel.get("symbolOffset");
          if (!isArray$2(symbolType)) {
            symbolType = [symbolType, symbolType];
          }
          if (!isArray$2(symbolSize)) {
            symbolSize = [symbolSize, symbolSize];
          }
          if (!isArray$2(symbolRotate)) {
            symbolRotate = [symbolRotate, symbolRotate];
          }
          if (!isArray$2(symbolOffset)) {
            symbolOffset = [symbolOffset, symbolOffset];
          }
          mlData.from.each(function(idx) {
            updateDataVisualAndLayout(fromData, idx, true);
            updateDataVisualAndLayout(toData, idx, false);
          });
          lineData.each(function(idx) {
            var lineStyle = lineData.getItemModel(idx).getModel("lineStyle").getLineStyle();
            lineData.setItemLayout(idx, [fromData.getItemLayout(idx), toData.getItemLayout(idx)]);
            if (lineStyle.stroke == null) {
              lineStyle.stroke = fromData.getItemVisual(idx, "style").fill;
            }
            lineData.setItemVisual(idx, {
              fromSymbolKeepAspect: fromData.getItemVisual(idx, "symbolKeepAspect"),
              fromSymbolOffset: fromData.getItemVisual(idx, "symbolOffset"),
              fromSymbolRotate: fromData.getItemVisual(idx, "symbolRotate"),
              fromSymbolSize: fromData.getItemVisual(idx, "symbolSize"),
              fromSymbol: fromData.getItemVisual(idx, "symbol"),
              toSymbolKeepAspect: toData.getItemVisual(idx, "symbolKeepAspect"),
              toSymbolOffset: toData.getItemVisual(idx, "symbolOffset"),
              toSymbolRotate: toData.getItemVisual(idx, "symbolRotate"),
              toSymbolSize: toData.getItemVisual(idx, "symbolSize"),
              toSymbol: toData.getItemVisual(idx, "symbol"),
              style: lineStyle
            });
          });
          lineDraw.updateData(lineData);
          mlData.line.eachItemGraphicEl(function(el) {
            getECData(el).dataModel = mlModel;
            el.traverse(function(child) {
              getECData(child).dataModel = mlModel;
            });
          });
          function updateDataVisualAndLayout(data, idx, isFrom) {
            var itemModel = data.getItemModel(idx);
            updateSingleMarkerEndLayout(data, idx, isFrom, seriesModel, api2);
            var style = itemModel.getModel("itemStyle").getItemStyle();
            if (style.fill == null) {
              style.fill = getVisualFromData(seriesData, "color");
            }
            data.setItemVisual(idx, {
              symbolKeepAspect: itemModel.get("symbolKeepAspect"),
              // `0` should be considered as a valid value, so use `retrieve2` instead of `||`
              symbolOffset: retrieve2(itemModel.get("symbolOffset", true), symbolOffset[isFrom ? 0 : 1]),
              symbolRotate: retrieve2(itemModel.get("symbolRotate", true), symbolRotate[isFrom ? 0 : 1]),
              // TODO: when 2d array is supported, it should ignore parent
              symbolSize: retrieve2(itemModel.get("symbolSize"), symbolSize[isFrom ? 0 : 1]),
              symbol: retrieve2(itemModel.get("symbol", true), symbolType[isFrom ? 0 : 1]),
              style
            });
          }
          this.markKeep(lineDraw);
          lineDraw.group.silent = mlModel.get("silent") || seriesModel.get("silent");
        };
        MarkLineView2.type = "markLine";
        return MarkLineView2;
      }(MarkerView)
    );
    function createList$1(coordSys, seriesModel, mlModel) {
      var coordDimsInfos;
      if (coordSys) {
        coordDimsInfos = map$1(coordSys && coordSys.dimensions, function(coordDim) {
          var info = seriesModel.getData().getDimensionInfo(seriesModel.getData().mapDimension(coordDim)) || {};
          return extend$1(extend$1({}, info), {
            name: coordDim,
            // DON'T use ordinalMeta to parse and collect ordinal.
            ordinalMeta: null
          });
        });
      } else {
        coordDimsInfos = [{
          name: "value",
          type: "float"
        }];
      }
      var fromData = new SeriesData(coordDimsInfos, mlModel);
      var toData = new SeriesData(coordDimsInfos, mlModel);
      var lineData = new SeriesData([], mlModel);
      var optData = map$1(mlModel.get("data"), curry$1(markLineTransform, seriesModel, coordSys, mlModel));
      if (coordSys) {
        optData = filter(optData, curry$1(markLineFilter, coordSys));
      }
      var dimValueGetter = createMarkerDimValueGetter(!!coordSys, coordDimsInfos);
      fromData.initData(map$1(optData, function(item) {
        return item[0];
      }), null, dimValueGetter);
      toData.initData(map$1(optData, function(item) {
        return item[1];
      }), null, dimValueGetter);
      lineData.initData(map$1(optData, function(item) {
        return item[2];
      }));
      lineData.hasItemOption = true;
      return {
        from: fromData,
        to: toData,
        line: lineData
      };
    }
    function install$d(registers) {
      registers.registerComponentModel(MarkLineModel);
      registers.registerComponentView(MarkLineView);
      registers.registerPreprocessor(function(opt) {
        if (checkMarkerInSeries(opt.series, "markLine")) {
          opt.markLine = opt.markLine || {};
        }
      });
    }
    var MarkAreaModel = (
      /** @class */
      function(_super) {
        __extends$1(MarkAreaModel2, _super);
        function MarkAreaModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkAreaModel2.type;
          return _this;
        }
        MarkAreaModel2.prototype.createMarkerModelFromSeries = function(markerOpt, masterMarkerModel, ecModel) {
          return new MarkAreaModel2(markerOpt, masterMarkerModel, ecModel);
        };
        MarkAreaModel2.type = "markArea";
        MarkAreaModel2.defaultOption = {
          // zlevel: 0,
          // PENDING
          z: 1,
          tooltip: {
            trigger: "item"
          },
          // markArea should fixed on the coordinate system
          animation: false,
          label: {
            show: true,
            position: "top"
          },
          itemStyle: {
            // color and borderColor default to use color from series
            // color: 'auto'
            // borderColor: 'auto'
            borderWidth: 0
          },
          emphasis: {
            label: {
              show: true,
              position: "top"
            }
          }
        };
        return MarkAreaModel2;
      }(MarkerModel)
    );
    var inner$2 = makeInner();
    var markAreaTransform = function(seriesModel, coordSys, maModel, item) {
      var item0 = item[0];
      var item1 = item[1];
      if (!item0 || !item1) {
        return;
      }
      var lt2 = dataTransform(seriesModel, item0);
      var rb2 = dataTransform(seriesModel, item1);
      var ltCoord = lt2.coord;
      var rbCoord = rb2.coord;
      ltCoord[0] = retrieve(ltCoord[0], -Infinity);
      ltCoord[1] = retrieve(ltCoord[1], -Infinity);
      rbCoord[0] = retrieve(rbCoord[0], Infinity);
      rbCoord[1] = retrieve(rbCoord[1], Infinity);
      var result = mergeAll([{}, lt2, rb2]);
      result.coord = [lt2.coord, rb2.coord];
      result.x0 = lt2.x;
      result.y0 = lt2.y;
      result.x1 = rb2.x;
      result.y1 = rb2.y;
      return result;
    };
    function isInfinity(val) {
      return !isNaN(val) && !isFinite(val);
    }
    function ifMarkAreaHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) {
      var otherDimIndex = 1 - dimIndex;
      return isInfinity(fromCoord[otherDimIndex]) && isInfinity(toCoord[otherDimIndex]);
    }
    function markAreaFilter(coordSys, item) {
      var fromCoord = item.coord[0];
      var toCoord = item.coord[1];
      var item0 = {
        coord: fromCoord,
        x: item.x0,
        y: item.y0
      };
      var item1 = {
        coord: toCoord,
        x: item.x1,
        y: item.y1
      };
      if (isCoordinateSystemType(coordSys, "cartesian2d")) {
        if (fromCoord && toCoord && (ifMarkAreaHasOnlyDim(1, fromCoord, toCoord) || ifMarkAreaHasOnlyDim(0, fromCoord, toCoord))) {
          return true;
        }
        return zoneFilter(coordSys, item0, item1);
      }
      return dataFilter(coordSys, item0) || dataFilter(coordSys, item1);
    }
    function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api2) {
      var coordSys = seriesModel.coordinateSystem;
      var itemModel = data.getItemModel(idx);
      var point;
      var xPx = parsePercent(itemModel.get(dims[0]), api2.getWidth());
      var yPx = parsePercent(itemModel.get(dims[1]), api2.getHeight());
      if (!isNaN(xPx) && !isNaN(yPx)) {
        point = [xPx, yPx];
      } else {
        if (seriesModel.getMarkerPosition) {
          var pointValue0 = data.getValues(["x0", "y0"], idx);
          var pointValue1 = data.getValues(["x1", "y1"], idx);
          var clampPointValue0 = coordSys.clampData(pointValue0);
          var clampPointValue1 = coordSys.clampData(pointValue1);
          var pointValue = [];
          if (dims[0] === "x0") {
            pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue1[0] : pointValue0[0];
          } else {
            pointValue[0] = clampPointValue0[0] > clampPointValue1[0] ? pointValue0[0] : pointValue1[0];
          }
          if (dims[1] === "y0") {
            pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue1[1] : pointValue0[1];
          } else {
            pointValue[1] = clampPointValue0[1] > clampPointValue1[1] ? pointValue0[1] : pointValue1[1];
          }
          point = seriesModel.getMarkerPosition(pointValue, dims, true);
        } else {
          var x2 = data.get(dims[0], idx);
          var y = data.get(dims[1], idx);
          var pt3 = [x2, y];
          coordSys.clampData && coordSys.clampData(pt3, pt3);
          point = coordSys.dataToPoint(pt3, true);
        }
        if (isCoordinateSystemType(coordSys, "cartesian2d")) {
          var xAxis = coordSys.getAxis("x");
          var yAxis = coordSys.getAxis("y");
          var x2 = data.get(dims[0], idx);
          var y = data.get(dims[1], idx);
          if (isInfinity(x2)) {
            point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === "x0" ? 0 : 1]);
          } else if (isInfinity(y)) {
            point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === "y0" ? 0 : 1]);
          }
        }
        if (!isNaN(xPx)) {
          point[0] = xPx;
        }
        if (!isNaN(yPx)) {
          point[1] = yPx;
        }
      }
      return point;
    }
    var dimPermutations = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
    var MarkAreaView = (
      /** @class */
      function(_super) {
        __extends$1(MarkAreaView2, _super);
        function MarkAreaView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = MarkAreaView2.type;
          return _this;
        }
        MarkAreaView2.prototype.updateTransform = function(markAreaModel, ecModel, api2) {
          ecModel.eachSeries(function(seriesModel) {
            var maModel = MarkerModel.getMarkerModelFromSeries(seriesModel, "markArea");
            if (maModel) {
              var areaData_1 = maModel.getData();
              areaData_1.each(function(idx) {
                var points2 = map$1(dimPermutations, function(dim) {
                  return getSingleMarkerEndPoint(areaData_1, idx, dim, seriesModel, api2);
                });
                areaData_1.setItemLayout(idx, points2);
                var el = areaData_1.getItemGraphicEl(idx);
                el.setShape("points", points2);
              });
            }
          }, this);
        };
        MarkAreaView2.prototype.renderSeries = function(seriesModel, maModel, ecModel, api2) {
          var coordSys = seriesModel.coordinateSystem;
          var seriesId = seriesModel.id;
          var seriesData = seriesModel.getData();
          var areaGroupMap = this.markerGroupMap;
          var polygonGroup = areaGroupMap.get(seriesId) || areaGroupMap.set(seriesId, {
            group: new Group$3()
          });
          this.group.add(polygonGroup.group);
          this.markKeep(polygonGroup);
          var areaData = createList(coordSys, seriesModel, maModel);
          maModel.setData(areaData);
          areaData.each(function(idx) {
            var points2 = map$1(dimPermutations, function(dim) {
              return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api2);
            });
            var xAxisScale = coordSys.getAxis("x").scale;
            var yAxisScale = coordSys.getAxis("y").scale;
            var xAxisExtent = xAxisScale.getExtent();
            var yAxisExtent = yAxisScale.getExtent();
            var xPointExtent = [xAxisScale.parse(areaData.get("x0", idx)), xAxisScale.parse(areaData.get("x1", idx))];
            var yPointExtent = [yAxisScale.parse(areaData.get("y0", idx)), yAxisScale.parse(areaData.get("y1", idx))];
            asc$2(xPointExtent);
            asc$2(yPointExtent);
            var overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0] || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);
            var allClipped = !overlapped;
            areaData.setItemLayout(idx, {
              points: points2,
              allClipped
            });
            var style = areaData.getItemModel(idx).getModel("itemStyle").getItemStyle();
            var color2 = getVisualFromData(seriesData, "color");
            if (!style.fill) {
              style.fill = color2;
              if (isString$1(style.fill)) {
                style.fill = modifyAlpha(style.fill, 0.4);
              }
            }
            if (!style.stroke) {
              style.stroke = color2;
            }
            areaData.setItemVisual(idx, "style", style);
          });
          areaData.diff(inner$2(polygonGroup).data).add(function(idx) {
            var layout2 = areaData.getItemLayout(idx);
            if (!layout2.allClipped) {
              var polygon = new Polygon({
                shape: {
                  points: layout2.points
                }
              });
              areaData.setItemGraphicEl(idx, polygon);
              polygonGroup.group.add(polygon);
            }
          }).update(function(newIdx, oldIdx) {
            var polygon = inner$2(polygonGroup).data.getItemGraphicEl(oldIdx);
            var layout2 = areaData.getItemLayout(newIdx);
            if (!layout2.allClipped) {
              if (polygon) {
                updateProps$1(polygon, {
                  shape: {
                    points: layout2.points
                  }
                }, maModel, newIdx);
              } else {
                polygon = new Polygon({
                  shape: {
                    points: layout2.points
                  }
                });
              }
              areaData.setItemGraphicEl(newIdx, polygon);
              polygonGroup.group.add(polygon);
            } else if (polygon) {
              polygonGroup.group.remove(polygon);
            }
          }).remove(function(idx) {
            var polygon = inner$2(polygonGroup).data.getItemGraphicEl(idx);
            polygonGroup.group.remove(polygon);
          }).execute();
          areaData.eachItemGraphicEl(function(polygon, idx) {
            var itemModel = areaData.getItemModel(idx);
            var style = areaData.getItemVisual(idx, "style");
            polygon.useStyle(areaData.getItemVisual(idx, "style"));
            setLabelStyle(polygon, getLabelStatesModels(itemModel), {
              labelFetcher: maModel,
              labelDataIndex: idx,
              defaultText: areaData.getName(idx) || "",
              inheritColor: isString$1(style.fill) ? modifyAlpha(style.fill, 1) : "#000"
            });
            setStatesStylesFromModel(polygon, itemModel);
            toggleHoverEmphasis(polygon, null, null, itemModel.get(["emphasis", "disabled"]));
            getECData(polygon).dataModel = maModel;
          });
          inner$2(polygonGroup).data = areaData;
          polygonGroup.group.silent = maModel.get("silent") || seriesModel.get("silent");
        };
        MarkAreaView2.type = "markArea";
        return MarkAreaView2;
      }(MarkerView)
    );
    function createList(coordSys, seriesModel, maModel) {
      var areaData;
      var dataDims;
      var dims = ["x0", "y0", "x1", "y1"];
      if (coordSys) {
        var coordDimsInfos_1 = map$1(coordSys && coordSys.dimensions, function(coordDim) {
          var data = seriesModel.getData();
          var info = data.getDimensionInfo(data.mapDimension(coordDim)) || {};
          return extend$1(extend$1({}, info), {
            name: coordDim,
            // DON'T use ordinalMeta to parse and collect ordinal.
            ordinalMeta: null
          });
        });
        dataDims = map$1(dims, function(dim, idx) {
          return {
            name: dim,
            type: coordDimsInfos_1[idx % 2].type
          };
        });
        areaData = new SeriesData(dataDims, maModel);
      } else {
        dataDims = [{
          name: "value",
          type: "float"
        }];
        areaData = new SeriesData(dataDims, maModel);
      }
      var optData = map$1(maModel.get("data"), curry$1(markAreaTransform, seriesModel, coordSys, maModel));
      if (coordSys) {
        optData = filter(optData, curry$1(markAreaFilter, coordSys));
      }
      var dimValueGetter = coordSys ? function(item, dimName, dataIndex, dimIndex) {
        var rawVal = item.coord[Math.floor(dimIndex / 2)][dimIndex % 2];
        return parseDataValue(rawVal, dataDims[dimIndex]);
      } : function(item, dimName, dataIndex, dimIndex) {
        return parseDataValue(item.value, dataDims[dimIndex]);
      };
      areaData.initData(optData, null, dimValueGetter);
      areaData.hasItemOption = true;
      return areaData;
    }
    function install$c(registers) {
      registers.registerComponentModel(MarkAreaModel);
      registers.registerComponentView(MarkAreaView);
      registers.registerPreprocessor(function(opt) {
        if (checkMarkerInSeries(opt.series, "markArea")) {
          opt.markArea = opt.markArea || {};
        }
      });
    }
    var getDefaultSelectorOptions = function(ecModel, type) {
      if (type === "all") {
        return {
          type: "all",
          title: ecModel.getLocaleModel().get(["legend", "selector", "all"])
        };
      } else if (type === "inverse") {
        return {
          type: "inverse",
          title: ecModel.getLocaleModel().get(["legend", "selector", "inverse"])
        };
      }
    };
    var LegendModel = (
      /** @class */
      function(_super) {
        __extends$1(LegendModel2, _super);
        function LegendModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = LegendModel2.type;
          _this.layoutMode = {
            type: "box",
            // legend.width/height are maxWidth/maxHeight actually,
            // whereas real width/height is calculated by its content.
            // (Setting {left: 10, right: 10} does not make sense).
            // So consider the case:
            // `setOption({legend: {left: 10});`
            // then `setOption({legend: {right: 10});`
            // The previous `left` should be cleared by setting `ignoreSize`.
            ignoreSize: true
          };
          return _this;
        }
        LegendModel2.prototype.init = function(option, parentModel, ecModel) {
          this.mergeDefaultAndTheme(option, ecModel);
          option.selected = option.selected || {};
          this._updateSelector(option);
        };
        LegendModel2.prototype.mergeOption = function(option, ecModel) {
          _super.prototype.mergeOption.call(this, option, ecModel);
          this._updateSelector(option);
        };
        LegendModel2.prototype._updateSelector = function(option) {
          var selector2 = option.selector;
          var ecModel = this.ecModel;
          if (selector2 === true) {
            selector2 = option.selector = ["all", "inverse"];
          }
          if (isArray$2(selector2)) {
            each$f(selector2, function(item, index) {
              isString$1(item) && (item = {
                type: item
              });
              selector2[index] = merge$1(item, getDefaultSelectorOptions(ecModel, item.type));
            });
          }
        };
        LegendModel2.prototype.optionUpdated = function() {
          this._updateData(this.ecModel);
          var legendData = this._data;
          if (legendData[0] && this.get("selectedMode") === "single") {
            var hasSelected = false;
            for (var i2 = 0; i2 < legendData.length; i2++) {
              var name_1 = legendData[i2].get("name");
              if (this.isSelected(name_1)) {
                this.select(name_1);
                hasSelected = true;
                break;
              }
            }
            !hasSelected && this.select(legendData[0].get("name"));
          }
        };
        LegendModel2.prototype._updateData = function(ecModel) {
          var potentialData = [];
          var availableNames = [];
          ecModel.eachRawSeries(function(seriesModel) {
            var seriesName = seriesModel.name;
            availableNames.push(seriesName);
            var isPotential;
            if (seriesModel.legendVisualProvider) {
              var provider = seriesModel.legendVisualProvider;
              var names2 = provider.getAllNames();
              if (!ecModel.isSeriesFiltered(seriesModel)) {
                availableNames = availableNames.concat(names2);
              }
              if (names2.length) {
                potentialData = potentialData.concat(names2);
              } else {
                isPotential = true;
              }
            } else {
              isPotential = true;
            }
            if (isPotential && isNameSpecified(seriesModel)) {
              potentialData.push(seriesModel.name);
            }
          });
          this._availableNames = availableNames;
          var rawData = this.get("data") || potentialData;
          var legendNameMap = createHashMap();
          var legendData = map$1(rawData, function(dataItem) {
            if (isString$1(dataItem) || isNumber$1(dataItem)) {
              dataItem = {
                name: dataItem
              };
            }
            if (legendNameMap.get(dataItem.name)) {
              return null;
            }
            legendNameMap.set(dataItem.name, true);
            return new Model(dataItem, this, this.ecModel);
          }, this);
          this._data = filter(legendData, function(item) {
            return !!item;
          });
        };
        LegendModel2.prototype.getData = function() {
          return this._data;
        };
        LegendModel2.prototype.select = function(name) {
          var selected = this.option.selected;
          var selectedMode = this.get("selectedMode");
          if (selectedMode === "single") {
            var data = this._data;
            each$f(data, function(dataItem) {
              selected[dataItem.get("name")] = false;
            });
          }
          selected[name] = true;
        };
        LegendModel2.prototype.unSelect = function(name) {
          if (this.get("selectedMode") !== "single") {
            this.option.selected[name] = false;
          }
        };
        LegendModel2.prototype.toggleSelected = function(name) {
          var selected = this.option.selected;
          if (!selected.hasOwnProperty(name)) {
            selected[name] = true;
          }
          this[selected[name] ? "unSelect" : "select"](name);
        };
        LegendModel2.prototype.allSelect = function() {
          var data = this._data;
          var selected = this.option.selected;
          each$f(data, function(dataItem) {
            selected[dataItem.get("name", true)] = true;
          });
        };
        LegendModel2.prototype.inverseSelect = function() {
          var data = this._data;
          var selected = this.option.selected;
          each$f(data, function(dataItem) {
            var name = dataItem.get("name", true);
            if (!selected.hasOwnProperty(name)) {
              selected[name] = true;
            }
            selected[name] = !selected[name];
          });
        };
        LegendModel2.prototype.isSelected = function(name) {
          var selected = this.option.selected;
          return !(selected.hasOwnProperty(name) && !selected[name]) && indexOf(this._availableNames, name) >= 0;
        };
        LegendModel2.prototype.getOrient = function() {
          return this.get("orient") === "vertical" ? {
            index: 1,
            name: "vertical"
          } : {
            index: 0,
            name: "horizontal"
          };
        };
        LegendModel2.type = "legend.plain";
        LegendModel2.dependencies = ["series"];
        LegendModel2.defaultOption = {
          // zlevel: 0,
          z: 4,
          show: true,
          orient: "horizontal",
          left: "center",
          // right: 'center',
          top: 0,
          // bottom: null,
          align: "auto",
          backgroundColor: "rgba(0,0,0,0)",
          borderColor: "#ccc",
          borderRadius: 0,
          borderWidth: 0,
          padding: 5,
          itemGap: 10,
          itemWidth: 25,
          itemHeight: 14,
          symbolRotate: "inherit",
          symbolKeepAspect: true,
          inactiveColor: "#ccc",
          inactiveBorderColor: "#ccc",
          inactiveBorderWidth: "auto",
          itemStyle: {
            color: "inherit",
            opacity: "inherit",
            borderColor: "inherit",
            borderWidth: "auto",
            borderCap: "inherit",
            borderJoin: "inherit",
            borderDashOffset: "inherit",
            borderMiterLimit: "inherit"
          },
          lineStyle: {
            width: "auto",
            color: "inherit",
            inactiveColor: "#ccc",
            inactiveWidth: 2,
            opacity: "inherit",
            type: "inherit",
            cap: "inherit",
            join: "inherit",
            dashOffset: "inherit",
            miterLimit: "inherit"
          },
          textStyle: {
            color: "#333"
          },
          selectedMode: true,
          selector: false,
          selectorLabel: {
            show: true,
            borderRadius: 10,
            padding: [3, 5, 3, 5],
            fontSize: 12,
            fontFamily: "sans-serif",
            color: "#666",
            borderWidth: 1,
            borderColor: "#666"
          },
          emphasis: {
            selectorLabel: {
              show: true,
              color: "#eee",
              backgroundColor: "#666"
            }
          },
          selectorPosition: "auto",
          selectorItemGap: 7,
          selectorButtonGap: 10,
          tooltip: {
            show: false
          }
        };
        return LegendModel2;
      }(ComponentModel)
    );
    var curry = curry$1;
    var each$3 = each$f;
    var Group$1 = Group$3;
    var LegendView = (
      /** @class */
      function(_super) {
        __extends$1(LegendView2, _super);
        function LegendView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = LegendView2.type;
          _this.newlineDisabled = false;
          return _this;
        }
        LegendView2.prototype.init = function() {
          this.group.add(this._contentGroup = new Group$1());
          this.group.add(this._selectorGroup = new Group$1());
          this._isFirstRender = true;
        };
        LegendView2.prototype.getContentGroup = function() {
          return this._contentGroup;
        };
        LegendView2.prototype.getSelectorGroup = function() {
          return this._selectorGroup;
        };
        LegendView2.prototype.render = function(legendModel, ecModel, api2) {
          var isFirstRender = this._isFirstRender;
          this._isFirstRender = false;
          this.resetInner();
          if (!legendModel.get("show", true)) {
            return;
          }
          var itemAlign = legendModel.get("align");
          var orient = legendModel.get("orient");
          if (!itemAlign || itemAlign === "auto") {
            itemAlign = legendModel.get("left") === "right" && orient === "vertical" ? "right" : "left";
          }
          var selector2 = legendModel.get("selector", true);
          var selectorPosition = legendModel.get("selectorPosition", true);
          if (selector2 && (!selectorPosition || selectorPosition === "auto")) {
            selectorPosition = orient === "horizontal" ? "end" : "start";
          }
          this.renderInner(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition);
          var positionInfo = legendModel.getBoxLayoutParams();
          var viewportSize = {
            width: api2.getWidth(),
            height: api2.getHeight()
          };
          var padding = legendModel.get("padding");
          var maxSize = getLayoutRect(positionInfo, viewportSize, padding);
          var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition);
          var layoutRect = getLayoutRect(defaults$1({
            width: mainRect.width,
            height: mainRect.height
          }, positionInfo), viewportSize, padding);
          this.group.x = layoutRect.x - mainRect.x;
          this.group.y = layoutRect.y - mainRect.y;
          this.group.markRedraw();
          this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));
        };
        LegendView2.prototype.resetInner = function() {
          this.getContentGroup().removeAll();
          this._backgroundEl && this.group.remove(this._backgroundEl);
          this.getSelectorGroup().removeAll();
        };
        LegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition) {
          var contentGroup = this.getContentGroup();
          var legendDrawnMap = createHashMap();
          var selectMode = legendModel.get("selectedMode");
          var excludeSeriesId = [];
          ecModel.eachRawSeries(function(seriesModel) {
            !seriesModel.get("legendHoverLink") && excludeSeriesId.push(seriesModel.id);
          });
          each$3(legendModel.getData(), function(legendItemModel, dataIndex) {
            var name = legendItemModel.get("name");
            if (!this.newlineDisabled && (name === "" || name === "\n")) {
              var g = new Group$1();
              g.newline = true;
              contentGroup.add(g);
              return;
            }
            var seriesModel = ecModel.getSeriesByName(name)[0];
            if (legendDrawnMap.get(name)) {
              return;
            }
            if (seriesModel) {
              var data = seriesModel.getData();
              var lineVisualStyle = data.getVisual("legendLineStyle") || {};
              var legendIcon = data.getVisual("legendIcon");
              var style = data.getVisual("style");
              var itemGroup = this._createItem(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, style, legendIcon, selectMode, api2);
              itemGroup.on("click", curry(dispatchSelectAction, name, null, api2, excludeSeriesId)).on("mouseover", curry(dispatchHighlightAction, seriesModel.name, null, api2, excludeSeriesId)).on("mouseout", curry(dispatchDownplayAction, seriesModel.name, null, api2, excludeSeriesId));
              if (ecModel.ssr) {
                itemGroup.eachChild(function(child) {
                  var ecData = getECData(child);
                  ecData.seriesIndex = seriesModel.seriesIndex;
                  ecData.dataIndex = dataIndex;
                  ecData.ssrType = "legend";
                });
              }
              legendDrawnMap.set(name, true);
            } else {
              ecModel.eachRawSeries(function(seriesModel2) {
                if (legendDrawnMap.get(name)) {
                  return;
                }
                if (seriesModel2.legendVisualProvider) {
                  var provider = seriesModel2.legendVisualProvider;
                  if (!provider.containName(name)) {
                    return;
                  }
                  var idx = provider.indexOfName(name);
                  var style2 = provider.getItemVisual(idx, "style");
                  var legendIcon2 = provider.getItemVisual(idx, "legendIcon");
                  var colorArr = parse$1(style2.fill);
                  if (colorArr && colorArr[3] === 0) {
                    colorArr[3] = 0.2;
                    style2 = extend$1(extend$1({}, style2), {
                      fill: stringify(colorArr, "rgba")
                    });
                  }
                  var itemGroup2 = this._createItem(seriesModel2, name, dataIndex, legendItemModel, legendModel, itemAlign, {}, style2, legendIcon2, selectMode, api2);
                  itemGroup2.on("click", curry(dispatchSelectAction, null, name, api2, excludeSeriesId)).on("mouseover", curry(dispatchHighlightAction, null, name, api2, excludeSeriesId)).on("mouseout", curry(dispatchDownplayAction, null, name, api2, excludeSeriesId));
                  if (ecModel.ssr) {
                    itemGroup2.eachChild(function(child) {
                      var ecData = getECData(child);
                      ecData.seriesIndex = seriesModel2.seriesIndex;
                      ecData.dataIndex = dataIndex;
                      ecData.ssrType = "legend";
                    });
                  }
                  legendDrawnMap.set(name, true);
                }
              }, this);
            }
          }, this);
          if (selector2) {
            this._createSelector(selector2, legendModel, api2, orient, selectorPosition);
          }
        };
        LegendView2.prototype._createSelector = function(selector2, legendModel, api2, orient, selectorPosition) {
          var selectorGroup = this.getSelectorGroup();
          each$3(selector2, function createSelectorButton(selectorItem) {
            var type = selectorItem.type;
            var labelText = new ZRText({
              style: {
                x: 0,
                y: 0,
                align: "center",
                verticalAlign: "middle"
              },
              onclick: function() {
                api2.dispatchAction({
                  type: type === "all" ? "legendAllSelect" : "legendInverseSelect",
                  legendId: legendModel.id
                });
              }
            });
            selectorGroup.add(labelText);
            var labelModel = legendModel.getModel("selectorLabel");
            var emphasisLabelModel = legendModel.getModel(["emphasis", "selectorLabel"]);
            setLabelStyle(labelText, {
              normal: labelModel,
              emphasis: emphasisLabelModel
            }, {
              defaultText: selectorItem.title
            });
            enableHoverEmphasis(labelText);
          });
        };
        LegendView2.prototype._createItem = function(seriesModel, name, dataIndex, legendItemModel, legendModel, itemAlign, lineVisualStyle, itemVisualStyle, legendIcon, selectMode, api2) {
          var drawType = seriesModel.visualDrawType;
          var itemWidth = legendModel.get("itemWidth");
          var itemHeight = legendModel.get("itemHeight");
          var isSelected = legendModel.isSelected(name);
          var iconRotate = legendItemModel.get("symbolRotate");
          var symbolKeepAspect = legendItemModel.get("symbolKeepAspect");
          var legendIconType = legendItemModel.get("icon");
          legendIcon = legendIconType || legendIcon || "roundRect";
          var style = getLegendStyle(legendIcon, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api2);
          var itemGroup = new Group$1();
          var textStyleModel = legendItemModel.getModel("textStyle");
          if (isFunction$1(seriesModel.getLegendIcon) && (!legendIconType || legendIconType === "inherit")) {
            itemGroup.add(seriesModel.getLegendIcon({
              itemWidth,
              itemHeight,
              icon: legendIcon,
              iconRotate,
              itemStyle: style.itemStyle,
              lineStyle: style.lineStyle,
              symbolKeepAspect
            }));
          } else {
            var rotate2 = legendIconType === "inherit" && seriesModel.getData().getVisual("symbol") ? iconRotate === "inherit" ? seriesModel.getData().getVisual("symbolRotate") : iconRotate : 0;
            itemGroup.add(getDefaultLegendIcon({
              itemWidth,
              itemHeight,
              icon: legendIcon,
              iconRotate: rotate2,
              itemStyle: style.itemStyle,
              symbolKeepAspect
            }));
          }
          var textX = itemAlign === "left" ? itemWidth + 5 : -5;
          var textAlign2 = itemAlign;
          var formatter2 = legendModel.get("formatter");
          var content2 = name;
          if (isString$1(formatter2) && formatter2) {
            content2 = formatter2.replace("{name}", name != null ? name : "");
          } else if (isFunction$1(formatter2)) {
            content2 = formatter2(name);
          }
          var textColor = isSelected ? textStyleModel.getTextColor() : legendItemModel.get("inactiveColor");
          itemGroup.add(new ZRText({
            style: createTextStyle(textStyleModel, {
              text: content2,
              x: textX,
              y: itemHeight / 2,
              fill: textColor,
              align: textAlign2,
              verticalAlign: "middle"
            }, {
              inheritColor: textColor
            })
          }));
          var hitRect = new Rect$2({
            shape: itemGroup.getBoundingRect(),
            style: {
              // Cannot use 'invisible' because SVG SSR will miss the node
              fill: "transparent"
            }
          });
          var tooltipModel = legendItemModel.getModel("tooltip");
          if (tooltipModel.get("show")) {
            setTooltipConfig({
              el: hitRect,
              componentModel: legendModel,
              itemName: name,
              itemTooltipOption: tooltipModel.option
            });
          }
          itemGroup.add(hitRect);
          itemGroup.eachChild(function(child) {
            child.silent = true;
          });
          hitRect.silent = !selectMode;
          this.getContentGroup().add(itemGroup);
          enableHoverEmphasis(itemGroup);
          itemGroup.__legendDataIndex = dataIndex;
          return itemGroup;
        };
        LegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
          var contentGroup = this.getContentGroup();
          var selectorGroup = this.getSelectorGroup();
          box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), maxSize.width, maxSize.height);
          var contentRect = contentGroup.getBoundingRect();
          var contentPos = [-contentRect.x, -contentRect.y];
          selectorGroup.markRedraw();
          contentGroup.markRedraw();
          if (selector2) {
            box(
              // Buttons in selectorGroup always layout horizontally
              "horizontal",
              selectorGroup,
              legendModel.get("selectorItemGap", true)
            );
            var selectorRect = selectorGroup.getBoundingRect();
            var selectorPos = [-selectorRect.x, -selectorRect.y];
            var selectorButtonGap = legendModel.get("selectorButtonGap", true);
            var orientIdx = legendModel.getOrient().index;
            var wh = orientIdx === 0 ? "width" : "height";
            var hw = orientIdx === 0 ? "height" : "width";
            var yx = orientIdx === 0 ? "y" : "x";
            if (selectorPosition === "end") {
              selectorPos[orientIdx] += contentRect[wh] + selectorButtonGap;
            } else {
              contentPos[orientIdx] += selectorRect[wh] + selectorButtonGap;
            }
            selectorPos[1 - orientIdx] += contentRect[hw] / 2 - selectorRect[hw] / 2;
            selectorGroup.x = selectorPos[0];
            selectorGroup.y = selectorPos[1];
            contentGroup.x = contentPos[0];
            contentGroup.y = contentPos[1];
            var mainRect = {
              x: 0,
              y: 0
            };
            mainRect[wh] = contentRect[wh] + selectorButtonGap + selectorRect[wh];
            mainRect[hw] = Math.max(contentRect[hw], selectorRect[hw]);
            mainRect[yx] = Math.min(0, selectorRect[yx] + selectorPos[1 - orientIdx]);
            return mainRect;
          } else {
            contentGroup.x = contentPos[0];
            contentGroup.y = contentPos[1];
            return this.group.getBoundingRect();
          }
        };
        LegendView2.prototype.remove = function() {
          this.getContentGroup().removeAll();
          this._isFirstRender = true;
        };
        LegendView2.type = "legend.plain";
        return LegendView2;
      }(ComponentView)
    );
    function getLegendStyle(iconType, legendItemModel, lineVisualStyle, itemVisualStyle, drawType, isSelected, api2) {
      function handleCommonProps(style, visualStyle) {
        if (style.lineWidth === "auto") {
          style.lineWidth = visualStyle.lineWidth > 0 ? 2 : 0;
        }
        each$3(style, function(propVal, propName) {
          style[propName] === "inherit" && (style[propName] = visualStyle[propName]);
        });
      }
      var itemStyleModel = legendItemModel.getModel("itemStyle");
      var itemStyle = itemStyleModel.getItemStyle();
      var iconBrushType = iconType.lastIndexOf("empty", 0) === 0 ? "fill" : "stroke";
      var decalStyle = itemStyleModel.getShallow("decal");
      itemStyle.decal = !decalStyle || decalStyle === "inherit" ? itemVisualStyle.decal : createOrUpdatePatternFromDecal(decalStyle, api2);
      if (itemStyle.fill === "inherit") {
        itemStyle.fill = itemVisualStyle[drawType];
      }
      if (itemStyle.stroke === "inherit") {
        itemStyle.stroke = itemVisualStyle[iconBrushType];
      }
      if (itemStyle.opacity === "inherit") {
        itemStyle.opacity = (drawType === "fill" ? itemVisualStyle : lineVisualStyle).opacity;
      }
      handleCommonProps(itemStyle, itemVisualStyle);
      var legendLineModel = legendItemModel.getModel("lineStyle");
      var lineStyle = legendLineModel.getLineStyle();
      handleCommonProps(lineStyle, lineVisualStyle);
      itemStyle.fill === "auto" && (itemStyle.fill = itemVisualStyle.fill);
      itemStyle.stroke === "auto" && (itemStyle.stroke = itemVisualStyle.fill);
      lineStyle.stroke === "auto" && (lineStyle.stroke = itemVisualStyle.fill);
      if (!isSelected) {
        var borderWidth = legendItemModel.get("inactiveBorderWidth");
        var visualHasBorder = itemStyle[iconBrushType];
        itemStyle.lineWidth = borderWidth === "auto" ? itemVisualStyle.lineWidth > 0 && visualHasBorder ? 2 : 0 : itemStyle.lineWidth;
        itemStyle.fill = legendItemModel.get("inactiveColor");
        itemStyle.stroke = legendItemModel.get("inactiveBorderColor");
        lineStyle.stroke = legendLineModel.get("inactiveColor");
        lineStyle.lineWidth = legendLineModel.get("inactiveWidth");
      }
      return {
        itemStyle,
        lineStyle
      };
    }
    function getDefaultLegendIcon(opt) {
      var symboType = opt.icon || "roundRect";
      var icon = createSymbol$1(symboType, 0, 0, opt.itemWidth, opt.itemHeight, opt.itemStyle.fill, opt.symbolKeepAspect);
      icon.setStyle(opt.itemStyle);
      icon.rotation = (opt.iconRotate || 0) * Math.PI / 180;
      icon.setOrigin([opt.itemWidth / 2, opt.itemHeight / 2]);
      if (symboType.indexOf("empty") > -1) {
        icon.style.stroke = icon.style.fill;
        icon.style.fill = "#fff";
        icon.style.lineWidth = 2;
      }
      return icon;
    }
    function dispatchSelectAction(seriesName, dataName, api2, excludeSeriesId) {
      dispatchDownplayAction(seriesName, dataName, api2, excludeSeriesId);
      api2.dispatchAction({
        type: "legendToggleSelect",
        name: seriesName != null ? seriesName : dataName
      });
      dispatchHighlightAction(seriesName, dataName, api2, excludeSeriesId);
    }
    function isUseHoverLayer(api2) {
      var list = api2.getZr().storage.getDisplayList();
      var emphasisState;
      var i2 = 0;
      var len2 = list.length;
      while (i2 < len2 && !(emphasisState = list[i2].states.emphasis)) {
        i2++;
      }
      return emphasisState && emphasisState.hoverLayer;
    }
    function dispatchHighlightAction(seriesName, dataName, api2, excludeSeriesId) {
      if (!isUseHoverLayer(api2)) {
        api2.dispatchAction({
          type: "highlight",
          seriesName,
          name: dataName,
          excludeSeriesId
        });
      }
    }
    function dispatchDownplayAction(seriesName, dataName, api2, excludeSeriesId) {
      if (!isUseHoverLayer(api2)) {
        api2.dispatchAction({
          type: "downplay",
          seriesName,
          name: dataName,
          excludeSeriesId
        });
      }
    }
    function legendFilter(ecModel) {
      var legendModels = ecModel.findComponents({
        mainType: "legend"
      });
      if (legendModels && legendModels.length) {
        ecModel.filterSeries(function(series) {
          for (var i2 = 0; i2 < legendModels.length; i2++) {
            if (!legendModels[i2].isSelected(series.name)) {
              return false;
            }
          }
          return true;
        });
      }
    }
    function legendSelectActionHandler(methodName, payload, ecModel) {
      var isAllSelect = methodName === "allSelect" || methodName === "inverseSelect";
      var selectedMap = {};
      var actionLegendIndices = [];
      ecModel.eachComponent({
        mainType: "legend",
        query: payload
      }, function(legendModel) {
        if (isAllSelect) {
          legendModel[methodName]();
        } else {
          legendModel[methodName](payload.name);
        }
        makeSelectedMap(legendModel, selectedMap);
        actionLegendIndices.push(legendModel.componentIndex);
      });
      var allSelectedMap = {};
      ecModel.eachComponent("legend", function(legendModel) {
        each$f(selectedMap, function(isSelected, name) {
          legendModel[isSelected ? "select" : "unSelect"](name);
        });
        makeSelectedMap(legendModel, allSelectedMap);
      });
      return isAllSelect ? {
        selected: allSelectedMap,
        // return legendIndex array to tell the developers which legends are allSelect / inverseSelect
        legendIndex: actionLegendIndices
      } : {
        name: payload.name,
        selected: allSelectedMap
      };
    }
    function makeSelectedMap(legendModel, out2) {
      var selectedMap = out2 || {};
      each$f(legendModel.getData(), function(model) {
        var name = model.get("name");
        if (name === "\n" || name === "") {
          return;
        }
        var isItemSelected = legendModel.isSelected(name);
        if (hasOwn(selectedMap, name)) {
          selectedMap[name] = selectedMap[name] && isItemSelected;
        } else {
          selectedMap[name] = isItemSelected;
        }
      });
      return selectedMap;
    }
    function installLegendAction(registers) {
      registers.registerAction("legendToggleSelect", "legendselectchanged", curry$1(legendSelectActionHandler, "toggleSelected"));
      registers.registerAction("legendAllSelect", "legendselectall", curry$1(legendSelectActionHandler, "allSelect"));
      registers.registerAction("legendInverseSelect", "legendinverseselect", curry$1(legendSelectActionHandler, "inverseSelect"));
      registers.registerAction("legendSelect", "legendselected", curry$1(legendSelectActionHandler, "select"));
      registers.registerAction("legendUnSelect", "legendunselected", curry$1(legendSelectActionHandler, "unSelect"));
    }
    function install$b(registers) {
      registers.registerComponentModel(LegendModel);
      registers.registerComponentView(LegendView);
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.SERIES_FILTER, legendFilter);
      registers.registerSubTypeDefaulter("legend", function() {
        return "plain";
      });
      installLegendAction(registers);
    }
    var ScrollableLegendModel = (
      /** @class */
      function(_super) {
        __extends$1(ScrollableLegendModel2, _super);
        function ScrollableLegendModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ScrollableLegendModel2.type;
          return _this;
        }
        ScrollableLegendModel2.prototype.setScrollDataIndex = function(scrollDataIndex) {
          this.option.scrollDataIndex = scrollDataIndex;
        };
        ScrollableLegendModel2.prototype.init = function(option, parentModel, ecModel) {
          var inputPositionParams = getLayoutParams(option);
          _super.prototype.init.call(this, option, parentModel, ecModel);
          mergeAndNormalizeLayoutParams(this, option, inputPositionParams);
        };
        ScrollableLegendModel2.prototype.mergeOption = function(option, ecModel) {
          _super.prototype.mergeOption.call(this, option, ecModel);
          mergeAndNormalizeLayoutParams(this, this.option, option);
        };
        ScrollableLegendModel2.type = "legend.scroll";
        ScrollableLegendModel2.defaultOption = inheritDefaultOption(LegendModel.defaultOption, {
          scrollDataIndex: 0,
          pageButtonItemGap: 5,
          pageButtonGap: null,
          pageButtonPosition: "end",
          pageFormatter: "{current}/{total}",
          pageIcons: {
            horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
            vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
          },
          pageIconColor: "#2f4554",
          pageIconInactiveColor: "#aaa",
          pageIconSize: 15,
          pageTextStyle: {
            color: "#333"
          },
          animationDurationUpdate: 800
        });
        return ScrollableLegendModel2;
      }(LegendModel)
    );
    function mergeAndNormalizeLayoutParams(legendModel, target, raw) {
      var orient = legendModel.getOrient();
      var ignoreSize = [1, 1];
      ignoreSize[orient.index] = 0;
      mergeLayoutParam(target, raw, {
        type: "box",
        ignoreSize: !!ignoreSize
      });
    }
    var Group = Group$3;
    var WH = ["width", "height"];
    var XY = ["x", "y"];
    var ScrollableLegendView = (
      /** @class */
      function(_super) {
        __extends$1(ScrollableLegendView2, _super);
        function ScrollableLegendView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ScrollableLegendView2.type;
          _this.newlineDisabled = true;
          _this._currentIndex = 0;
          return _this;
        }
        ScrollableLegendView2.prototype.init = function() {
          _super.prototype.init.call(this);
          this.group.add(this._containerGroup = new Group());
          this._containerGroup.add(this.getContentGroup());
          this.group.add(this._controllerGroup = new Group());
        };
        ScrollableLegendView2.prototype.resetInner = function() {
          _super.prototype.resetInner.call(this);
          this._controllerGroup.removeAll();
          this._containerGroup.removeClipPath();
          this._containerGroup.__rectSize = null;
        };
        ScrollableLegendView2.prototype.renderInner = function(itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition) {
          var self2 = this;
          _super.prototype.renderInner.call(this, itemAlign, legendModel, ecModel, api2, selector2, orient, selectorPosition);
          var controllerGroup = this._controllerGroup;
          var pageIconSize = legendModel.get("pageIconSize", true);
          var pageIconSizeArr = isArray$2(pageIconSize) ? pageIconSize : [pageIconSize, pageIconSize];
          createPageButton("pagePrev", 0);
          var pageTextStyleModel = legendModel.getModel("pageTextStyle");
          controllerGroup.add(new ZRText({
            name: "pageText",
            style: {
              // Placeholder to calculate a proper layout.
              text: "xx/xx",
              fill: pageTextStyleModel.getTextColor(),
              font: pageTextStyleModel.getFont(),
              verticalAlign: "middle",
              align: "center"
            },
            silent: true
          }));
          createPageButton("pageNext", 1);
          function createPageButton(name, iconIdx) {
            var pageDataIndexName = name + "DataIndex";
            var icon = createIcon(legendModel.get("pageIcons", true)[legendModel.getOrient().name][iconIdx], {
              // Buttons will be created in each render, so we do not need
              // to worry about avoiding using legendModel kept in scope.
              onclick: bind$2(self2._pageGo, self2, pageDataIndexName, legendModel, api2)
            }, {
              x: -pageIconSizeArr[0] / 2,
              y: -pageIconSizeArr[1] / 2,
              width: pageIconSizeArr[0],
              height: pageIconSizeArr[1]
            });
            icon.name = name;
            controllerGroup.add(icon);
          }
        };
        ScrollableLegendView2.prototype.layoutInner = function(legendModel, itemAlign, maxSize, isFirstRender, selector2, selectorPosition) {
          var selectorGroup = this.getSelectorGroup();
          var orientIdx = legendModel.getOrient().index;
          var wh = WH[orientIdx];
          var xy = XY[orientIdx];
          var hw = WH[1 - orientIdx];
          var yx = XY[1 - orientIdx];
          selector2 && box(
            // Buttons in selectorGroup always layout horizontally
            "horizontal",
            selectorGroup,
            legendModel.get("selectorItemGap", true)
          );
          var selectorButtonGap = legendModel.get("selectorButtonGap", true);
          var selectorRect = selectorGroup.getBoundingRect();
          var selectorPos = [-selectorRect.x, -selectorRect.y];
          var processMaxSize = clone$4(maxSize);
          selector2 && (processMaxSize[wh] = maxSize[wh] - selectorRect[wh] - selectorButtonGap);
          var mainRect = this._layoutContentAndController(legendModel, isFirstRender, processMaxSize, orientIdx, wh, hw, yx, xy);
          if (selector2) {
            if (selectorPosition === "end") {
              selectorPos[orientIdx] += mainRect[wh] + selectorButtonGap;
            } else {
              var offset2 = selectorRect[wh] + selectorButtonGap;
              selectorPos[orientIdx] -= offset2;
              mainRect[xy] -= offset2;
            }
            mainRect[wh] += selectorRect[wh] + selectorButtonGap;
            selectorPos[1 - orientIdx] += mainRect[yx] + mainRect[hw] / 2 - selectorRect[hw] / 2;
            mainRect[hw] = Math.max(mainRect[hw], selectorRect[hw]);
            mainRect[yx] = Math.min(mainRect[yx], selectorRect[yx] + selectorPos[1 - orientIdx]);
            selectorGroup.x = selectorPos[0];
            selectorGroup.y = selectorPos[1];
            selectorGroup.markRedraw();
          }
          return mainRect;
        };
        ScrollableLegendView2.prototype._layoutContentAndController = function(legendModel, isFirstRender, maxSize, orientIdx, wh, hw, yx, xy) {
          var contentGroup = this.getContentGroup();
          var containerGroup = this._containerGroup;
          var controllerGroup = this._controllerGroup;
          box(legendModel.get("orient"), contentGroup, legendModel.get("itemGap"), !orientIdx ? null : maxSize.width, orientIdx ? null : maxSize.height);
          box(
            // Buttons in controller are layout always horizontally.
            "horizontal",
            controllerGroup,
            legendModel.get("pageButtonItemGap", true)
          );
          var contentRect = contentGroup.getBoundingRect();
          var controllerRect = controllerGroup.getBoundingRect();
          var showController = this._showController = contentRect[wh] > maxSize[wh];
          var contentPos = [-contentRect.x, -contentRect.y];
          if (!isFirstRender) {
            contentPos[orientIdx] = contentGroup[xy];
          }
          var containerPos = [0, 0];
          var controllerPos = [-controllerRect.x, -controllerRect.y];
          var pageButtonGap = retrieve2(legendModel.get("pageButtonGap", true), legendModel.get("itemGap", true));
          if (showController) {
            var pageButtonPosition = legendModel.get("pageButtonPosition", true);
            if (pageButtonPosition === "end") {
              controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh];
            } else {
              containerPos[orientIdx] += controllerRect[wh] + pageButtonGap;
            }
          }
          controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2;
          contentGroup.setPosition(contentPos);
          containerGroup.setPosition(containerPos);
          controllerGroup.setPosition(controllerPos);
          var mainRect = {
            x: 0,
            y: 0
          };
          mainRect[wh] = showController ? maxSize[wh] : contentRect[wh];
          mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]);
          mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]);
          containerGroup.__rectSize = maxSize[wh];
          if (showController) {
            var clipShape = {
              x: 0,
              y: 0
            };
            clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0);
            clipShape[hw] = mainRect[hw];
            containerGroup.setClipPath(new Rect$2({
              shape: clipShape
            }));
            containerGroup.__rectSize = clipShape[wh];
          } else {
            controllerGroup.eachChild(function(child) {
              child.attr({
                invisible: true,
                silent: true
              });
            });
          }
          var pageInfo = this._getPageInfo(legendModel);
          pageInfo.pageIndex != null && updateProps$1(
            contentGroup,
            {
              x: pageInfo.contentPosition[0],
              y: pageInfo.contentPosition[1]
            },
            // When switch from "show controller" to "not show controller", view should be
            // updated immediately without animation, otherwise causes weird effect.
            showController ? legendModel : null
          );
          this._updatePageInfoView(legendModel, pageInfo);
          return mainRect;
        };
        ScrollableLegendView2.prototype._pageGo = function(to, legendModel, api2) {
          var scrollDataIndex = this._getPageInfo(legendModel)[to];
          scrollDataIndex != null && api2.dispatchAction({
            type: "legendScroll",
            scrollDataIndex,
            legendId: legendModel.id
          });
        };
        ScrollableLegendView2.prototype._updatePageInfoView = function(legendModel, pageInfo) {
          var controllerGroup = this._controllerGroup;
          each$f(["pagePrev", "pageNext"], function(name) {
            var key = name + "DataIndex";
            var canJump = pageInfo[key] != null;
            var icon = controllerGroup.childOfName(name);
            if (icon) {
              icon.setStyle("fill", canJump ? legendModel.get("pageIconColor", true) : legendModel.get("pageIconInactiveColor", true));
              icon.cursor = canJump ? "pointer" : "default";
            }
          });
          var pageText = controllerGroup.childOfName("pageText");
          var pageFormatter = legendModel.get("pageFormatter");
          var pageIndex = pageInfo.pageIndex;
          var current = pageIndex != null ? pageIndex + 1 : 0;
          var total2 = pageInfo.pageCount;
          pageText && pageFormatter && pageText.setStyle("text", isString$1(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total2 == null ? "" : total2 + "") : pageFormatter({
            current,
            total: total2
          }));
        };
        ScrollableLegendView2.prototype._getPageInfo = function(legendModel) {
          var scrollDataIndex = legendModel.get("scrollDataIndex", true);
          var contentGroup = this.getContentGroup();
          var containerRectSize = this._containerGroup.__rectSize;
          var orientIdx = legendModel.getOrient().index;
          var wh = WH[orientIdx];
          var xy = XY[orientIdx];
          var targetItemIndex = this._findTargetItemIndex(scrollDataIndex);
          var children = contentGroup.children();
          var targetItem = children[targetItemIndex];
          var itemCount = children.length;
          var pCount = !itemCount ? 0 : 1;
          var result = {
            contentPosition: [contentGroup.x, contentGroup.y],
            pageCount: pCount,
            pageIndex: pCount - 1,
            pagePrevDataIndex: null,
            pageNextDataIndex: null
          };
          if (!targetItem) {
            return result;
          }
          var targetItemInfo = getItemInfo(targetItem);
          result.contentPosition[orientIdx] = -targetItemInfo.s;
          for (var i2 = targetItemIndex + 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i2 <= itemCount; ++i2) {
            currItemInfo = getItemInfo(children[i2]);
            if (
              // Half of the last item is out of the window.
              !currItemInfo && winEndItemInfo.e > winStartItemInfo.s + containerRectSize || currItemInfo && !intersect2(currItemInfo, winStartItemInfo.s)
            ) {
              if (winEndItemInfo.i > winStartItemInfo.i) {
                winStartItemInfo = winEndItemInfo;
              } else {
                winStartItemInfo = currItemInfo;
              }
              if (winStartItemInfo) {
                if (result.pageNextDataIndex == null) {
                  result.pageNextDataIndex = winStartItemInfo.i;
                }
                ++result.pageCount;
              }
            }
            winEndItemInfo = currItemInfo;
          }
          for (var i2 = targetItemIndex - 1, winStartItemInfo = targetItemInfo, winEndItemInfo = targetItemInfo, currItemInfo = null; i2 >= -1; --i2) {
            currItemInfo = getItemInfo(children[i2]);
            if (
              // If the the end item does not intersect with the window started
              // from the current item, a page can be settled.
              (!currItemInfo || !intersect2(winEndItemInfo, currItemInfo.s)) && winStartItemInfo.i < winEndItemInfo.i
            ) {
              winEndItemInfo = winStartItemInfo;
              if (result.pagePrevDataIndex == null) {
                result.pagePrevDataIndex = winStartItemInfo.i;
              }
              ++result.pageCount;
              ++result.pageIndex;
            }
            winStartItemInfo = currItemInfo;
          }
          return result;
          function getItemInfo(el) {
            if (el) {
              var itemRect = el.getBoundingRect();
              var start2 = itemRect[xy] + el[xy];
              return {
                s: start2,
                e: start2 + itemRect[wh],
                i: el.__legendDataIndex
              };
            }
          }
          function intersect2(itemInfo, winStart) {
            return itemInfo.e >= winStart && itemInfo.s <= winStart + containerRectSize;
          }
        };
        ScrollableLegendView2.prototype._findTargetItemIndex = function(targetDataIndex) {
          if (!this._showController) {
            return 0;
          }
          var index;
          var contentGroup = this.getContentGroup();
          var defaultIndex;
          contentGroup.eachChild(function(child, idx) {
            var legendDataIdx = child.__legendDataIndex;
            if (defaultIndex == null && legendDataIdx != null) {
              defaultIndex = idx;
            }
            if (legendDataIdx === targetDataIndex) {
              index = idx;
            }
          });
          return index != null ? index : defaultIndex;
        };
        ScrollableLegendView2.type = "legend.scroll";
        return ScrollableLegendView2;
      }(LegendView)
    );
    function installScrollableLegendAction(registers) {
      registers.registerAction("legendScroll", "legendscroll", function(payload, ecModel) {
        var scrollDataIndex = payload.scrollDataIndex;
        scrollDataIndex != null && ecModel.eachComponent({
          mainType: "legend",
          subType: "scroll",
          query: payload
        }, function(legendModel) {
          legendModel.setScrollDataIndex(scrollDataIndex);
        });
      });
    }
    function install$a(registers) {
      use(install$b);
      registers.registerComponentModel(ScrollableLegendModel);
      registers.registerComponentView(ScrollableLegendView);
      installScrollableLegendAction(registers);
    }
    function install$9(registers) {
      use(install$b);
      use(install$a);
    }
    var InsideZoomModel = (
      /** @class */
      function(_super) {
        __extends$1(InsideZoomModel2, _super);
        function InsideZoomModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = InsideZoomModel2.type;
          return _this;
        }
        InsideZoomModel2.type = "dataZoom.inside";
        InsideZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {
          disabled: false,
          zoomLock: false,
          zoomOnMouseWheel: true,
          moveOnMouseMove: true,
          moveOnMouseWheel: false,
          preventDefaultMouseMove: true
        });
        return InsideZoomModel2;
      }(DataZoomModel)
    );
    var inner$1 = makeInner();
    function setViewInfoToCoordSysRecord(api2, dataZoomModel, getRange) {
      inner$1(api2).coordSysRecordMap.each(function(coordSysRecord) {
        var dzInfo = coordSysRecord.dataZoomInfoMap.get(dataZoomModel.uid);
        if (dzInfo) {
          dzInfo.getRange = getRange;
        }
      });
    }
    function disposeCoordSysRecordIfNeeded(api2, dataZoomModel) {
      var coordSysRecordMap = inner$1(api2).coordSysRecordMap;
      var coordSysKeyArr = coordSysRecordMap.keys();
      for (var i2 = 0; i2 < coordSysKeyArr.length; i2++) {
        var coordSysKey = coordSysKeyArr[i2];
        var coordSysRecord = coordSysRecordMap.get(coordSysKey);
        var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
        if (dataZoomInfoMap) {
          var dzUid = dataZoomModel.uid;
          var dzInfo = dataZoomInfoMap.get(dzUid);
          if (dzInfo) {
            dataZoomInfoMap.removeKey(dzUid);
            if (!dataZoomInfoMap.keys().length) {
              disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
            }
          }
        }
      }
    }
    function disposeCoordSysRecord(coordSysRecordMap, coordSysRecord) {
      if (coordSysRecord) {
        coordSysRecordMap.removeKey(coordSysRecord.model.uid);
        var controller = coordSysRecord.controller;
        controller && controller.dispose();
      }
    }
    function createCoordSysRecord(api2, coordSysModel) {
      var coordSysRecord = {
        model: coordSysModel,
        containsPoint: curry$1(containsPoint, coordSysModel),
        dispatchAction: curry$1(dispatchAction, api2),
        dataZoomInfoMap: null,
        controller: null
      };
      var controller = coordSysRecord.controller = new RoamController(api2.getZr());
      each$f(["pan", "zoom", "scrollMove"], function(eventName) {
        controller.on(eventName, function(event) {
          var batch2 = [];
          coordSysRecord.dataZoomInfoMap.each(function(dzInfo) {
            if (!event.isAvailableBehavior(dzInfo.model.option)) {
              return;
            }
            var method = (dzInfo.getRange || {})[eventName];
            var range2 = method && method(dzInfo.dzReferCoordSysInfo, coordSysRecord.model.mainType, coordSysRecord.controller, event);
            !dzInfo.model.get("disabled", true) && range2 && batch2.push({
              dataZoomId: dzInfo.model.id,
              start: range2[0],
              end: range2[1]
            });
          });
          batch2.length && coordSysRecord.dispatchAction(batch2);
        });
      });
      return coordSysRecord;
    }
    function dispatchAction(api2, batch2) {
      if (!api2.isDisposed()) {
        api2.dispatchAction({
          type: "dataZoom",
          animation: {
            easing: "cubicOut",
            duration: 100
          },
          batch: batch2
        });
      }
    }
    function containsPoint(coordSysModel, e2, x2, y) {
      return coordSysModel.coordinateSystem.containPoint([x2, y]);
    }
    function mergeControllerParams(dataZoomInfoMap) {
      var controlType;
      var prefix = "type_";
      var typePriority = {
        "type_true": 2,
        "type_move": 1,
        "type_false": 0,
        "type_undefined": -1
      };
      var preventDefaultMouseMove = true;
      dataZoomInfoMap.each(function(dataZoomInfo) {
        var dataZoomModel = dataZoomInfo.model;
        var oneType = dataZoomModel.get("disabled", true) ? false : dataZoomModel.get("zoomLock", true) ? "move" : true;
        if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) {
          controlType = oneType;
        }
        preventDefaultMouseMove = preventDefaultMouseMove && dataZoomModel.get("preventDefaultMouseMove", true);
      });
      return {
        controlType,
        opt: {
          // RoamController will enable all of these functionalities,
          // and the final behavior is determined by its event listener
          // provided by each inside zoom.
          zoomOnMouseWheel: true,
          moveOnMouseMove: true,
          moveOnMouseWheel: true,
          preventDefaultMouseMove: !!preventDefaultMouseMove
        }
      };
    }
    function installDataZoomRoamProcessor(registers) {
      registers.registerProcessor(registers.PRIORITY.PROCESSOR.FILTER, function(ecModel, api2) {
        var apiInner = inner$1(api2);
        var coordSysRecordMap = apiInner.coordSysRecordMap || (apiInner.coordSysRecordMap = createHashMap());
        coordSysRecordMap.each(function(coordSysRecord) {
          coordSysRecord.dataZoomInfoMap = null;
        });
        ecModel.eachComponent({
          mainType: "dataZoom",
          subType: "inside"
        }, function(dataZoomModel) {
          var dzReferCoordSysWrap = collectReferCoordSysModelInfo(dataZoomModel);
          each$f(dzReferCoordSysWrap.infoList, function(dzCoordSysInfo) {
            var coordSysUid = dzCoordSysInfo.model.uid;
            var coordSysRecord = coordSysRecordMap.get(coordSysUid) || coordSysRecordMap.set(coordSysUid, createCoordSysRecord(api2, dzCoordSysInfo.model));
            var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap || (coordSysRecord.dataZoomInfoMap = createHashMap());
            dataZoomInfoMap.set(dataZoomModel.uid, {
              dzReferCoordSysInfo: dzCoordSysInfo,
              model: dataZoomModel,
              getRange: null
            });
          });
        });
        coordSysRecordMap.each(function(coordSysRecord) {
          var controller = coordSysRecord.controller;
          var firstDzInfo;
          var dataZoomInfoMap = coordSysRecord.dataZoomInfoMap;
          if (dataZoomInfoMap) {
            var firstDzKey = dataZoomInfoMap.keys()[0];
            if (firstDzKey != null) {
              firstDzInfo = dataZoomInfoMap.get(firstDzKey);
            }
          }
          if (!firstDzInfo) {
            disposeCoordSysRecord(coordSysRecordMap, coordSysRecord);
            return;
          }
          var controllerParams = mergeControllerParams(dataZoomInfoMap);
          controller.enable(controllerParams.controlType, controllerParams.opt);
          controller.setPointerChecker(coordSysRecord.containsPoint);
          createOrUpdate(coordSysRecord, "dispatchAction", firstDzInfo.model.get("throttle", true), "fixRate");
        });
      });
    }
    var InsideZoomView = (
      /** @class */
      function(_super) {
        __extends$1(InsideZoomView2, _super);
        function InsideZoomView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "dataZoom.inside";
          return _this;
        }
        InsideZoomView2.prototype.render = function(dataZoomModel, ecModel, api2) {
          _super.prototype.render.apply(this, arguments);
          if (dataZoomModel.noTarget()) {
            this._clear();
            return;
          }
          this.range = dataZoomModel.getPercentRange();
          setViewInfoToCoordSysRecord(api2, dataZoomModel, {
            pan: bind$2(getRangeHandlers.pan, this),
            zoom: bind$2(getRangeHandlers.zoom, this),
            scrollMove: bind$2(getRangeHandlers.scrollMove, this)
          });
        };
        InsideZoomView2.prototype.dispose = function() {
          this._clear();
          _super.prototype.dispose.apply(this, arguments);
        };
        InsideZoomView2.prototype._clear = function() {
          disposeCoordSysRecordIfNeeded(this.api, this.dataZoomModel);
          this.range = null;
        };
        InsideZoomView2.type = "dataZoom.inside";
        return InsideZoomView2;
      }(DataZoomView)
    );
    var getRangeHandlers = {
      zoom: function(coordSysInfo, coordSysMainType, controller, e2) {
        var lastRange = this.range;
        var range2 = lastRange.slice();
        var axisModel = coordSysInfo.axisModels[0];
        if (!axisModel) {
          return;
        }
        var directionInfo = getDirectionInfo[coordSysMainType](null, [e2.originX, e2.originY], axisModel, controller, coordSysInfo);
        var percentPoint = (directionInfo.signal > 0 ? directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel : directionInfo.pixel - directionInfo.pixelStart) / directionInfo.pixelLength * (range2[1] - range2[0]) + range2[0];
        var scale2 = Math.max(1 / e2.scale, 0);
        range2[0] = (range2[0] - percentPoint) * scale2 + percentPoint;
        range2[1] = (range2[1] - percentPoint) * scale2 + percentPoint;
        var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
        sliderMove(0, range2, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan);
        this.range = range2;
        if (lastRange[0] !== range2[0] || lastRange[1] !== range2[1]) {
          return range2;
        }
      },
      pan: makeMover(function(range2, axisModel, coordSysInfo, coordSysMainType, controller, e2) {
        var directionInfo = getDirectionInfo[coordSysMainType]([e2.oldX, e2.oldY], [e2.newX, e2.newY], axisModel, controller, coordSysInfo);
        return directionInfo.signal * (range2[1] - range2[0]) * directionInfo.pixel / directionInfo.pixelLength;
      }),
      scrollMove: makeMover(function(range2, axisModel, coordSysInfo, coordSysMainType, controller, e2) {
        var directionInfo = getDirectionInfo[coordSysMainType]([0, 0], [e2.scrollDelta, e2.scrollDelta], axisModel, controller, coordSysInfo);
        return directionInfo.signal * (range2[1] - range2[0]) * e2.scrollDelta;
      })
    };
    function makeMover(getPercentDelta) {
      return function(coordSysInfo, coordSysMainType, controller, e2) {
        var lastRange = this.range;
        var range2 = lastRange.slice();
        var axisModel = coordSysInfo.axisModels[0];
        if (!axisModel) {
          return;
        }
        var percentDelta = getPercentDelta(range2, axisModel, coordSysInfo, coordSysMainType, controller, e2);
        sliderMove(percentDelta, range2, [0, 100], "all");
        this.range = range2;
        if (lastRange[0] !== range2[0] || lastRange[1] !== range2[1]) {
          return range2;
        }
      };
    }
    var getDirectionInfo = {
      grid: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
        var axis = axisModel.axis;
        var ret = {};
        var rect = coordSysInfo.model.coordinateSystem.getRect();
        oldPoint = oldPoint || [0, 0];
        if (axis.dim === "x") {
          ret.pixel = newPoint[0] - oldPoint[0];
          ret.pixelLength = rect.width;
          ret.pixelStart = rect.x;
          ret.signal = axis.inverse ? 1 : -1;
        } else {
          ret.pixel = newPoint[1] - oldPoint[1];
          ret.pixelLength = rect.height;
          ret.pixelStart = rect.y;
          ret.signal = axis.inverse ? -1 : 1;
        }
        return ret;
      },
      polar: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
        var axis = axisModel.axis;
        var ret = {};
        var polar = coordSysInfo.model.coordinateSystem;
        var radiusExtent = polar.getRadiusAxis().getExtent();
        var angleExtent = polar.getAngleAxis().getExtent();
        oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0];
        newPoint = polar.pointToCoord(newPoint);
        if (axisModel.mainType === "radiusAxis") {
          ret.pixel = newPoint[0] - oldPoint[0];
          ret.pixelLength = radiusExtent[1] - radiusExtent[0];
          ret.pixelStart = radiusExtent[0];
          ret.signal = axis.inverse ? 1 : -1;
        } else {
          ret.pixel = newPoint[1] - oldPoint[1];
          ret.pixelLength = angleExtent[1] - angleExtent[0];
          ret.pixelStart = angleExtent[0];
          ret.signal = axis.inverse ? -1 : 1;
        }
        return ret;
      },
      singleAxis: function(oldPoint, newPoint, axisModel, controller, coordSysInfo) {
        var axis = axisModel.axis;
        var rect = coordSysInfo.model.coordinateSystem.getRect();
        var ret = {};
        oldPoint = oldPoint || [0, 0];
        if (axis.orient === "horizontal") {
          ret.pixel = newPoint[0] - oldPoint[0];
          ret.pixelLength = rect.width;
          ret.pixelStart = rect.x;
          ret.signal = axis.inverse ? 1 : -1;
        } else {
          ret.pixel = newPoint[1] - oldPoint[1];
          ret.pixelLength = rect.height;
          ret.pixelStart = rect.y;
          ret.signal = axis.inverse ? -1 : 1;
        }
        return ret;
      }
    };
    function install$8(registers) {
      installCommon$1(registers);
      registers.registerComponentModel(InsideZoomModel);
      registers.registerComponentView(InsideZoomView);
      installDataZoomRoamProcessor(registers);
    }
    var SliderZoomModel = (
      /** @class */
      function(_super) {
        __extends$1(SliderZoomModel2, _super);
        function SliderZoomModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SliderZoomModel2.type;
          return _this;
        }
        SliderZoomModel2.type = "dataZoom.slider";
        SliderZoomModel2.layoutMode = "box";
        SliderZoomModel2.defaultOption = inheritDefaultOption(DataZoomModel.defaultOption, {
          show: true,
          // deault value can only be drived in view stage.
          right: "ph",
          top: "ph",
          width: "ph",
          height: "ph",
          left: null,
          bottom: null,
          borderColor: "#d2dbee",
          borderRadius: 3,
          backgroundColor: "rgba(47,69,84,0)",
          // dataBackgroundColor: '#ddd',
          dataBackground: {
            lineStyle: {
              color: "#d2dbee",
              width: 0.5
            },
            areaStyle: {
              color: "#d2dbee",
              opacity: 0.2
            }
          },
          selectedDataBackground: {
            lineStyle: {
              color: "#8fb0f7",
              width: 0.5
            },
            areaStyle: {
              color: "#8fb0f7",
              opacity: 0.2
            }
          },
          // Color of selected window.
          fillerColor: "rgba(135,175,274,0.2)",
          handleIcon: "path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",
          // Percent of the slider height
          handleSize: "100%",
          handleStyle: {
            color: "#fff",
            borderColor: "#ACB8D1"
          },
          moveHandleSize: 7,
          moveHandleIcon: "path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",
          moveHandleStyle: {
            color: "#D2DBEE",
            opacity: 0.7
          },
          showDetail: true,
          showDataShadow: "auto",
          realtime: true,
          zoomLock: false,
          textStyle: {
            color: "#6E7079"
          },
          brushSelect: true,
          brushStyle: {
            color: "rgba(135,175,274,0.15)"
          },
          emphasis: {
            handleLabel: {
              show: true
            },
            handleStyle: {
              borderColor: "#8FB0F7"
            },
            moveHandleStyle: {
              color: "#8FB0F7"
            }
          }
        });
        return SliderZoomModel2;
      }(DataZoomModel)
    );
    var Rect = Rect$2;
    var DEFAULT_LOCATION_EDGE_GAP = 7;
    var DEFAULT_FRAME_BORDER_WIDTH = 1;
    var DEFAULT_FILLER_SIZE = 30;
    var DEFAULT_MOVE_HANDLE_SIZE = 7;
    var HORIZONTAL = "horizontal";
    var VERTICAL = "vertical";
    var LABEL_GAP = 5;
    var SHOW_DATA_SHADOW_SERIES_TYPE = ["line", "bar", "candlestick", "scatter"];
    var REALTIME_ANIMATION_CONFIG = {
      easing: "cubicOut",
      duration: 100,
      delay: 0
    };
    var SliderZoomView = (
      /** @class */
      function(_super) {
        __extends$1(SliderZoomView2, _super);
        function SliderZoomView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = SliderZoomView2.type;
          _this._displayables = {};
          return _this;
        }
        SliderZoomView2.prototype.init = function(ecModel, api2) {
          this.api = api2;
          this._onBrush = bind$2(this._onBrush, this);
          this._onBrushEnd = bind$2(this._onBrushEnd, this);
        };
        SliderZoomView2.prototype.render = function(dataZoomModel, ecModel, api2, payload) {
          _super.prototype.render.apply(this, arguments);
          createOrUpdate(this, "_dispatchZoomAction", dataZoomModel.get("throttle"), "fixRate");
          this._orient = dataZoomModel.getOrient();
          if (dataZoomModel.get("show") === false) {
            this.group.removeAll();
            return;
          }
          if (dataZoomModel.noTarget()) {
            this._clear();
            this.group.removeAll();
            return;
          }
          if (!payload || payload.type !== "dataZoom" || payload.from !== this.uid) {
            this._buildView();
          }
          this._updateView();
        };
        SliderZoomView2.prototype.dispose = function() {
          this._clear();
          _super.prototype.dispose.apply(this, arguments);
        };
        SliderZoomView2.prototype._clear = function() {
          clear$1(this, "_dispatchZoomAction");
          var zr = this.api.getZr();
          zr.off("mousemove", this._onBrush);
          zr.off("mouseup", this._onBrushEnd);
        };
        SliderZoomView2.prototype._buildView = function() {
          var thisGroup = this.group;
          thisGroup.removeAll();
          this._brushing = false;
          this._displayables.brushRect = null;
          this._resetLocation();
          this._resetInterval();
          var barGroup = this._displayables.sliderGroup = new Group$3();
          this._renderBackground();
          this._renderHandle();
          this._renderDataShadow();
          thisGroup.add(barGroup);
          this._positionGroup();
        };
        SliderZoomView2.prototype._resetLocation = function() {
          var dataZoomModel = this.dataZoomModel;
          var api2 = this.api;
          var showMoveHandle = dataZoomModel.get("brushSelect");
          var moveHandleSize = showMoveHandle ? DEFAULT_MOVE_HANDLE_SIZE : 0;
          var coordRect = this._findCoordRect();
          var ecSize = {
            width: api2.getWidth(),
            height: api2.getHeight()
          };
          var positionInfo = this._orient === HORIZONTAL ? {
            // Why using 'right', because right should be used in vertical,
            // and it is better to be consistent for dealing with position param merge.
            right: ecSize.width - coordRect.x - coordRect.width,
            top: ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP - moveHandleSize,
            width: coordRect.width,
            height: DEFAULT_FILLER_SIZE
          } : {
            right: DEFAULT_LOCATION_EDGE_GAP,
            top: coordRect.y,
            width: DEFAULT_FILLER_SIZE,
            height: coordRect.height
          };
          var layoutParams = getLayoutParams(dataZoomModel.option);
          each$f(["right", "top", "width", "height"], function(name) {
            if (layoutParams[name] === "ph") {
              layoutParams[name] = positionInfo[name];
            }
          });
          var layoutRect = getLayoutRect(layoutParams, ecSize);
          this._location = {
            x: layoutRect.x,
            y: layoutRect.y
          };
          this._size = [layoutRect.width, layoutRect.height];
          this._orient === VERTICAL && this._size.reverse();
        };
        SliderZoomView2.prototype._positionGroup = function() {
          var thisGroup = this.group;
          var location2 = this._location;
          var orient = this._orient;
          var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();
          var inverse = targetAxisModel && targetAxisModel.get("inverse");
          var sliderGroup = this._displayables.sliderGroup;
          var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;
          sliderGroup.attr(orient === HORIZONTAL && !inverse ? {
            scaleY: otherAxisInverse ? 1 : -1,
            scaleX: 1
          } : orient === HORIZONTAL && inverse ? {
            scaleY: otherAxisInverse ? 1 : -1,
            scaleX: -1
          } : orient === VERTICAL && !inverse ? {
            scaleY: otherAxisInverse ? -1 : 1,
            scaleX: 1,
            rotation: Math.PI / 2
          } : {
            scaleY: otherAxisInverse ? -1 : 1,
            scaleX: -1,
            rotation: Math.PI / 2
          });
          var rect = thisGroup.getBoundingRect([sliderGroup]);
          thisGroup.x = location2.x - rect.x;
          thisGroup.y = location2.y - rect.y;
          thisGroup.markRedraw();
        };
        SliderZoomView2.prototype._getViewExtent = function() {
          return [0, this._size[0]];
        };
        SliderZoomView2.prototype._renderBackground = function() {
          var dataZoomModel = this.dataZoomModel;
          var size = this._size;
          var barGroup = this._displayables.sliderGroup;
          var brushSelect = dataZoomModel.get("brushSelect");
          barGroup.add(new Rect({
            silent: true,
            shape: {
              x: 0,
              y: 0,
              width: size[0],
              height: size[1]
            },
            style: {
              fill: dataZoomModel.get("backgroundColor")
            },
            z2: -40
          }));
          var clickPanel = new Rect({
            shape: {
              x: 0,
              y: 0,
              width: size[0],
              height: size[1]
            },
            style: {
              fill: "transparent"
            },
            z2: 0,
            onclick: bind$2(this._onClickPanel, this)
          });
          var zr = this.api.getZr();
          if (brushSelect) {
            clickPanel.on("mousedown", this._onBrushStart, this);
            clickPanel.cursor = "crosshair";
            zr.on("mousemove", this._onBrush);
            zr.on("mouseup", this._onBrushEnd);
          } else {
            zr.off("mousemove", this._onBrush);
            zr.off("mouseup", this._onBrushEnd);
          }
          barGroup.add(clickPanel);
        };
        SliderZoomView2.prototype._renderDataShadow = function() {
          var info = this._dataShadowInfo = this._prepareDataShadowInfo();
          this._displayables.dataShadowSegs = [];
          if (!info) {
            return;
          }
          var size = this._size;
          var oldSize = this._shadowSize || [];
          var seriesModel = info.series;
          var data = seriesModel.getRawData();
          var candlestickDim = seriesModel.getShadowDim && seriesModel.getShadowDim();
          var otherDim = candlestickDim && data.getDimensionInfo(candlestickDim) ? seriesModel.getShadowDim() : info.otherDim;
          if (otherDim == null) {
            return;
          }
          var polygonPts = this._shadowPolygonPts;
          var polylinePts = this._shadowPolylinePts;
          if (data !== this._shadowData || otherDim !== this._shadowDim || size[0] !== oldSize[0] || size[1] !== oldSize[1]) {
            var otherDataExtent_1 = data.getDataExtent(otherDim);
            var otherOffset = (otherDataExtent_1[1] - otherDataExtent_1[0]) * 0.3;
            otherDataExtent_1 = [otherDataExtent_1[0] - otherOffset, otherDataExtent_1[1] + otherOffset];
            var otherShadowExtent_1 = [0, size[1]];
            var thisShadowExtent = [0, size[0]];
            var areaPoints_1 = [[size[0], 0], [0, 0]];
            var linePoints_1 = [];
            var step_1 = thisShadowExtent[1] / (data.count() - 1);
            var thisCoord_1 = 0;
            var stride_1 = Math.round(data.count() / size[0]);
            var lastIsEmpty_1;
            data.each([otherDim], function(value, index) {
              if (stride_1 > 0 && index % stride_1) {
                thisCoord_1 += step_1;
                return;
              }
              var isEmpty2 = value == null || isNaN(value) || value === "";
              var otherCoord = isEmpty2 ? 0 : linearMap$2(value, otherDataExtent_1, otherShadowExtent_1, true);
              if (isEmpty2 && !lastIsEmpty_1 && index) {
                areaPoints_1.push([areaPoints_1[areaPoints_1.length - 1][0], 0]);
                linePoints_1.push([linePoints_1[linePoints_1.length - 1][0], 0]);
              } else if (!isEmpty2 && lastIsEmpty_1) {
                areaPoints_1.push([thisCoord_1, 0]);
                linePoints_1.push([thisCoord_1, 0]);
              }
              areaPoints_1.push([thisCoord_1, otherCoord]);
              linePoints_1.push([thisCoord_1, otherCoord]);
              thisCoord_1 += step_1;
              lastIsEmpty_1 = isEmpty2;
            });
            polygonPts = this._shadowPolygonPts = areaPoints_1;
            polylinePts = this._shadowPolylinePts = linePoints_1;
          }
          this._shadowData = data;
          this._shadowDim = otherDim;
          this._shadowSize = [size[0], size[1]];
          var dataZoomModel = this.dataZoomModel;
          function createDataShadowGroup(isSelectedArea) {
            var model = dataZoomModel.getModel(isSelectedArea ? "selectedDataBackground" : "dataBackground");
            var group2 = new Group$3();
            var polygon = new Polygon({
              shape: {
                points: polygonPts
              },
              segmentIgnoreThreshold: 1,
              style: model.getModel("areaStyle").getAreaStyle(),
              silent: true,
              z2: -20
            });
            var polyline = new Polyline$1({
              shape: {
                points: polylinePts
              },
              segmentIgnoreThreshold: 1,
              style: model.getModel("lineStyle").getLineStyle(),
              silent: true,
              z2: -19
            });
            group2.add(polygon);
            group2.add(polyline);
            return group2;
          }
          for (var i2 = 0; i2 < 3; i2++) {
            var group = createDataShadowGroup(i2 === 1);
            this._displayables.sliderGroup.add(group);
            this._displayables.dataShadowSegs.push(group);
          }
        };
        SliderZoomView2.prototype._prepareDataShadowInfo = function() {
          var dataZoomModel = this.dataZoomModel;
          var showDataShadow = dataZoomModel.get("showDataShadow");
          if (showDataShadow === false) {
            return;
          }
          var result;
          var ecModel = this.ecModel;
          dataZoomModel.eachTargetAxis(function(axisDim, axisIndex) {
            var seriesModels = dataZoomModel.getAxisProxy(axisDim, axisIndex).getTargetSeriesModels();
            each$f(seriesModels, function(seriesModel) {
              if (result) {
                return;
              }
              if (showDataShadow !== true && indexOf(SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get("type")) < 0) {
                return;
              }
              var thisAxis = ecModel.getComponent(getAxisMainType(axisDim), axisIndex).axis;
              var otherDim = getOtherDim(axisDim);
              var otherAxisInverse;
              var coordSys = seriesModel.coordinateSystem;
              if (otherDim != null && coordSys.getOtherAxis) {
                otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse;
              }
              otherDim = seriesModel.getData().mapDimension(otherDim);
              result = {
                thisAxis,
                series: seriesModel,
                thisDim: axisDim,
                otherDim,
                otherAxisInverse
              };
            }, this);
          }, this);
          return result;
        };
        SliderZoomView2.prototype._renderHandle = function() {
          var thisGroup = this.group;
          var displayables = this._displayables;
          var handles = displayables.handles = [null, null];
          var handleLabels = displayables.handleLabels = [null, null];
          var sliderGroup = this._displayables.sliderGroup;
          var size = this._size;
          var dataZoomModel = this.dataZoomModel;
          var api2 = this.api;
          var borderRadius = dataZoomModel.get("borderRadius") || 0;
          var brushSelect = dataZoomModel.get("brushSelect");
          var filler = displayables.filler = new Rect({
            silent: brushSelect,
            style: {
              fill: dataZoomModel.get("fillerColor")
            },
            textConfig: {
              position: "inside"
            }
          });
          sliderGroup.add(filler);
          sliderGroup.add(new Rect({
            silent: true,
            subPixelOptimize: true,
            shape: {
              x: 0,
              y: 0,
              width: size[0],
              height: size[1],
              r: borderRadius
            },
            style: {
              // deprecated option
              stroke: dataZoomModel.get("dataBackgroundColor") || dataZoomModel.get("borderColor"),
              lineWidth: DEFAULT_FRAME_BORDER_WIDTH,
              fill: "rgba(0,0,0,0)"
            }
          }));
          each$f([0, 1], function(handleIndex) {
            var iconStr = dataZoomModel.get("handleIcon");
            if (!symbolBuildProxies[iconStr] && iconStr.indexOf("path://") < 0 && iconStr.indexOf("image://") < 0) {
              iconStr = "path://" + iconStr;
            }
            var path = createSymbol$1(iconStr, -1, 0, 2, 2, null, true);
            path.attr({
              cursor: getCursor$1(this._orient),
              draggable: true,
              drift: bind$2(this._onDragMove, this, handleIndex),
              ondragend: bind$2(this._onDragEnd, this),
              onmouseover: bind$2(this._showDataInfo, this, true),
              onmouseout: bind$2(this._showDataInfo, this, false),
              z2: 5
            });
            var bRect = path.getBoundingRect();
            var handleSize = dataZoomModel.get("handleSize");
            this._handleHeight = parsePercent(handleSize, this._size[1]);
            this._handleWidth = bRect.width / bRect.height * this._handleHeight;
            path.setStyle(dataZoomModel.getModel("handleStyle").getItemStyle());
            path.style.strokeNoScale = true;
            path.rectHover = true;
            path.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
            enableHoverEmphasis(path);
            var handleColor = dataZoomModel.get("handleColor");
            if (handleColor != null) {
              path.style.fill = handleColor;
            }
            sliderGroup.add(handles[handleIndex] = path);
            var textStyleModel = dataZoomModel.getModel("textStyle");
            var handleLabel = dataZoomModel.get("handleLabel") || {};
            var handleLabelShow = handleLabel.show || false;
            thisGroup.add(handleLabels[handleIndex] = new ZRText({
              silent: true,
              invisible: !handleLabelShow,
              style: createTextStyle(textStyleModel, {
                x: 0,
                y: 0,
                text: "",
                verticalAlign: "middle",
                align: "center",
                fill: textStyleModel.getTextColor(),
                font: textStyleModel.getFont()
              }),
              z2: 10
            }));
          }, this);
          var actualMoveZone = filler;
          if (brushSelect) {
            var moveHandleHeight = parsePercent(dataZoomModel.get("moveHandleSize"), size[1]);
            var moveHandle_1 = displayables.moveHandle = new Rect$2({
              style: dataZoomModel.getModel("moveHandleStyle").getItemStyle(),
              silent: true,
              shape: {
                r: [0, 0, 2, 2],
                y: size[1] - 0.5,
                height: moveHandleHeight
              }
            });
            var iconSize = moveHandleHeight * 0.8;
            var moveHandleIcon = displayables.moveHandleIcon = createSymbol$1(dataZoomModel.get("moveHandleIcon"), -iconSize / 2, -iconSize / 2, iconSize, iconSize, "#fff", true);
            moveHandleIcon.silent = true;
            moveHandleIcon.y = size[1] + moveHandleHeight / 2 - 0.5;
            moveHandle_1.ensureState("emphasis").style = dataZoomModel.getModel(["emphasis", "moveHandleStyle"]).getItemStyle();
            var moveZoneExpandSize = Math.min(size[1] / 2, Math.max(moveHandleHeight, 10));
            actualMoveZone = displayables.moveZone = new Rect$2({
              invisible: true,
              shape: {
                y: size[1] - moveZoneExpandSize,
                height: moveHandleHeight + moveZoneExpandSize
              }
            });
            actualMoveZone.on("mouseover", function() {
              api2.enterEmphasis(moveHandle_1);
            }).on("mouseout", function() {
              api2.leaveEmphasis(moveHandle_1);
            });
            sliderGroup.add(moveHandle_1);
            sliderGroup.add(moveHandleIcon);
            sliderGroup.add(actualMoveZone);
          }
          actualMoveZone.attr({
            draggable: true,
            cursor: getCursor$1(this._orient),
            drift: bind$2(this._onDragMove, this, "all"),
            ondragstart: bind$2(this._showDataInfo, this, true),
            ondragend: bind$2(this._onDragEnd, this),
            onmouseover: bind$2(this._showDataInfo, this, true),
            onmouseout: bind$2(this._showDataInfo, this, false)
          });
        };
        SliderZoomView2.prototype._resetInterval = function() {
          var range2 = this._range = this.dataZoomModel.getPercentRange();
          var viewExtent = this._getViewExtent();
          this._handleEnds = [linearMap$2(range2[0], [0, 100], viewExtent, true), linearMap$2(range2[1], [0, 100], viewExtent, true)];
        };
        SliderZoomView2.prototype._updateInterval = function(handleIndex, delta) {
          var dataZoomModel = this.dataZoomModel;
          var handleEnds = this._handleEnds;
          var viewExtend = this._getViewExtent();
          var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
          var percentExtent = [0, 100];
          sliderMove(delta, handleEnds, viewExtend, dataZoomModel.get("zoomLock") ? "all" : handleIndex, minMaxSpan.minSpan != null ? linearMap$2(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, minMaxSpan.maxSpan != null ? linearMap$2(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null);
          var lastRange = this._range;
          var range2 = this._range = asc$2([linearMap$2(handleEnds[0], viewExtend, percentExtent, true), linearMap$2(handleEnds[1], viewExtend, percentExtent, true)]);
          return !lastRange || lastRange[0] !== range2[0] || lastRange[1] !== range2[1];
        };
        SliderZoomView2.prototype._updateView = function(nonRealtime) {
          var displaybles = this._displayables;
          var handleEnds = this._handleEnds;
          var handleInterval = asc$2(handleEnds.slice());
          var size = this._size;
          each$f([0, 1], function(handleIndex) {
            var handle = displaybles.handles[handleIndex];
            var handleHeight = this._handleHeight;
            handle.attr({
              scaleX: handleHeight / 2,
              scaleY: handleHeight / 2,
              // This is a trick, by adding an extra tiny offset to let the default handle's end point align to the drag window.
              // NOTE: It may affect some custom shapes a bit. But we prefer to have better result by default.
              x: handleEnds[handleIndex] + (handleIndex ? -1 : 1),
              y: size[1] / 2 - handleHeight / 2
            });
          }, this);
          displaybles.filler.setShape({
            x: handleInterval[0],
            y: 0,
            width: handleInterval[1] - handleInterval[0],
            height: size[1]
          });
          var viewExtent = {
            x: handleInterval[0],
            width: handleInterval[1] - handleInterval[0]
          };
          if (displaybles.moveHandle) {
            displaybles.moveHandle.setShape(viewExtent);
            displaybles.moveZone.setShape(viewExtent);
            displaybles.moveZone.getBoundingRect();
            displaybles.moveHandleIcon && displaybles.moveHandleIcon.attr("x", viewExtent.x + viewExtent.width / 2);
          }
          var dataShadowSegs = displaybles.dataShadowSegs;
          var segIntervals = [0, handleInterval[0], handleInterval[1], size[0]];
          for (var i2 = 0; i2 < dataShadowSegs.length; i2++) {
            var segGroup = dataShadowSegs[i2];
            var clipPath = segGroup.getClipPath();
            if (!clipPath) {
              clipPath = new Rect$2();
              segGroup.setClipPath(clipPath);
            }
            clipPath.setShape({
              x: segIntervals[i2],
              y: 0,
              width: segIntervals[i2 + 1] - segIntervals[i2],
              height: size[1]
            });
          }
          this._updateDataInfo(nonRealtime);
        };
        SliderZoomView2.prototype._updateDataInfo = function(nonRealtime) {
          var dataZoomModel = this.dataZoomModel;
          var displaybles = this._displayables;
          var handleLabels = displaybles.handleLabels;
          var orient = this._orient;
          var labelTexts = ["", ""];
          if (dataZoomModel.get("showDetail")) {
            var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
            if (axisProxy) {
              var axis = axisProxy.getAxisModel().axis;
              var range2 = this._range;
              var dataInterval = nonRealtime ? axisProxy.calculateDataWindow({
                start: range2[0],
                end: range2[1]
              }).valueWindow : axisProxy.getDataValueWindow();
              labelTexts = [this._formatLabel(dataInterval[0], axis), this._formatLabel(dataInterval[1], axis)];
            }
          }
          var orderedHandleEnds = asc$2(this._handleEnds.slice());
          setLabel.call(this, 0);
          setLabel.call(this, 1);
          function setLabel(handleIndex) {
            var barTransform = getTransform$1(displaybles.handles[handleIndex].parent, this.group);
            var direction2 = transformDirection(handleIndex === 0 ? "right" : "left", barTransform);
            var offset2 = this._handleWidth / 2 + LABEL_GAP;
            var textPoint = applyTransform([orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset2 : offset2), this._size[1] / 2], barTransform);
            handleLabels[handleIndex].setStyle({
              x: textPoint[0],
              y: textPoint[1],
              verticalAlign: orient === HORIZONTAL ? "middle" : direction2,
              align: orient === HORIZONTAL ? direction2 : "center",
              text: labelTexts[handleIndex]
            });
          }
        };
        SliderZoomView2.prototype._formatLabel = function(value, axis) {
          var dataZoomModel = this.dataZoomModel;
          var labelFormatter = dataZoomModel.get("labelFormatter");
          var labelPrecision = dataZoomModel.get("labelPrecision");
          if (labelPrecision == null || labelPrecision === "auto") {
            labelPrecision = axis.getPixelPrecision();
          }
          var valueStr = value == null || isNaN(value) ? "" : axis.type === "category" || axis.type === "time" ? axis.scale.getLabel({
            value: Math.round(value)
          }) : value.toFixed(Math.min(labelPrecision, 20));
          return isFunction$1(labelFormatter) ? labelFormatter(value, valueStr) : isString$1(labelFormatter) ? labelFormatter.replace("{value}", valueStr) : valueStr;
        };
        SliderZoomView2.prototype._showDataInfo = function(isEmphasis) {
          var handleLabel = this.dataZoomModel.get("handleLabel") || {};
          var normalShow = handleLabel.show || false;
          var emphasisHandleLabel = this.dataZoomModel.getModel(["emphasis", "handleLabel"]);
          var emphasisShow = emphasisHandleLabel.get("show") || false;
          var toShow = isEmphasis || this._dragging ? emphasisShow : normalShow;
          var displayables = this._displayables;
          var handleLabels = displayables.handleLabels;
          handleLabels[0].attr("invisible", !toShow);
          handleLabels[1].attr("invisible", !toShow);
          displayables.moveHandle && this.api[toShow ? "enterEmphasis" : "leaveEmphasis"](displayables.moveHandle, 1);
        };
        SliderZoomView2.prototype._onDragMove = function(handleIndex, dx, dy, event) {
          this._dragging = true;
          stop(event.event);
          var barTransform = this._displayables.sliderGroup.getLocalTransform();
          var vertex = applyTransform([dx, dy], barTransform, true);
          var changed = this._updateInterval(handleIndex, vertex[0]);
          var realtime = this.dataZoomModel.get("realtime");
          this._updateView(!realtime);
          changed && realtime && this._dispatchZoomAction(true);
        };
        SliderZoomView2.prototype._onDragEnd = function() {
          this._dragging = false;
          this._showDataInfo(false);
          var realtime = this.dataZoomModel.get("realtime");
          !realtime && this._dispatchZoomAction(false);
        };
        SliderZoomView2.prototype._onClickPanel = function(e2) {
          var size = this._size;
          var localPoint = this._displayables.sliderGroup.transformCoordToLocal(e2.offsetX, e2.offsetY);
          if (localPoint[0] < 0 || localPoint[0] > size[0] || localPoint[1] < 0 || localPoint[1] > size[1]) {
            return;
          }
          var handleEnds = this._handleEnds;
          var center2 = (handleEnds[0] + handleEnds[1]) / 2;
          var changed = this._updateInterval("all", localPoint[0] - center2);
          this._updateView();
          changed && this._dispatchZoomAction(false);
        };
        SliderZoomView2.prototype._onBrushStart = function(e2) {
          var x2 = e2.offsetX;
          var y = e2.offsetY;
          this._brushStart = new Point(x2, y);
          this._brushing = true;
          this._brushStartTime = +/* @__PURE__ */ new Date();
        };
        SliderZoomView2.prototype._onBrushEnd = function(e2) {
          if (!this._brushing) {
            return;
          }
          var brushRect = this._displayables.brushRect;
          this._brushing = false;
          if (!brushRect) {
            return;
          }
          brushRect.attr("ignore", true);
          var brushShape = brushRect.shape;
          var brushEndTime = +/* @__PURE__ */ new Date();
          if (brushEndTime - this._brushStartTime < 200 && Math.abs(brushShape.width) < 5) {
            return;
          }
          var viewExtend = this._getViewExtent();
          var percentExtent = [0, 100];
          this._range = asc$2([linearMap$2(brushShape.x, viewExtend, percentExtent, true), linearMap$2(brushShape.x + brushShape.width, viewExtend, percentExtent, true)]);
          this._handleEnds = [brushShape.x, brushShape.x + brushShape.width];
          this._updateView();
          this._dispatchZoomAction(false);
        };
        SliderZoomView2.prototype._onBrush = function(e2) {
          if (this._brushing) {
            stop(e2.event);
            this._updateBrushRect(e2.offsetX, e2.offsetY);
          }
        };
        SliderZoomView2.prototype._updateBrushRect = function(mouseX, mouseY) {
          var displayables = this._displayables;
          var dataZoomModel = this.dataZoomModel;
          var brushRect = displayables.brushRect;
          if (!brushRect) {
            brushRect = displayables.brushRect = new Rect({
              silent: true,
              style: dataZoomModel.getModel("brushStyle").getItemStyle()
            });
            displayables.sliderGroup.add(brushRect);
          }
          brushRect.attr("ignore", false);
          var brushStart = this._brushStart;
          var sliderGroup = this._displayables.sliderGroup;
          var endPoint = sliderGroup.transformCoordToLocal(mouseX, mouseY);
          var startPoint = sliderGroup.transformCoordToLocal(brushStart.x, brushStart.y);
          var size = this._size;
          endPoint[0] = Math.max(Math.min(size[0], endPoint[0]), 0);
          brushRect.setShape({
            x: startPoint[0],
            y: 0,
            width: endPoint[0] - startPoint[0],
            height: size[1]
          });
        };
        SliderZoomView2.prototype._dispatchZoomAction = function(realtime) {
          var range2 = this._range;
          this.api.dispatchAction({
            type: "dataZoom",
            from: this.uid,
            dataZoomId: this.dataZoomModel.id,
            animation: realtime ? REALTIME_ANIMATION_CONFIG : null,
            start: range2[0],
            end: range2[1]
          });
        };
        SliderZoomView2.prototype._findCoordRect = function() {
          var rect;
          var coordSysInfoList = collectReferCoordSysModelInfo(this.dataZoomModel).infoList;
          if (!rect && coordSysInfoList.length) {
            var coordSys = coordSysInfoList[0].model.coordinateSystem;
            rect = coordSys.getRect && coordSys.getRect();
          }
          if (!rect) {
            var width = this.api.getWidth();
            var height = this.api.getHeight();
            rect = {
              x: width * 0.2,
              y: height * 0.2,
              width: width * 0.6,
              height: height * 0.6
            };
          }
          return rect;
        };
        SliderZoomView2.type = "dataZoom.slider";
        return SliderZoomView2;
      }(DataZoomView)
    );
    function getOtherDim(thisDim) {
      var map2 = {
        x: "y",
        y: "x",
        radius: "angle",
        angle: "radius"
      };
      return map2[thisDim];
    }
    function getCursor$1(orient) {
      return orient === "vertical" ? "ns-resize" : "ew-resize";
    }
    function install$7(registers) {
      registers.registerComponentModel(SliderZoomModel);
      registers.registerComponentView(SliderZoomView);
      installCommon$1(registers);
    }
    function install$6(registers) {
      use(install$8);
      use(install$7);
    }
    var visualDefault = {
      /**
       * @public
       */
      get: function(visualType, key, isCategory2) {
        var value = clone$4((defaultOption[visualType] || {})[key]);
        return isCategory2 ? isArray$2(value) ? value[value.length - 1] : value : value;
      }
    };
    var defaultOption = {
      color: {
        active: ["#006edd", "#e0ffff"],
        inactive: ["rgba(0,0,0,0)"]
      },
      colorHue: {
        active: [0, 360],
        inactive: [0, 0]
      },
      colorSaturation: {
        active: [0.3, 1],
        inactive: [0, 0]
      },
      colorLightness: {
        active: [0.9, 0.5],
        inactive: [0, 0]
      },
      colorAlpha: {
        active: [0.3, 1],
        inactive: [0, 0]
      },
      opacity: {
        active: [0.3, 1],
        inactive: [0, 0]
      },
      symbol: {
        active: ["circle", "roundRect", "diamond"],
        inactive: ["none"]
      },
      symbolSize: {
        active: [10, 50],
        inactive: [0, 0]
      }
    };
    var mapVisual = VisualMapping.mapVisual;
    var eachVisual = VisualMapping.eachVisual;
    var isArray$1 = isArray$2;
    var each$2 = each$f;
    var asc = asc$2;
    var linearMap$1 = linearMap$2;
    var VisualMapModel = (
      /** @class */
      function(_super) {
        __extends$1(VisualMapModel2, _super);
        function VisualMapModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = VisualMapModel2.type;
          _this.stateList = ["inRange", "outOfRange"];
          _this.replacableOptionKeys = ["inRange", "outOfRange", "target", "controller", "color"];
          _this.layoutMode = {
            type: "box",
            ignoreSize: true
          };
          _this.dataBound = [-Infinity, Infinity];
          _this.targetVisuals = {};
          _this.controllerVisuals = {};
          return _this;
        }
        VisualMapModel2.prototype.init = function(option, parentModel, ecModel) {
          this.mergeDefaultAndTheme(option, ecModel);
        };
        VisualMapModel2.prototype.optionUpdated = function(newOption, isInit) {
          var thisOption = this.option;
          !isInit && replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);
          this.textStyleModel = this.getModel("textStyle");
          this.resetItemSize();
          this.completeVisualOption();
        };
        VisualMapModel2.prototype.resetVisual = function(supplementVisualOption) {
          var stateList = this.stateList;
          supplementVisualOption = bind$2(supplementVisualOption, this);
          this.controllerVisuals = createVisualMappings(this.option.controller, stateList, supplementVisualOption);
          this.targetVisuals = createVisualMappings(this.option.target, stateList, supplementVisualOption);
        };
        VisualMapModel2.prototype.getItemSymbol = function() {
          return null;
        };
        VisualMapModel2.prototype.getTargetSeriesIndices = function() {
          var optionSeriesIndex = this.option.seriesIndex;
          var seriesIndices = [];
          if (optionSeriesIndex == null || optionSeriesIndex === "all") {
            this.ecModel.eachSeries(function(seriesModel, index) {
              seriesIndices.push(index);
            });
          } else {
            seriesIndices = normalizeToArray(optionSeriesIndex);
          }
          return seriesIndices;
        };
        VisualMapModel2.prototype.eachTargetSeries = function(callback, context) {
          each$f(this.getTargetSeriesIndices(), function(seriesIndex) {
            var seriesModel = this.ecModel.getSeriesByIndex(seriesIndex);
            if (seriesModel) {
              callback.call(context, seriesModel);
            }
          }, this);
        };
        VisualMapModel2.prototype.isTargetSeries = function(seriesModel) {
          var is = false;
          this.eachTargetSeries(function(model) {
            model === seriesModel && (is = true);
          });
          return is;
        };
        VisualMapModel2.prototype.formatValueText = function(value, isCategory2, edgeSymbols) {
          var option = this.option;
          var precision = option.precision;
          var dataBound = this.dataBound;
          var formatter2 = option.formatter;
          var isMinMax;
          edgeSymbols = edgeSymbols || ["<", ">"];
          if (isArray$2(value)) {
            value = value.slice();
            isMinMax = true;
          }
          var textValue = isCategory2 ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);
          if (isString$1(formatter2)) {
            return formatter2.replace("{value}", isMinMax ? textValue[0] : textValue).replace("{value2}", isMinMax ? textValue[1] : textValue);
          } else if (isFunction$1(formatter2)) {
            return isMinMax ? formatter2(value[0], value[1]) : formatter2(value);
          }
          if (isMinMax) {
            if (value[0] === dataBound[0]) {
              return edgeSymbols[0] + " " + textValue[1];
            } else if (value[1] === dataBound[1]) {
              return edgeSymbols[1] + " " + textValue[0];
            } else {
              return textValue[0] + " - " + textValue[1];
            }
          } else {
            return textValue;
          }
          function toFixed(val) {
            return val === dataBound[0] ? "min" : val === dataBound[1] ? "max" : (+val).toFixed(Math.min(precision, 20));
          }
        };
        VisualMapModel2.prototype.resetExtent = function() {
          var thisOption = this.option;
          var extent3 = asc([thisOption.min, thisOption.max]);
          this._dataExtent = extent3;
        };
        VisualMapModel2.prototype.getDataDimensionIndex = function(data) {
          var optDim = this.option.dimension;
          if (optDim != null) {
            return data.getDimensionIndex(optDim);
          }
          var dimNames = data.dimensions;
          for (var i2 = dimNames.length - 1; i2 >= 0; i2--) {
            var dimName = dimNames[i2];
            var dimInfo = data.getDimensionInfo(dimName);
            if (!dimInfo.isCalculationCoord) {
              return dimInfo.storeDimIndex;
            }
          }
        };
        VisualMapModel2.prototype.getExtent = function() {
          return this._dataExtent.slice();
        };
        VisualMapModel2.prototype.completeVisualOption = function() {
          var ecModel = this.ecModel;
          var thisOption = this.option;
          var base2 = {
            inRange: thisOption.inRange,
            outOfRange: thisOption.outOfRange
          };
          var target = thisOption.target || (thisOption.target = {});
          var controller = thisOption.controller || (thisOption.controller = {});
          merge$1(target, base2);
          merge$1(controller, base2);
          var isCategory2 = this.isCategory();
          completeSingle.call(this, target);
          completeSingle.call(this, controller);
          completeInactive.call(this, target, "inRange", "outOfRange");
          completeController.call(this, controller);
          function completeSingle(base3) {
            if (isArray$1(thisOption.color) && !base3.inRange) {
              base3.inRange = {
                color: thisOption.color.slice().reverse()
              };
            }
            base3.inRange = base3.inRange || {
              color: ecModel.get("gradientColor")
            };
          }
          function completeInactive(base3, stateExist, stateAbsent) {
            var optExist = base3[stateExist];
            var optAbsent = base3[stateAbsent];
            if (optExist && !optAbsent) {
              optAbsent = base3[stateAbsent] = {};
              each$2(optExist, function(visualData, visualType) {
                if (!VisualMapping.isValidType(visualType)) {
                  return;
                }
                var defa = visualDefault.get(visualType, "inactive", isCategory2);
                if (defa != null) {
                  optAbsent[visualType] = defa;
                  if (visualType === "color" && !optAbsent.hasOwnProperty("opacity") && !optAbsent.hasOwnProperty("colorAlpha")) {
                    optAbsent.opacity = [0, 0];
                  }
                }
              });
            }
          }
          function completeController(controller2) {
            var symbolExists = (controller2.inRange || {}).symbol || (controller2.outOfRange || {}).symbol;
            var symbolSizeExists = (controller2.inRange || {}).symbolSize || (controller2.outOfRange || {}).symbolSize;
            var inactiveColor = this.get("inactiveColor");
            var itemSymbol = this.getItemSymbol();
            var defaultSymbol = itemSymbol || "roundRect";
            each$2(this.stateList, function(state) {
              var itemSize2 = this.itemSize;
              var visuals = controller2[state];
              if (!visuals) {
                visuals = controller2[state] = {
                  color: isCategory2 ? inactiveColor : [inactiveColor]
                };
              }
              if (visuals.symbol == null) {
                visuals.symbol = symbolExists && clone$4(symbolExists) || (isCategory2 ? defaultSymbol : [defaultSymbol]);
              }
              if (visuals.symbolSize == null) {
                visuals.symbolSize = symbolSizeExists && clone$4(symbolSizeExists) || (isCategory2 ? itemSize2[0] : [itemSize2[0], itemSize2[0]]);
              }
              visuals.symbol = mapVisual(visuals.symbol, function(symbol) {
                return symbol === "none" ? defaultSymbol : symbol;
              });
              var symbolSize = visuals.symbolSize;
              if (symbolSize != null) {
                var max_1 = -Infinity;
                eachVisual(symbolSize, function(value) {
                  value > max_1 && (max_1 = value);
                });
                visuals.symbolSize = mapVisual(symbolSize, function(value) {
                  return linearMap$1(value, [0, max_1], [0, itemSize2[0]], true);
                });
              }
            }, this);
          }
        };
        VisualMapModel2.prototype.resetItemSize = function() {
          this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))];
        };
        VisualMapModel2.prototype.isCategory = function() {
          return !!this.option.categories;
        };
        VisualMapModel2.prototype.setSelected = function(selected) {
        };
        VisualMapModel2.prototype.getSelected = function() {
          return null;
        };
        VisualMapModel2.prototype.getValueState = function(value) {
          return null;
        };
        VisualMapModel2.prototype.getVisualMeta = function(getColorVisual2) {
          return null;
        };
        VisualMapModel2.type = "visualMap";
        VisualMapModel2.dependencies = ["series"];
        VisualMapModel2.defaultOption = {
          show: true,
          // zlevel: 0,
          z: 4,
          seriesIndex: "all",
          min: 0,
          max: 200,
          left: 0,
          right: null,
          top: null,
          bottom: 0,
          itemWidth: null,
          itemHeight: null,
          inverse: false,
          orient: "vertical",
          backgroundColor: "rgba(0,0,0,0)",
          borderColor: "#ccc",
          contentColor: "#5793f3",
          inactiveColor: "#aaa",
          borderWidth: 0,
          padding: 5,
          // 接受数组分别设定上右下左边距，同css
          textGap: 10,
          precision: 0,
          textStyle: {
            color: "#333"
            // 值域文字颜色
          }
        };
        return VisualMapModel2;
      }(ComponentModel)
    );
    var DEFAULT_BAR_BOUND = [20, 140];
    var ContinuousModel = (
      /** @class */
      function(_super) {
        __extends$1(ContinuousModel2, _super);
        function ContinuousModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ContinuousModel2.type;
          return _this;
        }
        ContinuousModel2.prototype.optionUpdated = function(newOption, isInit) {
          _super.prototype.optionUpdated.apply(this, arguments);
          this.resetExtent();
          this.resetVisual(function(mappingOption) {
            mappingOption.mappingMethod = "linear";
            mappingOption.dataExtent = this.getExtent();
          });
          this._resetRange();
        };
        ContinuousModel2.prototype.resetItemSize = function() {
          _super.prototype.resetItemSize.apply(this, arguments);
          var itemSize2 = this.itemSize;
          (itemSize2[0] == null || isNaN(itemSize2[0])) && (itemSize2[0] = DEFAULT_BAR_BOUND[0]);
          (itemSize2[1] == null || isNaN(itemSize2[1])) && (itemSize2[1] = DEFAULT_BAR_BOUND[1]);
        };
        ContinuousModel2.prototype._resetRange = function() {
          var dataExtent = this.getExtent();
          var range2 = this.option.range;
          if (!range2 || range2.auto) {
            dataExtent.auto = 1;
            this.option.range = dataExtent;
          } else if (isArray$2(range2)) {
            if (range2[0] > range2[1]) {
              range2.reverse();
            }
            range2[0] = Math.max(range2[0], dataExtent[0]);
            range2[1] = Math.min(range2[1], dataExtent[1]);
          }
        };
        ContinuousModel2.prototype.completeVisualOption = function() {
          _super.prototype.completeVisualOption.apply(this, arguments);
          each$f(this.stateList, function(state) {
            var symbolSize = this.option.controller[state].symbolSize;
            if (symbolSize && symbolSize[0] !== symbolSize[1]) {
              symbolSize[0] = symbolSize[1] / 3;
            }
          }, this);
        };
        ContinuousModel2.prototype.setSelected = function(selected) {
          this.option.range = selected.slice();
          this._resetRange();
        };
        ContinuousModel2.prototype.getSelected = function() {
          var dataExtent = this.getExtent();
          var dataInterval = asc$2((this.get("range") || []).slice());
          dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);
          dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);
          dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);
          dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);
          return dataInterval;
        };
        ContinuousModel2.prototype.getValueState = function(value) {
          var range2 = this.option.range;
          var dataExtent = this.getExtent();
          return (range2[0] <= dataExtent[0] || range2[0] <= value) && (range2[1] >= dataExtent[1] || value <= range2[1]) ? "inRange" : "outOfRange";
        };
        ContinuousModel2.prototype.findTargetDataIndices = function(range2) {
          var result = [];
          this.eachTargetSeries(function(seriesModel) {
            var dataIndices = [];
            var data = seriesModel.getData();
            data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
              range2[0] <= value && value <= range2[1] && dataIndices.push(dataIndex);
            }, this);
            result.push({
              seriesId: seriesModel.id,
              dataIndex: dataIndices
            });
          }, this);
          return result;
        };
        ContinuousModel2.prototype.getVisualMeta = function(getColorVisual2) {
          var oVals = getColorStopValues(this, "outOfRange", this.getExtent());
          var iVals = getColorStopValues(this, "inRange", this.option.range.slice());
          var stops = [];
          function setStop(value, valueState) {
            stops.push({
              value,
              color: getColorVisual2(value, valueState)
            });
          }
          var iIdx = 0;
          var oIdx = 0;
          var iLen = iVals.length;
          var oLen = oVals.length;
          for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) {
            if (oVals[oIdx] < iVals[iIdx]) {
              setStop(oVals[oIdx], "outOfRange");
            }
          }
          for (var first = 1; iIdx < iLen; iIdx++, first = 0) {
            first && stops.length && setStop(iVals[iIdx], "outOfRange");
            setStop(iVals[iIdx], "inRange");
          }
          for (var first = 1; oIdx < oLen; oIdx++) {
            if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) {
              if (first) {
                stops.length && setStop(stops[stops.length - 1].value, "outOfRange");
                first = 0;
              }
              setStop(oVals[oIdx], "outOfRange");
            }
          }
          var stopsLen = stops.length;
          return {
            stops,
            outerColors: [stopsLen ? stops[0].color : "transparent", stopsLen ? stops[stopsLen - 1].color : "transparent"]
          };
        };
        ContinuousModel2.type = "visualMap.continuous";
        ContinuousModel2.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {
          align: "auto",
          calculable: false,
          hoverLink: true,
          realtime: true,
          handleIcon: "path://M-11.39,9.77h0a3.5,3.5,0,0,1-3.5,3.5h-22a3.5,3.5,0,0,1-3.5-3.5h0a3.5,3.5,0,0,1,3.5-3.5h22A3.5,3.5,0,0,1-11.39,9.77Z",
          handleSize: "120%",
          handleStyle: {
            borderColor: "#fff",
            borderWidth: 1
          },
          indicatorIcon: "circle",
          indicatorSize: "50%",
          indicatorStyle: {
            borderColor: "#fff",
            borderWidth: 2,
            shadowBlur: 2,
            shadowOffsetX: 1,
            shadowOffsetY: 1,
            shadowColor: "rgba(0,0,0,0.2)"
          }
          // emphasis: {
          //     handleStyle: {
          //         shadowBlur: 3,
          //         shadowOffsetX: 1,
          //         shadowOffsetY: 1,
          //         shadowColor: 'rgba(0,0,0,0.2)'
          //     }
          // }
        });
        return ContinuousModel2;
      }(VisualMapModel)
    );
    function getColorStopValues(visualMapModel, valueState, dataExtent) {
      if (dataExtent[0] === dataExtent[1]) {
        return dataExtent.slice();
      }
      var count2 = 200;
      var step = (dataExtent[1] - dataExtent[0]) / count2;
      var value = dataExtent[0];
      var stopValues = [];
      for (var i2 = 0; i2 <= count2 && value < dataExtent[1]; i2++) {
        stopValues.push(value);
        value += step;
      }
      stopValues.push(dataExtent[1]);
      return stopValues;
    }
    var VisualMapView = (
      /** @class */
      function(_super) {
        __extends$1(VisualMapView2, _super);
        function VisualMapView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = VisualMapView2.type;
          _this.autoPositionValues = {
            left: 1,
            right: 1,
            top: 1,
            bottom: 1
          };
          return _this;
        }
        VisualMapView2.prototype.init = function(ecModel, api2) {
          this.ecModel = ecModel;
          this.api = api2;
        };
        VisualMapView2.prototype.render = function(visualMapModel, ecModel, api2, payload) {
          this.visualMapModel = visualMapModel;
          if (visualMapModel.get("show") === false) {
            this.group.removeAll();
            return;
          }
          this.doRender(visualMapModel, ecModel, api2, payload);
        };
        VisualMapView2.prototype.renderBackground = function(group) {
          var visualMapModel = this.visualMapModel;
          var padding = normalizeCssArray(visualMapModel.get("padding") || 0);
          var rect = group.getBoundingRect();
          group.add(new Rect$2({
            z2: -1,
            silent: true,
            shape: {
              x: rect.x - padding[3],
              y: rect.y - padding[0],
              width: rect.width + padding[3] + padding[1],
              height: rect.height + padding[0] + padding[2]
            },
            style: {
              fill: visualMapModel.get("backgroundColor"),
              stroke: visualMapModel.get("borderColor"),
              lineWidth: visualMapModel.get("borderWidth")
            }
          }));
        };
        VisualMapView2.prototype.getControllerVisual = function(targetValue, visualCluster, opts) {
          opts = opts || {};
          var forceState = opts.forceState;
          var visualMapModel = this.visualMapModel;
          var visualObj = {};
          if (visualCluster === "color") {
            var defaultColor = visualMapModel.get("contentColor");
            visualObj.color = defaultColor;
          }
          function getter(key) {
            return visualObj[key];
          }
          function setter(key, value) {
            visualObj[key] = value;
          }
          var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];
          var visualTypes = VisualMapping.prepareVisualTypes(mappings);
          each$f(visualTypes, function(type) {
            var visualMapping = mappings[type];
            if (opts.convertOpacityToAlpha && type === "opacity") {
              type = "colorAlpha";
              visualMapping = mappings.__alphaForOpacity;
            }
            if (VisualMapping.dependsOn(type, visualCluster)) {
              visualMapping && visualMapping.applyVisual(targetValue, getter, setter);
            }
          });
          return visualObj[visualCluster];
        };
        VisualMapView2.prototype.positionGroup = function(group) {
          var model = this.visualMapModel;
          var api2 = this.api;
          positionElement(group, model.getBoxLayoutParams(), {
            width: api2.getWidth(),
            height: api2.getHeight()
          });
        };
        VisualMapView2.prototype.doRender = function(visualMapModel, ecModel, api2, payload) {
        };
        VisualMapView2.type = "visualMap";
        return VisualMapView2;
      }(ComponentView)
    );
    var paramsSet = [["left", "right", "width"], ["top", "bottom", "height"]];
    function getItemAlign(visualMapModel, api2, itemSize2) {
      var modelOption = visualMapModel.option;
      var itemAlign = modelOption.align;
      if (itemAlign != null && itemAlign !== "auto") {
        return itemAlign;
      }
      var ecSize = {
        width: api2.getWidth(),
        height: api2.getHeight()
      };
      var realIndex = modelOption.orient === "horizontal" ? 1 : 0;
      var reals = paramsSet[realIndex];
      var fakeValue = [0, null, 10];
      var layoutInput = {};
      for (var i2 = 0; i2 < 3; i2++) {
        layoutInput[paramsSet[1 - realIndex][i2]] = fakeValue[i2];
        layoutInput[reals[i2]] = i2 === 2 ? itemSize2[0] : modelOption[reals[i2]];
      }
      var rParam = [["x", "width", 3], ["y", "height", 0]][realIndex];
      var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);
      return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];
    }
    function makeHighDownBatch(batch2, visualMapModel) {
      each$f(batch2 || [], function(batchItem) {
        if (batchItem.dataIndex != null) {
          batchItem.dataIndexInside = batchItem.dataIndex;
          batchItem.dataIndex = null;
        }
        batchItem.highlightKey = "visualMap" + (visualMapModel ? visualMapModel.componentIndex : "");
      });
      return batch2;
    }
    var linearMap = linearMap$2;
    var each$1 = each$f;
    var mathMin = Math.min;
    var mathMax = Math.max;
    var HOVER_LINK_SIZE = 12;
    var HOVER_LINK_OUT = 6;
    var ContinuousView = (
      /** @class */
      function(_super) {
        __extends$1(ContinuousView2, _super);
        function ContinuousView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = ContinuousView2.type;
          _this._shapes = {};
          _this._dataInterval = [];
          _this._handleEnds = [];
          _this._hoverLinkDataIndices = [];
          return _this;
        }
        ContinuousView2.prototype.init = function(ecModel, api2) {
          _super.prototype.init.call(this, ecModel, api2);
          this._hoverLinkFromSeriesMouseOver = bind$2(this._hoverLinkFromSeriesMouseOver, this);
          this._hideIndicator = bind$2(this._hideIndicator, this);
        };
        ContinuousView2.prototype.doRender = function(visualMapModel, ecModel, api2, payload) {
          if (!payload || payload.type !== "selectDataRange" || payload.from !== this.uid) {
            this._buildView();
          }
        };
        ContinuousView2.prototype._buildView = function() {
          this.group.removeAll();
          var visualMapModel = this.visualMapModel;
          var thisGroup = this.group;
          this._orient = visualMapModel.get("orient");
          this._useHandle = visualMapModel.get("calculable");
          this._resetInterval();
          this._renderBar(thisGroup);
          var dataRangeText = visualMapModel.get("text");
          this._renderEndsText(thisGroup, dataRangeText, 0);
          this._renderEndsText(thisGroup, dataRangeText, 1);
          this._updateView(true);
          this.renderBackground(thisGroup);
          this._updateView();
          this._enableHoverLinkToSeries();
          this._enableHoverLinkFromSeries();
          this.positionGroup(thisGroup);
        };
        ContinuousView2.prototype._renderEndsText = function(group, dataRangeText, endsIndex) {
          if (!dataRangeText) {
            return;
          }
          var text = dataRangeText[1 - endsIndex];
          text = text != null ? text + "" : "";
          var visualMapModel = this.visualMapModel;
          var textGap = visualMapModel.get("textGap");
          var itemSize2 = visualMapModel.itemSize;
          var barGroup = this._shapes.mainGroup;
          var position2 = this._applyTransform([itemSize2[0] / 2, endsIndex === 0 ? -textGap : itemSize2[1] + textGap], barGroup);
          var align = this._applyTransform(endsIndex === 0 ? "bottom" : "top", barGroup);
          var orient = this._orient;
          var textStyleModel = this.visualMapModel.textStyleModel;
          this.group.add(new ZRText({
            style: createTextStyle(textStyleModel, {
              x: position2[0],
              y: position2[1],
              verticalAlign: orient === "horizontal" ? "middle" : align,
              align: orient === "horizontal" ? align : "center",
              text
            })
          }));
        };
        ContinuousView2.prototype._renderBar = function(targetGroup) {
          var visualMapModel = this.visualMapModel;
          var shapes = this._shapes;
          var itemSize2 = visualMapModel.itemSize;
          var orient = this._orient;
          var useHandle = this._useHandle;
          var itemAlign = getItemAlign(visualMapModel, this.api, itemSize2);
          var mainGroup = shapes.mainGroup = this._createBarGroup(itemAlign);
          var gradientBarGroup = new Group$3();
          mainGroup.add(gradientBarGroup);
          gradientBarGroup.add(shapes.outOfRange = createPolygon());
          gradientBarGroup.add(shapes.inRange = createPolygon(null, useHandle ? getCursor(this._orient) : null, bind$2(this._dragHandle, this, "all", false), bind$2(this._dragHandle, this, "all", true)));
          gradientBarGroup.setClipPath(new Rect$2({
            shape: {
              x: 0,
              y: 0,
              width: itemSize2[0],
              height: itemSize2[1],
              r: 3
            }
          }));
          var textRect = visualMapModel.textStyleModel.getTextRect("国");
          var textSize = mathMax(textRect.width, textRect.height);
          if (useHandle) {
            shapes.handleThumbs = [];
            shapes.handleLabels = [];
            shapes.handleLabelPoints = [];
            this._createHandle(visualMapModel, mainGroup, 0, itemSize2, textSize, orient);
            this._createHandle(visualMapModel, mainGroup, 1, itemSize2, textSize, orient);
          }
          this._createIndicator(visualMapModel, mainGroup, itemSize2, textSize, orient);
          targetGroup.add(mainGroup);
        };
        ContinuousView2.prototype._createHandle = function(visualMapModel, mainGroup, handleIndex, itemSize2, textSize, orient) {
          var onDrift = bind$2(this._dragHandle, this, handleIndex, false);
          var onDragEnd = bind$2(this._dragHandle, this, handleIndex, true);
          var handleSize = parsePercent$1(visualMapModel.get("handleSize"), itemSize2[0]);
          var handleThumb = createSymbol$1(visualMapModel.get("handleIcon"), -handleSize / 2, -handleSize / 2, handleSize, handleSize, null, true);
          var cursor = getCursor(this._orient);
          handleThumb.attr({
            cursor,
            draggable: true,
            drift: onDrift,
            ondragend: onDragEnd,
            onmousemove: function(e2) {
              stop(e2.event);
            }
          });
          handleThumb.x = itemSize2[0] / 2;
          handleThumb.useStyle(visualMapModel.getModel("handleStyle").getItemStyle());
          handleThumb.setStyle({
            strokeNoScale: true,
            strokeFirst: true
          });
          handleThumb.style.lineWidth *= 2;
          handleThumb.ensureState("emphasis").style = visualMapModel.getModel(["emphasis", "handleStyle"]).getItemStyle();
          setAsHighDownDispatcher(handleThumb, true);
          mainGroup.add(handleThumb);
          var textStyleModel = this.visualMapModel.textStyleModel;
          var handleLabel = new ZRText({
            cursor,
            draggable: true,
            drift: onDrift,
            onmousemove: function(e2) {
              stop(e2.event);
            },
            ondragend: onDragEnd,
            style: createTextStyle(textStyleModel, {
              x: 0,
              y: 0,
              text: ""
            })
          });
          handleLabel.ensureState("blur").style = {
            opacity: 0.1
          };
          handleLabel.stateTransition = {
            duration: 200
          };
          this.group.add(handleLabel);
          var handleLabelPoint = [handleSize, 0];
          var shapes = this._shapes;
          shapes.handleThumbs[handleIndex] = handleThumb;
          shapes.handleLabelPoints[handleIndex] = handleLabelPoint;
          shapes.handleLabels[handleIndex] = handleLabel;
        };
        ContinuousView2.prototype._createIndicator = function(visualMapModel, mainGroup, itemSize2, textSize, orient) {
          var scale2 = parsePercent$1(visualMapModel.get("indicatorSize"), itemSize2[0]);
          var indicator = createSymbol$1(visualMapModel.get("indicatorIcon"), -scale2 / 2, -scale2 / 2, scale2, scale2, null, true);
          indicator.attr({
            cursor: "move",
            invisible: true,
            silent: true,
            x: itemSize2[0] / 2
          });
          var indicatorStyle = visualMapModel.getModel("indicatorStyle").getItemStyle();
          if (indicator instanceof ZRImage) {
            var pathStyle = indicator.style;
            indicator.useStyle(extend$1({
              // TODO other properties like x, y ?
              image: pathStyle.image,
              x: pathStyle.x,
              y: pathStyle.y,
              width: pathStyle.width,
              height: pathStyle.height
            }, indicatorStyle));
          } else {
            indicator.useStyle(indicatorStyle);
          }
          mainGroup.add(indicator);
          var textStyleModel = this.visualMapModel.textStyleModel;
          var indicatorLabel = new ZRText({
            silent: true,
            invisible: true,
            style: createTextStyle(textStyleModel, {
              x: 0,
              y: 0,
              text: ""
            })
          });
          this.group.add(indicatorLabel);
          var indicatorLabelPoint = [(orient === "horizontal" ? textSize / 2 : HOVER_LINK_OUT) + itemSize2[0] / 2, 0];
          var shapes = this._shapes;
          shapes.indicator = indicator;
          shapes.indicatorLabel = indicatorLabel;
          shapes.indicatorLabelPoint = indicatorLabelPoint;
          this._firstShowIndicator = true;
        };
        ContinuousView2.prototype._dragHandle = function(handleIndex, isEnd, dx, dy) {
          if (!this._useHandle) {
            return;
          }
          this._dragging = !isEnd;
          if (!isEnd) {
            var vertex = this._applyTransform([dx, dy], this._shapes.mainGroup, true);
            this._updateInterval(handleIndex, vertex[1]);
            this._hideIndicator();
            this._updateView();
          }
          if (isEnd === !this.visualMapModel.get("realtime")) {
            this.api.dispatchAction({
              type: "selectDataRange",
              from: this.uid,
              visualMapId: this.visualMapModel.id,
              selected: this._dataInterval.slice()
            });
          }
          if (isEnd) {
            !this._hovering && this._clearHoverLinkToSeries();
          } else if (useHoverLinkOnHandle(this.visualMapModel)) {
            this._doHoverLinkToSeries(this._handleEnds[handleIndex], false);
          }
        };
        ContinuousView2.prototype._resetInterval = function() {
          var visualMapModel = this.visualMapModel;
          var dataInterval = this._dataInterval = visualMapModel.getSelected();
          var dataExtent = visualMapModel.getExtent();
          var sizeExtent = [0, visualMapModel.itemSize[1]];
          this._handleEnds = [linearMap(dataInterval[0], dataExtent, sizeExtent, true), linearMap(dataInterval[1], dataExtent, sizeExtent, true)];
        };
        ContinuousView2.prototype._updateInterval = function(handleIndex, delta) {
          delta = delta || 0;
          var visualMapModel = this.visualMapModel;
          var handleEnds = this._handleEnds;
          var sizeExtent = [0, visualMapModel.itemSize[1]];
          sliderMove(
            delta,
            handleEnds,
            sizeExtent,
            handleIndex,
            // cross is forbidden
            0
          );
          var dataExtent = visualMapModel.getExtent();
          this._dataInterval = [linearMap(handleEnds[0], sizeExtent, dataExtent, true), linearMap(handleEnds[1], sizeExtent, dataExtent, true)];
        };
        ContinuousView2.prototype._updateView = function(forSketch) {
          var visualMapModel = this.visualMapModel;
          var dataExtent = visualMapModel.getExtent();
          var shapes = this._shapes;
          var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];
          var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;
          var visualInRange = this._createBarVisual(this._dataInterval, dataExtent, inRangeHandleEnds, "inRange");
          var visualOutOfRange = this._createBarVisual(dataExtent, dataExtent, outOfRangeHandleEnds, "outOfRange");
          shapes.inRange.setStyle({
            fill: visualInRange.barColor
            // opacity: visualInRange.opacity
          }).setShape("points", visualInRange.barPoints);
          shapes.outOfRange.setStyle({
            fill: visualOutOfRange.barColor
            // opacity: visualOutOfRange.opacity
          }).setShape("points", visualOutOfRange.barPoints);
          this._updateHandle(inRangeHandleEnds, visualInRange);
        };
        ContinuousView2.prototype._createBarVisual = function(dataInterval, dataExtent, handleEnds, forceState) {
          var opts = {
            forceState,
            convertOpacityToAlpha: true
          };
          var colorStops = this._makeColorGradient(dataInterval, opts);
          var symbolSizes = [this.getControllerVisual(dataInterval[0], "symbolSize", opts), this.getControllerVisual(dataInterval[1], "symbolSize", opts)];
          var barPoints = this._createBarPoints(handleEnds, symbolSizes);
          return {
            barColor: new LinearGradient(0, 0, 0, 1, colorStops),
            barPoints,
            handlesColor: [colorStops[0].color, colorStops[colorStops.length - 1].color]
          };
        };
        ContinuousView2.prototype._makeColorGradient = function(dataInterval, opts) {
          var sampleNumber = 100;
          var colorStops = [];
          var step = (dataInterval[1] - dataInterval[0]) / sampleNumber;
          colorStops.push({
            color: this.getControllerVisual(dataInterval[0], "color", opts),
            offset: 0
          });
          for (var i2 = 1; i2 < sampleNumber; i2++) {
            var currValue = dataInterval[0] + step * i2;
            if (currValue > dataInterval[1]) {
              break;
            }
            colorStops.push({
              color: this.getControllerVisual(currValue, "color", opts),
              offset: i2 / sampleNumber
            });
          }
          colorStops.push({
            color: this.getControllerVisual(dataInterval[1], "color", opts),
            offset: 1
          });
          return colorStops;
        };
        ContinuousView2.prototype._createBarPoints = function(handleEnds, symbolSizes) {
          var itemSize2 = this.visualMapModel.itemSize;
          return [[itemSize2[0] - symbolSizes[0], handleEnds[0]], [itemSize2[0], handleEnds[0]], [itemSize2[0], handleEnds[1]], [itemSize2[0] - symbolSizes[1], handleEnds[1]]];
        };
        ContinuousView2.prototype._createBarGroup = function(itemAlign) {
          var orient = this._orient;
          var inverse = this.visualMapModel.get("inverse");
          return new Group$3(orient === "horizontal" && !inverse ? {
            scaleX: itemAlign === "bottom" ? 1 : -1,
            rotation: Math.PI / 2
          } : orient === "horizontal" && inverse ? {
            scaleX: itemAlign === "bottom" ? -1 : 1,
            rotation: -Math.PI / 2
          } : orient === "vertical" && !inverse ? {
            scaleX: itemAlign === "left" ? 1 : -1,
            scaleY: -1
          } : {
            scaleX: itemAlign === "left" ? 1 : -1
          });
        };
        ContinuousView2.prototype._updateHandle = function(handleEnds, visualInRange) {
          if (!this._useHandle) {
            return;
          }
          var shapes = this._shapes;
          var visualMapModel = this.visualMapModel;
          var handleThumbs = shapes.handleThumbs;
          var handleLabels = shapes.handleLabels;
          var itemSize2 = visualMapModel.itemSize;
          var dataExtent = visualMapModel.getExtent();
          var align = this._applyTransform("left", shapes.mainGroup);
          each$1([0, 1], function(handleIndex) {
            var handleThumb = handleThumbs[handleIndex];
            handleThumb.setStyle("fill", visualInRange.handlesColor[handleIndex]);
            handleThumb.y = handleEnds[handleIndex];
            var val = linearMap(handleEnds[handleIndex], [0, itemSize2[1]], dataExtent, true);
            var symbolSize = this.getControllerVisual(val, "symbolSize");
            handleThumb.scaleX = handleThumb.scaleY = symbolSize / itemSize2[0];
            handleThumb.x = itemSize2[0] - symbolSize / 2;
            var textPoint = applyTransform(shapes.handleLabelPoints[handleIndex], getTransform$1(handleThumb, this.group));
            if (this._orient === "horizontal") {
              var minimumOffset = align === "left" || align === "top" ? (itemSize2[0] - symbolSize) / 2 : (itemSize2[0] - symbolSize) / -2;
              textPoint[1] += minimumOffset;
            }
            handleLabels[handleIndex].setStyle({
              x: textPoint[0],
              y: textPoint[1],
              text: visualMapModel.formatValueText(this._dataInterval[handleIndex]),
              verticalAlign: "middle",
              align: this._orient === "vertical" ? this._applyTransform("left", shapes.mainGroup) : "center"
            });
          }, this);
        };
        ContinuousView2.prototype._showIndicator = function(cursorValue, textValue, rangeSymbol, halfHoverLinkSize) {
          var visualMapModel = this.visualMapModel;
          var dataExtent = visualMapModel.getExtent();
          var itemSize2 = visualMapModel.itemSize;
          var sizeExtent = [0, itemSize2[1]];
          var shapes = this._shapes;
          var indicator = shapes.indicator;
          if (!indicator) {
            return;
          }
          indicator.attr("invisible", false);
          var opts = {
            convertOpacityToAlpha: true
          };
          var color2 = this.getControllerVisual(cursorValue, "color", opts);
          var symbolSize = this.getControllerVisual(cursorValue, "symbolSize");
          var y = linearMap(cursorValue, dataExtent, sizeExtent, true);
          var x2 = itemSize2[0] - symbolSize / 2;
          var oldIndicatorPos = {
            x: indicator.x,
            y: indicator.y
          };
          indicator.y = y;
          indicator.x = x2;
          var textPoint = applyTransform(shapes.indicatorLabelPoint, getTransform$1(indicator, this.group));
          var indicatorLabel = shapes.indicatorLabel;
          indicatorLabel.attr("invisible", false);
          var align = this._applyTransform("left", shapes.mainGroup);
          var orient = this._orient;
          var isHorizontal2 = orient === "horizontal";
          indicatorLabel.setStyle({
            text: (rangeSymbol ? rangeSymbol : "") + visualMapModel.formatValueText(textValue),
            verticalAlign: isHorizontal2 ? align : "middle",
            align: isHorizontal2 ? "center" : align
          });
          var indicatorNewProps = {
            x: x2,
            y,
            style: {
              fill: color2
            }
          };
          var labelNewProps = {
            style: {
              x: textPoint[0],
              y: textPoint[1]
            }
          };
          if (visualMapModel.ecModel.isAnimationEnabled() && !this._firstShowIndicator) {
            var animationCfg = {
              duration: 100,
              easing: "cubicInOut",
              additive: true
            };
            indicator.x = oldIndicatorPos.x;
            indicator.y = oldIndicatorPos.y;
            indicator.animateTo(indicatorNewProps, animationCfg);
            indicatorLabel.animateTo(labelNewProps, animationCfg);
          } else {
            indicator.attr(indicatorNewProps);
            indicatorLabel.attr(labelNewProps);
          }
          this._firstShowIndicator = false;
          var handleLabels = this._shapes.handleLabels;
          if (handleLabels) {
            for (var i2 = 0; i2 < handleLabels.length; i2++) {
              this.api.enterBlur(handleLabels[i2]);
            }
          }
        };
        ContinuousView2.prototype._enableHoverLinkToSeries = function() {
          var self2 = this;
          this._shapes.mainGroup.on("mousemove", function(e2) {
            self2._hovering = true;
            if (!self2._dragging) {
              var itemSize2 = self2.visualMapModel.itemSize;
              var pos = self2._applyTransform([e2.offsetX, e2.offsetY], self2._shapes.mainGroup, true, true);
              pos[1] = mathMin(mathMax(0, pos[1]), itemSize2[1]);
              self2._doHoverLinkToSeries(pos[1], 0 <= pos[0] && pos[0] <= itemSize2[0]);
            }
          }).on("mouseout", function() {
            self2._hovering = false;
            !self2._dragging && self2._clearHoverLinkToSeries();
          });
        };
        ContinuousView2.prototype._enableHoverLinkFromSeries = function() {
          var zr = this.api.getZr();
          if (this.visualMapModel.option.hoverLink) {
            zr.on("mouseover", this._hoverLinkFromSeriesMouseOver, this);
            zr.on("mouseout", this._hideIndicator, this);
          } else {
            this._clearHoverLinkFromSeries();
          }
        };
        ContinuousView2.prototype._doHoverLinkToSeries = function(cursorPos, hoverOnBar) {
          var visualMapModel = this.visualMapModel;
          var itemSize2 = visualMapModel.itemSize;
          if (!visualMapModel.option.hoverLink) {
            return;
          }
          var sizeExtent = [0, itemSize2[1]];
          var dataExtent = visualMapModel.getExtent();
          cursorPos = mathMin(mathMax(sizeExtent[0], cursorPos), sizeExtent[1]);
          var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent);
          var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize];
          var cursorValue = linearMap(cursorPos, sizeExtent, dataExtent, true);
          var valueRange = [linearMap(hoverRange[0], sizeExtent, dataExtent, true), linearMap(hoverRange[1], sizeExtent, dataExtent, true)];
          hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity);
          hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity);
          if (hoverOnBar) {
            if (valueRange[0] === -Infinity) {
              this._showIndicator(cursorValue, valueRange[1], "< ", halfHoverLinkSize);
            } else if (valueRange[1] === Infinity) {
              this._showIndicator(cursorValue, valueRange[0], "> ", halfHoverLinkSize);
            } else {
              this._showIndicator(cursorValue, cursorValue, "≈ ", halfHoverLinkSize);
            }
          }
          var oldBatch = this._hoverLinkDataIndices;
          var newBatch = [];
          if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) {
            newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange);
          }
          var resultBatches = compressBatches(oldBatch, newBatch);
          this._dispatchHighDown("downplay", makeHighDownBatch(resultBatches[0], visualMapModel));
          this._dispatchHighDown("highlight", makeHighDownBatch(resultBatches[1], visualMapModel));
        };
        ContinuousView2.prototype._hoverLinkFromSeriesMouseOver = function(e2) {
          var ecData;
          findEventDispatcher(e2.target, function(target) {
            var currECData = getECData(target);
            if (currECData.dataIndex != null) {
              ecData = currECData;
              return true;
            }
          }, true);
          if (!ecData) {
            return;
          }
          var dataModel = this.ecModel.getSeriesByIndex(ecData.seriesIndex);
          var visualMapModel = this.visualMapModel;
          if (!visualMapModel.isTargetSeries(dataModel)) {
            return;
          }
          var data = dataModel.getData(ecData.dataType);
          var value = data.getStore().get(visualMapModel.getDataDimensionIndex(data), ecData.dataIndex);
          if (!isNaN(value)) {
            this._showIndicator(value, value);
          }
        };
        ContinuousView2.prototype._hideIndicator = function() {
          var shapes = this._shapes;
          shapes.indicator && shapes.indicator.attr("invisible", true);
          shapes.indicatorLabel && shapes.indicatorLabel.attr("invisible", true);
          var handleLabels = this._shapes.handleLabels;
          if (handleLabels) {
            for (var i2 = 0; i2 < handleLabels.length; i2++) {
              this.api.leaveBlur(handleLabels[i2]);
            }
          }
        };
        ContinuousView2.prototype._clearHoverLinkToSeries = function() {
          this._hideIndicator();
          var indices = this._hoverLinkDataIndices;
          this._dispatchHighDown("downplay", makeHighDownBatch(indices, this.visualMapModel));
          indices.length = 0;
        };
        ContinuousView2.prototype._clearHoverLinkFromSeries = function() {
          this._hideIndicator();
          var zr = this.api.getZr();
          zr.off("mouseover", this._hoverLinkFromSeriesMouseOver);
          zr.off("mouseout", this._hideIndicator);
        };
        ContinuousView2.prototype._applyTransform = function(vertex, element, inverse, global2) {
          var transform2 = getTransform$1(element, global2 ? null : this.group);
          return isArray$2(vertex) ? applyTransform(vertex, transform2, inverse) : transformDirection(vertex, transform2, inverse);
        };
        ContinuousView2.prototype._dispatchHighDown = function(type, batch2) {
          batch2 && batch2.length && this.api.dispatchAction({
            type,
            batch: batch2
          });
        };
        ContinuousView2.prototype.dispose = function() {
          this._clearHoverLinkFromSeries();
          this._clearHoverLinkToSeries();
        };
        ContinuousView2.type = "visualMap.continuous";
        return ContinuousView2;
      }(VisualMapView)
    );
    function createPolygon(points2, cursor, onDrift, onDragEnd) {
      return new Polygon({
        shape: {
          points: points2
        },
        draggable: !!onDrift,
        cursor,
        drift: onDrift,
        onmousemove: function(e2) {
          stop(e2.event);
        },
        ondragend: onDragEnd
      });
    }
    function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) {
      var halfHoverLinkSize = HOVER_LINK_SIZE / 2;
      var hoverLinkDataSize = visualMapModel.get("hoverLinkDataSize");
      if (hoverLinkDataSize) {
        halfHoverLinkSize = linearMap(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2;
      }
      return halfHoverLinkSize;
    }
    function useHoverLinkOnHandle(visualMapModel) {
      var hoverLinkOnHandle = visualMapModel.get("hoverLinkOnHandle");
      return !!(hoverLinkOnHandle == null ? visualMapModel.get("realtime") : hoverLinkOnHandle);
    }
    function getCursor(orient) {
      return orient === "vertical" ? "ns-resize" : "ew-resize";
    }
    var visualMapActionInfo = {
      type: "selectDataRange",
      event: "dataRangeSelected",
      // FIXME use updateView appears wrong
      update: "update"
    };
    var visualMapActionHander = function(payload, ecModel) {
      ecModel.eachComponent({
        mainType: "visualMap",
        query: payload
      }, function(model) {
        model.setSelected(payload.selected);
      });
    };
    var visualMapEncodingHandlers = [
      {
        createOnAllSeries: true,
        reset: function(seriesModel, ecModel) {
          var resetDefines = [];
          ecModel.eachComponent("visualMap", function(visualMapModel) {
            var pipelineContext = seriesModel.pipelineContext;
            if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {
              return;
            }
            resetDefines.push(incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, bind$2(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimensionIndex(seriesModel.getData())));
          });
          return resetDefines;
        }
      },
      // Only support color.
      {
        createOnAllSeries: true,
        reset: function(seriesModel, ecModel) {
          var data = seriesModel.getData();
          var visualMetaList = [];
          ecModel.eachComponent("visualMap", function(visualMapModel) {
            if (visualMapModel.isTargetSeries(seriesModel)) {
              var visualMeta = visualMapModel.getVisualMeta(bind$2(getColorVisual, null, seriesModel, visualMapModel)) || {
                stops: [],
                outerColors: []
              };
              var dimIdx = visualMapModel.getDataDimensionIndex(data);
              if (dimIdx >= 0) {
                visualMeta.dimension = dimIdx;
                visualMetaList.push(visualMeta);
              }
            }
          });
          seriesModel.getData().setVisual("visualMeta", visualMetaList);
        }
      }
    ];
    function getColorVisual(seriesModel, visualMapModel, value, valueState) {
      var mappings = visualMapModel.targetVisuals[valueState];
      var visualTypes = VisualMapping.prepareVisualTypes(mappings);
      var resultVisual = {
        color: getVisualFromData(seriesModel.getData(), "color")
        // default color.
      };
      for (var i2 = 0, len2 = visualTypes.length; i2 < len2; i2++) {
        var type = visualTypes[i2];
        var mapping = mappings[type === "opacity" ? "__alphaForOpacity" : type];
        mapping && mapping.applyVisual(value, getVisual, setVisual);
      }
      return resultVisual.color;
      function getVisual(key) {
        return resultVisual[key];
      }
      function setVisual(key, value2) {
        resultVisual[key] = value2;
      }
    }
    var each = each$f;
    function visualMapPreprocessor(option) {
      var visualMap = option && option.visualMap;
      if (!isArray$2(visualMap)) {
        visualMap = visualMap ? [visualMap] : [];
      }
      each(visualMap, function(opt) {
        if (!opt) {
          return;
        }
        if (has(opt, "splitList") && !has(opt, "pieces")) {
          opt.pieces = opt.splitList;
          delete opt.splitList;
        }
        var pieces = opt.pieces;
        if (pieces && isArray$2(pieces)) {
          each(pieces, function(piece) {
            if (isObject$5(piece)) {
              if (has(piece, "start") && !has(piece, "min")) {
                piece.min = piece.start;
              }
              if (has(piece, "end") && !has(piece, "max")) {
                piece.max = piece.end;
              }
            }
          });
        }
      });
    }
    function has(obj, name) {
      return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);
    }
    var installed = false;
    function installCommon(registers) {
      if (installed) {
        return;
      }
      installed = true;
      registers.registerSubTypeDefaulter("visualMap", function(option) {
        return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? "continuous" : "piecewise";
      });
      registers.registerAction(visualMapActionInfo, visualMapActionHander);
      each$f(visualMapEncodingHandlers, function(handler) {
        registers.registerVisual(registers.PRIORITY.VISUAL.COMPONENT, handler);
      });
      registers.registerPreprocessor(visualMapPreprocessor);
    }
    function install$5(registers) {
      registers.registerComponentModel(ContinuousModel);
      registers.registerComponentView(ContinuousView);
      installCommon(registers);
    }
    var PiecewiseModel = (
      /** @class */
      function(_super) {
        __extends$1(PiecewiseModel2, _super);
        function PiecewiseModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PiecewiseModel2.type;
          _this._pieceList = [];
          return _this;
        }
        PiecewiseModel2.prototype.optionUpdated = function(newOption, isInit) {
          _super.prototype.optionUpdated.apply(this, arguments);
          this.resetExtent();
          var mode = this._mode = this._determineMode();
          this._pieceList = [];
          resetMethods[this._mode].call(this, this._pieceList);
          this._resetSelected(newOption, isInit);
          var categories = this.option.categories;
          this.resetVisual(function(mappingOption, state) {
            if (mode === "categories") {
              mappingOption.mappingMethod = "category";
              mappingOption.categories = clone$4(categories);
            } else {
              mappingOption.dataExtent = this.getExtent();
              mappingOption.mappingMethod = "piecewise";
              mappingOption.pieceList = map$1(this._pieceList, function(piece) {
                piece = clone$4(piece);
                if (state !== "inRange") {
                  piece.visual = null;
                }
                return piece;
              });
            }
          });
        };
        PiecewiseModel2.prototype.completeVisualOption = function() {
          var option = this.option;
          var visualTypesInPieces = {};
          var visualTypes = VisualMapping.listVisualTypes();
          var isCategory2 = this.isCategory();
          each$f(option.pieces, function(piece) {
            each$f(visualTypes, function(visualType) {
              if (piece.hasOwnProperty(visualType)) {
                visualTypesInPieces[visualType] = 1;
              }
            });
          });
          each$f(visualTypesInPieces, function(v4, visualType) {
            var exists = false;
            each$f(this.stateList, function(state) {
              exists = exists || has2(option, state, visualType) || has2(option.target, state, visualType);
            }, this);
            !exists && each$f(this.stateList, function(state) {
              (option[state] || (option[state] = {}))[visualType] = visualDefault.get(visualType, state === "inRange" ? "active" : "inactive", isCategory2);
            });
          }, this);
          function has2(obj, state, visualType) {
            return obj && obj[state] && obj[state].hasOwnProperty(visualType);
          }
          _super.prototype.completeVisualOption.apply(this, arguments);
        };
        PiecewiseModel2.prototype._resetSelected = function(newOption, isInit) {
          var thisOption = this.option;
          var pieceList = this._pieceList;
          var selected = (isInit ? thisOption : newOption).selected || {};
          thisOption.selected = selected;
          each$f(pieceList, function(piece, index) {
            var key = this.getSelectedMapKey(piece);
            if (!selected.hasOwnProperty(key)) {
              selected[key] = true;
            }
          }, this);
          if (thisOption.selectedMode === "single") {
            var hasSel_1 = false;
            each$f(pieceList, function(piece, index) {
              var key = this.getSelectedMapKey(piece);
              if (selected[key]) {
                hasSel_1 ? selected[key] = false : hasSel_1 = true;
              }
            }, this);
          }
        };
        PiecewiseModel2.prototype.getItemSymbol = function() {
          return this.get("itemSymbol");
        };
        PiecewiseModel2.prototype.getSelectedMapKey = function(piece) {
          return this._mode === "categories" ? piece.value + "" : piece.index + "";
        };
        PiecewiseModel2.prototype.getPieceList = function() {
          return this._pieceList;
        };
        PiecewiseModel2.prototype._determineMode = function() {
          var option = this.option;
          return option.pieces && option.pieces.length > 0 ? "pieces" : this.option.categories ? "categories" : "splitNumber";
        };
        PiecewiseModel2.prototype.setSelected = function(selected) {
          this.option.selected = clone$4(selected);
        };
        PiecewiseModel2.prototype.getValueState = function(value) {
          var index = VisualMapping.findPieceIndex(value, this._pieceList);
          return index != null ? this.option.selected[this.getSelectedMapKey(this._pieceList[index])] ? "inRange" : "outOfRange" : "outOfRange";
        };
        PiecewiseModel2.prototype.findTargetDataIndices = function(pieceIndex) {
          var result = [];
          var pieceList = this._pieceList;
          this.eachTargetSeries(function(seriesModel) {
            var dataIndices = [];
            var data = seriesModel.getData();
            data.each(this.getDataDimensionIndex(data), function(value, dataIndex) {
              var pIdx = VisualMapping.findPieceIndex(value, pieceList);
              pIdx === pieceIndex && dataIndices.push(dataIndex);
            }, this);
            result.push({
              seriesId: seriesModel.id,
              dataIndex: dataIndices
            });
          }, this);
          return result;
        };
        PiecewiseModel2.prototype.getRepresentValue = function(piece) {
          var representValue;
          if (this.isCategory()) {
            representValue = piece.value;
          } else {
            if (piece.value != null) {
              representValue = piece.value;
            } else {
              var pieceInterval = piece.interval || [];
              representValue = pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity ? 0 : (pieceInterval[0] + pieceInterval[1]) / 2;
            }
          }
          return representValue;
        };
        PiecewiseModel2.prototype.getVisualMeta = function(getColorVisual2) {
          if (this.isCategory()) {
            return;
          }
          var stops = [];
          var outerColors = ["", ""];
          var visualMapModel = this;
          function setStop(interval, valueState) {
            var representValue = visualMapModel.getRepresentValue({
              interval
            });
            if (!valueState) {
              valueState = visualMapModel.getValueState(representValue);
            }
            var color2 = getColorVisual2(representValue, valueState);
            if (interval[0] === -Infinity) {
              outerColors[0] = color2;
            } else if (interval[1] === Infinity) {
              outerColors[1] = color2;
            } else {
              stops.push({
                value: interval[0],
                color: color2
              }, {
                value: interval[1],
                color: color2
              });
            }
          }
          var pieceList = this._pieceList.slice();
          if (!pieceList.length) {
            pieceList.push({
              interval: [-Infinity, Infinity]
            });
          } else {
            var edge = pieceList[0].interval[0];
            edge !== -Infinity && pieceList.unshift({
              interval: [-Infinity, edge]
            });
            edge = pieceList[pieceList.length - 1].interval[1];
            edge !== Infinity && pieceList.push({
              interval: [edge, Infinity]
            });
          }
          var curr = -Infinity;
          each$f(pieceList, function(piece) {
            var interval = piece.interval;
            if (interval) {
              interval[0] > curr && setStop([curr, interval[0]], "outOfRange");
              setStop(interval.slice());
              curr = interval[1];
            }
          }, this);
          return {
            stops,
            outerColors
          };
        };
        PiecewiseModel2.type = "visualMap.piecewise";
        PiecewiseModel2.defaultOption = inheritDefaultOption(VisualMapModel.defaultOption, {
          selected: null,
          minOpen: false,
          maxOpen: false,
          align: "auto",
          itemWidth: 20,
          itemHeight: 14,
          itemSymbol: "roundRect",
          pieces: null,
          categories: null,
          splitNumber: 5,
          selectedMode: "multiple",
          itemGap: 10,
          hoverLink: true
          // Enable hover highlight.
        });
        return PiecewiseModel2;
      }(VisualMapModel)
    );
    var resetMethods = {
      splitNumber: function(outPieceList) {
        var thisOption = this.option;
        var precision = Math.min(thisOption.precision, 20);
        var dataExtent = this.getExtent();
        var splitNumber = thisOption.splitNumber;
        splitNumber = Math.max(parseInt(splitNumber, 10), 1);
        thisOption.splitNumber = splitNumber;
        var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;
        while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {
          precision++;
        }
        thisOption.precision = precision;
        splitStep = +splitStep.toFixed(precision);
        if (thisOption.minOpen) {
          outPieceList.push({
            interval: [-Infinity, dataExtent[0]],
            close: [0, 0]
          });
        }
        for (var index = 0, curr = dataExtent[0]; index < splitNumber; curr += splitStep, index++) {
          var max3 = index === splitNumber - 1 ? dataExtent[1] : curr + splitStep;
          outPieceList.push({
            interval: [curr, max3],
            close: [1, 1]
          });
        }
        if (thisOption.maxOpen) {
          outPieceList.push({
            interval: [dataExtent[1], Infinity],
            close: [0, 0]
          });
        }
        reformIntervals(outPieceList);
        each$f(outPieceList, function(piece, index2) {
          piece.index = index2;
          piece.text = this.formatValueText(piece.interval);
        }, this);
      },
      categories: function(outPieceList) {
        var thisOption = this.option;
        each$f(thisOption.categories, function(cate) {
          outPieceList.push({
            text: this.formatValueText(cate, true),
            value: cate
          });
        }, this);
        normalizeReverse(thisOption, outPieceList);
      },
      pieces: function(outPieceList) {
        var thisOption = this.option;
        each$f(thisOption.pieces, function(pieceListItem, index) {
          if (!isObject$5(pieceListItem)) {
            pieceListItem = {
              value: pieceListItem
            };
          }
          var item = {
            text: "",
            index
          };
          if (pieceListItem.label != null) {
            item.text = pieceListItem.label;
          }
          if (pieceListItem.hasOwnProperty("value")) {
            var value = item.value = pieceListItem.value;
            item.interval = [value, value];
            item.close = [1, 1];
          } else {
            var interval = item.interval = [];
            var close_1 = item.close = [0, 0];
            var closeList = [1, 0, 1];
            var infinityList = [-Infinity, Infinity];
            var useMinMax = [];
            for (var lg = 0; lg < 2; lg++) {
              var names2 = [["gte", "gt", "min"], ["lte", "lt", "max"]][lg];
              for (var i2 = 0; i2 < 3 && interval[lg] == null; i2++) {
                interval[lg] = pieceListItem[names2[i2]];
                close_1[lg] = closeList[i2];
                useMinMax[lg] = i2 === 2;
              }
              interval[lg] == null && (interval[lg] = infinityList[lg]);
            }
            useMinMax[0] && interval[1] === Infinity && (close_1[0] = 0);
            useMinMax[1] && interval[0] === -Infinity && (close_1[1] = 0);
            if (interval[0] === interval[1] && close_1[0] && close_1[1]) {
              item.value = interval[0];
            }
          }
          item.visual = VisualMapping.retrieveVisuals(pieceListItem);
          outPieceList.push(item);
        }, this);
        normalizeReverse(thisOption, outPieceList);
        reformIntervals(outPieceList);
        each$f(outPieceList, function(piece) {
          var close2 = piece.close;
          var edgeSymbols = [["<", "≤"][close2[1]], [">", "≥"][close2[0]]];
          piece.text = piece.text || this.formatValueText(piece.value != null ? piece.value : piece.interval, false, edgeSymbols);
        }, this);
      }
    };
    function normalizeReverse(thisOption, pieceList) {
      var inverse = thisOption.inverse;
      if (thisOption.orient === "vertical" ? !inverse : inverse) {
        pieceList.reverse();
      }
    }
    var PiecewiseVisualMapView = (
      /** @class */
      function(_super) {
        __extends$1(PiecewiseVisualMapView2, _super);
        function PiecewiseVisualMapView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = PiecewiseVisualMapView2.type;
          return _this;
        }
        PiecewiseVisualMapView2.prototype.doRender = function() {
          var thisGroup = this.group;
          thisGroup.removeAll();
          var visualMapModel = this.visualMapModel;
          var textGap = visualMapModel.get("textGap");
          var textStyleModel = visualMapModel.textStyleModel;
          var textFont = textStyleModel.getFont();
          var textFill = textStyleModel.getTextColor();
          var itemAlign = this._getItemAlign();
          var itemSize2 = visualMapModel.itemSize;
          var viewData = this._getViewData();
          var endsText = viewData.endsText;
          var showLabel = retrieve(visualMapModel.get("showLabel", true), !endsText);
          var silent = !visualMapModel.get("selectedMode");
          endsText && this._renderEndsText(thisGroup, endsText[0], itemSize2, showLabel, itemAlign);
          each$f(viewData.viewPieceList, function(item) {
            var piece = item.piece;
            var itemGroup = new Group$3();
            itemGroup.onclick = bind$2(this._onItemClick, this, piece);
            this._enableHoverLink(itemGroup, item.indexInModelPieceList);
            var representValue = visualMapModel.getRepresentValue(piece);
            this._createItemSymbol(itemGroup, representValue, [0, 0, itemSize2[0], itemSize2[1]], silent);
            if (showLabel) {
              var visualState = this.visualMapModel.getValueState(representValue);
              itemGroup.add(new ZRText({
                style: {
                  x: itemAlign === "right" ? -textGap : itemSize2[0] + textGap,
                  y: itemSize2[1] / 2,
                  text: piece.text,
                  verticalAlign: "middle",
                  align: itemAlign,
                  font: textFont,
                  fill: textFill,
                  opacity: visualState === "outOfRange" ? 0.5 : 1
                },
                silent
              }));
            }
            thisGroup.add(itemGroup);
          }, this);
          endsText && this._renderEndsText(thisGroup, endsText[1], itemSize2, showLabel, itemAlign);
          box(visualMapModel.get("orient"), thisGroup, visualMapModel.get("itemGap"));
          this.renderBackground(thisGroup);
          this.positionGroup(thisGroup);
        };
        PiecewiseVisualMapView2.prototype._enableHoverLink = function(itemGroup, pieceIndex) {
          var _this = this;
          itemGroup.on("mouseover", function() {
            return onHoverLink("highlight");
          }).on("mouseout", function() {
            return onHoverLink("downplay");
          });
          var onHoverLink = function(method) {
            var visualMapModel = _this.visualMapModel;
            visualMapModel.option.hoverLink && _this.api.dispatchAction({
              type: method,
              batch: makeHighDownBatch(visualMapModel.findTargetDataIndices(pieceIndex), visualMapModel)
            });
          };
        };
        PiecewiseVisualMapView2.prototype._getItemAlign = function() {
          var visualMapModel = this.visualMapModel;
          var modelOption = visualMapModel.option;
          if (modelOption.orient === "vertical") {
            return getItemAlign(visualMapModel, this.api, visualMapModel.itemSize);
          } else {
            var align = modelOption.align;
            if (!align || align === "auto") {
              align = "left";
            }
            return align;
          }
        };
        PiecewiseVisualMapView2.prototype._renderEndsText = function(group, text, itemSize2, showLabel, itemAlign) {
          if (!text) {
            return;
          }
          var itemGroup = new Group$3();
          var textStyleModel = this.visualMapModel.textStyleModel;
          itemGroup.add(new ZRText({
            style: createTextStyle(textStyleModel, {
              x: showLabel ? itemAlign === "right" ? itemSize2[0] : 0 : itemSize2[0] / 2,
              y: itemSize2[1] / 2,
              verticalAlign: "middle",
              align: showLabel ? itemAlign : "center",
              text
            })
          }));
          group.add(itemGroup);
        };
        PiecewiseVisualMapView2.prototype._getViewData = function() {
          var visualMapModel = this.visualMapModel;
          var viewPieceList = map$1(visualMapModel.getPieceList(), function(piece, index) {
            return {
              piece,
              indexInModelPieceList: index
            };
          });
          var endsText = visualMapModel.get("text");
          var orient = visualMapModel.get("orient");
          var inverse = visualMapModel.get("inverse");
          if (orient === "horizontal" ? inverse : !inverse) {
            viewPieceList.reverse();
          } else if (endsText) {
            endsText = endsText.slice().reverse();
          }
          return {
            viewPieceList,
            endsText
          };
        };
        PiecewiseVisualMapView2.prototype._createItemSymbol = function(group, representValue, shapeParam, silent) {
          var itemSymbol = createSymbol$1(
            // symbol will be string
            this.getControllerVisual(representValue, "symbol"),
            shapeParam[0],
            shapeParam[1],
            shapeParam[2],
            shapeParam[3],
            // color will be string
            this.getControllerVisual(representValue, "color")
          );
          itemSymbol.silent = silent;
          group.add(itemSymbol);
        };
        PiecewiseVisualMapView2.prototype._onItemClick = function(piece) {
          var visualMapModel = this.visualMapModel;
          var option = visualMapModel.option;
          var selectedMode = option.selectedMode;
          if (!selectedMode) {
            return;
          }
          var selected = clone$4(option.selected);
          var newKey = visualMapModel.getSelectedMapKey(piece);
          if (selectedMode === "single" || selectedMode === true) {
            selected[newKey] = true;
            each$f(selected, function(o2, key) {
              selected[key] = key === newKey;
            });
          } else {
            selected[newKey] = !selected[newKey];
          }
          this.api.dispatchAction({
            type: "selectDataRange",
            from: this.uid,
            visualMapId: this.visualMapModel.id,
            selected
          });
        };
        PiecewiseVisualMapView2.type = "visualMap.piecewise";
        return PiecewiseVisualMapView2;
      }(VisualMapView)
    );
    function install$4(registers) {
      registers.registerComponentModel(PiecewiseModel);
      registers.registerComponentView(PiecewiseVisualMapView);
      installCommon(registers);
    }
    function install$3(registers) {
      use(install$5);
      use(install$4);
    }
    var DEFAULT_OPTION = {
      label: {
        enabled: true
      },
      decal: {
        show: false
      }
    };
    var inner = makeInner();
    var decalPaletteScope = {};
    function ariaVisual(ecModel, api2) {
      var ariaModel = ecModel.getModel("aria");
      if (!ariaModel.get("enabled")) {
        return;
      }
      var defaultOption2 = clone$4(DEFAULT_OPTION);
      merge$1(defaultOption2.label, ecModel.getLocaleModel().get("aria"), false);
      merge$1(ariaModel.option, defaultOption2, false);
      setDecal();
      setLabel();
      function setDecal() {
        var decalModel = ariaModel.getModel("decal");
        var useDecal = decalModel.get("show");
        if (useDecal) {
          var paletteScopeGroupByType_1 = createHashMap();
          ecModel.eachSeries(function(seriesModel) {
            if (seriesModel.isColorBySeries()) {
              return;
            }
            var decalScope = paletteScopeGroupByType_1.get(seriesModel.type);
            if (!decalScope) {
              decalScope = {};
              paletteScopeGroupByType_1.set(seriesModel.type, decalScope);
            }
            inner(seriesModel).scope = decalScope;
          });
          ecModel.eachRawSeries(function(seriesModel) {
            if (ecModel.isSeriesFiltered(seriesModel)) {
              return;
            }
            if (isFunction$1(seriesModel.enableAriaDecal)) {
              seriesModel.enableAriaDecal();
              return;
            }
            var data = seriesModel.getData();
            if (!seriesModel.isColorBySeries()) {
              var dataAll_1 = seriesModel.getRawData();
              var idxMap_1 = {};
              var decalScope_1 = inner(seriesModel).scope;
              data.each(function(idx) {
                var rawIdx = data.getRawIndex(idx);
                idxMap_1[rawIdx] = idx;
              });
              var dataCount_1 = dataAll_1.count();
              dataAll_1.each(function(rawIdx) {
                var idx = idxMap_1[rawIdx];
                var name = dataAll_1.getName(rawIdx) || rawIdx + "";
                var paletteDecal2 = getDecalFromPalette(seriesModel.ecModel, name, decalScope_1, dataCount_1);
                var specifiedDecal2 = data.getItemVisual(idx, "decal");
                data.setItemVisual(idx, "decal", mergeDecal(specifiedDecal2, paletteDecal2));
              });
            } else {
              var paletteDecal = getDecalFromPalette(seriesModel.ecModel, seriesModel.name, decalPaletteScope, ecModel.getSeriesCount());
              var specifiedDecal = data.getVisual("decal");
              data.setVisual("decal", mergeDecal(specifiedDecal, paletteDecal));
            }
            function mergeDecal(specifiedDecal2, paletteDecal2) {
              var resultDecal = specifiedDecal2 ? extend$1(extend$1({}, paletteDecal2), specifiedDecal2) : paletteDecal2;
              resultDecal.dirty = true;
              return resultDecal;
            }
          });
        }
      }
      function setLabel() {
        var dom = api2.getZr().dom;
        if (!dom) {
          return;
        }
        var labelLocale = ecModel.getLocaleModel().get("aria");
        var labelModel = ariaModel.getModel("label");
        labelModel.option = defaults$1(labelModel.option, labelLocale);
        if (!labelModel.get("enabled")) {
          return;
        }
        dom.setAttribute("role", "img");
        if (labelModel.get("description")) {
          dom.setAttribute("aria-label", labelModel.get("description"));
          return;
        }
        var seriesCnt = ecModel.getSeriesCount();
        var maxDataCnt = labelModel.get(["data", "maxCount"]) || 10;
        var maxSeriesCnt = labelModel.get(["series", "maxCount"]) || 10;
        var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt);
        var ariaLabel;
        if (seriesCnt < 1) {
          return;
        } else {
          var title = getTitle();
          if (title) {
            var withTitle = labelModel.get(["general", "withTitle"]);
            ariaLabel = replace(withTitle, {
              title
            });
          } else {
            ariaLabel = labelModel.get(["general", "withoutTitle"]);
          }
          var seriesLabels_1 = [];
          var prefix = seriesCnt > 1 ? labelModel.get(["series", "multiple", "prefix"]) : labelModel.get(["series", "single", "prefix"]);
          ariaLabel += replace(prefix, {
            seriesCount: seriesCnt
          });
          ecModel.eachSeries(function(seriesModel, idx) {
            if (idx < displaySeriesCnt) {
              var seriesLabel = void 0;
              var seriesName = seriesModel.get("name");
              var withName = seriesName ? "withName" : "withoutName";
              seriesLabel = seriesCnt > 1 ? labelModel.get(["series", "multiple", withName]) : labelModel.get(["series", "single", withName]);
              seriesLabel = replace(seriesLabel, {
                seriesId: seriesModel.seriesIndex,
                seriesName: seriesModel.get("name"),
                seriesType: getSeriesTypeName(seriesModel.subType)
              });
              var data = seriesModel.getData();
              if (data.count() > maxDataCnt) {
                var partialLabel = labelModel.get(["data", "partialData"]);
                seriesLabel += replace(partialLabel, {
                  displayCnt: maxDataCnt
                });
              } else {
                seriesLabel += labelModel.get(["data", "allData"]);
              }
              var middleSeparator_1 = labelModel.get(["data", "separator", "middle"]);
              var endSeparator_1 = labelModel.get(["data", "separator", "end"]);
              var excludeDimensionId_1 = labelModel.get(["data", "excludeDimensionId"]);
              var dataLabels = [];
              for (var i2 = 0; i2 < data.count(); i2++) {
                if (i2 < maxDataCnt) {
                  var name_1 = data.getName(i2);
                  var value = !excludeDimensionId_1 ? data.getValues(i2) : filter(data.getValues(i2), function(v4, j) {
                    return indexOf(excludeDimensionId_1, j) === -1;
                  });
                  var dataLabel = labelModel.get(["data", name_1 ? "withName" : "withoutName"]);
                  dataLabels.push(replace(dataLabel, {
                    name: name_1,
                    value: value.join(middleSeparator_1)
                  }));
                }
              }
              seriesLabel += dataLabels.join(middleSeparator_1) + endSeparator_1;
              seriesLabels_1.push(seriesLabel);
            }
          });
          var separatorModel = labelModel.getModel(["series", "multiple", "separator"]);
          var middleSeparator = separatorModel.get("middle");
          var endSeparator = separatorModel.get("end");
          ariaLabel += seriesLabels_1.join(middleSeparator) + endSeparator;
          dom.setAttribute("aria-label", ariaLabel);
        }
      }
      function replace(str, keyValues) {
        if (!isString$1(str)) {
          return str;
        }
        var result = str;
        each$f(keyValues, function(value, key) {
          result = result.replace(new RegExp("\\{\\s*" + key + "\\s*\\}", "g"), value);
        });
        return result;
      }
      function getTitle() {
        var title = ecModel.get("title");
        if (title && title.length) {
          title = title[0];
        }
        return title && title.text;
      }
      function getSeriesTypeName(type) {
        var typeNames = ecModel.getLocaleModel().get(["series", "typeNames"]);
        return typeNames[type] || typeNames.chart;
      }
    }
    function ariaPreprocessor(option) {
      if (!option || !option.aria) {
        return;
      }
      var aria = option.aria;
      if (aria.show != null) {
        aria.enabled = aria.show;
      }
      aria.label = aria.label || {};
      each$f(["description", "general", "series", "data"], function(name) {
        if (aria[name] != null) {
          aria.label[name] = aria[name];
        }
      });
    }
    function install$2(registers) {
      registers.registerPreprocessor(ariaPreprocessor);
      registers.registerVisual(registers.PRIORITY.VISUAL.ARIA, ariaVisual);
    }
    var RELATIONAL_EXPRESSION_OP_ALIAS_MAP = {
      value: "eq",
      // PENDING: not good for literal semantic?
      "<": "lt",
      "<=": "lte",
      ">": "gt",
      ">=": "gte",
      "=": "eq",
      "!=": "ne",
      "<>": "ne"
      // Might be misleading for sake of the difference between '==' and '===',
      // so don't support them.
      // '==': 'eq',
      // '===': 'seq',
      // '!==': 'sne'
      // PENDING: Whether support some common alias "ge", "le", "neq"?
      // ge: 'gte',
      // le: 'lte',
      // neq: 'ne',
    };
    var RegExpEvaluator = (
      /** @class */
      function() {
        function RegExpEvaluator2(rVal) {
          var condValue = this._condVal = isString$1(rVal) ? new RegExp(rVal) : isRegExp$1(rVal) ? rVal : null;
          if (condValue == null) {
            var errMsg = "";
            throwError(errMsg);
          }
        }
        RegExpEvaluator2.prototype.evaluate = function(lVal) {
          var type = typeof lVal;
          return isString$1(type) ? this._condVal.test(lVal) : isNumber$1(type) ? this._condVal.test(lVal + "") : false;
        };
        return RegExpEvaluator2;
      }()
    );
    var ConstConditionInternal = (
      /** @class */
      function() {
        function ConstConditionInternal2() {
        }
        ConstConditionInternal2.prototype.evaluate = function() {
          return this.value;
        };
        return ConstConditionInternal2;
      }()
    );
    var AndConditionInternal = (
      /** @class */
      function() {
        function AndConditionInternal2() {
        }
        AndConditionInternal2.prototype.evaluate = function() {
          var children = this.children;
          for (var i2 = 0; i2 < children.length; i2++) {
            if (!children[i2].evaluate()) {
              return false;
            }
          }
          return true;
        };
        return AndConditionInternal2;
      }()
    );
    var OrConditionInternal = (
      /** @class */
      function() {
        function OrConditionInternal2() {
        }
        OrConditionInternal2.prototype.evaluate = function() {
          var children = this.children;
          for (var i2 = 0; i2 < children.length; i2++) {
            if (children[i2].evaluate()) {
              return true;
            }
          }
          return false;
        };
        return OrConditionInternal2;
      }()
    );
    var NotConditionInternal = (
      /** @class */
      function() {
        function NotConditionInternal2() {
        }
        NotConditionInternal2.prototype.evaluate = function() {
          return !this.child.evaluate();
        };
        return NotConditionInternal2;
      }()
    );
    var RelationalConditionInternal = (
      /** @class */
      function() {
        function RelationalConditionInternal2() {
        }
        RelationalConditionInternal2.prototype.evaluate = function() {
          var needParse = !!this.valueParser;
          var getValue2 = this.getValue;
          var tarValRaw = getValue2(this.valueGetterParam);
          var tarValParsed = needParse ? this.valueParser(tarValRaw) : null;
          for (var i2 = 0; i2 < this.subCondList.length; i2++) {
            if (!this.subCondList[i2].evaluate(needParse ? tarValParsed : tarValRaw)) {
              return false;
            }
          }
          return true;
        };
        return RelationalConditionInternal2;
      }()
    );
    function parseOption(exprOption, getters) {
      if (exprOption === true || exprOption === false) {
        var cond = new ConstConditionInternal();
        cond.value = exprOption;
        return cond;
      }
      var errMsg = "";
      if (!isObjectNotArray(exprOption)) {
        throwError(errMsg);
      }
      if (exprOption.and) {
        return parseAndOrOption("and", exprOption, getters);
      } else if (exprOption.or) {
        return parseAndOrOption("or", exprOption, getters);
      } else if (exprOption.not) {
        return parseNotOption(exprOption, getters);
      }
      return parseRelationalOption(exprOption, getters);
    }
    function parseAndOrOption(op, exprOption, getters) {
      var subOptionArr = exprOption[op];
      var errMsg = "";
      if (!isArray$2(subOptionArr)) {
        throwError(errMsg);
      }
      if (!subOptionArr.length) {
        throwError(errMsg);
      }
      var cond = op === "and" ? new AndConditionInternal() : new OrConditionInternal();
      cond.children = map$1(subOptionArr, function(subOption) {
        return parseOption(subOption, getters);
      });
      if (!cond.children.length) {
        throwError(errMsg);
      }
      return cond;
    }
    function parseNotOption(exprOption, getters) {
      var subOption = exprOption.not;
      var errMsg = "";
      if (!isObjectNotArray(subOption)) {
        throwError(errMsg);
      }
      var cond = new NotConditionInternal();
      cond.child = parseOption(subOption, getters);
      if (!cond.child) {
        throwError(errMsg);
      }
      return cond;
    }
    function parseRelationalOption(exprOption, getters) {
      var errMsg = "";
      var valueGetterParam = getters.prepareGetValue(exprOption);
      var subCondList = [];
      var exprKeys = keys$1(exprOption);
      var parserName = exprOption.parser;
      var valueParser = parserName ? getRawValueParser(parserName) : null;
      for (var i2 = 0; i2 < exprKeys.length; i2++) {
        var keyRaw = exprKeys[i2];
        if (keyRaw === "parser" || getters.valueGetterAttrMap.get(keyRaw)) {
          continue;
        }
        var op = hasOwn(RELATIONAL_EXPRESSION_OP_ALIAS_MAP, keyRaw) ? RELATIONAL_EXPRESSION_OP_ALIAS_MAP[keyRaw] : keyRaw;
        var condValueRaw = exprOption[keyRaw];
        var condValueParsed = valueParser ? valueParser(condValueRaw) : condValueRaw;
        var evaluator = createFilterComparator(op, condValueParsed) || op === "reg" && new RegExpEvaluator(condValueParsed);
        if (!evaluator) {
          throwError(errMsg);
        }
        subCondList.push(evaluator);
      }
      if (!subCondList.length) {
        throwError(errMsg);
      }
      var cond = new RelationalConditionInternal();
      cond.valueGetterParam = valueGetterParam;
      cond.valueParser = valueParser;
      cond.getValue = getters.getValue;
      cond.subCondList = subCondList;
      return cond;
    }
    function isObjectNotArray(val) {
      return isObject$5(val) && !isArrayLike(val);
    }
    var ConditionalExpressionParsed = (
      /** @class */
      function() {
        function ConditionalExpressionParsed2(exprOption, getters) {
          this._cond = parseOption(exprOption, getters);
        }
        ConditionalExpressionParsed2.prototype.evaluate = function() {
          return this._cond.evaluate();
        };
        return ConditionalExpressionParsed2;
      }()
    );
    function parseConditionalExpression(exprOption, getters) {
      return new ConditionalExpressionParsed(exprOption, getters);
    }
    var filterTransform = {
      type: "echarts:filter",
      // PENDING: enhance to filter by index rather than create new data
      transform: function(params) {
        var upstream = params.upstream;
        var rawItem;
        var condition = parseConditionalExpression(params.config, {
          valueGetterAttrMap: createHashMap({
            dimension: true
          }),
          prepareGetValue: function(exprOption) {
            var errMsg = "";
            var dimLoose = exprOption.dimension;
            if (!hasOwn(exprOption, "dimension")) {
              throwError(errMsg);
            }
            var dimInfo = upstream.getDimensionInfo(dimLoose);
            if (!dimInfo) {
              throwError(errMsg);
            }
            return {
              dimIdx: dimInfo.index
            };
          },
          getValue: function(param) {
            return upstream.retrieveValueFromItem(rawItem, param.dimIdx);
          }
        });
        var resultData = [];
        for (var i2 = 0, len2 = upstream.count(); i2 < len2; i2++) {
          rawItem = upstream.getRawDataItem(i2);
          if (condition.evaluate()) {
            resultData.push(rawItem);
          }
        }
        return {
          data: resultData
        };
      }
    };
    var sortTransform = {
      type: "echarts:sort",
      transform: function(params) {
        var upstream = params.upstream;
        var config = params.config;
        var errMsg = "";
        var orderExprList = normalizeToArray(config);
        if (!orderExprList.length) {
          throwError(errMsg);
        }
        var orderDefList = [];
        each$f(orderExprList, function(orderExpr) {
          var dimLoose = orderExpr.dimension;
          var order = orderExpr.order;
          var parserName = orderExpr.parser;
          var incomparable = orderExpr.incomparable;
          if (dimLoose == null) {
            throwError(errMsg);
          }
          if (order !== "asc" && order !== "desc") {
            throwError(errMsg);
          }
          if (incomparable && incomparable !== "min" && incomparable !== "max") {
            var errMsg_1 = "";
            throwError(errMsg_1);
          }
          if (order !== "asc" && order !== "desc") {
            var errMsg_2 = "";
            throwError(errMsg_2);
          }
          var dimInfo = upstream.getDimensionInfo(dimLoose);
          if (!dimInfo) {
            throwError(errMsg);
          }
          var parser = parserName ? getRawValueParser(parserName) : null;
          if (parserName && !parser) {
            throwError(errMsg);
          }
          orderDefList.push({
            dimIdx: dimInfo.index,
            parser,
            comparator: new SortOrderComparator(order, incomparable)
          });
        });
        var sourceFormat = upstream.sourceFormat;
        if (sourceFormat !== SOURCE_FORMAT_ARRAY_ROWS && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS) {
          throwError(errMsg);
        }
        var resultData = [];
        for (var i2 = 0, len2 = upstream.count(); i2 < len2; i2++) {
          resultData.push(upstream.getRawDataItem(i2));
        }
        resultData.sort(function(item0, item1) {
          for (var i22 = 0; i22 < orderDefList.length; i22++) {
            var orderDef = orderDefList[i22];
            var val0 = upstream.retrieveValueFromItem(item0, orderDef.dimIdx);
            var val1 = upstream.retrieveValueFromItem(item1, orderDef.dimIdx);
            if (orderDef.parser) {
              val0 = orderDef.parser(val0);
              val1 = orderDef.parser(val1);
            }
            var result = orderDef.comparator.evaluate(val0, val1);
            if (result !== 0) {
              return result;
            }
          }
          return 0;
        });
        return {
          data: resultData
        };
      }
    };
    function install$1(registers) {
      registers.registerTransform(filterTransform);
      registers.registerTransform(sortTransform);
    }
    var DatasetModel = (
      /** @class */
      function(_super) {
        __extends$1(DatasetModel2, _super);
        function DatasetModel2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "dataset";
          return _this;
        }
        DatasetModel2.prototype.init = function(option, parentModel, ecModel) {
          _super.prototype.init.call(this, option, parentModel, ecModel);
          this._sourceManager = new SourceManager(this);
          disableTransformOptionMerge(this);
        };
        DatasetModel2.prototype.mergeOption = function(newOption, ecModel) {
          _super.prototype.mergeOption.call(this, newOption, ecModel);
          disableTransformOptionMerge(this);
        };
        DatasetModel2.prototype.optionUpdated = function() {
          this._sourceManager.dirty();
        };
        DatasetModel2.prototype.getSourceManager = function() {
          return this._sourceManager;
        };
        DatasetModel2.type = "dataset";
        DatasetModel2.defaultOption = {
          seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN
        };
        return DatasetModel2;
      }(ComponentModel)
    );
    var DatasetView = (
      /** @class */
      function(_super) {
        __extends$1(DatasetView2, _super);
        function DatasetView2() {
          var _this = _super !== null && _super.apply(this, arguments) || this;
          _this.type = "dataset";
          return _this;
        }
        DatasetView2.type = "dataset";
        return DatasetView2;
      }(ComponentView)
    );
    function install(registers) {
      registers.registerComponentModel(DatasetModel);
      registers.registerComponentView(DatasetView);
    }
    var CMD = PathProxy.CMD;
    function aroundEqual(a2, b2) {
      return Math.abs(a2 - b2) < 1e-5;
    }
    function pathToBezierCurves(path) {
      var data = path.data;
      var len2 = path.len();
      var bezierArrayGroups = [];
      var currentSubpath;
      var xi = 0;
      var yi = 0;
      var x0 = 0;
      var y0 = 0;
      function createNewSubpath(x3, y) {
        if (currentSubpath && currentSubpath.length > 2) {
          bezierArrayGroups.push(currentSubpath);
        }
        currentSubpath = [x3, y];
      }
      function addLine(x02, y02, x12, y12) {
        if (!(aroundEqual(x02, x12) && aroundEqual(y02, y12))) {
          currentSubpath.push(x02, y02, x12, y12, x12, y12);
        }
      }
      function addArc(startAngle2, endAngle2, cx2, cy2, rx2, ry2) {
        var delta = Math.abs(endAngle2 - startAngle2);
        var len3 = Math.tan(delta / 4) * 4 / 3;
        var dir3 = endAngle2 < startAngle2 ? -1 : 1;
        var c1 = Math.cos(startAngle2);
        var s1 = Math.sin(startAngle2);
        var c2 = Math.cos(endAngle2);
        var s2 = Math.sin(endAngle2);
        var x12 = c1 * rx2 + cx2;
        var y12 = s1 * ry2 + cy2;
        var x4 = c2 * rx2 + cx2;
        var y4 = s2 * ry2 + cy2;
        var hx = rx2 * len3 * dir3;
        var hy = ry2 * len3 * dir3;
        currentSubpath.push(x12 - hx * s1, y12 + hy * c1, x4 + hx * s2, y4 - hy * c2, x4, y4);
      }
      var x1;
      var y1;
      var x2;
      var y2;
      for (var i2 = 0; i2 < len2; ) {
        var cmd = data[i2++];
        var isFirst = i2 === 1;
        if (isFirst) {
          xi = data[i2];
          yi = data[i2 + 1];
          x0 = xi;
          y0 = yi;
          if (cmd === CMD.L || cmd === CMD.C || cmd === CMD.Q) {
            currentSubpath = [x0, y0];
          }
        }
        switch (cmd) {
          case CMD.M:
            xi = x0 = data[i2++];
            yi = y0 = data[i2++];
            createNewSubpath(x0, y0);
            break;
          case CMD.L:
            x1 = data[i2++];
            y1 = data[i2++];
            addLine(xi, yi, x1, y1);
            xi = x1;
            yi = y1;
            break;
          case CMD.C:
            currentSubpath.push(data[i2++], data[i2++], data[i2++], data[i2++], xi = data[i2++], yi = data[i2++]);
            break;
          case CMD.Q:
            x1 = data[i2++];
            y1 = data[i2++];
            x2 = data[i2++];
            y2 = data[i2++];
            currentSubpath.push(xi + 2 / 3 * (x1 - xi), yi + 2 / 3 * (y1 - yi), x2 + 2 / 3 * (x1 - x2), y2 + 2 / 3 * (y1 - y2), x2, y2);
            xi = x2;
            yi = y2;
            break;
          case CMD.A:
            var cx = data[i2++];
            var cy = data[i2++];
            var rx = data[i2++];
            var ry = data[i2++];
            var startAngle = data[i2++];
            var endAngle = data[i2++] + startAngle;
            i2 += 1;
            var anticlockwise = !data[i2++];
            x1 = Math.cos(startAngle) * rx + cx;
            y1 = Math.sin(startAngle) * ry + cy;
            if (isFirst) {
              x0 = x1;
              y0 = y1;
              createNewSubpath(x0, y0);
            } else {
              addLine(xi, yi, x1, y1);
            }
            xi = Math.cos(endAngle) * rx + cx;
            yi = Math.sin(endAngle) * ry + cy;
            var step = (anticlockwise ? -1 : 1) * Math.PI / 2;
            for (var angle2 = startAngle; anticlockwise ? angle2 > endAngle : angle2 < endAngle; angle2 += step) {
              var nextAngle = anticlockwise ? Math.max(angle2 + step, endAngle) : Math.min(angle2 + step, endAngle);
              addArc(angle2, nextAngle, cx, cy, rx, ry);
            }
            break;
          case CMD.R:
            x0 = xi = data[i2++];
            y0 = yi = data[i2++];
            x1 = x0 + data[i2++];
            y1 = y0 + data[i2++];
            createNewSubpath(x1, y0);
            addLine(x1, y0, x1, y1);
            addLine(x1, y1, x0, y1);
            addLine(x0, y1, x0, y0);
            addLine(x0, y0, x1, y0);
            break;
          case CMD.Z:
            currentSubpath && addLine(xi, yi, x0, y0);
            xi = x0;
            yi = y0;
            break;
        }
      }
      if (currentSubpath && currentSubpath.length > 2) {
        bezierArrayGroups.push(currentSubpath);
      }
      return bezierArrayGroups;
    }
    function adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, out2, scale2) {
      if (aroundEqual(x0, x1) && aroundEqual(y0, y1) && aroundEqual(x2, x3) && aroundEqual(y2, y3)) {
        out2.push(x3, y3);
        return;
      }
      var PIXEL_DISTANCE = 2 / scale2;
      var PIXEL_DISTANCE_SQR = PIXEL_DISTANCE * PIXEL_DISTANCE;
      var dx = x3 - x0;
      var dy = y3 - y0;
      var d2 = Math.sqrt(dx * dx + dy * dy);
      dx /= d2;
      dy /= d2;
      var dx1 = x1 - x0;
      var dy1 = y1 - y0;
      var dx2 = x2 - x3;
      var dy2 = y2 - y3;
      var cp1LenSqr = dx1 * dx1 + dy1 * dy1;
      var cp2LenSqr = dx2 * dx2 + dy2 * dy2;
      if (cp1LenSqr < PIXEL_DISTANCE_SQR && cp2LenSqr < PIXEL_DISTANCE_SQR) {
        out2.push(x3, y3);
        return;
      }
      var projLen1 = dx * dx1 + dy * dy1;
      var projLen2 = -dx * dx2 - dy * dy2;
      var d1Sqr = cp1LenSqr - projLen1 * projLen1;
      var d2Sqr = cp2LenSqr - projLen2 * projLen2;
      if (d1Sqr < PIXEL_DISTANCE_SQR && projLen1 >= 0 && d2Sqr < PIXEL_DISTANCE_SQR && projLen2 >= 0) {
        out2.push(x3, y3);
        return;
      }
      var tmpSegX = [];
      var tmpSegY = [];
      cubicSubdivide(x0, x1, x2, x3, 0.5, tmpSegX);
      cubicSubdivide(y0, y1, y2, y3, 0.5, tmpSegY);
      adpativeBezier(tmpSegX[0], tmpSegY[0], tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], tmpSegX[3], tmpSegY[3], out2, scale2);
      adpativeBezier(tmpSegX[4], tmpSegY[4], tmpSegX[5], tmpSegY[5], tmpSegX[6], tmpSegY[6], tmpSegX[7], tmpSegY[7], out2, scale2);
    }
    function pathToPolygons(path, scale2) {
      var bezierArrayGroups = pathToBezierCurves(path);
      var polygons = [];
      scale2 = scale2 || 1;
      for (var i2 = 0; i2 < bezierArrayGroups.length; i2++) {
        var beziers = bezierArrayGroups[i2];
        var polygon = [];
        var x0 = beziers[0];
        var y0 = beziers[1];
        polygon.push(x0, y0);
        for (var k2 = 2; k2 < beziers.length; ) {
          var x1 = beziers[k2++];
          var y1 = beziers[k2++];
          var x2 = beziers[k2++];
          var y2 = beziers[k2++];
          var x3 = beziers[k2++];
          var y3 = beziers[k2++];
          adpativeBezier(x0, y0, x1, y1, x2, y2, x3, y3, polygon, scale2);
          x0 = x3;
          y0 = y3;
        }
        polygons.push(polygon);
      }
      return polygons;
    }
    function getDividingGrids(dimSize, rowDim, count2) {
      var rowSize = dimSize[rowDim];
      var columnSize = dimSize[1 - rowDim];
      var ratio = Math.abs(rowSize / columnSize);
      var rowCount = Math.ceil(Math.sqrt(ratio * count2));
      var columnCount = Math.floor(count2 / rowCount);
      if (columnCount === 0) {
        columnCount = 1;
        rowCount = count2;
      }
      var grids = [];
      for (var i2 = 0; i2 < rowCount; i2++) {
        grids.push(columnCount);
      }
      var currentCount = rowCount * columnCount;
      var remained = count2 - currentCount;
      if (remained > 0) {
        for (var i2 = 0; i2 < remained; i2++) {
          grids[i2 % rowCount] += 1;
        }
      }
      return grids;
    }
    function divideSector(sectorShape, count2, outShapes) {
      var r0 = sectorShape.r0;
      var r = sectorShape.r;
      var startAngle = sectorShape.startAngle;
      var endAngle = sectorShape.endAngle;
      var angle2 = Math.abs(endAngle - startAngle);
      var arcLen = angle2 * r;
      var deltaR = r - r0;
      var isAngleRow = arcLen > Math.abs(deltaR);
      var grids = getDividingGrids([arcLen, deltaR], isAngleRow ? 0 : 1, count2);
      var rowSize = (isAngleRow ? angle2 : deltaR) / grids.length;
      for (var row = 0; row < grids.length; row++) {
        var columnSize = (isAngleRow ? deltaR : angle2) / grids[row];
        for (var column = 0; column < grids[row]; column++) {
          var newShape = {};
          if (isAngleRow) {
            newShape.startAngle = startAngle + rowSize * row;
            newShape.endAngle = startAngle + rowSize * (row + 1);
            newShape.r0 = r0 + columnSize * column;
            newShape.r = r0 + columnSize * (column + 1);
          } else {
            newShape.startAngle = startAngle + columnSize * column;
            newShape.endAngle = startAngle + columnSize * (column + 1);
            newShape.r0 = r0 + rowSize * row;
            newShape.r = r0 + rowSize * (row + 1);
          }
          newShape.clockwise = sectorShape.clockwise;
          newShape.cx = sectorShape.cx;
          newShape.cy = sectorShape.cy;
          outShapes.push(newShape);
        }
      }
    }
    function divideRect(rectShape, count2, outShapes) {
      var width = rectShape.width;
      var height = rectShape.height;
      var isHorizontalRow = width > height;
      var grids = getDividingGrids([width, height], isHorizontalRow ? 0 : 1, count2);
      var rowSizeDim = isHorizontalRow ? "width" : "height";
      var columnSizeDim = isHorizontalRow ? "height" : "width";
      var rowDim = isHorizontalRow ? "x" : "y";
      var columnDim = isHorizontalRow ? "y" : "x";
      var rowSize = rectShape[rowSizeDim] / grids.length;
      for (var row = 0; row < grids.length; row++) {
        var columnSize = rectShape[columnSizeDim] / grids[row];
        for (var column = 0; column < grids[row]; column++) {
          var newShape = {};
          newShape[rowDim] = row * rowSize;
          newShape[columnDim] = column * columnSize;
          newShape[rowSizeDim] = rowSize;
          newShape[columnSizeDim] = columnSize;
          newShape.x += rectShape.x;
          newShape.y += rectShape.y;
          outShapes.push(newShape);
        }
      }
    }
    function crossProduct2d(x1, y1, x2, y2) {
      return x1 * y2 - x2 * y1;
    }
    function lineLineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) {
      var mx = a2x - a1x;
      var my = a2y - a1y;
      var nx = b2x - b1x;
      var ny = b2y - b1y;
      var nmCrossProduct = crossProduct2d(nx, ny, mx, my);
      if (Math.abs(nmCrossProduct) < 1e-6) {
        return null;
      }
      var b1a1x = a1x - b1x;
      var b1a1y = a1y - b1y;
      var p2 = crossProduct2d(b1a1x, b1a1y, nx, ny) / nmCrossProduct;
      if (p2 < 0 || p2 > 1) {
        return null;
      }
      return new Point(p2 * mx + a1x, p2 * my + a1y);
    }
    function projPtOnLine(pt3, lineA, lineB) {
      var dir3 = new Point();
      Point.sub(dir3, lineB, lineA);
      dir3.normalize();
      var dir22 = new Point();
      Point.sub(dir22, pt3, lineA);
      var len2 = dir22.dot(dir3);
      return len2;
    }
    function addToPoly(poly, pt3) {
      var last2 = poly[poly.length - 1];
      if (last2 && last2[0] === pt3[0] && last2[1] === pt3[1]) {
        return;
      }
      poly.push(pt3);
    }
    function splitPolygonByLine(points2, lineA, lineB) {
      var len2 = points2.length;
      var intersections = [];
      for (var i2 = 0; i2 < len2; i2++) {
        var p0 = points2[i2];
        var p1 = points2[(i2 + 1) % len2];
        var intersectionPt = lineLineIntersect(p0[0], p0[1], p1[0], p1[1], lineA.x, lineA.y, lineB.x, lineB.y);
        if (intersectionPt) {
          intersections.push({
            projPt: projPtOnLine(intersectionPt, lineA, lineB),
            pt: intersectionPt,
            idx: i2
          });
        }
      }
      if (intersections.length < 2) {
        return [{ points: points2 }, { points: points2 }];
      }
      intersections.sort(function(a2, b2) {
        return a2.projPt - b2.projPt;
      });
      var splitPt0 = intersections[0];
      var splitPt1 = intersections[intersections.length - 1];
      if (splitPt1.idx < splitPt0.idx) {
        var tmp = splitPt0;
        splitPt0 = splitPt1;
        splitPt1 = tmp;
      }
      var splitPt0Arr = [splitPt0.pt.x, splitPt0.pt.y];
      var splitPt1Arr = [splitPt1.pt.x, splitPt1.pt.y];
      var newPolyA = [splitPt0Arr];
      var newPolyB = [splitPt1Arr];
      for (var i2 = splitPt0.idx + 1; i2 <= splitPt1.idx; i2++) {
        addToPoly(newPolyA, points2[i2].slice());
      }
      addToPoly(newPolyA, splitPt1Arr);
      addToPoly(newPolyA, splitPt0Arr);
      for (var i2 = splitPt1.idx + 1; i2 <= splitPt0.idx + len2; i2++) {
        addToPoly(newPolyB, points2[i2 % len2].slice());
      }
      addToPoly(newPolyB, splitPt0Arr);
      addToPoly(newPolyB, splitPt1Arr);
      return [{
        points: newPolyA
      }, {
        points: newPolyB
      }];
    }
    function binaryDividePolygon(polygonShape) {
      var points2 = polygonShape.points;
      var min3 = [];
      var max3 = [];
      fromPoints(points2, min3, max3);
      var boundingRect = new BoundingRect(min3[0], min3[1], max3[0] - min3[0], max3[1] - min3[1]);
      var width = boundingRect.width;
      var height = boundingRect.height;
      var x2 = boundingRect.x;
      var y = boundingRect.y;
      var pt02 = new Point();
      var pt12 = new Point();
      if (width > height) {
        pt02.x = pt12.x = x2 + width / 2;
        pt02.y = y;
        pt12.y = y + height;
      } else {
        pt02.y = pt12.y = y + height / 2;
        pt02.x = x2;
        pt12.x = x2 + width;
      }
      return splitPolygonByLine(points2, pt02, pt12);
    }
    function binaryDivideRecursive(divider, shape, count2, out2) {
      if (count2 === 1) {
        out2.push(shape);
      } else {
        var mid = Math.floor(count2 / 2);
        var sub2 = divider(shape);
        binaryDivideRecursive(divider, sub2[0], mid, out2);
        binaryDivideRecursive(divider, sub2[1], count2 - mid, out2);
      }
      return out2;
    }
    function clone(path, count2) {
      var paths = [];
      for (var i2 = 0; i2 < count2; i2++) {
        paths.push(clonePath(path));
      }
      return paths;
    }
    function copyPathProps(source, target) {
      target.setStyle(source.style);
      target.z = source.z;
      target.z2 = source.z2;
      target.zlevel = source.zlevel;
    }
    function polygonConvert(points2) {
      var out2 = [];
      for (var i2 = 0; i2 < points2.length; ) {
        out2.push([points2[i2++], points2[i2++]]);
      }
      return out2;
    }
    function split(path, count2) {
      var outShapes = [];
      var shape = path.shape;
      var OutShapeCtor;
      switch (path.type) {
        case "rect":
          divideRect(shape, count2, outShapes);
          OutShapeCtor = Rect$2;
          break;
        case "sector":
          divideSector(shape, count2, outShapes);
          OutShapeCtor = Sector;
          break;
        case "circle":
          divideSector({
            r0: 0,
            r: shape.r,
            startAngle: 0,
            endAngle: Math.PI * 2,
            cx: shape.cx,
            cy: shape.cy
          }, count2, outShapes);
          OutShapeCtor = Sector;
          break;
        default:
          var m2 = path.getComputedTransform();
          var scale2 = m2 ? Math.sqrt(Math.max(m2[0] * m2[0] + m2[1] * m2[1], m2[2] * m2[2] + m2[3] * m2[3])) : 1;
          var polygons = map$1(pathToPolygons(path.getUpdatedPathProxy(), scale2), function(poly) {
            return polygonConvert(poly);
          });
          var polygonCount = polygons.length;
          if (polygonCount === 0) {
            binaryDivideRecursive(binaryDividePolygon, {
              points: polygons[0]
            }, count2, outShapes);
          } else if (polygonCount === count2) {
            for (var i2 = 0; i2 < polygonCount; i2++) {
              outShapes.push({
                points: polygons[i2]
              });
            }
          } else {
            var totalArea_1 = 0;
            var items = map$1(polygons, function(poly) {
              var min3 = [];
              var max3 = [];
              fromPoints(poly, min3, max3);
              var area = (max3[1] - min3[1]) * (max3[0] - min3[0]);
              totalArea_1 += area;
              return { poly, area };
            });
            items.sort(function(a2, b2) {
              return b2.area - a2.area;
            });
            var left = count2;
            for (var i2 = 0; i2 < polygonCount; i2++) {
              var item = items[i2];
              if (left <= 0) {
                break;
              }
              var selfCount = i2 === polygonCount - 1 ? left : Math.ceil(item.area / totalArea_1 * count2);
              if (selfCount < 0) {
                continue;
              }
              binaryDivideRecursive(binaryDividePolygon, {
                points: item.poly
              }, selfCount, outShapes);
              left -= selfCount;
            }
          }
          OutShapeCtor = Polygon;
          break;
      }
      if (!OutShapeCtor) {
        return clone(path, count2);
      }
      var out2 = [];
      for (var i2 = 0; i2 < outShapes.length; i2++) {
        var subPath = new OutShapeCtor();
        subPath.setShape(outShapes[i2]);
        copyPathProps(path, subPath);
        out2.push(subPath);
      }
      return out2;
    }
    function alignSubpath(subpath1, subpath2) {
      var len1 = subpath1.length;
      var len2 = subpath2.length;
      if (len1 === len2) {
        return [subpath1, subpath2];
      }
      var tmpSegX = [];
      var tmpSegY = [];
      var shorterPath = len1 < len2 ? subpath1 : subpath2;
      var shorterLen = Math.min(len1, len2);
      var diff = Math.abs(len2 - len1) / 6;
      var shorterBezierCount = (shorterLen - 2) / 6;
      var eachCurveSubDivCount = Math.ceil(diff / shorterBezierCount) + 1;
      var newSubpath = [shorterPath[0], shorterPath[1]];
      var remained = diff;
      for (var i2 = 2; i2 < shorterLen; ) {
        var x0 = shorterPath[i2 - 2];
        var y0 = shorterPath[i2 - 1];
        var x1 = shorterPath[i2++];
        var y1 = shorterPath[i2++];
        var x2 = shorterPath[i2++];
        var y2 = shorterPath[i2++];
        var x3 = shorterPath[i2++];
        var y3 = shorterPath[i2++];
        if (remained <= 0) {
          newSubpath.push(x1, y1, x2, y2, x3, y3);
          continue;
        }
        var actualSubDivCount = Math.min(remained, eachCurveSubDivCount - 1) + 1;
        for (var k2 = 1; k2 <= actualSubDivCount; k2++) {
          var p2 = k2 / actualSubDivCount;
          cubicSubdivide(x0, x1, x2, x3, p2, tmpSegX);
          cubicSubdivide(y0, y1, y2, y3, p2, tmpSegY);
          x0 = tmpSegX[3];
          y0 = tmpSegY[3];
          newSubpath.push(tmpSegX[1], tmpSegY[1], tmpSegX[2], tmpSegY[2], x0, y0);
          x1 = tmpSegX[5];
          y1 = tmpSegY[5];
          x2 = tmpSegX[6];
          y2 = tmpSegY[6];
        }
        remained -= actualSubDivCount - 1;
      }
      return shorterPath === subpath1 ? [newSubpath, subpath2] : [subpath1, newSubpath];
    }
    function createSubpath(lastSubpathSubpath, otherSubpath) {
      var len2 = lastSubpathSubpath.length;
      var lastX = lastSubpathSubpath[len2 - 2];
      var lastY = lastSubpathSubpath[len2 - 1];
      var newSubpath = [];
      for (var i2 = 0; i2 < otherSubpath.length; ) {
        newSubpath[i2++] = lastX;
        newSubpath[i2++] = lastY;
      }
      return newSubpath;
    }
    function alignBezierCurves(array1, array22) {
      var _a2;
      var lastSubpath1;
      var lastSubpath2;
      var newArray1 = [];
      var newArray2 = [];
      for (var i2 = 0; i2 < Math.max(array1.length, array22.length); i2++) {
        var subpath1 = array1[i2];
        var subpath2 = array22[i2];
        var newSubpath1 = void 0;
        var newSubpath2 = void 0;
        if (!subpath1) {
          newSubpath1 = createSubpath(lastSubpath1 || subpath2, subpath2);
          newSubpath2 = subpath2;
        } else if (!subpath2) {
          newSubpath2 = createSubpath(lastSubpath2 || subpath1, subpath1);
          newSubpath1 = subpath1;
        } else {
          _a2 = alignSubpath(subpath1, subpath2), newSubpath1 = _a2[0], newSubpath2 = _a2[1];
          lastSubpath1 = newSubpath1;
          lastSubpath2 = newSubpath2;
        }
        newArray1.push(newSubpath1);
        newArray2.push(newSubpath2);
      }
      return [newArray1, newArray2];
    }
    function centroid(array) {
      var signedArea = 0;
      var cx = 0;
      var cy = 0;
      var len2 = array.length;
      for (var i2 = 0, j = len2 - 2; i2 < len2; j = i2, i2 += 2) {
        var x0 = array[j];
        var y0 = array[j + 1];
        var x1 = array[i2];
        var y1 = array[i2 + 1];
        var a2 = x0 * y1 - x1 * y0;
        signedArea += a2;
        cx += (x0 + x1) * a2;
        cy += (y0 + y1) * a2;
      }
      if (signedArea === 0) {
        return [array[0] || 0, array[1] || 0];
      }
      return [cx / signedArea / 3, cy / signedArea / 3, signedArea];
    }
    function findBestRingOffset(fromSubBeziers, toSubBeziers, fromCp, toCp) {
      var bezierCount = (fromSubBeziers.length - 2) / 6;
      var bestScore = Infinity;
      var bestOffset = 0;
      var len2 = fromSubBeziers.length;
      var len22 = len2 - 2;
      for (var offset2 = 0; offset2 < bezierCount; offset2++) {
        var cursorOffset = offset2 * 6;
        var score = 0;
        for (var k2 = 0; k2 < len2; k2 += 2) {
          var idx = k2 === 0 ? cursorOffset : (cursorOffset + k2 - 2) % len22 + 2;
          var x0 = fromSubBeziers[idx] - fromCp[0];
          var y0 = fromSubBeziers[idx + 1] - fromCp[1];
          var x1 = toSubBeziers[k2] - toCp[0];
          var y1 = toSubBeziers[k2 + 1] - toCp[1];
          var dx = x1 - x0;
          var dy = y1 - y0;
          score += dx * dx + dy * dy;
        }
        if (score < bestScore) {
          bestScore = score;
          bestOffset = offset2;
        }
      }
      return bestOffset;
    }
    function reverse(array) {
      var newArr = [];
      var len2 = array.length;
      for (var i2 = 0; i2 < len2; i2 += 2) {
        newArr[i2] = array[len2 - i2 - 2];
        newArr[i2 + 1] = array[len2 - i2 - 1];
      }
      return newArr;
    }
    function findBestMorphingRotation(fromArr, toArr2, searchAngleIteration, searchAngleRange) {
      var result = [];
      var fromNeedsReverse;
      for (var i2 = 0; i2 < fromArr.length; i2++) {
        var fromSubpathBezier = fromArr[i2];
        var toSubpathBezier = toArr2[i2];
        var fromCp = centroid(fromSubpathBezier);
        var toCp = centroid(toSubpathBezier);
        if (fromNeedsReverse == null) {
          fromNeedsReverse = fromCp[2] < 0 !== toCp[2] < 0;
        }
        var newFromSubpathBezier = [];
        var newToSubpathBezier = [];
        var bestAngle = 0;
        var bestScore = Infinity;
        var tmpArr2 = [];
        var len2 = fromSubpathBezier.length;
        if (fromNeedsReverse) {
          fromSubpathBezier = reverse(fromSubpathBezier);
        }
        var offset2 = findBestRingOffset(fromSubpathBezier, toSubpathBezier, fromCp, toCp) * 6;
        var len22 = len2 - 2;
        for (var k2 = 0; k2 < len22; k2 += 2) {
          var idx = (offset2 + k2) % len22 + 2;
          newFromSubpathBezier[k2 + 2] = fromSubpathBezier[idx] - fromCp[0];
          newFromSubpathBezier[k2 + 3] = fromSubpathBezier[idx + 1] - fromCp[1];
        }
        newFromSubpathBezier[0] = fromSubpathBezier[offset2] - fromCp[0];
        newFromSubpathBezier[1] = fromSubpathBezier[offset2 + 1] - fromCp[1];
        {
          var step = searchAngleRange / searchAngleIteration;
          for (var angle2 = -searchAngleRange / 2; angle2 <= searchAngleRange / 2; angle2 += step) {
            var sa = Math.sin(angle2);
            var ca = Math.cos(angle2);
            var score = 0;
            for (var k2 = 0; k2 < fromSubpathBezier.length; k2 += 2) {
              var x0 = newFromSubpathBezier[k2];
              var y0 = newFromSubpathBezier[k2 + 1];
              var x1 = toSubpathBezier[k2] - toCp[0];
              var y1 = toSubpathBezier[k2 + 1] - toCp[1];
              var newX1 = x1 * ca - y1 * sa;
              var newY1 = x1 * sa + y1 * ca;
              tmpArr2[k2] = newX1;
              tmpArr2[k2 + 1] = newY1;
              var dx = newX1 - x0;
              var dy = newY1 - y0;
              score += dx * dx + dy * dy;
            }
            if (score < bestScore) {
              bestScore = score;
              bestAngle = angle2;
              for (var m2 = 0; m2 < tmpArr2.length; m2++) {
                newToSubpathBezier[m2] = tmpArr2[m2];
              }
            }
          }
        }
        result.push({
          from: newFromSubpathBezier,
          to: newToSubpathBezier,
          fromCp,
          toCp,
          rotation: -bestAngle
        });
      }
      return result;
    }
    function isCombineMorphing(path) {
      return path.__isCombineMorphing;
    }
    var SAVED_METHOD_PREFIX = "__mOriginal_";
    function saveAndModifyMethod(obj, methodName, modifiers) {
      var savedMethodName = SAVED_METHOD_PREFIX + methodName;
      var originalMethod = obj[savedMethodName] || obj[methodName];
      if (!obj[savedMethodName]) {
        obj[savedMethodName] = obj[methodName];
      }
      var replace = modifiers.replace;
      var after = modifiers.after;
      var before = modifiers.before;
      obj[methodName] = function() {
        var args = arguments;
        var res;
        before && before.apply(this, args);
        if (replace) {
          res = replace.apply(this, args);
        } else {
          res = originalMethod.apply(this, args);
        }
        after && after.apply(this, args);
        return res;
      };
    }
    function restoreMethod(obj, methodName) {
      var savedMethodName = SAVED_METHOD_PREFIX + methodName;
      if (obj[savedMethodName]) {
        obj[methodName] = obj[savedMethodName];
        obj[savedMethodName] = null;
      }
    }
    function applyTransformOnBeziers(bezierCurves, mm) {
      for (var i2 = 0; i2 < bezierCurves.length; i2++) {
        var subBeziers = bezierCurves[i2];
        for (var k2 = 0; k2 < subBeziers.length; ) {
          var x2 = subBeziers[k2];
          var y = subBeziers[k2 + 1];
          subBeziers[k2++] = mm[0] * x2 + mm[2] * y + mm[4];
          subBeziers[k2++] = mm[1] * x2 + mm[3] * y + mm[5];
        }
      }
    }
    function prepareMorphPath(fromPath, toPath) {
      var fromPathProxy = fromPath.getUpdatedPathProxy();
      var toPathProxy = toPath.getUpdatedPathProxy();
      var _a2 = alignBezierCurves(pathToBezierCurves(fromPathProxy), pathToBezierCurves(toPathProxy)), fromBezierCurves = _a2[0], toBezierCurves = _a2[1];
      var fromPathTransform = fromPath.getComputedTransform();
      var toPathTransform = toPath.getComputedTransform();
      function updateIdentityTransform() {
        this.transform = null;
      }
      fromPathTransform && applyTransformOnBeziers(fromBezierCurves, fromPathTransform);
      toPathTransform && applyTransformOnBeziers(toBezierCurves, toPathTransform);
      saveAndModifyMethod(toPath, "updateTransform", { replace: updateIdentityTransform });
      toPath.transform = null;
      var morphingData = findBestMorphingRotation(fromBezierCurves, toBezierCurves, 10, Math.PI);
      var tmpArr2 = [];
      saveAndModifyMethod(toPath, "buildPath", { replace: function(path) {
        var t = toPath.__morphT;
        var onet = 1 - t;
        var newCp = [];
        for (var i2 = 0; i2 < morphingData.length; i2++) {
          var item = morphingData[i2];
          var from = item.from;
          var to = item.to;
          var angle2 = item.rotation * t;
          var fromCp = item.fromCp;
          var toCp = item.toCp;
          var sa = Math.sin(angle2);
          var ca = Math.cos(angle2);
          lerp$2(newCp, fromCp, toCp, t);
          for (var m2 = 0; m2 < from.length; m2 += 2) {
            var x0_1 = from[m2];
            var y0_1 = from[m2 + 1];
            var x1 = to[m2];
            var y1 = to[m2 + 1];
            var x2 = x0_1 * onet + x1 * t;
            var y = y0_1 * onet + y1 * t;
            tmpArr2[m2] = x2 * ca - y * sa + newCp[0];
            tmpArr2[m2 + 1] = x2 * sa + y * ca + newCp[1];
          }
          var x0 = tmpArr2[0];
          var y0 = tmpArr2[1];
          path.moveTo(x0, y0);
          for (var m2 = 2; m2 < from.length; ) {
            var x1 = tmpArr2[m2++];
            var y1 = tmpArr2[m2++];
            var x22 = tmpArr2[m2++];
            var y2 = tmpArr2[m2++];
            var x3 = tmpArr2[m2++];
            var y3 = tmpArr2[m2++];
            if (x0 === x1 && y0 === y1 && x22 === x3 && y2 === y3) {
              path.lineTo(x3, y3);
            } else {
              path.bezierCurveTo(x1, y1, x22, y2, x3, y3);
            }
            x0 = x3;
            y0 = y3;
          }
        }
      } });
    }
    function morphPath(fromPath, toPath, animationOpts) {
      if (!fromPath || !toPath) {
        return toPath;
      }
      var oldDone = animationOpts.done;
      var oldDuring = animationOpts.during;
      prepareMorphPath(fromPath, toPath);
      toPath.__morphT = 0;
      function restoreToPath() {
        restoreMethod(toPath, "buildPath");
        restoreMethod(toPath, "updateTransform");
        toPath.__morphT = -1;
        toPath.createPathProxy();
        toPath.dirtyShape();
      }
      toPath.animateTo({
        __morphT: 1
      }, defaults$1({
        during: function(p2) {
          toPath.dirtyShape();
          oldDuring && oldDuring(p2);
        },
        done: function() {
          restoreToPath();
          oldDone && oldDone();
        }
      }, animationOpts));
      return toPath;
    }
    function hilbert(x2, y, minX, minY, maxX, maxY) {
      var bits = 16;
      x2 = maxX === minX ? 0 : Math.round(32767 * (x2 - minX) / (maxX - minX));
      y = maxY === minY ? 0 : Math.round(32767 * (y - minY) / (maxY - minY));
      var d2 = 0;
      var tmp;
      for (var s2 = (1 << bits) / 2; s2 > 0; s2 /= 2) {
        var rx = 0;
        var ry = 0;
        if ((x2 & s2) > 0) {
          rx = 1;
        }
        if ((y & s2) > 0) {
          ry = 1;
        }
        d2 += s2 * s2 * (3 * rx ^ ry);
        if (ry === 0) {
          if (rx === 1) {
            x2 = s2 - 1 - x2;
            y = s2 - 1 - y;
          }
          tmp = x2;
          x2 = y;
          y = tmp;
        }
      }
      return d2;
    }
    function sortPaths(pathList) {
      var xMin = Infinity;
      var yMin = Infinity;
      var xMax = -Infinity;
      var yMax = -Infinity;
      var cps = map$1(pathList, function(path) {
        var rect = path.getBoundingRect();
        var m2 = path.getComputedTransform();
        var x2 = rect.x + rect.width / 2 + (m2 ? m2[4] : 0);
        var y = rect.y + rect.height / 2 + (m2 ? m2[5] : 0);
        xMin = Math.min(x2, xMin);
        yMin = Math.min(y, yMin);
        xMax = Math.max(x2, xMax);
        yMax = Math.max(y, yMax);
        return [x2, y];
      });
      var items = map$1(cps, function(cp, idx) {
        return {
          cp,
          z: hilbert(cp[0], cp[1], xMin, yMin, xMax, yMax),
          path: pathList[idx]
        };
      });
      return items.sort(function(a2, b2) {
        return a2.z - b2.z;
      }).map(function(item) {
        return item.path;
      });
    }
    function defaultDividePath(param) {
      return split(param.path, param.count);
    }
    function createEmptyReturn() {
      return {
        fromIndividuals: [],
        toIndividuals: [],
        count: 0
      };
    }
    function combineMorph(fromList, toPath, animationOpts) {
      var fromPathList = [];
      function addFromPath(fromList2) {
        for (var i3 = 0; i3 < fromList2.length; i3++) {
          var from2 = fromList2[i3];
          if (isCombineMorphing(from2)) {
            addFromPath(from2.childrenRef());
          } else if (from2 instanceof Path) {
            fromPathList.push(from2);
          }
        }
      }
      addFromPath(fromList);
      var separateCount = fromPathList.length;
      if (!separateCount) {
        return createEmptyReturn();
      }
      var dividePath = animationOpts.dividePath || defaultDividePath;
      var toSubPathList = dividePath({
        path: toPath,
        count: separateCount
      });
      if (toSubPathList.length !== separateCount) {
        console.error("Invalid morphing: unmatched splitted path");
        return createEmptyReturn();
      }
      fromPathList = sortPaths(fromPathList);
      toSubPathList = sortPaths(toSubPathList);
      var oldDone = animationOpts.done;
      var oldDuring = animationOpts.during;
      var individualDelay = animationOpts.individualDelay;
      var identityTransform = new Transformable();
      for (var i2 = 0; i2 < separateCount; i2++) {
        var from = fromPathList[i2];
        var to = toSubPathList[i2];
        to.parent = toPath;
        to.copyTransform(identityTransform);
        if (!individualDelay) {
          prepareMorphPath(from, to);
        }
      }
      toPath.__isCombineMorphing = true;
      toPath.childrenRef = function() {
        return toSubPathList;
      };
      function addToSubPathListToZr(zr) {
        for (var i3 = 0; i3 < toSubPathList.length; i3++) {
          toSubPathList[i3].addSelfToZr(zr);
        }
      }
      saveAndModifyMethod(toPath, "addSelfToZr", {
        after: function(zr) {
          addToSubPathListToZr(zr);
        }
      });
      saveAndModifyMethod(toPath, "removeSelfFromZr", {
        after: function(zr) {
          for (var i3 = 0; i3 < toSubPathList.length; i3++) {
            toSubPathList[i3].removeSelfFromZr(zr);
          }
        }
      });
      function restoreToPath() {
        toPath.__isCombineMorphing = false;
        toPath.__morphT = -1;
        toPath.childrenRef = null;
        restoreMethod(toPath, "addSelfToZr");
        restoreMethod(toPath, "removeSelfFromZr");
      }
      var toLen = toSubPathList.length;
      if (individualDelay) {
        var animating_1 = toLen;
        var eachDone = function() {
          animating_1--;
          if (animating_1 === 0) {
            restoreToPath();
            oldDone && oldDone();
          }
        };
        for (var i2 = 0; i2 < toLen; i2++) {
          var indivdualAnimationOpts = individualDelay ? defaults$1({
            delay: (animationOpts.delay || 0) + individualDelay(i2, toLen, fromPathList[i2], toSubPathList[i2]),
            done: eachDone
          }, animationOpts) : animationOpts;
          morphPath(fromPathList[i2], toSubPathList[i2], indivdualAnimationOpts);
        }
      } else {
        toPath.__morphT = 0;
        toPath.animateTo({
          __morphT: 1
        }, defaults$1({
          during: function(p2) {
            for (var i3 = 0; i3 < toLen; i3++) {
              var child = toSubPathList[i3];
              child.__morphT = toPath.__morphT;
              child.dirtyShape();
            }
            oldDuring && oldDuring(p2);
          },
          done: function() {
            restoreToPath();
            for (var i3 = 0; i3 < fromList.length; i3++) {
              restoreMethod(fromList[i3], "updateTransform");
            }
            oldDone && oldDone();
          }
        }, animationOpts));
      }
      if (toPath.__zr) {
        addToSubPathListToZr(toPath.__zr);
      }
      return {
        fromIndividuals: fromPathList,
        toIndividuals: toSubPathList,
        count: toLen
      };
    }
    function separateMorph(fromPath, toPathList, animationOpts) {
      var toLen = toPathList.length;
      var fromPathList = [];
      var dividePath = animationOpts.dividePath || defaultDividePath;
      function addFromPath(fromList) {
        for (var i3 = 0; i3 < fromList.length; i3++) {
          var from = fromList[i3];
          if (isCombineMorphing(from)) {
            addFromPath(from.childrenRef());
          } else if (from instanceof Path) {
            fromPathList.push(from);
          }
        }
      }
      if (isCombineMorphing(fromPath)) {
        addFromPath(fromPath.childrenRef());
        var fromLen = fromPathList.length;
        if (fromLen < toLen) {
          var k2 = 0;
          for (var i2 = fromLen; i2 < toLen; i2++) {
            fromPathList.push(clonePath(fromPathList[k2++ % fromLen]));
          }
        }
        fromPathList.length = toLen;
      } else {
        fromPathList = dividePath({ path: fromPath, count: toLen });
        var fromPathTransform = fromPath.getComputedTransform();
        for (var i2 = 0; i2 < fromPathList.length; i2++) {
          fromPathList[i2].setLocalTransform(fromPathTransform);
        }
        if (fromPathList.length !== toLen) {
          console.error("Invalid morphing: unmatched splitted path");
          return createEmptyReturn();
        }
      }
      fromPathList = sortPaths(fromPathList);
      toPathList = sortPaths(toPathList);
      var individualDelay = animationOpts.individualDelay;
      for (var i2 = 0; i2 < toLen; i2++) {
        var indivdualAnimationOpts = individualDelay ? defaults$1({
          delay: (animationOpts.delay || 0) + individualDelay(i2, toLen, fromPathList[i2], toPathList[i2])
        }, animationOpts) : animationOpts;
        morphPath(fromPathList[i2], toPathList[i2], indivdualAnimationOpts);
      }
      return {
        fromIndividuals: fromPathList,
        toIndividuals: toPathList,
        count: toPathList.length
      };
    }
    function isMultiple(elements) {
      return isArray$2(elements[0]);
    }
    function prepareMorphBatches(one, many) {
      var batches = [];
      var batchCount = one.length;
      for (var i2 = 0; i2 < batchCount; i2++) {
        batches.push({
          one: one[i2],
          many: []
        });
      }
      for (var i2 = 0; i2 < many.length; i2++) {
        var len2 = many[i2].length;
        var k2 = void 0;
        for (k2 = 0; k2 < len2; k2++) {
          batches[k2 % batchCount].many.push(many[i2][k2]);
        }
      }
      var off = 0;
      for (var i2 = batchCount - 1; i2 >= 0; i2--) {
        if (!batches[i2].many.length) {
          var moveFrom = batches[off].many;
          if (moveFrom.length <= 1) {
            if (off) {
              off = 0;
            } else {
              return batches;
            }
          }
          var len2 = moveFrom.length;
          var mid = Math.ceil(len2 / 2);
          batches[i2].many = moveFrom.slice(mid, len2);
          batches[off].many = moveFrom.slice(0, mid);
          off++;
        }
      }
      return batches;
    }
    var pathDividers = {
      clone: function(params) {
        var ret = [];
        var approxOpacity = 1 - Math.pow(1 - params.path.style.opacity, 1 / params.count);
        for (var i2 = 0; i2 < params.count; i2++) {
          var cloned = clonePath(params.path);
          cloned.setStyle("opacity", approxOpacity);
          ret.push(cloned);
        }
        return ret;
      },
      // Use the default divider
      split: null
    };
    function applyMorphAnimation(from, to, divideShape, seriesModel, dataIndex, animateOtherProps) {
      if (!from.length || !to.length) {
        return;
      }
      var updateAnimationCfg = getAnimationConfig("update", seriesModel, dataIndex);
      if (!(updateAnimationCfg && updateAnimationCfg.duration > 0)) {
        return;
      }
      var animationDelay = seriesModel.getModel("universalTransition").get("delay");
      var animationCfg = Object.assign({
        // Need to setToFinal so the further calculation based on the style can be correct.
        // Like emphasis color.
        setToFinal: true
      }, updateAnimationCfg);
      var many;
      var one;
      if (isMultiple(from)) {
        many = from;
        one = to;
      }
      if (isMultiple(to)) {
        many = to;
        one = from;
      }
      function morphOneBatch(batch2, fromIsMany2, animateIndex2, animateCount2, forceManyOne) {
        var batchMany = batch2.many;
        var batchOne = batch2.one;
        if (batchMany.length === 1 && !forceManyOne) {
          var batchFrom = fromIsMany2 ? batchMany[0] : batchOne;
          var batchTo = fromIsMany2 ? batchOne : batchMany[0];
          if (isCombineMorphing(batchFrom)) {
            morphOneBatch({
              many: [batchFrom],
              one: batchTo
            }, true, animateIndex2, animateCount2, true);
          } else {
            var individualAnimationCfg = animationDelay ? defaults$1({
              delay: animationDelay(animateIndex2, animateCount2)
            }, animationCfg) : animationCfg;
            morphPath(batchFrom, batchTo, individualAnimationCfg);
            animateOtherProps(batchFrom, batchTo, batchFrom, batchTo, individualAnimationCfg);
          }
        } else {
          var separateAnimationCfg = defaults$1({
            dividePath: pathDividers[divideShape],
            individualDelay: animationDelay && function(idx, count3, fromPath, toPath) {
              return animationDelay(idx + animateIndex2, animateCount2);
            }
          }, animationCfg);
          var _a2 = fromIsMany2 ? combineMorph(batchMany, batchOne, separateAnimationCfg) : separateMorph(batchOne, batchMany, separateAnimationCfg), fromIndividuals = _a2.fromIndividuals, toIndividuals = _a2.toIndividuals;
          var count2 = fromIndividuals.length;
          for (var k2 = 0; k2 < count2; k2++) {
            var individualAnimationCfg = animationDelay ? defaults$1({
              delay: animationDelay(k2, count2)
            }, animationCfg) : animationCfg;
            animateOtherProps(fromIndividuals[k2], toIndividuals[k2], fromIsMany2 ? batchMany[k2] : batch2.one, fromIsMany2 ? batch2.one : batchMany[k2], individualAnimationCfg);
          }
        }
      }
      var fromIsMany = many ? many === from : from.length > to.length;
      var morphBatches = many ? prepareMorphBatches(one, many) : prepareMorphBatches(fromIsMany ? to : from, [fromIsMany ? from : to]);
      var animateCount = 0;
      for (var i2 = 0; i2 < morphBatches.length; i2++) {
        animateCount += morphBatches[i2].many.length;
      }
      var animateIndex = 0;
      for (var i2 = 0; i2 < morphBatches.length; i2++) {
        morphOneBatch(morphBatches[i2], fromIsMany, animateIndex, animateCount);
        animateIndex += morphBatches[i2].many.length;
      }
    }
    function getPathList(elements) {
      if (!elements) {
        return [];
      }
      if (isArray$2(elements)) {
        var pathList_1 = [];
        for (var i2 = 0; i2 < elements.length; i2++) {
          pathList_1.push(getPathList(elements[i2]));
        }
        return pathList_1;
      }
      var pathList = [];
      elements.traverse(function(el) {
        if (el instanceof Path && !el.disableMorphing && !el.invisible && !el.ignore) {
          pathList.push(el);
        }
      });
      return pathList;
    }
    var DATA_COUNT_THRESHOLD = 1e4;
    var TRANSITION_NONE = 0;
    var TRANSITION_P2C = 1;
    var TRANSITION_C2P = 2;
    var getUniversalTransitionGlobalStore = makeInner();
    function getDimension(data, visualDimension) {
      var dimensions = data.dimensions;
      for (var i2 = 0; i2 < dimensions.length; i2++) {
        var dimInfo = data.getDimensionInfo(dimensions[i2]);
        if (dimInfo && dimInfo.otherDims[visualDimension] === 0) {
          return dimensions[i2];
        }
      }
    }
    function getValueByDimension(data, dataIndex, dimension) {
      var dimInfo = data.getDimensionInfo(dimension);
      var dimOrdinalMeta = dimInfo && dimInfo.ordinalMeta;
      if (dimInfo) {
        var value = data.get(dimInfo.name, dataIndex);
        if (dimOrdinalMeta) {
          return dimOrdinalMeta.categories[value] || value + "";
        }
        return value + "";
      }
    }
    function getGroupId(data, dataIndex, dataGroupId, isChild) {
      var visualDimension = isChild ? "itemChildGroupId" : "itemGroupId";
      var groupIdDim = getDimension(data, visualDimension);
      if (groupIdDim) {
        var groupId = getValueByDimension(data, dataIndex, groupIdDim);
        return groupId;
      }
      var rawDataItem = data.getRawDataItem(dataIndex);
      var property2 = isChild ? "childGroupId" : "groupId";
      if (rawDataItem && rawDataItem[property2]) {
        return rawDataItem[property2] + "";
      }
      if (isChild) {
        return;
      }
      return dataGroupId || data.getId(dataIndex);
    }
    function flattenDataDiffItems(list) {
      var items = [];
      each$f(list, function(seriesInfo) {
        var data = seriesInfo.data;
        var dataGroupId = seriesInfo.dataGroupId;
        if (data.count() > DATA_COUNT_THRESHOLD) {
          return;
        }
        var indices = data.getIndices();
        for (var dataIndex = 0; dataIndex < indices.length; dataIndex++) {
          items.push({
            data,
            groupId: getGroupId(data, dataIndex, dataGroupId, false),
            childGroupId: getGroupId(data, dataIndex, dataGroupId, true),
            divide: seriesInfo.divide,
            dataIndex
          });
        }
      });
      return items;
    }
    function fadeInElement(newEl2, newSeries, newIndex) {
      newEl2.traverse(function(el) {
        if (el instanceof Path) {
          initProps(el, {
            style: {
              opacity: 0
            }
          }, newSeries, {
            dataIndex: newIndex,
            isFrom: true
          });
        }
      });
    }
    function removeEl(el) {
      if (el.parent) {
        var computedTransform = el.getComputedTransform();
        el.setLocalTransform(computedTransform);
        el.parent.remove(el);
      }
    }
    function stopAnimation(el) {
      el.stopAnimation();
      if (el.isGroup) {
        el.traverse(function(child) {
          child.stopAnimation();
        });
      }
    }
    function animateElementStyles(el, dataIndex, seriesModel) {
      var animationConfig = getAnimationConfig("update", seriesModel, dataIndex);
      animationConfig && el.traverse(function(child) {
        if (child instanceof Displayable) {
          var oldStyle = getOldStyle(child);
          if (oldStyle) {
            child.animateFrom({
              style: oldStyle
            }, animationConfig);
          }
        }
      });
    }
    function isAllIdSame(oldDiffItems, newDiffItems) {
      var len2 = oldDiffItems.length;
      if (len2 !== newDiffItems.length) {
        return false;
      }
      for (var i2 = 0; i2 < len2; i2++) {
        var oldItem = oldDiffItems[i2];
        var newItem = newDiffItems[i2];
        if (oldItem.data.getId(oldItem.dataIndex) !== newItem.data.getId(newItem.dataIndex)) {
          return false;
        }
      }
      return true;
    }
    function transitionBetween(oldList, newList, api2) {
      var oldDiffItems = flattenDataDiffItems(oldList);
      var newDiffItems = flattenDataDiffItems(newList);
      function updateMorphingPathProps(from, to, rawFrom, rawTo, animationCfg) {
        if (rawFrom || from) {
          to.animateFrom({
            style: rawFrom && rawFrom !== from ? extend$1(extend$1({}, rawFrom.style), from.style) : from.style
          }, animationCfg);
        }
      }
      var hasMorphAnimation = false;
      var direction2 = TRANSITION_NONE;
      var oldGroupIds = createHashMap();
      var oldChildGroupIds = createHashMap();
      oldDiffItems.forEach(function(item) {
        item.groupId && oldGroupIds.set(item.groupId, true);
        item.childGroupId && oldChildGroupIds.set(item.childGroupId, true);
      });
      for (var i2 = 0; i2 < newDiffItems.length; i2++) {
        var newGroupId = newDiffItems[i2].groupId;
        if (oldChildGroupIds.get(newGroupId)) {
          direction2 = TRANSITION_P2C;
          break;
        }
        var newChildGroupId = newDiffItems[i2].childGroupId;
        if (newChildGroupId && oldGroupIds.get(newChildGroupId)) {
          direction2 = TRANSITION_C2P;
          break;
        }
      }
      function createKeyGetter(isOld, onlyGetId) {
        return function(diffItem) {
          var data = diffItem.data;
          var dataIndex = diffItem.dataIndex;
          if (onlyGetId) {
            return data.getId(dataIndex);
          }
          if (isOld) {
            return direction2 === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId;
          } else {
            return direction2 === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId;
          }
        };
      }
      var useId2 = isAllIdSame(oldDiffItems, newDiffItems);
      var isElementStillInChart = {};
      if (!useId2) {
        for (var i2 = 0; i2 < newDiffItems.length; i2++) {
          var newItem = newDiffItems[i2];
          var el = newItem.data.getItemGraphicEl(newItem.dataIndex);
          if (el) {
            isElementStillInChart[el.id] = true;
          }
        }
      }
      function updateOneToOne(newIndex, oldIndex) {
        var oldItem = oldDiffItems[oldIndex];
        var newItem2 = newDiffItems[newIndex];
        var newSeries = newItem2.data.hostModel;
        var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);
        var newEl2 = newItem2.data.getItemGraphicEl(newItem2.dataIndex);
        if (oldEl === newEl2) {
          newEl2 && animateElementStyles(newEl2, newItem2.dataIndex, newSeries);
          return;
        }
        if (
          // We can't use the elements that already being morphed
          oldEl && isElementStillInChart[oldEl.id]
        ) {
          return;
        }
        if (newEl2) {
          stopAnimation(newEl2);
          if (oldEl) {
            stopAnimation(oldEl);
            removeEl(oldEl);
            hasMorphAnimation = true;
            applyMorphAnimation(getPathList(oldEl), getPathList(newEl2), newItem2.divide, newSeries, newIndex, updateMorphingPathProps);
          } else {
            fadeInElement(newEl2, newSeries, newIndex);
          }
        }
      }
      new DataDiffer(oldDiffItems, newDiffItems, createKeyGetter(true, useId2), createKeyGetter(false, useId2), null, "multiple").update(updateOneToOne).updateManyToOne(function(newIndex, oldIndices) {
        var newItem2 = newDiffItems[newIndex];
        var newData = newItem2.data;
        var newSeries = newData.hostModel;
        var newEl2 = newData.getItemGraphicEl(newItem2.dataIndex);
        var oldElsList = filter(map$1(oldIndices, function(idx) {
          return oldDiffItems[idx].data.getItemGraphicEl(oldDiffItems[idx].dataIndex);
        }), function(oldEl) {
          return oldEl && oldEl !== newEl2 && !isElementStillInChart[oldEl.id];
        });
        if (newEl2) {
          stopAnimation(newEl2);
          if (oldElsList.length) {
            each$f(oldElsList, function(oldEl) {
              stopAnimation(oldEl);
              removeEl(oldEl);
            });
            hasMorphAnimation = true;
            applyMorphAnimation(getPathList(oldElsList), getPathList(newEl2), newItem2.divide, newSeries, newIndex, updateMorphingPathProps);
          } else {
            fadeInElement(newEl2, newSeries, newItem2.dataIndex);
          }
        }
      }).updateOneToMany(function(newIndices, oldIndex) {
        var oldItem = oldDiffItems[oldIndex];
        var oldEl = oldItem.data.getItemGraphicEl(oldItem.dataIndex);
        if (oldEl && isElementStillInChart[oldEl.id]) {
          return;
        }
        var newElsList = filter(map$1(newIndices, function(idx) {
          return newDiffItems[idx].data.getItemGraphicEl(newDiffItems[idx].dataIndex);
        }), function(el2) {
          return el2 && el2 !== oldEl;
        });
        var newSeris = newDiffItems[newIndices[0]].data.hostModel;
        if (newElsList.length) {
          each$f(newElsList, function(newEl2) {
            return stopAnimation(newEl2);
          });
          if (oldEl) {
            stopAnimation(oldEl);
            removeEl(oldEl);
            hasMorphAnimation = true;
            applyMorphAnimation(
              getPathList(oldEl),
              getPathList(newElsList),
              oldItem.divide,
              // Use divide on old.
              newSeris,
              newIndices[0],
              updateMorphingPathProps
            );
          } else {
            each$f(newElsList, function(newEl2) {
              return fadeInElement(newEl2, newSeris, newIndices[0]);
            });
          }
        }
      }).updateManyToMany(function(newIndices, oldIndices) {
        new DataDiffer(oldIndices, newIndices, function(rawIdx) {
          return oldDiffItems[rawIdx].data.getId(oldDiffItems[rawIdx].dataIndex);
        }, function(rawIdx) {
          return newDiffItems[rawIdx].data.getId(newDiffItems[rawIdx].dataIndex);
        }).update(function(newIndex, oldIndex) {
          updateOneToOne(newIndices[newIndex], oldIndices[oldIndex]);
        }).execute();
      }).execute();
      if (hasMorphAnimation) {
        each$f(newList, function(_a2) {
          var data = _a2.data;
          var seriesModel = data.hostModel;
          var view = seriesModel && api2.getViewOfSeriesModel(seriesModel);
          var animationCfg = getAnimationConfig("update", seriesModel, 0);
          if (view && seriesModel.isAnimationEnabled() && animationCfg && animationCfg.duration > 0) {
            view.group.traverse(function(el2) {
              if (el2 instanceof Path && !el2.animators.length) {
                el2.animateFrom({
                  style: {
                    opacity: 0
                  }
                }, animationCfg);
              }
            });
          }
        });
      }
    }
    function getSeriesTransitionKey(series) {
      var seriesKey = series.getModel("universalTransition").get("seriesKey");
      if (!seriesKey) {
        return series.id;
      }
      return seriesKey;
    }
    function convertArraySeriesKeyToString(seriesKey) {
      if (isArray$2(seriesKey)) {
        return seriesKey.sort().join(",");
      }
      return seriesKey;
    }
    function getDivideShapeFromData(data) {
      if (data.hostModel) {
        return data.hostModel.getModel("universalTransition").get("divideShape");
      }
    }
    function findTransitionSeriesBatches(globalStore, params) {
      var updateBatches = createHashMap();
      var oldDataMap = createHashMap();
      var oldDataMapForSplit = createHashMap();
      each$f(globalStore.oldSeries, function(series, idx) {
        var oldDataGroupId = globalStore.oldDataGroupIds[idx];
        var oldData = globalStore.oldData[idx];
        var transitionKey = getSeriesTransitionKey(series);
        var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);
        oldDataMap.set(transitionKeyStr, {
          dataGroupId: oldDataGroupId,
          data: oldData
        });
        if (isArray$2(transitionKey)) {
          each$f(transitionKey, function(key) {
            oldDataMapForSplit.set(key, {
              key: transitionKeyStr,
              dataGroupId: oldDataGroupId,
              data: oldData
            });
          });
        }
      });
      each$f(params.updatedSeries, function(series) {
        if (series.isUniversalTransitionEnabled() && series.isAnimationEnabled()) {
          var newDataGroupId = series.get("dataGroupId");
          var newData = series.getData();
          var transitionKey = getSeriesTransitionKey(series);
          var transitionKeyStr = convertArraySeriesKeyToString(transitionKey);
          var oldData = oldDataMap.get(transitionKeyStr);
          if (oldData) {
            updateBatches.set(transitionKeyStr, {
              oldSeries: [{
                dataGroupId: oldData.dataGroupId,
                divide: getDivideShapeFromData(oldData.data),
                data: oldData.data
              }],
              newSeries: [{
                dataGroupId: newDataGroupId,
                divide: getDivideShapeFromData(newData),
                data: newData
              }]
            });
          } else {
            if (isArray$2(transitionKey)) {
              var oldSeries_1 = [];
              each$f(transitionKey, function(key) {
                var oldData2 = oldDataMap.get(key);
                if (oldData2.data) {
                  oldSeries_1.push({
                    dataGroupId: oldData2.dataGroupId,
                    divide: getDivideShapeFromData(oldData2.data),
                    data: oldData2.data
                  });
                }
              });
              if (oldSeries_1.length) {
                updateBatches.set(transitionKeyStr, {
                  oldSeries: oldSeries_1,
                  newSeries: [{
                    dataGroupId: newDataGroupId,
                    data: newData,
                    divide: getDivideShapeFromData(newData)
                  }]
                });
              }
            } else {
              var oldData_1 = oldDataMapForSplit.get(transitionKey);
              if (oldData_1) {
                var batch2 = updateBatches.get(oldData_1.key);
                if (!batch2) {
                  batch2 = {
                    oldSeries: [{
                      dataGroupId: oldData_1.dataGroupId,
                      data: oldData_1.data,
                      divide: getDivideShapeFromData(oldData_1.data)
                    }],
                    newSeries: []
                  };
                  updateBatches.set(oldData_1.key, batch2);
                }
                batch2.newSeries.push({
                  dataGroupId: newDataGroupId,
                  data: newData,
                  divide: getDivideShapeFromData(newData)
                });
              }
            }
          }
        }
      });
      return updateBatches;
    }
    function querySeries(series, finder) {
      for (var i2 = 0; i2 < series.length; i2++) {
        var found = finder.seriesIndex != null && finder.seriesIndex === series[i2].seriesIndex || finder.seriesId != null && finder.seriesId === series[i2].id;
        if (found) {
          return i2;
        }
      }
    }
    function transitionSeriesFromOpt(transitionOpt, globalStore, params, api2) {
      var from = [];
      var to = [];
      each$f(normalizeToArray(transitionOpt.from), function(finder) {
        var idx = querySeries(globalStore.oldSeries, finder);
        if (idx >= 0) {
          from.push({
            dataGroupId: globalStore.oldDataGroupIds[idx],
            data: globalStore.oldData[idx],
            // TODO can specify divideShape in transition.
            divide: getDivideShapeFromData(globalStore.oldData[idx]),
            groupIdDim: finder.dimension
          });
        }
      });
      each$f(normalizeToArray(transitionOpt.to), function(finder) {
        var idx = querySeries(params.updatedSeries, finder);
        if (idx >= 0) {
          var data = params.updatedSeries[idx].getData();
          to.push({
            dataGroupId: globalStore.oldDataGroupIds[idx],
            data,
            divide: getDivideShapeFromData(data),
            groupIdDim: finder.dimension
          });
        }
      });
      if (from.length > 0 && to.length > 0) {
        transitionBetween(from, to, api2);
      }
    }
    function installUniversalTransition(registers) {
      registers.registerUpdateLifecycle("series:beforeupdate", function(ecMOdel, api2, params) {
        each$f(normalizeToArray(params.seriesTransition), function(transOpt) {
          each$f(normalizeToArray(transOpt.to), function(finder) {
            var series = params.updatedSeries;
            for (var i2 = 0; i2 < series.length; i2++) {
              if (finder.seriesIndex != null && finder.seriesIndex === series[i2].seriesIndex || finder.seriesId != null && finder.seriesId === series[i2].id) {
                series[i2][SERIES_UNIVERSAL_TRANSITION_PROP] = true;
              }
            }
          });
        });
      });
      registers.registerUpdateLifecycle("series:transition", function(ecModel, api2, params) {
        var globalStore = getUniversalTransitionGlobalStore(api2);
        if (globalStore.oldSeries && params.updatedSeries && params.optionChanged) {
          var transitionOpt = params.seriesTransition;
          if (transitionOpt) {
            each$f(normalizeToArray(transitionOpt), function(opt) {
              transitionSeriesFromOpt(opt, globalStore, params, api2);
            });
          } else {
            var updateBatches_1 = findTransitionSeriesBatches(globalStore, params);
            each$f(updateBatches_1.keys(), function(key) {
              var batch2 = updateBatches_1.get(key);
              transitionBetween(batch2.oldSeries, batch2.newSeries, api2);
            });
          }
          each$f(params.updatedSeries, function(series) {
            if (series[SERIES_UNIVERSAL_TRANSITION_PROP]) {
              series[SERIES_UNIVERSAL_TRANSITION_PROP] = false;
            }
          });
        }
        var allSeries = ecModel.getSeries();
        var savedSeries = globalStore.oldSeries = [];
        var savedDataGroupIds = globalStore.oldDataGroupIds = [];
        var savedData = globalStore.oldData = [];
        for (var i2 = 0; i2 < allSeries.length; i2++) {
          var data = allSeries[i2].getData();
          if (data.count() < DATA_COUNT_THRESHOLD) {
            savedSeries.push(allSeries[i2]);
            savedDataGroupIds.push(allSeries[i2].get("dataGroupId"));
            savedData.push(data);
          }
        }
      });
    }
    use([install$R]);
    use([install$S]);
    use([install$Q, install$P, install$O, install$M, install$K, install$I, install$H, install$G, install$F, install$E, install$D, install$B, install$A, install$z, install$y, install$x, install$w, install$v, install$u, install$t, install$s, install$r]);
    use(install$p);
    use(install$o);
    use(install$J);
    use(install$n);
    use(install$C);
    use(install$m);
    use(install$l);
    use(install$j);
    use(install$i);
    use(install$q);
    use(install$h);
    use(install$g);
    use(install$f);
    use(install$e);
    use(install$d);
    use(install$c);
    use(install$9);
    use(install$6);
    use(install$8);
    use(install$7);
    use(install$3);
    use(install$5);
    use(install$4);
    use(install$2);
    use(install$1);
    use(install);
    use(installUniversalTransition);
    use(installLabelLayout);
    const _sfc_main$6 = {
      name: "FeedingChart",
      props: {
        data: {
          type: Array,
          default: () => []
        }
      },
      data() {
        return {
          chart: null,
          resizeTimeout: null
        };
      },
      methods: {
        initChart() {
          if (!this.$refs.chartRef) return;
          this.chart = init$1(this.$refs.chartRef);
          this.updateChart();
          window.addEventListener("resize", this.handleResize);
        },
        updateChart() {
          if (!this.chart) return;
          const option = {
            grid: {
              top: 30,
              right: 20,
              bottom: 30,
              left: 50,
              containLabel: true
            },
            xAxis: {
              type: "category",
              boundaryGap: false,
              data: this.data.map((item) => item.time),
              axisLine: {
                lineStyle: {
                  color: "rgba(139, 158, 176, 0.3)"
                }
              },
              axisLabel: {
                color: "#8b9eb0",
                fontSize: 12,
                interval: Math.floor(this.data.length / 5)
              },
              splitLine: {
                show: true,
                lineStyle: {
                  color: "rgba(139, 158, 176, 0.1)"
                }
              }
            },
            yAxis: {
              type: "value",
              name: "给料量(g)",
              nameTextStyle: {
                color: "#8b9eb0",
                fontSize: 12,
                padding: [0, 30, 0, 0]
              },
              axisLine: {
                lineStyle: {
                  color: "rgba(139, 158, 176, 0.3)"
                }
              },
              axisLabel: {
                color: "#8b9eb0",
                fontSize: 12
              },
              splitLine: {
                show: true,
                lineStyle: {
                  color: "rgba(139, 158, 176, 0.1)"
                }
              }
            },
            series: [
              {
                data: this.data.map((item) => item.value),
                type: "line",
                smooth: true,
                symbol: "none",
                lineStyle: {
                  width: 3,
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#00a8ff"
                      },
                      {
                        offset: 1,
                        color: "rgba(0, 168, 255, 0.1)"
                      }
                    ]
                  },
                  shadowColor: "rgba(0, 168, 255, 0.2)",
                  shadowBlur: 10
                },
                areaStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "rgba(0, 168, 255, 0.2)"
                      },
                      {
                        offset: 1,
                        color: "rgba(0, 168, 255, 0.05)"
                      }
                    ]
                  }
                },
                emphasis: {
                  focus: "series"
                },
                animation: true
              }
            ]
          };
          this.chart.setOption(option);
        },
        handleResize() {
          if (this.resizeTimeout) {
            clearTimeout(this.resizeTimeout);
          }
          this.resizeTimeout = setTimeout(() => {
            if (this.chart && document.body.contains(this.$refs.chartRef)) {
              this.chart.resize();
            }
          }, 100);
        }
      },
      watch: {
        data: {
          handler() {
            this.updateChart();
          },
          deep: true
        }
      },
      mounted() {
        this.initChart();
      },
      beforeDestroy() {
        if (this.chart) {
          this.chart.dispose();
          this.chart = null;
        }
        if (this.resizeTimeout) {
          clearTimeout(this.resizeTimeout);
        }
        window.removeEventListener("resize", this.handleResize);
      }
    };
    const _hoisted_1$6 = {
      class: "feeding-chart",
      ref: "chartRef"
    };
    function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
      return openBlock(), createElementBlock("div", _hoisted_1$6, null, 512);
    }
    const FeedingChart = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$4], ["__scopeId", "data-v-98b4f12a"]]);
    var FileSaver_min$1 = { exports: {} };
    var FileSaver_min = FileSaver_min$1.exports;
    var hasRequiredFileSaver_min;
    function requireFileSaver_min() {
      if (hasRequiredFileSaver_min) return FileSaver_min$1.exports;
      hasRequiredFileSaver_min = 1;
      (function(module2, exports2) {
        (function(a2, b2) {
          b2();
        })(FileSaver_min, function() {
          function b2(a3, b3) {
            return "undefined" == typeof b3 ? b3 = { autoBom: false } : "object" != typeof b3 && (console.warn("Deprecated: Expected third argument to be a object"), b3 = { autoBom: !b3 }), b3.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a3.type) ? new Blob(["\uFEFF", a3], { type: a3.type }) : a3;
          }
          function c2(a3, b3, c3) {
            var d3 = new XMLHttpRequest();
            d3.open("GET", a3), d3.responseType = "blob", d3.onload = function() {
              g(d3.response, b3, c3);
            }, d3.onerror = function() {
              console.error("could not download file");
            }, d3.send();
          }
          function d2(a3) {
            var b3 = new XMLHttpRequest();
            b3.open("HEAD", a3, false);
            try {
              b3.send();
            } catch (a4) {
            }
            return 200 <= b3.status && 299 >= b3.status;
          }
          function e2(a3) {
            try {
              a3.dispatchEvent(new MouseEvent("click"));
            } catch (c3) {
              var b3 = document.createEvent("MouseEvents");
              b3.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a3.dispatchEvent(b3);
            }
          }
          var f2 = "object" == typeof window && window.window === window ? window : "object" == typeof self && self.self === self ? self : "object" == typeof commonjsGlobal && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0, a2 = f2.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f2.saveAs || ("object" != typeof window || window !== f2 ? function() {
          } : "download" in HTMLAnchorElement.prototype && !a2 ? function(b3, g2, h2) {
            var i2 = f2.URL || f2.webkitURL, j = document.createElement("a");
            g2 = g2 || b3.name || "download", j.download = g2, j.rel = "noopener", "string" == typeof b3 ? (j.href = b3, j.origin === location.origin ? e2(j) : d2(j.href) ? c2(b3, g2, h2) : e2(j, j.target = "_blank")) : (j.href = i2.createObjectURL(b3), setTimeout(function() {
              i2.revokeObjectURL(j.href);
            }, 4e4), setTimeout(function() {
              e2(j);
            }, 0));
          } : "msSaveOrOpenBlob" in navigator ? function(f3, g2, h2) {
            if (g2 = g2 || f3.name || "download", "string" != typeof f3) navigator.msSaveOrOpenBlob(b2(f3, h2), g2);
            else if (d2(f3)) c2(f3, g2, h2);
            else {
              var i2 = document.createElement("a");
              i2.href = f3, i2.target = "_blank", setTimeout(function() {
                e2(i2);
              });
            }
          } : function(b3, d3, e3, g2) {
            if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), "string" == typeof b3) return c2(b3, d3, e3);
            var h2 = "application/octet-stream" === b3.type, i2 = /constructor/i.test(f2.HTMLElement) || f2.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent);
            if ((j || h2 && i2 || a2) && "undefined" != typeof FileReader) {
              var k2 = new FileReader();
              k2.onloadend = function() {
                var a3 = k2.result;
                a3 = j ? a3 : a3.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a3 : location = a3, g2 = null;
              }, k2.readAsDataURL(b3);
            } else {
              var l2 = f2.URL || f2.webkitURL, m2 = l2.createObjectURL(b3);
              g2 ? g2.location = m2 : location.href = m2, g2 = null, setTimeout(function() {
                l2.revokeObjectURL(m2);
              }, 4e4);
            }
          });
          f2.saveAs = g.saveAs = g, module2.exports = g;
        });
      })(FileSaver_min$1);
      return FileSaver_min$1.exports;
    }
    var FileSaver_minExports = requireFileSaver_min();
    /*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
    var XLSX = {};
    XLSX.version = "0.18.5";
    var current_ansi = 1252;
    var VALID_ANSI = [874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 1e4];
    var set_ansi = function(cp) {
      if (VALID_ANSI.indexOf(cp) == -1) return;
      current_ansi = cp;
    };
    function reset_ansi() {
      set_ansi(1252);
    }
    var set_cp = function(cp) {
      set_ansi(cp);
    };
    function reset_cp() {
      set_cp(1200);
      reset_ansi();
    }
    var _getchar = function _gc1(x2) {
      return String.fromCharCode(x2);
    };
    var _getansi = function _ga1(x2) {
      return String.fromCharCode(x2);
    };
    var $cptable;
    var Base64_map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
    function Base64_encode(input) {
      var o2 = "";
      var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;
      for (var i2 = 0; i2 < input.length; ) {
        c1 = input.charCodeAt(i2++);
        e1 = c1 >> 2;
        c2 = input.charCodeAt(i2++);
        e2 = (c1 & 3) << 4 | c2 >> 4;
        c3 = input.charCodeAt(i2++);
        e3 = (c2 & 15) << 2 | c3 >> 6;
        e4 = c3 & 63;
        if (isNaN(c2)) {
          e3 = e4 = 64;
        } else if (isNaN(c3)) {
          e4 = 64;
        }
        o2 += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4);
      }
      return o2;
    }
    function Base64_decode(input) {
      var o2 = "";
      var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;
      input = input.replace(/[^\w\+\/\=]/g, "");
      for (var i2 = 0; i2 < input.length; ) {
        e1 = Base64_map.indexOf(input.charAt(i2++));
        e2 = Base64_map.indexOf(input.charAt(i2++));
        c1 = e1 << 2 | e2 >> 4;
        o2 += String.fromCharCode(c1);
        e3 = Base64_map.indexOf(input.charAt(i2++));
        c2 = (e2 & 15) << 4 | e3 >> 2;
        if (e3 !== 64) {
          o2 += String.fromCharCode(c2);
        }
        e4 = Base64_map.indexOf(input.charAt(i2++));
        c3 = (e3 & 3) << 6 | e4;
        if (e4 !== 64) {
          o2 += String.fromCharCode(c3);
        }
      }
      return o2;
    }
    var has_buf = /* @__PURE__ */ function() {
      return typeof Buffer !== "undefined" && typeof process !== "undefined" && typeof process.versions !== "undefined" && !!process.versions.node;
    }();
    var Buffer_from = /* @__PURE__ */ function() {
      if (typeof Buffer !== "undefined") {
        var nbfs = !Buffer.from;
        if (!nbfs) try {
          Buffer.from("foo", "utf8");
        } catch (e2) {
          nbfs = true;
        }
        return nbfs ? function(buf, enc) {
          return enc ? new Buffer(buf, enc) : new Buffer(buf);
        } : Buffer.from.bind(Buffer);
      }
      return function() {
      };
    }();
    function new_raw_buf(len2) {
      if (has_buf) return Buffer.alloc ? Buffer.alloc(len2) : new Buffer(len2);
      return typeof Uint8Array != "undefined" ? new Uint8Array(len2) : new Array(len2);
    }
    function new_unsafe_buf(len2) {
      if (has_buf) return Buffer.allocUnsafe ? Buffer.allocUnsafe(len2) : new Buffer(len2);
      return typeof Uint8Array != "undefined" ? new Uint8Array(len2) : new Array(len2);
    }
    var s2a = function s2a2(s2) {
      if (has_buf) return Buffer_from(s2, "binary");
      return s2.split("").map(function(x2) {
        return x2.charCodeAt(0) & 255;
      });
    };
    function s2ab(s2) {
      if (typeof ArrayBuffer === "undefined") return s2a(s2);
      var buf = new ArrayBuffer(s2.length), view = new Uint8Array(buf);
      for (var i2 = 0; i2 != s2.length; ++i2) view[i2] = s2.charCodeAt(i2) & 255;
      return buf;
    }
    function a2s(data) {
      if (Array.isArray(data)) return data.map(function(c2) {
        return String.fromCharCode(c2);
      }).join("");
      var o2 = [];
      for (var i2 = 0; i2 < data.length; ++i2) o2[i2] = String.fromCharCode(data[i2]);
      return o2.join("");
    }
    function a2u(data) {
      if (typeof Uint8Array === "undefined") throw new Error("Unsupported");
      return new Uint8Array(data);
    }
    var bconcat = has_buf ? function(bufs) {
      return Buffer.concat(bufs.map(function(buf) {
        return Buffer.isBuffer(buf) ? buf : Buffer_from(buf);
      }));
    } : function(bufs) {
      if (typeof Uint8Array !== "undefined") {
        var i2 = 0, maxlen = 0;
        for (i2 = 0; i2 < bufs.length; ++i2) maxlen += bufs[i2].length;
        var o2 = new Uint8Array(maxlen);
        var len2 = 0;
        for (i2 = 0, maxlen = 0; i2 < bufs.length; maxlen += len2, ++i2) {
          len2 = bufs[i2].length;
          if (bufs[i2] instanceof Uint8Array) o2.set(bufs[i2], maxlen);
          else if (typeof bufs[i2] == "string") {
            throw "wtf";
          } else o2.set(new Uint8Array(bufs[i2]), maxlen);
        }
        return o2;
      }
      return [].concat.apply([], bufs.map(function(buf) {
        return Array.isArray(buf) ? buf : [].slice.call(buf);
      }));
    };
    function utf8decode(content2) {
      var out2 = [], widx = 0, L2 = content2.length + 250;
      var o2 = new_raw_buf(content2.length + 255);
      for (var ridx = 0; ridx < content2.length; ++ridx) {
        var c2 = content2.charCodeAt(ridx);
        if (c2 < 128) o2[widx++] = c2;
        else if (c2 < 2048) {
          o2[widx++] = 192 | c2 >> 6 & 31;
          o2[widx++] = 128 | c2 & 63;
        } else if (c2 >= 55296 && c2 < 57344) {
          c2 = (c2 & 1023) + 64;
          var d2 = content2.charCodeAt(++ridx) & 1023;
          o2[widx++] = 240 | c2 >> 8 & 7;
          o2[widx++] = 128 | c2 >> 2 & 63;
          o2[widx++] = 128 | d2 >> 6 & 15 | (c2 & 3) << 4;
          o2[widx++] = 128 | d2 & 63;
        } else {
          o2[widx++] = 224 | c2 >> 12 & 15;
          o2[widx++] = 128 | c2 >> 6 & 63;
          o2[widx++] = 128 | c2 & 63;
        }
        if (widx > L2) {
          out2.push(o2.slice(0, widx));
          widx = 0;
          o2 = new_raw_buf(65535);
          L2 = 65530;
        }
      }
      out2.push(o2.slice(0, widx));
      return bconcat(out2);
    }
    var chr0 = /\u0000/g, chr1 = /[\u0001-\u0006]/g;
    function _strrev(x2) {
      var o2 = "", i2 = x2.length - 1;
      while (i2 >= 0) o2 += x2.charAt(i2--);
      return o2;
    }
    function pad0(v4, d2) {
      var t = "" + v4;
      return t.length >= d2 ? t : fill("0", d2 - t.length) + t;
    }
    function pad_(v4, d2) {
      var t = "" + v4;
      return t.length >= d2 ? t : fill(" ", d2 - t.length) + t;
    }
    function rpad_(v4, d2) {
      var t = "" + v4;
      return t.length >= d2 ? t : t + fill(" ", d2 - t.length);
    }
    function pad0r1(v4, d2) {
      var t = "" + Math.round(v4);
      return t.length >= d2 ? t : fill("0", d2 - t.length) + t;
    }
    function pad0r2(v4, d2) {
      var t = "" + v4;
      return t.length >= d2 ? t : fill("0", d2 - t.length) + t;
    }
    var p2_32 = /* @__PURE__ */ Math.pow(2, 32);
    function pad0r(v4, d2) {
      if (v4 > p2_32 || v4 < -p2_32) return pad0r1(v4, d2);
      var i2 = Math.round(v4);
      return pad0r2(i2, d2);
    }
    function SSF_isgeneral(s2, i2) {
      i2 = i2 || 0;
      return s2.length >= 7 + i2 && (s2.charCodeAt(i2) | 32) === 103 && (s2.charCodeAt(i2 + 1) | 32) === 101 && (s2.charCodeAt(i2 + 2) | 32) === 110 && (s2.charCodeAt(i2 + 3) | 32) === 101 && (s2.charCodeAt(i2 + 4) | 32) === 114 && (s2.charCodeAt(i2 + 5) | 32) === 97 && (s2.charCodeAt(i2 + 6) | 32) === 108;
    }
    var days = [
      ["Sun", "Sunday"],
      ["Mon", "Monday"],
      ["Tue", "Tuesday"],
      ["Wed", "Wednesday"],
      ["Thu", "Thursday"],
      ["Fri", "Friday"],
      ["Sat", "Saturday"]
    ];
    var months = [
      ["J", "Jan", "January"],
      ["F", "Feb", "February"],
      ["M", "Mar", "March"],
      ["A", "Apr", "April"],
      ["M", "May", "May"],
      ["J", "Jun", "June"],
      ["J", "Jul", "July"],
      ["A", "Aug", "August"],
      ["S", "Sep", "September"],
      ["O", "Oct", "October"],
      ["N", "Nov", "November"],
      ["D", "Dec", "December"]
    ];
    function SSF_init_table(t) {
      if (!t) t = {};
      t[0] = "General";
      t[1] = "0";
      t[2] = "0.00";
      t[3] = "#,##0";
      t[4] = "#,##0.00";
      t[9] = "0%";
      t[10] = "0.00%";
      t[11] = "0.00E+00";
      t[12] = "# ?/?";
      t[13] = "# ??/??";
      t[14] = "m/d/yy";
      t[15] = "d-mmm-yy";
      t[16] = "d-mmm";
      t[17] = "mmm-yy";
      t[18] = "h:mm AM/PM";
      t[19] = "h:mm:ss AM/PM";
      t[20] = "h:mm";
      t[21] = "h:mm:ss";
      t[22] = "m/d/yy h:mm";
      t[37] = "#,##0 ;(#,##0)";
      t[38] = "#,##0 ;[Red](#,##0)";
      t[39] = "#,##0.00;(#,##0.00)";
      t[40] = "#,##0.00;[Red](#,##0.00)";
      t[45] = "mm:ss";
      t[46] = "[h]:mm:ss";
      t[47] = "mmss.0";
      t[48] = "##0.0E+0";
      t[49] = "@";
      t[56] = '"上午/下午 "hh"時"mm"分"ss"秒 "';
      return t;
    }
    var table_fmt = {
      0: "General",
      1: "0",
      2: "0.00",
      3: "#,##0",
      4: "#,##0.00",
      9: "0%",
      10: "0.00%",
      11: "0.00E+00",
      12: "# ?/?",
      13: "# ??/??",
      14: "m/d/yy",
      15: "d-mmm-yy",
      16: "d-mmm",
      17: "mmm-yy",
      18: "h:mm AM/PM",
      19: "h:mm:ss AM/PM",
      20: "h:mm",
      21: "h:mm:ss",
      22: "m/d/yy h:mm",
      37: "#,##0 ;(#,##0)",
      38: "#,##0 ;[Red](#,##0)",
      39: "#,##0.00;(#,##0.00)",
      40: "#,##0.00;[Red](#,##0.00)",
      45: "mm:ss",
      46: "[h]:mm:ss",
      47: "mmss.0",
      48: "##0.0E+0",
      49: "@",
      56: '"上午/下午 "hh"時"mm"分"ss"秒 "'
    };
    var SSF_default_map = {
      5: 37,
      6: 38,
      7: 39,
      8: 40,
      //  5 -> 37 ...  8 -> 40
      23: 0,
      24: 0,
      25: 0,
      26: 0,
      // 23 ->  0 ... 26 ->  0
      27: 14,
      28: 14,
      29: 14,
      30: 14,
      31: 14,
      // 27 -> 14 ... 31 -> 14
      50: 14,
      51: 14,
      52: 14,
      53: 14,
      54: 14,
      // 50 -> 14 ... 58 -> 14
      55: 14,
      56: 14,
      57: 14,
      58: 14,
      59: 1,
      60: 2,
      61: 3,
      62: 4,
      // 59 ->  1 ... 62 ->  4
      67: 9,
      68: 10,
      // 67 ->  9 ... 68 -> 10
      69: 12,
      70: 13,
      71: 14,
      // 69 -> 12 ... 71 -> 14
      72: 14,
      73: 15,
      74: 16,
      75: 17,
      // 72 -> 14 ... 75 -> 17
      76: 20,
      77: 21,
      78: 22,
      // 76 -> 20 ... 78 -> 22
      79: 45,
      80: 46,
      81: 47,
      // 79 -> 45 ... 81 -> 47
      82: 0
      // 82 ->  0 ... 65536 -> 0 (omitted)
    };
    var SSF_default_str = {
      //  5 -- Currency,   0 decimal, black negative
      5: '"$"#,##0_);\\("$"#,##0\\)',
      63: '"$"#,##0_);\\("$"#,##0\\)',
      //  6 -- Currency,   0 decimal, red   negative
      6: '"$"#,##0_);[Red]\\("$"#,##0\\)',
      64: '"$"#,##0_);[Red]\\("$"#,##0\\)',
      //  7 -- Currency,   2 decimal, black negative
      7: '"$"#,##0.00_);\\("$"#,##0.00\\)',
      65: '"$"#,##0.00_);\\("$"#,##0.00\\)',
      //  8 -- Currency,   2 decimal, red   negative
      8: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
      66: '"$"#,##0.00_);[Red]\\("$"#,##0.00\\)',
      // 41 -- Accounting, 0 decimal, No Symbol
      41: '_(* #,##0_);_(* \\(#,##0\\);_(* "-"_);_(@_)',
      // 42 -- Accounting, 0 decimal, $  Symbol
      42: '_("$"* #,##0_);_("$"* \\(#,##0\\);_("$"* "-"_);_(@_)',
      // 43 -- Accounting, 2 decimal, No Symbol
      43: '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* "-"??_);_(@_)',
      // 44 -- Accounting, 2 decimal, $  Symbol
      44: '_("$"* #,##0.00_);_("$"* \\(#,##0.00\\);_("$"* "-"??_);_(@_)'
    };
    function SSF_frac(x2, D2, mixed) {
      var sgn = x2 < 0 ? -1 : 1;
      var B3 = x2 * sgn;
      var P_2 = 0, P_1 = 1, P2 = 0;
      var Q_2 = 1, Q_1 = 0, Q2 = 0;
      var A2 = Math.floor(B3);
      while (Q_1 < D2) {
        A2 = Math.floor(B3);
        P2 = A2 * P_1 + P_2;
        Q2 = A2 * Q_1 + Q_2;
        if (B3 - A2 < 5e-8) break;
        B3 = 1 / (B3 - A2);
        P_2 = P_1;
        P_1 = P2;
        Q_2 = Q_1;
        Q_1 = Q2;
      }
      if (Q2 > D2) {
        if (Q_1 > D2) {
          Q2 = Q_2;
          P2 = P_2;
        } else {
          Q2 = Q_1;
          P2 = P_1;
        }
      }
      if (!mixed) return [0, sgn * P2, Q2];
      var q2 = Math.floor(sgn * P2 / Q2);
      return [q2, sgn * P2 - q2 * Q2, Q2];
    }
    function SSF_parse_date_code(v4, opts, b2) {
      if (v4 > 2958465 || v4 < 0) return null;
      var date = v4 | 0, time2 = Math.floor(86400 * (v4 - date)), dow = 0;
      var dout = [];
      var out2 = { D: date, T: time2, u: 86400 * (v4 - date) - time2, y: 0, m: 0, d: 0, H: 0, M: 0, S: 0, q: 0 };
      if (Math.abs(out2.u) < 1e-6) out2.u = 0;
      if (opts && opts.date1904) date += 1462;
      if (out2.u > 0.9999) {
        out2.u = 0;
        if (++time2 == 86400) {
          out2.T = time2 = 0;
          ++date;
          ++out2.D;
        }
      }
      if (date === 60) {
        dout = b2 ? [1317, 10, 29] : [1900, 2, 29];
        dow = 3;
      } else if (date === 0) {
        dout = b2 ? [1317, 8, 29] : [1900, 1, 0];
        dow = 6;
      } else {
        if (date > 60) --date;
        var d2 = new Date(1900, 0, 1);
        d2.setDate(d2.getDate() + date - 1);
        dout = [d2.getFullYear(), d2.getMonth() + 1, d2.getDate()];
        dow = d2.getDay();
        if (date < 60) dow = (dow + 6) % 7;
        if (b2) dow = SSF_fix_hijri(d2, dout);
      }
      out2.y = dout[0];
      out2.m = dout[1];
      out2.d = dout[2];
      out2.S = time2 % 60;
      time2 = Math.floor(time2 / 60);
      out2.M = time2 % 60;
      time2 = Math.floor(time2 / 60);
      out2.H = time2;
      out2.q = dow;
      return out2;
    }
    var SSFbasedate = /* @__PURE__ */ new Date(1899, 11, 31, 0, 0, 0);
    var SSFdnthresh = /* @__PURE__ */ SSFbasedate.getTime();
    var SSFbase1904 = /* @__PURE__ */ new Date(1900, 2, 1, 0, 0, 0);
    function datenum_local(v4, date1904) {
      var epoch = /* @__PURE__ */ v4.getTime();
      if (date1904) epoch -= 1461 * 24 * 60 * 60 * 1e3;
      else if (v4 >= SSFbase1904) epoch += 24 * 60 * 60 * 1e3;
      return (epoch - (SSFdnthresh + (/* @__PURE__ */ v4.getTimezoneOffset() - /* @__PURE__ */ SSFbasedate.getTimezoneOffset()) * 6e4)) / (24 * 60 * 60 * 1e3);
    }
    function SSF_strip_decimal(o2) {
      return o2.indexOf(".") == -1 ? o2 : o2.replace(/(?:\.0*|(\.\d*[1-9])0+)$/, "$1");
    }
    function SSF_normalize_exp(o2) {
      if (o2.indexOf("E") == -1) return o2;
      return o2.replace(/(?:\.0*|(\.\d*[1-9])0+)[Ee]/, "$1E").replace(/(E[+-])(\d)$/, "$10$2");
    }
    function SSF_small_exp(v4) {
      var w2 = v4 < 0 ? 12 : 11;
      var o2 = SSF_strip_decimal(v4.toFixed(12));
      if (o2.length <= w2) return o2;
      o2 = v4.toPrecision(10);
      if (o2.length <= w2) return o2;
      return v4.toExponential(5);
    }
    function SSF_large_exp(v4) {
      var o2 = SSF_strip_decimal(v4.toFixed(11));
      return o2.length > (v4 < 0 ? 12 : 11) || o2 === "0" || o2 === "-0" ? v4.toPrecision(6) : o2;
    }
    function SSF_general_num(v4) {
      var V2 = Math.floor(Math.log(Math.abs(v4)) * Math.LOG10E), o2;
      if (V2 >= -4 && V2 <= -1) o2 = v4.toPrecision(10 + V2);
      else if (Math.abs(V2) <= 9) o2 = SSF_small_exp(v4);
      else if (V2 === 10) o2 = v4.toFixed(10).substr(0, 12);
      else o2 = SSF_large_exp(v4);
      return SSF_strip_decimal(SSF_normalize_exp(o2.toUpperCase()));
    }
    function SSF_general(v4, opts) {
      switch (typeof v4) {
        case "string":
          return v4;
        case "boolean":
          return v4 ? "TRUE" : "FALSE";
        case "number":
          return (v4 | 0) === v4 ? v4.toString(10) : SSF_general_num(v4);
        case "undefined":
          return "";
        case "object":
          if (v4 == null) return "";
          if (v4 instanceof Date) return SSF_format(14, datenum_local(v4, opts && opts.date1904), opts);
      }
      throw new Error("unsupported value in General format: " + v4);
    }
    function SSF_fix_hijri(date, o2) {
      o2[0] -= 581;
      var dow = date.getDay();
      if (date < 60) dow = (dow + 6) % 7;
      return dow;
    }
    function SSF_write_date(type, fmt, val, ss0) {
      var o2 = "", ss = 0, tt2 = 0, y = val.y, out2, outl = 0;
      switch (type) {
        case 98:
          y = val.y + 543;
        /* falls through */
        case 121:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = y % 100;
              outl = 2;
              break;
            default:
              out2 = y % 1e4;
              outl = 4;
              break;
          }
          break;
        case 109:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = val.m;
              outl = fmt.length;
              break;
            case 3:
              return months[val.m - 1][1];
            case 5:
              return months[val.m - 1][0];
            default:
              return months[val.m - 1][2];
          }
          break;
        case 100:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = val.d;
              outl = fmt.length;
              break;
            case 3:
              return days[val.q][0];
            default:
              return days[val.q][1];
          }
          break;
        case 104:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = 1 + (val.H + 11) % 12;
              outl = fmt.length;
              break;
            default:
              throw "bad hour format: " + fmt;
          }
          break;
        case 72:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = val.H;
              outl = fmt.length;
              break;
            default:
              throw "bad hour format: " + fmt;
          }
          break;
        case 77:
          switch (fmt.length) {
            case 1:
            case 2:
              out2 = val.M;
              outl = fmt.length;
              break;
            default:
              throw "bad minute format: " + fmt;
          }
          break;
        case 115:
          if (fmt != "s" && fmt != "ss" && fmt != ".0" && fmt != ".00" && fmt != ".000") throw "bad second format: " + fmt;
          if (val.u === 0 && (fmt == "s" || fmt == "ss")) return pad0(val.S, fmt.length);
          if (ss0 >= 2) tt2 = ss0 === 3 ? 1e3 : 100;
          else tt2 = ss0 === 1 ? 10 : 1;
          ss = Math.round(tt2 * (val.S + val.u));
          if (ss >= 60 * tt2) ss = 0;
          if (fmt === "s") return ss === 0 ? "0" : "" + ss / tt2;
          o2 = pad0(ss, 2 + ss0);
          if (fmt === "ss") return o2.substr(0, 2);
          return "." + o2.substr(2, fmt.length - 1);
        case 90:
          switch (fmt) {
            case "[h]":
            case "[hh]":
              out2 = val.D * 24 + val.H;
              break;
            case "[m]":
            case "[mm]":
              out2 = (val.D * 24 + val.H) * 60 + val.M;
              break;
            case "[s]":
            case "[ss]":
              out2 = ((val.D * 24 + val.H) * 60 + val.M) * 60 + Math.round(val.S + val.u);
              break;
            default:
              throw "bad abstime format: " + fmt;
          }
          outl = fmt.length === 3 ? 1 : 2;
          break;
        case 101:
          out2 = y;
          outl = 1;
          break;
      }
      var outstr = outl > 0 ? pad0(out2, outl) : "";
      return outstr;
    }
    function commaify(s2) {
      var w2 = 3;
      if (s2.length <= w2) return s2;
      var j = s2.length % w2, o2 = s2.substr(0, j);
      for (; j != s2.length; j += w2) o2 += (o2.length > 0 ? "," : "") + s2.substr(j, w2);
      return o2;
    }
    var pct1 = /%/g;
    function write_num_pct(type, fmt, val) {
      var sfmt = fmt.replace(pct1, ""), mul2 = fmt.length - sfmt.length;
      return write_num(type, sfmt, val * Math.pow(10, 2 * mul2)) + fill("%", mul2);
    }
    function write_num_cm(type, fmt, val) {
      var idx = fmt.length - 1;
      while (fmt.charCodeAt(idx - 1) === 44) --idx;
      return write_num(type, fmt.substr(0, idx), val / Math.pow(10, 3 * (fmt.length - idx)));
    }
    function write_num_exp(fmt, val) {
      var o2;
      var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
      if (fmt.match(/^#+0.0E\+0$/)) {
        if (val == 0) return "0.0E+0";
        else if (val < 0) return "-" + write_num_exp(fmt, -val);
        var period = fmt.indexOf(".");
        if (period === -1) period = fmt.indexOf("E");
        var ee2 = Math.floor(Math.log(val) * Math.LOG10E) % period;
        if (ee2 < 0) ee2 += period;
        o2 = (val / Math.pow(10, ee2)).toPrecision(idx + 1 + (period + ee2) % period);
        if (o2.indexOf("e") === -1) {
          var fakee = Math.floor(Math.log(val) * Math.LOG10E);
          if (o2.indexOf(".") === -1) o2 = o2.charAt(0) + "." + o2.substr(1) + "E+" + (fakee - o2.length + ee2);
          else o2 += "E+" + (fakee - ee2);
          while (o2.substr(0, 2) === "0.") {
            o2 = o2.charAt(0) + o2.substr(2, period) + "." + o2.substr(2 + period);
            o2 = o2.replace(/^0+([1-9])/, "$1").replace(/^0+\./, "0.");
          }
          o2 = o2.replace(/\+-/, "-");
        }
        o2 = o2.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function($$, $1, $2, $3) {
          return $1 + $2 + $3.substr(0, (period + ee2) % period) + "." + $3.substr(ee2) + "E";
        });
      } else o2 = val.toExponential(idx);
      if (fmt.match(/E\+00$/) && o2.match(/e[+-]\d$/)) o2 = o2.substr(0, o2.length - 1) + "0" + o2.charAt(o2.length - 1);
      if (fmt.match(/E\-/) && o2.match(/e\+/)) o2 = o2.replace(/e\+/, "e");
      return o2.replace("e", "E");
    }
    var frac1 = /# (\?+)( ?)\/( ?)(\d+)/;
    function write_num_f1(r, aval, sign) {
      var den = parseInt(r[4], 10), rr = Math.round(aval * den), base2 = Math.floor(rr / den);
      var myn = rr - base2 * den, myd = den;
      return sign + (base2 === 0 ? "" : "" + base2) + " " + (myn === 0 ? fill(" ", r[1].length + 1 + r[4].length) : pad_(myn, r[1].length) + r[2] + "/" + r[3] + pad0(myd, r[4].length));
    }
    function write_num_f2(r, aval, sign) {
      return sign + (aval === 0 ? "" : "" + aval) + fill(" ", r[1].length + 2 + r[4].length);
    }
    var dec1 = /^#*0*\.([0#]+)/;
    var closeparen = /\).*[0#]/;
    var phone = /\(###\) ###\\?-####/;
    function hashq(str) {
      var o2 = "", cc;
      for (var i2 = 0; i2 != str.length; ++i2) switch (cc = str.charCodeAt(i2)) {
        case 35:
          break;
        case 63:
          o2 += " ";
          break;
        case 48:
          o2 += "0";
          break;
        default:
          o2 += String.fromCharCode(cc);
      }
      return o2;
    }
    function rnd(val, d2) {
      var dd = Math.pow(10, d2);
      return "" + Math.round(val * dd) / dd;
    }
    function dec(val, d2) {
      var _frac = val - Math.floor(val), dd = Math.pow(10, d2);
      if (d2 < ("" + Math.round(_frac * dd)).length) return 0;
      return Math.round(_frac * dd);
    }
    function carry(val, d2) {
      if (d2 < ("" + Math.round((val - Math.floor(val)) * Math.pow(10, d2))).length) {
        return 1;
      }
      return 0;
    }
    function flr(val) {
      if (val < 2147483647 && val > -2147483648) return "" + (val >= 0 ? val | 0 : val - 1 | 0);
      return "" + Math.floor(val);
    }
    function write_num_flt(type, fmt, val) {
      if (type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
        var ffmt = fmt.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
        if (val >= 0) return write_num_flt("n", ffmt, val);
        return "(" + write_num_flt("n", ffmt, -val) + ")";
      }
      if (fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);
      if (fmt.indexOf("%") !== -1) return write_num_pct(type, fmt, val);
      if (fmt.indexOf("E") !== -1) return write_num_exp(fmt, val);
      if (fmt.charCodeAt(0) === 36) return "$" + write_num_flt(type, fmt.substr(fmt.charAt(1) == " " ? 2 : 1), val);
      var o2;
      var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
      if (fmt.match(/^00+$/)) return sign + pad0r(aval, fmt.length);
      if (fmt.match(/^[#?]+$/)) {
        o2 = pad0r(val, 0);
        if (o2 === "0") o2 = "";
        return o2.length > fmt.length ? o2 : hashq(fmt.substr(0, fmt.length - o2.length)) + o2;
      }
      if (r = fmt.match(frac1)) return write_num_f1(r, aval, sign);
      if (fmt.match(/^#+0+$/)) return sign + pad0r(aval, fmt.length - fmt.indexOf("0"));
      if (r = fmt.match(dec1)) {
        o2 = rnd(val, r[1].length).replace(/^([^\.]+)$/, "$1." + hashq(r[1])).replace(/\.$/, "." + hashq(r[1])).replace(/\.(\d*)$/, function($$, $1) {
          return "." + $1 + fill("0", hashq(
            /*::(*/
            r[1]
          ).length - $1.length);
        });
        return fmt.indexOf("0.") !== -1 ? o2 : o2.replace(/^0\./, ".");
      }
      fmt = fmt.replace(/^#+([0.])/, "$1");
      if (r = fmt.match(/^(0*)\.(#*)$/)) {
        return sign + rnd(aval, r[2].length).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, r[1].length ? "0." : ".");
      }
      if (r = fmt.match(/^#{1,3},##0(\.?)$/)) return sign + commaify(pad0r(aval, 0));
      if (r = fmt.match(/^#,##0\.([#0]*0)$/)) {
        return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify("" + (Math.floor(val) + carry(val, r[1].length))) + "." + pad0(dec(val, r[1].length), r[1].length);
      }
      if (r = fmt.match(/^#,#*,#0/)) return write_num_flt(type, fmt.replace(/^#,#*,/, ""), val);
      if (r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) {
        o2 = _strrev(write_num_flt(type, fmt.replace(/[\\-]/g, ""), val));
        ri = 0;
        return _strrev(_strrev(fmt.replace(/\\/g, "")).replace(/[0#]/g, function(x3) {
          return ri < o2.length ? o2.charAt(ri++) : x3 === "0" ? "0" : "";
        }));
      }
      if (fmt.match(phone)) {
        o2 = write_num_flt(type, "##########", val);
        return "(" + o2.substr(0, 3) + ") " + o2.substr(3, 3) + "-" + o2.substr(6);
      }
      var oa = "";
      if (r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/)) {
        ri = Math.min(
          /*::String(*/
          r[4].length,
          7
        );
        ff = SSF_frac(aval, Math.pow(10, ri) - 1, false);
        o2 = "" + sign;
        oa = write_num(
          "n",
          /*::String(*/
          r[1],
          ff[1]
        );
        if (oa.charAt(oa.length - 1) == " ") oa = oa.substr(0, oa.length - 1) + "0";
        o2 += oa + /*::String(*/
        r[2] + "/" + /*::String(*/
        r[3];
        oa = rpad_(ff[2], ri);
        if (oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length - oa.length)) + oa;
        o2 += oa;
        return o2;
      }
      if (r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/)) {
        ri = Math.min(Math.max(r[1].length, r[4].length), 7);
        ff = SSF_frac(aval, Math.pow(10, ri) - 1, true);
        return sign + (ff[0] || (ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1], ri) + r[2] + "/" + r[3] + rpad_(ff[2], ri) : fill(" ", 2 * ri + 1 + r[2].length + r[3].length));
      }
      if (r = fmt.match(/^[#0?]+$/)) {
        o2 = pad0r(val, 0);
        if (fmt.length <= o2.length) return o2;
        return hashq(fmt.substr(0, fmt.length - o2.length)) + o2;
      }
      if (r = fmt.match(/^([#0?]+)\.([#0]+)$/)) {
        o2 = "" + val.toFixed(Math.min(r[2].length, 10)).replace(/([^0])0+$/, "$1");
        ri = o2.indexOf(".");
        var lres = fmt.indexOf(".") - ri, rres = fmt.length - o2.length - lres;
        return hashq(fmt.substr(0, lres) + o2 + fmt.substr(fmt.length - rres));
      }
      if (r = fmt.match(/^00,000\.([#0]*0)$/)) {
        ri = dec(val, r[1].length);
        return val < 0 ? "-" + write_num_flt(type, fmt, -val) : commaify(flr(val)).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function($$) {
          return "00," + ($$.length < 3 ? pad0(0, 3 - $$.length) : "") + $$;
        }) + "." + pad0(ri, r[1].length);
      }
      switch (fmt) {
        case "###,##0.00":
          return write_num_flt(type, "#,##0.00", val);
        case "###,###":
        case "##,###":
        case "#,###":
          var x2 = commaify(pad0r(aval, 0));
          return x2 !== "0" ? sign + x2 : "";
        case "###,###.00":
          return write_num_flt(type, "###,##0.00", val).replace(/^0\./, ".");
        case "#,###.00":
          return write_num_flt(type, "#,##0.00", val).replace(/^0\./, ".");
      }
      throw new Error("unsupported format |" + fmt + "|");
    }
    function write_num_cm2(type, fmt, val) {
      var idx = fmt.length - 1;
      while (fmt.charCodeAt(idx - 1) === 44) --idx;
      return write_num(type, fmt.substr(0, idx), val / Math.pow(10, 3 * (fmt.length - idx)));
    }
    function write_num_pct2(type, fmt, val) {
      var sfmt = fmt.replace(pct1, ""), mul2 = fmt.length - sfmt.length;
      return write_num(type, sfmt, val * Math.pow(10, 2 * mul2)) + fill("%", mul2);
    }
    function write_num_exp2(fmt, val) {
      var o2;
      var idx = fmt.indexOf("E") - fmt.indexOf(".") - 1;
      if (fmt.match(/^#+0.0E\+0$/)) {
        if (val == 0) return "0.0E+0";
        else if (val < 0) return "-" + write_num_exp2(fmt, -val);
        var period = fmt.indexOf(".");
        if (period === -1) period = fmt.indexOf("E");
        var ee2 = Math.floor(Math.log(val) * Math.LOG10E) % period;
        if (ee2 < 0) ee2 += period;
        o2 = (val / Math.pow(10, ee2)).toPrecision(idx + 1 + (period + ee2) % period);
        if (!o2.match(/[Ee]/)) {
          var fakee = Math.floor(Math.log(val) * Math.LOG10E);
          if (o2.indexOf(".") === -1) o2 = o2.charAt(0) + "." + o2.substr(1) + "E+" + (fakee - o2.length + ee2);
          else o2 += "E+" + (fakee - ee2);
          o2 = o2.replace(/\+-/, "-");
        }
        o2 = o2.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/, function($$, $1, $2, $3) {
          return $1 + $2 + $3.substr(0, (period + ee2) % period) + "." + $3.substr(ee2) + "E";
        });
      } else o2 = val.toExponential(idx);
      if (fmt.match(/E\+00$/) && o2.match(/e[+-]\d$/)) o2 = o2.substr(0, o2.length - 1) + "0" + o2.charAt(o2.length - 1);
      if (fmt.match(/E\-/) && o2.match(/e\+/)) o2 = o2.replace(/e\+/, "e");
      return o2.replace("e", "E");
    }
    function write_num_int(type, fmt, val) {
      if (type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {
        var ffmt = fmt.replace(/\( */, "").replace(/ \)/, "").replace(/\)/, "");
        if (val >= 0) return write_num_int("n", ffmt, val);
        return "(" + write_num_int("n", ffmt, -val) + ")";
      }
      if (fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);
      if (fmt.indexOf("%") !== -1) return write_num_pct2(type, fmt, val);
      if (fmt.indexOf("E") !== -1) return write_num_exp2(fmt, val);
      if (fmt.charCodeAt(0) === 36) return "$" + write_num_int(type, fmt.substr(fmt.charAt(1) == " " ? 2 : 1), val);
      var o2;
      var r, ri, ff, aval = Math.abs(val), sign = val < 0 ? "-" : "";
      if (fmt.match(/^00+$/)) return sign + pad0(aval, fmt.length);
      if (fmt.match(/^[#?]+$/)) {
        o2 = "" + val;
        if (val === 0) o2 = "";
        return o2.length > fmt.length ? o2 : hashq(fmt.substr(0, fmt.length - o2.length)) + o2;
      }
      if (r = fmt.match(frac1)) return write_num_f2(r, aval, sign);
      if (fmt.match(/^#+0+$/)) return sign + pad0(aval, fmt.length - fmt.indexOf("0"));
      if (r = fmt.match(dec1)) {
        o2 = ("" + val).replace(/^([^\.]+)$/, "$1." + hashq(r[1])).replace(/\.$/, "." + hashq(r[1]));
        o2 = o2.replace(/\.(\d*)$/, function($$, $1) {
          return "." + $1 + fill("0", hashq(r[1]).length - $1.length);
        });
        return fmt.indexOf("0.") !== -1 ? o2 : o2.replace(/^0\./, ".");
      }
      fmt = fmt.replace(/^#+([0.])/, "$1");
      if (r = fmt.match(/^(0*)\.(#*)$/)) {
        return sign + ("" + aval).replace(/\.(\d*[1-9])0*$/, ".$1").replace(/^(-?\d*)$/, "$1.").replace(/^0\./, r[1].length ? "0." : ".");
      }
      if (r = fmt.match(/^#{1,3},##0(\.?)$/)) return sign + commaify("" + aval);
      if (r = fmt.match(/^#,##0\.([#0]*0)$/)) {
        return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify("" + val) + "." + fill("0", r[1].length);
      }
      if (r = fmt.match(/^#,#*,#0/)) return write_num_int(type, fmt.replace(/^#,#*,/, ""), val);
      if (r = fmt.match(/^([0#]+)(\\?-([0#]+))+$/)) {
        o2 = _strrev(write_num_int(type, fmt.replace(/[\\-]/g, ""), val));
        ri = 0;
        return _strrev(_strrev(fmt.replace(/\\/g, "")).replace(/[0#]/g, function(x3) {
          return ri < o2.length ? o2.charAt(ri++) : x3 === "0" ? "0" : "";
        }));
      }
      if (fmt.match(phone)) {
        o2 = write_num_int(type, "##########", val);
        return "(" + o2.substr(0, 3) + ") " + o2.substr(3, 3) + "-" + o2.substr(6);
      }
      var oa = "";
      if (r = fmt.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/)) {
        ri = Math.min(
          /*::String(*/
          r[4].length,
          7
        );
        ff = SSF_frac(aval, Math.pow(10, ri) - 1, false);
        o2 = "" + sign;
        oa = write_num(
          "n",
          /*::String(*/
          r[1],
          ff[1]
        );
        if (oa.charAt(oa.length - 1) == " ") oa = oa.substr(0, oa.length - 1) + "0";
        o2 += oa + /*::String(*/
        r[2] + "/" + /*::String(*/
        r[3];
        oa = rpad_(ff[2], ri);
        if (oa.length < r[4].length) oa = hashq(r[4].substr(r[4].length - oa.length)) + oa;
        o2 += oa;
        return o2;
      }
      if (r = fmt.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/)) {
        ri = Math.min(Math.max(r[1].length, r[4].length), 7);
        ff = SSF_frac(aval, Math.pow(10, ri) - 1, true);
        return sign + (ff[0] || (ff[1] ? "" : "0")) + " " + (ff[1] ? pad_(ff[1], ri) + r[2] + "/" + r[3] + rpad_(ff[2], ri) : fill(" ", 2 * ri + 1 + r[2].length + r[3].length));
      }
      if (r = fmt.match(/^[#0?]+$/)) {
        o2 = "" + val;
        if (fmt.length <= o2.length) return o2;
        return hashq(fmt.substr(0, fmt.length - o2.length)) + o2;
      }
      if (r = fmt.match(/^([#0]+)\.([#0]+)$/)) {
        o2 = "" + val.toFixed(Math.min(r[2].length, 10)).replace(/([^0])0+$/, "$1");
        ri = o2.indexOf(".");
        var lres = fmt.indexOf(".") - ri, rres = fmt.length - o2.length - lres;
        return hashq(fmt.substr(0, lres) + o2 + fmt.substr(fmt.length - rres));
      }
      if (r = fmt.match(/^00,000\.([#0]*0)$/)) {
        return val < 0 ? "-" + write_num_int(type, fmt, -val) : commaify("" + val).replace(/^\d,\d{3}$/, "0$&").replace(/^\d*$/, function($$) {
          return "00," + ($$.length < 3 ? pad0(0, 3 - $$.length) : "") + $$;
        }) + "." + pad0(0, r[1].length);
      }
      switch (fmt) {
        case "###,###":
        case "##,###":
        case "#,###":
          var x2 = commaify("" + aval);
          return x2 !== "0" ? sign + x2 : "";
        default:
          if (fmt.match(/\.[0#?]*$/)) return write_num_int(type, fmt.slice(0, fmt.lastIndexOf(".")), val) + hashq(fmt.slice(fmt.lastIndexOf(".")));
      }
      throw new Error("unsupported format |" + fmt + "|");
    }
    function write_num(type, fmt, val) {
      return (val | 0) === val ? write_num_int(type, fmt, val) : write_num_flt(type, fmt, val);
    }
    function SSF_split_fmt(fmt) {
      var out2 = [];
      var in_str = false;
      for (var i2 = 0, j = 0; i2 < fmt.length; ++i2) switch (
        /*cc=*/
        fmt.charCodeAt(i2)
      ) {
        case 34:
          in_str = !in_str;
          break;
        case 95:
        case 42:
        case 92:
          ++i2;
          break;
        case 59:
          out2[out2.length] = fmt.substr(j, i2 - j);
          j = i2 + 1;
      }
      out2[out2.length] = fmt.substr(j);
      if (in_str === true) throw new Error("Format |" + fmt + "| unterminated string ");
      return out2;
    }
    var SSF_abstime = /\[[HhMmSs\u0E0A\u0E19\u0E17]*\]/;
    function fmt_is_date(fmt) {
      var i2 = 0, c2 = "", o2 = "";
      while (i2 < fmt.length) {
        switch (c2 = fmt.charAt(i2)) {
          case "G":
            if (SSF_isgeneral(fmt, i2)) i2 += 6;
            i2++;
            break;
          case '"':
            for (
              ;
              /*cc=*/
              fmt.charCodeAt(++i2) !== 34 && i2 < fmt.length;
            ) {
            }
            ++i2;
            break;
          case "\\":
            i2 += 2;
            break;
          case "_":
            i2 += 2;
            break;
          case "@":
            ++i2;
            break;
          case "B":
          case "b":
            if (fmt.charAt(i2 + 1) === "1" || fmt.charAt(i2 + 1) === "2") return true;
          /* falls through */
          case "M":
          case "D":
          case "Y":
          case "H":
          case "S":
          case "E":
          /* falls through */
          case "m":
          case "d":
          case "y":
          case "h":
          case "s":
          case "e":
          case "g":
            return true;
          case "A":
          case "a":
          case "上":
            if (fmt.substr(i2, 3).toUpperCase() === "A/P") return true;
            if (fmt.substr(i2, 5).toUpperCase() === "AM/PM") return true;
            if (fmt.substr(i2, 5).toUpperCase() === "上午/下午") return true;
            ++i2;
            break;
          case "[":
            o2 = c2;
            while (fmt.charAt(i2++) !== "]" && i2 < fmt.length) o2 += fmt.charAt(i2);
            if (o2.match(SSF_abstime)) return true;
            break;
          case ".":
          /* falls through */
          case "0":
          case "#":
            while (i2 < fmt.length && ("0#?.,E+-%".indexOf(c2 = fmt.charAt(++i2)) > -1 || c2 == "\\" && fmt.charAt(i2 + 1) == "-" && "0#".indexOf(fmt.charAt(i2 + 2)) > -1)) {
            }
            break;
          case "?":
            while (fmt.charAt(++i2) === c2) {
            }
            break;
          case "*":
            ++i2;
            if (fmt.charAt(i2) == " " || fmt.charAt(i2) == "*") ++i2;
            break;
          case "(":
          case ")":
            ++i2;
            break;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            while (i2 < fmt.length && "0123456789".indexOf(fmt.charAt(++i2)) > -1) {
            }
            break;
          case " ":
            ++i2;
            break;
          default:
            ++i2;
            break;
        }
      }
      return false;
    }
    function eval_fmt(fmt, v4, opts, flen) {
      var out2 = [], o2 = "", i2 = 0, c2 = "", lst = "t", dt2, j, cc;
      var hr = "H";
      while (i2 < fmt.length) {
        switch (c2 = fmt.charAt(i2)) {
          case "G":
            if (!SSF_isgeneral(fmt, i2)) throw new Error("unrecognized character " + c2 + " in " + fmt);
            out2[out2.length] = { t: "G", v: "General" };
            i2 += 7;
            break;
          case '"':
            for (o2 = ""; (cc = fmt.charCodeAt(++i2)) !== 34 && i2 < fmt.length; ) o2 += String.fromCharCode(cc);
            out2[out2.length] = { t: "t", v: o2 };
            ++i2;
            break;
          case "\\":
            var w2 = fmt.charAt(++i2), t = w2 === "(" || w2 === ")" ? w2 : "t";
            out2[out2.length] = { t, v: w2 };
            ++i2;
            break;
          case "_":
            out2[out2.length] = { t: "t", v: " " };
            i2 += 2;
            break;
          case "@":
            out2[out2.length] = { t: "T", v: v4 };
            ++i2;
            break;
          case "B":
          case "b":
            if (fmt.charAt(i2 + 1) === "1" || fmt.charAt(i2 + 1) === "2") {
              if (dt2 == null) {
                dt2 = SSF_parse_date_code(v4, opts, fmt.charAt(i2 + 1) === "2");
                if (dt2 == null) return "";
              }
              out2[out2.length] = { t: "X", v: fmt.substr(i2, 2) };
              lst = c2;
              i2 += 2;
              break;
            }
          /* falls through */
          case "M":
          case "D":
          case "Y":
          case "H":
          case "S":
          case "E":
            c2 = c2.toLowerCase();
          /* falls through */
          case "m":
          case "d":
          case "y":
          case "h":
          case "s":
          case "e":
          case "g":
            if (v4 < 0) return "";
            if (dt2 == null) {
              dt2 = SSF_parse_date_code(v4, opts);
              if (dt2 == null) return "";
            }
            o2 = c2;
            while (++i2 < fmt.length && fmt.charAt(i2).toLowerCase() === c2) o2 += c2;
            if (c2 === "m" && lst.toLowerCase() === "h") c2 = "M";
            if (c2 === "h") c2 = hr;
            out2[out2.length] = { t: c2, v: o2 };
            lst = c2;
            break;
          case "A":
          case "a":
          case "上":
            var q2 = { t: c2, v: c2 };
            if (dt2 == null) dt2 = SSF_parse_date_code(v4, opts);
            if (fmt.substr(i2, 3).toUpperCase() === "A/P") {
              if (dt2 != null) q2.v = dt2.H >= 12 ? "P" : "A";
              q2.t = "T";
              hr = "h";
              i2 += 3;
            } else if (fmt.substr(i2, 5).toUpperCase() === "AM/PM") {
              if (dt2 != null) q2.v = dt2.H >= 12 ? "PM" : "AM";
              q2.t = "T";
              i2 += 5;
              hr = "h";
            } else if (fmt.substr(i2, 5).toUpperCase() === "上午/下午") {
              if (dt2 != null) q2.v = dt2.H >= 12 ? "下午" : "上午";
              q2.t = "T";
              i2 += 5;
              hr = "h";
            } else {
              q2.t = "t";
              ++i2;
            }
            if (dt2 == null && q2.t === "T") return "";
            out2[out2.length] = q2;
            lst = c2;
            break;
          case "[":
            o2 = c2;
            while (fmt.charAt(i2++) !== "]" && i2 < fmt.length) o2 += fmt.charAt(i2);
            if (o2.slice(-1) !== "]") throw 'unterminated "[" block: |' + o2 + "|";
            if (o2.match(SSF_abstime)) {
              if (dt2 == null) {
                dt2 = SSF_parse_date_code(v4, opts);
                if (dt2 == null) return "";
              }
              out2[out2.length] = { t: "Z", v: o2.toLowerCase() };
              lst = o2.charAt(1);
            } else if (o2.indexOf("$") > -1) {
              o2 = (o2.match(/\$([^-\[\]]*)/) || [])[1] || "$";
              if (!fmt_is_date(fmt)) out2[out2.length] = { t: "t", v: o2 };
            }
            break;
          /* Numbers */
          case ".":
            if (dt2 != null) {
              o2 = c2;
              while (++i2 < fmt.length && (c2 = fmt.charAt(i2)) === "0") o2 += c2;
              out2[out2.length] = { t: "s", v: o2 };
              break;
            }
          /* falls through */
          case "0":
          case "#":
            o2 = c2;
            while (++i2 < fmt.length && "0#?.,E+-%".indexOf(c2 = fmt.charAt(i2)) > -1) o2 += c2;
            out2[out2.length] = { t: "n", v: o2 };
            break;
          case "?":
            o2 = c2;
            while (fmt.charAt(++i2) === c2) o2 += c2;
            out2[out2.length] = { t: c2, v: o2 };
            lst = c2;
            break;
          case "*":
            ++i2;
            if (fmt.charAt(i2) == " " || fmt.charAt(i2) == "*") ++i2;
            break;
          // **
          case "(":
          case ")":
            out2[out2.length] = { t: flen === 1 ? "t" : c2, v: c2 };
            ++i2;
            break;
          case "1":
          case "2":
          case "3":
          case "4":
          case "5":
          case "6":
          case "7":
          case "8":
          case "9":
            o2 = c2;
            while (i2 < fmt.length && "0123456789".indexOf(fmt.charAt(++i2)) > -1) o2 += fmt.charAt(i2);
            out2[out2.length] = { t: "D", v: o2 };
            break;
          case " ":
            out2[out2.length] = { t: c2, v: c2 };
            ++i2;
            break;
          case "$":
            out2[out2.length] = { t: "t", v: "$" };
            ++i2;
            break;
          default:
            if (",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(c2) === -1) throw new Error("unrecognized character " + c2 + " in " + fmt);
            out2[out2.length] = { t: "t", v: c2 };
            ++i2;
            break;
        }
      }
      var bt2 = 0, ss0 = 0, ssm;
      for (i2 = out2.length - 1, lst = "t"; i2 >= 0; --i2) {
        switch (out2[i2].t) {
          case "h":
          case "H":
            out2[i2].t = hr;
            lst = "h";
            if (bt2 < 1) bt2 = 1;
            break;
          case "s":
            if (ssm = out2[i2].v.match(/\.0+$/)) ss0 = Math.max(ss0, ssm[0].length - 1);
            if (bt2 < 3) bt2 = 3;
          /* falls through */
          case "d":
          case "y":
          case "M":
          case "e":
            lst = out2[i2].t;
            break;
          case "m":
            if (lst === "s") {
              out2[i2].t = "M";
              if (bt2 < 2) bt2 = 2;
            }
            break;
          case "X":
            break;
          case "Z":
            if (bt2 < 1 && out2[i2].v.match(/[Hh]/)) bt2 = 1;
            if (bt2 < 2 && out2[i2].v.match(/[Mm]/)) bt2 = 2;
            if (bt2 < 3 && out2[i2].v.match(/[Ss]/)) bt2 = 3;
        }
      }
      switch (bt2) {
        case 0:
          break;
        case 1:
          if (dt2.u >= 0.5) {
            dt2.u = 0;
            ++dt2.S;
          }
          if (dt2.S >= 60) {
            dt2.S = 0;
            ++dt2.M;
          }
          if (dt2.M >= 60) {
            dt2.M = 0;
            ++dt2.H;
          }
          break;
        case 2:
          if (dt2.u >= 0.5) {
            dt2.u = 0;
            ++dt2.S;
          }
          if (dt2.S >= 60) {
            dt2.S = 0;
            ++dt2.M;
          }
          break;
      }
      var nstr = "", jj;
      for (i2 = 0; i2 < out2.length; ++i2) {
        switch (out2[i2].t) {
          case "t":
          case "T":
          case " ":
          case "D":
            break;
          case "X":
            out2[i2].v = "";
            out2[i2].t = ";";
            break;
          case "d":
          case "m":
          case "y":
          case "h":
          case "H":
          case "M":
          case "s":
          case "e":
          case "b":
          case "Z":
            out2[i2].v = SSF_write_date(out2[i2].t.charCodeAt(0), out2[i2].v, dt2, ss0);
            out2[i2].t = "t";
            break;
          case "n":
          case "?":
            jj = i2 + 1;
            while (out2[jj] != null && ((c2 = out2[jj].t) === "?" || c2 === "D" || (c2 === " " || c2 === "t") && out2[jj + 1] != null && (out2[jj + 1].t === "?" || out2[jj + 1].t === "t" && out2[jj + 1].v === "/") || out2[i2].t === "(" && (c2 === " " || c2 === "n" || c2 === ")") || c2 === "t" && (out2[jj].v === "/" || out2[jj].v === " " && out2[jj + 1] != null && out2[jj + 1].t == "?"))) {
              out2[i2].v += out2[jj].v;
              out2[jj] = { v: "", t: ";" };
              ++jj;
            }
            nstr += out2[i2].v;
            i2 = jj - 1;
            break;
          case "G":
            out2[i2].t = "t";
            out2[i2].v = SSF_general(v4, opts);
            break;
        }
      }
      var vv = "", myv, ostr;
      if (nstr.length > 0) {
        if (nstr.charCodeAt(0) == 40) {
          myv = v4 < 0 && nstr.charCodeAt(0) === 45 ? -v4 : v4;
          ostr = write_num("n", nstr, myv);
        } else {
          myv = v4 < 0 && flen > 1 ? -v4 : v4;
          ostr = write_num("n", nstr, myv);
          if (myv < 0 && out2[0] && out2[0].t == "t") {
            ostr = ostr.substr(1);
            out2[0].v = "-" + out2[0].v;
          }
        }
        jj = ostr.length - 1;
        var decpt = out2.length;
        for (i2 = 0; i2 < out2.length; ++i2) if (out2[i2] != null && out2[i2].t != "t" && out2[i2].v.indexOf(".") > -1) {
          decpt = i2;
          break;
        }
        var lasti = out2.length;
        if (decpt === out2.length && ostr.indexOf("E") === -1) {
          for (i2 = out2.length - 1; i2 >= 0; --i2) {
            if (out2[i2] == null || "n?".indexOf(out2[i2].t) === -1) continue;
            if (jj >= out2[i2].v.length - 1) {
              jj -= out2[i2].v.length;
              out2[i2].v = ostr.substr(jj + 1, out2[i2].v.length);
            } else if (jj < 0) out2[i2].v = "";
            else {
              out2[i2].v = ostr.substr(0, jj + 1);
              jj = -1;
            }
            out2[i2].t = "t";
            lasti = i2;
          }
          if (jj >= 0 && lasti < out2.length) out2[lasti].v = ostr.substr(0, jj + 1) + out2[lasti].v;
        } else if (decpt !== out2.length && ostr.indexOf("E") === -1) {
          jj = ostr.indexOf(".") - 1;
          for (i2 = decpt; i2 >= 0; --i2) {
            if (out2[i2] == null || "n?".indexOf(out2[i2].t) === -1) continue;
            j = out2[i2].v.indexOf(".") > -1 && i2 === decpt ? out2[i2].v.indexOf(".") - 1 : out2[i2].v.length - 1;
            vv = out2[i2].v.substr(j + 1);
            for (; j >= 0; --j) {
              if (jj >= 0 && (out2[i2].v.charAt(j) === "0" || out2[i2].v.charAt(j) === "#")) vv = ostr.charAt(jj--) + vv;
            }
            out2[i2].v = vv;
            out2[i2].t = "t";
            lasti = i2;
          }
          if (jj >= 0 && lasti < out2.length) out2[lasti].v = ostr.substr(0, jj + 1) + out2[lasti].v;
          jj = ostr.indexOf(".") + 1;
          for (i2 = decpt; i2 < out2.length; ++i2) {
            if (out2[i2] == null || "n?(".indexOf(out2[i2].t) === -1 && i2 !== decpt) continue;
            j = out2[i2].v.indexOf(".") > -1 && i2 === decpt ? out2[i2].v.indexOf(".") + 1 : 0;
            vv = out2[i2].v.substr(0, j);
            for (; j < out2[i2].v.length; ++j) {
              if (jj < ostr.length) vv += ostr.charAt(jj++);
            }
            out2[i2].v = vv;
            out2[i2].t = "t";
            lasti = i2;
          }
        }
      }
      for (i2 = 0; i2 < out2.length; ++i2) if (out2[i2] != null && "n?".indexOf(out2[i2].t) > -1) {
        myv = flen > 1 && v4 < 0 && i2 > 0 && out2[i2 - 1].v === "-" ? -v4 : v4;
        out2[i2].v = write_num(out2[i2].t, out2[i2].v, myv);
        out2[i2].t = "t";
      }
      var retval = "";
      for (i2 = 0; i2 !== out2.length; ++i2) if (out2[i2] != null) retval += out2[i2].v;
      return retval;
    }
    var cfregex2 = /\[(=|>[=]?|<[>=]?)(-?\d+(?:\.\d*)?)\]/;
    function chkcond(v4, rr) {
      if (rr == null) return false;
      var thresh = parseFloat(rr[2]);
      switch (rr[1]) {
        case "=":
          if (v4 == thresh) return true;
          break;
        case ">":
          if (v4 > thresh) return true;
          break;
        case "<":
          if (v4 < thresh) return true;
          break;
        case "<>":
          if (v4 != thresh) return true;
          break;
        case ">=":
          if (v4 >= thresh) return true;
          break;
        case "<=":
          if (v4 <= thresh) return true;
          break;
      }
      return false;
    }
    function choose_fmt(f2, v4) {
      var fmt = SSF_split_fmt(f2);
      var l2 = fmt.length, lat = fmt[l2 - 1].indexOf("@");
      if (l2 < 4 && lat > -1) --l2;
      if (fmt.length > 4) throw new Error("cannot find right format for |" + fmt.join("|") + "|");
      if (typeof v4 !== "number") return [4, fmt.length === 4 || lat > -1 ? fmt[fmt.length - 1] : "@"];
      switch (fmt.length) {
        case 1:
          fmt = lat > -1 ? ["General", "General", "General", fmt[0]] : [fmt[0], fmt[0], fmt[0], "@"];
          break;
        case 2:
          fmt = lat > -1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], "@"];
          break;
        case 3:
          fmt = lat > -1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], "@"];
          break;
      }
      var ff = v4 > 0 ? fmt[0] : v4 < 0 ? fmt[1] : fmt[2];
      if (fmt[0].indexOf("[") === -1 && fmt[1].indexOf("[") === -1) return [l2, ff];
      if (fmt[0].match(/\[[=<>]/) != null || fmt[1].match(/\[[=<>]/) != null) {
        var m1 = fmt[0].match(cfregex2);
        var m2 = fmt[1].match(cfregex2);
        return chkcond(v4, m1) ? [l2, fmt[0]] : chkcond(v4, m2) ? [l2, fmt[1]] : [l2, fmt[m1 != null && m2 != null ? 2 : 1]];
      }
      return [l2, ff];
    }
    function SSF_format(fmt, v4, o2) {
      if (o2 == null) o2 = {};
      var sfmt = "";
      switch (typeof fmt) {
        case "string":
          if (fmt == "m/d/yy" && o2.dateNF) sfmt = o2.dateNF;
          else sfmt = fmt;
          break;
        case "number":
          if (fmt == 14 && o2.dateNF) sfmt = o2.dateNF;
          else sfmt = (o2.table != null ? o2.table : table_fmt)[fmt];
          if (sfmt == null) sfmt = o2.table && o2.table[SSF_default_map[fmt]] || table_fmt[SSF_default_map[fmt]];
          if (sfmt == null) sfmt = SSF_default_str[fmt] || "General";
          break;
      }
      if (SSF_isgeneral(sfmt, 0)) return SSF_general(v4, o2);
      if (v4 instanceof Date) v4 = datenum_local(v4, o2.date1904);
      var f2 = choose_fmt(sfmt, v4);
      if (SSF_isgeneral(f2[1])) return SSF_general(v4, o2);
      if (v4 === true) v4 = "TRUE";
      else if (v4 === false) v4 = "FALSE";
      else if (v4 === "" || v4 == null) return "";
      return eval_fmt(f2[1], v4, o2, f2[0]);
    }
    function SSF_load(fmt, idx) {
      if (typeof idx != "number") {
        idx = +idx || -1;
        for (var i2 = 0; i2 < 392; ++i2) {
          if (table_fmt[i2] == void 0) {
            if (idx < 0) idx = i2;
            continue;
          }
          if (table_fmt[i2] == fmt) {
            idx = i2;
            break;
          }
        }
        if (idx < 0) idx = 391;
      }
      table_fmt[idx] = fmt;
      return idx;
    }
    function SSF_load_table(tbl) {
      for (var i2 = 0; i2 != 392; ++i2)
        if (tbl[i2] !== void 0) SSF_load(tbl[i2], i2);
    }
    function make_ssf() {
      table_fmt = SSF_init_table();
    }
    var dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;
    function dateNF_regex(dateNF) {
      var fmt = typeof dateNF == "number" ? table_fmt[dateNF] : dateNF;
      fmt = fmt.replace(dateNFregex, "(\\d+)");
      return new RegExp("^" + fmt + "$");
    }
    function dateNF_fix(str, dateNF, match) {
      var Y2 = -1, m2 = -1, d2 = -1, H4 = -1, M2 = -1, S2 = -1;
      (dateNF.match(dateNFregex) || []).forEach(function(n, i2) {
        var v4 = parseInt(match[i2 + 1], 10);
        switch (n.toLowerCase().charAt(0)) {
          case "y":
            Y2 = v4;
            break;
          case "d":
            d2 = v4;
            break;
          case "h":
            H4 = v4;
            break;
          case "s":
            S2 = v4;
            break;
          case "m":
            if (H4 >= 0) M2 = v4;
            else m2 = v4;
            break;
        }
      });
      if (S2 >= 0 && M2 == -1 && m2 >= 0) {
        M2 = m2;
        m2 = -1;
      }
      var datestr = ("" + (Y2 >= 0 ? Y2 : (/* @__PURE__ */ new Date()).getFullYear())).slice(-4) + "-" + ("00" + (m2 >= 1 ? m2 : 1)).slice(-2) + "-" + ("00" + (d2 >= 1 ? d2 : 1)).slice(-2);
      if (datestr.length == 7) datestr = "0" + datestr;
      if (datestr.length == 8) datestr = "20" + datestr;
      var timestr = ("00" + (H4 >= 0 ? H4 : 0)).slice(-2) + ":" + ("00" + (M2 >= 0 ? M2 : 0)).slice(-2) + ":" + ("00" + (S2 >= 0 ? S2 : 0)).slice(-2);
      if (H4 == -1 && M2 == -1 && S2 == -1) return datestr;
      if (Y2 == -1 && m2 == -1 && d2 == -1) return timestr;
      return datestr + "T" + timestr;
    }
    var CRC32 = /* @__PURE__ */ function() {
      var CRC322 = {};
      CRC322.version = "1.2.0";
      function signed_crc_table() {
        var c2 = 0, table = new Array(256);
        for (var n = 0; n != 256; ++n) {
          c2 = n;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          c2 = c2 & 1 ? -306674912 ^ c2 >>> 1 : c2 >>> 1;
          table[n] = c2;
        }
        return typeof Int32Array !== "undefined" ? new Int32Array(table) : table;
      }
      var T0 = signed_crc_table();
      function slice_by_16_tables(T10) {
        var c2 = 0, v4 = 0, n = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096);
        for (n = 0; n != 256; ++n) table[n] = T10[n];
        for (n = 0; n != 256; ++n) {
          v4 = T10[n];
          for (c2 = 256 + n; c2 < 4096; c2 += 256) v4 = table[c2] = v4 >>> 8 ^ T10[v4 & 255];
        }
        var out2 = [];
        for (n = 1; n != 16; ++n) out2[n - 1] = typeof Int32Array !== "undefined" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);
        return out2;
      }
      var TT = slice_by_16_tables(T0);
      var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
      var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
      var Tb = TT[10], Tc = TT[11], Td = TT[12], Te2 = TT[13], Tf = TT[14];
      function crc32_bstr(bstr, seed2) {
        var C2 = seed2 ^ -1;
        for (var i2 = 0, L2 = bstr.length; i2 < L2; ) C2 = C2 >>> 8 ^ T0[(C2 ^ bstr.charCodeAt(i2++)) & 255];
        return ~C2;
      }
      function crc32_buf(B3, seed2) {
        var C2 = seed2 ^ -1, L2 = B3.length - 15, i2 = 0;
        for (; i2 < L2; ) C2 = Tf[B3[i2++] ^ C2 & 255] ^ Te2[B3[i2++] ^ C2 >> 8 & 255] ^ Td[B3[i2++] ^ C2 >> 16 & 255] ^ Tc[B3[i2++] ^ C2 >>> 24] ^ Tb[B3[i2++]] ^ Ta[B3[i2++]] ^ T9[B3[i2++]] ^ T8[B3[i2++]] ^ T7[B3[i2++]] ^ T6[B3[i2++]] ^ T5[B3[i2++]] ^ T4[B3[i2++]] ^ T3[B3[i2++]] ^ T2[B3[i2++]] ^ T1[B3[i2++]] ^ T0[B3[i2++]];
        L2 += 15;
        while (i2 < L2) C2 = C2 >>> 8 ^ T0[(C2 ^ B3[i2++]) & 255];
        return ~C2;
      }
      function crc32_str(str, seed2) {
        var C2 = seed2 ^ -1;
        for (var i2 = 0, L2 = str.length, c2 = 0, d2 = 0; i2 < L2; ) {
          c2 = str.charCodeAt(i2++);
          if (c2 < 128) {
            C2 = C2 >>> 8 ^ T0[(C2 ^ c2) & 255];
          } else if (c2 < 2048) {
            C2 = C2 >>> 8 ^ T0[(C2 ^ (192 | c2 >> 6 & 31)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c2 & 63)) & 255];
          } else if (c2 >= 55296 && c2 < 57344) {
            c2 = (c2 & 1023) + 64;
            d2 = str.charCodeAt(i2++) & 1023;
            C2 = C2 >>> 8 ^ T0[(C2 ^ (240 | c2 >> 8 & 7)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c2 >> 2 & 63)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | d2 >> 6 & 15 | (c2 & 3) << 4)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | d2 & 63)) & 255];
          } else {
            C2 = C2 >>> 8 ^ T0[(C2 ^ (224 | c2 >> 12 & 15)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c2 >> 6 & 63)) & 255];
            C2 = C2 >>> 8 ^ T0[(C2 ^ (128 | c2 & 63)) & 255];
          }
        }
        return ~C2;
      }
      CRC322.table = T0;
      CRC322.bstr = crc32_bstr;
      CRC322.buf = crc32_buf;
      CRC322.str = crc32_str;
      return CRC322;
    }();
    var CFB = /* @__PURE__ */ function _CFB() {
      var exports2 = {};
      exports2.version = "1.2.1";
      function namecmp(l2, r) {
        var L2 = l2.split("/"), R2 = r.split("/");
        for (var i3 = 0, c2 = 0, Z2 = Math.min(L2.length, R2.length); i3 < Z2; ++i3) {
          if (c2 = L2[i3].length - R2[i3].length) return c2;
          if (L2[i3] != R2[i3]) return L2[i3] < R2[i3] ? -1 : 1;
        }
        return L2.length - R2.length;
      }
      function dirname(p2) {
        if (p2.charAt(p2.length - 1) == "/") return p2.slice(0, -1).indexOf("/") === -1 ? p2 : dirname(p2.slice(0, -1));
        var c2 = p2.lastIndexOf("/");
        return c2 === -1 ? p2 : p2.slice(0, c2 + 1);
      }
      function filename(p2) {
        if (p2.charAt(p2.length - 1) == "/") return filename(p2.slice(0, -1));
        var c2 = p2.lastIndexOf("/");
        return c2 === -1 ? p2 : p2.slice(c2 + 1);
      }
      function write_dos_date(buf, date) {
        if (typeof date === "string") date = new Date(date);
        var hms = date.getHours();
        hms = hms << 6 | date.getMinutes();
        hms = hms << 5 | date.getSeconds() >>> 1;
        buf.write_shift(2, hms);
        var ymd = date.getFullYear() - 1980;
        ymd = ymd << 4 | date.getMonth() + 1;
        ymd = ymd << 5 | date.getDate();
        buf.write_shift(2, ymd);
      }
      function parse_dos_date(buf) {
        var hms = buf.read_shift(2) & 65535;
        var ymd = buf.read_shift(2) & 65535;
        var val = /* @__PURE__ */ new Date();
        var d2 = ymd & 31;
        ymd >>>= 5;
        var m2 = ymd & 15;
        ymd >>>= 4;
        val.setMilliseconds(0);
        val.setFullYear(ymd + 1980);
        val.setMonth(m2 - 1);
        val.setDate(d2);
        var S2 = hms & 31;
        hms >>>= 5;
        var M2 = hms & 63;
        hms >>>= 6;
        val.setHours(hms);
        val.setMinutes(M2);
        val.setSeconds(S2 << 1);
        return val;
      }
      function parse_extra_field(blob) {
        prep_blob(blob, 0);
        var o2 = (
          /*::(*/
          {}
        );
        var flags = 0;
        while (blob.l <= blob.length - 4) {
          var type = blob.read_shift(2);
          var sz = blob.read_shift(2), tgt = blob.l + sz;
          var p2 = {};
          switch (type) {
            /* UNIX-style Timestamps */
            case 21589:
              {
                flags = blob.read_shift(1);
                if (flags & 1) p2.mtime = blob.read_shift(4);
                if (sz > 5) {
                  if (flags & 2) p2.atime = blob.read_shift(4);
                  if (flags & 4) p2.ctime = blob.read_shift(4);
                }
                if (p2.mtime) p2.mt = new Date(p2.mtime * 1e3);
              }
              break;
          }
          blob.l = tgt;
          o2[type] = p2;
        }
        return o2;
      }
      var fs;
      function get_fs() {
        return fs || (fs = {});
      }
      function parse2(file, options) {
        if (file[0] == 80 && file[1] == 75) return parse_zip(file, options);
        if ((file[0] | 32) == 109 && (file[1] | 32) == 105) return parse_mad(file, options);
        if (file.length < 512) throw new Error("CFB file size " + file.length + " < 512");
        var mver = 3;
        var ssz = 512;
        var nmfs = 0;
        var difat_sec_cnt = 0;
        var dir_start = 0;
        var minifat_start = 0;
        var difat_start = 0;
        var fat_addrs = [];
        var blob = (
          /*::(*/
          file.slice(0, 512)
        );
        prep_blob(blob, 0);
        var mv = check_get_mver(blob);
        mver = mv[0];
        switch (mver) {
          case 3:
            ssz = 512;
            break;
          case 4:
            ssz = 4096;
            break;
          case 0:
            if (mv[1] == 0) return parse_zip(file, options);
          /* falls through */
          default:
            throw new Error("Major Version: Expected 3 or 4 saw " + mver);
        }
        if (ssz !== 512) {
          blob = /*::(*/
          file.slice(0, ssz);
          prep_blob(
            blob,
            28
            /* blob.l */
          );
        }
        var header = file.slice(0, ssz);
        check_shifts(blob, mver);
        var dir_cnt = blob.read_shift(4, "i");
        if (mver === 3 && dir_cnt !== 0) throw new Error("# Directory Sectors: Expected 0 saw " + dir_cnt);
        blob.l += 4;
        dir_start = blob.read_shift(4, "i");
        blob.l += 4;
        blob.chk("00100000", "Mini Stream Cutoff Size: ");
        minifat_start = blob.read_shift(4, "i");
        nmfs = blob.read_shift(4, "i");
        difat_start = blob.read_shift(4, "i");
        difat_sec_cnt = blob.read_shift(4, "i");
        for (var q3 = -1, j = 0; j < 109; ++j) {
          q3 = blob.read_shift(4, "i");
          if (q3 < 0) break;
          fat_addrs[j] = q3;
        }
        var sectors = sectorify(file, ssz);
        sleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);
        var sector_list = make_sector_list(sectors, dir_start, fat_addrs, ssz);
        sector_list[dir_start].name = "!Directory";
        if (nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = "!MiniFAT";
        sector_list[fat_addrs[0]].name = "!FAT";
        sector_list.fat_addrs = fat_addrs;
        sector_list.ssz = ssz;
        var files = {}, Paths = [], FileIndex = [], FullPaths = [];
        read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);
        build_full_paths(FileIndex, FullPaths, Paths);
        Paths.shift();
        var o2 = {
          FileIndex,
          FullPaths
        };
        if (options && options.raw) o2.raw = { header, sectors };
        return o2;
      }
      function check_get_mver(blob) {
        if (blob[blob.l] == 80 && blob[blob.l + 1] == 75) return [0, 0];
        blob.chk(HEADER_SIGNATURE, "Header Signature: ");
        blob.l += 16;
        var mver = blob.read_shift(2, "u");
        return [blob.read_shift(2, "u"), mver];
      }
      function check_shifts(blob, mver) {
        var shift2 = 9;
        blob.l += 2;
        switch (shift2 = blob.read_shift(2)) {
          case 9:
            if (mver != 3) throw new Error("Sector Shift: Expected 9 saw " + shift2);
            break;
          case 12:
            if (mver != 4) throw new Error("Sector Shift: Expected 12 saw " + shift2);
            break;
          default:
            throw new Error("Sector Shift: Expected 9 or 12 saw " + shift2);
        }
        blob.chk("0600", "Mini Sector Shift: ");
        blob.chk("000000000000", "Reserved: ");
      }
      function sectorify(file, ssz) {
        var nsectors = Math.ceil(file.length / ssz) - 1;
        var sectors = [];
        for (var i3 = 1; i3 < nsectors; ++i3) sectors[i3 - 1] = file.slice(i3 * ssz, (i3 + 1) * ssz);
        sectors[nsectors - 1] = file.slice(nsectors * ssz);
        return sectors;
      }
      function build_full_paths(FI, FP, Paths) {
        var i3 = 0, L2 = 0, R2 = 0, C2 = 0, j = 0, pl = Paths.length;
        var dad = [], q3 = [];
        for (; i3 < pl; ++i3) {
          dad[i3] = q3[i3] = i3;
          FP[i3] = Paths[i3];
        }
        for (; j < q3.length; ++j) {
          i3 = q3[j];
          L2 = FI[i3].L;
          R2 = FI[i3].R;
          C2 = FI[i3].C;
          if (dad[i3] === i3) {
            if (L2 !== -1 && dad[L2] !== L2) dad[i3] = dad[L2];
            if (R2 !== -1 && dad[R2] !== R2) dad[i3] = dad[R2];
          }
          if (C2 !== -1) dad[C2] = i3;
          if (L2 !== -1 && i3 != dad[i3]) {
            dad[L2] = dad[i3];
            if (q3.lastIndexOf(L2) < j) q3.push(L2);
          }
          if (R2 !== -1 && i3 != dad[i3]) {
            dad[R2] = dad[i3];
            if (q3.lastIndexOf(R2) < j) q3.push(R2);
          }
        }
        for (i3 = 1; i3 < pl; ++i3) if (dad[i3] === i3) {
          if (R2 !== -1 && dad[R2] !== R2) dad[i3] = dad[R2];
          else if (L2 !== -1 && dad[L2] !== L2) dad[i3] = dad[L2];
        }
        for (i3 = 1; i3 < pl; ++i3) {
          if (FI[i3].type === 0) continue;
          j = i3;
          if (j != dad[j]) do {
            j = dad[j];
            FP[i3] = FP[j] + "/" + FP[i3];
          } while (j !== 0 && -1 !== dad[j] && j != dad[j]);
          dad[i3] = -1;
        }
        FP[0] += "/";
        for (i3 = 1; i3 < pl; ++i3) {
          if (FI[i3].type !== 2) FP[i3] += "/";
        }
      }
      function get_mfat_entry(entry, payload, mini) {
        var start2 = entry.start, size = entry.size;
        var o2 = [];
        var idx = start2;
        while (mini && size > 0 && idx >= 0) {
          o2.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));
          size -= MSSZ;
          idx = __readInt32LE(mini, idx * 4);
        }
        if (o2.length === 0) return new_buf(0);
        return bconcat(o2).slice(0, entry.size);
      }
      function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {
        var q3 = ENDOFCHAIN;
        if (idx === ENDOFCHAIN) {
          if (cnt !== 0) throw new Error("DIFAT chain shorter than expected");
        } else if (idx !== -1) {
          var sector = sectors[idx], m2 = (ssz >>> 2) - 1;
          if (!sector) return;
          for (var i3 = 0; i3 < m2; ++i3) {
            if ((q3 = __readInt32LE(sector, i3 * 4)) === ENDOFCHAIN) break;
            fat_addrs.push(q3);
          }
          sleuth_fat(__readInt32LE(sector, ssz - 4), cnt - 1, sectors, ssz, fat_addrs);
        }
      }
      function get_sector_list(sectors, start2, fat_addrs, ssz, chkd) {
        var buf = [], buf_chain = [];
        if (!chkd) chkd = [];
        var modulus = ssz - 1, j = 0, jj = 0;
        for (j = start2; j >= 0; ) {
          chkd[j] = true;
          buf[buf.length] = j;
          buf_chain.push(sectors[j]);
          var addr = fat_addrs[Math.floor(j * 4 / ssz)];
          jj = j * 4 & modulus;
          if (ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 " + ssz);
          if (!sectors[addr]) break;
          j = __readInt32LE(sectors[addr], jj);
        }
        return { nodes: buf, data: __toBuffer([buf_chain]) };
      }
      function make_sector_list(sectors, dir_start, fat_addrs, ssz) {
        var sl = sectors.length, sector_list = [];
        var chkd = [], buf = [], buf_chain = [];
        var modulus = ssz - 1, i3 = 0, j = 0, k2 = 0, jj = 0;
        for (i3 = 0; i3 < sl; ++i3) {
          buf = [];
          k2 = i3 + dir_start;
          if (k2 >= sl) k2 -= sl;
          if (chkd[k2]) continue;
          buf_chain = [];
          var seen = [];
          for (j = k2; j >= 0; ) {
            seen[j] = true;
            chkd[j] = true;
            buf[buf.length] = j;
            buf_chain.push(sectors[j]);
            var addr = fat_addrs[Math.floor(j * 4 / ssz)];
            jj = j * 4 & modulus;
            if (ssz < 4 + jj) throw new Error("FAT boundary crossed: " + j + " 4 " + ssz);
            if (!sectors[addr]) break;
            j = __readInt32LE(sectors[addr], jj);
            if (seen[j]) break;
          }
          sector_list[k2] = { nodes: buf, data: __toBuffer([buf_chain]) };
        }
        return sector_list;
      }
      function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {
        var minifat_store = 0, pl = Paths.length ? 2 : 0;
        var sector = sector_list[dir_start].data;
        var i3 = 0, namelen = 0, name;
        for (; i3 < sector.length; i3 += 128) {
          var blob = (
            /*::(*/
            sector.slice(i3, i3 + 128)
          );
          prep_blob(blob, 64);
          namelen = blob.read_shift(2);
          name = __utf16le(blob, 0, namelen - pl);
          Paths.push(name);
          var o2 = {
            name,
            type: blob.read_shift(1),
            color: blob.read_shift(1),
            L: blob.read_shift(4, "i"),
            R: blob.read_shift(4, "i"),
            C: blob.read_shift(4, "i"),
            clsid: blob.read_shift(16),
            state: blob.read_shift(4, "i"),
            start: 0,
            size: 0
          };
          var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
          if (ctime !== 0) o2.ct = read_date(blob, blob.l - 8);
          var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);
          if (mtime !== 0) o2.mt = read_date(blob, blob.l - 8);
          o2.start = blob.read_shift(4, "i");
          o2.size = blob.read_shift(4, "i");
          if (o2.size < 0 && o2.start < 0) {
            o2.size = o2.type = 0;
            o2.start = ENDOFCHAIN;
            o2.name = "";
          }
          if (o2.type === 5) {
            minifat_store = o2.start;
            if (nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = "!StreamData";
          } else if (o2.size >= 4096) {
            o2.storage = "fat";
            if (sector_list[o2.start] === void 0) sector_list[o2.start] = get_sector_list(sectors, o2.start, sector_list.fat_addrs, sector_list.ssz);
            sector_list[o2.start].name = o2.name;
            o2.content = sector_list[o2.start].data.slice(0, o2.size);
          } else {
            o2.storage = "minifat";
            if (o2.size < 0) o2.size = 0;
            else if (minifat_store !== ENDOFCHAIN && o2.start !== ENDOFCHAIN && sector_list[minifat_store]) {
              o2.content = get_mfat_entry(o2, sector_list[minifat_store].data, (sector_list[mini] || {}).data);
            }
          }
          if (o2.content) prep_blob(o2.content, 0);
          files[name] = o2;
          FileIndex.push(o2);
        }
      }
      function read_date(blob, offset2) {
        return new Date((__readUInt32LE(blob, offset2 + 4) / 1e7 * Math.pow(2, 32) + __readUInt32LE(blob, offset2) / 1e7 - 11644473600) * 1e3);
      }
      function read_file(filename2, options) {
        get_fs();
        return parse2(fs.readFileSync(filename2), options);
      }
      function read(blob, options) {
        var type = options && options.type;
        if (!type) {
          if (has_buf && Buffer.isBuffer(blob)) type = "buffer";
        }
        switch (type || "base64") {
          case "file":
            return read_file(blob, options);
          case "base64":
            return parse2(s2a(Base64_decode(blob)), options);
          case "binary":
            return parse2(s2a(blob), options);
        }
        return parse2(
          /*::typeof blob == 'string' ? new Buffer(blob, 'utf-8') : */
          blob,
          options
        );
      }
      function init_cfb(cfb, opts) {
        var o2 = opts || {}, root2 = o2.root || "Root Entry";
        if (!cfb.FullPaths) cfb.FullPaths = [];
        if (!cfb.FileIndex) cfb.FileIndex = [];
        if (cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error("inconsistent CFB structure");
        if (cfb.FullPaths.length === 0) {
          cfb.FullPaths[0] = root2 + "/";
          cfb.FileIndex[0] = { name: root2, type: 5 };
        }
        if (o2.CLSID) cfb.FileIndex[0].clsid = o2.CLSID;
        seed_cfb(cfb);
      }
      function seed_cfb(cfb) {
        var nm = "Sh33tJ5";
        if (CFB.find(cfb, "/" + nm)) return;
        var p2 = new_buf(4);
        p2[0] = 55;
        p2[1] = p2[3] = 50;
        p2[2] = 54;
        cfb.FileIndex.push({ name: nm, type: 2, content: p2, size: 4, L: 69, R: 69, C: 69 });
        cfb.FullPaths.push(cfb.FullPaths[0] + nm);
        rebuild_cfb(cfb);
      }
      function rebuild_cfb(cfb, f2) {
        init_cfb(cfb);
        var gc = false, s2 = false;
        for (var i3 = cfb.FullPaths.length - 1; i3 >= 0; --i3) {
          var _file = cfb.FileIndex[i3];
          switch (_file.type) {
            case 0:
              if (s2) gc = true;
              else {
                cfb.FileIndex.pop();
                cfb.FullPaths.pop();
              }
              break;
            case 1:
            case 2:
            case 5:
              s2 = true;
              if (isNaN(_file.R * _file.L * _file.C)) gc = true;
              if (_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;
              break;
            default:
              gc = true;
              break;
          }
        }
        if (!gc && !f2) return;
        var now2 = new Date(1987, 1, 19), j = 0;
        var fullPaths = Object.create ? /* @__PURE__ */ Object.create(null) : {};
        var data = [];
        for (i3 = 0; i3 < cfb.FullPaths.length; ++i3) {
          fullPaths[cfb.FullPaths[i3]] = true;
          if (cfb.FileIndex[i3].type === 0) continue;
          data.push([cfb.FullPaths[i3], cfb.FileIndex[i3]]);
        }
        for (i3 = 0; i3 < data.length; ++i3) {
          var dad = dirname(data[i3][0]);
          s2 = fullPaths[dad];
          if (!s2) {
            data.push([dad, {
              name: filename(dad).replace("/", ""),
              type: 1,
              clsid: HEADER_CLSID,
              ct: now2,
              mt: now2,
              content: null
            }]);
            fullPaths[dad] = true;
          }
        }
        data.sort(function(x2, y) {
          return namecmp(x2[0], y[0]);
        });
        cfb.FullPaths = [];
        cfb.FileIndex = [];
        for (i3 = 0; i3 < data.length; ++i3) {
          cfb.FullPaths[i3] = data[i3][0];
          cfb.FileIndex[i3] = data[i3][1];
        }
        for (i3 = 0; i3 < data.length; ++i3) {
          var elt = cfb.FileIndex[i3];
          var nm = cfb.FullPaths[i3];
          elt.name = filename(nm).replace("/", "");
          elt.L = elt.R = elt.C = -(elt.color = 1);
          elt.size = elt.content ? elt.content.length : 0;
          elt.start = 0;
          elt.clsid = elt.clsid || HEADER_CLSID;
          if (i3 === 0) {
            elt.C = data.length > 1 ? 1 : -1;
            elt.size = 0;
            elt.type = 5;
          } else if (nm.slice(-1) == "/") {
            for (j = i3 + 1; j < data.length; ++j) if (dirname(cfb.FullPaths[j]) == nm) break;
            elt.C = j >= data.length ? -1 : j;
            for (j = i3 + 1; j < data.length; ++j) if (dirname(cfb.FullPaths[j]) == dirname(nm)) break;
            elt.R = j >= data.length ? -1 : j;
            elt.type = 1;
          } else {
            if (dirname(cfb.FullPaths[i3 + 1] || "") == dirname(nm)) elt.R = i3 + 1;
            elt.type = 2;
          }
        }
      }
      function _write(cfb, options) {
        var _opts = options || {};
        if (_opts.fileType == "mad") return write_mad(cfb, _opts);
        rebuild_cfb(cfb);
        switch (_opts.fileType) {
          case "zip":
            return write_zip2(cfb, _opts);
        }
        var L2 = function(cfb2) {
          var mini_size = 0, fat_size = 0;
          for (var i4 = 0; i4 < cfb2.FileIndex.length; ++i4) {
            var file2 = cfb2.FileIndex[i4];
            if (!file2.content) continue;
            var flen2 = file2.content.length;
            if (flen2 > 0) {
              if (flen2 < 4096) mini_size += flen2 + 63 >> 6;
              else fat_size += flen2 + 511 >> 9;
            }
          }
          var dir_cnt = cfb2.FullPaths.length + 3 >> 2;
          var mini_cnt = mini_size + 7 >> 3;
          var mfat_cnt = mini_size + 127 >> 7;
          var fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;
          var fat_cnt = fat_base + 127 >> 7;
          var difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt - 109) / 127);
          while (fat_base + fat_cnt + difat_cnt + 127 >> 7 > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt - 109) / 127);
          var L3 = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];
          cfb2.FileIndex[0].size = mini_size << 6;
          L3[7] = (cfb2.FileIndex[0].start = L3[0] + L3[1] + L3[2] + L3[3] + L3[4] + L3[5]) + (L3[6] + 7 >> 3);
          return L3;
        }(cfb);
        var o2 = new_buf(L2[7] << 9);
        var i3 = 0, T2 = 0;
        {
          for (i3 = 0; i3 < 8; ++i3) o2.write_shift(1, HEADER_SIG[i3]);
          for (i3 = 0; i3 < 8; ++i3) o2.write_shift(2, 0);
          o2.write_shift(2, 62);
          o2.write_shift(2, 3);
          o2.write_shift(2, 65534);
          o2.write_shift(2, 9);
          o2.write_shift(2, 6);
          for (i3 = 0; i3 < 3; ++i3) o2.write_shift(2, 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, L2[2]);
          o2.write_shift(4, L2[0] + L2[1] + L2[2] + L2[3] - 1);
          o2.write_shift(4, 0);
          o2.write_shift(4, 1 << 12);
          o2.write_shift(4, L2[3] ? L2[0] + L2[1] + L2[2] - 1 : ENDOFCHAIN);
          o2.write_shift(4, L2[3]);
          o2.write_shift(-4, L2[1] ? L2[0] - 1 : ENDOFCHAIN);
          o2.write_shift(4, L2[1]);
          for (i3 = 0; i3 < 109; ++i3) o2.write_shift(-4, i3 < L2[2] ? L2[1] + i3 : -1);
        }
        if (L2[1]) {
          for (T2 = 0; T2 < L2[1]; ++T2) {
            for (; i3 < 236 + T2 * 127; ++i3) o2.write_shift(-4, i3 < L2[2] ? L2[1] + i3 : -1);
            o2.write_shift(-4, T2 === L2[1] - 1 ? ENDOFCHAIN : T2 + 1);
          }
        }
        var chainit = function(w2) {
          for (T2 += w2; i3 < T2 - 1; ++i3) o2.write_shift(-4, i3 + 1);
          if (w2) {
            ++i3;
            o2.write_shift(-4, ENDOFCHAIN);
          }
        };
        T2 = i3 = 0;
        for (T2 += L2[1]; i3 < T2; ++i3) o2.write_shift(-4, consts.DIFSECT);
        for (T2 += L2[2]; i3 < T2; ++i3) o2.write_shift(-4, consts.FATSECT);
        chainit(L2[3]);
        chainit(L2[4]);
        var j = 0, flen = 0;
        var file = cfb.FileIndex[0];
        for (; j < cfb.FileIndex.length; ++j) {
          file = cfb.FileIndex[j];
          if (!file.content) continue;
          flen = file.content.length;
          if (flen < 4096) continue;
          file.start = T2;
          chainit(flen + 511 >> 9);
        }
        chainit(L2[6] + 7 >> 3);
        while (o2.l & 511) o2.write_shift(-4, consts.ENDOFCHAIN);
        T2 = i3 = 0;
        for (j = 0; j < cfb.FileIndex.length; ++j) {
          file = cfb.FileIndex[j];
          if (!file.content) continue;
          flen = file.content.length;
          if (!flen || flen >= 4096) continue;
          file.start = T2;
          chainit(flen + 63 >> 6);
        }
        while (o2.l & 511) o2.write_shift(-4, consts.ENDOFCHAIN);
        for (i3 = 0; i3 < L2[4] << 2; ++i3) {
          var nm = cfb.FullPaths[i3];
          if (!nm || nm.length === 0) {
            for (j = 0; j < 17; ++j) o2.write_shift(4, 0);
            for (j = 0; j < 3; ++j) o2.write_shift(4, -1);
            for (j = 0; j < 12; ++j) o2.write_shift(4, 0);
            continue;
          }
          file = cfb.FileIndex[i3];
          if (i3 === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;
          var _nm = i3 === 0 && _opts.root || file.name;
          flen = 2 * (_nm.length + 1);
          o2.write_shift(64, _nm, "utf16le");
          o2.write_shift(2, flen);
          o2.write_shift(1, file.type);
          o2.write_shift(1, file.color);
          o2.write_shift(-4, file.L);
          o2.write_shift(-4, file.R);
          o2.write_shift(-4, file.C);
          if (!file.clsid) for (j = 0; j < 4; ++j) o2.write_shift(4, 0);
          else o2.write_shift(16, file.clsid, "hex");
          o2.write_shift(4, file.state || 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, file.start);
          o2.write_shift(4, file.size);
          o2.write_shift(4, 0);
        }
        for (i3 = 1; i3 < cfb.FileIndex.length; ++i3) {
          file = cfb.FileIndex[i3];
          if (file.size >= 4096) {
            o2.l = file.start + 1 << 9;
            if (has_buf && Buffer.isBuffer(file.content)) {
              file.content.copy(o2, o2.l, 0, file.size);
              o2.l += file.size + 511 & -512;
            } else {
              for (j = 0; j < file.size; ++j) o2.write_shift(1, file.content[j]);
              for (; j & 511; ++j) o2.write_shift(1, 0);
            }
          }
        }
        for (i3 = 1; i3 < cfb.FileIndex.length; ++i3) {
          file = cfb.FileIndex[i3];
          if (file.size > 0 && file.size < 4096) {
            if (has_buf && Buffer.isBuffer(file.content)) {
              file.content.copy(o2, o2.l, 0, file.size);
              o2.l += file.size + 63 & -64;
            } else {
              for (j = 0; j < file.size; ++j) o2.write_shift(1, file.content[j]);
              for (; j & 63; ++j) o2.write_shift(1, 0);
            }
          }
        }
        if (has_buf) {
          o2.l = o2.length;
        } else {
          while (o2.l < o2.length) o2.write_shift(1, 0);
        }
        return o2;
      }
      function find2(cfb, path) {
        var UCFullPaths = cfb.FullPaths.map(function(x2) {
          return x2.toUpperCase();
        });
        var UCPaths = UCFullPaths.map(function(x2) {
          var y = x2.split("/");
          return y[y.length - (x2.slice(-1) == "/" ? 2 : 1)];
        });
        var k2 = false;
        if (path.charCodeAt(0) === 47) {
          k2 = true;
          path = UCFullPaths[0].slice(0, -1) + path;
        } else k2 = path.indexOf("/") !== -1;
        var UCPath = path.toUpperCase();
        var w2 = k2 === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);
        if (w2 !== -1) return cfb.FileIndex[w2];
        var m2 = !UCPath.match(chr1);
        UCPath = UCPath.replace(chr0, "");
        if (m2) UCPath = UCPath.replace(chr1, "!");
        for (w2 = 0; w2 < UCFullPaths.length; ++w2) {
          if ((m2 ? UCFullPaths[w2].replace(chr1, "!") : UCFullPaths[w2]).replace(chr0, "") == UCPath) return cfb.FileIndex[w2];
          if ((m2 ? UCPaths[w2].replace(chr1, "!") : UCPaths[w2]).replace(chr0, "") == UCPath) return cfb.FileIndex[w2];
        }
        return null;
      }
      var MSSZ = 64;
      var ENDOFCHAIN = -2;
      var HEADER_SIGNATURE = "d0cf11e0a1b11ae1";
      var HEADER_SIG = [208, 207, 17, 224, 161, 177, 26, 225];
      var HEADER_CLSID = "00000000000000000000000000000000";
      var consts = {
        /* 2.1 Compund File Sector Numbers and Types */
        MAXREGSECT: -6,
        DIFSECT: -4,
        FATSECT: -3,
        ENDOFCHAIN,
        FREESECT: -1,
        /* 2.2 Compound File Header */
        HEADER_SIGNATURE,
        HEADER_MINOR_VERSION: "3e00",
        MAXREGSID: -6,
        NOSTREAM: -1,
        HEADER_CLSID,
        /* 2.6.1 Compound File Directory Entry */
        EntryTypes: ["unknown", "storage", "stream", "lockbytes", "property", "root"]
      };
      function write_file(cfb, filename2, options) {
        get_fs();
        var o2 = _write(cfb, options);
        fs.writeFileSync(filename2, o2);
      }
      function a2s2(o2) {
        var out2 = new Array(o2.length);
        for (var i3 = 0; i3 < o2.length; ++i3) out2[i3] = String.fromCharCode(o2[i3]);
        return out2.join("");
      }
      function write(cfb, options) {
        var o2 = _write(cfb, options);
        switch (options && options.type || "buffer") {
          case "file":
            get_fs();
            fs.writeFileSync(options.filename, o2);
            return o2;
          case "binary":
            return typeof o2 == "string" ? o2 : a2s2(o2);
          case "base64":
            return Base64_encode(typeof o2 == "string" ? o2 : a2s2(o2));
          case "buffer":
            if (has_buf) return Buffer.isBuffer(o2) ? o2 : Buffer_from(o2);
          /* falls through */
          case "array":
            return typeof o2 == "string" ? s2a(o2) : o2;
        }
        return o2;
      }
      var _zlib;
      function use_zlib(zlib) {
        try {
          var InflateRaw = zlib.InflateRaw;
          var InflRaw = new InflateRaw();
          InflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);
          if (InflRaw.bytesRead) _zlib = zlib;
          else throw new Error("zlib does not expose bytesRead");
        } catch (e2) {
          console.error("cannot use native zlib: " + (e2.message || e2));
        }
      }
      function _inflateRawSync(payload, usz) {
        if (!_zlib) return _inflate(payload, usz);
        var InflateRaw = _zlib.InflateRaw;
        var InflRaw = new InflateRaw();
        var out2 = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag);
        payload.l += InflRaw.bytesRead;
        return out2;
      }
      function _deflateRawSync(payload) {
        return _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload);
      }
      var CLEN_ORDER = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
      var LEN_LN = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258];
      var DST_LN = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577];
      function bit_swap_8(n) {
        var t = (n << 1 | n << 11) & 139536 | (n << 5 | n << 15) & 558144;
        return (t >> 16 | t >> 8 | t) & 255;
      }
      var use_typed_arrays = typeof Uint8Array !== "undefined";
      var bitswap8 = use_typed_arrays ? new Uint8Array(1 << 8) : [];
      for (var q2 = 0; q2 < 1 << 8; ++q2) bitswap8[q2] = bit_swap_8(q2);
      function bit_swap_n(n, b2) {
        var rev = bitswap8[n & 255];
        if (b2 <= 8) return rev >>> 8 - b2;
        rev = rev << 8 | bitswap8[n >> 8 & 255];
        if (b2 <= 16) return rev >>> 16 - b2;
        rev = rev << 8 | bitswap8[n >> 16 & 255];
        return rev >>> 24 - b2;
      }
      function read_bits_2(buf, bl) {
        var w2 = bl & 7, h2 = bl >>> 3;
        return (buf[h2] | (w2 <= 6 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 3;
      }
      function read_bits_3(buf, bl) {
        var w2 = bl & 7, h2 = bl >>> 3;
        return (buf[h2] | (w2 <= 5 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 7;
      }
      function read_bits_4(buf, bl) {
        var w2 = bl & 7, h2 = bl >>> 3;
        return (buf[h2] | (w2 <= 4 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 15;
      }
      function read_bits_5(buf, bl) {
        var w2 = bl & 7, h2 = bl >>> 3;
        return (buf[h2] | (w2 <= 3 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 31;
      }
      function read_bits_7(buf, bl) {
        var w2 = bl & 7, h2 = bl >>> 3;
        return (buf[h2] | (w2 <= 1 ? 0 : buf[h2 + 1] << 8)) >>> w2 & 127;
      }
      function read_bits_n(buf, bl, n) {
        var w2 = bl & 7, h2 = bl >>> 3, f2 = (1 << n) - 1;
        var v4 = buf[h2] >>> w2;
        if (n < 8 - w2) return v4 & f2;
        v4 |= buf[h2 + 1] << 8 - w2;
        if (n < 16 - w2) return v4 & f2;
        v4 |= buf[h2 + 2] << 16 - w2;
        if (n < 24 - w2) return v4 & f2;
        v4 |= buf[h2 + 3] << 24 - w2;
        return v4 & f2;
      }
      function write_bits_3(buf, bl, v4) {
        var w2 = bl & 7, h2 = bl >>> 3;
        if (w2 <= 5) buf[h2] |= (v4 & 7) << w2;
        else {
          buf[h2] |= v4 << w2 & 255;
          buf[h2 + 1] = (v4 & 7) >> 8 - w2;
        }
        return bl + 3;
      }
      function write_bits_1(buf, bl, v4) {
        var w2 = bl & 7, h2 = bl >>> 3;
        v4 = (v4 & 1) << w2;
        buf[h2] |= v4;
        return bl + 1;
      }
      function write_bits_8(buf, bl, v4) {
        var w2 = bl & 7, h2 = bl >>> 3;
        v4 <<= w2;
        buf[h2] |= v4 & 255;
        v4 >>>= 8;
        buf[h2 + 1] = v4;
        return bl + 8;
      }
      function write_bits_16(buf, bl, v4) {
        var w2 = bl & 7, h2 = bl >>> 3;
        v4 <<= w2;
        buf[h2] |= v4 & 255;
        v4 >>>= 8;
        buf[h2 + 1] = v4 & 255;
        buf[h2 + 2] = v4 >>> 8;
        return bl + 16;
      }
      function realloc(b2, sz) {
        var L2 = b2.length, M2 = 2 * L2 > sz ? 2 * L2 : sz + 5, i3 = 0;
        if (L2 >= sz) return b2;
        if (has_buf) {
          var o2 = new_unsafe_buf(M2);
          if (b2.copy) b2.copy(o2);
          else for (; i3 < b2.length; ++i3) o2[i3] = b2[i3];
          return o2;
        } else if (use_typed_arrays) {
          var a2 = new Uint8Array(M2);
          if (a2.set) a2.set(b2);
          else for (; i3 < L2; ++i3) a2[i3] = b2[i3];
          return a2;
        }
        b2.length = M2;
        return b2;
      }
      function zero_fill_array(n) {
        var o2 = new Array(n);
        for (var i3 = 0; i3 < n; ++i3) o2[i3] = 0;
        return o2;
      }
      function build_tree(clens, cmap, MAX) {
        var maxlen = 1, w2 = 0, i3 = 0, j = 0, ccode = 0, L2 = clens.length;
        var bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
        for (i3 = 0; i3 < 32; ++i3) bl_count[i3] = 0;
        for (i3 = L2; i3 < MAX; ++i3) clens[i3] = 0;
        L2 = clens.length;
        var ctree = use_typed_arrays ? new Uint16Array(L2) : zero_fill_array(L2);
        for (i3 = 0; i3 < L2; ++i3) {
          bl_count[w2 = clens[i3]]++;
          if (maxlen < w2) maxlen = w2;
          ctree[i3] = 0;
        }
        bl_count[0] = 0;
        for (i3 = 1; i3 <= maxlen; ++i3) bl_count[i3 + 16] = ccode = ccode + bl_count[i3 - 1] << 1;
        for (i3 = 0; i3 < L2; ++i3) {
          ccode = clens[i3];
          if (ccode != 0) ctree[i3] = bl_count[ccode + 16]++;
        }
        var cleni = 0;
        for (i3 = 0; i3 < L2; ++i3) {
          cleni = clens[i3];
          if (cleni != 0) {
            ccode = bit_swap_n(ctree[i3], maxlen) >> maxlen - cleni;
            for (j = (1 << maxlen + 4 - cleni) - 1; j >= 0; --j)
              cmap[ccode | j << cleni] = cleni & 15 | i3 << 4;
          }
        }
        return maxlen;
      }
      var fix_lmap = use_typed_arrays ? new Uint16Array(512) : zero_fill_array(512);
      var fix_dmap = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);
      if (!use_typed_arrays) {
        for (var i2 = 0; i2 < 512; ++i2) fix_lmap[i2] = 0;
        for (i2 = 0; i2 < 32; ++i2) fix_dmap[i2] = 0;
      }
      (function() {
        var dlens = [];
        var i3 = 0;
        for (; i3 < 32; i3++) dlens.push(5);
        build_tree(dlens, fix_dmap, 32);
        var clens = [];
        i3 = 0;
        for (; i3 <= 143; i3++) clens.push(8);
        for (; i3 <= 255; i3++) clens.push(9);
        for (; i3 <= 279; i3++) clens.push(7);
        for (; i3 <= 287; i3++) clens.push(8);
        build_tree(clens, fix_lmap, 288);
      })();
      var _deflateRaw = /* @__PURE__ */ function _deflateRawIIFE() {
        var DST_LN_RE = use_typed_arrays ? new Uint8Array(32768) : [];
        var j = 0, k2 = 0;
        for (; j < DST_LN.length - 1; ++j) {
          for (; k2 < DST_LN[j + 1]; ++k2) DST_LN_RE[k2] = j;
        }
        for (; k2 < 32768; ++k2) DST_LN_RE[k2] = 29;
        var LEN_LN_RE = use_typed_arrays ? new Uint8Array(259) : [];
        for (j = 0, k2 = 0; j < LEN_LN.length - 1; ++j) {
          for (; k2 < LEN_LN[j + 1]; ++k2) LEN_LN_RE[k2] = j;
        }
        function write_stored(data, out2) {
          var boff = 0;
          while (boff < data.length) {
            var L2 = Math.min(65535, data.length - boff);
            var h2 = boff + L2 == data.length;
            out2.write_shift(1, +h2);
            out2.write_shift(2, L2);
            out2.write_shift(2, ~L2 & 65535);
            while (L2-- > 0) out2[out2.l++] = data[boff++];
          }
          return out2.l;
        }
        function write_huff_fixed(data, out2) {
          var bl = 0;
          var boff = 0;
          var addrs = use_typed_arrays ? new Uint16Array(32768) : [];
          while (boff < data.length) {
            var L2 = (
              /* data.length - boff; */
              Math.min(65535, data.length - boff)
            );
            if (L2 < 10) {
              bl = write_bits_3(out2, bl, +!!(boff + L2 == data.length));
              if (bl & 7) bl += 8 - (bl & 7);
              out2.l = bl / 8 | 0;
              out2.write_shift(2, L2);
              out2.write_shift(2, ~L2 & 65535);
              while (L2-- > 0) out2[out2.l++] = data[boff++];
              bl = out2.l * 8;
              continue;
            }
            bl = write_bits_3(out2, bl, +!!(boff + L2 == data.length) + 2);
            var hash = 0;
            while (L2-- > 0) {
              var d2 = data[boff];
              hash = (hash << 5 ^ d2) & 32767;
              var match = -1, mlen = 0;
              if (match = addrs[hash]) {
                match |= boff & -32768;
                if (match > boff) match -= 32768;
                if (match < boff) while (data[match + mlen] == data[boff + mlen] && mlen < 250) ++mlen;
              }
              if (mlen > 2) {
                d2 = LEN_LN_RE[mlen];
                if (d2 <= 22) bl = write_bits_8(out2, bl, bitswap8[d2 + 1] >> 1) - 1;
                else {
                  write_bits_8(out2, bl, 3);
                  bl += 5;
                  write_bits_8(out2, bl, bitswap8[d2 - 23] >> 5);
                  bl += 3;
                }
                var len_eb = d2 < 8 ? 0 : d2 - 4 >> 2;
                if (len_eb > 0) {
                  write_bits_16(out2, bl, mlen - LEN_LN[d2]);
                  bl += len_eb;
                }
                d2 = DST_LN_RE[boff - match];
                bl = write_bits_8(out2, bl, bitswap8[d2] >> 3);
                bl -= 3;
                var dst_eb = d2 < 4 ? 0 : d2 - 2 >> 1;
                if (dst_eb > 0) {
                  write_bits_16(out2, bl, boff - match - DST_LN[d2]);
                  bl += dst_eb;
                }
                for (var q3 = 0; q3 < mlen; ++q3) {
                  addrs[hash] = boff & 32767;
                  hash = (hash << 5 ^ data[boff]) & 32767;
                  ++boff;
                }
                L2 -= mlen - 1;
              } else {
                if (d2 <= 143) d2 = d2 + 48;
                else bl = write_bits_1(out2, bl, 1);
                bl = write_bits_8(out2, bl, bitswap8[d2]);
                addrs[hash] = boff & 32767;
                ++boff;
              }
            }
            bl = write_bits_8(out2, bl, 0) - 1;
          }
          out2.l = (bl + 7) / 8 | 0;
          return out2.l;
        }
        return function _deflateRaw2(data, out2) {
          if (data.length < 8) return write_stored(data, out2);
          return write_huff_fixed(data, out2);
        };
      }();
      function _deflate(data) {
        var buf = new_buf(50 + Math.floor(data.length * 1.1));
        var off = _deflateRaw(data, buf);
        return buf.slice(0, off);
      }
      var dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
      var dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);
      var dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);
      var dyn_len_1 = 1, dyn_len_2 = 1;
      function dyn(data, boff) {
        var _HLIT = read_bits_5(data, boff) + 257;
        boff += 5;
        var _HDIST = read_bits_5(data, boff) + 1;
        boff += 5;
        var _HCLEN = read_bits_4(data, boff) + 4;
        boff += 4;
        var w2 = 0;
        var clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);
        var ctree = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        var maxlen = 1;
        var bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
        var next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);
        var L2 = clens.length;
        for (var i3 = 0; i3 < _HCLEN; ++i3) {
          clens[CLEN_ORDER[i3]] = w2 = read_bits_3(data, boff);
          if (maxlen < w2) maxlen = w2;
          bl_count[w2]++;
          boff += 3;
        }
        var ccode = 0;
        bl_count[0] = 0;
        for (i3 = 1; i3 <= maxlen; ++i3) next_code[i3] = ccode = ccode + bl_count[i3 - 1] << 1;
        for (i3 = 0; i3 < L2; ++i3) if ((ccode = clens[i3]) != 0) ctree[i3] = next_code[ccode]++;
        var cleni = 0;
        for (i3 = 0; i3 < L2; ++i3) {
          cleni = clens[i3];
          if (cleni != 0) {
            ccode = bitswap8[ctree[i3]] >> 8 - cleni;
            for (var j = (1 << 7 - cleni) - 1; j >= 0; --j) dyn_cmap[ccode | j << cleni] = cleni & 7 | i3 << 3;
          }
        }
        var hcodes = [];
        maxlen = 1;
        for (; hcodes.length < _HLIT + _HDIST; ) {
          ccode = dyn_cmap[read_bits_7(data, boff)];
          boff += ccode & 7;
          switch (ccode >>>= 3) {
            case 16:
              w2 = 3 + read_bits_2(data, boff);
              boff += 2;
              ccode = hcodes[hcodes.length - 1];
              while (w2-- > 0) hcodes.push(ccode);
              break;
            case 17:
              w2 = 3 + read_bits_3(data, boff);
              boff += 3;
              while (w2-- > 0) hcodes.push(0);
              break;
            case 18:
              w2 = 11 + read_bits_7(data, boff);
              boff += 7;
              while (w2-- > 0) hcodes.push(0);
              break;
            default:
              hcodes.push(ccode);
              if (maxlen < ccode) maxlen = ccode;
              break;
          }
        }
        var h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT);
        for (i3 = _HLIT; i3 < 286; ++i3) h1[i3] = 0;
        for (i3 = _HDIST; i3 < 30; ++i3) h2[i3] = 0;
        dyn_len_1 = build_tree(h1, dyn_lmap, 286);
        dyn_len_2 = build_tree(h2, dyn_dmap, 30);
        return boff;
      }
      function inflate(data, usz) {
        if (data[0] == 3 && !(data[1] & 3)) {
          return [new_raw_buf(usz), 2];
        }
        var boff = 0;
        var header = 0;
        var outbuf = new_unsafe_buf(usz ? usz : 1 << 18);
        var woff = 0;
        var OL = outbuf.length >>> 0;
        var max_len_1 = 0, max_len_2 = 0;
        while ((header & 1) == 0) {
          header = read_bits_3(data, boff);
          boff += 3;
          if (header >>> 1 == 0) {
            if (boff & 7) boff += 8 - (boff & 7);
            var sz = data[boff >>> 3] | data[(boff >>> 3) + 1] << 8;
            boff += 32;
            if (sz > 0) {
              if (!usz && OL < woff + sz) {
                outbuf = realloc(outbuf, woff + sz);
                OL = outbuf.length;
              }
              while (sz-- > 0) {
                outbuf[woff++] = data[boff >>> 3];
                boff += 8;
              }
            }
            continue;
          } else if (header >> 1 == 1) {
            max_len_1 = 9;
            max_len_2 = 5;
          } else {
            boff = dyn(data, boff);
            max_len_1 = dyn_len_1;
            max_len_2 = dyn_len_2;
          }
          for (; ; ) {
            if (!usz && OL < woff + 32767) {
              outbuf = realloc(outbuf, woff + 32767);
              OL = outbuf.length;
            }
            var bits = read_bits_n(data, boff, max_len_1);
            var code = header >>> 1 == 1 ? fix_lmap[bits] : dyn_lmap[bits];
            boff += code & 15;
            code >>>= 4;
            if ((code >>> 8 & 255) === 0) outbuf[woff++] = code;
            else if (code == 256) break;
            else {
              code -= 257;
              var len_eb = code < 8 ? 0 : code - 4 >> 2;
              if (len_eb > 5) len_eb = 0;
              var tgt = woff + LEN_LN[code];
              if (len_eb > 0) {
                tgt += read_bits_n(data, boff, len_eb);
                boff += len_eb;
              }
              bits = read_bits_n(data, boff, max_len_2);
              code = header >>> 1 == 1 ? fix_dmap[bits] : dyn_dmap[bits];
              boff += code & 15;
              code >>>= 4;
              var dst_eb = code < 4 ? 0 : code - 2 >> 1;
              var dst = DST_LN[code];
              if (dst_eb > 0) {
                dst += read_bits_n(data, boff, dst_eb);
                boff += dst_eb;
              }
              if (!usz && OL < tgt) {
                outbuf = realloc(outbuf, tgt + 100);
                OL = outbuf.length;
              }
              while (woff < tgt) {
                outbuf[woff] = outbuf[woff - dst];
                ++woff;
              }
            }
          }
        }
        if (usz) return [outbuf, boff + 7 >>> 3];
        return [outbuf.slice(0, woff), boff + 7 >>> 3];
      }
      function _inflate(payload, usz) {
        var data = payload.slice(payload.l || 0);
        var out2 = inflate(data, usz);
        payload.l += out2[1];
        return out2[0];
      }
      function warn_or_throw(wrn, msg) {
        if (wrn) {
          if (typeof console !== "undefined") console.error(msg);
        } else throw new Error(msg);
      }
      function parse_zip(file, options) {
        var blob = (
          /*::(*/
          file
        );
        prep_blob(blob, 0);
        var FileIndex = [], FullPaths = [];
        var o2 = {
          FileIndex,
          FullPaths
        };
        init_cfb(o2, { root: options.root });
        var i3 = blob.length - 4;
        while ((blob[i3] != 80 || blob[i3 + 1] != 75 || blob[i3 + 2] != 5 || blob[i3 + 3] != 6) && i3 >= 0) --i3;
        blob.l = i3 + 4;
        blob.l += 4;
        var fcnt = blob.read_shift(2);
        blob.l += 6;
        var start_cd = blob.read_shift(4);
        blob.l = start_cd;
        for (i3 = 0; i3 < fcnt; ++i3) {
          blob.l += 20;
          var csz = blob.read_shift(4);
          var usz = blob.read_shift(4);
          var namelen = blob.read_shift(2);
          var efsz = blob.read_shift(2);
          var fcsz = blob.read_shift(2);
          blob.l += 8;
          var offset2 = blob.read_shift(4);
          var EF = parse_extra_field(
            /*::(*/
            blob.slice(blob.l + namelen, blob.l + namelen + efsz)
            /*:: :any)*/
          );
          blob.l += namelen + efsz + fcsz;
          var L2 = blob.l;
          blob.l = offset2 + 4;
          parse_local_file(blob, csz, usz, o2, EF);
          blob.l = L2;
        }
        return o2;
      }
      function parse_local_file(blob, csz, usz, o2, EF) {
        blob.l += 2;
        var flags = blob.read_shift(2);
        var meth = blob.read_shift(2);
        var date = parse_dos_date(blob);
        if (flags & 8257) throw new Error("Unsupported ZIP encryption");
        var crc32 = blob.read_shift(4);
        var _csz = blob.read_shift(4);
        var _usz = blob.read_shift(4);
        var namelen = blob.read_shift(2);
        var efsz = blob.read_shift(2);
        var name = "";
        for (var i3 = 0; i3 < namelen; ++i3) name += String.fromCharCode(blob[blob.l++]);
        if (efsz) {
          var ef = parse_extra_field(
            /*::(*/
            blob.slice(blob.l, blob.l + efsz)
            /*:: :any)*/
          );
          if ((ef[21589] || {}).mt) date = ef[21589].mt;
          if (((EF || {})[21589] || {}).mt) date = EF[21589].mt;
        }
        blob.l += efsz;
        var data = blob.slice(blob.l, blob.l + _csz);
        switch (meth) {
          case 8:
            data = _inflateRawSync(blob, _usz);
            break;
          case 0:
            break;
          // TODO: scan for magic number
          default:
            throw new Error("Unsupported ZIP Compression method " + meth);
        }
        var wrn = false;
        if (flags & 8) {
          crc32 = blob.read_shift(4);
          if (crc32 == 134695760) {
            crc32 = blob.read_shift(4);
            wrn = true;
          }
          _csz = blob.read_shift(4);
          _usz = blob.read_shift(4);
        }
        if (_csz != csz) warn_or_throw(wrn, "Bad compressed size: " + csz + " != " + _csz);
        if (_usz != usz) warn_or_throw(wrn, "Bad uncompressed size: " + usz + " != " + _usz);
        cfb_add(o2, name, data, { unsafe: true, mt: date });
      }
      function write_zip2(cfb, options) {
        var _opts = options || {};
        var out2 = [], cdirs = [];
        var o2 = new_buf(1);
        var method = _opts.compression ? 8 : 0, flags = 0;
        var i3 = 0, j = 0;
        var start_cd = 0, fcnt = 0;
        var root2 = cfb.FullPaths[0], fp = root2, fi = cfb.FileIndex[0];
        var crcs = [];
        var sz_cd = 0;
        for (i3 = 1; i3 < cfb.FullPaths.length; ++i3) {
          fp = cfb.FullPaths[i3].slice(root2.length);
          fi = cfb.FileIndex[i3];
          if (!fi.size || !fi.content || fp == "Sh33tJ5") continue;
          var start2 = start_cd;
          var namebuf = new_buf(fp.length);
          for (j = 0; j < fp.length; ++j) namebuf.write_shift(1, fp.charCodeAt(j) & 127);
          namebuf = namebuf.slice(0, namebuf.l);
          crcs[fcnt] = CRC32.buf(
            /*::((*/
            fi.content,
            0
          );
          var outbuf = fi.content;
          if (method == 8) outbuf = _deflateRawSync(outbuf);
          o2 = new_buf(30);
          o2.write_shift(4, 67324752);
          o2.write_shift(2, 20);
          o2.write_shift(2, flags);
          o2.write_shift(2, method);
          if (fi.mt) write_dos_date(o2, fi.mt);
          else o2.write_shift(4, 0);
          o2.write_shift(-4, crcs[fcnt]);
          o2.write_shift(4, outbuf.length);
          o2.write_shift(
            4,
            /*::(*/
            fi.content.length
          );
          o2.write_shift(2, namebuf.length);
          o2.write_shift(2, 0);
          start_cd += o2.length;
          out2.push(o2);
          start_cd += namebuf.length;
          out2.push(namebuf);
          start_cd += outbuf.length;
          out2.push(outbuf);
          o2 = new_buf(46);
          o2.write_shift(4, 33639248);
          o2.write_shift(2, 0);
          o2.write_shift(2, 20);
          o2.write_shift(2, flags);
          o2.write_shift(2, method);
          o2.write_shift(4, 0);
          o2.write_shift(-4, crcs[fcnt]);
          o2.write_shift(4, outbuf.length);
          o2.write_shift(
            4,
            /*::(*/
            fi.content.length
          );
          o2.write_shift(2, namebuf.length);
          o2.write_shift(2, 0);
          o2.write_shift(2, 0);
          o2.write_shift(2, 0);
          o2.write_shift(2, 0);
          o2.write_shift(4, 0);
          o2.write_shift(4, start2);
          sz_cd += o2.l;
          cdirs.push(o2);
          sz_cd += namebuf.length;
          cdirs.push(namebuf);
          ++fcnt;
        }
        o2 = new_buf(22);
        o2.write_shift(4, 101010256);
        o2.write_shift(2, 0);
        o2.write_shift(2, 0);
        o2.write_shift(2, fcnt);
        o2.write_shift(2, fcnt);
        o2.write_shift(4, sz_cd);
        o2.write_shift(4, start_cd);
        o2.write_shift(2, 0);
        return bconcat([bconcat(out2), bconcat(cdirs), o2]);
      }
      var ContentTypeMap = {
        "htm": "text/html",
        "xml": "text/xml",
        "gif": "image/gif",
        "jpg": "image/jpeg",
        "png": "image/png",
        "mso": "application/x-mso",
        "thmx": "application/vnd.ms-officetheme",
        "sh33tj5": "application/octet-stream"
      };
      function get_content_type(fi, fp) {
        if (fi.ctype) return fi.ctype;
        var ext = fi.name || "", m2 = ext.match(/\.([^\.]+)$/);
        if (m2 && ContentTypeMap[m2[1]]) return ContentTypeMap[m2[1]];
        if (fp) {
          m2 = (ext = fp).match(/[\.\\]([^\.\\])+$/);
          if (m2 && ContentTypeMap[m2[1]]) return ContentTypeMap[m2[1]];
        }
        return "application/octet-stream";
      }
      function write_base64_76(bstr) {
        var data = Base64_encode(bstr);
        var o2 = [];
        for (var i3 = 0; i3 < data.length; i3 += 76) o2.push(data.slice(i3, i3 + 76));
        return o2.join("\r\n") + "\r\n";
      }
      function write_quoted_printable(text) {
        var encoded = text.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(c2) {
          var w2 = c2.charCodeAt(0).toString(16).toUpperCase();
          return "=" + (w2.length == 1 ? "0" + w2 : w2);
        });
        encoded = encoded.replace(/ $/mg, "=20").replace(/\t$/mg, "=09");
        if (encoded.charAt(0) == "\n") encoded = "=0D" + encoded.slice(1);
        encoded = encoded.replace(/\r(?!\n)/mg, "=0D").replace(/\n\n/mg, "\n=0A").replace(/([^\r\n])\n/mg, "$1=0A");
        var o2 = [], split2 = encoded.split("\r\n");
        for (var si = 0; si < split2.length; ++si) {
          var str = split2[si];
          if (str.length == 0) {
            o2.push("");
            continue;
          }
          for (var i3 = 0; i3 < str.length; ) {
            var end2 = 76;
            var tmp = str.slice(i3, i3 + end2);
            if (tmp.charAt(end2 - 1) == "=") end2--;
            else if (tmp.charAt(end2 - 2) == "=") end2 -= 2;
            else if (tmp.charAt(end2 - 3) == "=") end2 -= 3;
            tmp = str.slice(i3, i3 + end2);
            i3 += end2;
            if (i3 < str.length) tmp += "=";
            o2.push(tmp);
          }
        }
        return o2.join("\r\n");
      }
      function parse_quoted_printable(data) {
        var o2 = [];
        for (var di = 0; di < data.length; ++di) {
          var line = data[di];
          while (di <= data.length && line.charAt(line.length - 1) == "=") line = line.slice(0, line.length - 1) + data[++di];
          o2.push(line);
        }
        for (var oi = 0; oi < o2.length; ++oi) o2[oi] = o2[oi].replace(/[=][0-9A-Fa-f]{2}/g, function($$) {
          return String.fromCharCode(parseInt($$.slice(1), 16));
        });
        return s2a(o2.join("\r\n"));
      }
      function parse_mime(cfb, data, root2) {
        var fname = "", cte = "", ctype = "", fdata;
        var di = 0;
        for (; di < 10; ++di) {
          var line = data[di];
          if (!line || line.match(/^\s*$/)) break;
          var m2 = line.match(/^(.*?):\s*([^\s].*)$/);
          if (m2) switch (m2[1].toLowerCase()) {
            case "content-location":
              fname = m2[2].trim();
              break;
            case "content-type":
              ctype = m2[2].trim();
              break;
            case "content-transfer-encoding":
              cte = m2[2].trim();
              break;
          }
        }
        ++di;
        switch (cte.toLowerCase()) {
          case "base64":
            fdata = s2a(Base64_decode(data.slice(di).join("")));
            break;
          case "quoted-printable":
            fdata = parse_quoted_printable(data.slice(di));
            break;
          default:
            throw new Error("Unsupported Content-Transfer-Encoding " + cte);
        }
        var file = cfb_add(cfb, fname.slice(root2.length), fdata, { unsafe: true });
        if (ctype) file.ctype = ctype;
      }
      function parse_mad(file, options) {
        if (a2s2(file.slice(0, 13)).toLowerCase() != "mime-version:") throw new Error("Unsupported MAD header");
        var root2 = options && options.root || "";
        var data = (has_buf && Buffer.isBuffer(file) ? file.toString("binary") : a2s2(file)).split("\r\n");
        var di = 0, row = "";
        for (di = 0; di < data.length; ++di) {
          row = data[di];
          if (!/^Content-Location:/i.test(row)) continue;
          row = row.slice(row.indexOf("file"));
          if (!root2) root2 = row.slice(0, row.lastIndexOf("/") + 1);
          if (row.slice(0, root2.length) == root2) continue;
          while (root2.length > 0) {
            root2 = root2.slice(0, root2.length - 1);
            root2 = root2.slice(0, root2.lastIndexOf("/") + 1);
            if (row.slice(0, root2.length) == root2) break;
          }
        }
        var mboundary = (data[1] || "").match(/boundary="(.*?)"/);
        if (!mboundary) throw new Error("MAD cannot find boundary");
        var boundary = "--" + (mboundary[1] || "");
        var FileIndex = [], FullPaths = [];
        var o2 = {
          FileIndex,
          FullPaths
        };
        init_cfb(o2);
        var start_di, fcnt = 0;
        for (di = 0; di < data.length; ++di) {
          var line = data[di];
          if (line !== boundary && line !== boundary + "--") continue;
          if (fcnt++) parse_mime(o2, data.slice(start_di, di), root2);
          start_di = di;
        }
        return o2;
      }
      function write_mad(cfb, options) {
        var opts = options || {};
        var boundary = opts.boundary || "SheetJS";
        boundary = "------=" + boundary;
        var out2 = [
          "MIME-Version: 1.0",
          'Content-Type: multipart/related; boundary="' + boundary.slice(2) + '"',
          "",
          "",
          ""
        ];
        var root2 = cfb.FullPaths[0], fp = root2, fi = cfb.FileIndex[0];
        for (var i3 = 1; i3 < cfb.FullPaths.length; ++i3) {
          fp = cfb.FullPaths[i3].slice(root2.length);
          fi = cfb.FileIndex[i3];
          if (!fi.size || !fi.content || fp == "Sh33tJ5") continue;
          fp = fp.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF]/g, function(c2) {
            return "_x" + c2.charCodeAt(0).toString(16) + "_";
          }).replace(/[\u0080-\uFFFF]/g, function(u2) {
            return "_u" + u2.charCodeAt(0).toString(16) + "_";
          });
          var ca = fi.content;
          var cstr = has_buf && Buffer.isBuffer(ca) ? ca.toString("binary") : a2s2(ca);
          var dispcnt = 0, L2 = Math.min(1024, cstr.length), cc = 0;
          for (var csl = 0; csl <= L2; ++csl) if ((cc = cstr.charCodeAt(csl)) >= 32 && cc < 128) ++dispcnt;
          var qp = dispcnt >= L2 * 4 / 5;
          out2.push(boundary);
          out2.push("Content-Location: " + (opts.root || "file:///C:/SheetJS/") + fp);
          out2.push("Content-Transfer-Encoding: " + (qp ? "quoted-printable" : "base64"));
          out2.push("Content-Type: " + get_content_type(fi, fp));
          out2.push("");
          out2.push(qp ? write_quoted_printable(cstr) : write_base64_76(cstr));
        }
        out2.push(boundary + "--\r\n");
        return out2.join("\r\n");
      }
      function cfb_new(opts) {
        var o2 = {};
        init_cfb(o2, opts);
        return o2;
      }
      function cfb_add(cfb, name, content2, opts) {
        var unsafe = opts && opts.unsafe;
        if (!unsafe) init_cfb(cfb);
        var file = !unsafe && CFB.find(cfb, name);
        if (!file) {
          var fpath = cfb.FullPaths[0];
          if (name.slice(0, fpath.length) == fpath) fpath = name;
          else {
            if (fpath.slice(-1) != "/") fpath += "/";
            fpath = (fpath + name).replace("//", "/");
          }
          file = { name: filename(name), type: 2 };
          cfb.FileIndex.push(file);
          cfb.FullPaths.push(fpath);
          if (!unsafe) CFB.utils.cfb_gc(cfb);
        }
        file.content = content2;
        file.size = content2 ? content2.length : 0;
        if (opts) {
          if (opts.CLSID) file.clsid = opts.CLSID;
          if (opts.mt) file.mt = opts.mt;
          if (opts.ct) file.ct = opts.ct;
        }
        return file;
      }
      function cfb_del(cfb, name) {
        init_cfb(cfb);
        var file = CFB.find(cfb, name);
        if (file) {
          for (var j = 0; j < cfb.FileIndex.length; ++j) if (cfb.FileIndex[j] == file) {
            cfb.FileIndex.splice(j, 1);
            cfb.FullPaths.splice(j, 1);
            return true;
          }
        }
        return false;
      }
      function cfb_mov(cfb, old_name, new_name) {
        init_cfb(cfb);
        var file = CFB.find(cfb, old_name);
        if (file) {
          for (var j = 0; j < cfb.FileIndex.length; ++j) if (cfb.FileIndex[j] == file) {
            cfb.FileIndex[j].name = filename(new_name);
            cfb.FullPaths[j] = new_name;
            return true;
          }
        }
        return false;
      }
      function cfb_gc(cfb) {
        rebuild_cfb(cfb, true);
      }
      exports2.find = find2;
      exports2.read = read;
      exports2.parse = parse2;
      exports2.write = write;
      exports2.writeFile = write_file;
      exports2.utils = {
        cfb_new,
        cfb_add,
        cfb_del,
        cfb_mov,
        cfb_gc,
        ReadShift,
        CheckField,
        prep_blob,
        bconcat,
        use_zlib,
        _deflateRaw: _deflate,
        _inflateRaw: _inflate,
        consts
      };
      return exports2;
    }();
    function blobify(data) {
      if (typeof data === "string") return s2ab(data);
      if (Array.isArray(data)) return a2u(data);
      return data;
    }
    function write_dl(fname, payload, enc) {
      if (typeof Deno !== "undefined") {
        if (enc && typeof payload == "string") switch (enc) {
          case "utf8":
            payload = new TextEncoder(enc).encode(payload);
            break;
          case "binary":
            payload = s2ab(payload);
            break;
          /* TODO: binary equivalent */
          default:
            throw new Error("Unsupported encoding " + enc);
        }
        return Deno.writeFileSync(fname, payload);
      }
      var data = enc == "utf8" ? utf8write(payload) : payload;
      if (typeof IE_SaveFile !== "undefined") return IE_SaveFile(data, fname);
      if (typeof Blob !== "undefined") {
        var blob = new Blob([blobify(data)], { type: "application/octet-stream" });
        if (typeof navigator !== "undefined" && navigator.msSaveBlob) return navigator.msSaveBlob(blob, fname);
        if (typeof saveAs !== "undefined") return saveAs(blob, fname);
        if (typeof URL !== "undefined" && typeof document !== "undefined" && document.createElement && URL.createObjectURL) {
          var url = URL.createObjectURL(blob);
          if (typeof chrome === "object" && typeof (chrome.downloads || {}).download == "function") {
            if (URL.revokeObjectURL && typeof setTimeout !== "undefined") setTimeout(function() {
              URL.revokeObjectURL(url);
            }, 6e4);
            return chrome.downloads.download({ url, filename: fname, saveAs: true });
          }
          var a2 = document.createElement("a");
          if (a2.download != null) {
            a2.download = fname;
            a2.href = url;
            document.body.appendChild(a2);
            a2.click();
            document.body.removeChild(a2);
            if (URL.revokeObjectURL && typeof setTimeout !== "undefined") setTimeout(function() {
              URL.revokeObjectURL(url);
            }, 6e4);
            return url;
          }
        }
      }
      if (typeof $ !== "undefined" && typeof File !== "undefined" && typeof Folder !== "undefined") try {
        var out2 = File(fname);
        out2.open("w");
        out2.encoding = "binary";
        if (Array.isArray(payload)) payload = a2s(payload);
        out2.write(payload);
        out2.close();
        return payload;
      } catch (e2) {
        if (!e2.message || !e2.message.match(/onstruct/)) throw e2;
      }
      throw new Error("cannot save file " + fname);
    }
    function keys(o2) {
      var ks = Object.keys(o2), o22 = [];
      for (var i2 = 0; i2 < ks.length; ++i2) if (Object.prototype.hasOwnProperty.call(o2, ks[i2])) o22.push(ks[i2]);
      return o22;
    }
    function evert_key(obj, key) {
      var o2 = [], K2 = keys(obj);
      for (var i2 = 0; i2 !== K2.length; ++i2) if (o2[obj[K2[i2]][key]] == null) o2[obj[K2[i2]][key]] = K2[i2];
      return o2;
    }
    function evert(obj) {
      var o2 = [], K2 = keys(obj);
      for (var i2 = 0; i2 !== K2.length; ++i2) o2[obj[K2[i2]]] = K2[i2];
      return o2;
    }
    function evert_num(obj) {
      var o2 = [], K2 = keys(obj);
      for (var i2 = 0; i2 !== K2.length; ++i2) o2[obj[K2[i2]]] = parseInt(K2[i2], 10);
      return o2;
    }
    function evert_arr(obj) {
      var o2 = [], K2 = keys(obj);
      for (var i2 = 0; i2 !== K2.length; ++i2) {
        if (o2[obj[K2[i2]]] == null) o2[obj[K2[i2]]] = [];
        o2[obj[K2[i2]]].push(K2[i2]);
      }
      return o2;
    }
    var basedate = /* @__PURE__ */ new Date(1899, 11, 30, 0, 0, 0);
    function datenum(v4, date1904) {
      var epoch = /* @__PURE__ */ v4.getTime();
      var dnthresh2 = /* @__PURE__ */ basedate.getTime() + (/* @__PURE__ */ v4.getTimezoneOffset() - /* @__PURE__ */ basedate.getTimezoneOffset()) * 6e4;
      return (epoch - dnthresh2) / (24 * 60 * 60 * 1e3);
    }
    var refdate = /* @__PURE__ */ new Date();
    var dnthresh = /* @__PURE__ */ basedate.getTime() + (/* @__PURE__ */ refdate.getTimezoneOffset() - /* @__PURE__ */ basedate.getTimezoneOffset()) * 6e4;
    var refoffset = /* @__PURE__ */ refdate.getTimezoneOffset();
    function numdate(v4) {
      var out2 = /* @__PURE__ */ new Date();
      out2.setTime(v4 * 24 * 60 * 60 * 1e3 + dnthresh);
      if (out2.getTimezoneOffset() !== refoffset) {
        out2.setTime(out2.getTime() + (out2.getTimezoneOffset() - refoffset) * 6e4);
      }
      return out2;
    }
    var good_pd_date_1 = /* @__PURE__ */ new Date("2017-02-19T19:06:09.000Z");
    var good_pd_date = /* @__PURE__ */ isNaN(/* @__PURE__ */ good_pd_date_1.getFullYear()) ? /* @__PURE__ */ new Date("2/19/17") : good_pd_date_1;
    var good_pd = /* @__PURE__ */ good_pd_date.getFullYear() == 2017;
    function parseDate(str, fixdate) {
      var d2 = new Date(str);
      if (good_pd) {
        if (fixdate > 0) d2.setTime(d2.getTime() + d2.getTimezoneOffset() * 60 * 1e3);
        else if (fixdate < 0) d2.setTime(d2.getTime() - d2.getTimezoneOffset() * 60 * 1e3);
        return d2;
      }
      if (str instanceof Date) return str;
      if (good_pd_date.getFullYear() == 1917 && !isNaN(d2.getFullYear())) {
        var s2 = d2.getFullYear();
        if (str.indexOf("" + s2) > -1) return d2;
        d2.setFullYear(d2.getFullYear() + 100);
        return d2;
      }
      var n = str.match(/\d+/g) || ["2017", "2", "19", "0", "0", "0"];
      var out2 = new Date(+n[0], +n[1] - 1, +n[2], +n[3] || 0, +n[4] || 0, +n[5] || 0);
      if (str.indexOf("Z") > -1) out2 = new Date(out2.getTime() - out2.getTimezoneOffset() * 60 * 1e3);
      return out2;
    }
    function cc2str(arr, debomit) {
      if (has_buf && Buffer.isBuffer(arr)) {
        return arr.toString("binary");
      }
      if (typeof TextDecoder !== "undefined") try {
        if (debomit) ;
        var rev = {
          "€": "",
          "‚": "",
          "ƒ": "",
          "„": "",
          "…": "",
          "†": "",
          "‡": "",
          "ˆ": "",
          "‰": "",
          "Š": "",
          "‹": "",
          "Œ": "",
          "Ž": "",
          "‘": "",
          "’": "",
          "“": "",
          "”": "",
          "•": "",
          "–": "",
          "—": "",
          "˜": "",
          "™": "",
          "š": "",
          "›": "",
          "œ": "",
          "ž": "",
          "Ÿ": ""
        };
        if (Array.isArray(arr)) arr = new Uint8Array(arr);
        return new TextDecoder("latin1").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g, function(c2) {
          return rev[c2] || c2;
        });
      } catch (e2) {
      }
      var o2 = [];
      for (var i2 = 0; i2 != arr.length; ++i2) o2.push(String.fromCharCode(arr[i2]));
      return o2.join("");
    }
    function dup(o2) {
      if (typeof JSON != "undefined" && !Array.isArray(o2)) return JSON.parse(JSON.stringify(o2));
      if (typeof o2 != "object" || o2 == null) return o2;
      if (o2 instanceof Date) return new Date(o2.getTime());
      var out2 = {};
      for (var k2 in o2) if (Object.prototype.hasOwnProperty.call(o2, k2)) out2[k2] = dup(o2[k2]);
      return out2;
    }
    function fill(c2, l2) {
      var o2 = "";
      while (o2.length < l2) o2 += c2;
      return o2;
    }
    function fuzzynum(s2) {
      var v4 = Number(s2);
      if (!isNaN(v4)) return isFinite(v4) ? v4 : NaN;
      if (!/\d/.test(s2)) return v4;
      var wt2 = 1;
      var ss = s2.replace(/([\d]),([\d])/g, "$1$2").replace(/[$]/g, "").replace(/[%]/g, function() {
        wt2 *= 100;
        return "";
      });
      if (!isNaN(v4 = Number(ss))) return v4 / wt2;
      ss = ss.replace(/[(](.*)[)]/, function($$, $1) {
        wt2 = -wt2;
        return $1;
      });
      if (!isNaN(v4 = Number(ss))) return v4 / wt2;
      return v4;
    }
    var lower_months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
    function fuzzydate(s2) {
      var o2 = new Date(s2), n = /* @__PURE__ */ new Date(NaN);
      var y = o2.getYear(), m2 = o2.getMonth(), d2 = o2.getDate();
      if (isNaN(d2)) return n;
      var lower = s2.toLowerCase();
      if (lower.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) {
        lower = lower.replace(/[^a-z]/g, "").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/, "");
        if (lower.length > 3 && lower_months.indexOf(lower) == -1) return n;
      } else if (lower.match(/[a-z]/)) return n;
      if (y < 0 || y > 8099) return n;
      if ((m2 > 0 || d2 > 1) && y != 101) return o2;
      if (s2.match(/[^-0-9:,\/\\]/)) return n;
      return o2;
    }
    function zip_add_file(zip, path, content2) {
      if (zip.FullPaths) {
        if (typeof content2 == "string") {
          var res;
          if (has_buf) res = Buffer_from(content2);
          else res = utf8decode(content2);
          return CFB.utils.cfb_add(zip, path, res);
        }
        CFB.utils.cfb_add(zip, path, content2);
      } else zip.file(path, content2);
    }
    function zip_new() {
      return CFB.utils.cfb_new();
    }
    var XML_HEADER = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r\n';
    var encodings = {
      "&quot;": '"',
      "&apos;": "'",
      "&gt;": ">",
      "&lt;": "<",
      "&amp;": "&"
    };
    var rencoding = /* @__PURE__ */ evert(encodings);
    var decregex = /[&<>'"]/g, charegex = /[\u0000-\u0008\u000b-\u001f]/g;
    function escapexml(text) {
      var s2 = text + "";
      return s2.replace(decregex, function(y) {
        return rencoding[y];
      }).replace(charegex, function(s3) {
        return "_x" + ("000" + s3.charCodeAt(0).toString(16)).slice(-4) + "_";
      });
    }
    function escapexmltag(text) {
      return escapexml(text).replace(/ /g, "_x0020_");
    }
    var htmlcharegex = /[\u0000-\u001f]/g;
    function escapehtml(text) {
      var s2 = text + "";
      return s2.replace(decregex, function(y) {
        return rencoding[y];
      }).replace(/\n/g, "<br/>").replace(htmlcharegex, function(s3) {
        return "&#x" + ("000" + s3.charCodeAt(0).toString(16)).slice(-4) + ";";
      });
    }
    function escapexlml(text) {
      var s2 = text + "";
      return s2.replace(decregex, function(y) {
        return rencoding[y];
      }).replace(htmlcharegex, function(s3) {
        return "&#x" + s3.charCodeAt(0).toString(16).toUpperCase() + ";";
      });
    }
    function xlml_unfixstr(str) {
      return str.replace(/(\r\n|[\r\n])/g, "&#10;");
    }
    function parsexmlbool(value) {
      switch (value) {
        case 1:
        case true:
        case "1":
        case "true":
        case "TRUE":
          return true;
        /* case '0': case 'false': case 'FALSE':*/
        default:
          return false;
      }
    }
    function utf8reada(orig) {
      var out2 = "", i2 = 0, c2 = 0, d2 = 0, e2 = 0, f2 = 0, w2 = 0;
      while (i2 < orig.length) {
        c2 = orig.charCodeAt(i2++);
        if (c2 < 128) {
          out2 += String.fromCharCode(c2);
          continue;
        }
        d2 = orig.charCodeAt(i2++);
        if (c2 > 191 && c2 < 224) {
          f2 = (c2 & 31) << 6;
          f2 |= d2 & 63;
          out2 += String.fromCharCode(f2);
          continue;
        }
        e2 = orig.charCodeAt(i2++);
        if (c2 < 240) {
          out2 += String.fromCharCode((c2 & 15) << 12 | (d2 & 63) << 6 | e2 & 63);
          continue;
        }
        f2 = orig.charCodeAt(i2++);
        w2 = ((c2 & 7) << 18 | (d2 & 63) << 12 | (e2 & 63) << 6 | f2 & 63) - 65536;
        out2 += String.fromCharCode(55296 + (w2 >>> 10 & 1023));
        out2 += String.fromCharCode(56320 + (w2 & 1023));
      }
      return out2;
    }
    function utf8readb(data) {
      var out2 = new_raw_buf(2 * data.length), w2, i2, j = 1, k2 = 0, ww = 0, c2;
      for (i2 = 0; i2 < data.length; i2 += j) {
        j = 1;
        if ((c2 = data.charCodeAt(i2)) < 128) w2 = c2;
        else if (c2 < 224) {
          w2 = (c2 & 31) * 64 + (data.charCodeAt(i2 + 1) & 63);
          j = 2;
        } else if (c2 < 240) {
          w2 = (c2 & 15) * 4096 + (data.charCodeAt(i2 + 1) & 63) * 64 + (data.charCodeAt(i2 + 2) & 63);
          j = 3;
        } else {
          j = 4;
          w2 = (c2 & 7) * 262144 + (data.charCodeAt(i2 + 1) & 63) * 4096 + (data.charCodeAt(i2 + 2) & 63) * 64 + (data.charCodeAt(i2 + 3) & 63);
          w2 -= 65536;
          ww = 55296 + (w2 >>> 10 & 1023);
          w2 = 56320 + (w2 & 1023);
        }
        if (ww !== 0) {
          out2[k2++] = ww & 255;
          out2[k2++] = ww >>> 8;
          ww = 0;
        }
        out2[k2++] = w2 % 256;
        out2[k2++] = w2 >>> 8;
      }
      return out2.slice(0, k2).toString("ucs2");
    }
    function utf8readc(data) {
      return Buffer_from(data, "binary").toString("utf8");
    }
    var utf8corpus = "foo bar bazâð£";
    var utf8read = has_buf && (/* @__PURE__ */ utf8readc(utf8corpus) == /* @__PURE__ */ utf8reada(utf8corpus) && utf8readc || /* @__PURE__ */ utf8readb(utf8corpus) == /* @__PURE__ */ utf8reada(utf8corpus) && utf8readb) || utf8reada;
    var utf8write = has_buf ? function(data) {
      return Buffer_from(data, "utf8").toString("binary");
    } : function(orig) {
      var out2 = [], i2 = 0, c2 = 0, d2 = 0;
      while (i2 < orig.length) {
        c2 = orig.charCodeAt(i2++);
        switch (true) {
          case c2 < 128:
            out2.push(String.fromCharCode(c2));
            break;
          case c2 < 2048:
            out2.push(String.fromCharCode(192 + (c2 >> 6)));
            out2.push(String.fromCharCode(128 + (c2 & 63)));
            break;
          case (c2 >= 55296 && c2 < 57344):
            c2 -= 55296;
            d2 = orig.charCodeAt(i2++) - 56320 + (c2 << 10);
            out2.push(String.fromCharCode(240 + (d2 >> 18 & 7)));
            out2.push(String.fromCharCode(144 + (d2 >> 12 & 63)));
            out2.push(String.fromCharCode(128 + (d2 >> 6 & 63)));
            out2.push(String.fromCharCode(128 + (d2 & 63)));
            break;
          default:
            out2.push(String.fromCharCode(224 + (c2 >> 12)));
            out2.push(String.fromCharCode(128 + (c2 >> 6 & 63)));
            out2.push(String.fromCharCode(128 + (c2 & 63)));
        }
      }
      return out2.join("");
    };
    var htmldecode = /* @__PURE__ */ function() {
      var entities = [
        ["nbsp", " "],
        ["middot", "·"],
        ["quot", '"'],
        ["apos", "'"],
        ["gt", ">"],
        ["lt", "<"],
        ["amp", "&"]
      ].map(function(x2) {
        return [new RegExp("&" + x2[0] + ";", "ig"), x2[1]];
      });
      return function htmldecode2(str) {
        var o2 = str.replace(/^[\t\n\r ]+/, "").replace(/[\t\n\r ]+$/, "").replace(/>\s+/g, ">").replace(/\s+</g, "<").replace(/[\t\n\r ]+/g, " ").replace(/<\s*[bB][rR]\s*\/?>/g, "\n").replace(/<[^>]*>/g, "");
        for (var i2 = 0; i2 < entities.length; ++i2) o2 = o2.replace(entities[i2][0], entities[i2][1]);
        return o2;
      };
    }();
    var wtregex = /(^\s|\s$|\n)/;
    function writetag(f2, g) {
      return "<" + f2 + (g.match(wtregex) ? ' xml:space="preserve"' : "") + ">" + g + "</" + f2 + ">";
    }
    function wxt_helper(h2) {
      return keys(h2).map(function(k2) {
        return " " + k2 + '="' + h2[k2] + '"';
      }).join("");
    }
    function writextag(f2, g, h2) {
      return "<" + f2 + (h2 != null ? wxt_helper(h2) : "") + (g != null ? (g.match(wtregex) ? ' xml:space="preserve"' : "") + ">" + g + "</" + f2 : "/") + ">";
    }
    function write_w3cdtf(d2, t) {
      try {
        return d2.toISOString().replace(/\.\d*/, "");
      } catch (e2) {
        if (t) throw e2;
      }
      return "";
    }
    function write_vt(s2, xlsx) {
      switch (typeof s2) {
        case "string":
          var o2 = writextag("vt:lpwstr", escapexml(s2));
          o2 = o2.replace(/&quot;/g, "_x0022_");
          return o2;
        case "number":
          return writextag((s2 | 0) == s2 ? "vt:i4" : "vt:r8", escapexml(String(s2)));
        case "boolean":
          return writextag("vt:bool", s2 ? "true" : "false");
      }
      if (s2 instanceof Date) return writextag("vt:filetime", write_w3cdtf(s2));
      throw new Error("Unable to serialize " + s2);
    }
    var XMLNS = {
      CORE_PROPS: "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
      CUST_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",
      EXT_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
      CT: "http://schemas.openxmlformats.org/package/2006/content-types",
      RELS: "http://schemas.openxmlformats.org/package/2006/relationships",
      TCMNT: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
      "dc": "http://purl.org/dc/elements/1.1/",
      "dcterms": "http://purl.org/dc/terms/",
      "dcmitype": "http://purl.org/dc/dcmitype/",
      "r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
      "vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",
      "xsi": "http://www.w3.org/2001/XMLSchema-instance",
      "xsd": "http://www.w3.org/2001/XMLSchema"
    };
    var XMLNS_main = [
      "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
      "http://purl.oclc.org/ooxml/spreadsheetml/main",
      "http://schemas.microsoft.com/office/excel/2006/main",
      "http://schemas.microsoft.com/office/excel/2006/2"
    ];
    var XLMLNS = {
      "o": "urn:schemas-microsoft-com:office:office",
      "x": "urn:schemas-microsoft-com:office:excel",
      "ss": "urn:schemas-microsoft-com:office:spreadsheet",
      "dt": "uuid:C2F41010-65B3-11d1-A29F-00AA00C14882",
      "mv": "http://macVmlSchemaUri",
      "v": "urn:schemas-microsoft-com:vml",
      "html": "http://www.w3.org/TR/REC-html40"
    };
    function read_double_le(b2, idx) {
      var s2 = 1 - 2 * (b2[idx + 7] >>> 7);
      var e2 = ((b2[idx + 7] & 127) << 4) + (b2[idx + 6] >>> 4 & 15);
      var m2 = b2[idx + 6] & 15;
      for (var i2 = 5; i2 >= 0; --i2) m2 = m2 * 256 + b2[idx + i2];
      if (e2 == 2047) return m2 == 0 ? s2 * Infinity : NaN;
      if (e2 == 0) e2 = -1022;
      else {
        e2 -= 1023;
        m2 += Math.pow(2, 52);
      }
      return s2 * Math.pow(2, e2 - 52) * m2;
    }
    function write_double_le(b2, v4, idx) {
      var bs2 = (v4 < 0 || 1 / v4 == -Infinity ? 1 : 0) << 7, e2 = 0, m2 = 0;
      var av = bs2 ? -v4 : v4;
      if (!isFinite(av)) {
        e2 = 2047;
        m2 = isNaN(v4) ? 26985 : 0;
      } else if (av == 0) e2 = m2 = 0;
      else {
        e2 = Math.floor(Math.log(av) / Math.LN2);
        m2 = av * Math.pow(2, 52 - e2);
        if (e2 <= -1023 && (!isFinite(m2) || m2 < Math.pow(2, 52))) {
          e2 = -1022;
        } else {
          m2 -= Math.pow(2, 52);
          e2 += 1023;
        }
      }
      for (var i2 = 0; i2 <= 5; ++i2, m2 /= 256) b2[idx + i2] = m2 & 255;
      b2[idx + 6] = (e2 & 15) << 4 | m2 & 15;
      b2[idx + 7] = e2 >> 4 | bs2;
    }
    var ___toBuffer = function(bufs) {
      var x2 = [], w2 = 10240;
      for (var i2 = 0; i2 < bufs[0].length; ++i2) if (bufs[0][i2]) for (var j = 0, L2 = bufs[0][i2].length; j < L2; j += w2) x2.push.apply(x2, bufs[0][i2].slice(j, j + w2));
      return x2;
    };
    var __toBuffer = has_buf ? function(bufs) {
      return bufs[0].length > 0 && Buffer.isBuffer(bufs[0][0]) ? Buffer.concat(bufs[0].map(function(x2) {
        return Buffer.isBuffer(x2) ? x2 : Buffer_from(x2);
      })) : ___toBuffer(bufs);
    } : ___toBuffer;
    var ___utf16le = function(b2, s2, e2) {
      var ss = [];
      for (var i2 = s2; i2 < e2; i2 += 2) ss.push(String.fromCharCode(__readUInt16LE(b2, i2)));
      return ss.join("").replace(chr0, "");
    };
    var __utf16le = has_buf ? function(b2, s2, e2) {
      if (!Buffer.isBuffer(b2)) return ___utf16le(b2, s2, e2);
      return b2.toString("utf16le", s2, e2).replace(chr0, "");
    } : ___utf16le;
    var ___hexlify = function(b2, s2, l2) {
      var ss = [];
      for (var i2 = s2; i2 < s2 + l2; ++i2) ss.push(("0" + b2[i2].toString(16)).slice(-2));
      return ss.join("");
    };
    var __hexlify = has_buf ? function(b2, s2, l2) {
      return Buffer.isBuffer(b2) ? b2.toString("hex", s2, s2 + l2) : ___hexlify(b2, s2, l2);
    } : ___hexlify;
    var ___utf8 = function(b2, s2, e2) {
      var ss = [];
      for (var i2 = s2; i2 < e2; i2++) ss.push(String.fromCharCode(__readUInt8(b2, i2)));
      return ss.join("");
    };
    var __utf8 = has_buf ? function utf8_b(b2, s2, e2) {
      return Buffer.isBuffer(b2) ? b2.toString("utf8", s2, e2) : ___utf8(b2, s2, e2);
    } : ___utf8;
    var ___lpstr = function(b2, i2) {
      var len2 = __readUInt32LE(b2, i2);
      return len2 > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len2 - 1) : "";
    };
    var __lpstr = ___lpstr;
    var ___cpstr = function(b2, i2) {
      var len2 = __readUInt32LE(b2, i2);
      return len2 > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len2 - 1) : "";
    };
    var __cpstr = ___cpstr;
    var ___lpwstr = function(b2, i2) {
      var len2 = 2 * __readUInt32LE(b2, i2);
      return len2 > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len2 - 1) : "";
    };
    var __lpwstr = ___lpwstr;
    var ___lpp4 = function lpp4_(b2, i2) {
      var len2 = __readUInt32LE(b2, i2);
      return len2 > 0 ? __utf16le(b2, i2 + 4, i2 + 4 + len2) : "";
    };
    var __lpp4 = ___lpp4;
    var ___8lpp4 = function(b2, i2) {
      var len2 = __readUInt32LE(b2, i2);
      return len2 > 0 ? __utf8(b2, i2 + 4, i2 + 4 + len2) : "";
    };
    var __8lpp4 = ___8lpp4;
    var ___double = function(b2, idx) {
      return read_double_le(b2, idx);
    };
    var __double = ___double;
    var is_buf = function is_buf_a(a2) {
      return Array.isArray(a2) || typeof Uint8Array !== "undefined" && a2 instanceof Uint8Array;
    };
    if (has_buf) {
      __lpstr = function lpstr_b(b2, i2) {
        if (!Buffer.isBuffer(b2)) return ___lpstr(b2, i2);
        var len2 = b2.readUInt32LE(i2);
        return len2 > 0 ? b2.toString("utf8", i2 + 4, i2 + 4 + len2 - 1) : "";
      };
      __cpstr = function cpstr_b(b2, i2) {
        if (!Buffer.isBuffer(b2)) return ___cpstr(b2, i2);
        var len2 = b2.readUInt32LE(i2);
        return len2 > 0 ? b2.toString("utf8", i2 + 4, i2 + 4 + len2 - 1) : "";
      };
      __lpwstr = function lpwstr_b(b2, i2) {
        if (!Buffer.isBuffer(b2)) return ___lpwstr(b2, i2);
        var len2 = 2 * b2.readUInt32LE(i2);
        return b2.toString("utf16le", i2 + 4, i2 + 4 + len2 - 1);
      };
      __lpp4 = function lpp4_b(b2, i2) {
        if (!Buffer.isBuffer(b2)) return ___lpp4(b2, i2);
        var len2 = b2.readUInt32LE(i2);
        return b2.toString("utf16le", i2 + 4, i2 + 4 + len2);
      };
      __8lpp4 = function lpp4_8b(b2, i2) {
        if (!Buffer.isBuffer(b2)) return ___8lpp4(b2, i2);
        var len2 = b2.readUInt32LE(i2);
        return b2.toString("utf8", i2 + 4, i2 + 4 + len2);
      };
      __double = function double_(b2, i2) {
        if (Buffer.isBuffer(b2)) return b2.readDoubleLE(i2);
        return ___double(b2, i2);
      };
      is_buf = function is_buf_b(a2) {
        return Buffer.isBuffer(a2) || Array.isArray(a2) || typeof Uint8Array !== "undefined" && a2 instanceof Uint8Array;
      };
    }
    var __readUInt8 = function(b2, idx) {
      return b2[idx];
    };
    var __readUInt16LE = function(b2, idx) {
      return b2[idx + 1] * (1 << 8) + b2[idx];
    };
    var __readInt16LE = function(b2, idx) {
      var u2 = b2[idx + 1] * (1 << 8) + b2[idx];
      return u2 < 32768 ? u2 : (65535 - u2 + 1) * -1;
    };
    var __readUInt32LE = function(b2, idx) {
      return b2[idx + 3] * (1 << 24) + (b2[idx + 2] << 16) + (b2[idx + 1] << 8) + b2[idx];
    };
    var __readInt32LE = function(b2, idx) {
      return b2[idx + 3] << 24 | b2[idx + 2] << 16 | b2[idx + 1] << 8 | b2[idx];
    };
    var __readInt32BE = function(b2, idx) {
      return b2[idx] << 24 | b2[idx + 1] << 16 | b2[idx + 2] << 8 | b2[idx + 3];
    };
    function ReadShift(size, t) {
      var o2 = "", oI, oR, oo = [], w2, vv, i2, loc;
      switch (t) {
        case "dbcs":
          loc = this.l;
          if (has_buf && Buffer.isBuffer(this)) o2 = this.slice(this.l, this.l + 2 * size).toString("utf16le");
          else for (i2 = 0; i2 < size; ++i2) {
            o2 += String.fromCharCode(__readUInt16LE(this, loc));
            loc += 2;
          }
          size *= 2;
          break;
        case "utf8":
          o2 = __utf8(this, this.l, this.l + size);
          break;
        case "utf16le":
          size *= 2;
          o2 = __utf16le(this, this.l, this.l + size);
          break;
        case "wstr":
          return ReadShift.call(this, size, "dbcs");
        /* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */
        case "lpstr-ansi":
          o2 = __lpstr(this, this.l);
          size = 4 + __readUInt32LE(this, this.l);
          break;
        case "lpstr-cp":
          o2 = __cpstr(this, this.l);
          size = 4 + __readUInt32LE(this, this.l);
          break;
        /* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */
        case "lpwstr":
          o2 = __lpwstr(this, this.l);
          size = 4 + 2 * __readUInt32LE(this, this.l);
          break;
        /* [MS-OFFCRYPTO] 2.1.2 Length-Prefixed Padded Unicode String (UNICODE-LP-P4) */
        case "lpp4":
          size = 4 + __readUInt32LE(this, this.l);
          o2 = __lpp4(this, this.l);
          if (size & 2) size += 2;
          break;
        /* [MS-OFFCRYPTO] 2.1.3 Length-Prefixed UTF-8 String (UTF-8-LP-P4) */
        case "8lpp4":
          size = 4 + __readUInt32LE(this, this.l);
          o2 = __8lpp4(this, this.l);
          if (size & 3) size += 4 - (size & 3);
          break;
        case "cstr":
          size = 0;
          o2 = "";
          while ((w2 = __readUInt8(this, this.l + size++)) !== 0) oo.push(_getchar(w2));
          o2 = oo.join("");
          break;
        case "_wstr":
          size = 0;
          o2 = "";
          while ((w2 = __readUInt16LE(this, this.l + size)) !== 0) {
            oo.push(_getchar(w2));
            size += 2;
          }
          size += 2;
          o2 = oo.join("");
          break;
        /* sbcs and dbcs support continue records in the SST way TODO codepages */
        case "dbcs-cont":
          o2 = "";
          loc = this.l;
          for (i2 = 0; i2 < size; ++i2) {
            if (this.lens && this.lens.indexOf(loc) !== -1) {
              w2 = __readUInt8(this, loc);
              this.l = loc + 1;
              vv = ReadShift.call(this, size - i2, w2 ? "dbcs-cont" : "sbcs-cont");
              return oo.join("") + vv;
            }
            oo.push(_getchar(__readUInt16LE(this, loc)));
            loc += 2;
          }
          o2 = oo.join("");
          size *= 2;
          break;
        case "cpstr":
        /* falls through */
        case "sbcs-cont":
          o2 = "";
          loc = this.l;
          for (i2 = 0; i2 != size; ++i2) {
            if (this.lens && this.lens.indexOf(loc) !== -1) {
              w2 = __readUInt8(this, loc);
              this.l = loc + 1;
              vv = ReadShift.call(this, size - i2, w2 ? "dbcs-cont" : "sbcs-cont");
              return oo.join("") + vv;
            }
            oo.push(_getchar(__readUInt8(this, loc)));
            loc += 1;
          }
          o2 = oo.join("");
          break;
        default:
          switch (size) {
            case 1:
              oI = __readUInt8(this, this.l);
              this.l++;
              return oI;
            case 2:
              oI = (t === "i" ? __readInt16LE : __readUInt16LE)(this, this.l);
              this.l += 2;
              return oI;
            case 4:
            case -4:
              if (t === "i" || (this[this.l + 3] & 128) === 0) {
                oI = (size > 0 ? __readInt32LE : __readInt32BE)(this, this.l);
                this.l += 4;
                return oI;
              } else {
                oR = __readUInt32LE(this, this.l);
                this.l += 4;
              }
              return oR;
            case 8:
            case -8:
              if (t === "f") {
                if (size == 8) oR = __double(this, this.l);
                else oR = __double([this[this.l + 7], this[this.l + 6], this[this.l + 5], this[this.l + 4], this[this.l + 3], this[this.l + 2], this[this.l + 1], this[this.l + 0]], 0);
                this.l += 8;
                return oR;
              } else size = 8;
            /* falls through */
            case 16:
              o2 = __hexlify(this, this.l, size);
              break;
          }
      }
      this.l += size;
      return o2;
    }
    var __writeUInt32LE = function(b2, val, idx) {
      b2[idx] = val & 255;
      b2[idx + 1] = val >>> 8 & 255;
      b2[idx + 2] = val >>> 16 & 255;
      b2[idx + 3] = val >>> 24 & 255;
    };
    var __writeInt32LE = function(b2, val, idx) {
      b2[idx] = val & 255;
      b2[idx + 1] = val >> 8 & 255;
      b2[idx + 2] = val >> 16 & 255;
      b2[idx + 3] = val >> 24 & 255;
    };
    var __writeUInt16LE = function(b2, val, idx) {
      b2[idx] = val & 255;
      b2[idx + 1] = val >>> 8 & 255;
    };
    function WriteShift(t, val, f2) {
      var size = 0, i2 = 0;
      if (f2 === "dbcs") {
        for (i2 = 0; i2 != val.length; ++i2) __writeUInt16LE(this, val.charCodeAt(i2), this.l + 2 * i2);
        size = 2 * val.length;
      } else if (f2 === "sbcs") {
        {
          val = val.replace(/[^\x00-\x7F]/g, "_");
          for (i2 = 0; i2 != val.length; ++i2) this[this.l + i2] = val.charCodeAt(i2) & 255;
        }
        size = val.length;
      } else if (f2 === "hex") {
        for (; i2 < t; ++i2) {
          this[this.l++] = parseInt(val.slice(2 * i2, 2 * i2 + 2), 16) || 0;
        }
        return this;
      } else if (f2 === "utf16le") {
        var end2 = Math.min(this.l + t, this.length);
        for (i2 = 0; i2 < Math.min(val.length, t); ++i2) {
          var cc = val.charCodeAt(i2);
          this[this.l++] = cc & 255;
          this[this.l++] = cc >> 8;
        }
        while (this.l < end2) this[this.l++] = 0;
        return this;
      } else switch (t) {
        case 1:
          size = 1;
          this[this.l] = val & 255;
          break;
        case 2:
          size = 2;
          this[this.l] = val & 255;
          val >>>= 8;
          this[this.l + 1] = val & 255;
          break;
        case 3:
          size = 3;
          this[this.l] = val & 255;
          val >>>= 8;
          this[this.l + 1] = val & 255;
          val >>>= 8;
          this[this.l + 2] = val & 255;
          break;
        case 4:
          size = 4;
          __writeUInt32LE(this, val, this.l);
          break;
        case 8:
          size = 8;
          if (f2 === "f") {
            write_double_le(this, val, this.l);
            break;
          }
        /* falls through */
        case 16:
          break;
        case -4:
          size = 4;
          __writeInt32LE(this, val, this.l);
          break;
      }
      this.l += size;
      return this;
    }
    function CheckField(hexstr, fld) {
      var m2 = __hexlify(this, this.l, hexstr.length >> 1);
      if (m2 !== hexstr) throw new Error(fld + "Expected " + hexstr + " saw " + m2);
      this.l += hexstr.length >> 1;
    }
    function prep_blob(blob, pos) {
      blob.l = pos;
      blob.read_shift = /*::(*/
      ReadShift;
      blob.chk = CheckField;
      blob.write_shift = WriteShift;
    }
    function parsenoop(blob, length) {
      blob.l += length;
    }
    function new_buf(sz) {
      var o2 = new_raw_buf(sz);
      prep_blob(o2, 0);
      return o2;
    }
    function buf_array() {
      var bufs = [], blksz = has_buf ? 256 : 2048;
      var newblk = function ba_newblk(sz) {
        var o2 = new_buf(sz);
        prep_blob(o2, 0);
        return o2;
      };
      var curbuf = newblk(blksz);
      var endbuf = function ba_endbuf() {
        if (!curbuf) return;
        if (curbuf.length > curbuf.l) {
          curbuf = curbuf.slice(0, curbuf.l);
          curbuf.l = curbuf.length;
        }
        if (curbuf.length > 0) bufs.push(curbuf);
        curbuf = null;
      };
      var next = function ba_next(sz) {
        if (curbuf && sz < curbuf.length - curbuf.l) return curbuf;
        endbuf();
        return curbuf = newblk(Math.max(sz + 1, blksz));
      };
      var end2 = function ba_end() {
        endbuf();
        return bconcat(bufs);
      };
      var push2 = function ba_push(buf) {
        endbuf();
        curbuf = buf;
        if (curbuf.l == null) curbuf.l = curbuf.length;
        next(blksz);
      };
      return { next, push: push2, end: end2, _bufs: bufs };
    }
    function write_record(ba, type, payload, length) {
      var t = +type, l2;
      if (isNaN(t)) return;
      if (!length) length = XLSBRecordEnum[t].p || (payload || []).length || 0;
      l2 = 1 + (t >= 128 ? 1 : 0) + 1;
      if (length >= 128) ++l2;
      if (length >= 16384) ++l2;
      if (length >= 2097152) ++l2;
      var o2 = ba.next(l2);
      if (t <= 127) o2.write_shift(1, t);
      else {
        o2.write_shift(1, (t & 127) + 128);
        o2.write_shift(1, t >> 7);
      }
      for (var i2 = 0; i2 != 4; ++i2) {
        if (length >= 128) {
          o2.write_shift(1, (length & 127) + 128);
          length >>= 7;
        } else {
          o2.write_shift(1, length);
          break;
        }
      }
      if (
        /*:: length != null &&*/
        length > 0 && is_buf(payload)
      ) ba.push(payload);
    }
    function shift_cell_xls(cell, tgt, opts) {
      var out2 = dup(cell);
      if (tgt.s) {
        if (out2.cRel) out2.c += tgt.s.c;
        if (out2.rRel) out2.r += tgt.s.r;
      } else {
        if (out2.cRel) out2.c += tgt.c;
        if (out2.rRel) out2.r += tgt.r;
      }
      if (!opts || opts.biff < 12) {
        while (out2.c >= 256) out2.c -= 256;
        while (out2.r >= 65536) out2.r -= 65536;
      }
      return out2;
    }
    function shift_range_xls(cell, range2, opts) {
      var out2 = dup(cell);
      out2.s = shift_cell_xls(out2.s, range2.s, opts);
      out2.e = shift_cell_xls(out2.e, range2.s, opts);
      return out2;
    }
    function encode_cell_xls(c2, biff) {
      if (c2.cRel && c2.c < 0) {
        c2 = dup(c2);
        while (c2.c < 0) c2.c += biff > 8 ? 16384 : 256;
      }
      if (c2.rRel && c2.r < 0) {
        c2 = dup(c2);
        while (c2.r < 0) c2.r += biff > 8 ? 1048576 : biff > 5 ? 65536 : 16384;
      }
      var s2 = encode_cell(c2);
      if (!c2.cRel && c2.cRel != null) s2 = fix_col(s2);
      if (!c2.rRel && c2.rRel != null) s2 = fix_row(s2);
      return s2;
    }
    function encode_range_xls(r, opts) {
      if (r.s.r == 0 && !r.s.rRel) {
        if (r.e.r == (opts.biff >= 12 ? 1048575 : opts.biff >= 8 ? 65536 : 16384) && !r.e.rRel) {
          return (r.s.cRel ? "" : "$") + encode_col(r.s.c) + ":" + (r.e.cRel ? "" : "$") + encode_col(r.e.c);
        }
      }
      if (r.s.c == 0 && !r.s.cRel) {
        if (r.e.c == (opts.biff >= 12 ? 16383 : 255) && !r.e.cRel) {
          return (r.s.rRel ? "" : "$") + encode_row(r.s.r) + ":" + (r.e.rRel ? "" : "$") + encode_row(r.e.r);
        }
      }
      return encode_cell_xls(r.s, opts.biff) + ":" + encode_cell_xls(r.e, opts.biff);
    }
    function decode_row(rowstr) {
      return parseInt(unfix_row(rowstr), 10) - 1;
    }
    function encode_row(row) {
      return "" + (row + 1);
    }
    function fix_row(cstr) {
      return cstr.replace(/([A-Z]|^)(\d+)$/, "$1$$$2");
    }
    function unfix_row(cstr) {
      return cstr.replace(/\$(\d+)$/, "$1");
    }
    function decode_col(colstr) {
      var c2 = unfix_col(colstr), d2 = 0, i2 = 0;
      for (; i2 !== c2.length; ++i2) d2 = 26 * d2 + c2.charCodeAt(i2) - 64;
      return d2 - 1;
    }
    function encode_col(col) {
      if (col < 0) throw new Error("invalid column " + col);
      var s2 = "";
      for (++col; col; col = Math.floor((col - 1) / 26)) s2 = String.fromCharCode((col - 1) % 26 + 65) + s2;
      return s2;
    }
    function fix_col(cstr) {
      return cstr.replace(/^([A-Z])/, "$$$1");
    }
    function unfix_col(cstr) {
      return cstr.replace(/^\$([A-Z])/, "$1");
    }
    function split_cell(cstr) {
      return cstr.replace(/(\$?[A-Z]*)(\$?\d*)/, "$1,$2").split(",");
    }
    function decode_cell(cstr) {
      var R2 = 0, C2 = 0;
      for (var i2 = 0; i2 < cstr.length; ++i2) {
        var cc = cstr.charCodeAt(i2);
        if (cc >= 48 && cc <= 57) R2 = 10 * R2 + (cc - 48);
        else if (cc >= 65 && cc <= 90) C2 = 26 * C2 + (cc - 64);
      }
      return { c: C2 - 1, r: R2 - 1 };
    }
    function encode_cell(cell) {
      var col = cell.c + 1;
      var s2 = "";
      for (; col; col = (col - 1) / 26 | 0) s2 = String.fromCharCode((col - 1) % 26 + 65) + s2;
      return s2 + (cell.r + 1);
    }
    function decode_range(range2) {
      var idx = range2.indexOf(":");
      if (idx == -1) return { s: decode_cell(range2), e: decode_cell(range2) };
      return { s: decode_cell(range2.slice(0, idx)), e: decode_cell(range2.slice(idx + 1)) };
    }
    function encode_range(cs, ce2) {
      if (typeof ce2 === "undefined" || typeof ce2 === "number") {
        return encode_range(cs.s, cs.e);
      }
      if (typeof cs !== "string") cs = encode_cell(cs);
      if (typeof ce2 !== "string") ce2 = encode_cell(ce2);
      return cs == ce2 ? cs : cs + ":" + ce2;
    }
    function safe_decode_range(range2) {
      var o2 = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
      var idx = 0, i2 = 0, cc = 0;
      var len2 = range2.length;
      for (idx = 0; i2 < len2; ++i2) {
        if ((cc = range2.charCodeAt(i2) - 64) < 1 || cc > 26) break;
        idx = 26 * idx + cc;
      }
      o2.s.c = --idx;
      for (idx = 0; i2 < len2; ++i2) {
        if ((cc = range2.charCodeAt(i2) - 48) < 0 || cc > 9) break;
        idx = 10 * idx + cc;
      }
      o2.s.r = --idx;
      if (i2 === len2 || cc != 10) {
        o2.e.c = o2.s.c;
        o2.e.r = o2.s.r;
        return o2;
      }
      ++i2;
      for (idx = 0; i2 != len2; ++i2) {
        if ((cc = range2.charCodeAt(i2) - 64) < 1 || cc > 26) break;
        idx = 26 * idx + cc;
      }
      o2.e.c = --idx;
      for (idx = 0; i2 != len2; ++i2) {
        if ((cc = range2.charCodeAt(i2) - 48) < 0 || cc > 9) break;
        idx = 10 * idx + cc;
      }
      o2.e.r = --idx;
      return o2;
    }
    function safe_format_cell(cell, v4) {
      var q2 = cell.t == "d" && v4 instanceof Date;
      if (cell.z != null) try {
        return cell.w = SSF_format(cell.z, q2 ? datenum(v4) : v4);
      } catch (e2) {
      }
      try {
        return cell.w = SSF_format((cell.XF || {}).numFmtId || (q2 ? 14 : 0), q2 ? datenum(v4) : v4);
      } catch (e2) {
        return "" + v4;
      }
    }
    function format_cell(cell, v4, o2) {
      if (cell == null || cell.t == null || cell.t == "z") return "";
      if (cell.w !== void 0) return cell.w;
      if (cell.t == "d" && !cell.z && o2 && o2.dateNF) cell.z = o2.dateNF;
      if (cell.t == "e") return BErr[cell.v] || cell.v;
      if (v4 == void 0) return safe_format_cell(cell, cell.v);
      return safe_format_cell(cell, v4);
    }
    function sheet_to_workbook(sheet, opts) {
      var n = opts && opts.sheet ? opts.sheet : "Sheet1";
      var sheets = {};
      sheets[n] = sheet;
      return { SheetNames: [n], Sheets: sheets };
    }
    function sheet_add_aoa(_ws, data, opts) {
      var o2 = opts || {};
      var dense = _ws ? Array.isArray(_ws) : o2.dense;
      var ws = _ws || (dense ? [] : {});
      var _R = 0, _C = 0;
      if (ws && o2.origin != null) {
        if (typeof o2.origin == "number") _R = o2.origin;
        else {
          var _origin = typeof o2.origin == "string" ? decode_cell(o2.origin) : o2.origin;
          _R = _origin.r;
          _C = _origin.c;
        }
        if (!ws["!ref"]) ws["!ref"] = "A1:A1";
      }
      var range2 = { s: { c: 1e7, r: 1e7 }, e: { c: 0, r: 0 } };
      if (ws["!ref"]) {
        var _range = safe_decode_range(ws["!ref"]);
        range2.s.c = _range.s.c;
        range2.s.r = _range.s.r;
        range2.e.c = Math.max(range2.e.c, _range.e.c);
        range2.e.r = Math.max(range2.e.r, _range.e.r);
        if (_R == -1) range2.e.r = _R = _range.e.r + 1;
      }
      for (var R2 = 0; R2 != data.length; ++R2) {
        if (!data[R2]) continue;
        if (!Array.isArray(data[R2])) throw new Error("aoa_to_sheet expects an array of arrays");
        for (var C2 = 0; C2 != data[R2].length; ++C2) {
          if (typeof data[R2][C2] === "undefined") continue;
          var cell = { v: data[R2][C2] };
          var __R = _R + R2, __C = _C + C2;
          if (range2.s.r > __R) range2.s.r = __R;
          if (range2.s.c > __C) range2.s.c = __C;
          if (range2.e.r < __R) range2.e.r = __R;
          if (range2.e.c < __C) range2.e.c = __C;
          if (data[R2][C2] && typeof data[R2][C2] === "object" && !Array.isArray(data[R2][C2]) && !(data[R2][C2] instanceof Date)) cell = data[R2][C2];
          else {
            if (Array.isArray(cell.v)) {
              cell.f = data[R2][C2][1];
              cell.v = cell.v[0];
            }
            if (cell.v === null) {
              if (cell.f) cell.t = "n";
              else if (o2.nullError) {
                cell.t = "e";
                cell.v = 0;
              } else if (!o2.sheetStubs) continue;
              else cell.t = "z";
            } else if (typeof cell.v === "number") cell.t = "n";
            else if (typeof cell.v === "boolean") cell.t = "b";
            else if (cell.v instanceof Date) {
              cell.z = o2.dateNF || table_fmt[14];
              if (o2.cellDates) {
                cell.t = "d";
                cell.w = SSF_format(cell.z, datenum(cell.v));
              } else {
                cell.t = "n";
                cell.v = datenum(cell.v);
                cell.w = SSF_format(cell.z, cell.v);
              }
            } else cell.t = "s";
          }
          if (dense) {
            if (!ws[__R]) ws[__R] = [];
            if (ws[__R][__C] && ws[__R][__C].z) cell.z = ws[__R][__C].z;
            ws[__R][__C] = cell;
          } else {
            var cell_ref = encode_cell({ c: __C, r: __R });
            if (ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;
            ws[cell_ref] = cell;
          }
        }
      }
      if (range2.s.c < 1e7) ws["!ref"] = encode_range(range2);
      return ws;
    }
    function aoa_to_sheet(data, opts) {
      return sheet_add_aoa(null, data, opts);
    }
    function parse_Int32LE(data) {
      return data.read_shift(4, "i");
    }
    function write_UInt32LE(x2, o2) {
      if (!o2) o2 = new_buf(4);
      o2.write_shift(4, x2);
      return o2;
    }
    function parse_XLWideString(data) {
      var cchCharacters = data.read_shift(4);
      return cchCharacters === 0 ? "" : data.read_shift(cchCharacters, "dbcs");
    }
    function write_XLWideString(data, o2) {
      var _null = false;
      if (o2 == null) {
        _null = true;
        o2 = new_buf(4 + 2 * data.length);
      }
      o2.write_shift(4, data.length);
      if (data.length > 0) o2.write_shift(0, data, "dbcs");
      return _null ? o2.slice(0, o2.l) : o2;
    }
    function parse_StrRun(data) {
      return { ich: data.read_shift(2), ifnt: data.read_shift(2) };
    }
    function write_StrRun(run, o2) {
      if (!o2) o2 = new_buf(4);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      return o2;
    }
    function parse_RichStr(data, length) {
      var start2 = data.l;
      var flags = data.read_shift(1);
      var str = parse_XLWideString(data);
      var rgsStrRun = [];
      var z2 = { t: str, h: str };
      if ((flags & 1) !== 0) {
        var dwSizeStrRun = data.read_shift(4);
        for (var i2 = 0; i2 != dwSizeStrRun; ++i2) rgsStrRun.push(parse_StrRun(data));
        z2.r = rgsStrRun;
      } else z2.r = [{ ich: 0, ifnt: 0 }];
      data.l = start2 + length;
      return z2;
    }
    function write_RichStr(str, o2) {
      var _null = false;
      if (o2 == null) {
        _null = true;
        o2 = new_buf(15 + 4 * str.t.length);
      }
      o2.write_shift(1, 0);
      write_XLWideString(str.t, o2);
      return _null ? o2.slice(0, o2.l) : o2;
    }
    var parse_BrtCommentText = parse_RichStr;
    function write_BrtCommentText(str, o2) {
      var _null = false;
      if (o2 == null) {
        _null = true;
        o2 = new_buf(23 + 4 * str.t.length);
      }
      o2.write_shift(1, 1);
      write_XLWideString(str.t, o2);
      o2.write_shift(4, 1);
      write_StrRun({}, o2);
      return _null ? o2.slice(0, o2.l) : o2;
    }
    function parse_XLSBCell(data) {
      var col = data.read_shift(4);
      var iStyleRef = data.read_shift(2);
      iStyleRef += data.read_shift(1) << 16;
      data.l++;
      return { c: col, iStyleRef };
    }
    function write_XLSBCell(cell, o2) {
      if (o2 == null) o2 = new_buf(8);
      o2.write_shift(-4, cell.c);
      o2.write_shift(3, cell.iStyleRef || cell.s);
      o2.write_shift(1, 0);
      return o2;
    }
    function parse_XLSBShortCell(data) {
      var iStyleRef = data.read_shift(2);
      iStyleRef += data.read_shift(1) << 16;
      data.l++;
      return { c: -1, iStyleRef };
    }
    function write_XLSBShortCell(cell, o2) {
      if (o2 == null) o2 = new_buf(4);
      o2.write_shift(3, cell.iStyleRef || cell.s);
      o2.write_shift(1, 0);
      return o2;
    }
    var parse_XLSBCodeName = parse_XLWideString;
    var write_XLSBCodeName = write_XLWideString;
    function parse_XLNullableWideString(data) {
      var cchCharacters = data.read_shift(4);
      return cchCharacters === 0 || cchCharacters === 4294967295 ? "" : data.read_shift(cchCharacters, "dbcs");
    }
    function write_XLNullableWideString(data, o2) {
      var _null = false;
      if (o2 == null) {
        _null = true;
        o2 = new_buf(127);
      }
      o2.write_shift(4, data.length > 0 ? data.length : 4294967295);
      if (data.length > 0) o2.write_shift(0, data, "dbcs");
      return _null ? o2.slice(0, o2.l) : o2;
    }
    var parse_XLNameWideString = parse_XLWideString;
    var parse_RelID = parse_XLNullableWideString;
    var write_RelID = write_XLNullableWideString;
    function parse_RkNumber(data) {
      var b2 = data.slice(data.l, data.l + 4);
      var fX100 = b2[0] & 1, fInt = b2[0] & 2;
      data.l += 4;
      var RK = fInt === 0 ? __double([0, 0, 0, 0, b2[0] & 252, b2[1], b2[2], b2[3]], 0) : __readInt32LE(b2, 0) >> 2;
      return fX100 ? RK / 100 : RK;
    }
    function write_RkNumber(data, o2) {
      if (o2 == null) o2 = new_buf(4);
      var fX100 = 0, fInt = 0, d100 = data * 100;
      if (data == (data | 0) && data >= -536870912 && data < 1 << 29) {
        fInt = 1;
      } else if (d100 == (d100 | 0) && d100 >= -536870912 && d100 < 1 << 29) {
        fInt = 1;
        fX100 = 1;
      }
      if (fInt) o2.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));
      else throw new Error("unsupported RkNumber " + data);
    }
    function parse_RfX(data) {
      var cell = { s: {}, e: {} };
      cell.s.r = data.read_shift(4);
      cell.e.r = data.read_shift(4);
      cell.s.c = data.read_shift(4);
      cell.e.c = data.read_shift(4);
      return cell;
    }
    function write_RfX(r, o2) {
      if (!o2) o2 = new_buf(16);
      o2.write_shift(4, r.s.r);
      o2.write_shift(4, r.e.r);
      o2.write_shift(4, r.s.c);
      o2.write_shift(4, r.e.c);
      return o2;
    }
    var parse_UncheckedRfX = parse_RfX;
    var write_UncheckedRfX = write_RfX;
    function parse_Xnum(data) {
      if (data.length - data.l < 8) throw "XLS Xnum Buffer underflow";
      return data.read_shift(8, "f");
    }
    function write_Xnum(data, o2) {
      return (o2 || new_buf(8)).write_shift(8, data, "f");
    }
    function parse_BrtColor(data) {
      var out2 = {};
      var d2 = data.read_shift(1);
      var xColorType = d2 >>> 1;
      var index = data.read_shift(1);
      var nTS = data.read_shift(2, "i");
      var bR = data.read_shift(1);
      var bG = data.read_shift(1);
      var bB = data.read_shift(1);
      data.l++;
      switch (xColorType) {
        case 0:
          out2.auto = 1;
          break;
        case 1:
          out2.index = index;
          var icv = XLSIcv[index];
          if (icv) out2.rgb = rgb2Hex(icv);
          break;
        case 2:
          out2.rgb = rgb2Hex([bR, bG, bB]);
          break;
        case 3:
          out2.theme = index;
          break;
      }
      if (nTS != 0) out2.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;
      return out2;
    }
    function write_BrtColor(color2, o2) {
      if (!o2) o2 = new_buf(8);
      if (!color2 || color2.auto) {
        o2.write_shift(4, 0);
        o2.write_shift(4, 0);
        return o2;
      }
      if (color2.index != null) {
        o2.write_shift(1, 2);
        o2.write_shift(1, color2.index);
      } else if (color2.theme != null) {
        o2.write_shift(1, 6);
        o2.write_shift(1, color2.theme);
      } else {
        o2.write_shift(1, 5);
        o2.write_shift(1, 0);
      }
      var nTS = color2.tint || 0;
      if (nTS > 0) nTS *= 32767;
      else if (nTS < 0) nTS *= 32768;
      o2.write_shift(2, nTS);
      if (!color2.rgb || color2.theme != null) {
        o2.write_shift(2, 0);
        o2.write_shift(1, 0);
        o2.write_shift(1, 0);
      } else {
        var rgb2 = color2.rgb || "FFFFFF";
        if (typeof rgb2 == "number") rgb2 = ("000000" + rgb2.toString(16)).slice(-6);
        o2.write_shift(1, parseInt(rgb2.slice(0, 2), 16));
        o2.write_shift(1, parseInt(rgb2.slice(2, 4), 16));
        o2.write_shift(1, parseInt(rgb2.slice(4, 6), 16));
        o2.write_shift(1, 255);
      }
      return o2;
    }
    function parse_FontFlags(data) {
      var d2 = data.read_shift(1);
      data.l++;
      var out2 = {
        fBold: d2 & 1,
        fItalic: d2 & 2,
        fUnderline: d2 & 4,
        fStrikeout: d2 & 8,
        fOutline: d2 & 16,
        fShadow: d2 & 32,
        fCondense: d2 & 64,
        fExtend: d2 & 128
      };
      return out2;
    }
    function write_FontFlags(font, o2) {
      if (!o2) o2 = new_buf(2);
      var grbit = (font.italic ? 2 : 0) | (font.strike ? 8 : 0) | (font.outline ? 16 : 0) | (font.shadow ? 32 : 0) | (font.condense ? 64 : 0) | (font.extend ? 128 : 0);
      o2.write_shift(1, grbit);
      o2.write_shift(1, 0);
      return o2;
    }
    var VT_I2 = 2;
    var VT_I4 = 3;
    var VT_BOOL = 11;
    var VT_UI4 = 19;
    var VT_FILETIME = 64;
    var VT_BLOB = 65;
    var VT_CF = 71;
    var VT_VECTOR_VARIANT = 4108;
    var VT_VECTOR_LPSTR = 4126;
    var VT_STRING = 80;
    var DocSummaryPIDDSI = {
      /*::[*/
      1: { n: "CodePage", t: VT_I2 },
      /*::[*/
      2: { n: "Category", t: VT_STRING },
      /*::[*/
      3: { n: "PresentationFormat", t: VT_STRING },
      /*::[*/
      4: { n: "ByteCount", t: VT_I4 },
      /*::[*/
      5: { n: "LineCount", t: VT_I4 },
      /*::[*/
      6: { n: "ParagraphCount", t: VT_I4 },
      /*::[*/
      7: { n: "SlideCount", t: VT_I4 },
      /*::[*/
      8: { n: "NoteCount", t: VT_I4 },
      /*::[*/
      9: { n: "HiddenCount", t: VT_I4 },
      /*::[*/
      10: { n: "MultimediaClipCount", t: VT_I4 },
      /*::[*/
      11: { n: "ScaleCrop", t: VT_BOOL },
      /*::[*/
      12: {
        n: "HeadingPairs",
        t: VT_VECTOR_VARIANT
        /* VT_VECTOR | VT_VARIANT */
      },
      /*::[*/
      13: {
        n: "TitlesOfParts",
        t: VT_VECTOR_LPSTR
        /* VT_VECTOR | VT_LPSTR */
      },
      /*::[*/
      14: { n: "Manager", t: VT_STRING },
      /*::[*/
      15: { n: "Company", t: VT_STRING },
      /*::[*/
      16: { n: "LinksUpToDate", t: VT_BOOL },
      /*::[*/
      17: { n: "CharacterCount", t: VT_I4 },
      /*::[*/
      19: { n: "SharedDoc", t: VT_BOOL },
      /*::[*/
      22: { n: "HyperlinksChanged", t: VT_BOOL },
      /*::[*/
      23: { n: "AppVersion", t: VT_I4, p: "version" },
      /*::[*/
      24: { n: "DigSig", t: VT_BLOB },
      /*::[*/
      26: { n: "ContentType", t: VT_STRING },
      /*::[*/
      27: { n: "ContentStatus", t: VT_STRING },
      /*::[*/
      28: { n: "Language", t: VT_STRING },
      /*::[*/
      29: { n: "Version", t: VT_STRING },
      /*::[*/
      255: {},
      /* [MS-OLEPS] 2.18 */
      /*::[*/
      2147483648: { n: "Locale", t: VT_UI4 },
      /*::[*/
      2147483651: { n: "Behavior", t: VT_UI4 },
      /*::[*/
      1919054434: {}
    };
    var SummaryPIDSI = {
      /*::[*/
      1: { n: "CodePage", t: VT_I2 },
      /*::[*/
      2: { n: "Title", t: VT_STRING },
      /*::[*/
      3: { n: "Subject", t: VT_STRING },
      /*::[*/
      4: { n: "Author", t: VT_STRING },
      /*::[*/
      5: { n: "Keywords", t: VT_STRING },
      /*::[*/
      6: { n: "Comments", t: VT_STRING },
      /*::[*/
      7: { n: "Template", t: VT_STRING },
      /*::[*/
      8: { n: "LastAuthor", t: VT_STRING },
      /*::[*/
      9: { n: "RevNumber", t: VT_STRING },
      /*::[*/
      10: { n: "EditTime", t: VT_FILETIME },
      /*::[*/
      11: { n: "LastPrinted", t: VT_FILETIME },
      /*::[*/
      12: { n: "CreatedDate", t: VT_FILETIME },
      /*::[*/
      13: { n: "ModifiedDate", t: VT_FILETIME },
      /*::[*/
      14: { n: "PageCount", t: VT_I4 },
      /*::[*/
      15: { n: "WordCount", t: VT_I4 },
      /*::[*/
      16: { n: "CharCount", t: VT_I4 },
      /*::[*/
      17: { n: "Thumbnail", t: VT_CF },
      /*::[*/
      18: { n: "Application", t: VT_STRING },
      /*::[*/
      19: { n: "DocSecurity", t: VT_I4 },
      /*::[*/
      255: {},
      /* [MS-OLEPS] 2.18 */
      /*::[*/
      2147483648: { n: "Locale", t: VT_UI4 },
      /*::[*/
      2147483651: { n: "Behavior", t: VT_UI4 },
      /*::[*/
      1919054434: {}
    };
    function rgbify(arr) {
      return arr.map(function(x2) {
        return [x2 >> 16 & 255, x2 >> 8 & 255, x2 & 255];
      });
    }
    var _XLSIcv = /* @__PURE__ */ rgbify([
      /* Color Constants */
      0,
      16777215,
      16711680,
      65280,
      255,
      16776960,
      16711935,
      65535,
      /* Overridable Defaults */
      0,
      16777215,
      16711680,
      65280,
      255,
      16776960,
      16711935,
      65535,
      8388608,
      32768,
      128,
      8421376,
      8388736,
      32896,
      12632256,
      8421504,
      10066431,
      10040166,
      16777164,
      13434879,
      6684774,
      16744576,
      26316,
      13421823,
      128,
      16711935,
      16776960,
      65535,
      8388736,
      8388608,
      32896,
      255,
      52479,
      13434879,
      13434828,
      16777113,
      10079487,
      16751052,
      13408767,
      16764057,
      3368703,
      3394764,
      10079232,
      16763904,
      16750848,
      16737792,
      6710937,
      9868950,
      13158,
      3381606,
      13056,
      3355392,
      10040064,
      10040166,
      3355545,
      3355443,
      /* Other entries to appease BIFF8/12 */
      16777215,
      /* 0x40 icvForeground ?? */
      0,
      /* 0x41 icvBackground ?? */
      0,
      /* 0x42 icvFrame ?? */
      0,
      /* 0x43 icv3D ?? */
      0,
      /* 0x44 icv3DText ?? */
      0,
      /* 0x45 icv3DHilite ?? */
      0,
      /* 0x46 icv3DShadow ?? */
      0,
      /* 0x47 icvHilite ?? */
      0,
      /* 0x48 icvCtlText ?? */
      0,
      /* 0x49 icvCtlScrl ?? */
      0,
      /* 0x4A icvCtlInv ?? */
      0,
      /* 0x4B icvCtlBody ?? */
      0,
      /* 0x4C icvCtlFrame ?? */
      0,
      /* 0x4D icvCtlFore ?? */
      0,
      /* 0x4E icvCtlBack ?? */
      0,
      /* 0x4F icvCtlNeutral */
      0,
      /* 0x50 icvInfoBk ?? */
      0
      /* 0x51 icvInfoText ?? */
    ]);
    var XLSIcv = /* @__PURE__ */ dup(_XLSIcv);
    var BErr = {
      /*::[*/
      0: "#NULL!",
      /*::[*/
      7: "#DIV/0!",
      /*::[*/
      15: "#VALUE!",
      /*::[*/
      23: "#REF!",
      /*::[*/
      29: "#NAME?",
      /*::[*/
      36: "#NUM!",
      /*::[*/
      42: "#N/A",
      /*::[*/
      43: "#GETTING_DATA",
      /*::[*/
      255: "#WTF?"
    };
    var ct2type = {
      /* Workbook */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
      "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
      "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
      "application/vnd.ms-excel.addin.macroEnabled.main+xml": "workbooks",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": "workbooks",
      /* Worksheet */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": "sheets",
      "application/vnd.ms-excel.worksheet": "sheets",
      "application/vnd.ms-excel.binIndexWs": "TODO",
      /* Binary Index */
      /* Chartsheet */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": "charts",
      "application/vnd.ms-excel.chartsheet": "charts",
      /* Macrosheet */
      "application/vnd.ms-excel.macrosheet+xml": "macros",
      "application/vnd.ms-excel.macrosheet": "macros",
      "application/vnd.ms-excel.intlmacrosheet": "TODO",
      "application/vnd.ms-excel.binIndexMs": "TODO",
      /* Binary Index */
      /* Dialogsheet */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": "dialogs",
      "application/vnd.ms-excel.dialogsheet": "dialogs",
      /* Shared Strings */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml": "strs",
      "application/vnd.ms-excel.sharedStrings": "strs",
      /* Styles */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": "styles",
      "application/vnd.ms-excel.styles": "styles",
      /* File Properties */
      "application/vnd.openxmlformats-package.core-properties+xml": "coreprops",
      "application/vnd.openxmlformats-officedocument.custom-properties+xml": "custprops",
      "application/vnd.openxmlformats-officedocument.extended-properties+xml": "extprops",
      /* Custom Data Properties */
      "application/vnd.openxmlformats-officedocument.customXmlProperties+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty": "TODO",
      /* Comments */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": "comments",
      "application/vnd.ms-excel.comments": "comments",
      "application/vnd.ms-excel.threadedcomments+xml": "threadedcomments",
      "application/vnd.ms-excel.person+xml": "people",
      /* Metadata (Stock/Geography and Dynamic Array) */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml": "metadata",
      "application/vnd.ms-excel.sheetMetadata": "metadata",
      /* PivotTable */
      "application/vnd.ms-excel.pivotTable": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml": "TODO",
      /* Chart Objects */
      "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": "TODO",
      /* Chart Colors */
      "application/vnd.ms-office.chartcolorstyle+xml": "TODO",
      /* Chart Style */
      "application/vnd.ms-office.chartstyle+xml": "TODO",
      /* Chart Advanced */
      "application/vnd.ms-office.chartex+xml": "TODO",
      /* Calculation Chain */
      "application/vnd.ms-excel.calcChain": "calcchains",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml": "calcchains",
      /* Printer Settings */
      "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings": "TODO",
      /* ActiveX */
      "application/vnd.ms-office.activeX": "TODO",
      "application/vnd.ms-office.activeX+xml": "TODO",
      /* Custom Toolbars */
      "application/vnd.ms-excel.attachedToolbars": "TODO",
      /* External Data Connections */
      "application/vnd.ms-excel.connections": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": "TODO",
      /* External Links */
      "application/vnd.ms-excel.externalLink": "links",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
      /* PivotCache */
      "application/vnd.ms-excel.pivotCacheDefinition": "TODO",
      "application/vnd.ms-excel.pivotCacheRecords": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml": "TODO",
      /* Query Table */
      "application/vnd.ms-excel.queryTable": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml": "TODO",
      /* Shared Workbook */
      "application/vnd.ms-excel.userNames": "TODO",
      "application/vnd.ms-excel.revisionHeaders": "TODO",
      "application/vnd.ms-excel.revisionLog": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml": "TODO",
      /* Single Cell Table */
      "application/vnd.ms-excel.tableSingleCells": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml": "TODO",
      /* Slicer */
      "application/vnd.ms-excel.slicer": "TODO",
      "application/vnd.ms-excel.slicerCache": "TODO",
      "application/vnd.ms-excel.slicer+xml": "TODO",
      "application/vnd.ms-excel.slicerCache+xml": "TODO",
      /* Sort Map */
      "application/vnd.ms-excel.wsSortMap": "TODO",
      /* Table */
      "application/vnd.ms-excel.table": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": "TODO",
      /* Themes */
      "application/vnd.openxmlformats-officedocument.theme+xml": "themes",
      /* Theme Override */
      "application/vnd.openxmlformats-officedocument.themeOverride+xml": "TODO",
      /* Timeline */
      "application/vnd.ms-excel.Timeline+xml": "TODO",
      /* verify */
      "application/vnd.ms-excel.TimelineCache+xml": "TODO",
      /* verify */
      /* VBA */
      "application/vnd.ms-office.vbaProject": "vba",
      "application/vnd.ms-office.vbaProjectSignature": "TODO",
      /* Volatile Dependencies */
      "application/vnd.ms-office.volatileDependencies": "TODO",
      "application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml": "TODO",
      /* Control Properties */
      "application/vnd.ms-excel.controlproperties+xml": "TODO",
      /* Data Model */
      "application/vnd.openxmlformats-officedocument.model+data": "TODO",
      /* Survey */
      "application/vnd.ms-excel.Survey+xml": "TODO",
      /* Drawing */
      "application/vnd.openxmlformats-officedocument.drawing+xml": "drawings",
      "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml": "TODO",
      "application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml": "TODO",
      /* VML */
      "application/vnd.openxmlformats-officedocument.vmlDrawing": "TODO",
      "application/vnd.openxmlformats-package.relationships+xml": "rels",
      "application/vnd.openxmlformats-officedocument.oleObject": "TODO",
      /* Image */
      "image/png": "TODO",
      "sheet": "js"
    };
    var CT_LIST = {
      workbooks: {
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
        xlsm: "application/vnd.ms-excel.sheet.macroEnabled.main+xml",
        xlsb: "application/vnd.ms-excel.sheet.binary.macroEnabled.main",
        xlam: "application/vnd.ms-excel.addin.macroEnabled.main+xml",
        xltx: "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml"
      },
      strs: {
        /* Shared Strings */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
        xlsb: "application/vnd.ms-excel.sharedStrings"
      },
      comments: {
        /* Comments */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
        xlsb: "application/vnd.ms-excel.comments"
      },
      sheets: {
        /* Worksheet */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
        xlsb: "application/vnd.ms-excel.worksheet"
      },
      charts: {
        /* Chartsheet */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml",
        xlsb: "application/vnd.ms-excel.chartsheet"
      },
      dialogs: {
        /* Dialogsheet */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml",
        xlsb: "application/vnd.ms-excel.dialogsheet"
      },
      macros: {
        /* Macrosheet (Excel 4.0 Macros) */
        xlsx: "application/vnd.ms-excel.macrosheet+xml",
        xlsb: "application/vnd.ms-excel.macrosheet"
      },
      metadata: {
        /* Metadata (Stock/Geography and Dynamic Array) */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
        xlsb: "application/vnd.ms-excel.sheetMetadata"
      },
      styles: {
        /* Styles */
        xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
        xlsb: "application/vnd.ms-excel.styles"
      }
    };
    function new_ct() {
      return {
        workbooks: [],
        sheets: [],
        charts: [],
        dialogs: [],
        macros: [],
        rels: [],
        strs: [],
        comments: [],
        threadedcomments: [],
        links: [],
        coreprops: [],
        extprops: [],
        custprops: [],
        themes: [],
        styles: [],
        calcchains: [],
        vba: [],
        drawings: [],
        metadata: [],
        people: [],
        TODO: [],
        xmlns: ""
      };
    }
    function write_ct(ct2, opts) {
      var type2ct = evert_arr(ct2type);
      var o2 = [], v4;
      o2[o2.length] = XML_HEADER;
      o2[o2.length] = writextag("Types", null, {
        "xmlns": XMLNS.CT,
        "xmlns:xsd": XMLNS.xsd,
        "xmlns:xsi": XMLNS.xsi
      });
      o2 = o2.concat([
        ["xml", "application/xml"],
        ["bin", "application/vnd.ms-excel.sheet.binary.macroEnabled.main"],
        ["vml", "application/vnd.openxmlformats-officedocument.vmlDrawing"],
        ["data", "application/vnd.openxmlformats-officedocument.model+data"],
        /* from test files */
        ["bmp", "image/bmp"],
        ["png", "image/png"],
        ["gif", "image/gif"],
        ["emf", "image/x-emf"],
        ["wmf", "image/x-wmf"],
        ["jpg", "image/jpeg"],
        ["jpeg", "image/jpeg"],
        ["tif", "image/tiff"],
        ["tiff", "image/tiff"],
        ["pdf", "application/pdf"],
        ["rels", "application/vnd.openxmlformats-package.relationships+xml"]
      ].map(function(x2) {
        return writextag("Default", null, { "Extension": x2[0], "ContentType": x2[1] });
      }));
      var f1 = function(w2) {
        if (ct2[w2] && ct2[w2].length > 0) {
          v4 = ct2[w2][0];
          o2[o2.length] = writextag("Override", null, {
            "PartName": (v4[0] == "/" ? "" : "/") + v4,
            "ContentType": CT_LIST[w2][opts.bookType] || CT_LIST[w2]["xlsx"]
          });
        }
      };
      var f2 = function(w2) {
        (ct2[w2] || []).forEach(function(v5) {
          o2[o2.length] = writextag("Override", null, {
            "PartName": (v5[0] == "/" ? "" : "/") + v5,
            "ContentType": CT_LIST[w2][opts.bookType] || CT_LIST[w2]["xlsx"]
          });
        });
      };
      var f3 = function(t) {
        (ct2[t] || []).forEach(function(v5) {
          o2[o2.length] = writextag("Override", null, {
            "PartName": (v5[0] == "/" ? "" : "/") + v5,
            "ContentType": type2ct[t][0]
          });
        });
      };
      f1("workbooks");
      f2("sheets");
      f2("charts");
      f3("themes");
      ["strs", "styles"].forEach(f1);
      ["coreprops", "extprops", "custprops"].forEach(f3);
      f3("vba");
      f3("comments");
      f3("threadedcomments");
      f3("drawings");
      f2("metadata");
      f3("people");
      if (o2.length > 2) {
        o2[o2.length] = "</Types>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    var RELS = {
      WB: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
      HLINK: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
      VML: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
      XPATH: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",
      XMISS: "http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",
      CMNT: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
      CORE_PROPS: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
      EXT_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
      CUST_PROPS: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",
      SST: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
      STY: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
      THEME: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
      WS: [
        "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
        "http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"
      ],
      DRAW: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
      XLMETA: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
      TCMNT: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
      PEOPLE: "http://schemas.microsoft.com/office/2017/10/relationships/person",
      VBA: "http://schemas.microsoft.com/office/2006/relationships/vbaProject"
    };
    function get_rels_path(file) {
      var n = file.lastIndexOf("/");
      return file.slice(0, n + 1) + "_rels/" + file.slice(n + 1) + ".rels";
    }
    function write_rels(rels) {
      var o2 = [XML_HEADER, writextag("Relationships", null, {
        //'xmlns:ns0': XMLNS.RELS,
        "xmlns": XMLNS.RELS
      })];
      keys(rels["!id"]).forEach(function(rid) {
        o2[o2.length] = writextag("Relationship", null, rels["!id"][rid]);
      });
      if (o2.length > 2) {
        o2[o2.length] = "</Relationships>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function add_rels(rels, rId, f2, type, relobj, targetmode) {
      if (!relobj) relobj = {};
      if (!rels["!id"]) rels["!id"] = {};
      if (!rels["!idx"]) rels["!idx"] = 1;
      if (rId < 0) for (rId = rels["!idx"]; rels["!id"]["rId" + rId]; ++rId) {
      }
      rels["!idx"] = rId + 1;
      relobj.Id = "rId" + rId;
      relobj.Type = type;
      relobj.Target = f2;
      if ([RELS.HLINK, RELS.XPATH, RELS.XMISS].indexOf(relobj.Type) > -1) relobj.TargetMode = "External";
      if (rels["!id"][relobj.Id]) throw new Error("Cannot rewrite rId " + rId);
      rels["!id"][relobj.Id] = relobj;
      rels[("/" + relobj.Target).replace("//", "/")] = relobj;
      return rId;
    }
    function write_manifest(manifest) {
      var o2 = [XML_HEADER];
      o2.push('<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n');
      o2.push('  <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n');
      for (var i2 = 0; i2 < manifest.length; ++i2) o2.push('  <manifest:file-entry manifest:full-path="' + manifest[i2][0] + '" manifest:media-type="' + manifest[i2][1] + '"/>\n');
      o2.push("</manifest:manifest>");
      return o2.join("");
    }
    function write_rdf_type(file, res, tag) {
      return [
        '  <rdf:Description rdf:about="' + file + '">\n',
        '    <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + (tag || "odf") + "#" + res + '"/>\n',
        "  </rdf:Description>\n"
      ].join("");
    }
    function write_rdf_has(base2, file) {
      return [
        '  <rdf:Description rdf:about="' + base2 + '">\n',
        '    <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n',
        "  </rdf:Description>\n"
      ].join("");
    }
    function write_rdf(rdf) {
      var o2 = [XML_HEADER];
      o2.push('<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n');
      for (var i2 = 0; i2 != rdf.length; ++i2) {
        o2.push(write_rdf_type(rdf[i2][0], rdf[i2][1]));
        o2.push(write_rdf_has("", rdf[i2][0]));
      }
      o2.push(write_rdf_type("", "Document", "pkg"));
      o2.push("</rdf:RDF>");
      return o2.join("");
    }
    function write_meta_ods() {
      return '<office:document-meta xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xlink="http://www.w3.org/1999/xlink" office:version="1.2"><office:meta><meta:generator>SheetJS ' + XLSX.version + "</meta:generator></office:meta></office:document-meta>";
    }
    var CORE_PROPS = [
      ["cp:category", "Category"],
      ["cp:contentStatus", "ContentStatus"],
      ["cp:keywords", "Keywords"],
      ["cp:lastModifiedBy", "LastAuthor"],
      ["cp:lastPrinted", "LastPrinted"],
      ["cp:revision", "RevNumber"],
      ["cp:version", "Version"],
      ["dc:creator", "Author"],
      ["dc:description", "Comments"],
      ["dc:identifier", "Identifier"],
      ["dc:language", "Language"],
      ["dc:subject", "Subject"],
      ["dc:title", "Title"],
      ["dcterms:created", "CreatedDate", "date"],
      ["dcterms:modified", "ModifiedDate", "date"]
    ];
    function cp_doit(f2, g, h2, o2, p2) {
      if (p2[f2] != null || g == null || g === "") return;
      p2[f2] = g;
      g = escapexml(g);
      o2[o2.length] = h2 ? writextag(f2, g, h2) : writetag(f2, g);
    }
    function write_core_props(cp, _opts) {
      var opts = _opts || {};
      var o2 = [XML_HEADER, writextag("cp:coreProperties", null, {
        //'xmlns': XMLNS.CORE_PROPS,
        "xmlns:cp": XMLNS.CORE_PROPS,
        "xmlns:dc": XMLNS.dc,
        "xmlns:dcterms": XMLNS.dcterms,
        "xmlns:dcmitype": XMLNS.dcmitype,
        "xmlns:xsi": XMLNS.xsi
      })], p2 = {};
      if (!cp && !opts.Props) return o2.join("");
      if (cp) {
        if (cp.CreatedDate != null) cp_doit("dcterms:created", typeof cp.CreatedDate === "string" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), { "xsi:type": "dcterms:W3CDTF" }, o2, p2);
        if (cp.ModifiedDate != null) cp_doit("dcterms:modified", typeof cp.ModifiedDate === "string" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), { "xsi:type": "dcterms:W3CDTF" }, o2, p2);
      }
      for (var i2 = 0; i2 != CORE_PROPS.length; ++i2) {
        var f2 = CORE_PROPS[i2];
        var v4 = opts.Props && opts.Props[f2[1]] != null ? opts.Props[f2[1]] : cp ? cp[f2[1]] : null;
        if (v4 === true) v4 = "1";
        else if (v4 === false) v4 = "0";
        else if (typeof v4 == "number") v4 = String(v4);
        if (v4 != null) cp_doit(f2[0], v4, null, o2, p2);
      }
      if (o2.length > 2) {
        o2[o2.length] = "</cp:coreProperties>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    var EXT_PROPS = [
      ["Application", "Application", "string"],
      ["AppVersion", "AppVersion", "string"],
      ["Company", "Company", "string"],
      ["DocSecurity", "DocSecurity", "string"],
      ["Manager", "Manager", "string"],
      ["HyperlinksChanged", "HyperlinksChanged", "bool"],
      ["SharedDoc", "SharedDoc", "bool"],
      ["LinksUpToDate", "LinksUpToDate", "bool"],
      ["ScaleCrop", "ScaleCrop", "bool"],
      ["HeadingPairs", "HeadingPairs", "raw"],
      ["TitlesOfParts", "TitlesOfParts", "raw"]
    ];
    var PseudoPropsPairs = [
      "Worksheets",
      "SheetNames",
      "NamedRanges",
      "DefinedNames",
      "Chartsheets",
      "ChartNames"
    ];
    function write_ext_props(cp) {
      var o2 = [], W2 = writextag;
      if (!cp) cp = {};
      cp.Application = "SheetJS";
      o2[o2.length] = XML_HEADER;
      o2[o2.length] = writextag("Properties", null, {
        "xmlns": XMLNS.EXT_PROPS,
        "xmlns:vt": XMLNS.vt
      });
      EXT_PROPS.forEach(function(f2) {
        if (cp[f2[1]] === void 0) return;
        var v4;
        switch (f2[2]) {
          case "string":
            v4 = escapexml(String(cp[f2[1]]));
            break;
          case "bool":
            v4 = cp[f2[1]] ? "true" : "false";
            break;
        }
        if (v4 !== void 0) o2[o2.length] = W2(f2[0], v4);
      });
      o2[o2.length] = W2("HeadingPairs", W2("vt:vector", W2("vt:variant", "<vt:lpstr>Worksheets</vt:lpstr>") + W2("vt:variant", W2("vt:i4", String(cp.Worksheets))), { size: 2, baseType: "variant" }));
      o2[o2.length] = W2("TitlesOfParts", W2("vt:vector", cp.SheetNames.map(function(s2) {
        return "<vt:lpstr>" + escapexml(s2) + "</vt:lpstr>";
      }).join(""), { size: cp.Worksheets, baseType: "lpstr" }));
      if (o2.length > 2) {
        o2[o2.length] = "</Properties>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function write_cust_props(cp) {
      var o2 = [XML_HEADER, writextag("Properties", null, {
        "xmlns": XMLNS.CUST_PROPS,
        "xmlns:vt": XMLNS.vt
      })];
      if (!cp) return o2.join("");
      var pid = 1;
      keys(cp).forEach(function custprop(k2) {
        ++pid;
        o2[o2.length] = writextag("property", write_vt(cp[k2]), {
          "fmtid": "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",
          "pid": pid,
          "name": escapexml(k2)
        });
      });
      if (o2.length > 2) {
        o2[o2.length] = "</Properties>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    var XLMLDocPropsMap = {
      Title: "Title",
      Subject: "Subject",
      Author: "Author",
      Keywords: "Keywords",
      Comments: "Description",
      LastAuthor: "LastAuthor",
      RevNumber: "Revision",
      Application: "AppName",
      /* TotalTime: 'TotalTime', */
      LastPrinted: "LastPrinted",
      CreatedDate: "Created",
      ModifiedDate: "LastSaved",
      /* Pages */
      /* Words */
      /* Characters */
      Category: "Category",
      /* PresentationFormat */
      Manager: "Manager",
      Company: "Company",
      /* Guid */
      /* HyperlinkBase */
      /* Bytes */
      /* Lines */
      /* Paragraphs */
      /* CharactersWithSpaces */
      AppVersion: "Version",
      ContentStatus: "ContentStatus",
      /* NOTE: missing from schema */
      Identifier: "Identifier",
      /* NOTE: missing from schema */
      Language: "Language"
      /* NOTE: missing from schema */
    };
    function xlml_write_docprops(Props, opts) {
      var o2 = [];
      keys(XLMLDocPropsMap).map(function(m2) {
        for (var i2 = 0; i2 < CORE_PROPS.length; ++i2) if (CORE_PROPS[i2][1] == m2) return CORE_PROPS[i2];
        for (i2 = 0; i2 < EXT_PROPS.length; ++i2) if (EXT_PROPS[i2][1] == m2) return EXT_PROPS[i2];
        throw m2;
      }).forEach(function(p2) {
        if (Props[p2[1]] == null) return;
        var m2 = opts && opts.Props && opts.Props[p2[1]] != null ? opts.Props[p2[1]] : Props[p2[1]];
        switch (p2[2]) {
          case "date":
            m2 = new Date(m2).toISOString().replace(/\.\d*Z/, "Z");
            break;
        }
        if (typeof m2 == "number") m2 = String(m2);
        else if (m2 === true || m2 === false) {
          m2 = m2 ? "1" : "0";
        } else if (m2 instanceof Date) m2 = new Date(m2).toISOString().replace(/\.\d*Z/, "");
        o2.push(writetag(XLMLDocPropsMap[p2[1]] || p2[1], m2));
      });
      return writextag("DocumentProperties", o2.join(""), { xmlns: XLMLNS.o });
    }
    function xlml_write_custprops(Props, Custprops) {
      var BLACKLIST = ["Worksheets", "SheetNames"];
      var T2 = "CustomDocumentProperties";
      var o2 = [];
      if (Props) keys(Props).forEach(function(k2) {
        if (!Object.prototype.hasOwnProperty.call(Props, k2)) return;
        for (var i2 = 0; i2 < CORE_PROPS.length; ++i2) if (k2 == CORE_PROPS[i2][1]) return;
        for (i2 = 0; i2 < EXT_PROPS.length; ++i2) if (k2 == EXT_PROPS[i2][1]) return;
        for (i2 = 0; i2 < BLACKLIST.length; ++i2) if (k2 == BLACKLIST[i2]) return;
        var m2 = Props[k2];
        var t = "string";
        if (typeof m2 == "number") {
          t = "float";
          m2 = String(m2);
        } else if (m2 === true || m2 === false) {
          t = "boolean";
          m2 = m2 ? "1" : "0";
        } else m2 = String(m2);
        o2.push(writextag(escapexmltag(k2), m2, { "dt:dt": t }));
      });
      if (Custprops) keys(Custprops).forEach(function(k2) {
        if (!Object.prototype.hasOwnProperty.call(Custprops, k2)) return;
        if (Props && Object.prototype.hasOwnProperty.call(Props, k2)) return;
        var m2 = Custprops[k2];
        var t = "string";
        if (typeof m2 == "number") {
          t = "float";
          m2 = String(m2);
        } else if (m2 === true || m2 === false) {
          t = "boolean";
          m2 = m2 ? "1" : "0";
        } else if (m2 instanceof Date) {
          t = "dateTime.tz";
          m2 = m2.toISOString();
        } else m2 = String(m2);
        o2.push(writextag(escapexmltag(k2), m2, { "dt:dt": t }));
      });
      return "<" + T2 + ' xmlns="' + XLMLNS.o + '">' + o2.join("") + "</" + T2 + ">";
    }
    function write_FILETIME(time2) {
      var date = typeof time2 == "string" ? new Date(Date.parse(time2)) : time2;
      var t = date.getTime() / 1e3 + 11644473600;
      var l2 = t % Math.pow(2, 32), h2 = (t - l2) / Math.pow(2, 32);
      l2 *= 1e7;
      h2 *= 1e7;
      var w2 = l2 / Math.pow(2, 32) | 0;
      if (w2 > 0) {
        l2 = l2 % Math.pow(2, 32);
        h2 += w2;
      }
      var o2 = new_buf(8);
      o2.write_shift(4, l2);
      o2.write_shift(4, h2);
      return o2;
    }
    function write_TypedPropertyValue(type, value) {
      var o2 = new_buf(4), p2 = new_buf(4);
      o2.write_shift(4, type == 80 ? 31 : type);
      switch (type) {
        case 3:
          p2.write_shift(-4, value);
          break;
        case 5:
          p2 = new_buf(8);
          p2.write_shift(8, value, "f");
          break;
        case 11:
          p2.write_shift(4, value ? 1 : 0);
          break;
        case 64:
          p2 = write_FILETIME(value);
          break;
        case 31:
        case 80:
          p2 = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
          p2.write_shift(4, value.length + 1);
          p2.write_shift(0, value, "dbcs");
          while (p2.l != p2.length) p2.write_shift(1, 0);
          break;
        default:
          throw new Error("TypedPropertyValue unrecognized type " + type + " " + value);
      }
      return bconcat([o2, p2]);
    }
    var XLSPSSkip = ["CodePage", "Thumbnail", "_PID_LINKBASE", "_PID_HLINKS", "SystemIdentifier", "FMTID"];
    function guess_property_type(val) {
      switch (typeof val) {
        case "boolean":
          return 11;
        case "number":
          return (val | 0) == val ? 3 : 5;
        case "string":
          return 31;
        case "object":
          if (val instanceof Date) return 64;
          break;
      }
      return -1;
    }
    function write_PropertySet(entries, RE, PIDSI) {
      var hdr = new_buf(8), piao = [], prop = [];
      var sz = 8, i2 = 0;
      var pr = new_buf(8), pio = new_buf(8);
      pr.write_shift(4, 2);
      pr.write_shift(4, 1200);
      pio.write_shift(4, 1);
      prop.push(pr);
      piao.push(pio);
      sz += 8 + pr.length;
      if (!RE) {
        pio = new_buf(8);
        pio.write_shift(4, 0);
        piao.unshift(pio);
        var bufs = [new_buf(4)];
        bufs[0].write_shift(4, entries.length);
        for (i2 = 0; i2 < entries.length; ++i2) {
          var value = entries[i2][0];
          pr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));
          pr.write_shift(4, i2 + 2);
          pr.write_shift(4, value.length + 1);
          pr.write_shift(0, value, "dbcs");
          while (pr.l != pr.length) pr.write_shift(1, 0);
          bufs.push(pr);
        }
        pr = bconcat(bufs);
        prop.unshift(pr);
        sz += 8 + pr.length;
      }
      for (i2 = 0; i2 < entries.length; ++i2) {
        if (RE && !RE[entries[i2][0]]) continue;
        if (XLSPSSkip.indexOf(entries[i2][0]) > -1 || PseudoPropsPairs.indexOf(entries[i2][0]) > -1) continue;
        if (entries[i2][1] == null) continue;
        var val = entries[i2][1], idx = 0;
        if (RE) {
          idx = +RE[entries[i2][0]];
          var pinfo = PIDSI[idx];
          if (pinfo.p == "version" && typeof val == "string") {
            var arr = val.split(".");
            val = (+arr[0] << 16) + (+arr[1] || 0);
          }
          pr = write_TypedPropertyValue(pinfo.t, val);
        } else {
          var T2 = guess_property_type(val);
          if (T2 == -1) {
            T2 = 31;
            val = String(val);
          }
          pr = write_TypedPropertyValue(T2, val);
        }
        prop.push(pr);
        pio = new_buf(8);
        pio.write_shift(4, !RE ? 2 + i2 : idx);
        piao.push(pio);
        sz += 8 + pr.length;
      }
      var w2 = 8 * (prop.length + 1);
      for (i2 = 0; i2 < prop.length; ++i2) {
        piao[i2].write_shift(4, w2);
        w2 += prop[i2].length;
      }
      hdr.write_shift(4, sz);
      hdr.write_shift(4, prop.length);
      return bconcat([hdr].concat(piao).concat(prop));
    }
    function write_PropertySetStream(entries, clsid, RE, PIDSI, entries2, clsid2) {
      var hdr = new_buf(entries2 ? 68 : 48);
      var bufs = [hdr];
      hdr.write_shift(2, 65534);
      hdr.write_shift(2, 0);
      hdr.write_shift(4, 842412599);
      hdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, "hex");
      hdr.write_shift(4, entries2 ? 2 : 1);
      hdr.write_shift(16, clsid, "hex");
      hdr.write_shift(4, entries2 ? 68 : 48);
      var ps0 = write_PropertySet(entries, RE, PIDSI);
      bufs.push(ps0);
      if (entries2) {
        var ps1 = write_PropertySet(entries2, null, null);
        hdr.write_shift(16, clsid2, "hex");
        hdr.write_shift(4, 68 + ps0.length);
        bufs.push(ps1);
      }
      return bconcat(bufs);
    }
    function writezeroes(n, o2) {
      if (!o2) o2 = new_buf(n);
      for (var j = 0; j < n; ++j) o2.write_shift(1, 0);
      return o2;
    }
    function parsebool(blob, length) {
      return blob.read_shift(length) === 1;
    }
    function writebool(v4, o2) {
      if (!o2) o2 = new_buf(2);
      o2.write_shift(2, +!!v4);
      return o2;
    }
    function parseuint16(blob) {
      return blob.read_shift(2, "u");
    }
    function writeuint16(v4, o2) {
      if (!o2) o2 = new_buf(2);
      o2.write_shift(2, v4);
      return o2;
    }
    function write_Bes(v4, t, o2) {
      if (!o2) o2 = new_buf(2);
      o2.write_shift(1, t == "e" ? +v4 : +!!v4);
      o2.write_shift(1, t == "e" ? 1 : 0);
      return o2;
    }
    function parse_ShortXLUnicodeString(blob, length, opts) {
      var cch = blob.read_shift(opts && opts.biff >= 12 ? 2 : 1);
      var encoding = "sbcs-cont";
      if (opts && opts.biff >= 8) ;
      if (!opts || opts.biff == 8) {
        var fHighByte = blob.read_shift(1);
        if (fHighByte) {
          encoding = "dbcs-cont";
        }
      } else if (opts.biff == 12) {
        encoding = "wstr";
      }
      if (opts.biff >= 2 && opts.biff <= 5) encoding = "cpstr";
      var o2 = cch ? blob.read_shift(cch, encoding) : "";
      return o2;
    }
    function write_XLUnicodeRichExtendedString(xlstr) {
      var str = xlstr.t || "";
      var hdr = new_buf(3 + 0);
      hdr.write_shift(2, str.length);
      hdr.write_shift(1, 0 | 1);
      var otext = new_buf(2 * str.length);
      otext.write_shift(2 * str.length, str, "utf16le");
      var out2 = [hdr, otext];
      return bconcat(out2);
    }
    function parse_XLUnicodeStringNoCch(blob, cch, opts) {
      var retval;
      if (opts) {
        if (opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, "cpstr");
        if (opts.biff >= 12) return blob.read_shift(cch, "dbcs-cont");
      }
      var fHighByte = blob.read_shift(1);
      if (fHighByte === 0) {
        retval = blob.read_shift(cch, "sbcs-cont");
      } else {
        retval = blob.read_shift(cch, "dbcs-cont");
      }
      return retval;
    }
    function parse_XLUnicodeString(blob, length, opts) {
      var cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
      if (cch === 0) {
        blob.l++;
        return "";
      }
      return parse_XLUnicodeStringNoCch(blob, cch, opts);
    }
    function parse_XLUnicodeString2(blob, length, opts) {
      if (opts.biff > 5) return parse_XLUnicodeString(blob, length, opts);
      var cch = blob.read_shift(1);
      if (cch === 0) {
        blob.l++;
        return "";
      }
      return blob.read_shift(cch, opts.biff <= 4 || !blob.lens ? "cpstr" : "sbcs-cont");
    }
    function write_XLUnicodeString(str, opts, o2) {
      if (!o2) o2 = new_buf(3 + 2 * str.length);
      o2.write_shift(2, str.length);
      o2.write_shift(1, 1);
      o2.write_shift(31, str, "utf16le");
      return o2;
    }
    function write_HyperlinkString(str, o2) {
      if (!o2) o2 = new_buf(6 + str.length * 2);
      o2.write_shift(4, 1 + str.length);
      for (var i2 = 0; i2 < str.length; ++i2) o2.write_shift(2, str.charCodeAt(i2));
      o2.write_shift(2, 0);
      return o2;
    }
    function write_Hyperlink(hl) {
      var out2 = new_buf(512), i2 = 0;
      var Target = hl.Target;
      if (Target.slice(0, 7) == "file://") Target = Target.slice(7);
      var hashidx = Target.indexOf("#");
      var F2 = hashidx > -1 ? 31 : 23;
      switch (Target.charAt(0)) {
        case "#":
          F2 = 28;
          break;
        case ".":
          F2 &= -3;
          break;
      }
      out2.write_shift(4, 2);
      out2.write_shift(4, F2);
      var data = [8, 6815827, 6619237, 4849780, 83];
      for (i2 = 0; i2 < data.length; ++i2) out2.write_shift(4, data[i2]);
      if (F2 == 28) {
        Target = Target.slice(1);
        write_HyperlinkString(Target, out2);
      } else if (F2 & 2) {
        data = "e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
        for (i2 = 0; i2 < data.length; ++i2) out2.write_shift(1, parseInt(data[i2], 16));
        var Pretarget = hashidx > -1 ? Target.slice(0, hashidx) : Target;
        out2.write_shift(4, 2 * (Pretarget.length + 1));
        for (i2 = 0; i2 < Pretarget.length; ++i2) out2.write_shift(2, Pretarget.charCodeAt(i2));
        out2.write_shift(2, 0);
        if (F2 & 8) write_HyperlinkString(hashidx > -1 ? Target.slice(hashidx + 1) : "", out2);
      } else {
        data = "03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46".split(" ");
        for (i2 = 0; i2 < data.length; ++i2) out2.write_shift(1, parseInt(data[i2], 16));
        var P2 = 0;
        while (Target.slice(P2 * 3, P2 * 3 + 3) == "../" || Target.slice(P2 * 3, P2 * 3 + 3) == "..\\") ++P2;
        out2.write_shift(2, P2);
        out2.write_shift(4, Target.length - 3 * P2 + 1);
        for (i2 = 0; i2 < Target.length - 3 * P2; ++i2) out2.write_shift(1, Target.charCodeAt(i2 + 3 * P2) & 255);
        out2.write_shift(1, 0);
        out2.write_shift(2, 65535);
        out2.write_shift(2, 57005);
        for (i2 = 0; i2 < 6; ++i2) out2.write_shift(4, 0);
      }
      return out2.slice(0, out2.l);
    }
    function write_XLSCell(R2, C2, ixfe, o2) {
      if (!o2) o2 = new_buf(6);
      o2.write_shift(2, R2);
      o2.write_shift(2, C2);
      o2.write_shift(2, ixfe || 0);
      return o2;
    }
    function parse_XTI(blob, length, opts) {
      var w2 = opts.biff > 8 ? 4 : 2;
      var iSupBook = blob.read_shift(w2), itabFirst = blob.read_shift(w2, "i"), itabLast = blob.read_shift(w2, "i");
      return [iSupBook, itabFirst, itabLast];
    }
    function parse_Ref8U(blob) {
      var rwFirst = blob.read_shift(2);
      var rwLast = blob.read_shift(2);
      var colFirst = blob.read_shift(2);
      var colLast = blob.read_shift(2);
      return { s: { c: colFirst, r: rwFirst }, e: { c: colLast, r: rwLast } };
    }
    function write_Ref8U(r, o2) {
      if (!o2) o2 = new_buf(8);
      o2.write_shift(2, r.s.r);
      o2.write_shift(2, r.e.r);
      o2.write_shift(2, r.s.c);
      o2.write_shift(2, r.e.c);
      return o2;
    }
    function write_BOF(wb, t, o2) {
      var h2 = 1536, w2 = 16;
      switch (o2.bookType) {
        case "biff8":
          break;
        case "biff5":
          h2 = 1280;
          w2 = 8;
          break;
        case "biff4":
          h2 = 4;
          w2 = 6;
          break;
        case "biff3":
          h2 = 3;
          w2 = 6;
          break;
        case "biff2":
          h2 = 2;
          w2 = 4;
          break;
        case "xla":
          break;
        default:
          throw new Error("unsupported BIFF version");
      }
      var out2 = new_buf(w2);
      out2.write_shift(2, h2);
      out2.write_shift(2, t);
      if (w2 > 4) out2.write_shift(2, 29282);
      if (w2 > 6) out2.write_shift(2, 1997);
      if (w2 > 8) {
        out2.write_shift(2, 49161);
        out2.write_shift(2, 1);
        out2.write_shift(2, 1798);
        out2.write_shift(2, 0);
      }
      return out2;
    }
    function write_WriteAccess(s2, opts) {
      var b8 = !opts || opts.biff == 8;
      var o2 = new_buf(b8 ? 112 : 54);
      o2.write_shift(opts.biff == 8 ? 2 : 1, 7);
      if (b8) o2.write_shift(1, 0);
      o2.write_shift(4, 859007059);
      o2.write_shift(4, 5458548 | (b8 ? 0 : 536870912));
      while (o2.l < o2.length) o2.write_shift(1, b8 ? 0 : 32);
      return o2;
    }
    function write_BoundSheet8(data, opts) {
      var w2 = !opts || opts.biff >= 8 ? 2 : 1;
      var o2 = new_buf(8 + w2 * data.name.length);
      o2.write_shift(4, data.pos);
      o2.write_shift(1, data.hs || 0);
      o2.write_shift(1, data.dt);
      o2.write_shift(1, data.name.length);
      if (opts.biff >= 8) o2.write_shift(1, 1);
      o2.write_shift(w2 * data.name.length, data.name, opts.biff < 8 ? "sbcs" : "utf16le");
      var out2 = o2.slice(0, o2.l);
      out2.l = o2.l;
      return out2;
    }
    function write_SST(sst, opts) {
      var header = new_buf(8);
      header.write_shift(4, sst.Count);
      header.write_shift(4, sst.Unique);
      var strs = [];
      for (var j = 0; j < sst.length; ++j) strs[j] = write_XLUnicodeRichExtendedString(sst[j]);
      var o2 = bconcat([header].concat(strs));
      o2.parts = [header.length].concat(strs.map(function(str) {
        return str.length;
      }));
      return o2;
    }
    function write_Window1() {
      var o2 = new_buf(18);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 29280);
      o2.write_shift(2, 17600);
      o2.write_shift(2, 56);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 1);
      o2.write_shift(2, 500);
      return o2;
    }
    function write_Window2(view) {
      var o2 = new_buf(18), f2 = 1718;
      if (view && view.RTL) f2 |= 64;
      o2.write_shift(2, f2);
      o2.write_shift(4, 0);
      o2.write_shift(4, 64);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      return o2;
    }
    function write_Font(data, opts) {
      var name = data.name || "Arial";
      var b5 = opts && opts.biff == 5, w2 = b5 ? 15 + name.length : 16 + 2 * name.length;
      var o2 = new_buf(w2);
      o2.write_shift(2, data.sz * 20);
      o2.write_shift(4, 0);
      o2.write_shift(2, 400);
      o2.write_shift(4, 0);
      o2.write_shift(2, 0);
      o2.write_shift(1, name.length);
      if (!b5) o2.write_shift(1, 1);
      o2.write_shift((b5 ? 1 : 2) * name.length, name, b5 ? "sbcs" : "utf16le");
      return o2;
    }
    function write_LabelSst(R2, C2, v4, os) {
      var o2 = new_buf(10);
      write_XLSCell(R2, C2, os, o2);
      o2.write_shift(4, v4);
      return o2;
    }
    function write_Label(R2, C2, v4, os, opts) {
      var b8 = !opts || opts.biff == 8;
      var o2 = new_buf(6 + 2 + +b8 + (1 + b8) * v4.length);
      write_XLSCell(R2, C2, os, o2);
      o2.write_shift(2, v4.length);
      if (b8) o2.write_shift(1, 1);
      o2.write_shift((1 + b8) * v4.length, v4, b8 ? "utf16le" : "sbcs");
      return o2;
    }
    function write_Format(i2, f2, opts, o2) {
      var b5 = opts && opts.biff == 5;
      if (!o2) o2 = new_buf(b5 ? 3 + f2.length : 5 + 2 * f2.length);
      o2.write_shift(2, i2);
      o2.write_shift(b5 ? 1 : 2, f2.length);
      if (!b5) o2.write_shift(1, 1);
      o2.write_shift((b5 ? 1 : 2) * f2.length, f2, b5 ? "sbcs" : "utf16le");
      var out2 = o2.length > o2.l ? o2.slice(0, o2.l) : o2;
      if (out2.l == null) out2.l = out2.length;
      return out2;
    }
    function write_Dimensions(range2, opts) {
      var w2 = opts.biff == 8 || !opts.biff ? 4 : 2;
      var o2 = new_buf(2 * w2 + 6);
      o2.write_shift(w2, range2.s.r);
      o2.write_shift(w2, range2.e.r + 1);
      o2.write_shift(2, range2.s.c);
      o2.write_shift(2, range2.e.c + 1);
      o2.write_shift(2, 0);
      return o2;
    }
    function write_XF(data, ixfeP, opts, o2) {
      var b5 = opts && opts.biff == 5;
      if (!o2) o2 = new_buf(b5 ? 16 : 20);
      o2.write_shift(2, 0);
      if (data.style) {
        o2.write_shift(2, data.numFmtId || 0);
        o2.write_shift(2, 65524);
      } else {
        o2.write_shift(2, data.numFmtId || 0);
        o2.write_shift(2, ixfeP << 4);
      }
      var f2 = 0;
      if (data.numFmtId > 0 && b5) f2 |= 1024;
      o2.write_shift(4, f2);
      o2.write_shift(4, 0);
      if (!b5) o2.write_shift(4, 0);
      o2.write_shift(2, 0);
      return o2;
    }
    function write_Guts(guts) {
      var o2 = new_buf(8);
      o2.write_shift(4, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      return o2;
    }
    function write_BoolErr(R2, C2, v4, os, opts, t) {
      var o2 = new_buf(8);
      write_XLSCell(R2, C2, os, o2);
      write_Bes(v4, t, o2);
      return o2;
    }
    function write_Number(R2, C2, v4, os) {
      var o2 = new_buf(14);
      write_XLSCell(R2, C2, os, o2);
      write_Xnum(v4, o2);
      return o2;
    }
    function parse_ExternSheet(blob, length, opts) {
      if (opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);
      var o2 = [], target = blob.l + length, len2 = blob.read_shift(opts.biff > 8 ? 4 : 2);
      while (len2-- !== 0) o2.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));
      if (blob.l != target) throw new Error("Bad ExternSheet: " + blob.l + " != " + target);
      return o2;
    }
    function parse_BIFF5ExternSheet(blob, length, opts) {
      if (blob[blob.l + 1] == 3) blob[blob.l]++;
      var o2 = parse_ShortXLUnicodeString(blob, length, opts);
      return o2.charCodeAt(0) == 3 ? o2.slice(1) : o2;
    }
    function write_MergeCells(merges) {
      var o2 = new_buf(2 + merges.length * 8);
      o2.write_shift(2, merges.length);
      for (var i2 = 0; i2 < merges.length; ++i2) write_Ref8U(merges[i2], o2);
      return o2;
    }
    function write_HLink(hl) {
      var O2 = new_buf(24);
      var ref2 = decode_cell(hl[0]);
      O2.write_shift(2, ref2.r);
      O2.write_shift(2, ref2.r);
      O2.write_shift(2, ref2.c);
      O2.write_shift(2, ref2.c);
      var clsid = "d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b".split(" ");
      for (var i2 = 0; i2 < 16; ++i2) O2.write_shift(1, parseInt(clsid[i2], 16));
      return bconcat([O2, write_Hyperlink(hl[1])]);
    }
    function write_HLinkTooltip(hl) {
      var TT = hl[1].Tooltip;
      var O2 = new_buf(10 + 2 * (TT.length + 1));
      O2.write_shift(2, 2048);
      var ref2 = decode_cell(hl[0]);
      O2.write_shift(2, ref2.r);
      O2.write_shift(2, ref2.r);
      O2.write_shift(2, ref2.c);
      O2.write_shift(2, ref2.c);
      for (var i2 = 0; i2 < TT.length; ++i2) O2.write_shift(2, TT.charCodeAt(i2));
      O2.write_shift(2, 0);
      return O2;
    }
    function write_Country(o2) {
      if (!o2) o2 = new_buf(4);
      o2.write_shift(2, 1);
      o2.write_shift(2, 1);
      return o2;
    }
    function parse_ColInfo(blob, length, opts) {
      if (!opts.cellStyles) return parsenoop(blob, length);
      var w2 = opts && opts.biff >= 12 ? 4 : 2;
      var colFirst = blob.read_shift(w2);
      var colLast = blob.read_shift(w2);
      var coldx = blob.read_shift(w2);
      var ixfe = blob.read_shift(w2);
      var flags = blob.read_shift(2);
      if (w2 == 2) blob.l += 2;
      var o2 = { s: colFirst, e: colLast, w: coldx, ixfe, flags };
      if (opts.biff >= 5 || !opts.biff) o2.level = flags >> 8 & 7;
      return o2;
    }
    function write_ColInfo(col, idx) {
      var o2 = new_buf(12);
      o2.write_shift(2, idx);
      o2.write_shift(2, idx);
      o2.write_shift(2, col.width * 256);
      o2.write_shift(2, 0);
      var f2 = 0;
      if (col.hidden) f2 |= 1;
      o2.write_shift(1, f2);
      f2 = col.level || 0;
      o2.write_shift(1, f2);
      o2.write_shift(2, 0);
      return o2;
    }
    function write_RRTabId(n) {
      var out2 = new_buf(2 * n);
      for (var i2 = 0; i2 < n; ++i2) out2.write_shift(2, i2 + 1);
      return out2;
    }
    function write_BIFF2NUM(r, c2, val) {
      var out2 = new_buf(15);
      write_BIFF2Cell(out2, r, c2);
      out2.write_shift(8, val, "f");
      return out2;
    }
    function write_BIFF2INT(r, c2, val) {
      var out2 = new_buf(9);
      write_BIFF2Cell(out2, r, c2);
      out2.write_shift(2, val);
      return out2;
    }
    var DBF = /* @__PURE__ */ function() {
      var dbf_codepage_map = {
        /* Code Pages Supported by Visual FoxPro */
        /*::[*/
        1: 437,
        /*::[*/
        2: 850,
        /*::[*/
        3: 1252,
        /*::[*/
        4: 1e4,
        /*::[*/
        100: 852,
        /*::[*/
        101: 866,
        /*::[*/
        102: 865,
        /*::[*/
        103: 861,
        /*::[*/
        104: 895,
        /*::[*/
        105: 620,
        /*::[*/
        106: 737,
        /*::[*/
        107: 857,
        /*::[*/
        120: 950,
        /*::[*/
        121: 949,
        /*::[*/
        122: 936,
        /*::[*/
        123: 932,
        /*::[*/
        124: 874,
        /*::[*/
        125: 1255,
        /*::[*/
        126: 1256,
        /*::[*/
        150: 10007,
        /*::[*/
        151: 10029,
        /*::[*/
        152: 10006,
        /*::[*/
        200: 1250,
        /*::[*/
        201: 1251,
        /*::[*/
        202: 1254,
        /*::[*/
        203: 1253,
        /* shapefile DBF extension */
        /*::[*/
        0: 20127,
        /*::[*/
        8: 865,
        /*::[*/
        9: 437,
        /*::[*/
        10: 850,
        /*::[*/
        11: 437,
        /*::[*/
        13: 437,
        /*::[*/
        14: 850,
        /*::[*/
        15: 437,
        /*::[*/
        16: 850,
        /*::[*/
        17: 437,
        /*::[*/
        18: 850,
        /*::[*/
        19: 932,
        /*::[*/
        20: 850,
        /*::[*/
        21: 437,
        /*::[*/
        22: 850,
        /*::[*/
        23: 865,
        /*::[*/
        24: 437,
        /*::[*/
        25: 437,
        /*::[*/
        26: 850,
        /*::[*/
        27: 437,
        /*::[*/
        28: 863,
        /*::[*/
        29: 850,
        /*::[*/
        31: 852,
        /*::[*/
        34: 852,
        /*::[*/
        35: 852,
        /*::[*/
        36: 860,
        /*::[*/
        37: 850,
        /*::[*/
        38: 866,
        /*::[*/
        55: 850,
        /*::[*/
        64: 852,
        /*::[*/
        77: 936,
        /*::[*/
        78: 949,
        /*::[*/
        79: 950,
        /*::[*/
        80: 874,
        /*::[*/
        87: 1252,
        /*::[*/
        88: 1252,
        /*::[*/
        89: 1252,
        /*::[*/
        108: 863,
        /*::[*/
        134: 737,
        /*::[*/
        135: 852,
        /*::[*/
        136: 857,
        /*::[*/
        204: 1257,
        /*::[*/
        255: 16969
      };
      var dbf_reverse_map = evert({
        /*::[*/
        1: 437,
        /*::[*/
        2: 850,
        /*::[*/
        3: 1252,
        /*::[*/
        4: 1e4,
        /*::[*/
        100: 852,
        /*::[*/
        101: 866,
        /*::[*/
        102: 865,
        /*::[*/
        103: 861,
        /*::[*/
        104: 895,
        /*::[*/
        105: 620,
        /*::[*/
        106: 737,
        /*::[*/
        107: 857,
        /*::[*/
        120: 950,
        /*::[*/
        121: 949,
        /*::[*/
        122: 936,
        /*::[*/
        123: 932,
        /*::[*/
        124: 874,
        /*::[*/
        125: 1255,
        /*::[*/
        126: 1256,
        /*::[*/
        150: 10007,
        /*::[*/
        151: 10029,
        /*::[*/
        152: 10006,
        /*::[*/
        200: 1250,
        /*::[*/
        201: 1251,
        /*::[*/
        202: 1254,
        /*::[*/
        203: 1253,
        /*::[*/
        0: 20127
      });
      function dbf_to_aoa(buf, opts) {
        var out2 = [];
        var d2 = new_raw_buf(1);
        switch (opts.type) {
          case "base64":
            d2 = s2a(Base64_decode(buf));
            break;
          case "binary":
            d2 = s2a(buf);
            break;
          case "buffer":
          case "array":
            d2 = buf;
            break;
        }
        prep_blob(d2, 0);
        var ft2 = d2.read_shift(1);
        var memo = !!(ft2 & 136);
        var vfp = false, l7 = false;
        switch (ft2) {
          case 2:
            break;
          // dBASE II
          case 3:
            break;
          // dBASE III
          case 48:
            vfp = true;
            memo = true;
            break;
          // VFP
          case 49:
            vfp = true;
            memo = true;
            break;
          // VFP with autoincrement
          // 0x43 dBASE IV SQL table files
          // 0x63 dBASE IV SQL system files
          case 131:
            break;
          // dBASE III with memo
          case 139:
            break;
          // dBASE IV with memo
          case 140:
            l7 = true;
            break;
          // dBASE Level 7 with memo
          // case 0xCB dBASE IV SQL table files with memo
          case 245:
            break;
          // FoxPro 2.x with memo
          // case 0xFB FoxBASE
          default:
            throw new Error("DBF Unsupported Version: " + ft2.toString(16));
        }
        var nrow = 0, fpos = 521;
        if (ft2 == 2) nrow = d2.read_shift(2);
        d2.l += 3;
        if (ft2 != 2) nrow = d2.read_shift(4);
        if (nrow > 1048576) nrow = 1e6;
        if (ft2 != 2) fpos = d2.read_shift(2);
        var rlen = d2.read_shift(2);
        var current_cp = opts.codepage || 1252;
        if (ft2 != 2) {
          d2.l += 16;
          d2.read_shift(1);
          if (d2[d2.l] !== 0) current_cp = dbf_codepage_map[d2[d2.l]];
          d2.l += 1;
          d2.l += 2;
        }
        if (l7) d2.l += 36;
        var fields = [], field = {};
        var hend = Math.min(d2.length, ft2 == 2 ? 521 : fpos - 10 - (vfp ? 264 : 0));
        var ww = l7 ? 32 : 11;
        while (d2.l < hend && d2[d2.l] != 13) {
          field = {};
          field.name = $cptable.utils.decode(current_cp, d2.slice(d2.l, d2.l + ww)).replace(/[\u0000\r\n].*$/g, "");
          d2.l += ww;
          field.type = String.fromCharCode(d2.read_shift(1));
          if (ft2 != 2 && !l7) field.offset = d2.read_shift(4);
          field.len = d2.read_shift(1);
          if (ft2 == 2) field.offset = d2.read_shift(2);
          field.dec = d2.read_shift(1);
          if (field.name.length) fields.push(field);
          if (ft2 != 2) d2.l += l7 ? 13 : 14;
          switch (field.type) {
            case "B":
              if ((!vfp || field.len != 8) && opts.WTF) console.log("Skipping " + field.name + ":" + field.type);
              break;
            case "G":
            // General (FoxPro and dBASE L7)
            case "P":
              if (opts.WTF) console.log("Skipping " + field.name + ":" + field.type);
              break;
            case "+":
            // Autoincrement (dBASE L7 only)
            case "0":
            // _NullFlags (VFP only)
            case "@":
            // Timestamp (dBASE L7 only)
            case "C":
            // Character (dBASE II)
            case "D":
            // Date (dBASE III)
            case "F":
            // Float (dBASE IV)
            case "I":
            // Long (VFP and dBASE L7)
            case "L":
            // Logical (dBASE II)
            case "M":
            // Memo (dBASE III)
            case "N":
            // Number (dBASE II)
            case "O":
            // Double (dBASE L7 only)
            case "T":
            // Datetime (VFP only)
            case "Y":
              break;
            default:
              throw new Error("Unknown Field Type: " + field.type);
          }
        }
        if (d2[d2.l] !== 13) d2.l = fpos - 1;
        if (d2.read_shift(1) !== 13) throw new Error("DBF Terminator not found " + d2.l + " " + d2[d2.l]);
        d2.l = fpos;
        var R2 = 0, C2 = 0;
        out2[0] = [];
        for (C2 = 0; C2 != fields.length; ++C2) out2[0][C2] = fields[C2].name;
        while (nrow-- > 0) {
          if (d2[d2.l] === 42) {
            d2.l += rlen;
            continue;
          }
          ++d2.l;
          out2[++R2] = [];
          C2 = 0;
          for (C2 = 0; C2 != fields.length; ++C2) {
            var dd = d2.slice(d2.l, d2.l + fields[C2].len);
            d2.l += fields[C2].len;
            prep_blob(dd, 0);
            var s2 = $cptable.utils.decode(current_cp, dd);
            switch (fields[C2].type) {
              case "C":
                if (s2.trim().length) out2[R2][C2] = s2.replace(/\s+$/, "");
                break;
              case "D":
                if (s2.length === 8) out2[R2][C2] = new Date(+s2.slice(0, 4), +s2.slice(4, 6) - 1, +s2.slice(6, 8));
                else out2[R2][C2] = s2;
                break;
              case "F":
                out2[R2][C2] = parseFloat(s2.trim());
                break;
              case "+":
              case "I":
                out2[R2][C2] = l7 ? dd.read_shift(-4, "i") ^ 2147483648 : dd.read_shift(4, "i");
                break;
              case "L":
                switch (s2.trim().toUpperCase()) {
                  case "Y":
                  case "T":
                    out2[R2][C2] = true;
                    break;
                  case "N":
                  case "F":
                    out2[R2][C2] = false;
                    break;
                  case "":
                  case "?":
                    break;
                  default:
                    throw new Error("DBF Unrecognized L:|" + s2 + "|");
                }
                break;
              case "M":
                if (!memo) throw new Error("DBF Unexpected MEMO for type " + ft2.toString(16));
                out2[R2][C2] = "##MEMO##" + (l7 ? parseInt(s2.trim(), 10) : dd.read_shift(4));
                break;
              case "N":
                s2 = s2.replace(/\u0000/g, "").trim();
                if (s2 && s2 != ".") out2[R2][C2] = +s2 || 0;
                break;
              case "@":
                out2[R2][C2] = new Date(dd.read_shift(-8, "f") - 621356832e5);
                break;
              case "T":
                out2[R2][C2] = new Date((dd.read_shift(4) - 2440588) * 864e5 + dd.read_shift(4));
                break;
              case "Y":
                out2[R2][C2] = dd.read_shift(4, "i") / 1e4 + dd.read_shift(4, "i") / 1e4 * Math.pow(2, 32);
                break;
              case "O":
                out2[R2][C2] = -dd.read_shift(-8, "f");
                break;
              case "B":
                if (vfp && fields[C2].len == 8) {
                  out2[R2][C2] = dd.read_shift(8, "f");
                  break;
                }
              /* falls through */
              case "G":
              case "P":
                dd.l += fields[C2].len;
                break;
              case "0":
                if (fields[C2].name === "_NullFlags") break;
              /* falls through */
              default:
                throw new Error("DBF Unsupported data type " + fields[C2].type);
            }
          }
        }
        if (ft2 != 2) {
          if (d2.l < d2.length && d2[d2.l++] != 26) throw new Error("DBF EOF Marker missing " + (d2.l - 1) + " of " + d2.length + " " + d2[d2.l - 1].toString(16));
        }
        if (opts && opts.sheetRows) out2 = out2.slice(0, opts.sheetRows);
        opts.DBF = fields;
        return out2;
      }
      function dbf_to_sheet(buf, opts) {
        var o2 = opts || {};
        if (!o2.dateNF) o2.dateNF = "yyyymmdd";
        var ws = aoa_to_sheet(dbf_to_aoa(buf, o2), o2);
        ws["!cols"] = o2.DBF.map(function(field) {
          return {
            wch: field.len,
            DBF: field
          };
        });
        delete o2.DBF;
        return ws;
      }
      function dbf_to_workbook(buf, opts) {
        try {
          return sheet_to_workbook(dbf_to_sheet(buf, opts), opts);
        } catch (e2) {
          if (opts && opts.WTF) throw e2;
        }
        return { SheetNames: [], Sheets: {} };
      }
      var _RLEN = { "B": 8, "C": 250, "L": 1, "D": 8, "?": 0, "": 0 };
      function sheet_to_dbf(ws, opts) {
        var o2 = opts || {};
        if (+o2.codepage >= 0) set_cp(+o2.codepage);
        if (o2.type == "string") throw new Error("Cannot write DBF to JS string");
        var ba = buf_array();
        var aoa = sheet_to_json(ws, { header: 1, raw: true, cellDates: true });
        var headers = aoa[0], data = aoa.slice(1), cols = ws["!cols"] || [];
        var i2 = 0, j = 0, hcnt = 0, rlen = 1;
        for (i2 = 0; i2 < headers.length; ++i2) {
          if (((cols[i2] || {}).DBF || {}).name) {
            headers[i2] = cols[i2].DBF.name;
            ++hcnt;
            continue;
          }
          if (headers[i2] == null) continue;
          ++hcnt;
          if (typeof headers[i2] === "number") headers[i2] = headers[i2].toString(10);
          if (typeof headers[i2] !== "string") throw new Error("DBF Invalid column name " + headers[i2] + " |" + typeof headers[i2] + "|");
          if (headers.indexOf(headers[i2]) !== i2) {
            for (j = 0; j < 1024; ++j)
              if (headers.indexOf(headers[i2] + "_" + j) == -1) {
                headers[i2] += "_" + j;
                break;
              }
          }
        }
        var range2 = safe_decode_range(ws["!ref"]);
        var coltypes = [];
        var colwidths = [];
        var coldecimals = [];
        for (i2 = 0; i2 <= range2.e.c - range2.s.c; ++i2) {
          var guess = "", _guess = "", maxlen = 0;
          var col = [];
          for (j = 0; j < data.length; ++j) {
            if (data[j][i2] != null) col.push(data[j][i2]);
          }
          if (col.length == 0 || headers[i2] == null) {
            coltypes[i2] = "?";
            continue;
          }
          for (j = 0; j < col.length; ++j) {
            switch (typeof col[j]) {
              /* TODO: check if L2 compat is desired */
              case "number":
                _guess = "B";
                break;
              case "string":
                _guess = "C";
                break;
              case "boolean":
                _guess = "L";
                break;
              case "object":
                _guess = col[j] instanceof Date ? "D" : "C";
                break;
              default:
                _guess = "C";
            }
            maxlen = Math.max(maxlen, String(col[j]).length);
            guess = guess && guess != _guess ? "C" : _guess;
          }
          if (maxlen > 250) maxlen = 250;
          _guess = ((cols[i2] || {}).DBF || {}).type;
          if (_guess == "C") {
            if (cols[i2].DBF.len > maxlen) maxlen = cols[i2].DBF.len;
          }
          if (guess == "B" && _guess == "N") {
            guess = "N";
            coldecimals[i2] = cols[i2].DBF.dec;
            maxlen = cols[i2].DBF.len;
          }
          colwidths[i2] = guess == "C" || _guess == "N" ? maxlen : _RLEN[guess] || 0;
          rlen += colwidths[i2];
          coltypes[i2] = guess;
        }
        var h2 = ba.next(32);
        h2.write_shift(4, 318902576);
        h2.write_shift(4, data.length);
        h2.write_shift(2, 296 + 32 * hcnt);
        h2.write_shift(2, rlen);
        for (i2 = 0; i2 < 4; ++i2) h2.write_shift(4, 0);
        h2.write_shift(4, 0 | (+dbf_reverse_map[
          /*::String(*/
          current_ansi
          /*::)*/
        ] || 3) << 8);
        for (i2 = 0, j = 0; i2 < headers.length; ++i2) {
          if (headers[i2] == null) continue;
          var hf = ba.next(32);
          var _f = (headers[i2].slice(-10) + "\0\0\0\0\0\0\0\0\0\0\0").slice(0, 11);
          hf.write_shift(1, _f, "sbcs");
          hf.write_shift(1, coltypes[i2] == "?" ? "C" : coltypes[i2], "sbcs");
          hf.write_shift(4, j);
          hf.write_shift(1, colwidths[i2] || _RLEN[coltypes[i2]] || 0);
          hf.write_shift(1, coldecimals[i2] || 0);
          hf.write_shift(1, 2);
          hf.write_shift(4, 0);
          hf.write_shift(1, 0);
          hf.write_shift(4, 0);
          hf.write_shift(4, 0);
          j += colwidths[i2] || _RLEN[coltypes[i2]] || 0;
        }
        var hb = ba.next(264);
        hb.write_shift(4, 13);
        for (i2 = 0; i2 < 65; ++i2) hb.write_shift(4, 0);
        for (i2 = 0; i2 < data.length; ++i2) {
          var rout = ba.next(rlen);
          rout.write_shift(1, 0);
          for (j = 0; j < headers.length; ++j) {
            if (headers[j] == null) continue;
            switch (coltypes[j]) {
              case "L":
                rout.write_shift(1, data[i2][j] == null ? 63 : data[i2][j] ? 84 : 70);
                break;
              case "B":
                rout.write_shift(8, data[i2][j] || 0, "f");
                break;
              case "N":
                var _n = "0";
                if (typeof data[i2][j] == "number") _n = data[i2][j].toFixed(coldecimals[j] || 0);
                for (hcnt = 0; hcnt < colwidths[j] - _n.length; ++hcnt) rout.write_shift(1, 32);
                rout.write_shift(1, _n, "sbcs");
                break;
              case "D":
                if (!data[i2][j]) rout.write_shift(8, "00000000", "sbcs");
                else {
                  rout.write_shift(4, ("0000" + data[i2][j].getFullYear()).slice(-4), "sbcs");
                  rout.write_shift(2, ("00" + (data[i2][j].getMonth() + 1)).slice(-2), "sbcs");
                  rout.write_shift(2, ("00" + data[i2][j].getDate()).slice(-2), "sbcs");
                }
                break;
              case "C":
                var _s = String(data[i2][j] != null ? data[i2][j] : "").slice(0, colwidths[j]);
                rout.write_shift(1, _s, "sbcs");
                for (hcnt = 0; hcnt < colwidths[j] - _s.length; ++hcnt) rout.write_shift(1, 32);
                break;
            }
          }
        }
        ba.next(1).write_shift(1, 26);
        return ba.end();
      }
      return {
        to_workbook: dbf_to_workbook,
        to_sheet: dbf_to_sheet,
        from_sheet: sheet_to_dbf
      };
    }();
    var SYLK = /* @__PURE__ */ function() {
      var sylk_escapes = {
        AA: "À",
        BA: "Á",
        CA: "Â",
        DA: 195,
        HA: "Ä",
        JA: 197,
        AE: "È",
        BE: "É",
        CE: "Ê",
        HE: "Ë",
        AI: "Ì",
        BI: "Í",
        CI: "Î",
        HI: "Ï",
        AO: "Ò",
        BO: "Ó",
        CO: "Ô",
        DO: 213,
        HO: "Ö",
        AU: "Ù",
        BU: "Ú",
        CU: "Û",
        HU: "Ü",
        Aa: "à",
        Ba: "á",
        Ca: "â",
        Da: 227,
        Ha: "ä",
        Ja: 229,
        Ae: "è",
        Be: "é",
        Ce: "ê",
        He: "ë",
        Ai: "ì",
        Bi: "í",
        Ci: "î",
        Hi: "ï",
        Ao: "ò",
        Bo: "ó",
        Co: "ô",
        Do: 245,
        Ho: "ö",
        Au: "ù",
        Bu: "ú",
        Cu: "û",
        Hu: "ü",
        KC: "Ç",
        Kc: "ç",
        q: "æ",
        z: "œ",
        a: "Æ",
        j: "Œ",
        DN: 209,
        Dn: 241,
        Hy: 255,
        S: 169,
        c: 170,
        R: 174,
        "B ": 180,
        /*::[*/
        0: 176,
        /*::[*/
        1: 177,
        /*::[*/
        2: 178,
        /*::[*/
        3: 179,
        /*::[*/
        5: 181,
        /*::[*/
        6: 182,
        /*::[*/
        7: 183,
        Q: 185,
        k: 186,
        b: 208,
        i: 216,
        l: 222,
        s: 240,
        y: 248,
        "!": 161,
        '"': 162,
        "#": 163,
        "(": 164,
        "%": 165,
        "'": 167,
        "H ": 168,
        "+": 171,
        ";": 187,
        "<": 188,
        "=": 189,
        ">": 190,
        "?": 191,
        "{": 223
      };
      var sylk_char_regex = new RegExp("\x1BN(" + keys(sylk_escapes).join("|").replace(/\|\|\|/, "|\\||").replace(/([?()+])/g, "\\$1") + "|\\|)", "gm");
      var sylk_char_fn = function(_2, $1) {
        var o2 = sylk_escapes[$1];
        return typeof o2 == "number" ? _getansi(o2) : o2;
      };
      var decode_sylk_char = function($$, $1, $2) {
        var newcc = $1.charCodeAt(0) - 32 << 4 | $2.charCodeAt(0) - 48;
        return newcc == 59 ? $$ : _getansi(newcc);
      };
      sylk_escapes["|"] = 254;
      function sylk_to_aoa(d2, opts) {
        switch (opts.type) {
          case "base64":
            return sylk_to_aoa_str(Base64_decode(d2), opts);
          case "binary":
            return sylk_to_aoa_str(d2, opts);
          case "buffer":
            return sylk_to_aoa_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
          case "array":
            return sylk_to_aoa_str(cc2str(d2), opts);
        }
        throw new Error("Unrecognized type " + opts.type);
      }
      function sylk_to_aoa_str(str, opts) {
        var records = str.split(/[\n\r]+/), R2 = -1, C2 = -1, ri = 0, rj = 0, arr = [];
        var formats = [];
        var next_cell_format = null;
        var sht = {}, rowinfo = [], colinfo = [], cw = [];
        var Mval = 0, j;
        if (+opts.codepage >= 0) set_cp(+opts.codepage);
        for (; ri !== records.length; ++ri) {
          Mval = 0;
          var rstr = records[ri].trim().replace(/\x1B([\x20-\x2F])([\x30-\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn);
          var record = rstr.replace(/;;/g, "\0").split(";").map(function(x2) {
            return x2.replace(/\u0000/g, ";");
          });
          var RT = record[0], val;
          if (rstr.length > 0) switch (RT) {
            case "ID":
              break;
            /* header */
            case "E":
              break;
            /* EOF */
            case "B":
              break;
            /* dimensions */
            case "O":
              break;
            /* options? */
            case "W":
              break;
            /* window? */
            case "P":
              if (record[1].charAt(0) == "P")
                formats.push(rstr.slice(3).replace(/;;/g, ";"));
              break;
            case "C":
              var C_seen_K = false, C_seen_X = false, C_seen_S = false, C_seen_E = false, _R = -1, _C = -1;
              for (rj = 1; rj < record.length; ++rj) switch (record[rj].charAt(0)) {
                case "A":
                  break;
                // TODO: comment
                case "X":
                  C2 = parseInt(record[rj].slice(1)) - 1;
                  C_seen_X = true;
                  break;
                case "Y":
                  R2 = parseInt(record[rj].slice(1)) - 1;
                  if (!C_seen_X) C2 = 0;
                  for (j = arr.length; j <= R2; ++j) arr[j] = [];
                  break;
                case "K":
                  val = record[rj].slice(1);
                  if (val.charAt(0) === '"') val = val.slice(1, val.length - 1);
                  else if (val === "TRUE") val = true;
                  else if (val === "FALSE") val = false;
                  else if (!isNaN(fuzzynum(val))) {
                    val = fuzzynum(val);
                    if (next_cell_format !== null && fmt_is_date(next_cell_format)) val = numdate(val);
                  } else if (!isNaN(fuzzydate(val).getDate())) {
                    val = parseDate(val);
                  }
                  C_seen_K = true;
                  break;
                case "E":
                  C_seen_E = true;
                  var formula = rc_to_a1(record[rj].slice(1), { r: R2, c: C2 });
                  arr[R2][C2] = [arr[R2][C2], formula];
                  break;
                case "S":
                  C_seen_S = true;
                  arr[R2][C2] = [arr[R2][C2], "S5S"];
                  break;
                case "G":
                  break;
                // unknown
                case "R":
                  _R = parseInt(record[rj].slice(1)) - 1;
                  break;
                case "C":
                  _C = parseInt(record[rj].slice(1)) - 1;
                  break;
                default:
                  if (opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
              }
              if (C_seen_K) {
                if (arr[R2][C2] && arr[R2][C2].length == 2) arr[R2][C2][0] = val;
                else arr[R2][C2] = val;
                next_cell_format = null;
              }
              if (C_seen_S) {
                if (C_seen_E) throw new Error("SYLK shared formula cannot have own formula");
                var shrbase = _R > -1 && arr[_R][_C];
                if (!shrbase || !shrbase[1]) throw new Error("SYLK shared formula cannot find base");
                arr[R2][C2][1] = shift_formula_str(shrbase[1], { r: R2 - _R, c: C2 - _C });
              }
              break;
            case "F":
              var F_seen = 0;
              for (rj = 1; rj < record.length; ++rj) switch (record[rj].charAt(0)) {
                case "X":
                  C2 = parseInt(record[rj].slice(1)) - 1;
                  ++F_seen;
                  break;
                case "Y":
                  R2 = parseInt(record[rj].slice(1)) - 1;
                  for (j = arr.length; j <= R2; ++j) arr[j] = [];
                  break;
                case "M":
                  Mval = parseInt(record[rj].slice(1)) / 20;
                  break;
                case "F":
                  break;
                /* ??? */
                case "G":
                  break;
                /* hide grid */
                case "P":
                  next_cell_format = formats[parseInt(record[rj].slice(1))];
                  break;
                case "S":
                  break;
                /* cell style */
                case "D":
                  break;
                /* column */
                case "N":
                  break;
                /* font */
                case "W":
                  cw = record[rj].slice(1).split(" ");
                  for (j = parseInt(cw[0], 10); j <= parseInt(cw[1], 10); ++j) {
                    Mval = parseInt(cw[2], 10);
                    colinfo[j - 1] = Mval === 0 ? { hidden: true } : { wch: Mval };
                    process_col(colinfo[j - 1]);
                  }
                  break;
                case "C":
                  C2 = parseInt(record[rj].slice(1)) - 1;
                  if (!colinfo[C2]) colinfo[C2] = {};
                  break;
                case "R":
                  R2 = parseInt(record[rj].slice(1)) - 1;
                  if (!rowinfo[R2]) rowinfo[R2] = {};
                  if (Mval > 0) {
                    rowinfo[R2].hpt = Mval;
                    rowinfo[R2].hpx = pt2px(Mval);
                  } else if (Mval === 0) rowinfo[R2].hidden = true;
                  break;
                default:
                  if (opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
              }
              if (F_seen < 1) next_cell_format = null;
              break;
            default:
              if (opts && opts.WTF) throw new Error("SYLK bad record " + rstr);
          }
        }
        if (rowinfo.length > 0) sht["!rows"] = rowinfo;
        if (colinfo.length > 0) sht["!cols"] = colinfo;
        if (opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
        return [arr, sht];
      }
      function sylk_to_sheet(d2, opts) {
        var aoasht = sylk_to_aoa(d2, opts);
        var aoa = aoasht[0], ws = aoasht[1];
        var o2 = aoa_to_sheet(aoa, opts);
        keys(ws).forEach(function(k2) {
          o2[k2] = ws[k2];
        });
        return o2;
      }
      function sylk_to_workbook(d2, opts) {
        return sheet_to_workbook(sylk_to_sheet(d2, opts), opts);
      }
      function write_ws_cell_sylk(cell, ws, R2, C2) {
        var o2 = "C;Y" + (R2 + 1) + ";X" + (C2 + 1) + ";K";
        switch (cell.t) {
          case "n":
            o2 += cell.v || 0;
            if (cell.f && !cell.F) o2 += ";E" + a1_to_rc(cell.f, { r: R2, c: C2 });
            break;
          case "b":
            o2 += cell.v ? "TRUE" : "FALSE";
            break;
          case "e":
            o2 += cell.w || cell.v;
            break;
          case "d":
            o2 += '"' + (cell.w || cell.v) + '"';
            break;
          case "s":
            o2 += '"' + cell.v.replace(/"/g, "").replace(/;/g, ";;") + '"';
            break;
        }
        return o2;
      }
      function write_ws_cols_sylk(out2, cols) {
        cols.forEach(function(col, i2) {
          var rec = "F;W" + (i2 + 1) + " " + (i2 + 1) + " ";
          if (col.hidden) rec += "0";
          else {
            if (typeof col.width == "number" && !col.wpx) col.wpx = width2px(col.width);
            if (typeof col.wpx == "number" && !col.wch) col.wch = px2char(col.wpx);
            if (typeof col.wch == "number") rec += Math.round(col.wch);
          }
          if (rec.charAt(rec.length - 1) != " ") out2.push(rec);
        });
      }
      function write_ws_rows_sylk(out2, rows) {
        rows.forEach(function(row, i2) {
          var rec = "F;";
          if (row.hidden) rec += "M0;";
          else if (row.hpt) rec += "M" + 20 * row.hpt + ";";
          else if (row.hpx) rec += "M" + 20 * px2pt(row.hpx) + ";";
          if (rec.length > 2) out2.push(rec + "R" + (i2 + 1));
        });
      }
      function sheet_to_sylk(ws, opts) {
        var preamble = ["ID;PWXL;N;E"], o2 = [];
        var r = safe_decode_range(ws["!ref"]), cell;
        var dense = Array.isArray(ws);
        var RS = "\r\n";
        preamble.push("P;PGeneral");
        preamble.push("F;P0;DG0G8;M255");
        if (ws["!cols"]) write_ws_cols_sylk(preamble, ws["!cols"]);
        if (ws["!rows"]) write_ws_rows_sylk(preamble, ws["!rows"]);
        preamble.push("B;Y" + (r.e.r - r.s.r + 1) + ";X" + (r.e.c - r.s.c + 1) + ";D" + [r.s.c, r.s.r, r.e.c, r.e.r].join(" "));
        for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
          for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
            var coord = encode_cell({ r: R2, c: C2 });
            cell = dense ? (ws[R2] || [])[C2] : ws[coord];
            if (!cell || cell.v == null && (!cell.f || cell.F)) continue;
            o2.push(write_ws_cell_sylk(cell, ws, R2, C2));
          }
        }
        return preamble.join(RS) + RS + o2.join(RS) + RS + "E" + RS;
      }
      return {
        to_workbook: sylk_to_workbook,
        to_sheet: sylk_to_sheet,
        from_sheet: sheet_to_sylk
      };
    }();
    var DIF = /* @__PURE__ */ function() {
      function dif_to_aoa(d2, opts) {
        switch (opts.type) {
          case "base64":
            return dif_to_aoa_str(Base64_decode(d2), opts);
          case "binary":
            return dif_to_aoa_str(d2, opts);
          case "buffer":
            return dif_to_aoa_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
          case "array":
            return dif_to_aoa_str(cc2str(d2), opts);
        }
        throw new Error("Unrecognized type " + opts.type);
      }
      function dif_to_aoa_str(str, opts) {
        var records = str.split("\n"), R2 = -1, C2 = -1, ri = 0, arr = [];
        for (; ri !== records.length; ++ri) {
          if (records[ri].trim() === "BOT") {
            arr[++R2] = [];
            C2 = 0;
            continue;
          }
          if (R2 < 0) continue;
          var metadata = records[ri].trim().split(",");
          var type = metadata[0], value = metadata[1];
          ++ri;
          var data = records[ri] || "";
          while ((data.match(/["]/g) || []).length & 1 && ri < records.length - 1) data += "\n" + records[++ri];
          data = data.trim();
          switch (+type) {
            case -1:
              if (data === "BOT") {
                arr[++R2] = [];
                C2 = 0;
                continue;
              } else if (data !== "EOD") throw new Error("Unrecognized DIF special command " + data);
              break;
            case 0:
              if (data === "TRUE") arr[R2][C2] = true;
              else if (data === "FALSE") arr[R2][C2] = false;
              else if (!isNaN(fuzzynum(value))) arr[R2][C2] = fuzzynum(value);
              else if (!isNaN(fuzzydate(value).getDate())) arr[R2][C2] = parseDate(value);
              else arr[R2][C2] = value;
              ++C2;
              break;
            case 1:
              data = data.slice(1, data.length - 1);
              data = data.replace(/""/g, '"');
              if (data && data.match(/^=".*"$/)) data = data.slice(2, -1);
              arr[R2][C2++] = data !== "" ? data : null;
              break;
          }
          if (data === "EOD") break;
        }
        if (opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
        return arr;
      }
      function dif_to_sheet(str, opts) {
        return aoa_to_sheet(dif_to_aoa(str, opts), opts);
      }
      function dif_to_workbook(str, opts) {
        return sheet_to_workbook(dif_to_sheet(str, opts), opts);
      }
      var sheet_to_dif = /* @__PURE__ */ function() {
        var push_field = function pf(o2, topic, v4, n, s2) {
          o2.push(topic);
          o2.push(v4 + "," + n);
          o2.push('"' + s2.replace(/"/g, '""') + '"');
        };
        var push_value = function po(o2, type, v4, s2) {
          o2.push(type + "," + v4);
          o2.push(type == 1 ? '"' + s2.replace(/"/g, '""') + '"' : s2);
        };
        return function sheet_to_dif2(ws) {
          var o2 = [];
          var r = safe_decode_range(ws["!ref"]), cell;
          var dense = Array.isArray(ws);
          push_field(o2, "TABLE", 0, 1, "sheetjs");
          push_field(o2, "VECTORS", 0, r.e.r - r.s.r + 1, "");
          push_field(o2, "TUPLES", 0, r.e.c - r.s.c + 1, "");
          push_field(o2, "DATA", 0, 0, "");
          for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
            push_value(o2, -1, 0, "BOT");
            for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
              var coord = encode_cell({ r: R2, c: C2 });
              cell = dense ? (ws[R2] || [])[C2] : ws[coord];
              if (!cell) {
                push_value(o2, 1, 0, "");
                continue;
              }
              switch (cell.t) {
                case "n":
                  var val = cell.w;
                  if (!val && cell.v != null) val = cell.v;
                  if (val == null) {
                    if (cell.f && !cell.F) push_value(o2, 1, 0, "=" + cell.f);
                    else push_value(o2, 1, 0, "");
                  } else push_value(o2, 0, val, "V");
                  break;
                case "b":
                  push_value(o2, 0, cell.v ? 1 : 0, cell.v ? "TRUE" : "FALSE");
                  break;
                case "s":
                  push_value(o2, 1, 0, isNaN(cell.v) ? cell.v : '="' + cell.v + '"');
                  break;
                case "d":
                  if (!cell.w) cell.w = SSF_format(cell.z || table_fmt[14], datenum(parseDate(cell.v)));
                  push_value(o2, 0, cell.w, "V");
                  break;
                default:
                  push_value(o2, 1, 0, "");
              }
            }
          }
          push_value(o2, -1, 0, "EOD");
          var RS = "\r\n";
          var oo = o2.join(RS);
          return oo;
        };
      }();
      return {
        to_workbook: dif_to_workbook,
        to_sheet: dif_to_sheet,
        from_sheet: sheet_to_dif
      };
    }();
    var ETH = /* @__PURE__ */ function() {
      function decode2(s2) {
        return s2.replace(/\\b/g, "\\").replace(/\\c/g, ":").replace(/\\n/g, "\n");
      }
      function encode2(s2) {
        return s2.replace(/\\/g, "\\b").replace(/:/g, "\\c").replace(/\n/g, "\\n");
      }
      function eth_to_aoa(str, opts) {
        var records = str.split("\n"), R2 = -1, C2 = -1, ri = 0, arr = [];
        for (; ri !== records.length; ++ri) {
          var record = records[ri].trim().split(":");
          if (record[0] !== "cell") continue;
          var addr = decode_cell(record[1]);
          if (arr.length <= addr.r) {
            for (R2 = arr.length; R2 <= addr.r; ++R2) if (!arr[R2]) arr[R2] = [];
          }
          R2 = addr.r;
          C2 = addr.c;
          switch (record[2]) {
            case "t":
              arr[R2][C2] = decode2(record[3]);
              break;
            case "v":
              arr[R2][C2] = +record[3];
              break;
            case "vtf":
              var _f = record[record.length - 1];
            /* falls through */
            case "vtc":
              switch (record[3]) {
                case "nl":
                  arr[R2][C2] = +record[4] ? true : false;
                  break;
                default:
                  arr[R2][C2] = +record[4];
                  break;
              }
              if (record[2] == "vtf") arr[R2][C2] = [arr[R2][C2], _f];
          }
        }
        if (opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);
        return arr;
      }
      function eth_to_sheet(d2, opts) {
        return aoa_to_sheet(eth_to_aoa(d2, opts), opts);
      }
      function eth_to_workbook(d2, opts) {
        return sheet_to_workbook(eth_to_sheet(d2, opts), opts);
      }
      var header = [
        "socialcalc:version:1.5",
        "MIME-Version: 1.0",
        "Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave"
      ].join("\n");
      var sep = [
        "--SocialCalcSpreadsheetControlSave",
        "Content-type: text/plain; charset=UTF-8"
      ].join("\n") + "\n";
      var meta = [
        "# SocialCalc Spreadsheet Control Save",
        "part:sheet"
      ].join("\n");
      var end2 = "--SocialCalcSpreadsheetControlSave--";
      function sheet_to_eth_data(ws) {
        if (!ws || !ws["!ref"]) return "";
        var o2 = [], oo = [], cell, coord = "";
        var r = decode_range(ws["!ref"]);
        var dense = Array.isArray(ws);
        for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
          for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
            coord = encode_cell({ r: R2, c: C2 });
            cell = dense ? (ws[R2] || [])[C2] : ws[coord];
            if (!cell || cell.v == null || cell.t === "z") continue;
            oo = ["cell", coord, "t"];
            switch (cell.t) {
              case "s":
              case "str":
                oo.push(encode2(cell.v));
                break;
              case "n":
                if (!cell.f) {
                  oo[2] = "v";
                  oo[3] = cell.v;
                } else {
                  oo[2] = "vtf";
                  oo[3] = "n";
                  oo[4] = cell.v;
                  oo[5] = encode2(cell.f);
                }
                break;
              case "b":
                oo[2] = "vt" + (cell.f ? "f" : "c");
                oo[3] = "nl";
                oo[4] = cell.v ? "1" : "0";
                oo[5] = encode2(cell.f || (cell.v ? "TRUE" : "FALSE"));
                break;
              case "d":
                var t = datenum(parseDate(cell.v));
                oo[2] = "vtc";
                oo[3] = "nd";
                oo[4] = "" + t;
                oo[5] = cell.w || SSF_format(cell.z || table_fmt[14], t);
                break;
              case "e":
                continue;
            }
            o2.push(oo.join(":"));
          }
        }
        o2.push("sheet:c:" + (r.e.c - r.s.c + 1) + ":r:" + (r.e.r - r.s.r + 1) + ":tvf:1");
        o2.push("valueformat:1:text-wiki");
        return o2.join("\n");
      }
      function sheet_to_eth(ws) {
        return [header, sep, meta, sep, sheet_to_eth_data(ws), end2].join("\n");
      }
      return {
        to_workbook: eth_to_workbook,
        to_sheet: eth_to_sheet,
        from_sheet: sheet_to_eth
      };
    }();
    var PRN = /* @__PURE__ */ function() {
      function set_text_arr(data, arr, R2, C2, o2) {
        if (o2.raw) arr[R2][C2] = data;
        else if (data === "") ;
        else if (data === "TRUE") arr[R2][C2] = true;
        else if (data === "FALSE") arr[R2][C2] = false;
        else if (!isNaN(fuzzynum(data))) arr[R2][C2] = fuzzynum(data);
        else if (!isNaN(fuzzydate(data).getDate())) arr[R2][C2] = parseDate(data);
        else arr[R2][C2] = data;
      }
      function prn_to_aoa_str(f2, opts) {
        var o2 = opts || {};
        var arr = [];
        if (!f2 || f2.length === 0) return arr;
        var lines = f2.split(/[\r\n]/);
        var L2 = lines.length - 1;
        while (L2 >= 0 && lines[L2].length === 0) --L2;
        var start2 = 10, idx = 0;
        var R2 = 0;
        for (; R2 <= L2; ++R2) {
          idx = lines[R2].indexOf(" ");
          if (idx == -1) idx = lines[R2].length;
          else idx++;
          start2 = Math.max(start2, idx);
        }
        for (R2 = 0; R2 <= L2; ++R2) {
          arr[R2] = [];
          var C2 = 0;
          set_text_arr(lines[R2].slice(0, start2).trim(), arr, R2, C2, o2);
          for (C2 = 1; C2 <= (lines[R2].length - start2) / 10 + 1; ++C2)
            set_text_arr(lines[R2].slice(start2 + (C2 - 1) * 10, start2 + C2 * 10).trim(), arr, R2, C2, o2);
        }
        if (o2.sheetRows) arr = arr.slice(0, o2.sheetRows);
        return arr;
      }
      var guess_seps = {
        /*::[*/
        44: ",",
        /*::[*/
        9: "	",
        /*::[*/
        59: ";",
        /*::[*/
        124: "|"
      };
      var guess_sep_weights = {
        /*::[*/
        44: 3,
        /*::[*/
        9: 2,
        /*::[*/
        59: 1,
        /*::[*/
        124: 0
      };
      function guess_sep(str) {
        var cnt = {}, instr = false, end2 = 0, cc = 0;
        for (; end2 < str.length; ++end2) {
          if ((cc = str.charCodeAt(end2)) == 34) instr = !instr;
          else if (!instr && cc in guess_seps) cnt[cc] = (cnt[cc] || 0) + 1;
        }
        cc = [];
        for (end2 in cnt) if (Object.prototype.hasOwnProperty.call(cnt, end2)) {
          cc.push([cnt[end2], end2]);
        }
        if (!cc.length) {
          cnt = guess_sep_weights;
          for (end2 in cnt) if (Object.prototype.hasOwnProperty.call(cnt, end2)) {
            cc.push([cnt[end2], end2]);
          }
        }
        cc.sort(function(a2, b2) {
          return a2[0] - b2[0] || guess_sep_weights[a2[1]] - guess_sep_weights[b2[1]];
        });
        return guess_seps[cc.pop()[1]] || 44;
      }
      function dsv_to_sheet_str(str, opts) {
        var o2 = opts || {};
        var sep = "";
        var ws = o2.dense ? [] : {};
        var range2 = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
        if (str.slice(0, 4) == "sep=") {
          if (str.charCodeAt(5) == 13 && str.charCodeAt(6) == 10) {
            sep = str.charAt(4);
            str = str.slice(7);
          } else if (str.charCodeAt(5) == 13 || str.charCodeAt(5) == 10) {
            sep = str.charAt(4);
            str = str.slice(6);
          } else sep = guess_sep(str.slice(0, 1024));
        } else if (o2 && o2.FS) sep = o2.FS;
        else sep = guess_sep(str.slice(0, 1024));
        var R2 = 0, C2 = 0, v4 = 0;
        var start2 = 0, end2 = 0, sepcc = sep.charCodeAt(0), instr = false, cc = 0, startcc = str.charCodeAt(0);
        str = str.replace(/\r\n/mg, "\n");
        var _re = o2.dateNF != null ? dateNF_regex(o2.dateNF) : null;
        function finish_cell() {
          var s2 = str.slice(start2, end2);
          var cell = {};
          if (s2.charAt(0) == '"' && s2.charAt(s2.length - 1) == '"') s2 = s2.slice(1, -1).replace(/""/g, '"');
          if (s2.length === 0) cell.t = "z";
          else if (o2.raw) {
            cell.t = "s";
            cell.v = s2;
          } else if (s2.trim().length === 0) {
            cell.t = "s";
            cell.v = s2;
          } else if (s2.charCodeAt(0) == 61) {
            if (s2.charCodeAt(1) == 34 && s2.charCodeAt(s2.length - 1) == 34) {
              cell.t = "s";
              cell.v = s2.slice(2, -1).replace(/""/g, '"');
            } else if (fuzzyfmla(s2)) {
              cell.t = "n";
              cell.f = s2.slice(1);
            } else {
              cell.t = "s";
              cell.v = s2;
            }
          } else if (s2 == "TRUE") {
            cell.t = "b";
            cell.v = true;
          } else if (s2 == "FALSE") {
            cell.t = "b";
            cell.v = false;
          } else if (!isNaN(v4 = fuzzynum(s2))) {
            cell.t = "n";
            if (o2.cellText !== false) cell.w = s2;
            cell.v = v4;
          } else if (!isNaN(fuzzydate(s2).getDate()) || _re && s2.match(_re)) {
            cell.z = o2.dateNF || table_fmt[14];
            var k2 = 0;
            if (_re && s2.match(_re)) {
              s2 = dateNF_fix(s2, o2.dateNF, s2.match(_re) || []);
              k2 = 1;
            }
            if (o2.cellDates) {
              cell.t = "d";
              cell.v = parseDate(s2, k2);
            } else {
              cell.t = "n";
              cell.v = datenum(parseDate(s2, k2));
            }
            if (o2.cellText !== false) cell.w = SSF_format(cell.z, cell.v instanceof Date ? datenum(cell.v) : cell.v);
            if (!o2.cellNF) delete cell.z;
          } else {
            cell.t = "s";
            cell.v = s2;
          }
          if (cell.t == "z") ;
          else if (o2.dense) {
            if (!ws[R2]) ws[R2] = [];
            ws[R2][C2] = cell;
          } else ws[encode_cell({ c: C2, r: R2 })] = cell;
          start2 = end2 + 1;
          startcc = str.charCodeAt(start2);
          if (range2.e.c < C2) range2.e.c = C2;
          if (range2.e.r < R2) range2.e.r = R2;
          if (cc == sepcc) ++C2;
          else {
            C2 = 0;
            ++R2;
            if (o2.sheetRows && o2.sheetRows <= R2) return true;
          }
        }
        outer: for (; end2 < str.length; ++end2) switch (cc = str.charCodeAt(end2)) {
          case 34:
            if (startcc === 34) instr = !instr;
            break;
          case sepcc:
          case 10:
          case 13:
            if (!instr && finish_cell()) break outer;
            break;
        }
        if (end2 - start2 > 0) finish_cell();
        ws["!ref"] = encode_range(range2);
        return ws;
      }
      function prn_to_sheet_str(str, opts) {
        if (!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts);
        if (opts.FS) return dsv_to_sheet_str(str, opts);
        if (str.slice(0, 4) == "sep=") return dsv_to_sheet_str(str, opts);
        if (str.indexOf("	") >= 0 || str.indexOf(",") >= 0 || str.indexOf(";") >= 0) return dsv_to_sheet_str(str, opts);
        return aoa_to_sheet(prn_to_aoa_str(str, opts), opts);
      }
      function prn_to_sheet(d2, opts) {
        var str = "", bytes = opts.type == "string" ? [0, 0, 0, 0] : firstbyte(d2, opts);
        switch (opts.type) {
          case "base64":
            str = Base64_decode(d2);
            break;
          case "binary":
            str = d2;
            break;
          case "buffer":
            if (opts.codepage == 65001) str = d2.toString("utf8");
            else if (opts.codepage && false) ;
            else str = has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2);
            break;
          case "array":
            str = cc2str(d2);
            break;
          case "string":
            str = d2;
            break;
          default:
            throw new Error("Unrecognized type " + opts.type);
        }
        if (bytes[0] == 239 && bytes[1] == 187 && bytes[2] == 191) str = utf8read(str.slice(3));
        else if (opts.type != "string" && opts.type != "buffer" && opts.codepage == 65001) str = utf8read(str);
        else if (opts.type == "binary" && false) ;
        if (str.slice(0, 19) == "socialcalc:version:") return ETH.to_sheet(opts.type == "string" ? str : utf8read(str), opts);
        return prn_to_sheet_str(str, opts);
      }
      function prn_to_workbook(d2, opts) {
        return sheet_to_workbook(prn_to_sheet(d2, opts), opts);
      }
      function sheet_to_prn(ws) {
        var o2 = [];
        var r = safe_decode_range(ws["!ref"]), cell;
        var dense = Array.isArray(ws);
        for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
          var oo = [];
          for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
            var coord = encode_cell({ r: R2, c: C2 });
            cell = dense ? (ws[R2] || [])[C2] : ws[coord];
            if (!cell || cell.v == null) {
              oo.push("          ");
              continue;
            }
            var w2 = (cell.w || (format_cell(cell), cell.w) || "").slice(0, 10);
            while (w2.length < 10) w2 += " ";
            oo.push(w2 + (C2 === 0 ? " " : ""));
          }
          o2.push(oo.join(""));
        }
        return o2.join("\n");
      }
      return {
        to_workbook: prn_to_workbook,
        to_sheet: prn_to_sheet,
        from_sheet: sheet_to_prn
      };
    }();
    var WK_ = /* @__PURE__ */ function() {
      function lotushopper(data, cb, opts) {
        if (!data) return;
        prep_blob(data, data.l || 0);
        var Enum = opts.Enum || WK1Enum;
        while (data.l < data.length) {
          var RT = data.read_shift(2);
          var R2 = Enum[RT] || Enum[65535];
          var length = data.read_shift(2);
          var tgt = data.l + length;
          var d2 = R2.f && R2.f(data, length, opts);
          data.l = tgt;
          if (cb(d2, R2, RT)) return;
        }
      }
      function lotus_to_workbook(d2, opts) {
        switch (opts.type) {
          case "base64":
            return lotus_to_workbook_buf(s2a(Base64_decode(d2)), opts);
          case "binary":
            return lotus_to_workbook_buf(s2a(d2), opts);
          case "buffer":
          case "array":
            return lotus_to_workbook_buf(d2, opts);
        }
        throw "Unsupported type " + opts.type;
      }
      function lotus_to_workbook_buf(d2, opts) {
        if (!d2) return d2;
        var o2 = opts || {};
        var s2 = o2.dense ? [] : {}, n = "Sheet1", next_n = "", sidx = 0;
        var sheets = {}, snames = [], realnames = [];
        var refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
        var sheetRows = o2.sheetRows || 0;
        if (d2[2] == 0) {
          if (d2[3] == 8 || d2[3] == 9) {
            if (d2.length >= 16 && d2[14] == 5 && d2[15] === 108) throw new Error("Unsupported Works 3 for Mac file");
          }
        }
        if (d2[2] == 2) {
          o2.Enum = WK1Enum;
          lotushopper(d2, function(val, R2, RT) {
            switch (RT) {
              case 0:
                o2.vers = val;
                if (val >= 4096) o2.qpro = true;
                break;
              case 6:
                refguess = val;
                break;
              /* RANGE */
              case 204:
                if (val) next_n = val;
                break;
              /* SHEETNAMECS */
              case 222:
                next_n = val;
                break;
              /* SHEETNAMELP */
              case 15:
              /* LABEL */
              case 51:
                if (!o2.qpro) val[1].v = val[1].v.slice(1);
              /* falls through */
              case 13:
              /* INTEGER */
              case 14:
              /* NUMBER */
              case 16:
                if (RT == 14 && (val[2] & 112) == 112 && (val[2] & 15) > 1 && (val[2] & 15) < 15) {
                  val[1].z = o2.dateNF || table_fmt[14];
                  if (o2.cellDates) {
                    val[1].t = "d";
                    val[1].v = numdate(val[1].v);
                  }
                }
                if (o2.qpro) {
                  if (val[3] > sidx) {
                    s2["!ref"] = encode_range(refguess);
                    sheets[n] = s2;
                    snames.push(n);
                    s2 = o2.dense ? [] : {};
                    refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
                    sidx = val[3];
                    n = next_n || "Sheet" + (sidx + 1);
                    next_n = "";
                  }
                }
                var tmpcell = o2.dense ? (s2[val[0].r] || [])[val[0].c] : s2[encode_cell(val[0])];
                if (tmpcell) {
                  tmpcell.t = val[1].t;
                  tmpcell.v = val[1].v;
                  if (val[1].z != null) tmpcell.z = val[1].z;
                  if (val[1].f != null) tmpcell.f = val[1].f;
                  break;
                }
                if (o2.dense) {
                  if (!s2[val[0].r]) s2[val[0].r] = [];
                  s2[val[0].r][val[0].c] = val[1];
                } else s2[encode_cell(val[0])] = val[1];
                break;
            }
          }, o2);
        } else if (d2[2] == 26 || d2[2] == 14) {
          o2.Enum = WK3Enum;
          if (d2[2] == 14) {
            o2.qpro = true;
            d2.l = 0;
          }
          lotushopper(d2, function(val, R2, RT) {
            switch (RT) {
              case 204:
                n = val;
                break;
              /* SHEETNAMECS */
              case 22:
                val[1].v = val[1].v.slice(1);
              /* falls through */
              case 23:
              /* NUMBER17 */
              case 24:
              /* NUMBER18 */
              case 25:
              /* FORMULA19 */
              case 37:
              /* NUMBER25 */
              case 39:
              /* NUMBER27 */
              case 40:
                if (val[3] > sidx) {
                  s2["!ref"] = encode_range(refguess);
                  sheets[n] = s2;
                  snames.push(n);
                  s2 = o2.dense ? [] : {};
                  refguess = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
                  sidx = val[3];
                  n = "Sheet" + (sidx + 1);
                }
                if (sheetRows > 0 && val[0].r >= sheetRows) break;
                if (o2.dense) {
                  if (!s2[val[0].r]) s2[val[0].r] = [];
                  s2[val[0].r][val[0].c] = val[1];
                } else s2[encode_cell(val[0])] = val[1];
                if (refguess.e.c < val[0].c) refguess.e.c = val[0].c;
                if (refguess.e.r < val[0].r) refguess.e.r = val[0].r;
                break;
              case 27:
                if (val[14e3]) realnames[val[14e3][0]] = val[14e3][1];
                break;
              case 1537:
                realnames[val[0]] = val[1];
                if (val[0] == sidx) n = val[1];
                break;
            }
          }, o2);
        } else throw new Error("Unrecognized LOTUS BOF " + d2[2]);
        s2["!ref"] = encode_range(refguess);
        sheets[next_n || n] = s2;
        snames.push(next_n || n);
        if (!realnames.length) return { SheetNames: snames, Sheets: sheets };
        var osheets = {}, rnames = [];
        for (var i2 = 0; i2 < realnames.length; ++i2) if (sheets[snames[i2]]) {
          rnames.push(realnames[i2] || snames[i2]);
          osheets[realnames[i2]] = sheets[realnames[i2]] || sheets[snames[i2]];
        } else {
          rnames.push(realnames[i2]);
          osheets[realnames[i2]] = { "!ref": "A1" };
        }
        return { SheetNames: rnames, Sheets: osheets };
      }
      function sheet_to_wk1(ws, opts) {
        var o2 = opts || {};
        if (+o2.codepage >= 0) set_cp(+o2.codepage);
        if (o2.type == "string") throw new Error("Cannot write WK1 to JS string");
        var ba = buf_array();
        var range2 = safe_decode_range(ws["!ref"]);
        var dense = Array.isArray(ws);
        var cols = [];
        write_biff_rec(ba, 0, write_BOF_WK1(1030));
        write_biff_rec(ba, 6, write_RANGE(range2));
        var max_R = Math.min(range2.e.r, 8191);
        for (var R2 = range2.s.r; R2 <= max_R; ++R2) {
          var rr = encode_row(R2);
          for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
            if (R2 === range2.s.r) cols[C2] = encode_col(C2);
            var ref2 = cols[C2] + rr;
            var cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
            if (!cell || cell.t == "z") continue;
            if (cell.t == "n") {
              if ((cell.v | 0) == cell.v && cell.v >= -32768 && cell.v <= 32767) write_biff_rec(ba, 13, write_INTEGER(R2, C2, cell.v));
              else write_biff_rec(ba, 14, write_NUMBER(R2, C2, cell.v));
            } else {
              var str = format_cell(cell);
              write_biff_rec(ba, 15, write_LABEL(R2, C2, str.slice(0, 239)));
            }
          }
        }
        write_biff_rec(ba, 1);
        return ba.end();
      }
      function book_to_wk3(wb, opts) {
        var o2 = opts || {};
        if (+o2.codepage >= 0) set_cp(+o2.codepage);
        if (o2.type == "string") throw new Error("Cannot write WK3 to JS string");
        var ba = buf_array();
        write_biff_rec(ba, 0, write_BOF_WK3(wb));
        for (var i2 = 0, cnt = 0; i2 < wb.SheetNames.length; ++i2) if ((wb.Sheets[wb.SheetNames[i2]] || {})["!ref"]) write_biff_rec(ba, 27, write_XFORMAT_SHEETNAME(wb.SheetNames[i2], cnt++));
        var wsidx = 0;
        for (i2 = 0; i2 < wb.SheetNames.length; ++i2) {
          var ws = wb.Sheets[wb.SheetNames[i2]];
          if (!ws || !ws["!ref"]) continue;
          var range2 = safe_decode_range(ws["!ref"]);
          var dense = Array.isArray(ws);
          var cols = [];
          var max_R = Math.min(range2.e.r, 8191);
          for (var R2 = range2.s.r; R2 <= max_R; ++R2) {
            var rr = encode_row(R2);
            for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
              if (R2 === range2.s.r) cols[C2] = encode_col(C2);
              var ref2 = cols[C2] + rr;
              var cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
              if (!cell || cell.t == "z") continue;
              if (cell.t == "n") {
                write_biff_rec(ba, 23, write_NUMBER_17(R2, C2, wsidx, cell.v));
              } else {
                var str = format_cell(cell);
                write_biff_rec(ba, 22, write_LABEL_16(R2, C2, wsidx, str.slice(0, 239)));
              }
            }
          }
          ++wsidx;
        }
        write_biff_rec(ba, 1);
        return ba.end();
      }
      function write_BOF_WK1(v4) {
        var out2 = new_buf(2);
        out2.write_shift(2, v4);
        return out2;
      }
      function write_BOF_WK3(wb) {
        var out2 = new_buf(26);
        out2.write_shift(2, 4096);
        out2.write_shift(2, 4);
        out2.write_shift(4, 0);
        var rows = 0, cols = 0, wscnt = 0;
        for (var i2 = 0; i2 < wb.SheetNames.length; ++i2) {
          var name = wb.SheetNames[i2];
          var ws = wb.Sheets[name];
          if (!ws || !ws["!ref"]) continue;
          ++wscnt;
          var range2 = decode_range(ws["!ref"]);
          if (rows < range2.e.r) rows = range2.e.r;
          if (cols < range2.e.c) cols = range2.e.c;
        }
        if (rows > 8191) rows = 8191;
        out2.write_shift(2, rows);
        out2.write_shift(1, wscnt);
        out2.write_shift(1, cols);
        out2.write_shift(2, 0);
        out2.write_shift(2, 0);
        out2.write_shift(1, 1);
        out2.write_shift(1, 2);
        out2.write_shift(4, 0);
        out2.write_shift(4, 0);
        return out2;
      }
      function parse_RANGE(blob, length, opts) {
        var o2 = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
        if (length == 8 && opts.qpro) {
          o2.s.c = blob.read_shift(1);
          blob.l++;
          o2.s.r = blob.read_shift(2);
          o2.e.c = blob.read_shift(1);
          blob.l++;
          o2.e.r = blob.read_shift(2);
          return o2;
        }
        o2.s.c = blob.read_shift(2);
        o2.s.r = blob.read_shift(2);
        if (length == 12 && opts.qpro) blob.l += 2;
        o2.e.c = blob.read_shift(2);
        o2.e.r = blob.read_shift(2);
        if (length == 12 && opts.qpro) blob.l += 2;
        if (o2.s.c == 65535) o2.s.c = o2.e.c = o2.s.r = o2.e.r = 0;
        return o2;
      }
      function write_RANGE(range2) {
        var out2 = new_buf(8);
        out2.write_shift(2, range2.s.c);
        out2.write_shift(2, range2.s.r);
        out2.write_shift(2, range2.e.c);
        out2.write_shift(2, range2.e.r);
        return out2;
      }
      function parse_cell(blob, length, opts) {
        var o2 = [{ c: 0, r: 0 }, { t: "n", v: 0 }, 0, 0];
        if (opts.qpro && opts.vers != 20768) {
          o2[0].c = blob.read_shift(1);
          o2[3] = blob.read_shift(1);
          o2[0].r = blob.read_shift(2);
          blob.l += 2;
        } else {
          o2[2] = blob.read_shift(1);
          o2[0].c = blob.read_shift(2);
          o2[0].r = blob.read_shift(2);
        }
        return o2;
      }
      function parse_LABEL(blob, length, opts) {
        var tgt = blob.l + length;
        var o2 = parse_cell(blob, length, opts);
        o2[1].t = "s";
        if (opts.vers == 20768) {
          blob.l++;
          var len2 = blob.read_shift(1);
          o2[1].v = blob.read_shift(len2, "utf8");
          return o2;
        }
        if (opts.qpro) blob.l++;
        o2[1].v = blob.read_shift(tgt - blob.l, "cstr");
        return o2;
      }
      function write_LABEL(R2, C2, s2) {
        var o2 = new_buf(7 + s2.length);
        o2.write_shift(1, 255);
        o2.write_shift(2, C2);
        o2.write_shift(2, R2);
        o2.write_shift(1, 39);
        for (var i2 = 0; i2 < o2.length; ++i2) {
          var cc = s2.charCodeAt(i2);
          o2.write_shift(1, cc >= 128 ? 95 : cc);
        }
        o2.write_shift(1, 0);
        return o2;
      }
      function parse_INTEGER(blob, length, opts) {
        var o2 = parse_cell(blob, length, opts);
        o2[1].v = blob.read_shift(2, "i");
        return o2;
      }
      function write_INTEGER(R2, C2, v4) {
        var o2 = new_buf(7);
        o2.write_shift(1, 255);
        o2.write_shift(2, C2);
        o2.write_shift(2, R2);
        o2.write_shift(2, v4, "i");
        return o2;
      }
      function parse_NUMBER(blob, length, opts) {
        var o2 = parse_cell(blob, length, opts);
        o2[1].v = blob.read_shift(8, "f");
        return o2;
      }
      function write_NUMBER(R2, C2, v4) {
        var o2 = new_buf(13);
        o2.write_shift(1, 255);
        o2.write_shift(2, C2);
        o2.write_shift(2, R2);
        o2.write_shift(8, v4, "f");
        return o2;
      }
      function parse_FORMULA(blob, length, opts) {
        var tgt = blob.l + length;
        var o2 = parse_cell(blob, length, opts);
        o2[1].v = blob.read_shift(8, "f");
        if (opts.qpro) blob.l = tgt;
        else {
          var flen = blob.read_shift(2);
          wk1_fmla_to_csf(blob.slice(blob.l, blob.l + flen), o2);
          blob.l += flen;
        }
        return o2;
      }
      function wk1_parse_rc(B3, V2, col) {
        var rel = V2 & 32768;
        V2 &= -32769;
        V2 = (rel ? B3 : 0) + (V2 >= 8192 ? V2 - 16384 : V2);
        return (rel ? "" : "$") + (col ? encode_col(V2) : encode_row(V2));
      }
      var FuncTab = {
        51: ["FALSE", 0],
        52: ["TRUE", 0],
        70: ["LEN", 1],
        80: ["SUM", 69],
        81: ["AVERAGEA", 69],
        82: ["COUNTA", 69],
        83: ["MINA", 69],
        84: ["MAXA", 69],
        111: ["T", 1]
      };
      var BinOpTab = [
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        "",
        // eslint-disable-line no-mixed-spaces-and-tabs
        "",
        "+",
        "-",
        "*",
        "/",
        "^",
        "=",
        "<>",
        // eslint-disable-line no-mixed-spaces-and-tabs
        "<=",
        ">=",
        "<",
        ">",
        "",
        "",
        "",
        "",
        // eslint-disable-line no-mixed-spaces-and-tabs
        "&",
        "",
        "",
        "",
        "",
        "",
        "",
        ""
        // eslint-disable-line no-mixed-spaces-and-tabs
      ];
      function wk1_fmla_to_csf(blob, o2) {
        prep_blob(blob, 0);
        var out2 = [], argc = 0, R2 = "", C2 = "", argL = "", argR = "";
        while (blob.l < blob.length) {
          var cc = blob[blob.l++];
          switch (cc) {
            case 0:
              out2.push(blob.read_shift(8, "f"));
              break;
            case 1:
              {
                C2 = wk1_parse_rc(o2[0].c, blob.read_shift(2), true);
                R2 = wk1_parse_rc(o2[0].r, blob.read_shift(2), false);
                out2.push(C2 + R2);
              }
              break;
            case 2:
              {
                var c2 = wk1_parse_rc(o2[0].c, blob.read_shift(2), true);
                var r = wk1_parse_rc(o2[0].r, blob.read_shift(2), false);
                C2 = wk1_parse_rc(o2[0].c, blob.read_shift(2), true);
                R2 = wk1_parse_rc(o2[0].r, blob.read_shift(2), false);
                out2.push(c2 + r + ":" + C2 + R2);
              }
              break;
            case 3:
              if (blob.l < blob.length) {
                console.error("WK1 premature formula end");
                return;
              }
              break;
            case 4:
              out2.push("(" + out2.pop() + ")");
              break;
            case 5:
              out2.push(blob.read_shift(2));
              break;
            case 6:
              {
                var Z2 = "";
                while (cc = blob[blob.l++]) Z2 += String.fromCharCode(cc);
                out2.push('"' + Z2.replace(/"/g, '""') + '"');
              }
              break;
            case 8:
              out2.push("-" + out2.pop());
              break;
            case 23:
              out2.push("+" + out2.pop());
              break;
            case 22:
              out2.push("NOT(" + out2.pop() + ")");
              break;
            case 20:
            case 21:
              {
                argR = out2.pop();
                argL = out2.pop();
                out2.push(["AND", "OR"][cc - 20] + "(" + argL + "," + argR + ")");
              }
              break;
            default:
              if (cc < 32 && BinOpTab[cc]) {
                argR = out2.pop();
                argL = out2.pop();
                out2.push(argL + BinOpTab[cc] + argR);
              } else if (FuncTab[cc]) {
                argc = FuncTab[cc][1];
                if (argc == 69) argc = blob[blob.l++];
                if (argc > out2.length) {
                  console.error("WK1 bad formula parse 0x" + cc.toString(16) + ":|" + out2.join("|") + "|");
                  return;
                }
                var args = out2.slice(-argc);
                out2.length -= argc;
                out2.push(FuncTab[cc][0] + "(" + args.join(",") + ")");
              } else if (cc <= 7) return console.error("WK1 invalid opcode " + cc.toString(16));
              else if (cc <= 24) return console.error("WK1 unsupported op " + cc.toString(16));
              else if (cc <= 30) return console.error("WK1 invalid opcode " + cc.toString(16));
              else if (cc <= 115) return console.error("WK1 unsupported function opcode " + cc.toString(16));
              else return console.error("WK1 unrecognized opcode " + cc.toString(16));
          }
        }
        if (out2.length == 1) o2[1].f = "" + out2[0];
        else console.error("WK1 bad formula parse |" + out2.join("|") + "|");
      }
      function parse_cell_3(blob) {
        var o2 = [{ c: 0, r: 0 }, { t: "n", v: 0 }, 0];
        o2[0].r = blob.read_shift(2);
        o2[3] = blob[blob.l++];
        o2[0].c = blob[blob.l++];
        return o2;
      }
      function parse_LABEL_16(blob, length) {
        var o2 = parse_cell_3(blob);
        o2[1].t = "s";
        o2[1].v = blob.read_shift(length - 4, "cstr");
        return o2;
      }
      function write_LABEL_16(R2, C2, wsidx, s2) {
        var o2 = new_buf(6 + s2.length);
        o2.write_shift(2, R2);
        o2.write_shift(1, wsidx);
        o2.write_shift(1, C2);
        o2.write_shift(1, 39);
        for (var i2 = 0; i2 < s2.length; ++i2) {
          var cc = s2.charCodeAt(i2);
          o2.write_shift(1, cc >= 128 ? 95 : cc);
        }
        o2.write_shift(1, 0);
        return o2;
      }
      function parse_NUMBER_18(blob, length) {
        var o2 = parse_cell_3(blob);
        o2[1].v = blob.read_shift(2);
        var v4 = o2[1].v >> 1;
        if (o2[1].v & 1) {
          switch (v4 & 7) {
            case 0:
              v4 = (v4 >> 3) * 5e3;
              break;
            case 1:
              v4 = (v4 >> 3) * 500;
              break;
            case 2:
              v4 = (v4 >> 3) / 20;
              break;
            case 3:
              v4 = (v4 >> 3) / 200;
              break;
            case 4:
              v4 = (v4 >> 3) / 2e3;
              break;
            case 5:
              v4 = (v4 >> 3) / 2e4;
              break;
            case 6:
              v4 = (v4 >> 3) / 16;
              break;
            case 7:
              v4 = (v4 >> 3) / 64;
              break;
          }
        }
        o2[1].v = v4;
        return o2;
      }
      function parse_NUMBER_17(blob, length) {
        var o2 = parse_cell_3(blob);
        var v12 = blob.read_shift(4);
        var v22 = blob.read_shift(4);
        var e2 = blob.read_shift(2);
        if (e2 == 65535) {
          if (v12 === 0 && v22 === 3221225472) {
            o2[1].t = "e";
            o2[1].v = 15;
          } else if (v12 === 0 && v22 === 3489660928) {
            o2[1].t = "e";
            o2[1].v = 42;
          } else o2[1].v = 0;
          return o2;
        }
        var s2 = e2 & 32768;
        e2 = (e2 & 32767) - 16446;
        o2[1].v = (1 - s2 * 2) * (v22 * Math.pow(2, e2 + 32) + v12 * Math.pow(2, e2));
        return o2;
      }
      function write_NUMBER_17(R2, C2, wsidx, v4) {
        var o2 = new_buf(14);
        o2.write_shift(2, R2);
        o2.write_shift(1, wsidx);
        o2.write_shift(1, C2);
        if (v4 == 0) {
          o2.write_shift(4, 0);
          o2.write_shift(4, 0);
          o2.write_shift(2, 65535);
          return o2;
        }
        var s2 = 0, e2 = 0, v12 = 0, v22 = 0;
        if (v4 < 0) {
          s2 = 1;
          v4 = -v4;
        }
        e2 = Math.log2(v4) | 0;
        v4 /= Math.pow(2, e2 - 31);
        v22 = v4 >>> 0;
        if ((v22 & 2147483648) == 0) {
          v4 /= 2;
          ++e2;
          v22 = v4 >>> 0;
        }
        v4 -= v22;
        v22 |= 2147483648;
        v22 >>>= 0;
        v4 *= Math.pow(2, 32);
        v12 = v4 >>> 0;
        o2.write_shift(4, v12);
        o2.write_shift(4, v22);
        e2 += 16383 + (s2 ? 32768 : 0);
        o2.write_shift(2, e2);
        return o2;
      }
      function parse_FORMULA_19(blob, length) {
        var o2 = parse_NUMBER_17(blob);
        blob.l += length - 14;
        return o2;
      }
      function parse_NUMBER_25(blob, length) {
        var o2 = parse_cell_3(blob);
        var v12 = blob.read_shift(4);
        o2[1].v = v12 >> 6;
        return o2;
      }
      function parse_NUMBER_27(blob, length) {
        var o2 = parse_cell_3(blob);
        var v12 = blob.read_shift(8, "f");
        o2[1].v = v12;
        return o2;
      }
      function parse_FORMULA_28(blob, length) {
        var o2 = parse_NUMBER_27(blob);
        blob.l += length - 10;
        return o2;
      }
      function parse_SHEETNAMECS(blob, length) {
        return blob[blob.l + length - 1] == 0 ? blob.read_shift(length, "cstr") : "";
      }
      function parse_SHEETNAMELP(blob, length) {
        var len2 = blob[blob.l++];
        if (len2 > length - 1) len2 = length - 1;
        var o2 = "";
        while (o2.length < len2) o2 += String.fromCharCode(blob[blob.l++]);
        return o2;
      }
      function parse_SHEETINFOQP(blob, length, opts) {
        if (!opts.qpro || length < 21) return;
        var id = blob.read_shift(1);
        blob.l += 17;
        blob.l += 1;
        blob.l += 2;
        var nm = blob.read_shift(length - 21, "cstr");
        return [id, nm];
      }
      function parse_XFORMAT(blob, length) {
        var o2 = {}, tgt = blob.l + length;
        while (blob.l < tgt) {
          var dt2 = blob.read_shift(2);
          if (dt2 == 14e3) {
            o2[dt2] = [0, ""];
            o2[dt2][0] = blob.read_shift(2);
            while (blob[blob.l]) {
              o2[dt2][1] += String.fromCharCode(blob[blob.l]);
              blob.l++;
            }
            blob.l++;
          }
        }
        return o2;
      }
      function write_XFORMAT_SHEETNAME(name, wsidx) {
        var out2 = new_buf(5 + name.length);
        out2.write_shift(2, 14e3);
        out2.write_shift(2, wsidx);
        for (var i2 = 0; i2 < name.length; ++i2) {
          var cc = name.charCodeAt(i2);
          out2[out2.l++] = cc > 127 ? 95 : cc;
        }
        out2[out2.l++] = 0;
        return out2;
      }
      var WK1Enum = {
        /*::[*/
        0: { n: "BOF", f: parseuint16 },
        /*::[*/
        1: { n: "EOF" },
        /*::[*/
        2: { n: "CALCMODE" },
        /*::[*/
        3: { n: "CALCORDER" },
        /*::[*/
        4: { n: "SPLIT" },
        /*::[*/
        5: { n: "SYNC" },
        /*::[*/
        6: { n: "RANGE", f: parse_RANGE },
        /*::[*/
        7: { n: "WINDOW1" },
        /*::[*/
        8: { n: "COLW1" },
        /*::[*/
        9: { n: "WINTWO" },
        /*::[*/
        10: { n: "COLW2" },
        /*::[*/
        11: { n: "NAME" },
        /*::[*/
        12: { n: "BLANK" },
        /*::[*/
        13: { n: "INTEGER", f: parse_INTEGER },
        /*::[*/
        14: { n: "NUMBER", f: parse_NUMBER },
        /*::[*/
        15: { n: "LABEL", f: parse_LABEL },
        /*::[*/
        16: { n: "FORMULA", f: parse_FORMULA },
        /*::[*/
        24: { n: "TABLE" },
        /*::[*/
        25: { n: "ORANGE" },
        /*::[*/
        26: { n: "PRANGE" },
        /*::[*/
        27: { n: "SRANGE" },
        /*::[*/
        28: { n: "FRANGE" },
        /*::[*/
        29: { n: "KRANGE1" },
        /*::[*/
        32: { n: "HRANGE" },
        /*::[*/
        35: { n: "KRANGE2" },
        /*::[*/
        36: { n: "PROTEC" },
        /*::[*/
        37: { n: "FOOTER" },
        /*::[*/
        38: { n: "HEADER" },
        /*::[*/
        39: { n: "SETUP" },
        /*::[*/
        40: { n: "MARGINS" },
        /*::[*/
        41: { n: "LABELFMT" },
        /*::[*/
        42: { n: "TITLES" },
        /*::[*/
        43: { n: "SHEETJS" },
        /*::[*/
        45: { n: "GRAPH" },
        /*::[*/
        46: { n: "NGRAPH" },
        /*::[*/
        47: { n: "CALCCOUNT" },
        /*::[*/
        48: { n: "UNFORMATTED" },
        /*::[*/
        49: { n: "CURSORW12" },
        /*::[*/
        50: { n: "WINDOW" },
        /*::[*/
        51: { n: "STRING", f: parse_LABEL },
        /*::[*/
        55: { n: "PASSWORD" },
        /*::[*/
        56: { n: "LOCKED" },
        /*::[*/
        60: { n: "QUERY" },
        /*::[*/
        61: { n: "QUERYNAME" },
        /*::[*/
        62: { n: "PRINT" },
        /*::[*/
        63: { n: "PRINTNAME" },
        /*::[*/
        64: { n: "GRAPH2" },
        /*::[*/
        65: { n: "GRAPHNAME" },
        /*::[*/
        66: { n: "ZOOM" },
        /*::[*/
        67: { n: "SYMSPLIT" },
        /*::[*/
        68: { n: "NSROWS" },
        /*::[*/
        69: { n: "NSCOLS" },
        /*::[*/
        70: { n: "RULER" },
        /*::[*/
        71: { n: "NNAME" },
        /*::[*/
        72: { n: "ACOMM" },
        /*::[*/
        73: { n: "AMACRO" },
        /*::[*/
        74: { n: "PARSE" },
        /*::[*/
        102: { n: "PRANGES??" },
        /*::[*/
        103: { n: "RRANGES??" },
        /*::[*/
        104: { n: "FNAME??" },
        /*::[*/
        105: { n: "MRANGES??" },
        /*::[*/
        204: { n: "SHEETNAMECS", f: parse_SHEETNAMECS },
        /*::[*/
        222: { n: "SHEETNAMELP", f: parse_SHEETNAMELP },
        /*::[*/
        65535: { n: "" }
      };
      var WK3Enum = {
        /*::[*/
        0: { n: "BOF" },
        /*::[*/
        1: { n: "EOF" },
        /*::[*/
        2: { n: "PASSWORD" },
        /*::[*/
        3: { n: "CALCSET" },
        /*::[*/
        4: { n: "WINDOWSET" },
        /*::[*/
        5: { n: "SHEETCELLPTR" },
        /*::[*/
        6: { n: "SHEETLAYOUT" },
        /*::[*/
        7: { n: "COLUMNWIDTH" },
        /*::[*/
        8: { n: "HIDDENCOLUMN" },
        /*::[*/
        9: { n: "USERRANGE" },
        /*::[*/
        10: { n: "SYSTEMRANGE" },
        /*::[*/
        11: { n: "ZEROFORCE" },
        /*::[*/
        12: { n: "SORTKEYDIR" },
        /*::[*/
        13: { n: "FILESEAL" },
        /*::[*/
        14: { n: "DATAFILLNUMS" },
        /*::[*/
        15: { n: "PRINTMAIN" },
        /*::[*/
        16: { n: "PRINTSTRING" },
        /*::[*/
        17: { n: "GRAPHMAIN" },
        /*::[*/
        18: { n: "GRAPHSTRING" },
        /*::[*/
        19: { n: "??" },
        /*::[*/
        20: { n: "ERRCELL" },
        /*::[*/
        21: { n: "NACELL" },
        /*::[*/
        22: { n: "LABEL16", f: parse_LABEL_16 },
        /*::[*/
        23: { n: "NUMBER17", f: parse_NUMBER_17 },
        /*::[*/
        24: { n: "NUMBER18", f: parse_NUMBER_18 },
        /*::[*/
        25: { n: "FORMULA19", f: parse_FORMULA_19 },
        /*::[*/
        26: { n: "FORMULA1A" },
        /*::[*/
        27: { n: "XFORMAT", f: parse_XFORMAT },
        /*::[*/
        28: { n: "DTLABELMISC" },
        /*::[*/
        29: { n: "DTLABELCELL" },
        /*::[*/
        30: { n: "GRAPHWINDOW" },
        /*::[*/
        31: { n: "CPA" },
        /*::[*/
        32: { n: "LPLAUTO" },
        /*::[*/
        33: { n: "QUERY" },
        /*::[*/
        34: { n: "HIDDENSHEET" },
        /*::[*/
        35: { n: "??" },
        /*::[*/
        37: { n: "NUMBER25", f: parse_NUMBER_25 },
        /*::[*/
        38: { n: "??" },
        /*::[*/
        39: { n: "NUMBER27", f: parse_NUMBER_27 },
        /*::[*/
        40: { n: "FORMULA28", f: parse_FORMULA_28 },
        /*::[*/
        142: { n: "??" },
        /*::[*/
        147: { n: "??" },
        /*::[*/
        150: { n: "??" },
        /*::[*/
        151: { n: "??" },
        /*::[*/
        152: { n: "??" },
        /*::[*/
        153: { n: "??" },
        /*::[*/
        154: { n: "??" },
        /*::[*/
        155: { n: "??" },
        /*::[*/
        156: { n: "??" },
        /*::[*/
        163: { n: "??" },
        /*::[*/
        174: { n: "??" },
        /*::[*/
        175: { n: "??" },
        /*::[*/
        176: { n: "??" },
        /*::[*/
        177: { n: "??" },
        /*::[*/
        184: { n: "??" },
        /*::[*/
        185: { n: "??" },
        /*::[*/
        186: { n: "??" },
        /*::[*/
        187: { n: "??" },
        /*::[*/
        188: { n: "??" },
        /*::[*/
        195: { n: "??" },
        /*::[*/
        201: { n: "??" },
        /*::[*/
        204: { n: "SHEETNAMECS", f: parse_SHEETNAMECS },
        /*::[*/
        205: { n: "??" },
        /*::[*/
        206: { n: "??" },
        /*::[*/
        207: { n: "??" },
        /*::[*/
        208: { n: "??" },
        /*::[*/
        256: { n: "??" },
        /*::[*/
        259: { n: "??" },
        /*::[*/
        260: { n: "??" },
        /*::[*/
        261: { n: "??" },
        /*::[*/
        262: { n: "??" },
        /*::[*/
        263: { n: "??" },
        /*::[*/
        265: { n: "??" },
        /*::[*/
        266: { n: "??" },
        /*::[*/
        267: { n: "??" },
        /*::[*/
        268: { n: "??" },
        /*::[*/
        270: { n: "??" },
        /*::[*/
        271: { n: "??" },
        /*::[*/
        384: { n: "??" },
        /*::[*/
        389: { n: "??" },
        /*::[*/
        390: { n: "??" },
        /*::[*/
        393: { n: "??" },
        /*::[*/
        396: { n: "??" },
        /*::[*/
        512: { n: "??" },
        /*::[*/
        514: { n: "??" },
        /*::[*/
        513: { n: "??" },
        /*::[*/
        516: { n: "??" },
        /*::[*/
        517: { n: "??" },
        /*::[*/
        640: { n: "??" },
        /*::[*/
        641: { n: "??" },
        /*::[*/
        642: { n: "??" },
        /*::[*/
        643: { n: "??" },
        /*::[*/
        644: { n: "??" },
        /*::[*/
        645: { n: "??" },
        /*::[*/
        646: { n: "??" },
        /*::[*/
        647: { n: "??" },
        /*::[*/
        648: { n: "??" },
        /*::[*/
        658: { n: "??" },
        /*::[*/
        659: { n: "??" },
        /*::[*/
        660: { n: "??" },
        /*::[*/
        661: { n: "??" },
        /*::[*/
        662: { n: "??" },
        /*::[*/
        665: { n: "??" },
        /*::[*/
        666: { n: "??" },
        /*::[*/
        768: { n: "??" },
        /*::[*/
        772: { n: "??" },
        /*::[*/
        1537: { n: "SHEETINFOQP", f: parse_SHEETINFOQP },
        /*::[*/
        1600: { n: "??" },
        /*::[*/
        1602: { n: "??" },
        /*::[*/
        1793: { n: "??" },
        /*::[*/
        1794: { n: "??" },
        /*::[*/
        1795: { n: "??" },
        /*::[*/
        1796: { n: "??" },
        /*::[*/
        1920: { n: "??" },
        /*::[*/
        2048: { n: "??" },
        /*::[*/
        2049: { n: "??" },
        /*::[*/
        2052: { n: "??" },
        /*::[*/
        2688: { n: "??" },
        /*::[*/
        10998: { n: "??" },
        /*::[*/
        12849: { n: "??" },
        /*::[*/
        28233: { n: "??" },
        /*::[*/
        28484: { n: "??" },
        /*::[*/
        65535: { n: "" }
      };
      return {
        sheet_to_wk1,
        book_to_wk3,
        to_workbook: lotus_to_workbook
      };
    }();
    var straywsregex = /^\s|\s$|[\t\n\r]/;
    function write_sst_xml(sst, opts) {
      if (!opts.bookSST) return "";
      var o2 = [XML_HEADER];
      o2[o2.length] = writextag("sst", null, {
        xmlns: XMLNS_main[0],
        count: sst.Count,
        uniqueCount: sst.Unique
      });
      for (var i2 = 0; i2 != sst.length; ++i2) {
        if (sst[i2] == null) continue;
        var s2 = sst[i2];
        var sitag = "<si>";
        if (s2.r) sitag += s2.r;
        else {
          sitag += "<t";
          if (!s2.t) s2.t = "";
          if (s2.t.match(straywsregex)) sitag += ' xml:space="preserve"';
          sitag += ">" + escapexml(s2.t) + "</t>";
        }
        sitag += "</si>";
        o2[o2.length] = sitag;
      }
      if (o2.length > 2) {
        o2[o2.length] = "</sst>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function parse_BrtBeginSst(data) {
      return [data.read_shift(4), data.read_shift(4)];
    }
    function write_BrtBeginSst(sst, o2) {
      if (!o2) o2 = new_buf(8);
      o2.write_shift(4, sst.Count);
      o2.write_shift(4, sst.Unique);
      return o2;
    }
    var write_BrtSSTItem = write_RichStr;
    function write_sst_bin(sst) {
      var ba = buf_array();
      write_record(ba, 159, write_BrtBeginSst(sst));
      for (var i2 = 0; i2 < sst.length; ++i2) write_record(ba, 19, write_BrtSSTItem(sst[i2]));
      write_record(
        ba,
        160
        /* BrtEndSst */
      );
      return ba.end();
    }
    function _JS2ANSI(str) {
      var o2 = [], oo = str.split("");
      for (var i2 = 0; i2 < oo.length; ++i2) o2[i2] = oo[i2].charCodeAt(0);
      return o2;
    }
    function crypto_CreatePasswordVerifier_Method1(Password) {
      var Verifier = 0, PasswordArray;
      var PasswordDecoded = _JS2ANSI(Password);
      var len2 = PasswordDecoded.length + 1, i2, PasswordByte;
      var Intermediate1, Intermediate2, Intermediate3;
      PasswordArray = new_raw_buf(len2);
      PasswordArray[0] = PasswordDecoded.length;
      for (i2 = 1; i2 != len2; ++i2) PasswordArray[i2] = PasswordDecoded[i2 - 1];
      for (i2 = len2 - 1; i2 >= 0; --i2) {
        PasswordByte = PasswordArray[i2];
        Intermediate1 = (Verifier & 16384) === 0 ? 0 : 1;
        Intermediate2 = Verifier << 1 & 32767;
        Intermediate3 = Intermediate1 | Intermediate2;
        Verifier = Intermediate3 ^ PasswordByte;
      }
      return Verifier ^ 52811;
    }
    var RTF = /* @__PURE__ */ function() {
      function rtf_to_sheet(d2, opts) {
        switch (opts.type) {
          case "base64":
            return rtf_to_sheet_str(Base64_decode(d2), opts);
          case "binary":
            return rtf_to_sheet_str(d2, opts);
          case "buffer":
            return rtf_to_sheet_str(has_buf && Buffer.isBuffer(d2) ? d2.toString("binary") : a2s(d2), opts);
          case "array":
            return rtf_to_sheet_str(cc2str(d2), opts);
        }
        throw new Error("Unrecognized type " + opts.type);
      }
      function rtf_to_sheet_str(str, opts) {
        var o2 = opts || {};
        var ws = o2.dense ? [] : {};
        var rows = str.match(/\\trowd.*?\\row\b/g);
        if (!rows.length) throw new Error("RTF missing table");
        var range2 = { s: { c: 0, r: 0 }, e: { c: 0, r: rows.length - 1 } };
        rows.forEach(function(rowtf, R2) {
          if (Array.isArray(ws)) ws[R2] = [];
          var rtfre = /\\\w+\b/g;
          var last_index = 0;
          var res;
          var C2 = -1;
          while (res = rtfre.exec(rowtf)) {
            switch (res[0]) {
              case "\\cell":
                var data = rowtf.slice(last_index, rtfre.lastIndex - res[0].length);
                if (data[0] == " ") data = data.slice(1);
                ++C2;
                if (data.length) {
                  var cell = { v: data, t: "s" };
                  if (Array.isArray(ws)) ws[R2][C2] = cell;
                  else ws[encode_cell({ r: R2, c: C2 })] = cell;
                }
                break;
            }
            last_index = rtfre.lastIndex;
          }
          if (C2 > range2.e.c) range2.e.c = C2;
        });
        ws["!ref"] = encode_range(range2);
        return ws;
      }
      function rtf_to_workbook(d2, opts) {
        return sheet_to_workbook(rtf_to_sheet(d2, opts), opts);
      }
      function sheet_to_rtf(ws) {
        var o2 = ["{\\rtf1\\ansi"];
        var r = safe_decode_range(ws["!ref"]), cell;
        var dense = Array.isArray(ws);
        for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
          o2.push("\\trowd\\trautofit1");
          for (var C2 = r.s.c; C2 <= r.e.c; ++C2) o2.push("\\cellx" + (C2 + 1));
          o2.push("\\pard\\intbl");
          for (C2 = r.s.c; C2 <= r.e.c; ++C2) {
            var coord = encode_cell({ r: R2, c: C2 });
            cell = dense ? (ws[R2] || [])[C2] : ws[coord];
            if (!cell || cell.v == null && (!cell.f || cell.F)) continue;
            o2.push(" " + (cell.w || (format_cell(cell), cell.w)));
            o2.push("\\cell");
          }
          o2.push("\\pard\\intbl\\row");
        }
        return o2.join("") + "}";
      }
      return {
        to_workbook: rtf_to_workbook,
        to_sheet: rtf_to_sheet,
        from_sheet: sheet_to_rtf
      };
    }();
    function rgb2Hex(rgb2) {
      for (var i2 = 0, o2 = 1; i2 != 3; ++i2) o2 = o2 * 256 + (rgb2[i2] > 255 ? 255 : rgb2[i2] < 0 ? 0 : rgb2[i2]);
      return o2.toString(16).toUpperCase().slice(1);
    }
    var DEF_MDW = 6, MDW = DEF_MDW;
    function width2px(width) {
      return Math.floor((width + Math.round(128 / MDW) / 256) * MDW);
    }
    function px2char(px) {
      return Math.floor((px - 5) / MDW * 100 + 0.5) / 100;
    }
    function char2width(chr) {
      return Math.round((chr * MDW + 5) / MDW * 256) / 256;
    }
    function process_col(coll) {
      if (coll.width) {
        coll.wpx = width2px(coll.width);
        coll.wch = px2char(coll.wpx);
        coll.MDW = MDW;
      } else if (coll.wpx) {
        coll.wch = px2char(coll.wpx);
        coll.width = char2width(coll.wch);
        coll.MDW = MDW;
      } else if (typeof coll.wch == "number") {
        coll.width = char2width(coll.wch);
        coll.wpx = width2px(coll.width);
        coll.MDW = MDW;
      }
      if (coll.customWidth) delete coll.customWidth;
    }
    var DEF_PPI = 96, PPI = DEF_PPI;
    function px2pt(px) {
      return px * 96 / PPI;
    }
    function pt2px(pt3) {
      return pt3 * PPI / 96;
    }
    function write_numFmts(NF) {
      var o2 = ["<numFmts>"];
      [[5, 8], [23, 26], [41, 44], [
        /*63*/
        50,
        /*66],[164,*/
        392
      ]].forEach(function(r) {
        for (var i2 = r[0]; i2 <= r[1]; ++i2) if (NF[i2] != null) o2[o2.length] = writextag("numFmt", null, { numFmtId: i2, formatCode: escapexml(NF[i2]) });
      });
      if (o2.length === 1) return "";
      o2[o2.length] = "</numFmts>";
      o2[0] = writextag("numFmts", null, { count: o2.length - 2 }).replace("/>", ">");
      return o2.join("");
    }
    function write_cellXfs(cellXfs) {
      var o2 = [];
      o2[o2.length] = writextag("cellXfs", null);
      cellXfs.forEach(function(c2) {
        o2[o2.length] = writextag("xf", null, c2);
      });
      o2[o2.length] = "</cellXfs>";
      if (o2.length === 2) return "";
      o2[0] = writextag("cellXfs", null, { count: o2.length - 2 }).replace("/>", ">");
      return o2.join("");
    }
    function write_sty_xml(wb, opts) {
      var o2 = [XML_HEADER, writextag("styleSheet", null, {
        "xmlns": XMLNS_main[0],
        "xmlns:vt": XMLNS.vt
      })], w2;
      if (wb.SSF && (w2 = write_numFmts(wb.SSF)) != null) o2[o2.length] = w2;
      o2[o2.length] = '<fonts count="1"><font><sz val="12"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/></font></fonts>';
      o2[o2.length] = '<fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills>';
      o2[o2.length] = '<borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders>';
      o2[o2.length] = '<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs>';
      if (w2 = write_cellXfs(opts.cellXfs)) o2[o2.length] = w2;
      o2[o2.length] = '<cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>';
      o2[o2.length] = '<dxfs count="0"/>';
      o2[o2.length] = '<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleMedium4"/>';
      if (o2.length > 2) {
        o2[o2.length] = "</styleSheet>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function parse_BrtFmt(data, length) {
      var numFmtId = data.read_shift(2);
      var stFmtCode = parse_XLWideString(data);
      return [numFmtId, stFmtCode];
    }
    function write_BrtFmt(i2, f2, o2) {
      if (!o2) o2 = new_buf(6 + 4 * f2.length);
      o2.write_shift(2, i2);
      write_XLWideString(f2, o2);
      var out2 = o2.length > o2.l ? o2.slice(0, o2.l) : o2;
      if (o2.l == null) o2.l = o2.length;
      return out2;
    }
    function parse_BrtFont(data, length, opts) {
      var out2 = {};
      out2.sz = data.read_shift(2) / 20;
      var grbit = parse_FontFlags(data);
      if (grbit.fItalic) out2.italic = 1;
      if (grbit.fCondense) out2.condense = 1;
      if (grbit.fExtend) out2.extend = 1;
      if (grbit.fShadow) out2.shadow = 1;
      if (grbit.fOutline) out2.outline = 1;
      if (grbit.fStrikeout) out2.strike = 1;
      var bls = data.read_shift(2);
      if (bls === 700) out2.bold = 1;
      switch (data.read_shift(2)) {
        /* case 0: out.vertAlign = "baseline"; break; */
        case 1:
          out2.vertAlign = "superscript";
          break;
        case 2:
          out2.vertAlign = "subscript";
          break;
      }
      var underline = data.read_shift(1);
      if (underline != 0) out2.underline = underline;
      var family = data.read_shift(1);
      if (family > 0) out2.family = family;
      var bCharSet = data.read_shift(1);
      if (bCharSet > 0) out2.charset = bCharSet;
      data.l++;
      out2.color = parse_BrtColor(data);
      switch (data.read_shift(1)) {
        /* case 0: out.scheme = "none": break; */
        case 1:
          out2.scheme = "major";
          break;
        case 2:
          out2.scheme = "minor";
          break;
      }
      out2.name = parse_XLWideString(data);
      return out2;
    }
    function write_BrtFont(font, o2) {
      if (!o2) o2 = new_buf(25 + 4 * 32);
      o2.write_shift(2, font.sz * 20);
      write_FontFlags(font, o2);
      o2.write_shift(2, font.bold ? 700 : 400);
      var sss = 0;
      if (font.vertAlign == "superscript") sss = 1;
      else if (font.vertAlign == "subscript") sss = 2;
      o2.write_shift(2, sss);
      o2.write_shift(1, font.underline || 0);
      o2.write_shift(1, font.family || 0);
      o2.write_shift(1, font.charset || 0);
      o2.write_shift(1, 0);
      write_BrtColor(font.color, o2);
      var scheme = 0;
      scheme = 2;
      o2.write_shift(1, scheme);
      write_XLWideString(font.name, o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    var XLSBFillPTNames = [
      "none",
      "solid",
      "mediumGray",
      "darkGray",
      "lightGray",
      "darkHorizontal",
      "darkVertical",
      "darkDown",
      "darkUp",
      "darkGrid",
      "darkTrellis",
      "lightHorizontal",
      "lightVertical",
      "lightDown",
      "lightUp",
      "lightGrid",
      "lightTrellis",
      "gray125",
      "gray0625"
    ];
    var rev_XLSBFillPTNames;
    var parse_BrtFill = parsenoop;
    function write_BrtFill(fill2, o2) {
      if (!o2) o2 = new_buf(4 * 3 + 8 * 7 + 16 * 1);
      if (!rev_XLSBFillPTNames) rev_XLSBFillPTNames = evert(XLSBFillPTNames);
      var fls = rev_XLSBFillPTNames[fill2.patternType];
      if (fls == null) fls = 40;
      o2.write_shift(4, fls);
      var j = 0;
      if (fls != 40) {
        write_BrtColor({ auto: 1 }, o2);
        write_BrtColor({ auto: 1 }, o2);
        for (; j < 12; ++j) o2.write_shift(4, 0);
      } else {
        for (; j < 4; ++j) o2.write_shift(4, 0);
        for (; j < 12; ++j) o2.write_shift(4, 0);
      }
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function parse_BrtXF(data, length) {
      var tgt = data.l + length;
      var ixfeParent = data.read_shift(2);
      var ifmt = data.read_shift(2);
      data.l = tgt;
      return { ixfe: ixfeParent, numFmtId: ifmt };
    }
    function write_BrtXF(data, ixfeP, o2) {
      if (!o2) o2 = new_buf(16);
      o2.write_shift(2, ixfeP || 0);
      o2.write_shift(2, data.numFmtId || 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      var flow = 0;
      o2.write_shift(1, flow);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      return o2;
    }
    function write_Blxf(data, o2) {
      if (!o2) o2 = new_buf(10);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      return o2;
    }
    var parse_BrtBorder = parsenoop;
    function write_BrtBorder(border, o2) {
      if (!o2) o2 = new_buf(51);
      o2.write_shift(1, 0);
      write_Blxf(null, o2);
      write_Blxf(null, o2);
      write_Blxf(null, o2);
      write_Blxf(null, o2);
      write_Blxf(null, o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_BrtStyle(style, o2) {
      if (!o2) o2 = new_buf(12 + 4 * 10);
      o2.write_shift(4, style.xfId);
      o2.write_shift(2, 1);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      write_XLNullableWideString(style.name || "", o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) {
      var o2 = new_buf(4 + 256 * 2 * 4);
      o2.write_shift(4, cnt);
      write_XLNullableWideString(defTableStyle, o2);
      write_XLNullableWideString(defPivotStyle, o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_FMTS_bin(ba, NF) {
      if (!NF) return;
      var cnt = 0;
      [[5, 8], [23, 26], [41, 44], [
        /*63*/
        50,
        /*66],[164,*/
        392
      ]].forEach(function(r) {
        for (var i2 = r[0]; i2 <= r[1]; ++i2) if (NF[i2] != null) ++cnt;
      });
      if (cnt == 0) return;
      write_record(ba, 615, write_UInt32LE(cnt));
      [[5, 8], [23, 26], [41, 44], [
        /*63*/
        50,
        /*66],[164,*/
        392
      ]].forEach(function(r) {
        for (var i2 = r[0]; i2 <= r[1]; ++i2) if (NF[i2] != null) write_record(ba, 44, write_BrtFmt(i2, NF[i2]));
      });
      write_record(
        ba,
        616
        /* BrtEndFmts */
      );
    }
    function write_FONTS_bin(ba) {
      var cnt = 1;
      write_record(ba, 611, write_UInt32LE(cnt));
      write_record(ba, 43, write_BrtFont({
        sz: 12,
        color: { theme: 1 },
        name: "Calibri",
        family: 2
      }));
      write_record(
        ba,
        612
        /* BrtEndFonts */
      );
    }
    function write_FILLS_bin(ba) {
      var cnt = 2;
      write_record(ba, 603, write_UInt32LE(cnt));
      write_record(ba, 45, write_BrtFill({ patternType: "none" }));
      write_record(ba, 45, write_BrtFill({ patternType: "gray125" }));
      write_record(
        ba,
        604
        /* BrtEndFills */
      );
    }
    function write_BORDERS_bin(ba) {
      var cnt = 1;
      write_record(ba, 613, write_UInt32LE(cnt));
      write_record(ba, 46, write_BrtBorder());
      write_record(
        ba,
        614
        /* BrtEndBorders */
      );
    }
    function write_CELLSTYLEXFS_bin(ba) {
      var cnt = 1;
      write_record(ba, 626, write_UInt32LE(cnt));
      write_record(ba, 47, write_BrtXF({
        numFmtId: 0
      }, 65535));
      write_record(
        ba,
        627
        /* BrtEndCellStyleXFs */
      );
    }
    function write_CELLXFS_bin(ba, data) {
      write_record(ba, 617, write_UInt32LE(data.length));
      data.forEach(function(c2) {
        write_record(ba, 47, write_BrtXF(c2, 0));
      });
      write_record(
        ba,
        618
        /* BrtEndCellXFs */
      );
    }
    function write_STYLES_bin(ba) {
      var cnt = 1;
      write_record(ba, 619, write_UInt32LE(cnt));
      write_record(ba, 48, write_BrtStyle({
        xfId: 0,
        name: "Normal"
      }));
      write_record(
        ba,
        620
        /* BrtEndStyles */
      );
    }
    function write_DXFS_bin(ba) {
      var cnt = 0;
      write_record(ba, 505, write_UInt32LE(cnt));
      write_record(
        ba,
        506
        /* BrtEndDXFs */
      );
    }
    function write_TABLESTYLES_bin(ba) {
      var cnt = 0;
      write_record(ba, 508, write_BrtBeginTableStyles(cnt, "TableStyleMedium9", "PivotStyleMedium4"));
      write_record(
        ba,
        509
        /* BrtEndTableStyles */
      );
    }
    function write_sty_bin(wb, opts) {
      var ba = buf_array();
      write_record(
        ba,
        278
        /* BrtBeginStyleSheet */
      );
      write_FMTS_bin(ba, wb.SSF);
      write_FONTS_bin(ba);
      write_FILLS_bin(ba);
      write_BORDERS_bin(ba);
      write_CELLSTYLEXFS_bin(ba);
      write_CELLXFS_bin(ba, opts.cellXfs);
      write_STYLES_bin(ba);
      write_DXFS_bin(ba);
      write_TABLESTYLES_bin(ba);
      write_record(
        ba,
        279
        /* BrtEndStyleSheet */
      );
      return ba.end();
    }
    function write_theme(Themes, opts) {
      if (opts && opts.themeXLSX) return opts.themeXLSX;
      if (Themes && typeof Themes.raw == "string") return Themes.raw;
      var o2 = [XML_HEADER];
      o2[o2.length] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">';
      o2[o2.length] = "<a:themeElements>";
      o2[o2.length] = '<a:clrScheme name="Office">';
      o2[o2.length] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>';
      o2[o2.length] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>';
      o2[o2.length] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>';
      o2[o2.length] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>';
      o2[o2.length] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>';
      o2[o2.length] = '<a:accent2><a:srgbClr val="C0504D"/></a:accent2>';
      o2[o2.length] = '<a:accent3><a:srgbClr val="9BBB59"/></a:accent3>';
      o2[o2.length] = '<a:accent4><a:srgbClr val="8064A2"/></a:accent4>';
      o2[o2.length] = '<a:accent5><a:srgbClr val="4BACC6"/></a:accent5>';
      o2[o2.length] = '<a:accent6><a:srgbClr val="F79646"/></a:accent6>';
      o2[o2.length] = '<a:hlink><a:srgbClr val="0000FF"/></a:hlink>';
      o2[o2.length] = '<a:folHlink><a:srgbClr val="800080"/></a:folHlink>';
      o2[o2.length] = "</a:clrScheme>";
      o2[o2.length] = '<a:fontScheme name="Office">';
      o2[o2.length] = "<a:majorFont>";
      o2[o2.length] = '<a:latin typeface="Cambria"/>';
      o2[o2.length] = '<a:ea typeface=""/>';
      o2[o2.length] = '<a:cs typeface=""/>';
      o2[o2.length] = '<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>';
      o2[o2.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
      o2[o2.length] = '<a:font script="Hans" typeface="宋体"/>';
      o2[o2.length] = '<a:font script="Hant" typeface="新細明體"/>';
      o2[o2.length] = '<a:font script="Arab" typeface="Times New Roman"/>';
      o2[o2.length] = '<a:font script="Hebr" typeface="Times New Roman"/>';
      o2[o2.length] = '<a:font script="Thai" typeface="Tahoma"/>';
      o2[o2.length] = '<a:font script="Ethi" typeface="Nyala"/>';
      o2[o2.length] = '<a:font script="Beng" typeface="Vrinda"/>';
      o2[o2.length] = '<a:font script="Gujr" typeface="Shruti"/>';
      o2[o2.length] = '<a:font script="Khmr" typeface="MoolBoran"/>';
      o2[o2.length] = '<a:font script="Knda" typeface="Tunga"/>';
      o2[o2.length] = '<a:font script="Guru" typeface="Raavi"/>';
      o2[o2.length] = '<a:font script="Cans" typeface="Euphemia"/>';
      o2[o2.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
      o2[o2.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
      o2[o2.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
      o2[o2.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
      o2[o2.length] = '<a:font script="Deva" typeface="Mangal"/>';
      o2[o2.length] = '<a:font script="Telu" typeface="Gautami"/>';
      o2[o2.length] = '<a:font script="Taml" typeface="Latha"/>';
      o2[o2.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
      o2[o2.length] = '<a:font script="Orya" typeface="Kalinga"/>';
      o2[o2.length] = '<a:font script="Mlym" typeface="Kartika"/>';
      o2[o2.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
      o2[o2.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
      o2[o2.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
      o2[o2.length] = '<a:font script="Viet" typeface="Times New Roman"/>';
      o2[o2.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
      o2[o2.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
      o2[o2.length] = "</a:majorFont>";
      o2[o2.length] = "<a:minorFont>";
      o2[o2.length] = '<a:latin typeface="Calibri"/>';
      o2[o2.length] = '<a:ea typeface=""/>';
      o2[o2.length] = '<a:cs typeface=""/>';
      o2[o2.length] = '<a:font script="Jpan" typeface="ＭＳ Ｐゴシック"/>';
      o2[o2.length] = '<a:font script="Hang" typeface="맑은 고딕"/>';
      o2[o2.length] = '<a:font script="Hans" typeface="宋体"/>';
      o2[o2.length] = '<a:font script="Hant" typeface="新細明體"/>';
      o2[o2.length] = '<a:font script="Arab" typeface="Arial"/>';
      o2[o2.length] = '<a:font script="Hebr" typeface="Arial"/>';
      o2[o2.length] = '<a:font script="Thai" typeface="Tahoma"/>';
      o2[o2.length] = '<a:font script="Ethi" typeface="Nyala"/>';
      o2[o2.length] = '<a:font script="Beng" typeface="Vrinda"/>';
      o2[o2.length] = '<a:font script="Gujr" typeface="Shruti"/>';
      o2[o2.length] = '<a:font script="Khmr" typeface="DaunPenh"/>';
      o2[o2.length] = '<a:font script="Knda" typeface="Tunga"/>';
      o2[o2.length] = '<a:font script="Guru" typeface="Raavi"/>';
      o2[o2.length] = '<a:font script="Cans" typeface="Euphemia"/>';
      o2[o2.length] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>';
      o2[o2.length] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>';
      o2[o2.length] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>';
      o2[o2.length] = '<a:font script="Thaa" typeface="MV Boli"/>';
      o2[o2.length] = '<a:font script="Deva" typeface="Mangal"/>';
      o2[o2.length] = '<a:font script="Telu" typeface="Gautami"/>';
      o2[o2.length] = '<a:font script="Taml" typeface="Latha"/>';
      o2[o2.length] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>';
      o2[o2.length] = '<a:font script="Orya" typeface="Kalinga"/>';
      o2[o2.length] = '<a:font script="Mlym" typeface="Kartika"/>';
      o2[o2.length] = '<a:font script="Laoo" typeface="DokChampa"/>';
      o2[o2.length] = '<a:font script="Sinh" typeface="Iskoola Pota"/>';
      o2[o2.length] = '<a:font script="Mong" typeface="Mongolian Baiti"/>';
      o2[o2.length] = '<a:font script="Viet" typeface="Arial"/>';
      o2[o2.length] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>';
      o2[o2.length] = '<a:font script="Geor" typeface="Sylfaen"/>';
      o2[o2.length] = "</a:minorFont>";
      o2[o2.length] = "</a:fontScheme>";
      o2[o2.length] = '<a:fmtScheme name="Office">';
      o2[o2.length] = "<a:fillStyleLst>";
      o2[o2.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
      o2[o2.length] = '<a:gradFill rotWithShape="1">';
      o2[o2.length] = "<a:gsLst>";
      o2[o2.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
      o2[o2.length] = "</a:gsLst>";
      o2[o2.length] = '<a:lin ang="16200000" scaled="1"/>';
      o2[o2.length] = "</a:gradFill>";
      o2[o2.length] = '<a:gradFill rotWithShape="1">';
      o2[o2.length] = "<a:gsLst>";
      o2[o2.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
      o2[o2.length] = "</a:gsLst>";
      o2[o2.length] = '<a:lin ang="16200000" scaled="0"/>';
      o2[o2.length] = "</a:gradFill>";
      o2[o2.length] = "</a:fillStyleLst>";
      o2[o2.length] = "<a:lnStyleLst>";
      o2[o2.length] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>';
      o2[o2.length] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
      o2[o2.length] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>';
      o2[o2.length] = "</a:lnStyleLst>";
      o2[o2.length] = "<a:effectStyleLst>";
      o2[o2.length] = "<a:effectStyle>";
      o2[o2.length] = "<a:effectLst>";
      o2[o2.length] = '<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="38000"/></a:srgbClr></a:outerShdw>';
      o2[o2.length] = "</a:effectLst>";
      o2[o2.length] = "</a:effectStyle>";
      o2[o2.length] = "<a:effectStyle>";
      o2[o2.length] = "<a:effectLst>";
      o2[o2.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
      o2[o2.length] = "</a:effectLst>";
      o2[o2.length] = "</a:effectStyle>";
      o2[o2.length] = "<a:effectStyle>";
      o2[o2.length] = "<a:effectLst>";
      o2[o2.length] = '<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="35000"/></a:srgbClr></a:outerShdw>';
      o2[o2.length] = "</a:effectLst>";
      o2[o2.length] = '<a:scene3d><a:camera prst="orthographicFront"><a:rot lat="0" lon="0" rev="0"/></a:camera><a:lightRig rig="threePt" dir="t"><a:rot lat="0" lon="0" rev="1200000"/></a:lightRig></a:scene3d>';
      o2[o2.length] = '<a:sp3d><a:bevelT w="63500" h="25400"/></a:sp3d>';
      o2[o2.length] = "</a:effectStyle>";
      o2[o2.length] = "</a:effectStyleLst>";
      o2[o2.length] = "<a:bgFillStyleLst>";
      o2[o2.length] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>';
      o2[o2.length] = '<a:gradFill rotWithShape="1">';
      o2[o2.length] = "<a:gsLst>";
      o2[o2.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="40000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="40000"><a:schemeClr val="phClr"><a:tint val="45000"/><a:shade val="99000"/><a:satMod val="350000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="20000"/><a:satMod val="255000"/></a:schemeClr></a:gs>';
      o2[o2.length] = "</a:gsLst>";
      o2[o2.length] = '<a:path path="circle"><a:fillToRect l="50000" t="-80000" r="50000" b="180000"/></a:path>';
      o2[o2.length] = "</a:gradFill>";
      o2[o2.length] = '<a:gradFill rotWithShape="1">';
      o2[o2.length] = "<a:gsLst>";
      o2[o2.length] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="80000"/><a:satMod val="300000"/></a:schemeClr></a:gs>';
      o2[o2.length] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="30000"/><a:satMod val="200000"/></a:schemeClr></a:gs>';
      o2[o2.length] = "</a:gsLst>";
      o2[o2.length] = '<a:path path="circle"><a:fillToRect l="50000" t="50000" r="50000" b="50000"/></a:path>';
      o2[o2.length] = "</a:gradFill>";
      o2[o2.length] = "</a:bgFillStyleLst>";
      o2[o2.length] = "</a:fmtScheme>";
      o2[o2.length] = "</a:themeElements>";
      o2[o2.length] = "<a:objectDefaults>";
      o2[o2.length] = "<a:spDef>";
      o2[o2.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="1"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="3"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="2"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="lt1"/></a:fontRef></a:style>';
      o2[o2.length] = "</a:spDef>";
      o2[o2.length] = "<a:lnDef>";
      o2[o2.length] = '<a:spPr/><a:bodyPr/><a:lstStyle/><a:style><a:lnRef idx="2"><a:schemeClr val="accent1"/></a:lnRef><a:fillRef idx="0"><a:schemeClr val="accent1"/></a:fillRef><a:effectRef idx="1"><a:schemeClr val="accent1"/></a:effectRef><a:fontRef idx="minor"><a:schemeClr val="tx1"/></a:fontRef></a:style>';
      o2[o2.length] = "</a:lnDef>";
      o2[o2.length] = "</a:objectDefaults>";
      o2[o2.length] = "<a:extraClrSchemeLst/>";
      o2[o2.length] = "</a:theme>";
      return o2.join("");
    }
    function parse_BrtMdtinfo(data, length) {
      return {
        flags: data.read_shift(4),
        version: data.read_shift(4),
        name: parse_XLWideString(data)
      };
    }
    function write_BrtMdtinfo(data) {
      var o2 = new_buf(12 + 2 * data.name.length);
      o2.write_shift(4, data.flags);
      o2.write_shift(4, data.version);
      write_XLWideString(data.name, o2);
      return o2.slice(0, o2.l);
    }
    function parse_BrtMdb(data) {
      var out2 = [];
      var cnt = data.read_shift(4);
      while (cnt-- > 0)
        out2.push([data.read_shift(4), data.read_shift(4)]);
      return out2;
    }
    function write_BrtMdb(mdb) {
      var o2 = new_buf(4 + 8 * mdb.length);
      o2.write_shift(4, mdb.length);
      for (var i2 = 0; i2 < mdb.length; ++i2) {
        o2.write_shift(4, mdb[i2][0]);
        o2.write_shift(4, mdb[i2][1]);
      }
      return o2;
    }
    function write_BrtBeginEsfmd(cnt, name) {
      var o2 = new_buf(8 + 2 * name.length);
      o2.write_shift(4, cnt);
      write_XLWideString(name, o2);
      return o2.slice(0, o2.l);
    }
    function parse_BrtBeginEsmdb(data) {
      data.l += 4;
      return data.read_shift(4) != 0;
    }
    function write_BrtBeginEsmdb(cnt, cm) {
      var o2 = new_buf(8);
      o2.write_shift(4, cnt);
      o2.write_shift(4, 1);
      return o2;
    }
    function write_xlmeta_bin() {
      var ba = buf_array();
      write_record(ba, 332);
      write_record(ba, 334, write_UInt32LE(1));
      write_record(ba, 335, write_BrtMdtinfo({
        name: "XLDAPR",
        version: 12e4,
        flags: 3496657072
      }));
      write_record(ba, 336);
      write_record(ba, 339, write_BrtBeginEsfmd(1, "XLDAPR"));
      write_record(ba, 52);
      write_record(ba, 35, write_UInt32LE(514));
      write_record(ba, 4096, write_UInt32LE(0));
      write_record(ba, 4097, writeuint16(1));
      write_record(ba, 36);
      write_record(ba, 53);
      write_record(ba, 340);
      write_record(ba, 337, write_BrtBeginEsmdb(1));
      write_record(ba, 51, write_BrtMdb([[1, 0]]));
      write_record(ba, 338);
      write_record(ba, 333);
      return ba.end();
    }
    function write_xlmeta_xml() {
      var o2 = [XML_HEADER];
      o2.push('<metadata xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:xlrd="http://schemas.microsoft.com/office/spreadsheetml/2017/richdata" xmlns:xda="http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray">\n  <metadataTypes count="1">\n    <metadataType name="XLDAPR" minSupportedVersion="120000" copy="1" pasteAll="1" pasteValues="1" merge="1" splitFirst="1" rowColShift="1" clearFormats="1" clearComments="1" assign="1" coerce="1" cellMeta="1"/>\n  </metadataTypes>\n  <futureMetadata name="XLDAPR" count="1">\n    <bk>\n      <extLst>\n        <ext uri="{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}">\n          <xda:dynamicArrayProperties fDynamic="1" fCollapsed="0"/>\n        </ext>\n      </extLst>\n    </bk>\n  </futureMetadata>\n  <cellMetadata count="1">\n    <bk>\n      <rc t="1" v="0"/>\n    </bk>\n  </cellMetadata>\n</metadata>');
      return o2.join("");
    }
    function parse_BrtCalcChainItem$(data) {
      var out2 = {};
      out2.i = data.read_shift(4);
      var cell = {};
      cell.r = data.read_shift(4);
      cell.c = data.read_shift(4);
      out2.r = encode_cell(cell);
      var flags = data.read_shift(1);
      if (flags & 2) out2.l = "1";
      if (flags & 8) out2.a = "1";
      return out2;
    }
    var _shapeid = 1024;
    function write_comments_vml(rId, comments) {
      var csize = [21600, 21600];
      var bbox = ["m0,0l0", csize[1], csize[0], csize[1], csize[0], "0xe"].join(",");
      var o2 = [
        writextag("xml", null, { "xmlns:v": XLMLNS.v, "xmlns:o": XLMLNS.o, "xmlns:x": XLMLNS.x, "xmlns:mv": XLMLNS.mv }).replace(/\/>/, ">"),
        writextag("o:shapelayout", writextag("o:idmap", null, { "v:ext": "edit", "data": rId }), { "v:ext": "edit" }),
        writextag("v:shapetype", [
          writextag("v:stroke", null, { joinstyle: "miter" }),
          writextag("v:path", null, { gradientshapeok: "t", "o:connecttype": "rect" })
        ].join(""), { id: "_x0000_t202", "o:spt": 202, coordsize: csize.join(","), path: bbox })
      ];
      while (_shapeid < rId * 1e3) _shapeid += 1e3;
      comments.forEach(function(x2) {
        var c2 = decode_cell(x2[0]);
        var fillopts = (
          /*::(*/
          { "color2": "#BEFF82", "type": "gradient" }
        );
        if (fillopts.type == "gradient") fillopts.angle = "-180";
        var fillparm = fillopts.type == "gradient" ? writextag("o:fill", null, { type: "gradientUnscaled", "v:ext": "view" }) : null;
        var fillxml = writextag("v:fill", fillparm, fillopts);
        var shadata = { on: "t", "obscured": "t" };
        ++_shapeid;
        o2 = o2.concat([
          "<v:shape" + wxt_helper({
            id: "_x0000_s" + _shapeid,
            type: "#_x0000_t202",
            style: "position:absolute; margin-left:80pt;margin-top:5pt;width:104pt;height:64pt;z-index:10" + (x2[1].hidden ? ";visibility:hidden" : ""),
            fillcolor: "#ECFAD4",
            strokecolor: "#edeaa1"
          }) + ">",
          fillxml,
          writextag("v:shadow", null, shadata),
          writextag("v:path", null, { "o:connecttype": "none" }),
          '<v:textbox><div style="text-align:left"></div></v:textbox>',
          '<x:ClientData ObjectType="Note">',
          "<x:MoveWithCells/>",
          "<x:SizeWithCells/>",
          /* Part 4 19.4.2.3 Anchor (Anchor) */
          writetag("x:Anchor", [c2.c + 1, 0, c2.r + 1, 0, c2.c + 3, 20, c2.r + 5, 20].join(",")),
          writetag("x:AutoFill", "False"),
          writetag("x:Row", String(c2.r)),
          writetag("x:Column", String(c2.c)),
          x2[1].hidden ? "" : "<x:Visible/>",
          "</x:ClientData>",
          "</v:shape>"
        ]);
      });
      o2.push("</xml>");
      return o2.join("");
    }
    function write_comments_xml(data) {
      var o2 = [XML_HEADER, writextag("comments", null, { "xmlns": XMLNS_main[0] })];
      var iauthor = [];
      o2.push("<authors>");
      data.forEach(function(x2) {
        x2[1].forEach(function(w2) {
          var a2 = escapexml(w2.a);
          if (iauthor.indexOf(a2) == -1) {
            iauthor.push(a2);
            o2.push("<author>" + a2 + "</author>");
          }
          if (w2.T && w2.ID && iauthor.indexOf("tc=" + w2.ID) == -1) {
            iauthor.push("tc=" + w2.ID);
            o2.push("<author>tc=" + w2.ID + "</author>");
          }
        });
      });
      if (iauthor.length == 0) {
        iauthor.push("SheetJ5");
        o2.push("<author>SheetJ5</author>");
      }
      o2.push("</authors>");
      o2.push("<commentList>");
      data.forEach(function(d2) {
        var lastauthor = 0, ts = [];
        if (d2[1][0] && d2[1][0].T && d2[1][0].ID) lastauthor = iauthor.indexOf("tc=" + d2[1][0].ID);
        else d2[1].forEach(function(c2) {
          if (c2.a) lastauthor = iauthor.indexOf(escapexml(c2.a));
          ts.push(c2.t || "");
        });
        o2.push('<comment ref="' + d2[0] + '" authorId="' + lastauthor + '"><text>');
        if (ts.length <= 1) o2.push(writetag("t", escapexml(ts[0] || "")));
        else {
          var t = "Comment:\n    " + ts[0] + "\n";
          for (var i2 = 1; i2 < ts.length; ++i2) t += "Reply:\n    " + ts[i2] + "\n";
          o2.push(writetag("t", escapexml(t)));
        }
        o2.push("</text></comment>");
      });
      o2.push("</commentList>");
      if (o2.length > 2) {
        o2[o2.length] = "</comments>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function write_tcmnt_xml(comments, people, opts) {
      var o2 = [XML_HEADER, writextag("ThreadedComments", null, { "xmlns": XMLNS.TCMNT }).replace(/[\/]>/, ">")];
      comments.forEach(function(carr) {
        var rootid = "";
        (carr[1] || []).forEach(function(c2, idx) {
          if (!c2.T) {
            delete c2.ID;
            return;
          }
          if (c2.a && people.indexOf(c2.a) == -1) people.push(c2.a);
          var tcopts = {
            ref: carr[0],
            id: "{54EE7951-7262-4200-6969-" + ("000000000000" + opts.tcid++).slice(-12) + "}"
          };
          if (idx == 0) rootid = tcopts.id;
          else tcopts.parentId = rootid;
          c2.ID = tcopts.id;
          if (c2.a) tcopts.personId = "{54EE7950-7262-4200-6969-" + ("000000000000" + people.indexOf(c2.a)).slice(-12) + "}";
          o2.push(writextag("threadedComment", writetag("text", c2.t || ""), tcopts));
        });
      });
      o2.push("</ThreadedComments>");
      return o2.join("");
    }
    function write_people_xml(people) {
      var o2 = [XML_HEADER, writextag("personList", null, {
        "xmlns": XMLNS.TCMNT,
        "xmlns:x": XMLNS_main[0]
      }).replace(/[\/]>/, ">")];
      people.forEach(function(person, idx) {
        o2.push(writextag("person", null, {
          displayName: person,
          id: "{54EE7950-7262-4200-6969-" + ("000000000000" + idx).slice(-12) + "}",
          userId: person,
          providerId: "None"
        }));
      });
      o2.push("</personList>");
      return o2.join("");
    }
    function parse_BrtBeginComment(data) {
      var out2 = {};
      out2.iauthor = data.read_shift(4);
      var rfx = parse_UncheckedRfX(data);
      out2.rfx = rfx.s;
      out2.ref = encode_cell(rfx.s);
      data.l += 16;
      return out2;
    }
    function write_BrtBeginComment(data, o2) {
      if (o2 == null) o2 = new_buf(36);
      o2.write_shift(4, data[1].iauthor);
      write_UncheckedRfX(data[0], o2);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      return o2;
    }
    var parse_BrtCommentAuthor = parse_XLWideString;
    function write_BrtCommentAuthor(data) {
      return write_XLWideString(data.slice(0, 54));
    }
    function write_comments_bin(data) {
      var ba = buf_array();
      var iauthor = [];
      write_record(
        ba,
        628
        /* BrtBeginComments */
      );
      write_record(
        ba,
        630
        /* BrtBeginCommentAuthors */
      );
      data.forEach(function(comment) {
        comment[1].forEach(function(c2) {
          if (iauthor.indexOf(c2.a) > -1) return;
          iauthor.push(c2.a.slice(0, 54));
          write_record(ba, 632, write_BrtCommentAuthor(c2.a));
        });
      });
      write_record(
        ba,
        631
        /* BrtEndCommentAuthors */
      );
      write_record(
        ba,
        633
        /* BrtBeginCommentList */
      );
      data.forEach(function(comment) {
        comment[1].forEach(function(c2) {
          c2.iauthor = iauthor.indexOf(c2.a);
          var range2 = { s: decode_cell(comment[0]), e: decode_cell(comment[0]) };
          write_record(ba, 635, write_BrtBeginComment([range2, c2]));
          if (c2.t && c2.t.length > 0) write_record(ba, 637, write_BrtCommentText(c2));
          write_record(
            ba,
            636
            /* BrtEndComment */
          );
          delete c2.iauthor;
        });
      });
      write_record(
        ba,
        634
        /* BrtEndCommentList */
      );
      write_record(
        ba,
        629
        /* BrtEndComments */
      );
      return ba.end();
    }
    function fill_vba_xls(cfb, vba) {
      vba.FullPaths.forEach(function(p2, i2) {
        if (i2 == 0)
          return;
        var newpath = p2.replace(/[^\/]*[\/]/, "/_VBA_PROJECT_CUR/");
        if (newpath.slice(-1) !== "/")
          CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i2].content);
      });
    }
    var VBAFMTS = ["xlsb", "xlsm", "xlam", "biff8", "xla"];
    var rc_to_a1 = /* @__PURE__ */ function() {
      var rcregex = /(^|[^A-Za-z_])R(\[?-?\d+\]|[1-9]\d*|)C(\[?-?\d+\]|[1-9]\d*|)(?![A-Za-z0-9_])/g;
      var rcbase = { r: 0, c: 0 };
      function rcfunc($$, $1, $2, $3) {
        var cRel = false, rRel = false;
        if ($2.length == 0) rRel = true;
        else if ($2.charAt(0) == "[") {
          rRel = true;
          $2 = $2.slice(1, -1);
        }
        if ($3.length == 0) cRel = true;
        else if ($3.charAt(0) == "[") {
          cRel = true;
          $3 = $3.slice(1, -1);
        }
        var R2 = $2.length > 0 ? parseInt($2, 10) | 0 : 0, C2 = $3.length > 0 ? parseInt($3, 10) | 0 : 0;
        if (cRel) C2 += rcbase.c;
        else --C2;
        if (rRel) R2 += rcbase.r;
        else --R2;
        return $1 + (cRel ? "" : "$") + encode_col(C2) + (rRel ? "" : "$") + encode_row(R2);
      }
      return function rc_to_a12(fstr, base2) {
        rcbase = base2;
        return fstr.replace(rcregex, rcfunc);
      };
    }();
    var crefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\d{4}|104[0-7]\d{3}|1048[0-4]\d{2}|10485[0-6]\d|104857[0-6]|[1-9]\d{0,5})(?![_.\(A-Za-z0-9])/g;
    var a1_to_rc = /* @__PURE__ */ function() {
      return function a1_to_rc2(fstr, base2) {
        return fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
          var c2 = decode_col($3) - ($2 ? 0 : base2.c);
          var r = decode_row($5) - ($4 ? 0 : base2.r);
          var R2 = r == 0 ? "" : !$4 ? "[" + r + "]" : r + 1;
          var C2 = c2 == 0 ? "" : !$2 ? "[" + c2 + "]" : c2 + 1;
          return $1 + "R" + R2 + "C" + C2;
        });
      };
    }();
    function shift_formula_str(f2, delta) {
      return f2.replace(crefregex, function($0, $1, $2, $3, $4, $5) {
        return $1 + ($2 == "$" ? $2 + $3 : encode_col(decode_col($3) + delta.c)) + ($4 == "$" ? $4 + $5 : encode_row(decode_row($5) + delta.r));
      });
    }
    function fuzzyfmla(f2) {
      if (f2.length == 1) return false;
      return true;
    }
    function parseread1(blob) {
      blob.l += 1;
      return;
    }
    function parse_ColRelU(blob, length) {
      var c2 = blob.read_shift(2);
      return [c2 & 16383, c2 >> 14 & 1, c2 >> 15 & 1];
    }
    function parse_RgceArea(blob, length, opts) {
      var w2 = 2;
      if (opts) {
        if (opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob);
        else if (opts.biff == 12) w2 = 4;
      }
      var r = blob.read_shift(w2), R2 = blob.read_shift(w2);
      var c2 = parse_ColRelU(blob);
      var C2 = parse_ColRelU(blob);
      return { s: { r, c: c2[0], cRel: c2[1], rRel: c2[2] }, e: { r: R2, c: C2[0], cRel: C2[1], rRel: C2[2] } };
    }
    function parse_RgceArea_BIFF2(blob) {
      var r = parse_ColRelU(blob), R2 = parse_ColRelU(blob);
      var c2 = blob.read_shift(1);
      var C2 = blob.read_shift(1);
      return { s: { r: r[0], c: c2, cRel: r[1], rRel: r[2] }, e: { r: R2[0], c: C2, cRel: R2[1], rRel: R2[2] } };
    }
    function parse_RgceAreaRel(blob, length, opts) {
      if (opts.biff < 8) return parse_RgceArea_BIFF2(blob);
      var r = blob.read_shift(opts.biff == 12 ? 4 : 2), R2 = blob.read_shift(opts.biff == 12 ? 4 : 2);
      var c2 = parse_ColRelU(blob);
      var C2 = parse_ColRelU(blob);
      return { s: { r, c: c2[0], cRel: c2[1], rRel: c2[2] }, e: { r: R2, c: C2[0], cRel: C2[1], rRel: C2[2] } };
    }
    function parse_RgceLoc(blob, length, opts) {
      if (opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob);
      var r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);
      var c2 = parse_ColRelU(blob);
      return { r, c: c2[0], cRel: c2[1], rRel: c2[2] };
    }
    function parse_RgceLoc_BIFF2(blob) {
      var r = parse_ColRelU(blob);
      var c2 = blob.read_shift(1);
      return { r: r[0], c: c2, cRel: r[1], rRel: r[2] };
    }
    function parse_RgceElfLoc(blob) {
      var r = blob.read_shift(2);
      var c2 = blob.read_shift(2);
      return { r, c: c2 & 255, fQuoted: !!(c2 & 16384), cRel: c2 >> 15, rRel: c2 >> 15 };
    }
    function parse_RgceLocRel(blob, length, opts) {
      var biff = opts && opts.biff ? opts.biff : 8;
      if (biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob);
      var r = blob.read_shift(biff >= 12 ? 4 : 2);
      var cl = blob.read_shift(2);
      var cRel = (cl & 16384) >> 14, rRel = (cl & 32768) >> 15;
      cl &= 16383;
      if (rRel == 1) while (r > 524287) r -= 1048576;
      if (cRel == 1) while (cl > 8191) cl = cl - 16384;
      return { r, c: cl, cRel, rRel };
    }
    function parse_RgceLocRel_BIFF2(blob) {
      var rl = blob.read_shift(2);
      var c2 = blob.read_shift(1);
      var rRel = (rl & 32768) >> 15, cRel = (rl & 16384) >> 14;
      rl &= 16383;
      if (rRel == 1 && rl >= 8192) rl = rl - 16384;
      if (cRel == 1 && c2 >= 128) c2 = c2 - 256;
      return { r: rl, c: c2, cRel, rRel };
    }
    function parse_PtgArea(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      var area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);
      return [type, area];
    }
    function parse_PtgArea3d(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      var ixti = blob.read_shift(2, "i");
      var w2 = 8;
      if (opts) switch (opts.biff) {
        case 5:
          blob.l += 12;
          w2 = 6;
          break;
        case 12:
          w2 = 12;
          break;
      }
      var area = parse_RgceArea(blob, w2, opts);
      return [type, ixti, area];
    }
    function parse_PtgAreaErr(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      blob.l += opts && opts.biff > 8 ? 12 : opts.biff < 8 ? 6 : 8;
      return [type];
    }
    function parse_PtgAreaErr3d(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      var ixti = blob.read_shift(2);
      var w2 = 8;
      if (opts) switch (opts.biff) {
        case 5:
          blob.l += 12;
          w2 = 6;
          break;
        case 12:
          w2 = 12;
          break;
      }
      blob.l += w2;
      return [type, ixti];
    }
    function parse_PtgAreaN(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      var area = parse_RgceAreaRel(blob, length - 1, opts);
      return [type, area];
    }
    function parse_PtgArray(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      blob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;
      return [type];
    }
    function parse_PtgAttrBaxcel(blob) {
      var bitSemi = blob[blob.l + 1] & 1;
      var bitBaxcel = 1;
      blob.l += 4;
      return [bitSemi, bitBaxcel];
    }
    function parse_PtgAttrChoose(blob, length, opts) {
      blob.l += 2;
      var offset2 = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
      var o2 = [];
      for (var i2 = 0; i2 <= offset2; ++i2) o2.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));
      return o2;
    }
    function parse_PtgAttrGoto(blob, length, opts) {
      var bitGoto = blob[blob.l + 1] & 255 ? 1 : 0;
      blob.l += 2;
      return [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
    }
    function parse_PtgAttrIf(blob, length, opts) {
      var bitIf = blob[blob.l + 1] & 255 ? 1 : 0;
      blob.l += 2;
      return [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];
    }
    function parse_PtgAttrIfError(blob) {
      var bitIf = blob[blob.l + 1] & 255 ? 1 : 0;
      blob.l += 2;
      return [bitIf, blob.read_shift(2)];
    }
    function parse_PtgAttrSemi(blob, length, opts) {
      var bitSemi = blob[blob.l + 1] & 255 ? 1 : 0;
      blob.l += opts && opts.biff == 2 ? 3 : 4;
      return [bitSemi];
    }
    function parse_PtgAttrSpaceType(blob) {
      var type = blob.read_shift(1), cch = blob.read_shift(1);
      return [type, cch];
    }
    function parse_PtgAttrSpace(blob) {
      blob.read_shift(2);
      return parse_PtgAttrSpaceType(blob);
    }
    function parse_PtgAttrSpaceSemi(blob) {
      blob.read_shift(2);
      return parse_PtgAttrSpaceType(blob);
    }
    function parse_PtgRef(blob, length, opts) {
      var type = (blob[blob.l] & 96) >> 5;
      blob.l += 1;
      var loc = parse_RgceLoc(blob, 0, opts);
      return [type, loc];
    }
    function parse_PtgRefN(blob, length, opts) {
      var type = (blob[blob.l] & 96) >> 5;
      blob.l += 1;
      var loc = parse_RgceLocRel(blob, 0, opts);
      return [type, loc];
    }
    function parse_PtgRef3d(blob, length, opts) {
      var type = (blob[blob.l] & 96) >> 5;
      blob.l += 1;
      var ixti = blob.read_shift(2);
      if (opts && opts.biff == 5) blob.l += 12;
      var loc = parse_RgceLoc(blob, 0, opts);
      return [type, ixti, loc];
    }
    function parse_PtgFunc(blob, length, opts) {
      var type = (blob[blob.l] & 96) >> 5;
      blob.l += 1;
      var iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);
      return [FtabArgc[iftab], Ftab[iftab], type];
    }
    function parse_PtgFuncVar(blob, length, opts) {
      var type = blob[blob.l++];
      var cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [type == 88 ? -1 : 0, blob.read_shift(1)] : parsetab(blob);
      return [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];
    }
    function parsetab(blob) {
      return [blob[blob.l + 1] >> 7, blob.read_shift(2) & 32767];
    }
    function parse_PtgAttrSum(blob, length, opts) {
      blob.l += opts && opts.biff == 2 ? 3 : 4;
      return;
    }
    function parse_PtgExp(blob, length, opts) {
      blob.l++;
      if (opts && opts.biff == 12) return [blob.read_shift(4, "i"), 0];
      var row = blob.read_shift(2);
      var col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
      return [row, col];
    }
    function parse_PtgErr(blob) {
      blob.l++;
      return BErr[blob.read_shift(1)];
    }
    function parse_PtgInt(blob) {
      blob.l++;
      return blob.read_shift(2);
    }
    function parse_PtgBool(blob) {
      blob.l++;
      return blob.read_shift(1) !== 0;
    }
    function parse_PtgNum(blob) {
      blob.l++;
      return parse_Xnum(blob);
    }
    function parse_PtgStr(blob, length, opts) {
      blob.l++;
      return parse_ShortXLUnicodeString(blob, length - 1, opts);
    }
    function parse_SerAr(blob, biff) {
      var val = [blob.read_shift(1)];
      if (biff == 12) switch (val[0]) {
        case 2:
          val[0] = 4;
          break;
        /* SerBool */
        case 4:
          val[0] = 16;
          break;
        /* SerErr */
        case 0:
          val[0] = 1;
          break;
        /* SerNum */
        case 1:
          val[0] = 2;
          break;
      }
      switch (val[0]) {
        case 4:
          val[1] = parsebool(blob, 1) ? "TRUE" : "FALSE";
          if (biff != 12) blob.l += 7;
          break;
        case 37:
        /* appears to be an alias */
        case 16:
          val[1] = BErr[blob[blob.l]];
          blob.l += biff == 12 ? 4 : 8;
          break;
        case 0:
          blob.l += 8;
          break;
        case 1:
          val[1] = parse_Xnum(blob);
          break;
        case 2:
          val[1] = parse_XLUnicodeString2(blob, 0, { biff: biff > 0 && biff < 8 ? 2 : biff });
          break;
        default:
          throw new Error("Bad SerAr: " + val[0]);
      }
      return val;
    }
    function parse_PtgExtraMem(blob, cce, opts) {
      var count2 = blob.read_shift(opts.biff == 12 ? 4 : 2);
      var out2 = [];
      for (var i2 = 0; i2 != count2; ++i2) out2.push((opts.biff == 12 ? parse_UncheckedRfX : parse_Ref8U)(blob));
      return out2;
    }
    function parse_PtgExtraArray(blob, length, opts) {
      var rows = 0, cols = 0;
      if (opts.biff == 12) {
        rows = blob.read_shift(4);
        cols = blob.read_shift(4);
      } else {
        cols = 1 + blob.read_shift(1);
        rows = 1 + blob.read_shift(2);
      }
      if (opts.biff >= 2 && opts.biff < 8) {
        --rows;
        if (--cols == 0) cols = 256;
      }
      for (var i2 = 0, o2 = []; i2 != rows && (o2[i2] = []); ++i2)
        for (var j = 0; j != cols; ++j) o2[i2][j] = parse_SerAr(blob, opts.biff);
      return o2;
    }
    function parse_PtgName(blob, length, opts) {
      var type = blob.read_shift(1) >>> 5 & 3;
      var w2 = !opts || opts.biff >= 8 ? 4 : 2;
      var nameindex = blob.read_shift(w2);
      switch (opts.biff) {
        case 2:
          blob.l += 5;
          break;
        case 3:
        case 4:
          blob.l += 8;
          break;
        case 5:
          blob.l += 12;
          break;
      }
      return [type, 0, nameindex];
    }
    function parse_PtgNameX(blob, length, opts) {
      if (opts.biff == 5) return parse_PtgNameX_BIFF5(blob);
      var type = blob.read_shift(1) >>> 5 & 3;
      var ixti = blob.read_shift(2);
      var nameindex = blob.read_shift(4);
      return [type, ixti, nameindex];
    }
    function parse_PtgNameX_BIFF5(blob) {
      var type = blob.read_shift(1) >>> 5 & 3;
      var ixti = blob.read_shift(2, "i");
      blob.l += 8;
      var nameindex = blob.read_shift(2);
      blob.l += 12;
      return [type, ixti, nameindex];
    }
    function parse_PtgMemArea(blob, length, opts) {
      var type = blob.read_shift(1) >>> 5 & 3;
      blob.l += opts && opts.biff == 2 ? 3 : 4;
      var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
      return [type, cce];
    }
    function parse_PtgMemFunc(blob, length, opts) {
      var type = blob.read_shift(1) >>> 5 & 3;
      var cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);
      return [type, cce];
    }
    function parse_PtgRefErr(blob, length, opts) {
      var type = blob.read_shift(1) >>> 5 & 3;
      blob.l += 4;
      if (opts.biff < 8) blob.l--;
      if (opts.biff == 12) blob.l += 2;
      return [type];
    }
    function parse_PtgRefErr3d(blob, length, opts) {
      var type = (blob[blob.l++] & 96) >> 5;
      var ixti = blob.read_shift(2);
      var w2 = 4;
      if (opts) switch (opts.biff) {
        case 5:
          w2 = 15;
          break;
        case 12:
          w2 = 6;
          break;
      }
      blob.l += w2;
      return [type, ixti];
    }
    var parse_PtgMemErr = parsenoop;
    var parse_PtgMemNoMem = parsenoop;
    var parse_PtgTbl = parsenoop;
    function parse_PtgElfLoc(blob, length, opts) {
      blob.l += 2;
      return [parse_RgceElfLoc(blob)];
    }
    function parse_PtgElfNoop(blob) {
      blob.l += 6;
      return [];
    }
    var parse_PtgElfCol = parse_PtgElfLoc;
    var parse_PtgElfColS = parse_PtgElfNoop;
    var parse_PtgElfColSV = parse_PtgElfNoop;
    var parse_PtgElfColV = parse_PtgElfLoc;
    function parse_PtgElfLel(blob) {
      blob.l += 2;
      return [parseuint16(blob), blob.read_shift(2) & 1];
    }
    var parse_PtgElfRadical = parse_PtgElfLoc;
    var parse_PtgElfRadicalLel = parse_PtgElfLel;
    var parse_PtgElfRadicalS = parse_PtgElfNoop;
    var parse_PtgElfRw = parse_PtgElfLoc;
    var parse_PtgElfRwV = parse_PtgElfLoc;
    var PtgListRT = [
      "Data",
      "All",
      "Headers",
      "??",
      "?Data2",
      "??",
      "?DataHeaders",
      "??",
      "Totals",
      "??",
      "??",
      "??",
      "?DataTotals",
      "??",
      "??",
      "??",
      "?Current"
    ];
    function parse_PtgList(blob) {
      blob.l += 2;
      var ixti = blob.read_shift(2);
      var flags = blob.read_shift(2);
      var idx = blob.read_shift(4);
      var c2 = blob.read_shift(2);
      var C2 = blob.read_shift(2);
      var rt2 = PtgListRT[flags >> 2 & 31];
      return { ixti, coltype: flags & 3, rt: rt2, idx, c: c2, C: C2 };
    }
    function parse_PtgSxName(blob) {
      blob.l += 2;
      return [blob.read_shift(4)];
    }
    function parse_PtgSheet(blob, length, opts) {
      blob.l += 5;
      blob.l += 2;
      blob.l += opts.biff == 2 ? 1 : 4;
      return ["PTGSHEET"];
    }
    function parse_PtgEndSheet(blob, length, opts) {
      blob.l += opts.biff == 2 ? 4 : 5;
      return ["PTGENDSHEET"];
    }
    function parse_PtgMemAreaN(blob) {
      var type = blob.read_shift(1) >>> 5 & 3;
      var cce = blob.read_shift(2);
      return [type, cce];
    }
    function parse_PtgMemNoMemN(blob) {
      var type = blob.read_shift(1) >>> 5 & 3;
      var cce = blob.read_shift(2);
      return [type, cce];
    }
    function parse_PtgAttrNoop(blob) {
      blob.l += 4;
      return [0, 0];
    }
    var PtgTypes = {
      /*::[*/
      1: { n: "PtgExp", f: parse_PtgExp },
      /*::[*/
      2: { n: "PtgTbl", f: parse_PtgTbl },
      /*::[*/
      3: { n: "PtgAdd", f: parseread1 },
      /*::[*/
      4: { n: "PtgSub", f: parseread1 },
      /*::[*/
      5: { n: "PtgMul", f: parseread1 },
      /*::[*/
      6: { n: "PtgDiv", f: parseread1 },
      /*::[*/
      7: { n: "PtgPower", f: parseread1 },
      /*::[*/
      8: { n: "PtgConcat", f: parseread1 },
      /*::[*/
      9: { n: "PtgLt", f: parseread1 },
      /*::[*/
      10: { n: "PtgLe", f: parseread1 },
      /*::[*/
      11: { n: "PtgEq", f: parseread1 },
      /*::[*/
      12: { n: "PtgGe", f: parseread1 },
      /*::[*/
      13: { n: "PtgGt", f: parseread1 },
      /*::[*/
      14: { n: "PtgNe", f: parseread1 },
      /*::[*/
      15: { n: "PtgIsect", f: parseread1 },
      /*::[*/
      16: { n: "PtgUnion", f: parseread1 },
      /*::[*/
      17: { n: "PtgRange", f: parseread1 },
      /*::[*/
      18: { n: "PtgUplus", f: parseread1 },
      /*::[*/
      19: { n: "PtgUminus", f: parseread1 },
      /*::[*/
      20: { n: "PtgPercent", f: parseread1 },
      /*::[*/
      21: { n: "PtgParen", f: parseread1 },
      /*::[*/
      22: { n: "PtgMissArg", f: parseread1 },
      /*::[*/
      23: { n: "PtgStr", f: parse_PtgStr },
      /*::[*/
      26: { n: "PtgSheet", f: parse_PtgSheet },
      /*::[*/
      27: { n: "PtgEndSheet", f: parse_PtgEndSheet },
      /*::[*/
      28: { n: "PtgErr", f: parse_PtgErr },
      /*::[*/
      29: { n: "PtgBool", f: parse_PtgBool },
      /*::[*/
      30: { n: "PtgInt", f: parse_PtgInt },
      /*::[*/
      31: { n: "PtgNum", f: parse_PtgNum },
      /*::[*/
      32: { n: "PtgArray", f: parse_PtgArray },
      /*::[*/
      33: { n: "PtgFunc", f: parse_PtgFunc },
      /*::[*/
      34: { n: "PtgFuncVar", f: parse_PtgFuncVar },
      /*::[*/
      35: { n: "PtgName", f: parse_PtgName },
      /*::[*/
      36: { n: "PtgRef", f: parse_PtgRef },
      /*::[*/
      37: { n: "PtgArea", f: parse_PtgArea },
      /*::[*/
      38: { n: "PtgMemArea", f: parse_PtgMemArea },
      /*::[*/
      39: { n: "PtgMemErr", f: parse_PtgMemErr },
      /*::[*/
      40: { n: "PtgMemNoMem", f: parse_PtgMemNoMem },
      /*::[*/
      41: { n: "PtgMemFunc", f: parse_PtgMemFunc },
      /*::[*/
      42: { n: "PtgRefErr", f: parse_PtgRefErr },
      /*::[*/
      43: { n: "PtgAreaErr", f: parse_PtgAreaErr },
      /*::[*/
      44: { n: "PtgRefN", f: parse_PtgRefN },
      /*::[*/
      45: { n: "PtgAreaN", f: parse_PtgAreaN },
      /*::[*/
      46: { n: "PtgMemAreaN", f: parse_PtgMemAreaN },
      /*::[*/
      47: { n: "PtgMemNoMemN", f: parse_PtgMemNoMemN },
      /*::[*/
      57: { n: "PtgNameX", f: parse_PtgNameX },
      /*::[*/
      58: { n: "PtgRef3d", f: parse_PtgRef3d },
      /*::[*/
      59: { n: "PtgArea3d", f: parse_PtgArea3d },
      /*::[*/
      60: { n: "PtgRefErr3d", f: parse_PtgRefErr3d },
      /*::[*/
      61: { n: "PtgAreaErr3d", f: parse_PtgAreaErr3d },
      /*::[*/
      255: {}
    };
    var PtgDupes = {
      /*::[*/
      64: 32,
      /*::[*/
      96: 32,
      /*::[*/
      65: 33,
      /*::[*/
      97: 33,
      /*::[*/
      66: 34,
      /*::[*/
      98: 34,
      /*::[*/
      67: 35,
      /*::[*/
      99: 35,
      /*::[*/
      68: 36,
      /*::[*/
      100: 36,
      /*::[*/
      69: 37,
      /*::[*/
      101: 37,
      /*::[*/
      70: 38,
      /*::[*/
      102: 38,
      /*::[*/
      71: 39,
      /*::[*/
      103: 39,
      /*::[*/
      72: 40,
      /*::[*/
      104: 40,
      /*::[*/
      73: 41,
      /*::[*/
      105: 41,
      /*::[*/
      74: 42,
      /*::[*/
      106: 42,
      /*::[*/
      75: 43,
      /*::[*/
      107: 43,
      /*::[*/
      76: 44,
      /*::[*/
      108: 44,
      /*::[*/
      77: 45,
      /*::[*/
      109: 45,
      /*::[*/
      78: 46,
      /*::[*/
      110: 46,
      /*::[*/
      79: 47,
      /*::[*/
      111: 47,
      /*::[*/
      88: 34,
      /*::[*/
      120: 34,
      /*::[*/
      89: 57,
      /*::[*/
      121: 57,
      /*::[*/
      90: 58,
      /*::[*/
      122: 58,
      /*::[*/
      91: 59,
      /*::[*/
      123: 59,
      /*::[*/
      92: 60,
      /*::[*/
      124: 60,
      /*::[*/
      93: 61,
      /*::[*/
      125: 61
    };
    var Ptg18 = {
      /*::[*/
      1: { n: "PtgElfLel", f: parse_PtgElfLel },
      /*::[*/
      2: { n: "PtgElfRw", f: parse_PtgElfRw },
      /*::[*/
      3: { n: "PtgElfCol", f: parse_PtgElfCol },
      /*::[*/
      6: { n: "PtgElfRwV", f: parse_PtgElfRwV },
      /*::[*/
      7: { n: "PtgElfColV", f: parse_PtgElfColV },
      /*::[*/
      10: { n: "PtgElfRadical", f: parse_PtgElfRadical },
      /*::[*/
      11: { n: "PtgElfRadicalS", f: parse_PtgElfRadicalS },
      /*::[*/
      13: { n: "PtgElfColS", f: parse_PtgElfColS },
      /*::[*/
      15: { n: "PtgElfColSV", f: parse_PtgElfColSV },
      /*::[*/
      16: { n: "PtgElfRadicalLel", f: parse_PtgElfRadicalLel },
      /*::[*/
      25: { n: "PtgList", f: parse_PtgList },
      /*::[*/
      29: { n: "PtgSxName", f: parse_PtgSxName },
      /*::[*/
      255: {}
    };
    var Ptg19 = {
      /*::[*/
      0: { n: "PtgAttrNoop", f: parse_PtgAttrNoop },
      /*::[*/
      1: { n: "PtgAttrSemi", f: parse_PtgAttrSemi },
      /*::[*/
      2: { n: "PtgAttrIf", f: parse_PtgAttrIf },
      /*::[*/
      4: { n: "PtgAttrChoose", f: parse_PtgAttrChoose },
      /*::[*/
      8: { n: "PtgAttrGoto", f: parse_PtgAttrGoto },
      /*::[*/
      16: { n: "PtgAttrSum", f: parse_PtgAttrSum },
      /*::[*/
      32: { n: "PtgAttrBaxcel", f: parse_PtgAttrBaxcel },
      /*::[*/
      33: { n: "PtgAttrBaxcel", f: parse_PtgAttrBaxcel },
      /*::[*/
      64: { n: "PtgAttrSpace", f: parse_PtgAttrSpace },
      /*::[*/
      65: { n: "PtgAttrSpaceSemi", f: parse_PtgAttrSpaceSemi },
      /*::[*/
      128: { n: "PtgAttrIfError", f: parse_PtgAttrIfError },
      /*::[*/
      255: {}
    };
    function parse_RgbExtra(blob, length, rgce, opts) {
      if (opts.biff < 8) return parsenoop(blob, length);
      var target = blob.l + length;
      var o2 = [];
      for (var i2 = 0; i2 !== rgce.length; ++i2) {
        switch (rgce[i2][0]) {
          case "PtgArray":
            rgce[i2][1] = parse_PtgExtraArray(blob, 0, opts);
            o2.push(rgce[i2][1]);
            break;
          case "PtgMemArea":
            rgce[i2][2] = parse_PtgExtraMem(blob, rgce[i2][1], opts);
            o2.push(rgce[i2][2]);
            break;
          case "PtgExp":
            if (opts && opts.biff == 12) {
              rgce[i2][1][1] = blob.read_shift(4);
              o2.push(rgce[i2][1]);
            }
            break;
          case "PtgList":
          /* TODO: PtgList -> PtgExtraList */
          case "PtgElfRadicalS":
          /* TODO: PtgElfRadicalS -> PtgExtraElf */
          case "PtgElfColS":
          /* TODO: PtgElfColS -> PtgExtraElf */
          case "PtgElfColSV":
            throw "Unsupported " + rgce[i2][0];
        }
      }
      length = target - blob.l;
      if (length !== 0) o2.push(parsenoop(blob, length));
      return o2;
    }
    function parse_Rgce(blob, length, opts) {
      var target = blob.l + length;
      var R2, id, ptgs = [];
      while (target != blob.l) {
        length = target - blob.l;
        id = blob[blob.l];
        R2 = PtgTypes[id] || PtgTypes[PtgDupes[id]];
        if (id === 24 || id === 25) R2 = (id === 24 ? Ptg18 : Ptg19)[blob[blob.l + 1]];
        if (!R2 || !R2.f) {
          parsenoop(blob, length);
        } else {
          ptgs.push([R2.n, R2.f(blob, length, opts)]);
        }
      }
      return ptgs;
    }
    function stringify_array(f2) {
      var o2 = [];
      for (var i2 = 0; i2 < f2.length; ++i2) {
        var x2 = f2[i2], r = [];
        for (var j = 0; j < x2.length; ++j) {
          var y = x2[j];
          if (y) switch (y[0]) {
            // TODO: handle embedded quotes
            case 2:
              r.push('"' + y[1].replace(/"/g, '""') + '"');
              break;
            default:
              r.push(y[1]);
          }
          else r.push("");
        }
        o2.push(r.join(","));
      }
      return o2.join(";");
    }
    var PtgBinOp = {
      PtgAdd: "+",
      PtgConcat: "&",
      PtgDiv: "/",
      PtgEq: "=",
      PtgGe: ">=",
      PtgGt: ">",
      PtgLe: "<=",
      PtgLt: "<",
      PtgMul: "*",
      PtgNe: "<>",
      PtgPower: "^",
      PtgSub: "-"
    };
    function formula_quote_sheet_name(sname, opts) {
      if (!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error("empty sheet name");
      if (/[^\w\u4E00-\u9FFF\u3040-\u30FF]/.test(sname)) return "'" + sname + "'";
      return sname;
    }
    function get_ixti_raw(supbooks, ixti, opts) {
      if (!supbooks) return "SH33TJSERR0";
      if (opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti];
      if (!supbooks.XTI) return "SH33TJSERR6";
      var XTI = supbooks.XTI[ixti];
      if (opts.biff < 8) {
        if (ixti > 1e4) ixti -= 65536;
        if (ixti < 0) ixti = -ixti;
        return ixti == 0 ? "" : supbooks.XTI[ixti - 1];
      }
      if (!XTI) return "SH33TJSERR1";
      var o2 = "";
      if (opts.biff > 8) switch (supbooks[XTI[0]][0]) {
        case 357:
          o2 = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]];
          return XTI[1] == XTI[2] ? o2 : o2 + ":" + supbooks.SheetNames[XTI[2]];
        case 358:
          if (opts.SID != null) return supbooks.SheetNames[opts.SID];
          return "SH33TJSSAME" + supbooks[XTI[0]][0];
        case 355:
        /* 'BrtSupBookSrc' */
        /* falls through */
        default:
          return "SH33TJSSRC" + supbooks[XTI[0]][0];
      }
      switch (supbooks[XTI[0]][0][0]) {
        case 1025:
          o2 = XTI[1] == -1 ? "#REF" : supbooks.SheetNames[XTI[1]] || "SH33TJSERR3";
          return XTI[1] == XTI[2] ? o2 : o2 + ":" + supbooks.SheetNames[XTI[2]];
        case 14849:
          return supbooks[XTI[0]].slice(1).map(function(name) {
            return name.Name;
          }).join(";;");
        //return "SH33TJSERR8";
        default:
          if (!supbooks[XTI[0]][0][3]) return "SH33TJSERR2";
          o2 = XTI[1] == -1 ? "#REF" : supbooks[XTI[0]][0][3][XTI[1]] || "SH33TJSERR4";
          return XTI[1] == XTI[2] ? o2 : o2 + ":" + supbooks[XTI[0]][0][3][XTI[2]];
      }
    }
    function get_ixti(supbooks, ixti, opts) {
      var ixtiraw = get_ixti_raw(supbooks, ixti, opts);
      return ixtiraw == "#REF" ? ixtiraw : formula_quote_sheet_name(ixtiraw, opts);
    }
    function stringify_formula(formula, range2, cell, supbooks, opts) {
      var biff = opts && opts.biff || 8;
      var _range = (
        /*range != null ? range :*/
        { s: { c: 0, r: 0 } }
      );
      var stack2 = [], e1, e2, c2, ixti = 0, nameidx = 0, r, sname = "";
      if (!formula[0] || !formula[0][0]) return "";
      var last_sp = -1, sp = "";
      for (var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {
        var f2 = formula[0][ff];
        switch (f2[0]) {
          case "PtgUminus":
            stack2.push("-" + stack2.pop());
            break;
          case "PtgUplus":
            stack2.push("+" + stack2.pop());
            break;
          case "PtgPercent":
            stack2.push(stack2.pop() + "%");
            break;
          case "PtgAdd":
          /* [MS-XLS] 2.5.198.26 */
          case "PtgConcat":
          /* [MS-XLS] 2.5.198.43 */
          case "PtgDiv":
          /* [MS-XLS] 2.5.198.45 */
          case "PtgEq":
          /* [MS-XLS] 2.5.198.56 */
          case "PtgGe":
          /* [MS-XLS] 2.5.198.64 */
          case "PtgGt":
          /* [MS-XLS] 2.5.198.65 */
          case "PtgLe":
          /* [MS-XLS] 2.5.198.68 */
          case "PtgLt":
          /* [MS-XLS] 2.5.198.69 */
          case "PtgMul":
          /* [MS-XLS] 2.5.198.75 */
          case "PtgNe":
          /* [MS-XLS] 2.5.198.78 */
          case "PtgPower":
          /* [MS-XLS] 2.5.198.82 */
          case "PtgSub":
            e1 = stack2.pop();
            e2 = stack2.pop();
            if (last_sp >= 0) {
              switch (formula[0][last_sp][1][0]) {
                case 0:
                  sp = fill(" ", formula[0][last_sp][1][1]);
                  break;
                case 1:
                  sp = fill("\r", formula[0][last_sp][1][1]);
                  break;
                default:
                  sp = "";
                  if (opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
              }
              e2 = e2 + sp;
              last_sp = -1;
            }
            stack2.push(e2 + PtgBinOp[f2[0]] + e1);
            break;
          case "PtgIsect":
            e1 = stack2.pop();
            e2 = stack2.pop();
            stack2.push(e2 + " " + e1);
            break;
          case "PtgUnion":
            e1 = stack2.pop();
            e2 = stack2.pop();
            stack2.push(e2 + "," + e1);
            break;
          case "PtgRange":
            e1 = stack2.pop();
            e2 = stack2.pop();
            stack2.push(e2 + ":" + e1);
            break;
          case "PtgAttrChoose":
            break;
          case "PtgAttrGoto":
            break;
          case "PtgAttrIf":
            break;
          case "PtgAttrIfError":
            break;
          case "PtgRef":
            c2 = shift_cell_xls(f2[1][1], _range, opts);
            stack2.push(encode_cell_xls(c2, biff));
            break;
          case "PtgRefN":
            c2 = cell ? shift_cell_xls(f2[1][1], cell, opts) : f2[1][1];
            stack2.push(encode_cell_xls(c2, biff));
            break;
          case "PtgRef3d":
            ixti = /*::Number(*/
            f2[1][1];
            c2 = shift_cell_xls(f2[1][2], _range, opts);
            sname = get_ixti(supbooks, ixti, opts);
            stack2.push(sname + "!" + encode_cell_xls(c2, biff));
            break;
          case "PtgFunc":
          /* [MS-XLS] 2.5.198.62 */
          case "PtgFuncVar":
            var argc = f2[1][0], func = f2[1][1];
            if (!argc) argc = 0;
            argc &= 127;
            var args = argc == 0 ? [] : stack2.slice(-argc);
            stack2.length -= argc;
            if (func === "User") func = args.shift();
            stack2.push(func + "(" + args.join(",") + ")");
            break;
          case "PtgBool":
            stack2.push(f2[1] ? "TRUE" : "FALSE");
            break;
          case "PtgInt":
            stack2.push(
              /*::String(*/
              f2[1]
              /*::)*/
            );
            break;
          case "PtgNum":
            stack2.push(String(f2[1]));
            break;
          case "PtgStr":
            stack2.push('"' + f2[1].replace(/"/g, '""') + '"');
            break;
          case "PtgErr":
            stack2.push(
              /*::String(*/
              f2[1]
              /*::)*/
            );
            break;
          case "PtgAreaN":
            r = shift_range_xls(f2[1][1], cell ? { s: cell } : _range, opts);
            stack2.push(encode_range_xls(r, opts));
            break;
          case "PtgArea":
            r = shift_range_xls(f2[1][1], _range, opts);
            stack2.push(encode_range_xls(r, opts));
            break;
          case "PtgArea3d":
            ixti = /*::Number(*/
            f2[1][1];
            r = f2[1][2];
            sname = get_ixti(supbooks, ixti, opts);
            stack2.push(sname + "!" + encode_range_xls(r, opts));
            break;
          case "PtgAttrSum":
            stack2.push("SUM(" + stack2.pop() + ")");
            break;
          case "PtgAttrBaxcel":
          /* [MS-XLS] 2.5.198.33 */
          case "PtgAttrSemi":
            break;
          case "PtgName":
            nameidx = f2[1][2];
            var lbl = (supbooks.names || [])[nameidx - 1] || (supbooks[0] || [])[nameidx];
            var name = lbl ? lbl.Name : "SH33TJSNAME" + String(nameidx);
            if (name && name.slice(0, 6) == "_xlfn." && !opts.xlfn) name = name.slice(6);
            stack2.push(name);
            break;
          case "PtgNameX":
            var bookidx = f2[1][1];
            nameidx = f2[1][2];
            var externbook;
            if (opts.biff <= 5) {
              if (bookidx < 0) bookidx = -bookidx;
              if (supbooks[bookidx]) externbook = supbooks[bookidx][nameidx];
            } else {
              var o2 = "";
              if (((supbooks[bookidx] || [])[0] || [])[0] == 14849) ;
              else if (((supbooks[bookidx] || [])[0] || [])[0] == 1025) {
                if (supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) {
                  o2 = supbooks.SheetNames[supbooks[bookidx][nameidx].itab - 1] + "!";
                }
              } else o2 = supbooks.SheetNames[nameidx - 1] + "!";
              if (supbooks[bookidx] && supbooks[bookidx][nameidx]) o2 += supbooks[bookidx][nameidx].Name;
              else if (supbooks[0] && supbooks[0][nameidx]) o2 += supbooks[0][nameidx].Name;
              else {
                var ixtidata = (get_ixti_raw(supbooks, bookidx, opts) || "").split(";;");
                if (ixtidata[nameidx - 1]) o2 = ixtidata[nameidx - 1];
                else o2 += "SH33TJSERRX";
              }
              stack2.push(o2);
              break;
            }
            if (!externbook) externbook = { Name: "SH33TJSERRY" };
            stack2.push(externbook.Name);
            break;
          case "PtgParen":
            var lp = "(", rp = ")";
            if (last_sp >= 0) {
              sp = "";
              switch (formula[0][last_sp][1][0]) {
                // $FlowIgnore
                case 2:
                  lp = fill(" ", formula[0][last_sp][1][1]) + lp;
                  break;
                // $FlowIgnore
                case 3:
                  lp = fill("\r", formula[0][last_sp][1][1]) + lp;
                  break;
                // $FlowIgnore
                case 4:
                  rp = fill(" ", formula[0][last_sp][1][1]) + rp;
                  break;
                // $FlowIgnore
                case 5:
                  rp = fill("\r", formula[0][last_sp][1][1]) + rp;
                  break;
                default:
                  if (opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + formula[0][last_sp][1][0]);
              }
              last_sp = -1;
            }
            stack2.push(lp + stack2.pop() + rp);
            break;
          case "PtgRefErr":
            stack2.push("#REF!");
            break;
          case "PtgRefErr3d":
            stack2.push("#REF!");
            break;
          case "PtgExp":
            c2 = { c: f2[1][1], r: f2[1][0] };
            var q2 = { c: cell.c, r: cell.r };
            if (supbooks.sharedf[encode_cell(c2)]) {
              var parsedf = supbooks.sharedf[encode_cell(c2)];
              stack2.push(stringify_formula(parsedf, _range, q2, supbooks, opts));
            } else {
              var fnd = false;
              for (e1 = 0; e1 != supbooks.arrayf.length; ++e1) {
                e2 = supbooks.arrayf[e1];
                if (c2.c < e2[0].s.c || c2.c > e2[0].e.c) continue;
                if (c2.r < e2[0].s.r || c2.r > e2[0].e.r) continue;
                stack2.push(stringify_formula(e2[1], _range, q2, supbooks, opts));
                fnd = true;
                break;
              }
              if (!fnd) stack2.push(
                /*::String(*/
                f2[1]
                /*::)*/
              );
            }
            break;
          case "PtgArray":
            stack2.push("{" + stringify_array(
              /*::(*/
              f2[1]
              /*:: :any)*/
            ) + "}");
            break;
          case "PtgMemArea":
            break;
          case "PtgAttrSpace":
          /* [MS-XLS] 2.5.198.38 */
          case "PtgAttrSpaceSemi":
            last_sp = ff;
            break;
          case "PtgTbl":
            break;
          case "PtgMemErr":
            break;
          case "PtgMissArg":
            stack2.push("");
            break;
          case "PtgAreaErr":
            stack2.push("#REF!");
            break;
          case "PtgAreaErr3d":
            stack2.push("#REF!");
            break;
          case "PtgList":
            stack2.push("Table" + f2[1].idx + "[#" + f2[1].rt + "]");
            break;
          case "PtgMemAreaN":
          case "PtgMemNoMemN":
          case "PtgAttrNoop":
          case "PtgSheet":
          case "PtgEndSheet":
            break;
          case "PtgMemFunc":
            break;
          case "PtgMemNoMem":
            break;
          case "PtgElfCol":
          /* [MS-XLS] 2.5.198.46 */
          case "PtgElfColS":
          /* [MS-XLS] 2.5.198.47 */
          case "PtgElfColSV":
          /* [MS-XLS] 2.5.198.48 */
          case "PtgElfColV":
          /* [MS-XLS] 2.5.198.49 */
          case "PtgElfLel":
          /* [MS-XLS] 2.5.198.50 */
          case "PtgElfRadical":
          /* [MS-XLS] 2.5.198.51 */
          case "PtgElfRadicalLel":
          /* [MS-XLS] 2.5.198.52 */
          case "PtgElfRadicalS":
          /* [MS-XLS] 2.5.198.53 */
          case "PtgElfRw":
          /* [MS-XLS] 2.5.198.54 */
          case "PtgElfRwV":
            throw new Error("Unsupported ELFs");
          case "PtgSxName":
            throw new Error("Unrecognized Formula Token: " + String(f2));
          default:
            throw new Error("Unrecognized Formula Token: " + String(f2));
        }
        var PtgNonDisp = ["PtgAttrSpace", "PtgAttrSpaceSemi", "PtgAttrGoto"];
        if (opts.biff != 3) {
          if (last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {
            f2 = formula[0][last_sp];
            var _left = true;
            switch (f2[1][0]) {
              /* note: some bad XLSB files omit the PtgParen */
              case 4:
                _left = false;
              /* falls through */
              case 0:
                sp = fill(" ", f2[1][1]);
                break;
              case 5:
                _left = false;
              /* falls through */
              case 1:
                sp = fill("\r", f2[1][1]);
                break;
              default:
                sp = "";
                if (opts.WTF) throw new Error("Unexpected PtgAttrSpaceType " + f2[1][0]);
            }
            stack2.push((_left ? sp : "") + stack2.pop() + (_left ? "" : sp));
            last_sp = -1;
          }
        }
      }
      if (stack2.length > 1 && opts.WTF) throw new Error("bad formula stack");
      return stack2[0];
    }
    function write_FormulaValue(value) {
      if (value == null) {
        var o2 = new_buf(8);
        o2.write_shift(1, 3);
        o2.write_shift(1, 0);
        o2.write_shift(2, 0);
        o2.write_shift(2, 0);
        o2.write_shift(2, 65535);
        return o2;
      } else if (typeof value == "number") return write_Xnum(value);
      return write_Xnum(0);
    }
    function write_Formula(cell, R2, C2, opts, os) {
      var o1 = write_XLSCell(R2, C2, os);
      var o2 = write_FormulaValue(cell.v);
      var o3 = new_buf(6);
      var flags = 1 | 32;
      o3.write_shift(2, flags);
      o3.write_shift(4, 0);
      var bf = new_buf(cell.bf.length);
      for (var i2 = 0; i2 < cell.bf.length; ++i2) bf[i2] = cell.bf[i2];
      var out2 = bconcat([o1, o2, o3, bf]);
      return out2;
    }
    function parse_XLSBParsedFormula(data, length, opts) {
      var cce = data.read_shift(4);
      var rgce = parse_Rgce(data, cce, opts);
      var cb = data.read_shift(4);
      var rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;
      return [rgce, rgcb];
    }
    var parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula;
    var parse_XLSBCellParsedFormula = parse_XLSBParsedFormula;
    var parse_XLSBNameParsedFormula = parse_XLSBParsedFormula;
    var parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula;
    var Cetab = {
      0: "BEEP",
      1: "OPEN",
      2: "OPEN.LINKS",
      3: "CLOSE.ALL",
      4: "SAVE",
      5: "SAVE.AS",
      6: "FILE.DELETE",
      7: "PAGE.SETUP",
      8: "PRINT",
      9: "PRINTER.SETUP",
      10: "QUIT",
      11: "NEW.WINDOW",
      12: "ARRANGE.ALL",
      13: "WINDOW.SIZE",
      14: "WINDOW.MOVE",
      15: "FULL",
      16: "CLOSE",
      17: "RUN",
      22: "SET.PRINT.AREA",
      23: "SET.PRINT.TITLES",
      24: "SET.PAGE.BREAK",
      25: "REMOVE.PAGE.BREAK",
      26: "FONT",
      27: "DISPLAY",
      28: "PROTECT.DOCUMENT",
      29: "PRECISION",
      30: "A1.R1C1",
      31: "CALCULATE.NOW",
      32: "CALCULATION",
      34: "DATA.FIND",
      35: "EXTRACT",
      36: "DATA.DELETE",
      37: "SET.DATABASE",
      38: "SET.CRITERIA",
      39: "SORT",
      40: "DATA.SERIES",
      41: "TABLE",
      42: "FORMAT.NUMBER",
      43: "ALIGNMENT",
      44: "STYLE",
      45: "BORDER",
      46: "CELL.PROTECTION",
      47: "COLUMN.WIDTH",
      48: "UNDO",
      49: "CUT",
      50: "COPY",
      51: "PASTE",
      52: "CLEAR",
      53: "PASTE.SPECIAL",
      54: "EDIT.DELETE",
      55: "INSERT",
      56: "FILL.RIGHT",
      57: "FILL.DOWN",
      61: "DEFINE.NAME",
      62: "CREATE.NAMES",
      63: "FORMULA.GOTO",
      64: "FORMULA.FIND",
      65: "SELECT.LAST.CELL",
      66: "SHOW.ACTIVE.CELL",
      67: "GALLERY.AREA",
      68: "GALLERY.BAR",
      69: "GALLERY.COLUMN",
      70: "GALLERY.LINE",
      71: "GALLERY.PIE",
      72: "GALLERY.SCATTER",
      73: "COMBINATION",
      74: "PREFERRED",
      75: "ADD.OVERLAY",
      76: "GRIDLINES",
      77: "SET.PREFERRED",
      78: "AXES",
      79: "LEGEND",
      80: "ATTACH.TEXT",
      81: "ADD.ARROW",
      82: "SELECT.CHART",
      83: "SELECT.PLOT.AREA",
      84: "PATTERNS",
      85: "MAIN.CHART",
      86: "OVERLAY",
      87: "SCALE",
      88: "FORMAT.LEGEND",
      89: "FORMAT.TEXT",
      90: "EDIT.REPEAT",
      91: "PARSE",
      92: "JUSTIFY",
      93: "HIDE",
      94: "UNHIDE",
      95: "WORKSPACE",
      96: "FORMULA",
      97: "FORMULA.FILL",
      98: "FORMULA.ARRAY",
      99: "DATA.FIND.NEXT",
      100: "DATA.FIND.PREV",
      101: "FORMULA.FIND.NEXT",
      102: "FORMULA.FIND.PREV",
      103: "ACTIVATE",
      104: "ACTIVATE.NEXT",
      105: "ACTIVATE.PREV",
      106: "UNLOCKED.NEXT",
      107: "UNLOCKED.PREV",
      108: "COPY.PICTURE",
      109: "SELECT",
      110: "DELETE.NAME",
      111: "DELETE.FORMAT",
      112: "VLINE",
      113: "HLINE",
      114: "VPAGE",
      115: "HPAGE",
      116: "VSCROLL",
      117: "HSCROLL",
      118: "ALERT",
      119: "NEW",
      120: "CANCEL.COPY",
      121: "SHOW.CLIPBOARD",
      122: "MESSAGE",
      124: "PASTE.LINK",
      125: "APP.ACTIVATE",
      126: "DELETE.ARROW",
      127: "ROW.HEIGHT",
      128: "FORMAT.MOVE",
      129: "FORMAT.SIZE",
      130: "FORMULA.REPLACE",
      131: "SEND.KEYS",
      132: "SELECT.SPECIAL",
      133: "APPLY.NAMES",
      134: "REPLACE.FONT",
      135: "FREEZE.PANES",
      136: "SHOW.INFO",
      137: "SPLIT",
      138: "ON.WINDOW",
      139: "ON.DATA",
      140: "DISABLE.INPUT",
      142: "OUTLINE",
      143: "LIST.NAMES",
      144: "FILE.CLOSE",
      145: "SAVE.WORKBOOK",
      146: "DATA.FORM",
      147: "COPY.CHART",
      148: "ON.TIME",
      149: "WAIT",
      150: "FORMAT.FONT",
      151: "FILL.UP",
      152: "FILL.LEFT",
      153: "DELETE.OVERLAY",
      155: "SHORT.MENUS",
      159: "SET.UPDATE.STATUS",
      161: "COLOR.PALETTE",
      162: "DELETE.STYLE",
      163: "WINDOW.RESTORE",
      164: "WINDOW.MAXIMIZE",
      166: "CHANGE.LINK",
      167: "CALCULATE.DOCUMENT",
      168: "ON.KEY",
      169: "APP.RESTORE",
      170: "APP.MOVE",
      171: "APP.SIZE",
      172: "APP.MINIMIZE",
      173: "APP.MAXIMIZE",
      174: "BRING.TO.FRONT",
      175: "SEND.TO.BACK",
      185: "MAIN.CHART.TYPE",
      186: "OVERLAY.CHART.TYPE",
      187: "SELECT.END",
      188: "OPEN.MAIL",
      189: "SEND.MAIL",
      190: "STANDARD.FONT",
      191: "CONSOLIDATE",
      192: "SORT.SPECIAL",
      193: "GALLERY.3D.AREA",
      194: "GALLERY.3D.COLUMN",
      195: "GALLERY.3D.LINE",
      196: "GALLERY.3D.PIE",
      197: "VIEW.3D",
      198: "GOAL.SEEK",
      199: "WORKGROUP",
      200: "FILL.GROUP",
      201: "UPDATE.LINK",
      202: "PROMOTE",
      203: "DEMOTE",
      204: "SHOW.DETAIL",
      206: "UNGROUP",
      207: "OBJECT.PROPERTIES",
      208: "SAVE.NEW.OBJECT",
      209: "SHARE",
      210: "SHARE.NAME",
      211: "DUPLICATE",
      212: "APPLY.STYLE",
      213: "ASSIGN.TO.OBJECT",
      214: "OBJECT.PROTECTION",
      215: "HIDE.OBJECT",
      216: "SET.EXTRACT",
      217: "CREATE.PUBLISHER",
      218: "SUBSCRIBE.TO",
      219: "ATTRIBUTES",
      220: "SHOW.TOOLBAR",
      222: "PRINT.PREVIEW",
      223: "EDIT.COLOR",
      224: "SHOW.LEVELS",
      225: "FORMAT.MAIN",
      226: "FORMAT.OVERLAY",
      227: "ON.RECALC",
      228: "EDIT.SERIES",
      229: "DEFINE.STYLE",
      240: "LINE.PRINT",
      243: "ENTER.DATA",
      249: "GALLERY.RADAR",
      250: "MERGE.STYLES",
      251: "EDITION.OPTIONS",
      252: "PASTE.PICTURE",
      253: "PASTE.PICTURE.LINK",
      254: "SPELLING",
      256: "ZOOM",
      259: "INSERT.OBJECT",
      260: "WINDOW.MINIMIZE",
      265: "SOUND.NOTE",
      266: "SOUND.PLAY",
      267: "FORMAT.SHAPE",
      268: "EXTEND.POLYGON",
      269: "FORMAT.AUTO",
      272: "GALLERY.3D.BAR",
      273: "GALLERY.3D.SURFACE",
      274: "FILL.AUTO",
      276: "CUSTOMIZE.TOOLBAR",
      277: "ADD.TOOL",
      278: "EDIT.OBJECT",
      279: "ON.DOUBLECLICK",
      280: "ON.ENTRY",
      281: "WORKBOOK.ADD",
      282: "WORKBOOK.MOVE",
      283: "WORKBOOK.COPY",
      284: "WORKBOOK.OPTIONS",
      285: "SAVE.WORKSPACE",
      288: "CHART.WIZARD",
      289: "DELETE.TOOL",
      290: "MOVE.TOOL",
      291: "WORKBOOK.SELECT",
      292: "WORKBOOK.ACTIVATE",
      293: "ASSIGN.TO.TOOL",
      295: "COPY.TOOL",
      296: "RESET.TOOL",
      297: "CONSTRAIN.NUMERIC",
      298: "PASTE.TOOL",
      302: "WORKBOOK.NEW",
      305: "SCENARIO.CELLS",
      306: "SCENARIO.DELETE",
      307: "SCENARIO.ADD",
      308: "SCENARIO.EDIT",
      309: "SCENARIO.SHOW",
      310: "SCENARIO.SHOW.NEXT",
      311: "SCENARIO.SUMMARY",
      312: "PIVOT.TABLE.WIZARD",
      313: "PIVOT.FIELD.PROPERTIES",
      314: "PIVOT.FIELD",
      315: "PIVOT.ITEM",
      316: "PIVOT.ADD.FIELDS",
      318: "OPTIONS.CALCULATION",
      319: "OPTIONS.EDIT",
      320: "OPTIONS.VIEW",
      321: "ADDIN.MANAGER",
      322: "MENU.EDITOR",
      323: "ATTACH.TOOLBARS",
      324: "VBAActivate",
      325: "OPTIONS.CHART",
      328: "VBA.INSERT.FILE",
      330: "VBA.PROCEDURE.DEFINITION",
      336: "ROUTING.SLIP",
      338: "ROUTE.DOCUMENT",
      339: "MAIL.LOGON",
      342: "INSERT.PICTURE",
      343: "EDIT.TOOL",
      344: "GALLERY.DOUGHNUT",
      350: "CHART.TREND",
      352: "PIVOT.ITEM.PROPERTIES",
      354: "WORKBOOK.INSERT",
      355: "OPTIONS.TRANSITION",
      356: "OPTIONS.GENERAL",
      370: "FILTER.ADVANCED",
      373: "MAIL.ADD.MAILER",
      374: "MAIL.DELETE.MAILER",
      375: "MAIL.REPLY",
      376: "MAIL.REPLY.ALL",
      377: "MAIL.FORWARD",
      378: "MAIL.NEXT.LETTER",
      379: "DATA.LABEL",
      380: "INSERT.TITLE",
      381: "FONT.PROPERTIES",
      382: "MACRO.OPTIONS",
      383: "WORKBOOK.HIDE",
      384: "WORKBOOK.UNHIDE",
      385: "WORKBOOK.DELETE",
      386: "WORKBOOK.NAME",
      388: "GALLERY.CUSTOM",
      390: "ADD.CHART.AUTOFORMAT",
      391: "DELETE.CHART.AUTOFORMAT",
      392: "CHART.ADD.DATA",
      393: "AUTO.OUTLINE",
      394: "TAB.ORDER",
      395: "SHOW.DIALOG",
      396: "SELECT.ALL",
      397: "UNGROUP.SHEETS",
      398: "SUBTOTAL.CREATE",
      399: "SUBTOTAL.REMOVE",
      400: "RENAME.OBJECT",
      412: "WORKBOOK.SCROLL",
      413: "WORKBOOK.NEXT",
      414: "WORKBOOK.PREV",
      415: "WORKBOOK.TAB.SPLIT",
      416: "FULL.SCREEN",
      417: "WORKBOOK.PROTECT",
      420: "SCROLLBAR.PROPERTIES",
      421: "PIVOT.SHOW.PAGES",
      422: "TEXT.TO.COLUMNS",
      423: "FORMAT.CHARTTYPE",
      424: "LINK.FORMAT",
      425: "TRACER.DISPLAY",
      430: "TRACER.NAVIGATE",
      431: "TRACER.CLEAR",
      432: "TRACER.ERROR",
      433: "PIVOT.FIELD.GROUP",
      434: "PIVOT.FIELD.UNGROUP",
      435: "CHECKBOX.PROPERTIES",
      436: "LABEL.PROPERTIES",
      437: "LISTBOX.PROPERTIES",
      438: "EDITBOX.PROPERTIES",
      439: "PIVOT.REFRESH",
      440: "LINK.COMBO",
      441: "OPEN.TEXT",
      442: "HIDE.DIALOG",
      443: "SET.DIALOG.FOCUS",
      444: "ENABLE.OBJECT",
      445: "PUSHBUTTON.PROPERTIES",
      446: "SET.DIALOG.DEFAULT",
      447: "FILTER",
      448: "FILTER.SHOW.ALL",
      449: "CLEAR.OUTLINE",
      450: "FUNCTION.WIZARD",
      451: "ADD.LIST.ITEM",
      452: "SET.LIST.ITEM",
      453: "REMOVE.LIST.ITEM",
      454: "SELECT.LIST.ITEM",
      455: "SET.CONTROL.VALUE",
      456: "SAVE.COPY.AS",
      458: "OPTIONS.LISTS.ADD",
      459: "OPTIONS.LISTS.DELETE",
      460: "SERIES.AXES",
      461: "SERIES.X",
      462: "SERIES.Y",
      463: "ERRORBAR.X",
      464: "ERRORBAR.Y",
      465: "FORMAT.CHART",
      466: "SERIES.ORDER",
      467: "MAIL.LOGOFF",
      468: "CLEAR.ROUTING.SLIP",
      469: "APP.ACTIVATE.MICROSOFT",
      470: "MAIL.EDIT.MAILER",
      471: "ON.SHEET",
      472: "STANDARD.WIDTH",
      473: "SCENARIO.MERGE",
      474: "SUMMARY.INFO",
      475: "FIND.FILE",
      476: "ACTIVE.CELL.FONT",
      477: "ENABLE.TIPWIZARD",
      478: "VBA.MAKE.ADDIN",
      480: "INSERTDATATABLE",
      481: "WORKGROUP.OPTIONS",
      482: "MAIL.SEND.MAILER",
      485: "AUTOCORRECT",
      489: "POST.DOCUMENT",
      491: "PICKLIST",
      493: "VIEW.SHOW",
      494: "VIEW.DEFINE",
      495: "VIEW.DELETE",
      509: "SHEET.BACKGROUND",
      510: "INSERT.MAP.OBJECT",
      511: "OPTIONS.MENONO",
      517: "MSOCHECKS",
      518: "NORMAL",
      519: "LAYOUT",
      520: "RM.PRINT.AREA",
      521: "CLEAR.PRINT.AREA",
      522: "ADD.PRINT.AREA",
      523: "MOVE.BRK",
      545: "HIDECURR.NOTE",
      546: "HIDEALL.NOTES",
      547: "DELETE.NOTE",
      548: "TRAVERSE.NOTES",
      549: "ACTIVATE.NOTES",
      620: "PROTECT.REVISIONS",
      621: "UNPROTECT.REVISIONS",
      647: "OPTIONS.ME",
      653: "WEB.PUBLISH",
      667: "NEWWEBQUERY",
      673: "PIVOT.TABLE.CHART",
      753: "OPTIONS.SAVE",
      755: "OPTIONS.SPELL",
      808: "HIDEALL.INKANNOTS"
    };
    var Ftab = {
      0: "COUNT",
      1: "IF",
      2: "ISNA",
      3: "ISERROR",
      4: "SUM",
      5: "AVERAGE",
      6: "MIN",
      7: "MAX",
      8: "ROW",
      9: "COLUMN",
      10: "NA",
      11: "NPV",
      12: "STDEV",
      13: "DOLLAR",
      14: "FIXED",
      15: "SIN",
      16: "COS",
      17: "TAN",
      18: "ATAN",
      19: "PI",
      20: "SQRT",
      21: "EXP",
      22: "LN",
      23: "LOG10",
      24: "ABS",
      25: "INT",
      26: "SIGN",
      27: "ROUND",
      28: "LOOKUP",
      29: "INDEX",
      30: "REPT",
      31: "MID",
      32: "LEN",
      33: "VALUE",
      34: "TRUE",
      35: "FALSE",
      36: "AND",
      37: "OR",
      38: "NOT",
      39: "MOD",
      40: "DCOUNT",
      41: "DSUM",
      42: "DAVERAGE",
      43: "DMIN",
      44: "DMAX",
      45: "DSTDEV",
      46: "VAR",
      47: "DVAR",
      48: "TEXT",
      49: "LINEST",
      50: "TREND",
      51: "LOGEST",
      52: "GROWTH",
      53: "GOTO",
      54: "HALT",
      55: "RETURN",
      56: "PV",
      57: "FV",
      58: "NPER",
      59: "PMT",
      60: "RATE",
      61: "MIRR",
      62: "IRR",
      63: "RAND",
      64: "MATCH",
      65: "DATE",
      66: "TIME",
      67: "DAY",
      68: "MONTH",
      69: "YEAR",
      70: "WEEKDAY",
      71: "HOUR",
      72: "MINUTE",
      73: "SECOND",
      74: "NOW",
      75: "AREAS",
      76: "ROWS",
      77: "COLUMNS",
      78: "OFFSET",
      79: "ABSREF",
      80: "RELREF",
      81: "ARGUMENT",
      82: "SEARCH",
      83: "TRANSPOSE",
      84: "ERROR",
      85: "STEP",
      86: "TYPE",
      87: "ECHO",
      88: "SET.NAME",
      89: "CALLER",
      90: "DEREF",
      91: "WINDOWS",
      92: "SERIES",
      93: "DOCUMENTS",
      94: "ACTIVE.CELL",
      95: "SELECTION",
      96: "RESULT",
      97: "ATAN2",
      98: "ASIN",
      99: "ACOS",
      100: "CHOOSE",
      101: "HLOOKUP",
      102: "VLOOKUP",
      103: "LINKS",
      104: "INPUT",
      105: "ISREF",
      106: "GET.FORMULA",
      107: "GET.NAME",
      108: "SET.VALUE",
      109: "LOG",
      110: "EXEC",
      111: "CHAR",
      112: "LOWER",
      113: "UPPER",
      114: "PROPER",
      115: "LEFT",
      116: "RIGHT",
      117: "EXACT",
      118: "TRIM",
      119: "REPLACE",
      120: "SUBSTITUTE",
      121: "CODE",
      122: "NAMES",
      123: "DIRECTORY",
      124: "FIND",
      125: "CELL",
      126: "ISERR",
      127: "ISTEXT",
      128: "ISNUMBER",
      129: "ISBLANK",
      130: "T",
      131: "N",
      132: "FOPEN",
      133: "FCLOSE",
      134: "FSIZE",
      135: "FREADLN",
      136: "FREAD",
      137: "FWRITELN",
      138: "FWRITE",
      139: "FPOS",
      140: "DATEVALUE",
      141: "TIMEVALUE",
      142: "SLN",
      143: "SYD",
      144: "DDB",
      145: "GET.DEF",
      146: "REFTEXT",
      147: "TEXTREF",
      148: "INDIRECT",
      149: "REGISTER",
      150: "CALL",
      151: "ADD.BAR",
      152: "ADD.MENU",
      153: "ADD.COMMAND",
      154: "ENABLE.COMMAND",
      155: "CHECK.COMMAND",
      156: "RENAME.COMMAND",
      157: "SHOW.BAR",
      158: "DELETE.MENU",
      159: "DELETE.COMMAND",
      160: "GET.CHART.ITEM",
      161: "DIALOG.BOX",
      162: "CLEAN",
      163: "MDETERM",
      164: "MINVERSE",
      165: "MMULT",
      166: "FILES",
      167: "IPMT",
      168: "PPMT",
      169: "COUNTA",
      170: "CANCEL.KEY",
      171: "FOR",
      172: "WHILE",
      173: "BREAK",
      174: "NEXT",
      175: "INITIATE",
      176: "REQUEST",
      177: "POKE",
      178: "EXECUTE",
      179: "TERMINATE",
      180: "RESTART",
      181: "HELP",
      182: "GET.BAR",
      183: "PRODUCT",
      184: "FACT",
      185: "GET.CELL",
      186: "GET.WORKSPACE",
      187: "GET.WINDOW",
      188: "GET.DOCUMENT",
      189: "DPRODUCT",
      190: "ISNONTEXT",
      191: "GET.NOTE",
      192: "NOTE",
      193: "STDEVP",
      194: "VARP",
      195: "DSTDEVP",
      196: "DVARP",
      197: "TRUNC",
      198: "ISLOGICAL",
      199: "DCOUNTA",
      200: "DELETE.BAR",
      201: "UNREGISTER",
      204: "USDOLLAR",
      205: "FINDB",
      206: "SEARCHB",
      207: "REPLACEB",
      208: "LEFTB",
      209: "RIGHTB",
      210: "MIDB",
      211: "LENB",
      212: "ROUNDUP",
      213: "ROUNDDOWN",
      214: "ASC",
      215: "DBCS",
      216: "RANK",
      219: "ADDRESS",
      220: "DAYS360",
      221: "TODAY",
      222: "VDB",
      223: "ELSE",
      224: "ELSE.IF",
      225: "END.IF",
      226: "FOR.CELL",
      227: "MEDIAN",
      228: "SUMPRODUCT",
      229: "SINH",
      230: "COSH",
      231: "TANH",
      232: "ASINH",
      233: "ACOSH",
      234: "ATANH",
      235: "DGET",
      236: "CREATE.OBJECT",
      237: "VOLATILE",
      238: "LAST.ERROR",
      239: "CUSTOM.UNDO",
      240: "CUSTOM.REPEAT",
      241: "FORMULA.CONVERT",
      242: "GET.LINK.INFO",
      243: "TEXT.BOX",
      244: "INFO",
      245: "GROUP",
      246: "GET.OBJECT",
      247: "DB",
      248: "PAUSE",
      251: "RESUME",
      252: "FREQUENCY",
      253: "ADD.TOOLBAR",
      254: "DELETE.TOOLBAR",
      255: "User",
      256: "RESET.TOOLBAR",
      257: "EVALUATE",
      258: "GET.TOOLBAR",
      259: "GET.TOOL",
      260: "SPELLING.CHECK",
      261: "ERROR.TYPE",
      262: "APP.TITLE",
      263: "WINDOW.TITLE",
      264: "SAVE.TOOLBAR",
      265: "ENABLE.TOOL",
      266: "PRESS.TOOL",
      267: "REGISTER.ID",
      268: "GET.WORKBOOK",
      269: "AVEDEV",
      270: "BETADIST",
      271: "GAMMALN",
      272: "BETAINV",
      273: "BINOMDIST",
      274: "CHIDIST",
      275: "CHIINV",
      276: "COMBIN",
      277: "CONFIDENCE",
      278: "CRITBINOM",
      279: "EVEN",
      280: "EXPONDIST",
      281: "FDIST",
      282: "FINV",
      283: "FISHER",
      284: "FISHERINV",
      285: "FLOOR",
      286: "GAMMADIST",
      287: "GAMMAINV",
      288: "CEILING",
      289: "HYPGEOMDIST",
      290: "LOGNORMDIST",
      291: "LOGINV",
      292: "NEGBINOMDIST",
      293: "NORMDIST",
      294: "NORMSDIST",
      295: "NORMINV",
      296: "NORMSINV",
      297: "STANDARDIZE",
      298: "ODD",
      299: "PERMUT",
      300: "POISSON",
      301: "TDIST",
      302: "WEIBULL",
      303: "SUMXMY2",
      304: "SUMX2MY2",
      305: "SUMX2PY2",
      306: "CHITEST",
      307: "CORREL",
      308: "COVAR",
      309: "FORECAST",
      310: "FTEST",
      311: "INTERCEPT",
      312: "PEARSON",
      313: "RSQ",
      314: "STEYX",
      315: "SLOPE",
      316: "TTEST",
      317: "PROB",
      318: "DEVSQ",
      319: "GEOMEAN",
      320: "HARMEAN",
      321: "SUMSQ",
      322: "KURT",
      323: "SKEW",
      324: "ZTEST",
      325: "LARGE",
      326: "SMALL",
      327: "QUARTILE",
      328: "PERCENTILE",
      329: "PERCENTRANK",
      330: "MODE",
      331: "TRIMMEAN",
      332: "TINV",
      334: "MOVIE.COMMAND",
      335: "GET.MOVIE",
      336: "CONCATENATE",
      337: "POWER",
      338: "PIVOT.ADD.DATA",
      339: "GET.PIVOT.TABLE",
      340: "GET.PIVOT.FIELD",
      341: "GET.PIVOT.ITEM",
      342: "RADIANS",
      343: "DEGREES",
      344: "SUBTOTAL",
      345: "SUMIF",
      346: "COUNTIF",
      347: "COUNTBLANK",
      348: "SCENARIO.GET",
      349: "OPTIONS.LISTS.GET",
      350: "ISPMT",
      351: "DATEDIF",
      352: "DATESTRING",
      353: "NUMBERSTRING",
      354: "ROMAN",
      355: "OPEN.DIALOG",
      356: "SAVE.DIALOG",
      357: "VIEW.GET",
      358: "GETPIVOTDATA",
      359: "HYPERLINK",
      360: "PHONETIC",
      361: "AVERAGEA",
      362: "MAXA",
      363: "MINA",
      364: "STDEVPA",
      365: "VARPA",
      366: "STDEVA",
      367: "VARA",
      368: "BAHTTEXT",
      369: "THAIDAYOFWEEK",
      370: "THAIDIGIT",
      371: "THAIMONTHOFYEAR",
      372: "THAINUMSOUND",
      373: "THAINUMSTRING",
      374: "THAISTRINGLENGTH",
      375: "ISTHAIDIGIT",
      376: "ROUNDBAHTDOWN",
      377: "ROUNDBAHTUP",
      378: "THAIYEAR",
      379: "RTD",
      380: "CUBEVALUE",
      381: "CUBEMEMBER",
      382: "CUBEMEMBERPROPERTY",
      383: "CUBERANKEDMEMBER",
      384: "HEX2BIN",
      385: "HEX2DEC",
      386: "HEX2OCT",
      387: "DEC2BIN",
      388: "DEC2HEX",
      389: "DEC2OCT",
      390: "OCT2BIN",
      391: "OCT2HEX",
      392: "OCT2DEC",
      393: "BIN2DEC",
      394: "BIN2OCT",
      395: "BIN2HEX",
      396: "IMSUB",
      397: "IMDIV",
      398: "IMPOWER",
      399: "IMABS",
      400: "IMSQRT",
      401: "IMLN",
      402: "IMLOG2",
      403: "IMLOG10",
      404: "IMSIN",
      405: "IMCOS",
      406: "IMEXP",
      407: "IMARGUMENT",
      408: "IMCONJUGATE",
      409: "IMAGINARY",
      410: "IMREAL",
      411: "COMPLEX",
      412: "IMSUM",
      413: "IMPRODUCT",
      414: "SERIESSUM",
      415: "FACTDOUBLE",
      416: "SQRTPI",
      417: "QUOTIENT",
      418: "DELTA",
      419: "GESTEP",
      420: "ISEVEN",
      421: "ISODD",
      422: "MROUND",
      423: "ERF",
      424: "ERFC",
      425: "BESSELJ",
      426: "BESSELK",
      427: "BESSELY",
      428: "BESSELI",
      429: "XIRR",
      430: "XNPV",
      431: "PRICEMAT",
      432: "YIELDMAT",
      433: "INTRATE",
      434: "RECEIVED",
      435: "DISC",
      436: "PRICEDISC",
      437: "YIELDDISC",
      438: "TBILLEQ",
      439: "TBILLPRICE",
      440: "TBILLYIELD",
      441: "PRICE",
      442: "YIELD",
      443: "DOLLARDE",
      444: "DOLLARFR",
      445: "NOMINAL",
      446: "EFFECT",
      447: "CUMPRINC",
      448: "CUMIPMT",
      449: "EDATE",
      450: "EOMONTH",
      451: "YEARFRAC",
      452: "COUPDAYBS",
      453: "COUPDAYS",
      454: "COUPDAYSNC",
      455: "COUPNCD",
      456: "COUPNUM",
      457: "COUPPCD",
      458: "DURATION",
      459: "MDURATION",
      460: "ODDLPRICE",
      461: "ODDLYIELD",
      462: "ODDFPRICE",
      463: "ODDFYIELD",
      464: "RANDBETWEEN",
      465: "WEEKNUM",
      466: "AMORDEGRC",
      467: "AMORLINC",
      468: "CONVERT",
      724: "SHEETJS",
      469: "ACCRINT",
      470: "ACCRINTM",
      471: "WORKDAY",
      472: "NETWORKDAYS",
      473: "GCD",
      474: "MULTINOMIAL",
      475: "LCM",
      476: "FVSCHEDULE",
      477: "CUBEKPIMEMBER",
      478: "CUBESET",
      479: "CUBESETCOUNT",
      480: "IFERROR",
      481: "COUNTIFS",
      482: "SUMIFS",
      483: "AVERAGEIF",
      484: "AVERAGEIFS"
    };
    var FtabArgc = {
      2: 1,
      3: 1,
      10: 0,
      15: 1,
      16: 1,
      17: 1,
      18: 1,
      19: 0,
      20: 1,
      21: 1,
      22: 1,
      23: 1,
      24: 1,
      25: 1,
      26: 1,
      27: 2,
      30: 2,
      31: 3,
      32: 1,
      33: 1,
      34: 0,
      35: 0,
      38: 1,
      39: 2,
      40: 3,
      41: 3,
      42: 3,
      43: 3,
      44: 3,
      45: 3,
      47: 3,
      48: 2,
      53: 1,
      61: 3,
      63: 0,
      65: 3,
      66: 3,
      67: 1,
      68: 1,
      69: 1,
      70: 1,
      71: 1,
      72: 1,
      73: 1,
      74: 0,
      75: 1,
      76: 1,
      77: 1,
      79: 2,
      80: 2,
      83: 1,
      85: 0,
      86: 1,
      89: 0,
      90: 1,
      94: 0,
      95: 0,
      97: 2,
      98: 1,
      99: 1,
      101: 3,
      102: 3,
      105: 1,
      106: 1,
      108: 2,
      111: 1,
      112: 1,
      113: 1,
      114: 1,
      117: 2,
      118: 1,
      119: 4,
      121: 1,
      126: 1,
      127: 1,
      128: 1,
      129: 1,
      130: 1,
      131: 1,
      133: 1,
      134: 1,
      135: 1,
      136: 2,
      137: 2,
      138: 2,
      140: 1,
      141: 1,
      142: 3,
      143: 4,
      144: 4,
      161: 1,
      162: 1,
      163: 1,
      164: 1,
      165: 2,
      172: 1,
      175: 2,
      176: 2,
      177: 3,
      178: 2,
      179: 1,
      184: 1,
      186: 1,
      189: 3,
      190: 1,
      195: 3,
      196: 3,
      197: 1,
      198: 1,
      199: 3,
      201: 1,
      207: 4,
      210: 3,
      211: 1,
      212: 2,
      213: 2,
      214: 1,
      215: 1,
      225: 0,
      229: 1,
      230: 1,
      231: 1,
      232: 1,
      233: 1,
      234: 1,
      235: 3,
      244: 1,
      247: 4,
      252: 2,
      257: 1,
      261: 1,
      271: 1,
      273: 4,
      274: 2,
      275: 2,
      276: 2,
      277: 3,
      278: 3,
      279: 1,
      280: 3,
      281: 3,
      282: 3,
      283: 1,
      284: 1,
      285: 2,
      286: 4,
      287: 3,
      288: 2,
      289: 4,
      290: 3,
      291: 3,
      292: 3,
      293: 4,
      294: 1,
      295: 3,
      296: 1,
      297: 3,
      298: 1,
      299: 2,
      300: 3,
      301: 3,
      302: 4,
      303: 2,
      304: 2,
      305: 2,
      306: 2,
      307: 2,
      308: 2,
      309: 3,
      310: 2,
      311: 2,
      312: 2,
      313: 2,
      314: 2,
      315: 2,
      316: 4,
      325: 2,
      326: 2,
      327: 2,
      328: 2,
      331: 2,
      332: 2,
      337: 2,
      342: 1,
      343: 1,
      346: 2,
      347: 1,
      350: 4,
      351: 3,
      352: 1,
      353: 2,
      360: 1,
      368: 1,
      369: 1,
      370: 1,
      371: 1,
      372: 1,
      373: 1,
      374: 1,
      375: 1,
      376: 1,
      377: 1,
      378: 1,
      382: 3,
      385: 1,
      392: 1,
      393: 1,
      396: 2,
      397: 2,
      398: 2,
      399: 1,
      400: 1,
      401: 1,
      402: 1,
      403: 1,
      404: 1,
      405: 1,
      406: 1,
      407: 1,
      408: 1,
      409: 1,
      410: 1,
      414: 4,
      415: 1,
      416: 1,
      417: 2,
      420: 1,
      421: 1,
      422: 2,
      424: 1,
      425: 2,
      426: 2,
      427: 2,
      428: 2,
      430: 3,
      438: 3,
      439: 3,
      440: 3,
      443: 2,
      444: 2,
      445: 2,
      446: 2,
      447: 6,
      448: 6,
      449: 2,
      450: 2,
      464: 2,
      468: 3,
      476: 2,
      479: 1,
      480: 2,
      65535: 0
    };
    function csf_to_ods_formula(f2) {
      var o2 = "of:=" + f2.replace(crefregex, "$1[.$2$3$4$5]").replace(/\]:\[/g, ":");
      return o2.replace(/;/g, "|").replace(/,/g, ";");
    }
    function csf_to_ods_3D(r) {
      return r.replace(/\./, "!");
    }
    var browser_has_Map = typeof Map !== "undefined";
    function get_sst_id(sst, str, rev) {
      var i2 = 0, len2 = sst.length;
      if (rev) {
        if (browser_has_Map ? rev.has(str) : Object.prototype.hasOwnProperty.call(rev, str)) {
          var revarr = browser_has_Map ? rev.get(str) : rev[str];
          for (; i2 < revarr.length; ++i2) {
            if (sst[revarr[i2]].t === str) {
              sst.Count++;
              return revarr[i2];
            }
          }
        }
      } else for (; i2 < len2; ++i2) {
        if (sst[i2].t === str) {
          sst.Count++;
          return i2;
        }
      }
      sst[len2] = { t: str };
      sst.Count++;
      sst.Unique++;
      if (rev) {
        if (browser_has_Map) {
          if (!rev.has(str)) rev.set(str, []);
          rev.get(str).push(len2);
        } else {
          if (!Object.prototype.hasOwnProperty.call(rev, str)) rev[str] = [];
          rev[str].push(len2);
        }
      }
      return len2;
    }
    function col_obj_w(C2, col) {
      var p2 = { min: C2 + 1, max: C2 + 1 };
      var wch = -1;
      if (col.MDW) MDW = col.MDW;
      if (col.width != null) p2.customWidth = 1;
      else if (col.wpx != null) wch = px2char(col.wpx);
      else if (col.wch != null) wch = col.wch;
      if (wch > -1) {
        p2.width = char2width(wch);
        p2.customWidth = 1;
      } else if (col.width != null) p2.width = col.width;
      if (col.hidden) p2.hidden = true;
      if (col.level != null) {
        p2.outlineLevel = p2.level = col.level;
      }
      return p2;
    }
    function default_margins(margins, mode) {
      if (!margins) return;
      var defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3];
      if (margins.left == null) margins.left = defs[0];
      if (margins.right == null) margins.right = defs[1];
      if (margins.top == null) margins.top = defs[2];
      if (margins.bottom == null) margins.bottom = defs[3];
      if (margins.header == null) margins.header = defs[4];
      if (margins.footer == null) margins.footer = defs[5];
    }
    function get_cell_style(styles, cell, opts) {
      var z2 = opts.revssf[cell.z != null ? cell.z : "General"];
      var i2 = 60, len2 = styles.length;
      if (z2 == null && opts.ssf) {
        for (; i2 < 392; ++i2) if (opts.ssf[i2] == null) {
          SSF_load(cell.z, i2);
          opts.ssf[i2] = cell.z;
          opts.revssf[cell.z] = z2 = i2;
          break;
        }
      }
      for (i2 = 0; i2 != len2; ++i2) if (styles[i2].numFmtId === z2) return i2;
      styles[len2] = {
        numFmtId: z2,
        fontId: 0,
        fillId: 0,
        borderId: 0,
        xfId: 0,
        applyNumberFormat: 1
      };
      return len2;
    }
    function check_ws(ws, sname, i2) {
      if (ws && ws["!ref"]) {
        var range2 = safe_decode_range(ws["!ref"]);
        if (range2.e.c < range2.s.c || range2.e.r < range2.s.r) throw new Error("Bad range (" + i2 + "): " + ws["!ref"]);
      }
    }
    function write_ws_xml_merges(merges) {
      if (merges.length === 0) return "";
      var o2 = '<mergeCells count="' + merges.length + '">';
      for (var i2 = 0; i2 != merges.length; ++i2) o2 += '<mergeCell ref="' + encode_range(merges[i2]) + '"/>';
      return o2 + "</mergeCells>";
    }
    function write_ws_xml_sheetpr(ws, wb, idx, opts, o2) {
      var needed = false;
      var props2 = {}, payload = null;
      if (opts.bookType !== "xlsx" && wb.vbaraw) {
        var cname = wb.SheetNames[idx];
        try {
          if (wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname;
        } catch (e2) {
        }
        needed = true;
        props2.codeName = utf8write(escapexml(cname));
      }
      if (ws && ws["!outline"]) {
        var outlineprops = { summaryBelow: 1, summaryRight: 1 };
        if (ws["!outline"].above) outlineprops.summaryBelow = 0;
        if (ws["!outline"].left) outlineprops.summaryRight = 0;
        payload = (payload || "") + writextag("outlinePr", null, outlineprops);
      }
      if (!needed && !payload) return;
      o2[o2.length] = writextag("sheetPr", payload, props2);
    }
    var sheetprot_deffalse = ["objects", "scenarios", "selectLockedCells", "selectUnlockedCells"];
    var sheetprot_deftrue = [
      "formatColumns",
      "formatRows",
      "formatCells",
      "insertColumns",
      "insertRows",
      "insertHyperlinks",
      "deleteColumns",
      "deleteRows",
      "sort",
      "autoFilter",
      "pivotTables"
    ];
    function write_ws_xml_protection(sp) {
      var o2 = { sheet: 1 };
      sheetprot_deffalse.forEach(function(n) {
        if (sp[n] != null && sp[n]) o2[n] = "1";
      });
      sheetprot_deftrue.forEach(function(n) {
        if (sp[n] != null && !sp[n]) o2[n] = "0";
      });
      if (sp.password) o2.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase();
      return writextag("sheetProtection", null, o2);
    }
    function write_ws_xml_margins(margin) {
      default_margins(margin);
      return writextag("pageMargins", null, margin);
    }
    function write_ws_xml_cols(ws, cols) {
      var o2 = ["<cols>"], col;
      for (var i2 = 0; i2 != cols.length; ++i2) {
        if (!(col = cols[i2])) continue;
        o2[o2.length] = writextag("col", null, col_obj_w(i2, col));
      }
      o2[o2.length] = "</cols>";
      return o2.join("");
    }
    function write_ws_xml_autofilter(data, ws, wb, idx) {
      var ref2 = typeof data.ref == "string" ? data.ref : encode_range(data.ref);
      if (!wb.Workbook) wb.Workbook = { Sheets: [] };
      if (!wb.Workbook.Names) wb.Workbook.Names = [];
      var names2 = wb.Workbook.Names;
      var range2 = decode_range(ref2);
      if (range2.s.r == range2.e.r) {
        range2.e.r = decode_range(ws["!ref"]).e.r;
        ref2 = encode_range(range2);
      }
      for (var i2 = 0; i2 < names2.length; ++i2) {
        var name = names2[i2];
        if (name.Name != "_xlnm._FilterDatabase") continue;
        if (name.Sheet != idx) continue;
        name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref2;
        break;
      }
      if (i2 == names2.length) names2.push({ Name: "_xlnm._FilterDatabase", Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref2 });
      return writextag("autoFilter", null, { ref: ref2 });
    }
    function write_ws_xml_sheetviews(ws, opts, idx, wb) {
      var sview = { workbookViewId: "0" };
      if ((((wb || {}).Workbook || {}).Views || [])[0]) sview.rightToLeft = wb.Workbook.Views[0].RTL ? "1" : "0";
      return writextag("sheetViews", writextag("sheetView", null, sview), {});
    }
    function write_ws_xml_cell(cell, ref2, ws, opts) {
      if (cell.c) ws["!comments"].push([ref2, cell.c]);
      if (cell.v === void 0 && typeof cell.f !== "string" || cell.t === "z" && !cell.f) return "";
      var vv = "";
      var oldt = cell.t, oldv = cell.v;
      if (cell.t !== "z") switch (cell.t) {
        case "b":
          vv = cell.v ? "1" : "0";
          break;
        case "n":
          vv = "" + cell.v;
          break;
        case "e":
          vv = BErr[cell.v];
          break;
        case "d":
          if (opts && opts.cellDates) vv = parseDate(cell.v, -1).toISOString();
          else {
            cell = dup(cell);
            cell.t = "n";
            vv = "" + (cell.v = datenum(parseDate(cell.v)));
          }
          if (typeof cell.z === "undefined") cell.z = table_fmt[14];
          break;
        default:
          vv = cell.v;
          break;
      }
      var v4 = writetag("v", escapexml(vv)), o2 = { r: ref2 };
      var os = get_cell_style(opts.cellXfs, cell, opts);
      if (os !== 0) o2.s = os;
      switch (cell.t) {
        case "n":
          break;
        case "d":
          o2.t = "d";
          break;
        case "b":
          o2.t = "b";
          break;
        case "e":
          o2.t = "e";
          break;
        case "z":
          break;
        default:
          if (cell.v == null) {
            delete cell.t;
            break;
          }
          if (cell.v.length > 32767) throw new Error("Text length must not exceed 32767 characters");
          if (opts && opts.bookSST) {
            v4 = writetag("v", "" + get_sst_id(opts.Strings, cell.v, opts.revStrings));
            o2.t = "s";
            break;
          }
          o2.t = "str";
          break;
      }
      if (cell.t != oldt) {
        cell.t = oldt;
        cell.v = oldv;
      }
      if (typeof cell.f == "string" && cell.f) {
        var ff = cell.F && cell.F.slice(0, ref2.length) == ref2 ? { t: "array", ref: cell.F } : null;
        v4 = writextag("f", escapexml(cell.f), ff) + (cell.v != null ? v4 : "");
      }
      if (cell.l) ws["!links"].push([ref2, cell.l]);
      if (cell.D) o2.cm = 1;
      return writextag("c", v4, o2);
    }
    function write_ws_xml_data(ws, opts, idx, wb) {
      var o2 = [], r = [], range2 = safe_decode_range(ws["!ref"]), cell = "", ref2, rr = "", cols = [], R2 = 0, C2 = 0, rows = ws["!rows"];
      var dense = Array.isArray(ws);
      var params = { r: rr }, row, height = -1;
      for (C2 = range2.s.c; C2 <= range2.e.c; ++C2) cols[C2] = encode_col(C2);
      for (R2 = range2.s.r; R2 <= range2.e.r; ++R2) {
        r = [];
        rr = encode_row(R2);
        for (C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
          ref2 = cols[C2] + rr;
          var _cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
          if (_cell === void 0) continue;
          if ((cell = write_ws_xml_cell(_cell, ref2, ws, opts)) != null) r.push(cell);
        }
        if (r.length > 0 || rows && rows[R2]) {
          params = { r: rr };
          if (rows && rows[R2]) {
            row = rows[R2];
            if (row.hidden) params.hidden = 1;
            height = -1;
            if (row.hpx) height = px2pt(row.hpx);
            else if (row.hpt) height = row.hpt;
            if (height > -1) {
              params.ht = height;
              params.customHeight = 1;
            }
            if (row.level) {
              params.outlineLevel = row.level;
            }
          }
          o2[o2.length] = writextag("row", r.join(""), params);
        }
      }
      if (rows) for (; R2 < rows.length; ++R2) {
        if (rows && rows[R2]) {
          params = { r: R2 + 1 };
          row = rows[R2];
          if (row.hidden) params.hidden = 1;
          height = -1;
          if (row.hpx) height = px2pt(row.hpx);
          else if (row.hpt) height = row.hpt;
          if (height > -1) {
            params.ht = height;
            params.customHeight = 1;
          }
          if (row.level) {
            params.outlineLevel = row.level;
          }
          o2[o2.length] = writextag("row", "", params);
        }
      }
      return o2.join("");
    }
    function write_ws_xml(idx, opts, wb, rels) {
      var o2 = [XML_HEADER, writextag("worksheet", null, {
        "xmlns": XMLNS_main[0],
        "xmlns:r": XMLNS.r
      })];
      var s2 = wb.SheetNames[idx], sidx = 0, rdata = "";
      var ws = wb.Sheets[s2];
      if (ws == null) ws = {};
      var ref2 = ws["!ref"] || "A1";
      var range2 = safe_decode_range(ref2);
      if (range2.e.c > 16383 || range2.e.r > 1048575) {
        if (opts.WTF) throw new Error("Range " + ref2 + " exceeds format limit A1:XFD1048576");
        range2.e.c = Math.min(range2.e.c, 16383);
        range2.e.r = Math.min(range2.e.c, 1048575);
        ref2 = encode_range(range2);
      }
      if (!rels) rels = {};
      ws["!comments"] = [];
      var _drawing = [];
      write_ws_xml_sheetpr(ws, wb, idx, opts, o2);
      o2[o2.length] = writextag("dimension", null, { "ref": ref2 });
      o2[o2.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);
      if (opts.sheetFormat) o2[o2.length] = writextag("sheetFormatPr", null, {
        defaultRowHeight: opts.sheetFormat.defaultRowHeight || "16",
        baseColWidth: opts.sheetFormat.baseColWidth || "10",
        outlineLevelRow: opts.sheetFormat.outlineLevelRow || "7"
      });
      if (ws["!cols"] != null && ws["!cols"].length > 0) o2[o2.length] = write_ws_xml_cols(ws, ws["!cols"]);
      o2[sidx = o2.length] = "<sheetData/>";
      ws["!links"] = [];
      if (ws["!ref"] != null) {
        rdata = write_ws_xml_data(ws, opts);
        if (rdata.length > 0) o2[o2.length] = rdata;
      }
      if (o2.length > sidx + 1) {
        o2[o2.length] = "</sheetData>";
        o2[sidx] = o2[sidx].replace("/>", ">");
      }
      if (ws["!protect"]) o2[o2.length] = write_ws_xml_protection(ws["!protect"]);
      if (ws["!autofilter"] != null) o2[o2.length] = write_ws_xml_autofilter(ws["!autofilter"], ws, wb, idx);
      if (ws["!merges"] != null && ws["!merges"].length > 0) o2[o2.length] = write_ws_xml_merges(ws["!merges"]);
      var relc = -1, rel, rId = -1;
      if (
        /*::(*/
        ws["!links"].length > 0
      ) {
        o2[o2.length] = "<hyperlinks>";
        ws["!links"].forEach(function(l2) {
          if (!l2[1].Target) return;
          rel = { "ref": l2[0] };
          if (l2[1].Target.charAt(0) != "#") {
            rId = add_rels(rels, -1, escapexml(l2[1].Target).replace(/#.*$/, ""), RELS.HLINK);
            rel["r:id"] = "rId" + rId;
          }
          if ((relc = l2[1].Target.indexOf("#")) > -1) rel.location = escapexml(l2[1].Target.slice(relc + 1));
          if (l2[1].Tooltip) rel.tooltip = escapexml(l2[1].Tooltip);
          o2[o2.length] = writextag("hyperlink", null, rel);
        });
        o2[o2.length] = "</hyperlinks>";
      }
      delete ws["!links"];
      if (ws["!margins"] != null) o2[o2.length] = write_ws_xml_margins(ws["!margins"]);
      if (!opts || opts.ignoreEC || opts.ignoreEC == void 0) o2[o2.length] = writetag("ignoredErrors", writextag("ignoredError", null, { numberStoredAsText: 1, sqref: ref2 }));
      if (_drawing.length > 0) {
        rId = add_rels(rels, -1, "../drawings/drawing" + (idx + 1) + ".xml", RELS.DRAW);
        o2[o2.length] = writextag("drawing", null, { "r:id": "rId" + rId });
        ws["!drawing"] = _drawing;
      }
      if (ws["!comments"].length > 0) {
        rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx + 1) + ".vml", RELS.VML);
        o2[o2.length] = writextag("legacyDrawing", null, { "r:id": "rId" + rId });
        ws["!legacy"] = rId;
      }
      if (o2.length > 1) {
        o2[o2.length] = "</worksheet>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function parse_BrtRowHdr(data, length) {
      var z2 = {};
      var tgt = data.l + length;
      z2.r = data.read_shift(4);
      data.l += 4;
      var miyRw = data.read_shift(2);
      data.l += 1;
      var flags = data.read_shift(1);
      data.l = tgt;
      if (flags & 7) z2.level = flags & 7;
      if (flags & 16) z2.hidden = true;
      if (flags & 32) z2.hpt = miyRw / 20;
      return z2;
    }
    function write_BrtRowHdr(R2, range2, ws) {
      var o2 = new_buf(17 + 8 * 16);
      var row = (ws["!rows"] || [])[R2] || {};
      o2.write_shift(4, R2);
      o2.write_shift(4, 0);
      var miyRw = 320;
      if (row.hpx) miyRw = px2pt(row.hpx) * 20;
      else if (row.hpt) miyRw = row.hpt * 20;
      o2.write_shift(2, miyRw);
      o2.write_shift(1, 0);
      var flags = 0;
      if (row.level) flags |= row.level;
      if (row.hidden) flags |= 16;
      if (row.hpx || row.hpt) flags |= 32;
      o2.write_shift(1, flags);
      o2.write_shift(1, 0);
      var ncolspan = 0, lcs = o2.l;
      o2.l += 4;
      var caddr = { r: R2, c: 0 };
      for (var i2 = 0; i2 < 16; ++i2) {
        if (range2.s.c > i2 + 1 << 10 || range2.e.c < i2 << 10) continue;
        var first = -1, last2 = -1;
        for (var j = i2 << 10; j < i2 + 1 << 10; ++j) {
          caddr.c = j;
          var cell = Array.isArray(ws) ? (ws[caddr.r] || [])[caddr.c] : ws[encode_cell(caddr)];
          if (cell) {
            if (first < 0) first = j;
            last2 = j;
          }
        }
        if (first < 0) continue;
        ++ncolspan;
        o2.write_shift(4, first);
        o2.write_shift(4, last2);
      }
      var l2 = o2.l;
      o2.l = lcs;
      o2.write_shift(4, ncolspan);
      o2.l = l2;
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_row_header(ba, ws, range2, R2) {
      var o2 = write_BrtRowHdr(R2, range2, ws);
      if (o2.length > 17 || (ws["!rows"] || [])[R2]) write_record(ba, 0, o2);
    }
    var parse_BrtWsDim = parse_UncheckedRfX;
    var write_BrtWsDim = write_UncheckedRfX;
    function parse_BrtWsFmtInfo() {
    }
    function parse_BrtWsProp(data, length) {
      var z2 = {};
      var f2 = data[data.l];
      ++data.l;
      z2.above = !(f2 & 64);
      z2.left = !(f2 & 128);
      data.l += 18;
      z2.name = parse_XLSBCodeName(data);
      return z2;
    }
    function write_BrtWsProp(str, outl, o2) {
      if (o2 == null) o2 = new_buf(84 + 4 * str.length);
      var f2 = 192;
      if (outl) {
        if (outl.above) f2 &= -65;
        if (outl.left) f2 &= -129;
      }
      o2.write_shift(1, f2);
      for (var i2 = 1; i2 < 3; ++i2) o2.write_shift(1, 0);
      write_BrtColor({ auto: 1 }, o2);
      o2.write_shift(-4, -1);
      o2.write_shift(-4, -1);
      write_XLSBCodeName(str, o2);
      return o2.slice(0, o2.l);
    }
    function parse_BrtCellBlank(data) {
      var cell = parse_XLSBCell(data);
      return [cell];
    }
    function write_BrtCellBlank(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(8);
      return write_XLSBCell(ncell, o2);
    }
    function parse_BrtShortBlank(data) {
      var cell = parse_XLSBShortCell(data);
      return [cell];
    }
    function write_BrtShortBlank(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(4);
      return write_XLSBShortCell(ncell, o2);
    }
    function parse_BrtCellBool(data) {
      var cell = parse_XLSBCell(data);
      var fBool = data.read_shift(1);
      return [cell, fBool, "b"];
    }
    function write_BrtCellBool(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(9);
      write_XLSBCell(ncell, o2);
      o2.write_shift(1, cell.v ? 1 : 0);
      return o2;
    }
    function parse_BrtShortBool(data) {
      var cell = parse_XLSBShortCell(data);
      var fBool = data.read_shift(1);
      return [cell, fBool, "b"];
    }
    function write_BrtShortBool(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(5);
      write_XLSBShortCell(ncell, o2);
      o2.write_shift(1, cell.v ? 1 : 0);
      return o2;
    }
    function parse_BrtCellError(data) {
      var cell = parse_XLSBCell(data);
      var bError = data.read_shift(1);
      return [cell, bError, "e"];
    }
    function write_BrtCellError(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(9);
      write_XLSBCell(ncell, o2);
      o2.write_shift(1, cell.v);
      return o2;
    }
    function parse_BrtShortError(data) {
      var cell = parse_XLSBShortCell(data);
      var bError = data.read_shift(1);
      return [cell, bError, "e"];
    }
    function write_BrtShortError(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(8);
      write_XLSBShortCell(ncell, o2);
      o2.write_shift(1, cell.v);
      o2.write_shift(2, 0);
      o2.write_shift(1, 0);
      return o2;
    }
    function parse_BrtCellIsst(data) {
      var cell = parse_XLSBCell(data);
      var isst = data.read_shift(4);
      return [cell, isst, "s"];
    }
    function write_BrtCellIsst(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(12);
      write_XLSBCell(ncell, o2);
      o2.write_shift(4, ncell.v);
      return o2;
    }
    function parse_BrtShortIsst(data) {
      var cell = parse_XLSBShortCell(data);
      var isst = data.read_shift(4);
      return [cell, isst, "s"];
    }
    function write_BrtShortIsst(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(8);
      write_XLSBShortCell(ncell, o2);
      o2.write_shift(4, ncell.v);
      return o2;
    }
    function parse_BrtCellReal(data) {
      var cell = parse_XLSBCell(data);
      var value = parse_Xnum(data);
      return [cell, value, "n"];
    }
    function write_BrtCellReal(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(16);
      write_XLSBCell(ncell, o2);
      write_Xnum(cell.v, o2);
      return o2;
    }
    function parse_BrtShortReal(data) {
      var cell = parse_XLSBShortCell(data);
      var value = parse_Xnum(data);
      return [cell, value, "n"];
    }
    function write_BrtShortReal(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(12);
      write_XLSBShortCell(ncell, o2);
      write_Xnum(cell.v, o2);
      return o2;
    }
    function parse_BrtCellRk(data) {
      var cell = parse_XLSBCell(data);
      var value = parse_RkNumber(data);
      return [cell, value, "n"];
    }
    function write_BrtCellRk(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(12);
      write_XLSBCell(ncell, o2);
      write_RkNumber(cell.v, o2);
      return o2;
    }
    function parse_BrtShortRk(data) {
      var cell = parse_XLSBShortCell(data);
      var value = parse_RkNumber(data);
      return [cell, value, "n"];
    }
    function write_BrtShortRk(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(8);
      write_XLSBShortCell(ncell, o2);
      write_RkNumber(cell.v, o2);
      return o2;
    }
    function parse_BrtCellRString(data) {
      var cell = parse_XLSBCell(data);
      var value = parse_RichStr(data);
      return [cell, value, "is"];
    }
    function parse_BrtCellSt(data) {
      var cell = parse_XLSBCell(data);
      var value = parse_XLWideString(data);
      return [cell, value, "str"];
    }
    function write_BrtCellSt(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(12 + 4 * cell.v.length);
      write_XLSBCell(ncell, o2);
      write_XLWideString(cell.v, o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function parse_BrtShortSt(data) {
      var cell = parse_XLSBShortCell(data);
      var value = parse_XLWideString(data);
      return [cell, value, "str"];
    }
    function write_BrtShortSt(cell, ncell, o2) {
      if (o2 == null) o2 = new_buf(8 + 4 * cell.v.length);
      write_XLSBShortCell(ncell, o2);
      write_XLWideString(cell.v, o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function parse_BrtFmlaBool(data, length, opts) {
      var end2 = data.l + length;
      var cell = parse_XLSBCell(data);
      cell.r = opts["!row"];
      var value = data.read_shift(1);
      var o2 = [cell, value, "b"];
      if (opts.cellFormula) {
        data.l += 2;
        var formula = parse_XLSBCellParsedFormula(data, end2 - data.l, opts);
        o2[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
      } else data.l = end2;
      return o2;
    }
    function parse_BrtFmlaError(data, length, opts) {
      var end2 = data.l + length;
      var cell = parse_XLSBCell(data);
      cell.r = opts["!row"];
      var value = data.read_shift(1);
      var o2 = [cell, value, "e"];
      if (opts.cellFormula) {
        data.l += 2;
        var formula = parse_XLSBCellParsedFormula(data, end2 - data.l, opts);
        o2[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
      } else data.l = end2;
      return o2;
    }
    function parse_BrtFmlaNum(data, length, opts) {
      var end2 = data.l + length;
      var cell = parse_XLSBCell(data);
      cell.r = opts["!row"];
      var value = parse_Xnum(data);
      var o2 = [cell, value, "n"];
      if (opts.cellFormula) {
        data.l += 2;
        var formula = parse_XLSBCellParsedFormula(data, end2 - data.l, opts);
        o2[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
      } else data.l = end2;
      return o2;
    }
    function parse_BrtFmlaString(data, length, opts) {
      var end2 = data.l + length;
      var cell = parse_XLSBCell(data);
      cell.r = opts["!row"];
      var value = parse_XLWideString(data);
      var o2 = [cell, value, "str"];
      if (opts.cellFormula) {
        data.l += 2;
        var formula = parse_XLSBCellParsedFormula(data, end2 - data.l, opts);
        o2[3] = stringify_formula(formula, null, cell, opts.supbooks, opts);
      } else data.l = end2;
      return o2;
    }
    var parse_BrtMergeCell = parse_UncheckedRfX;
    var write_BrtMergeCell = write_UncheckedRfX;
    function write_BrtBeginMergeCells(cnt, o2) {
      if (o2 == null) o2 = new_buf(4);
      o2.write_shift(4, cnt);
      return o2;
    }
    function parse_BrtHLink(data, length) {
      var end2 = data.l + length;
      var rfx = parse_UncheckedRfX(data);
      var relId = parse_XLNullableWideString(data);
      var loc = parse_XLWideString(data);
      var tooltip = parse_XLWideString(data);
      var display2 = parse_XLWideString(data);
      data.l = end2;
      var o2 = { rfx, relId, loc, display: display2 };
      if (tooltip) o2.Tooltip = tooltip;
      return o2;
    }
    function write_BrtHLink(l2, rId) {
      var o2 = new_buf(50 + 4 * (l2[1].Target.length + (l2[1].Tooltip || "").length));
      write_UncheckedRfX({ s: decode_cell(l2[0]), e: decode_cell(l2[0]) }, o2);
      write_RelID("rId" + rId, o2);
      var locidx = l2[1].Target.indexOf("#");
      var loc = locidx == -1 ? "" : l2[1].Target.slice(locidx + 1);
      write_XLWideString(loc || "", o2);
      write_XLWideString(l2[1].Tooltip || "", o2);
      write_XLWideString("", o2);
      return o2.slice(0, o2.l);
    }
    function parse_BrtPane() {
    }
    function parse_BrtArrFmla(data, length, opts) {
      var end2 = data.l + length;
      var rfx = parse_RfX(data);
      var fAlwaysCalc = data.read_shift(1);
      var o2 = [rfx];
      o2[2] = fAlwaysCalc;
      if (opts.cellFormula) {
        var formula = parse_XLSBArrayParsedFormula(data, end2 - data.l, opts);
        o2[1] = formula;
      } else data.l = end2;
      return o2;
    }
    function parse_BrtShrFmla(data, length, opts) {
      var end2 = data.l + length;
      var rfx = parse_UncheckedRfX(data);
      var o2 = [rfx];
      if (opts.cellFormula) {
        var formula = parse_XLSBSharedParsedFormula(data, end2 - data.l, opts);
        o2[1] = formula;
        data.l = end2;
      } else data.l = end2;
      return o2;
    }
    function write_BrtColInfo(C2, col, o2) {
      if (o2 == null) o2 = new_buf(18);
      var p2 = col_obj_w(C2, col);
      o2.write_shift(-4, C2);
      o2.write_shift(-4, C2);
      o2.write_shift(4, (p2.width || 10) * 256);
      o2.write_shift(
        4,
        0
        /*ixfe*/
      );
      var flags = 0;
      if (col.hidden) flags |= 1;
      if (typeof p2.width == "number") flags |= 2;
      if (col.level) flags |= col.level << 8;
      o2.write_shift(2, flags);
      return o2;
    }
    var BrtMarginKeys = ["left", "right", "top", "bottom", "header", "footer"];
    function parse_BrtMargins(data) {
      var margins = {};
      BrtMarginKeys.forEach(function(k2) {
        margins[k2] = parse_Xnum(data);
      });
      return margins;
    }
    function write_BrtMargins(margins, o2) {
      if (o2 == null) o2 = new_buf(6 * 8);
      default_margins(margins);
      BrtMarginKeys.forEach(function(k2) {
        write_Xnum(margins[k2], o2);
      });
      return o2;
    }
    function parse_BrtBeginWsView(data) {
      var f2 = data.read_shift(2);
      data.l += 28;
      return { RTL: f2 & 32 };
    }
    function write_BrtBeginWsView(ws, Workbook, o2) {
      if (o2 == null) o2 = new_buf(30);
      var f2 = 924;
      if ((((Workbook || {}).Views || [])[0] || {}).RTL) f2 |= 32;
      o2.write_shift(2, f2);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(1, 0);
      o2.write_shift(1, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 100);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(2, 0);
      o2.write_shift(4, 0);
      return o2;
    }
    function write_BrtCellIgnoreEC(ref2) {
      var o2 = new_buf(24);
      o2.write_shift(4, 4);
      o2.write_shift(4, 1);
      write_UncheckedRfX(ref2, o2);
      return o2;
    }
    function write_BrtSheetProtection(sp, o2) {
      if (o2 == null) o2 = new_buf(16 * 4 + 2);
      o2.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0);
      o2.write_shift(4, 1);
      [
        ["objects", false],
        // fObjects
        ["scenarios", false],
        // fScenarios
        ["formatCells", true],
        // fFormatCells
        ["formatColumns", true],
        // fFormatColumns
        ["formatRows", true],
        // fFormatRows
        ["insertColumns", true],
        // fInsertColumns
        ["insertRows", true],
        // fInsertRows
        ["insertHyperlinks", true],
        // fInsertHyperlinks
        ["deleteColumns", true],
        // fDeleteColumns
        ["deleteRows", true],
        // fDeleteRows
        ["selectLockedCells", false],
        // fSelLockedCells
        ["sort", true],
        // fSort
        ["autoFilter", true],
        // fAutoFilter
        ["pivotTables", true],
        // fPivotTables
        ["selectUnlockedCells", false]
        // fSelUnlockedCells
      ].forEach(function(n) {
        if (n[1]) o2.write_shift(4, sp[n[0]] != null && !sp[n[0]] ? 1 : 0);
        else o2.write_shift(4, sp[n[0]] != null && sp[n[0]] ? 0 : 1);
      });
      return o2;
    }
    function parse_BrtDVal() {
    }
    function parse_BrtDVal14() {
    }
    function write_ws_bin_cell(ba, cell, R2, C2, opts, ws, last_seen) {
      if (cell.v === void 0) return false;
      var vv = "";
      switch (cell.t) {
        case "b":
          vv = cell.v ? "1" : "0";
          break;
        case "d":
          cell = dup(cell);
          cell.z = cell.z || table_fmt[14];
          cell.v = datenum(parseDate(cell.v));
          cell.t = "n";
          break;
        /* falls through */
        case "n":
        case "e":
          vv = "" + cell.v;
          break;
        default:
          vv = cell.v;
          break;
      }
      var o2 = { r: R2, c: C2 };
      o2.s = get_cell_style(opts.cellXfs, cell, opts);
      if (cell.l) ws["!links"].push([encode_cell(o2), cell.l]);
      if (cell.c) ws["!comments"].push([encode_cell(o2), cell.c]);
      switch (cell.t) {
        case "s":
        case "str":
          if (opts.bookSST) {
            vv = get_sst_id(opts.Strings, cell.v, opts.revStrings);
            o2.t = "s";
            o2.v = vv;
            if (last_seen) write_record(ba, 18, write_BrtShortIsst(cell, o2));
            else write_record(ba, 7, write_BrtCellIsst(cell, o2));
          } else {
            o2.t = "str";
            if (last_seen) write_record(ba, 17, write_BrtShortSt(cell, o2));
            else write_record(ba, 6, write_BrtCellSt(cell, o2));
          }
          return true;
        case "n":
          if (cell.v == (cell.v | 0) && cell.v > -1e3 && cell.v < 1e3) {
            if (last_seen) write_record(ba, 13, write_BrtShortRk(cell, o2));
            else write_record(ba, 2, write_BrtCellRk(cell, o2));
          } else {
            if (last_seen) write_record(ba, 16, write_BrtShortReal(cell, o2));
            else write_record(ba, 5, write_BrtCellReal(cell, o2));
          }
          return true;
        case "b":
          o2.t = "b";
          if (last_seen) write_record(ba, 15, write_BrtShortBool(cell, o2));
          else write_record(ba, 4, write_BrtCellBool(cell, o2));
          return true;
        case "e":
          o2.t = "e";
          if (last_seen) write_record(ba, 14, write_BrtShortError(cell, o2));
          else write_record(ba, 3, write_BrtCellError(cell, o2));
          return true;
      }
      if (last_seen) write_record(ba, 12, write_BrtShortBlank(cell, o2));
      else write_record(ba, 1, write_BrtCellBlank(cell, o2));
      return true;
    }
    function write_CELLTABLE(ba, ws, idx, opts) {
      var range2 = safe_decode_range(ws["!ref"] || "A1"), ref2, rr = "", cols = [];
      write_record(
        ba,
        145
        /* BrtBeginSheetData */
      );
      var dense = Array.isArray(ws);
      var cap = range2.e.r;
      if (ws["!rows"]) cap = Math.max(range2.e.r, ws["!rows"].length - 1);
      for (var R2 = range2.s.r; R2 <= cap; ++R2) {
        rr = encode_row(R2);
        write_row_header(ba, ws, range2, R2);
        var last_seen = false;
        if (R2 <= range2.e.r) for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
          if (R2 === range2.s.r) cols[C2] = encode_col(C2);
          ref2 = cols[C2] + rr;
          var cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
          if (!cell) {
            last_seen = false;
            continue;
          }
          last_seen = write_ws_bin_cell(ba, cell, R2, C2, opts, ws, last_seen);
        }
      }
      write_record(
        ba,
        146
        /* BrtEndSheetData */
      );
    }
    function write_MERGECELLS(ba, ws) {
      if (!ws || !ws["!merges"]) return;
      write_record(ba, 177, write_BrtBeginMergeCells(ws["!merges"].length));
      ws["!merges"].forEach(function(m2) {
        write_record(ba, 176, write_BrtMergeCell(m2));
      });
      write_record(
        ba,
        178
        /* BrtEndMergeCells */
      );
    }
    function write_COLINFOS(ba, ws) {
      if (!ws || !ws["!cols"]) return;
      write_record(
        ba,
        390
        /* BrtBeginColInfos */
      );
      ws["!cols"].forEach(function(m2, i2) {
        if (m2) write_record(ba, 60, write_BrtColInfo(i2, m2));
      });
      write_record(
        ba,
        391
        /* BrtEndColInfos */
      );
    }
    function write_IGNOREECS(ba, ws) {
      if (!ws || !ws["!ref"]) return;
      write_record(
        ba,
        648
        /* BrtBeginCellIgnoreECs */
      );
      write_record(ba, 649, write_BrtCellIgnoreEC(safe_decode_range(ws["!ref"])));
      write_record(
        ba,
        650
        /* BrtEndCellIgnoreECs */
      );
    }
    function write_HLINKS(ba, ws, rels) {
      ws["!links"].forEach(function(l2) {
        if (!l2[1].Target) return;
        var rId = add_rels(rels, -1, l2[1].Target.replace(/#.*$/, ""), RELS.HLINK);
        write_record(ba, 494, write_BrtHLink(l2, rId));
      });
      delete ws["!links"];
    }
    function write_LEGACYDRAWING(ba, ws, idx, rels) {
      if (ws["!comments"].length > 0) {
        var rId = add_rels(rels, -1, "../drawings/vmlDrawing" + (idx + 1) + ".vml", RELS.VML);
        write_record(ba, 551, write_RelID("rId" + rId));
        ws["!legacy"] = rId;
      }
    }
    function write_AUTOFILTER(ba, ws, wb, idx) {
      if (!ws["!autofilter"]) return;
      var data = ws["!autofilter"];
      var ref2 = typeof data.ref === "string" ? data.ref : encode_range(data.ref);
      if (!wb.Workbook) wb.Workbook = { Sheets: [] };
      if (!wb.Workbook.Names) wb.Workbook.Names = [];
      var names2 = wb.Workbook.Names;
      var range2 = decode_range(ref2);
      if (range2.s.r == range2.e.r) {
        range2.e.r = decode_range(ws["!ref"]).e.r;
        ref2 = encode_range(range2);
      }
      for (var i2 = 0; i2 < names2.length; ++i2) {
        var name = names2[i2];
        if (name.Name != "_xlnm._FilterDatabase") continue;
        if (name.Sheet != idx) continue;
        name.Ref = "'" + wb.SheetNames[idx] + "'!" + ref2;
        break;
      }
      if (i2 == names2.length) names2.push({ Name: "_xlnm._FilterDatabase", Sheet: idx, Ref: "'" + wb.SheetNames[idx] + "'!" + ref2 });
      write_record(ba, 161, write_UncheckedRfX(safe_decode_range(ref2)));
      write_record(
        ba,
        162
        /* BrtEndAFilter */
      );
    }
    function write_WSVIEWS2(ba, ws, Workbook) {
      write_record(
        ba,
        133
        /* BrtBeginWsViews */
      );
      {
        write_record(ba, 137, write_BrtBeginWsView(ws, Workbook));
        write_record(
          ba,
          138
          /* BrtEndWsView */
        );
      }
      write_record(
        ba,
        134
        /* BrtEndWsViews */
      );
    }
    function write_SHEETPROTECT(ba, ws) {
      if (!ws["!protect"]) return;
      write_record(ba, 535, write_BrtSheetProtection(ws["!protect"]));
    }
    function write_ws_bin(idx, opts, wb, rels) {
      var ba = buf_array();
      var s2 = wb.SheetNames[idx], ws = wb.Sheets[s2] || {};
      var c2 = s2;
      try {
        if (wb && wb.Workbook) c2 = wb.Workbook.Sheets[idx].CodeName || c2;
      } catch (e2) {
      }
      var r = safe_decode_range(ws["!ref"] || "A1");
      if (r.e.c > 16383 || r.e.r > 1048575) {
        if (opts.WTF) throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:XFD1048576");
        r.e.c = Math.min(r.e.c, 16383);
        r.e.r = Math.min(r.e.c, 1048575);
      }
      ws["!links"] = [];
      ws["!comments"] = [];
      write_record(
        ba,
        129
        /* BrtBeginSheet */
      );
      if (wb.vbaraw || ws["!outline"]) write_record(ba, 147, write_BrtWsProp(c2, ws["!outline"]));
      write_record(ba, 148, write_BrtWsDim(r));
      write_WSVIEWS2(ba, ws, wb.Workbook);
      write_COLINFOS(ba, ws);
      write_CELLTABLE(ba, ws, idx, opts);
      write_SHEETPROTECT(ba, ws);
      write_AUTOFILTER(ba, ws, wb, idx);
      write_MERGECELLS(ba, ws);
      write_HLINKS(ba, ws, rels);
      if (ws["!margins"]) write_record(ba, 476, write_BrtMargins(ws["!margins"]));
      if (!opts || opts.ignoreEC || opts.ignoreEC == void 0) write_IGNOREECS(ba, ws);
      write_LEGACYDRAWING(ba, ws, idx, rels);
      write_record(
        ba,
        130
        /* BrtEndSheet */
      );
      return ba.end();
    }
    function parse_BrtCsProp(data, length) {
      data.l += 10;
      var name = parse_XLWideString(data);
      return { name };
    }
    var WBPropsDef = [
      ["allowRefreshQuery", false, "bool"],
      ["autoCompressPictures", true, "bool"],
      ["backupFile", false, "bool"],
      ["checkCompatibility", false, "bool"],
      ["CodeName", ""],
      ["date1904", false, "bool"],
      ["defaultThemeVersion", 0, "int"],
      ["filterPrivacy", false, "bool"],
      ["hidePivotFieldList", false, "bool"],
      ["promptedSolutions", false, "bool"],
      ["publishItems", false, "bool"],
      ["refreshAllConnections", false, "bool"],
      ["saveExternalLinkValues", true, "bool"],
      ["showBorderUnselectedTables", true, "bool"],
      ["showInkAnnotation", true, "bool"],
      ["showObjects", "all"],
      ["showPivotChartFilter", false, "bool"],
      ["updateLinks", "userSet"]
    ];
    function safe1904(wb) {
      if (!wb.Workbook) return "false";
      if (!wb.Workbook.WBProps) return "false";
      return parsexmlbool(wb.Workbook.WBProps.date1904) ? "true" : "false";
    }
    var badchars = /* @__PURE__ */ "][*?/\\".split("");
    function check_ws_name(n, safe) {
      if (n.length > 31) {
        throw new Error("Sheet names cannot exceed 31 chars");
      }
      var _good = true;
      badchars.forEach(function(c2) {
        if (n.indexOf(c2) == -1) return;
        throw new Error("Sheet name cannot contain : \\ / ? * [ ]");
      });
      return _good;
    }
    function check_wb_names(N2, S2, codes) {
      N2.forEach(function(n, i2) {
        check_ws_name(n);
        for (var j = 0; j < i2; ++j) if (n == N2[j]) throw new Error("Duplicate Sheet Name: " + n);
        if (codes) {
          var cn2 = S2 && S2[i2] && S2[i2].CodeName || n;
          if (cn2.charCodeAt(0) == 95 && cn2.length > 22) throw new Error("Bad Code Name: Worksheet" + cn2);
        }
      });
    }
    function check_wb(wb) {
      if (!wb || !wb.SheetNames || !wb.Sheets) throw new Error("Invalid Workbook");
      if (!wb.SheetNames.length) throw new Error("Workbook is empty");
      var Sheets = wb.Workbook && wb.Workbook.Sheets || [];
      check_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw);
      for (var i2 = 0; i2 < wb.SheetNames.length; ++i2) check_ws(wb.Sheets[wb.SheetNames[i2]], wb.SheetNames[i2], i2);
    }
    function write_wb_xml(wb) {
      var o2 = [XML_HEADER];
      o2[o2.length] = writextag("workbook", null, {
        "xmlns": XMLNS_main[0],
        //'xmlns:mx': XMLNS.mx,
        //'xmlns:s': XMLNS_main[0],
        "xmlns:r": XMLNS.r
      });
      var write_names = wb.Workbook && (wb.Workbook.Names || []).length > 0;
      var workbookPr = { codeName: "ThisWorkbook" };
      if (wb.Workbook && wb.Workbook.WBProps) {
        WBPropsDef.forEach(function(x2) {
          if (wb.Workbook.WBProps[x2[0]] == null) return;
          if (wb.Workbook.WBProps[x2[0]] == x2[1]) return;
          workbookPr[x2[0]] = wb.Workbook.WBProps[x2[0]];
        });
        if (wb.Workbook.WBProps.CodeName) {
          workbookPr.codeName = wb.Workbook.WBProps.CodeName;
          delete workbookPr.CodeName;
        }
      }
      o2[o2.length] = writextag("workbookPr", null, workbookPr);
      var sheets = wb.Workbook && wb.Workbook.Sheets || [];
      var i2 = 0;
      if (sheets && sheets[0] && !!sheets[0].Hidden) {
        o2[o2.length] = "<bookViews>";
        for (i2 = 0; i2 != wb.SheetNames.length; ++i2) {
          if (!sheets[i2]) break;
          if (!sheets[i2].Hidden) break;
        }
        if (i2 == wb.SheetNames.length) i2 = 0;
        o2[o2.length] = '<workbookView firstSheet="' + i2 + '" activeTab="' + i2 + '"/>';
        o2[o2.length] = "</bookViews>";
      }
      o2[o2.length] = "<sheets>";
      for (i2 = 0; i2 != wb.SheetNames.length; ++i2) {
        var sht = { name: escapexml(wb.SheetNames[i2].slice(0, 31)) };
        sht.sheetId = "" + (i2 + 1);
        sht["r:id"] = "rId" + (i2 + 1);
        if (sheets[i2]) switch (sheets[i2].Hidden) {
          case 1:
            sht.state = "hidden";
            break;
          case 2:
            sht.state = "veryHidden";
            break;
        }
        o2[o2.length] = writextag("sheet", null, sht);
      }
      o2[o2.length] = "</sheets>";
      if (write_names) {
        o2[o2.length] = "<definedNames>";
        if (wb.Workbook && wb.Workbook.Names) wb.Workbook.Names.forEach(function(n) {
          var d2 = { name: n.Name };
          if (n.Comment) d2.comment = n.Comment;
          if (n.Sheet != null) d2.localSheetId = "" + n.Sheet;
          if (n.Hidden) d2.hidden = "1";
          if (!n.Ref) return;
          o2[o2.length] = writextag("definedName", escapexml(n.Ref), d2);
        });
        o2[o2.length] = "</definedNames>";
      }
      if (o2.length > 2) {
        o2[o2.length] = "</workbook>";
        o2[1] = o2[1].replace("/>", ">");
      }
      return o2.join("");
    }
    function parse_BrtBundleSh(data, length) {
      var z2 = {};
      z2.Hidden = data.read_shift(4);
      z2.iTabID = data.read_shift(4);
      z2.strRelID = parse_RelID(data);
      z2.name = parse_XLWideString(data);
      return z2;
    }
    function write_BrtBundleSh(data, o2) {
      if (!o2) o2 = new_buf(127);
      o2.write_shift(4, data.Hidden);
      o2.write_shift(4, data.iTabID);
      write_RelID(data.strRelID, o2);
      write_XLWideString(data.name.slice(0, 31), o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function parse_BrtWbProp(data, length) {
      var o2 = {};
      var flags = data.read_shift(4);
      o2.defaultThemeVersion = data.read_shift(4);
      var strName = length > 8 ? parse_XLWideString(data) : "";
      if (strName.length > 0) o2.CodeName = strName;
      o2.autoCompressPictures = !!(flags & 65536);
      o2.backupFile = !!(flags & 64);
      o2.checkCompatibility = !!(flags & 4096);
      o2.date1904 = !!(flags & 1);
      o2.filterPrivacy = !!(flags & 8);
      o2.hidePivotFieldList = !!(flags & 1024);
      o2.promptedSolutions = !!(flags & 16);
      o2.publishItems = !!(flags & 2048);
      o2.refreshAllConnections = !!(flags & 262144);
      o2.saveExternalLinkValues = !!(flags & 128);
      o2.showBorderUnselectedTables = !!(flags & 4);
      o2.showInkAnnotation = !!(flags & 32);
      o2.showObjects = ["all", "placeholders", "none"][flags >> 13 & 3];
      o2.showPivotChartFilter = !!(flags & 32768);
      o2.updateLinks = ["userSet", "never", "always"][flags >> 8 & 3];
      return o2;
    }
    function write_BrtWbProp(data, o2) {
      if (!o2) o2 = new_buf(72);
      var flags = 0;
      if (data) {
        if (data.filterPrivacy) flags |= 8;
      }
      o2.write_shift(4, flags);
      o2.write_shift(4, 0);
      write_XLSBCodeName(data && data.CodeName || "ThisWorkbook", o2);
      return o2.slice(0, o2.l);
    }
    function parse_BrtName(data, length, opts) {
      var end2 = data.l + length;
      data.l += 4;
      data.l += 1;
      var itab = data.read_shift(4);
      var name = parse_XLNameWideString(data);
      var formula = parse_XLSBNameParsedFormula(data, 0, opts);
      var comment = parse_XLNullableWideString(data);
      data.l = end2;
      var out2 = { Name: name, Ptg: formula };
      if (itab < 268435455) out2.Sheet = itab;
      if (comment) out2.Comment = comment;
      return out2;
    }
    function write_BUNDLESHS(ba, wb) {
      write_record(
        ba,
        143
        /* BrtBeginBundleShs */
      );
      for (var idx = 0; idx != wb.SheetNames.length; ++idx) {
        var viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0;
        var d2 = { Hidden: viz, iTabID: idx + 1, strRelID: "rId" + (idx + 1), name: wb.SheetNames[idx] };
        write_record(ba, 156, write_BrtBundleSh(d2));
      }
      write_record(
        ba,
        144
        /* BrtEndBundleShs */
      );
    }
    function write_BrtFileVersion(data, o2) {
      if (!o2) o2 = new_buf(127);
      for (var i2 = 0; i2 != 4; ++i2) o2.write_shift(4, 0);
      write_XLWideString("SheetJS", o2);
      write_XLWideString(XLSX.version, o2);
      write_XLWideString(XLSX.version, o2);
      write_XLWideString("7262", o2);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_BrtBookView(idx, o2) {
      if (!o2) o2 = new_buf(29);
      o2.write_shift(-4, 0);
      o2.write_shift(-4, 460);
      o2.write_shift(4, 28800);
      o2.write_shift(4, 17600);
      o2.write_shift(4, 500);
      o2.write_shift(4, idx);
      o2.write_shift(4, idx);
      var flags = 120;
      o2.write_shift(1, flags);
      return o2.length > o2.l ? o2.slice(0, o2.l) : o2;
    }
    function write_BOOKVIEWS(ba, wb) {
      if (!wb.Workbook || !wb.Workbook.Sheets) return;
      var sheets = wb.Workbook.Sheets;
      var i2 = 0, vistab = -1, hidden = -1;
      for (; i2 < sheets.length; ++i2) {
        if (!sheets[i2] || !sheets[i2].Hidden && vistab == -1) vistab = i2;
        else if (sheets[i2].Hidden == 1 && hidden == -1) hidden = i2;
      }
      if (hidden > vistab) return;
      write_record(
        ba,
        135
        /* BrtBeginBookViews */
      );
      write_record(ba, 158, write_BrtBookView(vistab));
      write_record(
        ba,
        136
        /* BrtEndBookViews */
      );
    }
    function write_wb_bin(wb, opts) {
      var ba = buf_array();
      write_record(
        ba,
        131
        /* BrtBeginBook */
      );
      write_record(ba, 128, write_BrtFileVersion());
      write_record(ba, 153, write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));
      write_BOOKVIEWS(ba, wb);
      write_BUNDLESHS(ba, wb);
      write_record(
        ba,
        132
        /* BrtEndBook */
      );
      return ba.end();
    }
    function write_wb(wb, name, opts) {
      return (name.slice(-4) === ".bin" ? write_wb_bin : write_wb_xml)(wb);
    }
    function write_ws(data, name, opts, wb, rels) {
      return (name.slice(-4) === ".bin" ? write_ws_bin : write_ws_xml)(data, opts, wb, rels);
    }
    function write_sty(data, name, opts) {
      return (name.slice(-4) === ".bin" ? write_sty_bin : write_sty_xml)(data, opts);
    }
    function write_sst(data, name, opts) {
      return (name.slice(-4) === ".bin" ? write_sst_bin : write_sst_xml)(data, opts);
    }
    function write_cmnt(data, name, opts) {
      return (name.slice(-4) === ".bin" ? write_comments_bin : write_comments_xml)(data);
    }
    function write_xlmeta(name) {
      return (name.slice(-4) === ".bin" ? write_xlmeta_bin : write_xlmeta_xml)();
    }
    function write_props_xlml(wb, opts) {
      var o2 = [];
      if (wb.Props) o2.push(xlml_write_docprops(wb.Props, opts));
      if (wb.Custprops) o2.push(xlml_write_custprops(wb.Props, wb.Custprops));
      return o2.join("");
    }
    function write_wb_xlml() {
      return "";
    }
    function write_sty_xlml(wb, opts) {
      var styles = ['<Style ss:ID="Default" ss:Name="Normal"><NumberFormat/></Style>'];
      opts.cellXfs.forEach(function(xf, id) {
        var payload = [];
        payload.push(writextag("NumberFormat", null, { "ss:Format": escapexml(table_fmt[xf.numFmtId]) }));
        var o2 = (
          /*::(*/
          { "ss:ID": "s" + (21 + id) }
        );
        styles.push(writextag("Style", payload.join(""), o2));
      });
      return writextag("Styles", styles.join(""));
    }
    function write_name_xlml(n) {
      return writextag("NamedRange", null, { "ss:Name": n.Name, "ss:RefersTo": "=" + a1_to_rc(n.Ref, { r: 0, c: 0 }) });
    }
    function write_names_xlml(wb) {
      if (!((wb || {}).Workbook || {}).Names) return "";
      var names2 = wb.Workbook.Names;
      var out2 = [];
      for (var i2 = 0; i2 < names2.length; ++i2) {
        var n = names2[i2];
        if (n.Sheet != null) continue;
        if (n.Name.match(/^_xlfn\./)) continue;
        out2.push(write_name_xlml(n));
      }
      return writextag("Names", out2.join(""));
    }
    function write_ws_xlml_names(ws, opts, idx, wb) {
      if (!ws) return "";
      if (!((wb || {}).Workbook || {}).Names) return "";
      var names2 = wb.Workbook.Names;
      var out2 = [];
      for (var i2 = 0; i2 < names2.length; ++i2) {
        var n = names2[i2];
        if (n.Sheet != idx) continue;
        if (n.Name.match(/^_xlfn\./)) continue;
        out2.push(write_name_xlml(n));
      }
      return out2.join("");
    }
    function write_ws_xlml_wsopts(ws, opts, idx, wb) {
      if (!ws) return "";
      var o2 = [];
      if (ws["!margins"]) {
        o2.push("<PageSetup>");
        if (ws["!margins"].header) o2.push(writextag("Header", null, { "x:Margin": ws["!margins"].header }));
        if (ws["!margins"].footer) o2.push(writextag("Footer", null, { "x:Margin": ws["!margins"].footer }));
        o2.push(writextag("PageMargins", null, {
          "x:Bottom": ws["!margins"].bottom || "0.75",
          "x:Left": ws["!margins"].left || "0.7",
          "x:Right": ws["!margins"].right || "0.7",
          "x:Top": ws["!margins"].top || "0.75"
        }));
        o2.push("</PageSetup>");
      }
      if (wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) {
        if (wb.Workbook.Sheets[idx].Hidden) o2.push(writextag("Visible", wb.Workbook.Sheets[idx].Hidden == 1 ? "SheetHidden" : "SheetVeryHidden", {}));
        else {
          for (var i2 = 0; i2 < idx; ++i2) if (wb.Workbook.Sheets[i2] && !wb.Workbook.Sheets[i2].Hidden) break;
          if (i2 == idx) o2.push("<Selected/>");
        }
      }
      if (((((wb || {}).Workbook || {}).Views || [])[0] || {}).RTL) o2.push("<DisplayRightToLeft/>");
      if (ws["!protect"]) {
        o2.push(writetag("ProtectContents", "True"));
        if (ws["!protect"].objects) o2.push(writetag("ProtectObjects", "True"));
        if (ws["!protect"].scenarios) o2.push(writetag("ProtectScenarios", "True"));
        if (ws["!protect"].selectLockedCells != null && !ws["!protect"].selectLockedCells) o2.push(writetag("EnableSelection", "NoSelection"));
        else if (ws["!protect"].selectUnlockedCells != null && !ws["!protect"].selectUnlockedCells) o2.push(writetag("EnableSelection", "UnlockedCells"));
        [
          ["formatCells", "AllowFormatCells"],
          ["formatColumns", "AllowSizeCols"],
          ["formatRows", "AllowSizeRows"],
          ["insertColumns", "AllowInsertCols"],
          ["insertRows", "AllowInsertRows"],
          ["insertHyperlinks", "AllowInsertHyperlinks"],
          ["deleteColumns", "AllowDeleteCols"],
          ["deleteRows", "AllowDeleteRows"],
          ["sort", "AllowSort"],
          ["autoFilter", "AllowFilter"],
          ["pivotTables", "AllowUsePivotTables"]
        ].forEach(function(x2) {
          if (ws["!protect"][x2[0]]) o2.push("<" + x2[1] + "/>");
        });
      }
      if (o2.length == 0) return "";
      return writextag("WorksheetOptions", o2.join(""), { xmlns: XLMLNS.x });
    }
    function write_ws_xlml_comment(comments) {
      return comments.map(function(c2) {
        var t = xlml_unfixstr(c2.t || "");
        var d2 = writextag("ss:Data", t, { "xmlns": "http://www.w3.org/TR/REC-html40" });
        return writextag("Comment", d2, { "ss:Author": c2.a });
      }).join("");
    }
    function write_ws_xlml_cell(cell, ref2, ws, opts, idx, wb, addr) {
      if (!cell || cell.v == void 0 && cell.f == void 0) return "";
      var attr = {};
      if (cell.f) attr["ss:Formula"] = "=" + escapexml(a1_to_rc(cell.f, addr));
      if (cell.F && cell.F.slice(0, ref2.length) == ref2) {
        var end2 = decode_cell(cell.F.slice(ref2.length + 1));
        attr["ss:ArrayRange"] = "RC:R" + (end2.r == addr.r ? "" : "[" + (end2.r - addr.r) + "]") + "C" + (end2.c == addr.c ? "" : "[" + (end2.c - addr.c) + "]");
      }
      if (cell.l && cell.l.Target) {
        attr["ss:HRef"] = escapexml(cell.l.Target);
        if (cell.l.Tooltip) attr["x:HRefScreenTip"] = escapexml(cell.l.Tooltip);
      }
      if (ws["!merges"]) {
        var marr = ws["!merges"];
        for (var mi = 0; mi != marr.length; ++mi) {
          if (marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue;
          if (marr[mi].e.c > marr[mi].s.c) attr["ss:MergeAcross"] = marr[mi].e.c - marr[mi].s.c;
          if (marr[mi].e.r > marr[mi].s.r) attr["ss:MergeDown"] = marr[mi].e.r - marr[mi].s.r;
        }
      }
      var t = "", p2 = "";
      switch (cell.t) {
        case "z":
          if (!opts.sheetStubs) return "";
          break;
        case "n":
          t = "Number";
          p2 = String(cell.v);
          break;
        case "b":
          t = "Boolean";
          p2 = cell.v ? "1" : "0";
          break;
        case "e":
          t = "Error";
          p2 = BErr[cell.v];
          break;
        case "d":
          t = "DateTime";
          p2 = new Date(cell.v).toISOString();
          if (cell.z == null) cell.z = cell.z || table_fmt[14];
          break;
        case "s":
          t = "String";
          p2 = escapexlml(cell.v || "");
          break;
      }
      var os = get_cell_style(opts.cellXfs, cell, opts);
      attr["ss:StyleID"] = "s" + (21 + os);
      attr["ss:Index"] = addr.c + 1;
      var _v = cell.v != null ? p2 : "";
      var m2 = cell.t == "z" ? "" : '<Data ss:Type="' + t + '">' + _v + "</Data>";
      if ((cell.c || []).length > 0) m2 += write_ws_xlml_comment(cell.c);
      return writextag("Cell", m2, attr);
    }
    function write_ws_xlml_row(R2, row) {
      var o2 = '<Row ss:Index="' + (R2 + 1) + '"';
      if (row) {
        if (row.hpt && !row.hpx) row.hpx = pt2px(row.hpt);
        if (row.hpx) o2 += ' ss:AutoFitHeight="0" ss:Height="' + row.hpx + '"';
        if (row.hidden) o2 += ' ss:Hidden="1"';
      }
      return o2 + ">";
    }
    function write_ws_xlml_table(ws, opts, idx, wb) {
      if (!ws["!ref"]) return "";
      var range2 = safe_decode_range(ws["!ref"]);
      var marr = ws["!merges"] || [], mi = 0;
      var o2 = [];
      if (ws["!cols"]) ws["!cols"].forEach(function(n, i2) {
        process_col(n);
        var w2 = !!n.width;
        var p2 = col_obj_w(i2, n);
        var k2 = { "ss:Index": i2 + 1 };
        if (w2) k2["ss:Width"] = width2px(p2.width);
        if (n.hidden) k2["ss:Hidden"] = "1";
        o2.push(writextag("Column", null, k2));
      });
      var dense = Array.isArray(ws);
      for (var R2 = range2.s.r; R2 <= range2.e.r; ++R2) {
        var row = [write_ws_xlml_row(R2, (ws["!rows"] || [])[R2])];
        for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
          var skip = false;
          for (mi = 0; mi != marr.length; ++mi) {
            if (marr[mi].s.c > C2) continue;
            if (marr[mi].s.r > R2) continue;
            if (marr[mi].e.c < C2) continue;
            if (marr[mi].e.r < R2) continue;
            if (marr[mi].s.c != C2 || marr[mi].s.r != R2) skip = true;
            break;
          }
          if (skip) continue;
          var addr = { r: R2, c: C2 };
          var ref2 = encode_cell(addr), cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
          row.push(write_ws_xlml_cell(cell, ref2, ws, opts, idx, wb, addr));
        }
        row.push("</Row>");
        if (row.length > 2) o2.push(row.join(""));
      }
      return o2.join("");
    }
    function write_ws_xlml(idx, opts, wb) {
      var o2 = [];
      var s2 = wb.SheetNames[idx];
      var ws = wb.Sheets[s2];
      var t = ws ? write_ws_xlml_names(ws, opts, idx, wb) : "";
      if (t.length > 0) o2.push("<Names>" + t + "</Names>");
      t = ws ? write_ws_xlml_table(ws, opts, idx, wb) : "";
      if (t.length > 0) o2.push("<Table>" + t + "</Table>");
      o2.push(write_ws_xlml_wsopts(ws, opts, idx, wb));
      return o2.join("");
    }
    function write_xlml(wb, opts) {
      if (!opts) opts = {};
      if (!wb.SSF) wb.SSF = dup(table_fmt);
      if (wb.SSF) {
        make_ssf();
        SSF_load_table(wb.SSF);
        opts.revssf = evert_num(wb.SSF);
        opts.revssf[wb.SSF[65535]] = 0;
        opts.ssf = wb.SSF;
        opts.cellXfs = [];
        get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
      }
      var d2 = [];
      d2.push(write_props_xlml(wb, opts));
      d2.push(write_wb_xlml());
      d2.push("");
      d2.push("");
      for (var i2 = 0; i2 < wb.SheetNames.length; ++i2)
        d2.push(writextag("Worksheet", write_ws_xlml(i2, opts, wb), { "ss:Name": escapexml(wb.SheetNames[i2]) }));
      d2[2] = write_sty_xlml(wb, opts);
      d2[3] = write_names_xlml(wb);
      return XML_HEADER + writextag("Workbook", d2.join(""), {
        "xmlns": XLMLNS.ss,
        "xmlns:o": XLMLNS.o,
        "xmlns:x": XLMLNS.x,
        "xmlns:ss": XLMLNS.ss,
        "xmlns:dt": XLMLNS.dt,
        "xmlns:html": XLMLNS.html
      });
    }
    var PSCLSID = {
      SI: "e0859ff2f94f6810ab9108002b27b3d9",
      DSI: "02d5cdd59c2e1b10939708002b2cf9ae",
      UDI: "05d5cdd59c2e1b10939708002b2cf9ae"
    };
    function write_xls_props(wb, cfb) {
      var DSEntries = [], SEntries = [], CEntries = [];
      var i2 = 0, Keys;
      var DocSummaryRE = evert_key(DocSummaryPIDDSI, "n");
      var SummaryRE = evert_key(SummaryPIDSI, "n");
      if (wb.Props) {
        Keys = keys(wb.Props);
        for (i2 = 0; i2 < Keys.length; ++i2) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i2]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i2]) ? SEntries : CEntries).push([Keys[i2], wb.Props[Keys[i2]]]);
      }
      if (wb.Custprops) {
        Keys = keys(wb.Custprops);
        for (i2 = 0; i2 < Keys.length; ++i2) if (!Object.prototype.hasOwnProperty.call(wb.Props || {}, Keys[i2])) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i2]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i2]) ? SEntries : CEntries).push([Keys[i2], wb.Custprops[Keys[i2]]]);
      }
      var CEntries2 = [];
      for (i2 = 0; i2 < CEntries.length; ++i2) {
        if (XLSPSSkip.indexOf(CEntries[i2][0]) > -1 || PseudoPropsPairs.indexOf(CEntries[i2][0]) > -1) continue;
        if (CEntries[i2][1] == null) continue;
        CEntries2.push(CEntries[i2]);
      }
      if (SEntries.length) CFB.utils.cfb_add(cfb, "/SummaryInformation", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI));
      if (DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, "/DocumentSummaryInformation", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI));
    }
    function write_xlscfb(wb, opts) {
      var o2 = opts || {};
      var cfb = CFB.utils.cfb_new({ root: "R" });
      var wbpath = "/Workbook";
      switch (o2.bookType || "xls") {
        case "xls":
          o2.bookType = "biff8";
        /* falls through */
        case "xla":
          if (!o2.bookType) o2.bookType = "xla";
        /* falls through */
        case "biff8":
          wbpath = "/Workbook";
          o2.biff = 8;
          break;
        case "biff5":
          wbpath = "/Book";
          o2.biff = 5;
          break;
        default:
          throw new Error("invalid type " + o2.bookType + " for XLS CFB");
      }
      CFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o2));
      if (o2.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb);
      if (o2.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, { type: typeof wb.vbaraw == "string" ? "binary" : "buffer" }));
      return cfb;
    }
    var XLSBRecordEnum = {
      /*::[*/
      0: {
        /* n:"BrtRowHdr", */
        f: parse_BrtRowHdr
      },
      /*::[*/
      1: {
        /* n:"BrtCellBlank", */
        f: parse_BrtCellBlank
      },
      /*::[*/
      2: {
        /* n:"BrtCellRk", */
        f: parse_BrtCellRk
      },
      /*::[*/
      3: {
        /* n:"BrtCellError", */
        f: parse_BrtCellError
      },
      /*::[*/
      4: {
        /* n:"BrtCellBool", */
        f: parse_BrtCellBool
      },
      /*::[*/
      5: {
        /* n:"BrtCellReal", */
        f: parse_BrtCellReal
      },
      /*::[*/
      6: {
        /* n:"BrtCellSt", */
        f: parse_BrtCellSt
      },
      /*::[*/
      7: {
        /* n:"BrtCellIsst", */
        f: parse_BrtCellIsst
      },
      /*::[*/
      8: {
        /* n:"BrtFmlaString", */
        f: parse_BrtFmlaString
      },
      /*::[*/
      9: {
        /* n:"BrtFmlaNum", */
        f: parse_BrtFmlaNum
      },
      /*::[*/
      10: {
        /* n:"BrtFmlaBool", */
        f: parse_BrtFmlaBool
      },
      /*::[*/
      11: {
        /* n:"BrtFmlaError", */
        f: parse_BrtFmlaError
      },
      /*::[*/
      12: {
        /* n:"BrtShortBlank", */
        f: parse_BrtShortBlank
      },
      /*::[*/
      13: {
        /* n:"BrtShortRk", */
        f: parse_BrtShortRk
      },
      /*::[*/
      14: {
        /* n:"BrtShortError", */
        f: parse_BrtShortError
      },
      /*::[*/
      15: {
        /* n:"BrtShortBool", */
        f: parse_BrtShortBool
      },
      /*::[*/
      16: {
        /* n:"BrtShortReal", */
        f: parse_BrtShortReal
      },
      /*::[*/
      17: {
        /* n:"BrtShortSt", */
        f: parse_BrtShortSt
      },
      /*::[*/
      18: {
        /* n:"BrtShortIsst", */
        f: parse_BrtShortIsst
      },
      /*::[*/
      19: {
        /* n:"BrtSSTItem", */
        f: parse_RichStr
      },
      /*::[*/
      20: {
        /* n:"BrtPCDIMissing" */
      },
      /*::[*/
      21: {
        /* n:"BrtPCDINumber" */
      },
      /*::[*/
      22: {
        /* n:"BrtPCDIBoolean" */
      },
      /*::[*/
      23: {
        /* n:"BrtPCDIError" */
      },
      /*::[*/
      24: {
        /* n:"BrtPCDIString" */
      },
      /*::[*/
      25: {
        /* n:"BrtPCDIDatetime" */
      },
      /*::[*/
      26: {
        /* n:"BrtPCDIIndex" */
      },
      /*::[*/
      27: {
        /* n:"BrtPCDIAMissing" */
      },
      /*::[*/
      28: {
        /* n:"BrtPCDIANumber" */
      },
      /*::[*/
      29: {
        /* n:"BrtPCDIABoolean" */
      },
      /*::[*/
      30: {
        /* n:"BrtPCDIAError" */
      },
      /*::[*/
      31: {
        /* n:"BrtPCDIAString" */
      },
      /*::[*/
      32: {
        /* n:"BrtPCDIADatetime" */
      },
      /*::[*/
      33: {
        /* n:"BrtPCRRecord" */
      },
      /*::[*/
      34: {
        /* n:"BrtPCRRecordDt" */
      },
      /*::[*/
      35: {
        /* n:"BrtFRTBegin", */
        T: 1
      },
      /*::[*/
      36: {
        /* n:"BrtFRTEnd", */
        T: -1
      },
      /*::[*/
      37: {
        /* n:"BrtACBegin", */
        T: 1
      },
      /*::[*/
      38: {
        /* n:"BrtACEnd", */
        T: -1
      },
      /*::[*/
      39: {
        /* n:"BrtName", */
        f: parse_BrtName
      },
      /*::[*/
      40: {
        /* n:"BrtIndexRowBlock" */
      },
      /*::[*/
      42: {
        /* n:"BrtIndexBlock" */
      },
      /*::[*/
      43: {
        /* n:"BrtFont", */
        f: parse_BrtFont
      },
      /*::[*/
      44: {
        /* n:"BrtFmt", */
        f: parse_BrtFmt
      },
      /*::[*/
      45: {
        /* n:"BrtFill", */
        f: parse_BrtFill
      },
      /*::[*/
      46: {
        /* n:"BrtBorder", */
        f: parse_BrtBorder
      },
      /*::[*/
      47: {
        /* n:"BrtXF", */
        f: parse_BrtXF
      },
      /*::[*/
      48: {
        /* n:"BrtStyle" */
      },
      /*::[*/
      49: {
        /* n:"BrtCellMeta", */
        f: parse_Int32LE
      },
      /*::[*/
      50: {
        /* n:"BrtValueMeta" */
      },
      /*::[*/
      51: {
        /* n:"BrtMdb" */
        f: parse_BrtMdb
      },
      /*::[*/
      52: {
        /* n:"BrtBeginFmd", */
        T: 1
      },
      /*::[*/
      53: {
        /* n:"BrtEndFmd", */
        T: -1
      },
      /*::[*/
      54: {
        /* n:"BrtBeginMdx", */
        T: 1
      },
      /*::[*/
      55: {
        /* n:"BrtEndMdx", */
        T: -1
      },
      /*::[*/
      56: {
        /* n:"BrtBeginMdxTuple", */
        T: 1
      },
      /*::[*/
      57: {
        /* n:"BrtEndMdxTuple", */
        T: -1
      },
      /*::[*/
      58: {
        /* n:"BrtMdxMbrIstr" */
      },
      /*::[*/
      59: {
        /* n:"BrtStr" */
      },
      /*::[*/
      60: {
        /* n:"BrtColInfo", */
        f: parse_ColInfo
      },
      /*::[*/
      62: {
        /* n:"BrtCellRString", */
        f: parse_BrtCellRString
      },
      /*::[*/
      63: {
        /* n:"BrtCalcChainItem$", */
        f: parse_BrtCalcChainItem$
      },
      /*::[*/
      64: {
        /* n:"BrtDVal", */
        f: parse_BrtDVal
      },
      /*::[*/
      65: {
        /* n:"BrtSxvcellNum" */
      },
      /*::[*/
      66: {
        /* n:"BrtSxvcellStr" */
      },
      /*::[*/
      67: {
        /* n:"BrtSxvcellBool" */
      },
      /*::[*/
      68: {
        /* n:"BrtSxvcellErr" */
      },
      /*::[*/
      69: {
        /* n:"BrtSxvcellDate" */
      },
      /*::[*/
      70: {
        /* n:"BrtSxvcellNil" */
      },
      /*::[*/
      128: {
        /* n:"BrtFileVersion" */
      },
      /*::[*/
      129: {
        /* n:"BrtBeginSheet", */
        T: 1
      },
      /*::[*/
      130: {
        /* n:"BrtEndSheet", */
        T: -1
      },
      /*::[*/
      131: {
        /* n:"BrtBeginBook", */
        T: 1,
        f: parsenoop,
        p: 0
      },
      /*::[*/
      132: {
        /* n:"BrtEndBook", */
        T: -1
      },
      /*::[*/
      133: {
        /* n:"BrtBeginWsViews", */
        T: 1
      },
      /*::[*/
      134: {
        /* n:"BrtEndWsViews", */
        T: -1
      },
      /*::[*/
      135: {
        /* n:"BrtBeginBookViews", */
        T: 1
      },
      /*::[*/
      136: {
        /* n:"BrtEndBookViews", */
        T: -1
      },
      /*::[*/
      137: {
        /* n:"BrtBeginWsView", */
        T: 1,
        f: parse_BrtBeginWsView
      },
      /*::[*/
      138: {
        /* n:"BrtEndWsView", */
        T: -1
      },
      /*::[*/
      139: {
        /* n:"BrtBeginCsViews", */
        T: 1
      },
      /*::[*/
      140: {
        /* n:"BrtEndCsViews", */
        T: -1
      },
      /*::[*/
      141: {
        /* n:"BrtBeginCsView", */
        T: 1
      },
      /*::[*/
      142: {
        /* n:"BrtEndCsView", */
        T: -1
      },
      /*::[*/
      143: {
        /* n:"BrtBeginBundleShs", */
        T: 1
      },
      /*::[*/
      144: {
        /* n:"BrtEndBundleShs", */
        T: -1
      },
      /*::[*/
      145: {
        /* n:"BrtBeginSheetData", */
        T: 1
      },
      /*::[*/
      146: {
        /* n:"BrtEndSheetData", */
        T: -1
      },
      /*::[*/
      147: {
        /* n:"BrtWsProp", */
        f: parse_BrtWsProp
      },
      /*::[*/
      148: {
        /* n:"BrtWsDim", */
        f: parse_BrtWsDim,
        p: 16
      },
      /*::[*/
      151: {
        /* n:"BrtPane", */
        f: parse_BrtPane
      },
      /*::[*/
      152: {
        /* n:"BrtSel" */
      },
      /*::[*/
      153: {
        /* n:"BrtWbProp", */
        f: parse_BrtWbProp
      },
      /*::[*/
      154: {
        /* n:"BrtWbFactoid" */
      },
      /*::[*/
      155: {
        /* n:"BrtFileRecover" */
      },
      /*::[*/
      156: {
        /* n:"BrtBundleSh", */
        f: parse_BrtBundleSh
      },
      /*::[*/
      157: {
        /* n:"BrtCalcProp" */
      },
      /*::[*/
      158: {
        /* n:"BrtBookView" */
      },
      /*::[*/
      159: {
        /* n:"BrtBeginSst", */
        T: 1,
        f: parse_BrtBeginSst
      },
      /*::[*/
      160: {
        /* n:"BrtEndSst", */
        T: -1
      },
      /*::[*/
      161: {
        /* n:"BrtBeginAFilter", */
        T: 1,
        f: parse_UncheckedRfX
      },
      /*::[*/
      162: {
        /* n:"BrtEndAFilter", */
        T: -1
      },
      /*::[*/
      163: {
        /* n:"BrtBeginFilterColumn", */
        T: 1
      },
      /*::[*/
      164: {
        /* n:"BrtEndFilterColumn", */
        T: -1
      },
      /*::[*/
      165: {
        /* n:"BrtBeginFilters", */
        T: 1
      },
      /*::[*/
      166: {
        /* n:"BrtEndFilters", */
        T: -1
      },
      /*::[*/
      167: {
        /* n:"BrtFilter" */
      },
      /*::[*/
      168: {
        /* n:"BrtColorFilter" */
      },
      /*::[*/
      169: {
        /* n:"BrtIconFilter" */
      },
      /*::[*/
      170: {
        /* n:"BrtTop10Filter" */
      },
      /*::[*/
      171: {
        /* n:"BrtDynamicFilter" */
      },
      /*::[*/
      172: {
        /* n:"BrtBeginCustomFilters", */
        T: 1
      },
      /*::[*/
      173: {
        /* n:"BrtEndCustomFilters", */
        T: -1
      },
      /*::[*/
      174: {
        /* n:"BrtCustomFilter" */
      },
      /*::[*/
      175: {
        /* n:"BrtAFilterDateGroupItem" */
      },
      /*::[*/
      176: {
        /* n:"BrtMergeCell", */
        f: parse_BrtMergeCell
      },
      /*::[*/
      177: {
        /* n:"BrtBeginMergeCells", */
        T: 1
      },
      /*::[*/
      178: {
        /* n:"BrtEndMergeCells", */
        T: -1
      },
      /*::[*/
      179: {
        /* n:"BrtBeginPivotCacheDef", */
        T: 1
      },
      /*::[*/
      180: {
        /* n:"BrtEndPivotCacheDef", */
        T: -1
      },
      /*::[*/
      181: {
        /* n:"BrtBeginPCDFields", */
        T: 1
      },
      /*::[*/
      182: {
        /* n:"BrtEndPCDFields", */
        T: -1
      },
      /*::[*/
      183: {
        /* n:"BrtBeginPCDField", */
        T: 1
      },
      /*::[*/
      184: {
        /* n:"BrtEndPCDField", */
        T: -1
      },
      /*::[*/
      185: {
        /* n:"BrtBeginPCDSource", */
        T: 1
      },
      /*::[*/
      186: {
        /* n:"BrtEndPCDSource", */
        T: -1
      },
      /*::[*/
      187: {
        /* n:"BrtBeginPCDSRange", */
        T: 1
      },
      /*::[*/
      188: {
        /* n:"BrtEndPCDSRange", */
        T: -1
      },
      /*::[*/
      189: {
        /* n:"BrtBeginPCDFAtbl", */
        T: 1
      },
      /*::[*/
      190: {
        /* n:"BrtEndPCDFAtbl", */
        T: -1
      },
      /*::[*/
      191: {
        /* n:"BrtBeginPCDIRun", */
        T: 1
      },
      /*::[*/
      192: {
        /* n:"BrtEndPCDIRun", */
        T: -1
      },
      /*::[*/
      193: {
        /* n:"BrtBeginPivotCacheRecords", */
        T: 1
      },
      /*::[*/
      194: {
        /* n:"BrtEndPivotCacheRecords", */
        T: -1
      },
      /*::[*/
      195: {
        /* n:"BrtBeginPCDHierarchies", */
        T: 1
      },
      /*::[*/
      196: {
        /* n:"BrtEndPCDHierarchies", */
        T: -1
      },
      /*::[*/
      197: {
        /* n:"BrtBeginPCDHierarchy", */
        T: 1
      },
      /*::[*/
      198: {
        /* n:"BrtEndPCDHierarchy", */
        T: -1
      },
      /*::[*/
      199: {
        /* n:"BrtBeginPCDHFieldsUsage", */
        T: 1
      },
      /*::[*/
      200: {
        /* n:"BrtEndPCDHFieldsUsage", */
        T: -1
      },
      /*::[*/
      201: {
        /* n:"BrtBeginExtConnection", */
        T: 1
      },
      /*::[*/
      202: {
        /* n:"BrtEndExtConnection", */
        T: -1
      },
      /*::[*/
      203: {
        /* n:"BrtBeginECDbProps", */
        T: 1
      },
      /*::[*/
      204: {
        /* n:"BrtEndECDbProps", */
        T: -1
      },
      /*::[*/
      205: {
        /* n:"BrtBeginECOlapProps", */
        T: 1
      },
      /*::[*/
      206: {
        /* n:"BrtEndECOlapProps", */
        T: -1
      },
      /*::[*/
      207: {
        /* n:"BrtBeginPCDSConsol", */
        T: 1
      },
      /*::[*/
      208: {
        /* n:"BrtEndPCDSConsol", */
        T: -1
      },
      /*::[*/
      209: {
        /* n:"BrtBeginPCDSCPages", */
        T: 1
      },
      /*::[*/
      210: {
        /* n:"BrtEndPCDSCPages", */
        T: -1
      },
      /*::[*/
      211: {
        /* n:"BrtBeginPCDSCPage", */
        T: 1
      },
      /*::[*/
      212: {
        /* n:"BrtEndPCDSCPage", */
        T: -1
      },
      /*::[*/
      213: {
        /* n:"BrtBeginPCDSCPItem", */
        T: 1
      },
      /*::[*/
      214: {
        /* n:"BrtEndPCDSCPItem", */
        T: -1
      },
      /*::[*/
      215: {
        /* n:"BrtBeginPCDSCSets", */
        T: 1
      },
      /*::[*/
      216: {
        /* n:"BrtEndPCDSCSets", */
        T: -1
      },
      /*::[*/
      217: {
        /* n:"BrtBeginPCDSCSet", */
        T: 1
      },
      /*::[*/
      218: {
        /* n:"BrtEndPCDSCSet", */
        T: -1
      },
      /*::[*/
      219: {
        /* n:"BrtBeginPCDFGroup", */
        T: 1
      },
      /*::[*/
      220: {
        /* n:"BrtEndPCDFGroup", */
        T: -1
      },
      /*::[*/
      221: {
        /* n:"BrtBeginPCDFGItems", */
        T: 1
      },
      /*::[*/
      222: {
        /* n:"BrtEndPCDFGItems", */
        T: -1
      },
      /*::[*/
      223: {
        /* n:"BrtBeginPCDFGRange", */
        T: 1
      },
      /*::[*/
      224: {
        /* n:"BrtEndPCDFGRange", */
        T: -1
      },
      /*::[*/
      225: {
        /* n:"BrtBeginPCDFGDiscrete", */
        T: 1
      },
      /*::[*/
      226: {
        /* n:"BrtEndPCDFGDiscrete", */
        T: -1
      },
      /*::[*/
      227: {
        /* n:"BrtBeginPCDSDTupleCache", */
        T: 1
      },
      /*::[*/
      228: {
        /* n:"BrtEndPCDSDTupleCache", */
        T: -1
      },
      /*::[*/
      229: {
        /* n:"BrtBeginPCDSDTCEntries", */
        T: 1
      },
      /*::[*/
      230: {
        /* n:"BrtEndPCDSDTCEntries", */
        T: -1
      },
      /*::[*/
      231: {
        /* n:"BrtBeginPCDSDTCEMembers", */
        T: 1
      },
      /*::[*/
      232: {
        /* n:"BrtEndPCDSDTCEMembers", */
        T: -1
      },
      /*::[*/
      233: {
        /* n:"BrtBeginPCDSDTCEMember", */
        T: 1
      },
      /*::[*/
      234: {
        /* n:"BrtEndPCDSDTCEMember", */
        T: -1
      },
      /*::[*/
      235: {
        /* n:"BrtBeginPCDSDTCQueries", */
        T: 1
      },
      /*::[*/
      236: {
        /* n:"BrtEndPCDSDTCQueries", */
        T: -1
      },
      /*::[*/
      237: {
        /* n:"BrtBeginPCDSDTCQuery", */
        T: 1
      },
      /*::[*/
      238: {
        /* n:"BrtEndPCDSDTCQuery", */
        T: -1
      },
      /*::[*/
      239: {
        /* n:"BrtBeginPCDSDTCSets", */
        T: 1
      },
      /*::[*/
      240: {
        /* n:"BrtEndPCDSDTCSets", */
        T: -1
      },
      /*::[*/
      241: {
        /* n:"BrtBeginPCDSDTCSet", */
        T: 1
      },
      /*::[*/
      242: {
        /* n:"BrtEndPCDSDTCSet", */
        T: -1
      },
      /*::[*/
      243: {
        /* n:"BrtBeginPCDCalcItems", */
        T: 1
      },
      /*::[*/
      244: {
        /* n:"BrtEndPCDCalcItems", */
        T: -1
      },
      /*::[*/
      245: {
        /* n:"BrtBeginPCDCalcItem", */
        T: 1
      },
      /*::[*/
      246: {
        /* n:"BrtEndPCDCalcItem", */
        T: -1
      },
      /*::[*/
      247: {
        /* n:"BrtBeginPRule", */
        T: 1
      },
      /*::[*/
      248: {
        /* n:"BrtEndPRule", */
        T: -1
      },
      /*::[*/
      249: {
        /* n:"BrtBeginPRFilters", */
        T: 1
      },
      /*::[*/
      250: {
        /* n:"BrtEndPRFilters", */
        T: -1
      },
      /*::[*/
      251: {
        /* n:"BrtBeginPRFilter", */
        T: 1
      },
      /*::[*/
      252: {
        /* n:"BrtEndPRFilter", */
        T: -1
      },
      /*::[*/
      253: {
        /* n:"BrtBeginPNames", */
        T: 1
      },
      /*::[*/
      254: {
        /* n:"BrtEndPNames", */
        T: -1
      },
      /*::[*/
      255: {
        /* n:"BrtBeginPName", */
        T: 1
      },
      /*::[*/
      256: {
        /* n:"BrtEndPName", */
        T: -1
      },
      /*::[*/
      257: {
        /* n:"BrtBeginPNPairs", */
        T: 1
      },
      /*::[*/
      258: {
        /* n:"BrtEndPNPairs", */
        T: -1
      },
      /*::[*/
      259: {
        /* n:"BrtBeginPNPair", */
        T: 1
      },
      /*::[*/
      260: {
        /* n:"BrtEndPNPair", */
        T: -1
      },
      /*::[*/
      261: {
        /* n:"BrtBeginECWebProps", */
        T: 1
      },
      /*::[*/
      262: {
        /* n:"BrtEndECWebProps", */
        T: -1
      },
      /*::[*/
      263: {
        /* n:"BrtBeginEcWpTables", */
        T: 1
      },
      /*::[*/
      264: {
        /* n:"BrtEndECWPTables", */
        T: -1
      },
      /*::[*/
      265: {
        /* n:"BrtBeginECParams", */
        T: 1
      },
      /*::[*/
      266: {
        /* n:"BrtEndECParams", */
        T: -1
      },
      /*::[*/
      267: {
        /* n:"BrtBeginECParam", */
        T: 1
      },
      /*::[*/
      268: {
        /* n:"BrtEndECParam", */
        T: -1
      },
      /*::[*/
      269: {
        /* n:"BrtBeginPCDKPIs", */
        T: 1
      },
      /*::[*/
      270: {
        /* n:"BrtEndPCDKPIs", */
        T: -1
      },
      /*::[*/
      271: {
        /* n:"BrtBeginPCDKPI", */
        T: 1
      },
      /*::[*/
      272: {
        /* n:"BrtEndPCDKPI", */
        T: -1
      },
      /*::[*/
      273: {
        /* n:"BrtBeginDims", */
        T: 1
      },
      /*::[*/
      274: {
        /* n:"BrtEndDims", */
        T: -1
      },
      /*::[*/
      275: {
        /* n:"BrtBeginDim", */
        T: 1
      },
      /*::[*/
      276: {
        /* n:"BrtEndDim", */
        T: -1
      },
      /*::[*/
      277: {
        /* n:"BrtIndexPartEnd" */
      },
      /*::[*/
      278: {
        /* n:"BrtBeginStyleSheet", */
        T: 1
      },
      /*::[*/
      279: {
        /* n:"BrtEndStyleSheet", */
        T: -1
      },
      /*::[*/
      280: {
        /* n:"BrtBeginSXView", */
        T: 1
      },
      /*::[*/
      281: {
        /* n:"BrtEndSXVI", */
        T: -1
      },
      /*::[*/
      282: {
        /* n:"BrtBeginSXVI", */
        T: 1
      },
      /*::[*/
      283: {
        /* n:"BrtBeginSXVIs", */
        T: 1
      },
      /*::[*/
      284: {
        /* n:"BrtEndSXVIs", */
        T: -1
      },
      /*::[*/
      285: {
        /* n:"BrtBeginSXVD", */
        T: 1
      },
      /*::[*/
      286: {
        /* n:"BrtEndSXVD", */
        T: -1
      },
      /*::[*/
      287: {
        /* n:"BrtBeginSXVDs", */
        T: 1
      },
      /*::[*/
      288: {
        /* n:"BrtEndSXVDs", */
        T: -1
      },
      /*::[*/
      289: {
        /* n:"BrtBeginSXPI", */
        T: 1
      },
      /*::[*/
      290: {
        /* n:"BrtEndSXPI", */
        T: -1
      },
      /*::[*/
      291: {
        /* n:"BrtBeginSXPIs", */
        T: 1
      },
      /*::[*/
      292: {
        /* n:"BrtEndSXPIs", */
        T: -1
      },
      /*::[*/
      293: {
        /* n:"BrtBeginSXDI", */
        T: 1
      },
      /*::[*/
      294: {
        /* n:"BrtEndSXDI", */
        T: -1
      },
      /*::[*/
      295: {
        /* n:"BrtBeginSXDIs", */
        T: 1
      },
      /*::[*/
      296: {
        /* n:"BrtEndSXDIs", */
        T: -1
      },
      /*::[*/
      297: {
        /* n:"BrtBeginSXLI", */
        T: 1
      },
      /*::[*/
      298: {
        /* n:"BrtEndSXLI", */
        T: -1
      },
      /*::[*/
      299: {
        /* n:"BrtBeginSXLIRws", */
        T: 1
      },
      /*::[*/
      300: {
        /* n:"BrtEndSXLIRws", */
        T: -1
      },
      /*::[*/
      301: {
        /* n:"BrtBeginSXLICols", */
        T: 1
      },
      /*::[*/
      302: {
        /* n:"BrtEndSXLICols", */
        T: -1
      },
      /*::[*/
      303: {
        /* n:"BrtBeginSXFormat", */
        T: 1
      },
      /*::[*/
      304: {
        /* n:"BrtEndSXFormat", */
        T: -1
      },
      /*::[*/
      305: {
        /* n:"BrtBeginSXFormats", */
        T: 1
      },
      /*::[*/
      306: {
        /* n:"BrtEndSxFormats", */
        T: -1
      },
      /*::[*/
      307: {
        /* n:"BrtBeginSxSelect", */
        T: 1
      },
      /*::[*/
      308: {
        /* n:"BrtEndSxSelect", */
        T: -1
      },
      /*::[*/
      309: {
        /* n:"BrtBeginISXVDRws", */
        T: 1
      },
      /*::[*/
      310: {
        /* n:"BrtEndISXVDRws", */
        T: -1
      },
      /*::[*/
      311: {
        /* n:"BrtBeginISXVDCols", */
        T: 1
      },
      /*::[*/
      312: {
        /* n:"BrtEndISXVDCols", */
        T: -1
      },
      /*::[*/
      313: {
        /* n:"BrtEndSXLocation", */
        T: -1
      },
      /*::[*/
      314: {
        /* n:"BrtBeginSXLocation", */
        T: 1
      },
      /*::[*/
      315: {
        /* n:"BrtEndSXView", */
        T: -1
      },
      /*::[*/
      316: {
        /* n:"BrtBeginSXTHs", */
        T: 1
      },
      /*::[*/
      317: {
        /* n:"BrtEndSXTHs", */
        T: -1
      },
      /*::[*/
      318: {
        /* n:"BrtBeginSXTH", */
        T: 1
      },
      /*::[*/
      319: {
        /* n:"BrtEndSXTH", */
        T: -1
      },
      /*::[*/
      320: {
        /* n:"BrtBeginISXTHRws", */
        T: 1
      },
      /*::[*/
      321: {
        /* n:"BrtEndISXTHRws", */
        T: -1
      },
      /*::[*/
      322: {
        /* n:"BrtBeginISXTHCols", */
        T: 1
      },
      /*::[*/
      323: {
        /* n:"BrtEndISXTHCols", */
        T: -1
      },
      /*::[*/
      324: {
        /* n:"BrtBeginSXTDMPS", */
        T: 1
      },
      /*::[*/
      325: {
        /* n:"BrtEndSXTDMPs", */
        T: -1
      },
      /*::[*/
      326: {
        /* n:"BrtBeginSXTDMP", */
        T: 1
      },
      /*::[*/
      327: {
        /* n:"BrtEndSXTDMP", */
        T: -1
      },
      /*::[*/
      328: {
        /* n:"BrtBeginSXTHItems", */
        T: 1
      },
      /*::[*/
      329: {
        /* n:"BrtEndSXTHItems", */
        T: -1
      },
      /*::[*/
      330: {
        /* n:"BrtBeginSXTHItem", */
        T: 1
      },
      /*::[*/
      331: {
        /* n:"BrtEndSXTHItem", */
        T: -1
      },
      /*::[*/
      332: {
        /* n:"BrtBeginMetadata", */
        T: 1
      },
      /*::[*/
      333: {
        /* n:"BrtEndMetadata", */
        T: -1
      },
      /*::[*/
      334: {
        /* n:"BrtBeginEsmdtinfo", */
        T: 1
      },
      /*::[*/
      335: {
        /* n:"BrtMdtinfo", */
        f: parse_BrtMdtinfo
      },
      /*::[*/
      336: {
        /* n:"BrtEndEsmdtinfo", */
        T: -1
      },
      /*::[*/
      337: {
        /* n:"BrtBeginEsmdb", */
        f: parse_BrtBeginEsmdb,
        T: 1
      },
      /*::[*/
      338: {
        /* n:"BrtEndEsmdb", */
        T: -1
      },
      /*::[*/
      339: {
        /* n:"BrtBeginEsfmd", */
        T: 1
      },
      /*::[*/
      340: {
        /* n:"BrtEndEsfmd", */
        T: -1
      },
      /*::[*/
      341: {
        /* n:"BrtBeginSingleCells", */
        T: 1
      },
      /*::[*/
      342: {
        /* n:"BrtEndSingleCells", */
        T: -1
      },
      /*::[*/
      343: {
        /* n:"BrtBeginList", */
        T: 1
      },
      /*::[*/
      344: {
        /* n:"BrtEndList", */
        T: -1
      },
      /*::[*/
      345: {
        /* n:"BrtBeginListCols", */
        T: 1
      },
      /*::[*/
      346: {
        /* n:"BrtEndListCols", */
        T: -1
      },
      /*::[*/
      347: {
        /* n:"BrtBeginListCol", */
        T: 1
      },
      /*::[*/
      348: {
        /* n:"BrtEndListCol", */
        T: -1
      },
      /*::[*/
      349: {
        /* n:"BrtBeginListXmlCPr", */
        T: 1
      },
      /*::[*/
      350: {
        /* n:"BrtEndListXmlCPr", */
        T: -1
      },
      /*::[*/
      351: {
        /* n:"BrtListCCFmla" */
      },
      /*::[*/
      352: {
        /* n:"BrtListTrFmla" */
      },
      /*::[*/
      353: {
        /* n:"BrtBeginExternals", */
        T: 1
      },
      /*::[*/
      354: {
        /* n:"BrtEndExternals", */
        T: -1
      },
      /*::[*/
      355: {
        /* n:"BrtSupBookSrc", */
        f: parse_RelID
      },
      /*::[*/
      357: {
        /* n:"BrtSupSelf" */
      },
      /*::[*/
      358: {
        /* n:"BrtSupSame" */
      },
      /*::[*/
      359: {
        /* n:"BrtSupTabs" */
      },
      /*::[*/
      360: {
        /* n:"BrtBeginSupBook", */
        T: 1
      },
      /*::[*/
      361: {
        /* n:"BrtPlaceholderName" */
      },
      /*::[*/
      362: {
        /* n:"BrtExternSheet", */
        f: parse_ExternSheet
      },
      /*::[*/
      363: {
        /* n:"BrtExternTableStart" */
      },
      /*::[*/
      364: {
        /* n:"BrtExternTableEnd" */
      },
      /*::[*/
      366: {
        /* n:"BrtExternRowHdr" */
      },
      /*::[*/
      367: {
        /* n:"BrtExternCellBlank" */
      },
      /*::[*/
      368: {
        /* n:"BrtExternCellReal" */
      },
      /*::[*/
      369: {
        /* n:"BrtExternCellBool" */
      },
      /*::[*/
      370: {
        /* n:"BrtExternCellError" */
      },
      /*::[*/
      371: {
        /* n:"BrtExternCellString" */
      },
      /*::[*/
      372: {
        /* n:"BrtBeginEsmdx", */
        T: 1
      },
      /*::[*/
      373: {
        /* n:"BrtEndEsmdx", */
        T: -1
      },
      /*::[*/
      374: {
        /* n:"BrtBeginMdxSet", */
        T: 1
      },
      /*::[*/
      375: {
        /* n:"BrtEndMdxSet", */
        T: -1
      },
      /*::[*/
      376: {
        /* n:"BrtBeginMdxMbrProp", */
        T: 1
      },
      /*::[*/
      377: {
        /* n:"BrtEndMdxMbrProp", */
        T: -1
      },
      /*::[*/
      378: {
        /* n:"BrtBeginMdxKPI", */
        T: 1
      },
      /*::[*/
      379: {
        /* n:"BrtEndMdxKPI", */
        T: -1
      },
      /*::[*/
      380: {
        /* n:"BrtBeginEsstr", */
        T: 1
      },
      /*::[*/
      381: {
        /* n:"BrtEndEsstr", */
        T: -1
      },
      /*::[*/
      382: {
        /* n:"BrtBeginPRFItem", */
        T: 1
      },
      /*::[*/
      383: {
        /* n:"BrtEndPRFItem", */
        T: -1
      },
      /*::[*/
      384: {
        /* n:"BrtBeginPivotCacheIDs", */
        T: 1
      },
      /*::[*/
      385: {
        /* n:"BrtEndPivotCacheIDs", */
        T: -1
      },
      /*::[*/
      386: {
        /* n:"BrtBeginPivotCacheID", */
        T: 1
      },
      /*::[*/
      387: {
        /* n:"BrtEndPivotCacheID", */
        T: -1
      },
      /*::[*/
      388: {
        /* n:"BrtBeginISXVIs", */
        T: 1
      },
      /*::[*/
      389: {
        /* n:"BrtEndISXVIs", */
        T: -1
      },
      /*::[*/
      390: {
        /* n:"BrtBeginColInfos", */
        T: 1
      },
      /*::[*/
      391: {
        /* n:"BrtEndColInfos", */
        T: -1
      },
      /*::[*/
      392: {
        /* n:"BrtBeginRwBrk", */
        T: 1
      },
      /*::[*/
      393: {
        /* n:"BrtEndRwBrk", */
        T: -1
      },
      /*::[*/
      394: {
        /* n:"BrtBeginColBrk", */
        T: 1
      },
      /*::[*/
      395: {
        /* n:"BrtEndColBrk", */
        T: -1
      },
      /*::[*/
      396: {
        /* n:"BrtBrk" */
      },
      /*::[*/
      397: {
        /* n:"BrtUserBookView" */
      },
      /*::[*/
      398: {
        /* n:"BrtInfo" */
      },
      /*::[*/
      399: {
        /* n:"BrtCUsr" */
      },
      /*::[*/
      400: {
        /* n:"BrtUsr" */
      },
      /*::[*/
      401: {
        /* n:"BrtBeginUsers", */
        T: 1
      },
      /*::[*/
      403: {
        /* n:"BrtEOF" */
      },
      /*::[*/
      404: {
        /* n:"BrtUCR" */
      },
      /*::[*/
      405: {
        /* n:"BrtRRInsDel" */
      },
      /*::[*/
      406: {
        /* n:"BrtRREndInsDel" */
      },
      /*::[*/
      407: {
        /* n:"BrtRRMove" */
      },
      /*::[*/
      408: {
        /* n:"BrtRREndMove" */
      },
      /*::[*/
      409: {
        /* n:"BrtRRChgCell" */
      },
      /*::[*/
      410: {
        /* n:"BrtRREndChgCell" */
      },
      /*::[*/
      411: {
        /* n:"BrtRRHeader" */
      },
      /*::[*/
      412: {
        /* n:"BrtRRUserView" */
      },
      /*::[*/
      413: {
        /* n:"BrtRRRenSheet" */
      },
      /*::[*/
      414: {
        /* n:"BrtRRInsertSh" */
      },
      /*::[*/
      415: {
        /* n:"BrtRRDefName" */
      },
      /*::[*/
      416: {
        /* n:"BrtRRNote" */
      },
      /*::[*/
      417: {
        /* n:"BrtRRConflict" */
      },
      /*::[*/
      418: {
        /* n:"BrtRRTQSIF" */
      },
      /*::[*/
      419: {
        /* n:"BrtRRFormat" */
      },
      /*::[*/
      420: {
        /* n:"BrtRREndFormat" */
      },
      /*::[*/
      421: {
        /* n:"BrtRRAutoFmt" */
      },
      /*::[*/
      422: {
        /* n:"BrtBeginUserShViews", */
        T: 1
      },
      /*::[*/
      423: {
        /* n:"BrtBeginUserShView", */
        T: 1
      },
      /*::[*/
      424: {
        /* n:"BrtEndUserShView", */
        T: -1
      },
      /*::[*/
      425: {
        /* n:"BrtEndUserShViews", */
        T: -1
      },
      /*::[*/
      426: {
        /* n:"BrtArrFmla", */
        f: parse_BrtArrFmla
      },
      /*::[*/
      427: {
        /* n:"BrtShrFmla", */
        f: parse_BrtShrFmla
      },
      /*::[*/
      428: {
        /* n:"BrtTable" */
      },
      /*::[*/
      429: {
        /* n:"BrtBeginExtConnections", */
        T: 1
      },
      /*::[*/
      430: {
        /* n:"BrtEndExtConnections", */
        T: -1
      },
      /*::[*/
      431: {
        /* n:"BrtBeginPCDCalcMems", */
        T: 1
      },
      /*::[*/
      432: {
        /* n:"BrtEndPCDCalcMems", */
        T: -1
      },
      /*::[*/
      433: {
        /* n:"BrtBeginPCDCalcMem", */
        T: 1
      },
      /*::[*/
      434: {
        /* n:"BrtEndPCDCalcMem", */
        T: -1
      },
      /*::[*/
      435: {
        /* n:"BrtBeginPCDHGLevels", */
        T: 1
      },
      /*::[*/
      436: {
        /* n:"BrtEndPCDHGLevels", */
        T: -1
      },
      /*::[*/
      437: {
        /* n:"BrtBeginPCDHGLevel", */
        T: 1
      },
      /*::[*/
      438: {
        /* n:"BrtEndPCDHGLevel", */
        T: -1
      },
      /*::[*/
      439: {
        /* n:"BrtBeginPCDHGLGroups", */
        T: 1
      },
      /*::[*/
      440: {
        /* n:"BrtEndPCDHGLGroups", */
        T: -1
      },
      /*::[*/
      441: {
        /* n:"BrtBeginPCDHGLGroup", */
        T: 1
      },
      /*::[*/
      442: {
        /* n:"BrtEndPCDHGLGroup", */
        T: -1
      },
      /*::[*/
      443: {
        /* n:"BrtBeginPCDHGLGMembers", */
        T: 1
      },
      /*::[*/
      444: {
        /* n:"BrtEndPCDHGLGMembers", */
        T: -1
      },
      /*::[*/
      445: {
        /* n:"BrtBeginPCDHGLGMember", */
        T: 1
      },
      /*::[*/
      446: {
        /* n:"BrtEndPCDHGLGMember", */
        T: -1
      },
      /*::[*/
      447: {
        /* n:"BrtBeginQSI", */
        T: 1
      },
      /*::[*/
      448: {
        /* n:"BrtEndQSI", */
        T: -1
      },
      /*::[*/
      449: {
        /* n:"BrtBeginQSIR", */
        T: 1
      },
      /*::[*/
      450: {
        /* n:"BrtEndQSIR", */
        T: -1
      },
      /*::[*/
      451: {
        /* n:"BrtBeginDeletedNames", */
        T: 1
      },
      /*::[*/
      452: {
        /* n:"BrtEndDeletedNames", */
        T: -1
      },
      /*::[*/
      453: {
        /* n:"BrtBeginDeletedName", */
        T: 1
      },
      /*::[*/
      454: {
        /* n:"BrtEndDeletedName", */
        T: -1
      },
      /*::[*/
      455: {
        /* n:"BrtBeginQSIFs", */
        T: 1
      },
      /*::[*/
      456: {
        /* n:"BrtEndQSIFs", */
        T: -1
      },
      /*::[*/
      457: {
        /* n:"BrtBeginQSIF", */
        T: 1
      },
      /*::[*/
      458: {
        /* n:"BrtEndQSIF", */
        T: -1
      },
      /*::[*/
      459: {
        /* n:"BrtBeginAutoSortScope", */
        T: 1
      },
      /*::[*/
      460: {
        /* n:"BrtEndAutoSortScope", */
        T: -1
      },
      /*::[*/
      461: {
        /* n:"BrtBeginConditionalFormatting", */
        T: 1
      },
      /*::[*/
      462: {
        /* n:"BrtEndConditionalFormatting", */
        T: -1
      },
      /*::[*/
      463: {
        /* n:"BrtBeginCFRule", */
        T: 1
      },
      /*::[*/
      464: {
        /* n:"BrtEndCFRule", */
        T: -1
      },
      /*::[*/
      465: {
        /* n:"BrtBeginIconSet", */
        T: 1
      },
      /*::[*/
      466: {
        /* n:"BrtEndIconSet", */
        T: -1
      },
      /*::[*/
      467: {
        /* n:"BrtBeginDatabar", */
        T: 1
      },
      /*::[*/
      468: {
        /* n:"BrtEndDatabar", */
        T: -1
      },
      /*::[*/
      469: {
        /* n:"BrtBeginColorScale", */
        T: 1
      },
      /*::[*/
      470: {
        /* n:"BrtEndColorScale", */
        T: -1
      },
      /*::[*/
      471: {
        /* n:"BrtCFVO" */
      },
      /*::[*/
      472: {
        /* n:"BrtExternValueMeta" */
      },
      /*::[*/
      473: {
        /* n:"BrtBeginColorPalette", */
        T: 1
      },
      /*::[*/
      474: {
        /* n:"BrtEndColorPalette", */
        T: -1
      },
      /*::[*/
      475: {
        /* n:"BrtIndexedColor" */
      },
      /*::[*/
      476: {
        /* n:"BrtMargins", */
        f: parse_BrtMargins
      },
      /*::[*/
      477: {
        /* n:"BrtPrintOptions" */
      },
      /*::[*/
      478: {
        /* n:"BrtPageSetup" */
      },
      /*::[*/
      479: {
        /* n:"BrtBeginHeaderFooter", */
        T: 1
      },
      /*::[*/
      480: {
        /* n:"BrtEndHeaderFooter", */
        T: -1
      },
      /*::[*/
      481: {
        /* n:"BrtBeginSXCrtFormat", */
        T: 1
      },
      /*::[*/
      482: {
        /* n:"BrtEndSXCrtFormat", */
        T: -1
      },
      /*::[*/
      483: {
        /* n:"BrtBeginSXCrtFormats", */
        T: 1
      },
      /*::[*/
      484: {
        /* n:"BrtEndSXCrtFormats", */
        T: -1
      },
      /*::[*/
      485: {
        /* n:"BrtWsFmtInfo", */
        f: parse_BrtWsFmtInfo
      },
      /*::[*/
      486: {
        /* n:"BrtBeginMgs", */
        T: 1
      },
      /*::[*/
      487: {
        /* n:"BrtEndMGs", */
        T: -1
      },
      /*::[*/
      488: {
        /* n:"BrtBeginMGMaps", */
        T: 1
      },
      /*::[*/
      489: {
        /* n:"BrtEndMGMaps", */
        T: -1
      },
      /*::[*/
      490: {
        /* n:"BrtBeginMG", */
        T: 1
      },
      /*::[*/
      491: {
        /* n:"BrtEndMG", */
        T: -1
      },
      /*::[*/
      492: {
        /* n:"BrtBeginMap", */
        T: 1
      },
      /*::[*/
      493: {
        /* n:"BrtEndMap", */
        T: -1
      },
      /*::[*/
      494: {
        /* n:"BrtHLink", */
        f: parse_BrtHLink
      },
      /*::[*/
      495: {
        /* n:"BrtBeginDCon", */
        T: 1
      },
      /*::[*/
      496: {
        /* n:"BrtEndDCon", */
        T: -1
      },
      /*::[*/
      497: {
        /* n:"BrtBeginDRefs", */
        T: 1
      },
      /*::[*/
      498: {
        /* n:"BrtEndDRefs", */
        T: -1
      },
      /*::[*/
      499: {
        /* n:"BrtDRef" */
      },
      /*::[*/
      500: {
        /* n:"BrtBeginScenMan", */
        T: 1
      },
      /*::[*/
      501: {
        /* n:"BrtEndScenMan", */
        T: -1
      },
      /*::[*/
      502: {
        /* n:"BrtBeginSct", */
        T: 1
      },
      /*::[*/
      503: {
        /* n:"BrtEndSct", */
        T: -1
      },
      /*::[*/
      504: {
        /* n:"BrtSlc" */
      },
      /*::[*/
      505: {
        /* n:"BrtBeginDXFs", */
        T: 1
      },
      /*::[*/
      506: {
        /* n:"BrtEndDXFs", */
        T: -1
      },
      /*::[*/
      507: {
        /* n:"BrtDXF" */
      },
      /*::[*/
      508: {
        /* n:"BrtBeginTableStyles", */
        T: 1
      },
      /*::[*/
      509: {
        /* n:"BrtEndTableStyles", */
        T: -1
      },
      /*::[*/
      510: {
        /* n:"BrtBeginTableStyle", */
        T: 1
      },
      /*::[*/
      511: {
        /* n:"BrtEndTableStyle", */
        T: -1
      },
      /*::[*/
      512: {
        /* n:"BrtTableStyleElement" */
      },
      /*::[*/
      513: {
        /* n:"BrtTableStyleClient" */
      },
      /*::[*/
      514: {
        /* n:"BrtBeginVolDeps", */
        T: 1
      },
      /*::[*/
      515: {
        /* n:"BrtEndVolDeps", */
        T: -1
      },
      /*::[*/
      516: {
        /* n:"BrtBeginVolType", */
        T: 1
      },
      /*::[*/
      517: {
        /* n:"BrtEndVolType", */
        T: -1
      },
      /*::[*/
      518: {
        /* n:"BrtBeginVolMain", */
        T: 1
      },
      /*::[*/
      519: {
        /* n:"BrtEndVolMain", */
        T: -1
      },
      /*::[*/
      520: {
        /* n:"BrtBeginVolTopic", */
        T: 1
      },
      /*::[*/
      521: {
        /* n:"BrtEndVolTopic", */
        T: -1
      },
      /*::[*/
      522: {
        /* n:"BrtVolSubtopic" */
      },
      /*::[*/
      523: {
        /* n:"BrtVolRef" */
      },
      /*::[*/
      524: {
        /* n:"BrtVolNum" */
      },
      /*::[*/
      525: {
        /* n:"BrtVolErr" */
      },
      /*::[*/
      526: {
        /* n:"BrtVolStr" */
      },
      /*::[*/
      527: {
        /* n:"BrtVolBool" */
      },
      /*::[*/
      528: {
        /* n:"BrtBeginCalcChain$", */
        T: 1
      },
      /*::[*/
      529: {
        /* n:"BrtEndCalcChain$", */
        T: -1
      },
      /*::[*/
      530: {
        /* n:"BrtBeginSortState", */
        T: 1
      },
      /*::[*/
      531: {
        /* n:"BrtEndSortState", */
        T: -1
      },
      /*::[*/
      532: {
        /* n:"BrtBeginSortCond", */
        T: 1
      },
      /*::[*/
      533: {
        /* n:"BrtEndSortCond", */
        T: -1
      },
      /*::[*/
      534: {
        /* n:"BrtBookProtection" */
      },
      /*::[*/
      535: {
        /* n:"BrtSheetProtection" */
      },
      /*::[*/
      536: {
        /* n:"BrtRangeProtection" */
      },
      /*::[*/
      537: {
        /* n:"BrtPhoneticInfo" */
      },
      /*::[*/
      538: {
        /* n:"BrtBeginECTxtWiz", */
        T: 1
      },
      /*::[*/
      539: {
        /* n:"BrtEndECTxtWiz", */
        T: -1
      },
      /*::[*/
      540: {
        /* n:"BrtBeginECTWFldInfoLst", */
        T: 1
      },
      /*::[*/
      541: {
        /* n:"BrtEndECTWFldInfoLst", */
        T: -1
      },
      /*::[*/
      542: {
        /* n:"BrtBeginECTwFldInfo", */
        T: 1
      },
      /*::[*/
      548: {
        /* n:"BrtFileSharing" */
      },
      /*::[*/
      549: {
        /* n:"BrtOleSize" */
      },
      /*::[*/
      550: {
        /* n:"BrtDrawing", */
        f: parse_RelID
      },
      /*::[*/
      551: {
        /* n:"BrtLegacyDrawing" */
      },
      /*::[*/
      552: {
        /* n:"BrtLegacyDrawingHF" */
      },
      /*::[*/
      553: {
        /* n:"BrtWebOpt" */
      },
      /*::[*/
      554: {
        /* n:"BrtBeginWebPubItems", */
        T: 1
      },
      /*::[*/
      555: {
        /* n:"BrtEndWebPubItems", */
        T: -1
      },
      /*::[*/
      556: {
        /* n:"BrtBeginWebPubItem", */
        T: 1
      },
      /*::[*/
      557: {
        /* n:"BrtEndWebPubItem", */
        T: -1
      },
      /*::[*/
      558: {
        /* n:"BrtBeginSXCondFmt", */
        T: 1
      },
      /*::[*/
      559: {
        /* n:"BrtEndSXCondFmt", */
        T: -1
      },
      /*::[*/
      560: {
        /* n:"BrtBeginSXCondFmts", */
        T: 1
      },
      /*::[*/
      561: {
        /* n:"BrtEndSXCondFmts", */
        T: -1
      },
      /*::[*/
      562: {
        /* n:"BrtBkHim" */
      },
      /*::[*/
      564: {
        /* n:"BrtColor" */
      },
      /*::[*/
      565: {
        /* n:"BrtBeginIndexedColors", */
        T: 1
      },
      /*::[*/
      566: {
        /* n:"BrtEndIndexedColors", */
        T: -1
      },
      /*::[*/
      569: {
        /* n:"BrtBeginMRUColors", */
        T: 1
      },
      /*::[*/
      570: {
        /* n:"BrtEndMRUColors", */
        T: -1
      },
      /*::[*/
      572: {
        /* n:"BrtMRUColor" */
      },
      /*::[*/
      573: {
        /* n:"BrtBeginDVals", */
        T: 1
      },
      /*::[*/
      574: {
        /* n:"BrtEndDVals", */
        T: -1
      },
      /*::[*/
      577: {
        /* n:"BrtSupNameStart" */
      },
      /*::[*/
      578: {
        /* n:"BrtSupNameValueStart" */
      },
      /*::[*/
      579: {
        /* n:"BrtSupNameValueEnd" */
      },
      /*::[*/
      580: {
        /* n:"BrtSupNameNum" */
      },
      /*::[*/
      581: {
        /* n:"BrtSupNameErr" */
      },
      /*::[*/
      582: {
        /* n:"BrtSupNameSt" */
      },
      /*::[*/
      583: {
        /* n:"BrtSupNameNil" */
      },
      /*::[*/
      584: {
        /* n:"BrtSupNameBool" */
      },
      /*::[*/
      585: {
        /* n:"BrtSupNameFmla" */
      },
      /*::[*/
      586: {
        /* n:"BrtSupNameBits" */
      },
      /*::[*/
      587: {
        /* n:"BrtSupNameEnd" */
      },
      /*::[*/
      588: {
        /* n:"BrtEndSupBook", */
        T: -1
      },
      /*::[*/
      589: {
        /* n:"BrtCellSmartTagProperty" */
      },
      /*::[*/
      590: {
        /* n:"BrtBeginCellSmartTag", */
        T: 1
      },
      /*::[*/
      591: {
        /* n:"BrtEndCellSmartTag", */
        T: -1
      },
      /*::[*/
      592: {
        /* n:"BrtBeginCellSmartTags", */
        T: 1
      },
      /*::[*/
      593: {
        /* n:"BrtEndCellSmartTags", */
        T: -1
      },
      /*::[*/
      594: {
        /* n:"BrtBeginSmartTags", */
        T: 1
      },
      /*::[*/
      595: {
        /* n:"BrtEndSmartTags", */
        T: -1
      },
      /*::[*/
      596: {
        /* n:"BrtSmartTagType" */
      },
      /*::[*/
      597: {
        /* n:"BrtBeginSmartTagTypes", */
        T: 1
      },
      /*::[*/
      598: {
        /* n:"BrtEndSmartTagTypes", */
        T: -1
      },
      /*::[*/
      599: {
        /* n:"BrtBeginSXFilters", */
        T: 1
      },
      /*::[*/
      600: {
        /* n:"BrtEndSXFilters", */
        T: -1
      },
      /*::[*/
      601: {
        /* n:"BrtBeginSXFILTER", */
        T: 1
      },
      /*::[*/
      602: {
        /* n:"BrtEndSXFilter", */
        T: -1
      },
      /*::[*/
      603: {
        /* n:"BrtBeginFills", */
        T: 1
      },
      /*::[*/
      604: {
        /* n:"BrtEndFills", */
        T: -1
      },
      /*::[*/
      605: {
        /* n:"BrtBeginCellWatches", */
        T: 1
      },
      /*::[*/
      606: {
        /* n:"BrtEndCellWatches", */
        T: -1
      },
      /*::[*/
      607: {
        /* n:"BrtCellWatch" */
      },
      /*::[*/
      608: {
        /* n:"BrtBeginCRErrs", */
        T: 1
      },
      /*::[*/
      609: {
        /* n:"BrtEndCRErrs", */
        T: -1
      },
      /*::[*/
      610: {
        /* n:"BrtCrashRecErr" */
      },
      /*::[*/
      611: {
        /* n:"BrtBeginFonts", */
        T: 1
      },
      /*::[*/
      612: {
        /* n:"BrtEndFonts", */
        T: -1
      },
      /*::[*/
      613: {
        /* n:"BrtBeginBorders", */
        T: 1
      },
      /*::[*/
      614: {
        /* n:"BrtEndBorders", */
        T: -1
      },
      /*::[*/
      615: {
        /* n:"BrtBeginFmts", */
        T: 1
      },
      /*::[*/
      616: {
        /* n:"BrtEndFmts", */
        T: -1
      },
      /*::[*/
      617: {
        /* n:"BrtBeginCellXFs", */
        T: 1
      },
      /*::[*/
      618: {
        /* n:"BrtEndCellXFs", */
        T: -1
      },
      /*::[*/
      619: {
        /* n:"BrtBeginStyles", */
        T: 1
      },
      /*::[*/
      620: {
        /* n:"BrtEndStyles", */
        T: -1
      },
      /*::[*/
      625: {
        /* n:"BrtBigName" */
      },
      /*::[*/
      626: {
        /* n:"BrtBeginCellStyleXFs", */
        T: 1
      },
      /*::[*/
      627: {
        /* n:"BrtEndCellStyleXFs", */
        T: -1
      },
      /*::[*/
      628: {
        /* n:"BrtBeginComments", */
        T: 1
      },
      /*::[*/
      629: {
        /* n:"BrtEndComments", */
        T: -1
      },
      /*::[*/
      630: {
        /* n:"BrtBeginCommentAuthors", */
        T: 1
      },
      /*::[*/
      631: {
        /* n:"BrtEndCommentAuthors", */
        T: -1
      },
      /*::[*/
      632: {
        /* n:"BrtCommentAuthor", */
        f: parse_BrtCommentAuthor
      },
      /*::[*/
      633: {
        /* n:"BrtBeginCommentList", */
        T: 1
      },
      /*::[*/
      634: {
        /* n:"BrtEndCommentList", */
        T: -1
      },
      /*::[*/
      635: {
        /* n:"BrtBeginComment", */
        T: 1,
        f: parse_BrtBeginComment
      },
      /*::[*/
      636: {
        /* n:"BrtEndComment", */
        T: -1
      },
      /*::[*/
      637: {
        /* n:"BrtCommentText", */
        f: parse_BrtCommentText
      },
      /*::[*/
      638: {
        /* n:"BrtBeginOleObjects", */
        T: 1
      },
      /*::[*/
      639: {
        /* n:"BrtOleObject" */
      },
      /*::[*/
      640: {
        /* n:"BrtEndOleObjects", */
        T: -1
      },
      /*::[*/
      641: {
        /* n:"BrtBeginSxrules", */
        T: 1
      },
      /*::[*/
      642: {
        /* n:"BrtEndSxRules", */
        T: -1
      },
      /*::[*/
      643: {
        /* n:"BrtBeginActiveXControls", */
        T: 1
      },
      /*::[*/
      644: {
        /* n:"BrtActiveX" */
      },
      /*::[*/
      645: {
        /* n:"BrtEndActiveXControls", */
        T: -1
      },
      /*::[*/
      646: {
        /* n:"BrtBeginPCDSDTCEMembersSortBy", */
        T: 1
      },
      /*::[*/
      648: {
        /* n:"BrtBeginCellIgnoreECs", */
        T: 1
      },
      /*::[*/
      649: {
        /* n:"BrtCellIgnoreEC" */
      },
      /*::[*/
      650: {
        /* n:"BrtEndCellIgnoreECs", */
        T: -1
      },
      /*::[*/
      651: {
        /* n:"BrtCsProp", */
        f: parse_BrtCsProp
      },
      /*::[*/
      652: {
        /* n:"BrtCsPageSetup" */
      },
      /*::[*/
      653: {
        /* n:"BrtBeginUserCsViews", */
        T: 1
      },
      /*::[*/
      654: {
        /* n:"BrtEndUserCsViews", */
        T: -1
      },
      /*::[*/
      655: {
        /* n:"BrtBeginUserCsView", */
        T: 1
      },
      /*::[*/
      656: {
        /* n:"BrtEndUserCsView", */
        T: -1
      },
      /*::[*/
      657: {
        /* n:"BrtBeginPcdSFCIEntries", */
        T: 1
      },
      /*::[*/
      658: {
        /* n:"BrtEndPCDSFCIEntries", */
        T: -1
      },
      /*::[*/
      659: {
        /* n:"BrtPCDSFCIEntry" */
      },
      /*::[*/
      660: {
        /* n:"BrtBeginListParts", */
        T: 1
      },
      /*::[*/
      661: {
        /* n:"BrtListPart" */
      },
      /*::[*/
      662: {
        /* n:"BrtEndListParts", */
        T: -1
      },
      /*::[*/
      663: {
        /* n:"BrtSheetCalcProp" */
      },
      /*::[*/
      664: {
        /* n:"BrtBeginFnGroup", */
        T: 1
      },
      /*::[*/
      665: {
        /* n:"BrtFnGroup" */
      },
      /*::[*/
      666: {
        /* n:"BrtEndFnGroup", */
        T: -1
      },
      /*::[*/
      667: {
        /* n:"BrtSupAddin" */
      },
      /*::[*/
      668: {
        /* n:"BrtSXTDMPOrder" */
      },
      /*::[*/
      669: {
        /* n:"BrtCsProtection" */
      },
      /*::[*/
      671: {
        /* n:"BrtBeginWsSortMap", */
        T: 1
      },
      /*::[*/
      672: {
        /* n:"BrtEndWsSortMap", */
        T: -1
      },
      /*::[*/
      673: {
        /* n:"BrtBeginRRSort", */
        T: 1
      },
      /*::[*/
      674: {
        /* n:"BrtEndRRSort", */
        T: -1
      },
      /*::[*/
      675: {
        /* n:"BrtRRSortItem" */
      },
      /*::[*/
      676: {
        /* n:"BrtFileSharingIso" */
      },
      /*::[*/
      677: {
        /* n:"BrtBookProtectionIso" */
      },
      /*::[*/
      678: {
        /* n:"BrtSheetProtectionIso" */
      },
      /*::[*/
      679: {
        /* n:"BrtCsProtectionIso" */
      },
      /*::[*/
      680: {
        /* n:"BrtRangeProtectionIso" */
      },
      /*::[*/
      681: {
        /* n:"BrtDValList" */
      },
      /*::[*/
      1024: {
        /* n:"BrtRwDescent" */
      },
      /*::[*/
      1025: {
        /* n:"BrtKnownFonts" */
      },
      /*::[*/
      1026: {
        /* n:"BrtBeginSXTupleSet", */
        T: 1
      },
      /*::[*/
      1027: {
        /* n:"BrtEndSXTupleSet", */
        T: -1
      },
      /*::[*/
      1028: {
        /* n:"BrtBeginSXTupleSetHeader", */
        T: 1
      },
      /*::[*/
      1029: {
        /* n:"BrtEndSXTupleSetHeader", */
        T: -1
      },
      /*::[*/
      1030: {
        /* n:"BrtSXTupleSetHeaderItem" */
      },
      /*::[*/
      1031: {
        /* n:"BrtBeginSXTupleSetData", */
        T: 1
      },
      /*::[*/
      1032: {
        /* n:"BrtEndSXTupleSetData", */
        T: -1
      },
      /*::[*/
      1033: {
        /* n:"BrtBeginSXTupleSetRow", */
        T: 1
      },
      /*::[*/
      1034: {
        /* n:"BrtEndSXTupleSetRow", */
        T: -1
      },
      /*::[*/
      1035: {
        /* n:"BrtSXTupleSetRowItem" */
      },
      /*::[*/
      1036: {
        /* n:"BrtNameExt" */
      },
      /*::[*/
      1037: {
        /* n:"BrtPCDH14" */
      },
      /*::[*/
      1038: {
        /* n:"BrtBeginPCDCalcMem14", */
        T: 1
      },
      /*::[*/
      1039: {
        /* n:"BrtEndPCDCalcMem14", */
        T: -1
      },
      /*::[*/
      1040: {
        /* n:"BrtSXTH14" */
      },
      /*::[*/
      1041: {
        /* n:"BrtBeginSparklineGroup", */
        T: 1
      },
      /*::[*/
      1042: {
        /* n:"BrtEndSparklineGroup", */
        T: -1
      },
      /*::[*/
      1043: {
        /* n:"BrtSparkline" */
      },
      /*::[*/
      1044: {
        /* n:"BrtSXDI14" */
      },
      /*::[*/
      1045: {
        /* n:"BrtWsFmtInfoEx14" */
      },
      /*::[*/
      1046: {
        /* n:"BrtBeginConditionalFormatting14", */
        T: 1
      },
      /*::[*/
      1047: {
        /* n:"BrtEndConditionalFormatting14", */
        T: -1
      },
      /*::[*/
      1048: {
        /* n:"BrtBeginCFRule14", */
        T: 1
      },
      /*::[*/
      1049: {
        /* n:"BrtEndCFRule14", */
        T: -1
      },
      /*::[*/
      1050: {
        /* n:"BrtCFVO14" */
      },
      /*::[*/
      1051: {
        /* n:"BrtBeginDatabar14", */
        T: 1
      },
      /*::[*/
      1052: {
        /* n:"BrtBeginIconSet14", */
        T: 1
      },
      /*::[*/
      1053: {
        /* n:"BrtDVal14", */
        f: parse_BrtDVal14
      },
      /*::[*/
      1054: {
        /* n:"BrtBeginDVals14", */
        T: 1
      },
      /*::[*/
      1055: {
        /* n:"BrtColor14" */
      },
      /*::[*/
      1056: {
        /* n:"BrtBeginSparklines", */
        T: 1
      },
      /*::[*/
      1057: {
        /* n:"BrtEndSparklines", */
        T: -1
      },
      /*::[*/
      1058: {
        /* n:"BrtBeginSparklineGroups", */
        T: 1
      },
      /*::[*/
      1059: {
        /* n:"BrtEndSparklineGroups", */
        T: -1
      },
      /*::[*/
      1061: {
        /* n:"BrtSXVD14" */
      },
      /*::[*/
      1062: {
        /* n:"BrtBeginSXView14", */
        T: 1
      },
      /*::[*/
      1063: {
        /* n:"BrtEndSXView14", */
        T: -1
      },
      /*::[*/
      1064: {
        /* n:"BrtBeginSXView16", */
        T: 1
      },
      /*::[*/
      1065: {
        /* n:"BrtEndSXView16", */
        T: -1
      },
      /*::[*/
      1066: {
        /* n:"BrtBeginPCD14", */
        T: 1
      },
      /*::[*/
      1067: {
        /* n:"BrtEndPCD14", */
        T: -1
      },
      /*::[*/
      1068: {
        /* n:"BrtBeginExtConn14", */
        T: 1
      },
      /*::[*/
      1069: {
        /* n:"BrtEndExtConn14", */
        T: -1
      },
      /*::[*/
      1070: {
        /* n:"BrtBeginSlicerCacheIDs", */
        T: 1
      },
      /*::[*/
      1071: {
        /* n:"BrtEndSlicerCacheIDs", */
        T: -1
      },
      /*::[*/
      1072: {
        /* n:"BrtBeginSlicerCacheID", */
        T: 1
      },
      /*::[*/
      1073: {
        /* n:"BrtEndSlicerCacheID", */
        T: -1
      },
      /*::[*/
      1075: {
        /* n:"BrtBeginSlicerCache", */
        T: 1
      },
      /*::[*/
      1076: {
        /* n:"BrtEndSlicerCache", */
        T: -1
      },
      /*::[*/
      1077: {
        /* n:"BrtBeginSlicerCacheDef", */
        T: 1
      },
      /*::[*/
      1078: {
        /* n:"BrtEndSlicerCacheDef", */
        T: -1
      },
      /*::[*/
      1079: {
        /* n:"BrtBeginSlicersEx", */
        T: 1
      },
      /*::[*/
      1080: {
        /* n:"BrtEndSlicersEx", */
        T: -1
      },
      /*::[*/
      1081: {
        /* n:"BrtBeginSlicerEx", */
        T: 1
      },
      /*::[*/
      1082: {
        /* n:"BrtEndSlicerEx", */
        T: -1
      },
      /*::[*/
      1083: {
        /* n:"BrtBeginSlicer", */
        T: 1
      },
      /*::[*/
      1084: {
        /* n:"BrtEndSlicer", */
        T: -1
      },
      /*::[*/
      1085: {
        /* n:"BrtSlicerCachePivotTables" */
      },
      /*::[*/
      1086: {
        /* n:"BrtBeginSlicerCacheOlapImpl", */
        T: 1
      },
      /*::[*/
      1087: {
        /* n:"BrtEndSlicerCacheOlapImpl", */
        T: -1
      },
      /*::[*/
      1088: {
        /* n:"BrtBeginSlicerCacheLevelsData", */
        T: 1
      },
      /*::[*/
      1089: {
        /* n:"BrtEndSlicerCacheLevelsData", */
        T: -1
      },
      /*::[*/
      1090: {
        /* n:"BrtBeginSlicerCacheLevelData", */
        T: 1
      },
      /*::[*/
      1091: {
        /* n:"BrtEndSlicerCacheLevelData", */
        T: -1
      },
      /*::[*/
      1092: {
        /* n:"BrtBeginSlicerCacheSiRanges", */
        T: 1
      },
      /*::[*/
      1093: {
        /* n:"BrtEndSlicerCacheSiRanges", */
        T: -1
      },
      /*::[*/
      1094: {
        /* n:"BrtBeginSlicerCacheSiRange", */
        T: 1
      },
      /*::[*/
      1095: {
        /* n:"BrtEndSlicerCacheSiRange", */
        T: -1
      },
      /*::[*/
      1096: {
        /* n:"BrtSlicerCacheOlapItem" */
      },
      /*::[*/
      1097: {
        /* n:"BrtBeginSlicerCacheSelections", */
        T: 1
      },
      /*::[*/
      1098: {
        /* n:"BrtSlicerCacheSelection" */
      },
      /*::[*/
      1099: {
        /* n:"BrtEndSlicerCacheSelections", */
        T: -1
      },
      /*::[*/
      1100: {
        /* n:"BrtBeginSlicerCacheNative", */
        T: 1
      },
      /*::[*/
      1101: {
        /* n:"BrtEndSlicerCacheNative", */
        T: -1
      },
      /*::[*/
      1102: {
        /* n:"BrtSlicerCacheNativeItem" */
      },
      /*::[*/
      1103: {
        /* n:"BrtRangeProtection14" */
      },
      /*::[*/
      1104: {
        /* n:"BrtRangeProtectionIso14" */
      },
      /*::[*/
      1105: {
        /* n:"BrtCellIgnoreEC14" */
      },
      /*::[*/
      1111: {
        /* n:"BrtList14" */
      },
      /*::[*/
      1112: {
        /* n:"BrtCFIcon" */
      },
      /*::[*/
      1113: {
        /* n:"BrtBeginSlicerCachesPivotCacheIDs", */
        T: 1
      },
      /*::[*/
      1114: {
        /* n:"BrtEndSlicerCachesPivotCacheIDs", */
        T: -1
      },
      /*::[*/
      1115: {
        /* n:"BrtBeginSlicers", */
        T: 1
      },
      /*::[*/
      1116: {
        /* n:"BrtEndSlicers", */
        T: -1
      },
      /*::[*/
      1117: {
        /* n:"BrtWbProp14" */
      },
      /*::[*/
      1118: {
        /* n:"BrtBeginSXEdit", */
        T: 1
      },
      /*::[*/
      1119: {
        /* n:"BrtEndSXEdit", */
        T: -1
      },
      /*::[*/
      1120: {
        /* n:"BrtBeginSXEdits", */
        T: 1
      },
      /*::[*/
      1121: {
        /* n:"BrtEndSXEdits", */
        T: -1
      },
      /*::[*/
      1122: {
        /* n:"BrtBeginSXChange", */
        T: 1
      },
      /*::[*/
      1123: {
        /* n:"BrtEndSXChange", */
        T: -1
      },
      /*::[*/
      1124: {
        /* n:"BrtBeginSXChanges", */
        T: 1
      },
      /*::[*/
      1125: {
        /* n:"BrtEndSXChanges", */
        T: -1
      },
      /*::[*/
      1126: {
        /* n:"BrtSXTupleItems" */
      },
      /*::[*/
      1128: {
        /* n:"BrtBeginSlicerStyle", */
        T: 1
      },
      /*::[*/
      1129: {
        /* n:"BrtEndSlicerStyle", */
        T: -1
      },
      /*::[*/
      1130: {
        /* n:"BrtSlicerStyleElement" */
      },
      /*::[*/
      1131: {
        /* n:"BrtBeginStyleSheetExt14", */
        T: 1
      },
      /*::[*/
      1132: {
        /* n:"BrtEndStyleSheetExt14", */
        T: -1
      },
      /*::[*/
      1133: {
        /* n:"BrtBeginSlicerCachesPivotCacheID", */
        T: 1
      },
      /*::[*/
      1134: {
        /* n:"BrtEndSlicerCachesPivotCacheID", */
        T: -1
      },
      /*::[*/
      1135: {
        /* n:"BrtBeginConditionalFormattings", */
        T: 1
      },
      /*::[*/
      1136: {
        /* n:"BrtEndConditionalFormattings", */
        T: -1
      },
      /*::[*/
      1137: {
        /* n:"BrtBeginPCDCalcMemExt", */
        T: 1
      },
      /*::[*/
      1138: {
        /* n:"BrtEndPCDCalcMemExt", */
        T: -1
      },
      /*::[*/
      1139: {
        /* n:"BrtBeginPCDCalcMemsExt", */
        T: 1
      },
      /*::[*/
      1140: {
        /* n:"BrtEndPCDCalcMemsExt", */
        T: -1
      },
      /*::[*/
      1141: {
        /* n:"BrtPCDField14" */
      },
      /*::[*/
      1142: {
        /* n:"BrtBeginSlicerStyles", */
        T: 1
      },
      /*::[*/
      1143: {
        /* n:"BrtEndSlicerStyles", */
        T: -1
      },
      /*::[*/
      1144: {
        /* n:"BrtBeginSlicerStyleElements", */
        T: 1
      },
      /*::[*/
      1145: {
        /* n:"BrtEndSlicerStyleElements", */
        T: -1
      },
      /*::[*/
      1146: {
        /* n:"BrtCFRuleExt" */
      },
      /*::[*/
      1147: {
        /* n:"BrtBeginSXCondFmt14", */
        T: 1
      },
      /*::[*/
      1148: {
        /* n:"BrtEndSXCondFmt14", */
        T: -1
      },
      /*::[*/
      1149: {
        /* n:"BrtBeginSXCondFmts14", */
        T: 1
      },
      /*::[*/
      1150: {
        /* n:"BrtEndSXCondFmts14", */
        T: -1
      },
      /*::[*/
      1152: {
        /* n:"BrtBeginSortCond14", */
        T: 1
      },
      /*::[*/
      1153: {
        /* n:"BrtEndSortCond14", */
        T: -1
      },
      /*::[*/
      1154: {
        /* n:"BrtEndDVals14", */
        T: -1
      },
      /*::[*/
      1155: {
        /* n:"BrtEndIconSet14", */
        T: -1
      },
      /*::[*/
      1156: {
        /* n:"BrtEndDatabar14", */
        T: -1
      },
      /*::[*/
      1157: {
        /* n:"BrtBeginColorScale14", */
        T: 1
      },
      /*::[*/
      1158: {
        /* n:"BrtEndColorScale14", */
        T: -1
      },
      /*::[*/
      1159: {
        /* n:"BrtBeginSxrules14", */
        T: 1
      },
      /*::[*/
      1160: {
        /* n:"BrtEndSxrules14", */
        T: -1
      },
      /*::[*/
      1161: {
        /* n:"BrtBeginPRule14", */
        T: 1
      },
      /*::[*/
      1162: {
        /* n:"BrtEndPRule14", */
        T: -1
      },
      /*::[*/
      1163: {
        /* n:"BrtBeginPRFilters14", */
        T: 1
      },
      /*::[*/
      1164: {
        /* n:"BrtEndPRFilters14", */
        T: -1
      },
      /*::[*/
      1165: {
        /* n:"BrtBeginPRFilter14", */
        T: 1
      },
      /*::[*/
      1166: {
        /* n:"BrtEndPRFilter14", */
        T: -1
      },
      /*::[*/
      1167: {
        /* n:"BrtBeginPRFItem14", */
        T: 1
      },
      /*::[*/
      1168: {
        /* n:"BrtEndPRFItem14", */
        T: -1
      },
      /*::[*/
      1169: {
        /* n:"BrtBeginCellIgnoreECs14", */
        T: 1
      },
      /*::[*/
      1170: {
        /* n:"BrtEndCellIgnoreECs14", */
        T: -1
      },
      /*::[*/
      1171: {
        /* n:"BrtDxf14" */
      },
      /*::[*/
      1172: {
        /* n:"BrtBeginDxF14s", */
        T: 1
      },
      /*::[*/
      1173: {
        /* n:"BrtEndDxf14s", */
        T: -1
      },
      /*::[*/
      1177: {
        /* n:"BrtFilter14" */
      },
      /*::[*/
      1178: {
        /* n:"BrtBeginCustomFilters14", */
        T: 1
      },
      /*::[*/
      1180: {
        /* n:"BrtCustomFilter14" */
      },
      /*::[*/
      1181: {
        /* n:"BrtIconFilter14" */
      },
      /*::[*/
      1182: {
        /* n:"BrtPivotCacheConnectionName" */
      },
      /*::[*/
      2048: {
        /* n:"BrtBeginDecoupledPivotCacheIDs", */
        T: 1
      },
      /*::[*/
      2049: {
        /* n:"BrtEndDecoupledPivotCacheIDs", */
        T: -1
      },
      /*::[*/
      2050: {
        /* n:"BrtDecoupledPivotCacheID" */
      },
      /*::[*/
      2051: {
        /* n:"BrtBeginPivotTableRefs", */
        T: 1
      },
      /*::[*/
      2052: {
        /* n:"BrtEndPivotTableRefs", */
        T: -1
      },
      /*::[*/
      2053: {
        /* n:"BrtPivotTableRef" */
      },
      /*::[*/
      2054: {
        /* n:"BrtSlicerCacheBookPivotTables" */
      },
      /*::[*/
      2055: {
        /* n:"BrtBeginSxvcells", */
        T: 1
      },
      /*::[*/
      2056: {
        /* n:"BrtEndSxvcells", */
        T: -1
      },
      /*::[*/
      2057: {
        /* n:"BrtBeginSxRow", */
        T: 1
      },
      /*::[*/
      2058: {
        /* n:"BrtEndSxRow", */
        T: -1
      },
      /*::[*/
      2060: {
        /* n:"BrtPcdCalcMem15" */
      },
      /*::[*/
      2067: {
        /* n:"BrtQsi15" */
      },
      /*::[*/
      2068: {
        /* n:"BrtBeginWebExtensions", */
        T: 1
      },
      /*::[*/
      2069: {
        /* n:"BrtEndWebExtensions", */
        T: -1
      },
      /*::[*/
      2070: {
        /* n:"BrtWebExtension" */
      },
      /*::[*/
      2071: {
        /* n:"BrtAbsPath15" */
      },
      /*::[*/
      2072: {
        /* n:"BrtBeginPivotTableUISettings", */
        T: 1
      },
      /*::[*/
      2073: {
        /* n:"BrtEndPivotTableUISettings", */
        T: -1
      },
      /*::[*/
      2075: {
        /* n:"BrtTableSlicerCacheIDs" */
      },
      /*::[*/
      2076: {
        /* n:"BrtTableSlicerCacheID" */
      },
      /*::[*/
      2077: {
        /* n:"BrtBeginTableSlicerCache", */
        T: 1
      },
      /*::[*/
      2078: {
        /* n:"BrtEndTableSlicerCache", */
        T: -1
      },
      /*::[*/
      2079: {
        /* n:"BrtSxFilter15" */
      },
      /*::[*/
      2080: {
        /* n:"BrtBeginTimelineCachePivotCacheIDs", */
        T: 1
      },
      /*::[*/
      2081: {
        /* n:"BrtEndTimelineCachePivotCacheIDs", */
        T: -1
      },
      /*::[*/
      2082: {
        /* n:"BrtTimelineCachePivotCacheID" */
      },
      /*::[*/
      2083: {
        /* n:"BrtBeginTimelineCacheIDs", */
        T: 1
      },
      /*::[*/
      2084: {
        /* n:"BrtEndTimelineCacheIDs", */
        T: -1
      },
      /*::[*/
      2085: {
        /* n:"BrtBeginTimelineCacheID", */
        T: 1
      },
      /*::[*/
      2086: {
        /* n:"BrtEndTimelineCacheID", */
        T: -1
      },
      /*::[*/
      2087: {
        /* n:"BrtBeginTimelinesEx", */
        T: 1
      },
      /*::[*/
      2088: {
        /* n:"BrtEndTimelinesEx", */
        T: -1
      },
      /*::[*/
      2089: {
        /* n:"BrtBeginTimelineEx", */
        T: 1
      },
      /*::[*/
      2090: {
        /* n:"BrtEndTimelineEx", */
        T: -1
      },
      /*::[*/
      2091: {
        /* n:"BrtWorkBookPr15" */
      },
      /*::[*/
      2092: {
        /* n:"BrtPCDH15" */
      },
      /*::[*/
      2093: {
        /* n:"BrtBeginTimelineStyle", */
        T: 1
      },
      /*::[*/
      2094: {
        /* n:"BrtEndTimelineStyle", */
        T: -1
      },
      /*::[*/
      2095: {
        /* n:"BrtTimelineStyleElement" */
      },
      /*::[*/
      2096: {
        /* n:"BrtBeginTimelineStylesheetExt15", */
        T: 1
      },
      /*::[*/
      2097: {
        /* n:"BrtEndTimelineStylesheetExt15", */
        T: -1
      },
      /*::[*/
      2098: {
        /* n:"BrtBeginTimelineStyles", */
        T: 1
      },
      /*::[*/
      2099: {
        /* n:"BrtEndTimelineStyles", */
        T: -1
      },
      /*::[*/
      2100: {
        /* n:"BrtBeginTimelineStyleElements", */
        T: 1
      },
      /*::[*/
      2101: {
        /* n:"BrtEndTimelineStyleElements", */
        T: -1
      },
      /*::[*/
      2102: {
        /* n:"BrtDxf15" */
      },
      /*::[*/
      2103: {
        /* n:"BrtBeginDxfs15", */
        T: 1
      },
      /*::[*/
      2104: {
        /* n:"BrtEndDxfs15", */
        T: -1
      },
      /*::[*/
      2105: {
        /* n:"BrtSlicerCacheHideItemsWithNoData" */
      },
      /*::[*/
      2106: {
        /* n:"BrtBeginItemUniqueNames", */
        T: 1
      },
      /*::[*/
      2107: {
        /* n:"BrtEndItemUniqueNames", */
        T: -1
      },
      /*::[*/
      2108: {
        /* n:"BrtItemUniqueName" */
      },
      /*::[*/
      2109: {
        /* n:"BrtBeginExtConn15", */
        T: 1
      },
      /*::[*/
      2110: {
        /* n:"BrtEndExtConn15", */
        T: -1
      },
      /*::[*/
      2111: {
        /* n:"BrtBeginOledbPr15", */
        T: 1
      },
      /*::[*/
      2112: {
        /* n:"BrtEndOledbPr15", */
        T: -1
      },
      /*::[*/
      2113: {
        /* n:"BrtBeginDataFeedPr15", */
        T: 1
      },
      /*::[*/
      2114: {
        /* n:"BrtEndDataFeedPr15", */
        T: -1
      },
      /*::[*/
      2115: {
        /* n:"BrtTextPr15" */
      },
      /*::[*/
      2116: {
        /* n:"BrtRangePr15" */
      },
      /*::[*/
      2117: {
        /* n:"BrtDbCommand15" */
      },
      /*::[*/
      2118: {
        /* n:"BrtBeginDbTables15", */
        T: 1
      },
      /*::[*/
      2119: {
        /* n:"BrtEndDbTables15", */
        T: -1
      },
      /*::[*/
      2120: {
        /* n:"BrtDbTable15" */
      },
      /*::[*/
      2121: {
        /* n:"BrtBeginDataModel", */
        T: 1
      },
      /*::[*/
      2122: {
        /* n:"BrtEndDataModel", */
        T: -1
      },
      /*::[*/
      2123: {
        /* n:"BrtBeginModelTables", */
        T: 1
      },
      /*::[*/
      2124: {
        /* n:"BrtEndModelTables", */
        T: -1
      },
      /*::[*/
      2125: {
        /* n:"BrtModelTable" */
      },
      /*::[*/
      2126: {
        /* n:"BrtBeginModelRelationships", */
        T: 1
      },
      /*::[*/
      2127: {
        /* n:"BrtEndModelRelationships", */
        T: -1
      },
      /*::[*/
      2128: {
        /* n:"BrtModelRelationship" */
      },
      /*::[*/
      2129: {
        /* n:"BrtBeginECTxtWiz15", */
        T: 1
      },
      /*::[*/
      2130: {
        /* n:"BrtEndECTxtWiz15", */
        T: -1
      },
      /*::[*/
      2131: {
        /* n:"BrtBeginECTWFldInfoLst15", */
        T: 1
      },
      /*::[*/
      2132: {
        /* n:"BrtEndECTWFldInfoLst15", */
        T: -1
      },
      /*::[*/
      2133: {
        /* n:"BrtBeginECTWFldInfo15", */
        T: 1
      },
      /*::[*/
      2134: {
        /* n:"BrtFieldListActiveItem" */
      },
      /*::[*/
      2135: {
        /* n:"BrtPivotCacheIdVersion" */
      },
      /*::[*/
      2136: {
        /* n:"BrtSXDI15" */
      },
      /*::[*/
      2137: {
        /* n:"BrtBeginModelTimeGroupings", */
        T: 1
      },
      /*::[*/
      2138: {
        /* n:"BrtEndModelTimeGroupings", */
        T: -1
      },
      /*::[*/
      2139: {
        /* n:"BrtBeginModelTimeGrouping", */
        T: 1
      },
      /*::[*/
      2140: {
        /* n:"BrtEndModelTimeGrouping", */
        T: -1
      },
      /*::[*/
      2141: {
        /* n:"BrtModelTimeGroupingCalcCol" */
      },
      /*::[*/
      3072: {
        /* n:"BrtUid" */
      },
      /*::[*/
      3073: {
        /* n:"BrtRevisionPtr" */
      },
      /*::[*/
      4096: {
        /* n:"BrtBeginDynamicArrayPr", */
        T: 1
      },
      /*::[*/
      4097: {
        /* n:"BrtEndDynamicArrayPr", */
        T: -1
      },
      /*::[*/
      5002: {
        /* n:"BrtBeginRichValueBlock", */
        T: 1
      },
      /*::[*/
      5003: {
        /* n:"BrtEndRichValueBlock", */
        T: -1
      },
      /*::[*/
      5081: {
        /* n:"BrtBeginRichFilters", */
        T: 1
      },
      /*::[*/
      5082: {
        /* n:"BrtEndRichFilters", */
        T: -1
      },
      /*::[*/
      5083: {
        /* n:"BrtRichFilter" */
      },
      /*::[*/
      5084: {
        /* n:"BrtBeginRichFilterColumn", */
        T: 1
      },
      /*::[*/
      5085: {
        /* n:"BrtEndRichFilterColumn", */
        T: -1
      },
      /*::[*/
      5086: {
        /* n:"BrtBeginCustomRichFilters", */
        T: 1
      },
      /*::[*/
      5087: {
        /* n:"BrtEndCustomRichFilters", */
        T: -1
      },
      /*::[*/
      5088: {
        /* n:"BrtCustomRichFilter" */
      },
      /*::[*/
      5089: {
        /* n:"BrtTop10RichFilter" */
      },
      /*::[*/
      5090: {
        /* n:"BrtDynamicRichFilter" */
      },
      /*::[*/
      5092: {
        /* n:"BrtBeginRichSortCondition", */
        T: 1
      },
      /*::[*/
      5093: {
        /* n:"BrtEndRichSortCondition", */
        T: -1
      },
      /*::[*/
      5094: {
        /* n:"BrtRichFilterDateGroupItem" */
      },
      /*::[*/
      5095: {
        /* n:"BrtBeginCalcFeatures", */
        T: 1
      },
      /*::[*/
      5096: {
        /* n:"BrtEndCalcFeatures", */
        T: -1
      },
      /*::[*/
      5097: {
        /* n:"BrtCalcFeature" */
      },
      /*::[*/
      5099: {
        /* n:"BrtExternalLinksPr" */
      },
      /*::[*/
      65535: { n: "" }
    };
    function write_biff_rec(ba, type, payload, length) {
      var t = type;
      if (isNaN(t)) return;
      var len2 = length || (payload || []).length || 0;
      var o2 = ba.next(4);
      o2.write_shift(2, t);
      o2.write_shift(2, len2);
      if (
        /*:: len != null &&*/
        len2 > 0 && is_buf(payload)
      ) ba.push(payload);
    }
    function write_biff_continue(ba, type, payload, length) {
      var len2 = (payload || []).length || 0;
      if (len2 <= 8224) return write_biff_rec(ba, type, payload, len2);
      var t = type;
      if (isNaN(t)) return;
      var parts = payload.parts || [], sidx = 0;
      var i2 = 0, w2 = 0;
      while (w2 + (parts[sidx] || 8224) <= 8224) {
        w2 += parts[sidx] || 8224;
        sidx++;
      }
      var o2 = ba.next(4);
      o2.write_shift(2, t);
      o2.write_shift(2, w2);
      ba.push(payload.slice(i2, i2 + w2));
      i2 += w2;
      while (i2 < len2) {
        o2 = ba.next(4);
        o2.write_shift(2, 60);
        w2 = 0;
        while (w2 + (parts[sidx] || 8224) <= 8224) {
          w2 += parts[sidx] || 8224;
          sidx++;
        }
        o2.write_shift(2, w2);
        ba.push(payload.slice(i2, i2 + w2));
        i2 += w2;
      }
    }
    function write_BIFF2Cell(out2, r, c2) {
      if (!out2) out2 = new_buf(7);
      out2.write_shift(2, r);
      out2.write_shift(2, c2);
      out2.write_shift(2, 0);
      out2.write_shift(1, 0);
      return out2;
    }
    function write_BIFF2BERR(r, c2, val, t) {
      var out2 = new_buf(9);
      write_BIFF2Cell(out2, r, c2);
      write_Bes(val, t || "b", out2);
      return out2;
    }
    function write_BIFF2LABEL(r, c2, val) {
      var out2 = new_buf(8 + 2 * val.length);
      write_BIFF2Cell(out2, r, c2);
      out2.write_shift(1, val.length);
      out2.write_shift(val.length, val, "sbcs");
      return out2.l < out2.length ? out2.slice(0, out2.l) : out2;
    }
    function write_ws_biff2_cell(ba, cell, R2, C2) {
      if (cell.v != null) switch (cell.t) {
        case "d":
        case "n":
          var v4 = cell.t == "d" ? datenum(parseDate(cell.v)) : cell.v;
          if (v4 == (v4 | 0) && v4 >= 0 && v4 < 65536)
            write_biff_rec(ba, 2, write_BIFF2INT(R2, C2, v4));
          else
            write_biff_rec(ba, 3, write_BIFF2NUM(R2, C2, v4));
          return;
        case "b":
        case "e":
          write_biff_rec(ba, 5, write_BIFF2BERR(R2, C2, cell.v, cell.t));
          return;
        /* TODO: codepage, sst */
        case "s":
        case "str":
          write_biff_rec(ba, 4, write_BIFF2LABEL(R2, C2, (cell.v || "").slice(0, 255)));
          return;
      }
      write_biff_rec(ba, 1, write_BIFF2Cell(null, R2, C2));
    }
    function write_ws_biff2(ba, ws, idx, opts) {
      var dense = Array.isArray(ws);
      var range2 = safe_decode_range(ws["!ref"] || "A1"), ref2, rr = "", cols = [];
      if (range2.e.c > 255 || range2.e.r > 16383) {
        if (opts.WTF) throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:IV16384");
        range2.e.c = Math.min(range2.e.c, 255);
        range2.e.r = Math.min(range2.e.c, 16383);
        ref2 = encode_range(range2);
      }
      for (var R2 = range2.s.r; R2 <= range2.e.r; ++R2) {
        rr = encode_row(R2);
        for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
          if (R2 === range2.s.r) cols[C2] = encode_col(C2);
          ref2 = cols[C2] + rr;
          var cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
          if (!cell) continue;
          write_ws_biff2_cell(ba, cell, R2, C2);
        }
      }
    }
    function write_biff2_buf(wb, opts) {
      var o2 = opts || {};
      var ba = buf_array();
      var idx = 0;
      for (var i2 = 0; i2 < wb.SheetNames.length; ++i2) if (wb.SheetNames[i2] == o2.sheet) idx = i2;
      if (idx == 0 && !!o2.sheet && wb.SheetNames[0] != o2.sheet) throw new Error("Sheet not found: " + o2.sheet);
      write_biff_rec(ba, o2.biff == 4 ? 1033 : o2.biff == 3 ? 521 : 9, write_BOF(wb, 16, o2));
      write_ws_biff2(ba, wb.Sheets[wb.SheetNames[idx]], idx, o2);
      write_biff_rec(ba, 10);
      return ba.end();
    }
    function write_FONTS_biff8(ba, data, opts) {
      write_biff_rec(ba, 49, write_Font({
        sz: 12,
        name: "Arial"
      }, opts));
    }
    function write_FMTS_biff8(ba, NF, opts) {
      if (!NF) return;
      [[5, 8], [23, 26], [41, 44], [
        /*63*/
        50,
        /*66],[164,*/
        392
      ]].forEach(function(r) {
        for (var i2 = r[0]; i2 <= r[1]; ++i2) if (NF[i2] != null) write_biff_rec(ba, 1054, write_Format(i2, NF[i2], opts));
      });
    }
    function write_FEAT(ba, ws) {
      var o2 = new_buf(19);
      o2.write_shift(4, 2151);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(2, 3);
      o2.write_shift(1, 1);
      o2.write_shift(4, 0);
      write_biff_rec(ba, 2151, o2);
      o2 = new_buf(39);
      o2.write_shift(4, 2152);
      o2.write_shift(4, 0);
      o2.write_shift(4, 0);
      o2.write_shift(2, 3);
      o2.write_shift(1, 0);
      o2.write_shift(4, 0);
      o2.write_shift(2, 1);
      o2.write_shift(4, 4);
      o2.write_shift(2, 0);
      write_Ref8U(safe_decode_range(ws["!ref"] || "A1"), o2);
      o2.write_shift(4, 4);
      write_biff_rec(ba, 2152, o2);
    }
    function write_CELLXFS_biff8(ba, opts) {
      for (var i2 = 0; i2 < 16; ++i2) write_biff_rec(ba, 224, write_XF({ numFmtId: 0, style: true }, 0, opts));
      opts.cellXfs.forEach(function(c2) {
        write_biff_rec(ba, 224, write_XF(c2, 0, opts));
      });
    }
    function write_ws_biff8_hlinks(ba, ws) {
      for (var R2 = 0; R2 < ws["!links"].length; ++R2) {
        var HL2 = ws["!links"][R2];
        write_biff_rec(ba, 440, write_HLink(HL2));
        if (HL2[1].Tooltip) write_biff_rec(ba, 2048, write_HLinkTooltip(HL2));
      }
      delete ws["!links"];
    }
    function write_ws_cols_biff8(ba, cols) {
      if (!cols) return;
      var cnt = 0;
      cols.forEach(function(col, idx) {
        if (++cnt <= 256 && col) {
          write_biff_rec(ba, 125, write_ColInfo(col_obj_w(idx, col), idx));
        }
      });
    }
    function write_ws_biff8_cell(ba, cell, R2, C2, opts) {
      var os = 16 + get_cell_style(opts.cellXfs, cell, opts);
      if (cell.v == null && !cell.bf) {
        write_biff_rec(ba, 513, write_XLSCell(R2, C2, os));
        return;
      }
      if (cell.bf) write_biff_rec(ba, 6, write_Formula(cell, R2, C2, opts, os));
      else switch (cell.t) {
        case "d":
        case "n":
          var v4 = cell.t == "d" ? datenum(parseDate(cell.v)) : cell.v;
          write_biff_rec(ba, 515, write_Number(R2, C2, v4, os));
          break;
        case "b":
        case "e":
          write_biff_rec(ba, 517, write_BoolErr(R2, C2, cell.v, os, opts, cell.t));
          break;
        /* TODO: codepage, sst */
        case "s":
        case "str":
          if (opts.bookSST) {
            var isst = get_sst_id(opts.Strings, cell.v, opts.revStrings);
            write_biff_rec(ba, 253, write_LabelSst(R2, C2, isst, os));
          } else write_biff_rec(ba, 516, write_Label(R2, C2, (cell.v || "").slice(0, 255), os, opts));
          break;
        default:
          write_biff_rec(ba, 513, write_XLSCell(R2, C2, os));
      }
    }
    function write_ws_biff8(idx, opts, wb) {
      var ba = buf_array();
      var s2 = wb.SheetNames[idx], ws = wb.Sheets[s2] || {};
      var _WB = (wb || {}).Workbook || {};
      var _sheet = (_WB.Sheets || [])[idx] || {};
      var dense = Array.isArray(ws);
      var b8 = opts.biff == 8;
      var ref2, rr = "", cols = [];
      var range2 = safe_decode_range(ws["!ref"] || "A1");
      var MAX_ROWS = b8 ? 65536 : 16384;
      if (range2.e.c > 255 || range2.e.r >= MAX_ROWS) {
        if (opts.WTF) throw new Error("Range " + (ws["!ref"] || "A1") + " exceeds format limit A1:IV16384");
        range2.e.c = Math.min(range2.e.c, 255);
        range2.e.r = Math.min(range2.e.c, MAX_ROWS - 1);
      }
      write_biff_rec(ba, 2057, write_BOF(wb, 16, opts));
      write_biff_rec(ba, 13, writeuint16(1));
      write_biff_rec(ba, 12, writeuint16(100));
      write_biff_rec(ba, 15, writebool(true));
      write_biff_rec(ba, 17, writebool(false));
      write_biff_rec(ba, 16, write_Xnum(1e-3));
      write_biff_rec(ba, 95, writebool(true));
      write_biff_rec(ba, 42, writebool(false));
      write_biff_rec(ba, 43, writebool(false));
      write_biff_rec(ba, 130, writeuint16(1));
      write_biff_rec(ba, 128, write_Guts());
      write_biff_rec(ba, 131, writebool(false));
      write_biff_rec(ba, 132, writebool(false));
      if (b8) write_ws_cols_biff8(ba, ws["!cols"]);
      write_biff_rec(ba, 512, write_Dimensions(range2, opts));
      if (b8) ws["!links"] = [];
      for (var R2 = range2.s.r; R2 <= range2.e.r; ++R2) {
        rr = encode_row(R2);
        for (var C2 = range2.s.c; C2 <= range2.e.c; ++C2) {
          if (R2 === range2.s.r) cols[C2] = encode_col(C2);
          ref2 = cols[C2] + rr;
          var cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
          if (!cell) continue;
          write_ws_biff8_cell(ba, cell, R2, C2, opts);
          if (b8 && cell.l) ws["!links"].push([ref2, cell.l]);
        }
      }
      var cname = _sheet.CodeName || _sheet.name || s2;
      if (b8) write_biff_rec(ba, 574, write_Window2((_WB.Views || [])[0]));
      if (b8 && (ws["!merges"] || []).length) write_biff_rec(ba, 229, write_MergeCells(ws["!merges"]));
      if (b8) write_ws_biff8_hlinks(ba, ws);
      write_biff_rec(ba, 442, write_XLUnicodeString(cname));
      if (b8) write_FEAT(ba, ws);
      write_biff_rec(
        ba,
        10
        /* EOF */
      );
      return ba.end();
    }
    function write_biff8_global(wb, bufs, opts) {
      var A2 = buf_array();
      var _WB = (wb || {}).Workbook || {};
      var _sheets = _WB.Sheets || [];
      var _wb = (
        /*::((*/
        _WB.WBProps || {
          /*::CodeName:"ThisWorkbook"*/
        }
      );
      var b8 = opts.biff == 8, b5 = opts.biff == 5;
      write_biff_rec(A2, 2057, write_BOF(wb, 5, opts));
      if (opts.bookType == "xla") write_biff_rec(
        A2,
        135
        /* Addin */
      );
      write_biff_rec(A2, 225, b8 ? writeuint16(1200) : null);
      write_biff_rec(A2, 193, writezeroes(2));
      if (b5) write_biff_rec(
        A2,
        191
        /* ToolbarHdr */
      );
      if (b5) write_biff_rec(
        A2,
        192
        /* ToolbarEnd */
      );
      write_biff_rec(
        A2,
        226
        /* InterfaceEnd */
      );
      write_biff_rec(A2, 92, write_WriteAccess("SheetJS", opts));
      write_biff_rec(A2, 66, writeuint16(b8 ? 1200 : 1252));
      if (b8) write_biff_rec(A2, 353, writeuint16(0));
      if (b8) write_biff_rec(
        A2,
        448
        /* Excel9File */
      );
      write_biff_rec(A2, 317, write_RRTabId(wb.SheetNames.length));
      if (b8 && wb.vbaraw) write_biff_rec(
        A2,
        211
        /* ObProj */
      );
      if (b8 && wb.vbaraw) {
        var cname = _wb.CodeName || "ThisWorkbook";
        write_biff_rec(A2, 442, write_XLUnicodeString(cname));
      }
      write_biff_rec(A2, 156, writeuint16(17));
      write_biff_rec(A2, 25, writebool(false));
      write_biff_rec(A2, 18, writebool(false));
      write_biff_rec(A2, 19, writeuint16(0));
      if (b8) write_biff_rec(A2, 431, writebool(false));
      if (b8) write_biff_rec(A2, 444, writeuint16(0));
      write_biff_rec(A2, 61, write_Window1());
      write_biff_rec(A2, 64, writebool(false));
      write_biff_rec(A2, 141, writeuint16(0));
      write_biff_rec(A2, 34, writebool(safe1904(wb) == "true"));
      write_biff_rec(A2, 14, writebool(true));
      if (b8) write_biff_rec(A2, 439, writebool(false));
      write_biff_rec(A2, 218, writeuint16(0));
      write_FONTS_biff8(A2, wb, opts);
      write_FMTS_biff8(A2, wb.SSF, opts);
      write_CELLXFS_biff8(A2, opts);
      if (b8) write_biff_rec(A2, 352, writebool(false));
      var a2 = A2.end();
      var C2 = buf_array();
      if (b8) write_biff_rec(C2, 140, write_Country());
      if (b8 && opts.Strings) write_biff_continue(C2, 252, write_SST(opts.Strings));
      write_biff_rec(
        C2,
        10
        /* EOF */
      );
      var c2 = C2.end();
      var B3 = buf_array();
      var blen = 0, j = 0;
      for (j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length;
      var start2 = a2.length + blen + c2.length;
      for (j = 0; j < wb.SheetNames.length; ++j) {
        var _sheet = _sheets[j] || {};
        write_biff_rec(B3, 133, write_BoundSheet8({ pos: start2, hs: _sheet.Hidden || 0, dt: 0, name: wb.SheetNames[j] }, opts));
        start2 += bufs[j].length;
      }
      var b2 = B3.end();
      if (blen != b2.length) throw new Error("BS8 " + blen + " != " + b2.length);
      var out2 = [];
      if (a2.length) out2.push(a2);
      if (b2.length) out2.push(b2);
      if (c2.length) out2.push(c2);
      return bconcat(out2);
    }
    function write_biff8_buf(wb, opts) {
      var o2 = opts || {};
      var bufs = [];
      if (wb && !wb.SSF) {
        wb.SSF = dup(table_fmt);
      }
      if (wb && wb.SSF) {
        make_ssf();
        SSF_load_table(wb.SSF);
        o2.revssf = evert_num(wb.SSF);
        o2.revssf[wb.SSF[65535]] = 0;
        o2.ssf = wb.SSF;
      }
      o2.Strings = /*::((*/
      [];
      o2.Strings.Count = 0;
      o2.Strings.Unique = 0;
      fix_write_opts(o2);
      o2.cellXfs = [];
      get_cell_style(o2.cellXfs, {}, { revssf: { "General": 0 } });
      if (!wb.Props) wb.Props = {};
      for (var i2 = 0; i2 < wb.SheetNames.length; ++i2) bufs[bufs.length] = write_ws_biff8(i2, o2, wb);
      bufs.unshift(write_biff8_global(wb, bufs, o2));
      return bconcat(bufs);
    }
    function write_biff_buf(wb, opts) {
      for (var i2 = 0; i2 <= wb.SheetNames.length; ++i2) {
        var ws = wb.Sheets[wb.SheetNames[i2]];
        if (!ws || !ws["!ref"]) continue;
        var range2 = decode_range(ws["!ref"]);
        if (range2.e.c > 255) {
          if (typeof console != "undefined" && console.error) console.error("Worksheet '" + wb.SheetNames[i2] + "' extends beyond column IV (255).  Data may be lost.");
        }
      }
      var o2 = opts || {};
      switch (o2.biff || 2) {
        case 8:
        case 5:
          return write_biff8_buf(wb, opts);
        case 4:
        case 3:
        case 2:
          return write_biff2_buf(wb, opts);
      }
      throw new Error("invalid type " + o2.bookType + " for BIFF");
    }
    function make_html_row(ws, r, R2, o2) {
      var M2 = ws["!merges"] || [];
      var oo = [];
      for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
        var RS = 0, CS = 0;
        for (var j = 0; j < M2.length; ++j) {
          if (M2[j].s.r > R2 || M2[j].s.c > C2) continue;
          if (M2[j].e.r < R2 || M2[j].e.c < C2) continue;
          if (M2[j].s.r < R2 || M2[j].s.c < C2) {
            RS = -1;
            break;
          }
          RS = M2[j].e.r - M2[j].s.r + 1;
          CS = M2[j].e.c - M2[j].s.c + 1;
          break;
        }
        if (RS < 0) continue;
        var coord = encode_cell({ r: R2, c: C2 });
        var cell = o2.dense ? (ws[R2] || [])[C2] : ws[coord];
        var w2 = cell && cell.v != null && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || "")) || "";
        var sp = {};
        if (RS > 1) sp.rowspan = RS;
        if (CS > 1) sp.colspan = CS;
        if (o2.editable) w2 = '<span contenteditable="true">' + w2 + "</span>";
        else if (cell) {
          sp["data-t"] = cell && cell.t || "z";
          if (cell.v != null) sp["data-v"] = cell.v;
          if (cell.z != null) sp["data-z"] = cell.z;
          if (cell.l && (cell.l.Target || "#").charAt(0) != "#") w2 = '<a href="' + cell.l.Target + '">' + w2 + "</a>";
        }
        sp.id = (o2.id || "sjs") + "-" + coord;
        oo.push(writextag("td", w2, sp));
      }
      var preamble = "<tr>";
      return preamble + oo.join("") + "</tr>";
    }
    var HTML_BEGIN = '<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';
    var HTML_END = "</body></html>";
    function make_html_preamble(ws, R2, o2) {
      var out2 = [];
      return out2.join("") + "<table" + (o2 && o2.id ? ' id="' + o2.id + '"' : "") + ">";
    }
    function sheet_to_html(ws, opts) {
      var o2 = opts || {};
      var header = o2.header != null ? o2.header : HTML_BEGIN;
      var footer = o2.footer != null ? o2.footer : HTML_END;
      var out2 = [header];
      var r = decode_range(ws["!ref"]);
      o2.dense = Array.isArray(ws);
      out2.push(make_html_preamble(ws, r, o2));
      for (var R2 = r.s.r; R2 <= r.e.r; ++R2) out2.push(make_html_row(ws, r, R2, o2));
      out2.push("</table>" + footer);
      return out2.join("");
    }
    function sheet_add_dom(ws, table, _opts) {
      var opts = _opts || {};
      var or_R = 0, or_C = 0;
      if (opts.origin != null) {
        if (typeof opts.origin == "number") or_R = opts.origin;
        else {
          var _origin = typeof opts.origin == "string" ? decode_cell(opts.origin) : opts.origin;
          or_R = _origin.r;
          or_C = _origin.c;
        }
      }
      var rows = table.getElementsByTagName("tr");
      var sheetRows = Math.min(opts.sheetRows || 1e7, rows.length);
      var range2 = { s: { r: 0, c: 0 }, e: { r: or_R, c: or_C } };
      if (ws["!ref"]) {
        var _range = decode_range(ws["!ref"]);
        range2.s.r = Math.min(range2.s.r, _range.s.r);
        range2.s.c = Math.min(range2.s.c, _range.s.c);
        range2.e.r = Math.max(range2.e.r, _range.e.r);
        range2.e.c = Math.max(range2.e.c, _range.e.c);
        if (or_R == -1) range2.e.r = or_R = _range.e.r + 1;
      }
      var merges = [], midx = 0;
      var rowinfo = ws["!rows"] || (ws["!rows"] = []);
      var _R = 0, R2 = 0, _C = 0, C2 = 0, RS = 0, CS = 0;
      if (!ws["!cols"]) ws["!cols"] = [];
      for (; _R < rows.length && R2 < sheetRows; ++_R) {
        var row = rows[_R];
        if (is_dom_element_hidden(row)) {
          if (opts.display) continue;
          rowinfo[R2] = { hidden: true };
        }
        var elts = row.children;
        for (_C = C2 = 0; _C < elts.length; ++_C) {
          var elt = elts[_C];
          if (opts.display && is_dom_element_hidden(elt)) continue;
          var v4 = elt.hasAttribute("data-v") ? elt.getAttribute("data-v") : elt.hasAttribute("v") ? elt.getAttribute("v") : htmldecode(elt.innerHTML);
          var z2 = elt.getAttribute("data-z") || elt.getAttribute("z");
          for (midx = 0; midx < merges.length; ++midx) {
            var m2 = merges[midx];
            if (m2.s.c == C2 + or_C && m2.s.r < R2 + or_R && R2 + or_R <= m2.e.r) {
              C2 = m2.e.c + 1 - or_C;
              midx = -1;
            }
          }
          CS = +elt.getAttribute("colspan") || 1;
          if ((RS = +elt.getAttribute("rowspan") || 1) > 1 || CS > 1) merges.push({ s: { r: R2 + or_R, c: C2 + or_C }, e: { r: R2 + or_R + (RS || 1) - 1, c: C2 + or_C + (CS || 1) - 1 } });
          var o2 = { t: "s", v: v4 };
          var _t2 = elt.getAttribute("data-t") || elt.getAttribute("t") || "";
          if (v4 != null) {
            if (v4.length == 0) o2.t = _t2 || "z";
            else if (opts.raw || v4.trim().length == 0 || _t2 == "s") ;
            else if (v4 === "TRUE") o2 = { t: "b", v: true };
            else if (v4 === "FALSE") o2 = { t: "b", v: false };
            else if (!isNaN(fuzzynum(v4))) o2 = { t: "n", v: fuzzynum(v4) };
            else if (!isNaN(fuzzydate(v4).getDate())) {
              o2 = { t: "d", v: parseDate(v4) };
              if (!opts.cellDates) o2 = { t: "n", v: datenum(o2.v) };
              o2.z = opts.dateNF || table_fmt[14];
            }
          }
          if (o2.z === void 0 && z2 != null) o2.z = z2;
          var l2 = "", Aelts = elt.getElementsByTagName("A");
          if (Aelts && Aelts.length) {
            for (var Aelti = 0; Aelti < Aelts.length; ++Aelti) if (Aelts[Aelti].hasAttribute("href")) {
              l2 = Aelts[Aelti].getAttribute("href");
              if (l2.charAt(0) != "#") break;
            }
          }
          if (l2 && l2.charAt(0) != "#") o2.l = { Target: l2 };
          if (opts.dense) {
            if (!ws[R2 + or_R]) ws[R2 + or_R] = [];
            ws[R2 + or_R][C2 + or_C] = o2;
          } else ws[encode_cell({ c: C2 + or_C, r: R2 + or_R })] = o2;
          if (range2.e.c < C2 + or_C) range2.e.c = C2 + or_C;
          C2 += CS;
        }
        ++R2;
      }
      if (merges.length) ws["!merges"] = (ws["!merges"] || []).concat(merges);
      range2.e.r = Math.max(range2.e.r, R2 - 1 + or_R);
      ws["!ref"] = encode_range(range2);
      if (R2 >= sheetRows) ws["!fullref"] = encode_range((range2.e.r = rows.length - _R + R2 - 1 + or_R, range2));
      return ws;
    }
    function parse_dom_table(table, _opts) {
      var opts = _opts || {};
      var ws = opts.dense ? [] : {};
      return sheet_add_dom(ws, table, _opts);
    }
    function table_to_book(table, opts) {
      return sheet_to_workbook(parse_dom_table(table, opts), opts);
    }
    function is_dom_element_hidden(element) {
      var display2 = "";
      var get_computed_style = get_get_computed_style_function(element);
      if (get_computed_style) display2 = get_computed_style(element).getPropertyValue("display");
      if (!display2) display2 = element.style && element.style.display;
      return display2 === "none";
    }
    function get_get_computed_style_function(element) {
      if (element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === "function") return element.ownerDocument.defaultView.getComputedStyle;
      if (typeof getComputedStyle === "function") return getComputedStyle;
      return null;
    }
    var write_styles_ods = /* @__PURE__ */ function() {
      var master_styles = [
        "<office:master-styles>",
        '<style:master-page style:name="mp1" style:page-layout-name="mp1">',
        "<style:header/>",
        '<style:header-left style:display="false"/>',
        "<style:footer/>",
        '<style:footer-left style:display="false"/>',
        "</style:master-page>",
        "</office:master-styles>"
      ].join("");
      var payload = "<office:document-styles " + wxt_helper({
        "xmlns:office": "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
        "xmlns:table": "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
        "xmlns:style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
        "xmlns:text": "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
        "xmlns:draw": "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
        "xmlns:fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
        "xmlns:xlink": "http://www.w3.org/1999/xlink",
        "xmlns:dc": "http://purl.org/dc/elements/1.1/",
        "xmlns:number": "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
        "xmlns:svg": "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
        "xmlns:of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
        "office:version": "1.2"
      }) + ">" + master_styles + "</office:document-styles>";
      return function wso() {
        return XML_HEADER + payload;
      };
    }();
    var write_content_ods = /* @__PURE__ */ function() {
      var write_text_p = function(text) {
        return escapexml(text).replace(/  +/g, function($$) {
          return '<text:s text:c="' + $$.length + '"/>';
        }).replace(/\t/g, "<text:tab/>").replace(/\n/g, "</text:p><text:p>").replace(/^ /, "<text:s/>").replace(/ $/, "<text:s/>");
      };
      var null_cell_xml = "          <table:table-cell />\n";
      var covered_cell_xml = "          <table:covered-table-cell/>\n";
      var write_ws2 = function(ws, wb, i2) {
        var o2 = [];
        o2.push('      <table:table table:name="' + escapexml(wb.SheetNames[i2]) + '" table:style-name="ta1">\n');
        var R2 = 0, C2 = 0, range2 = decode_range(ws["!ref"] || "A1");
        var marr = ws["!merges"] || [], mi = 0;
        var dense = Array.isArray(ws);
        if (ws["!cols"]) {
          for (C2 = 0; C2 <= range2.e.c; ++C2) o2.push("        <table:table-column" + (ws["!cols"][C2] ? ' table:style-name="co' + ws["!cols"][C2].ods + '"' : "") + "></table:table-column>\n");
        }
        var H4 = "", ROWS = ws["!rows"] || [];
        for (R2 = 0; R2 < range2.s.r; ++R2) {
          H4 = ROWS[R2] ? ' table:style-name="ro' + ROWS[R2].ods + '"' : "";
          o2.push("        <table:table-row" + H4 + "></table:table-row>\n");
        }
        for (; R2 <= range2.e.r; ++R2) {
          H4 = ROWS[R2] ? ' table:style-name="ro' + ROWS[R2].ods + '"' : "";
          o2.push("        <table:table-row" + H4 + ">\n");
          for (C2 = 0; C2 < range2.s.c; ++C2) o2.push(null_cell_xml);
          for (; C2 <= range2.e.c; ++C2) {
            var skip = false, ct2 = {}, textp = "";
            for (mi = 0; mi != marr.length; ++mi) {
              if (marr[mi].s.c > C2) continue;
              if (marr[mi].s.r > R2) continue;
              if (marr[mi].e.c < C2) continue;
              if (marr[mi].e.r < R2) continue;
              if (marr[mi].s.c != C2 || marr[mi].s.r != R2) skip = true;
              ct2["table:number-columns-spanned"] = marr[mi].e.c - marr[mi].s.c + 1;
              ct2["table:number-rows-spanned"] = marr[mi].e.r - marr[mi].s.r + 1;
              break;
            }
            if (skip) {
              o2.push(covered_cell_xml);
              continue;
            }
            var ref2 = encode_cell({ r: R2, c: C2 }), cell = dense ? (ws[R2] || [])[C2] : ws[ref2];
            if (cell && cell.f) {
              ct2["table:formula"] = escapexml(csf_to_ods_formula(cell.f));
              if (cell.F) {
                if (cell.F.slice(0, ref2.length) == ref2) {
                  var _Fref = decode_range(cell.F);
                  ct2["table:number-matrix-columns-spanned"] = _Fref.e.c - _Fref.s.c + 1;
                  ct2["table:number-matrix-rows-spanned"] = _Fref.e.r - _Fref.s.r + 1;
                }
              }
            }
            if (!cell) {
              o2.push(null_cell_xml);
              continue;
            }
            switch (cell.t) {
              case "b":
                textp = cell.v ? "TRUE" : "FALSE";
                ct2["office:value-type"] = "boolean";
                ct2["office:boolean-value"] = cell.v ? "true" : "false";
                break;
              case "n":
                textp = cell.w || String(cell.v || 0);
                ct2["office:value-type"] = "float";
                ct2["office:value"] = cell.v || 0;
                break;
              case "s":
              case "str":
                textp = cell.v == null ? "" : cell.v;
                ct2["office:value-type"] = "string";
                break;
              case "d":
                textp = cell.w || parseDate(cell.v).toISOString();
                ct2["office:value-type"] = "date";
                ct2["office:date-value"] = parseDate(cell.v).toISOString();
                ct2["table:style-name"] = "ce1";
                break;
              //case 'e':
              default:
                o2.push(null_cell_xml);
                continue;
            }
            var text_p = write_text_p(textp);
            if (cell.l && cell.l.Target) {
              var _tgt = cell.l.Target;
              _tgt = _tgt.charAt(0) == "#" ? "#" + csf_to_ods_3D(_tgt.slice(1)) : _tgt;
              if (_tgt.charAt(0) != "#" && !_tgt.match(/^\w+:/)) _tgt = "../" + _tgt;
              text_p = writextag("text:a", text_p, { "xlink:href": _tgt.replace(/&/g, "&amp;") });
            }
            o2.push("          " + writextag("table:table-cell", writextag("text:p", text_p, {}), ct2) + "\n");
          }
          o2.push("        </table:table-row>\n");
        }
        o2.push("      </table:table>\n");
        return o2.join("");
      };
      var write_automatic_styles_ods = function(o2, wb) {
        o2.push(" <office:automatic-styles>\n");
        o2.push('  <number:date-style style:name="N37" number:automatic-order="true">\n');
        o2.push('   <number:month number:style="long"/>\n');
        o2.push("   <number:text>/</number:text>\n");
        o2.push('   <number:day number:style="long"/>\n');
        o2.push("   <number:text>/</number:text>\n");
        o2.push("   <number:year/>\n");
        o2.push("  </number:date-style>\n");
        var cidx = 0;
        wb.SheetNames.map(function(n) {
          return wb.Sheets[n];
        }).forEach(function(ws) {
          if (!ws) return;
          if (ws["!cols"]) {
            for (var C2 = 0; C2 < ws["!cols"].length; ++C2) if (ws["!cols"][C2]) {
              var colobj = ws["!cols"][C2];
              if (colobj.width == null && colobj.wpx == null && colobj.wch == null) continue;
              process_col(colobj);
              colobj.ods = cidx;
              var w2 = ws["!cols"][C2].wpx + "px";
              o2.push('  <style:style style:name="co' + cidx + '" style:family="table-column">\n');
              o2.push('   <style:table-column-properties fo:break-before="auto" style:column-width="' + w2 + '"/>\n');
              o2.push("  </style:style>\n");
              ++cidx;
            }
          }
        });
        var ridx = 0;
        wb.SheetNames.map(function(n) {
          return wb.Sheets[n];
        }).forEach(function(ws) {
          if (!ws) return;
          if (ws["!rows"]) {
            for (var R2 = 0; R2 < ws["!rows"].length; ++R2) if (ws["!rows"][R2]) {
              ws["!rows"][R2].ods = ridx;
              var h2 = ws["!rows"][R2].hpx + "px";
              o2.push('  <style:style style:name="ro' + ridx + '" style:family="table-row">\n');
              o2.push('   <style:table-row-properties fo:break-before="auto" style:row-height="' + h2 + '"/>\n');
              o2.push("  </style:style>\n");
              ++ridx;
            }
          }
        });
        o2.push('  <style:style style:name="ta1" style:family="table" style:master-page-name="mp1">\n');
        o2.push('   <style:table-properties table:display="true" style:writing-mode="lr-tb"/>\n');
        o2.push("  </style:style>\n");
        o2.push('  <style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N37"/>\n');
        o2.push(" </office:automatic-styles>\n");
      };
      return function wcx(wb, opts) {
        var o2 = [XML_HEADER];
        var attr = wxt_helper({
          "xmlns:office": "urn:oasis:names:tc:opendocument:xmlns:office:1.0",
          "xmlns:table": "urn:oasis:names:tc:opendocument:xmlns:table:1.0",
          "xmlns:style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
          "xmlns:text": "urn:oasis:names:tc:opendocument:xmlns:text:1.0",
          "xmlns:draw": "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0",
          "xmlns:fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0",
          "xmlns:xlink": "http://www.w3.org/1999/xlink",
          "xmlns:dc": "http://purl.org/dc/elements/1.1/",
          "xmlns:meta": "urn:oasis:names:tc:opendocument:xmlns:meta:1.0",
          "xmlns:number": "urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0",
          "xmlns:presentation": "urn:oasis:names:tc:opendocument:xmlns:presentation:1.0",
          "xmlns:svg": "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0",
          "xmlns:chart": "urn:oasis:names:tc:opendocument:xmlns:chart:1.0",
          "xmlns:dr3d": "urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0",
          "xmlns:math": "http://www.w3.org/1998/Math/MathML",
          "xmlns:form": "urn:oasis:names:tc:opendocument:xmlns:form:1.0",
          "xmlns:script": "urn:oasis:names:tc:opendocument:xmlns:script:1.0",
          "xmlns:ooo": "http://openoffice.org/2004/office",
          "xmlns:ooow": "http://openoffice.org/2004/writer",
          "xmlns:oooc": "http://openoffice.org/2004/calc",
          "xmlns:dom": "http://www.w3.org/2001/xml-events",
          "xmlns:xforms": "http://www.w3.org/2002/xforms",
          "xmlns:xsd": "http://www.w3.org/2001/XMLSchema",
          "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
          "xmlns:sheet": "urn:oasis:names:tc:opendocument:sh33tjs:1.0",
          "xmlns:rpt": "http://openoffice.org/2005/report",
          "xmlns:of": "urn:oasis:names:tc:opendocument:xmlns:of:1.2",
          "xmlns:xhtml": "http://www.w3.org/1999/xhtml",
          "xmlns:grddl": "http://www.w3.org/2003/g/data-view#",
          "xmlns:tableooo": "http://openoffice.org/2009/table",
          "xmlns:drawooo": "http://openoffice.org/2010/draw",
          "xmlns:calcext": "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0",
          "xmlns:loext": "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0",
          "xmlns:field": "urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0",
          "xmlns:formx": "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0",
          "xmlns:css3t": "http://www.w3.org/TR/css3-text/",
          "office:version": "1.2"
        });
        var fods = wxt_helper({
          "xmlns:config": "urn:oasis:names:tc:opendocument:xmlns:config:1.0",
          "office:mimetype": "application/vnd.oasis.opendocument.spreadsheet"
        });
        if (opts.bookType == "fods") {
          o2.push("<office:document" + attr + fods + ">\n");
          o2.push(write_meta_ods().replace(/office:document-meta/g, "office:meta"));
        } else o2.push("<office:document-content" + attr + ">\n");
        write_automatic_styles_ods(o2, wb);
        o2.push("  <office:body>\n");
        o2.push("    <office:spreadsheet>\n");
        for (var i2 = 0; i2 != wb.SheetNames.length; ++i2) o2.push(write_ws2(wb.Sheets[wb.SheetNames[i2]], wb, i2));
        o2.push("    </office:spreadsheet>\n");
        o2.push("  </office:body>\n");
        if (opts.bookType == "fods") o2.push("</office:document>");
        else o2.push("</office:document-content>");
        return o2.join("");
      };
    }();
    function write_ods(wb, opts) {
      if (opts.bookType == "fods") return write_content_ods(wb, opts);
      var zip = zip_new();
      var f2 = "";
      var manifest = [];
      var rdf = [];
      f2 = "mimetype";
      zip_add_file(zip, f2, "application/vnd.oasis.opendocument.spreadsheet");
      f2 = "content.xml";
      zip_add_file(zip, f2, write_content_ods(wb, opts));
      manifest.push([f2, "text/xml"]);
      rdf.push([f2, "ContentFile"]);
      f2 = "styles.xml";
      zip_add_file(zip, f2, write_styles_ods(wb, opts));
      manifest.push([f2, "text/xml"]);
      rdf.push([f2, "StylesFile"]);
      f2 = "meta.xml";
      zip_add_file(zip, f2, XML_HEADER + write_meta_ods(
        /*::wb, opts*/
      ));
      manifest.push([f2, "text/xml"]);
      rdf.push([f2, "MetadataFile"]);
      f2 = "manifest.rdf";
      zip_add_file(zip, f2, write_rdf(
        rdf
        /*, opts*/
      ));
      manifest.push([f2, "application/rdf+xml"]);
      f2 = "META-INF/manifest.xml";
      zip_add_file(zip, f2, write_manifest(
        manifest
        /*, opts*/
      ));
      return zip;
    }
    /*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
    function u8_to_dataview(array) {
      return new DataView(array.buffer, array.byteOffset, array.byteLength);
    }
    function stru8(str) {
      return typeof TextEncoder != "undefined" ? new TextEncoder().encode(str) : s2a(utf8write(str));
    }
    function u8contains(body, search) {
      outer:
        for (var L2 = 0; L2 <= body.length - search.length; ++L2) {
          for (var j = 0; j < search.length; ++j)
            if (body[L2 + j] != search[j])
              continue outer;
          return true;
        }
      return false;
    }
    function u8concat(u8a) {
      var len2 = u8a.reduce(function(acc, x2) {
        return acc + x2.length;
      }, 0);
      var out2 = new Uint8Array(len2);
      var off = 0;
      u8a.forEach(function(u8) {
        out2.set(u8, off);
        off += u8.length;
      });
      return out2;
    }
    function writeDecimal128LE(buf, offset2, value) {
      var exp = Math.floor(value == 0 ? 0 : Math.LOG10E * Math.log(Math.abs(value))) + 6176 - 20;
      var mantissa = value / Math.pow(10, exp - 6176);
      buf[offset2 + 15] |= exp >> 7;
      buf[offset2 + 14] |= (exp & 127) << 1;
      for (var i2 = 0; mantissa >= 1; ++i2, mantissa /= 256)
        buf[offset2 + i2] = mantissa & 255;
      buf[offset2 + 15] |= value >= 0 ? 0 : 128;
    }
    function parse_varint49(buf, ptr) {
      var l2 = ptr ? ptr[0] : 0;
      var usz = buf[l2] & 127;
      varint:
        if (buf[l2++] >= 128) {
          usz |= (buf[l2] & 127) << 7;
          if (buf[l2++] < 128)
            break varint;
          usz |= (buf[l2] & 127) << 14;
          if (buf[l2++] < 128)
            break varint;
          usz |= (buf[l2] & 127) << 21;
          if (buf[l2++] < 128)
            break varint;
          usz += (buf[l2] & 127) * Math.pow(2, 28);
          ++l2;
          if (buf[l2++] < 128)
            break varint;
          usz += (buf[l2] & 127) * Math.pow(2, 35);
          ++l2;
          if (buf[l2++] < 128)
            break varint;
          usz += (buf[l2] & 127) * Math.pow(2, 42);
          ++l2;
          if (buf[l2++] < 128)
            break varint;
        }
      if (ptr)
        ptr[0] = l2;
      return usz;
    }
    function write_varint49(v4) {
      var usz = new Uint8Array(7);
      usz[0] = v4 & 127;
      var L2 = 1;
      sz:
        if (v4 > 127) {
          usz[L2 - 1] |= 128;
          usz[L2] = v4 >> 7 & 127;
          ++L2;
          if (v4 <= 16383)
            break sz;
          usz[L2 - 1] |= 128;
          usz[L2] = v4 >> 14 & 127;
          ++L2;
          if (v4 <= 2097151)
            break sz;
          usz[L2 - 1] |= 128;
          usz[L2] = v4 >> 21 & 127;
          ++L2;
          if (v4 <= 268435455)
            break sz;
          usz[L2 - 1] |= 128;
          usz[L2] = v4 / 256 >>> 21 & 127;
          ++L2;
          if (v4 <= 34359738367)
            break sz;
          usz[L2 - 1] |= 128;
          usz[L2] = v4 / 65536 >>> 21 & 127;
          ++L2;
          if (v4 <= 4398046511103)
            break sz;
          usz[L2 - 1] |= 128;
          usz[L2] = v4 / 16777216 >>> 21 & 127;
          ++L2;
        }
      return usz.slice(0, L2);
    }
    function varint_to_i32(buf) {
      var l2 = 0, i32 = buf[l2] & 127;
      varint:
        if (buf[l2++] >= 128) {
          i32 |= (buf[l2] & 127) << 7;
          if (buf[l2++] < 128)
            break varint;
          i32 |= (buf[l2] & 127) << 14;
          if (buf[l2++] < 128)
            break varint;
          i32 |= (buf[l2] & 127) << 21;
          if (buf[l2++] < 128)
            break varint;
          i32 |= (buf[l2] & 127) << 28;
        }
      return i32;
    }
    function parse_shallow(buf) {
      var out2 = [], ptr = [0];
      while (ptr[0] < buf.length) {
        var off = ptr[0];
        var num = parse_varint49(buf, ptr);
        var type = num & 7;
        num = Math.floor(num / 8);
        var len2 = 0;
        var res;
        if (num == 0)
          break;
        switch (type) {
          case 0:
            {
              var l2 = ptr[0];
              while (buf[ptr[0]++] >= 128)
                ;
              res = buf.slice(l2, ptr[0]);
            }
            break;
          case 5:
            len2 = 4;
            res = buf.slice(ptr[0], ptr[0] + len2);
            ptr[0] += len2;
            break;
          case 1:
            len2 = 8;
            res = buf.slice(ptr[0], ptr[0] + len2);
            ptr[0] += len2;
            break;
          case 2:
            len2 = parse_varint49(buf, ptr);
            res = buf.slice(ptr[0], ptr[0] + len2);
            ptr[0] += len2;
            break;
          case 3:
          case 4:
          default:
            throw new Error("PB Type ".concat(type, " for Field ").concat(num, " at offset ").concat(off));
        }
        var v4 = { data: res, type };
        if (out2[num] == null)
          out2[num] = [v4];
        else
          out2[num].push(v4);
      }
      return out2;
    }
    function write_shallow(proto2) {
      var out2 = [];
      proto2.forEach(function(field, idx) {
        field.forEach(function(item) {
          if (!item.data)
            return;
          out2.push(write_varint49(idx * 8 + item.type));
          if (item.type == 2)
            out2.push(write_varint49(item.data.length));
          out2.push(item.data);
        });
      });
      return u8concat(out2);
    }
    function parse_iwa_file(buf) {
      var _a2;
      var out2 = [], ptr = [0];
      while (ptr[0] < buf.length) {
        var len2 = parse_varint49(buf, ptr);
        var ai = parse_shallow(buf.slice(ptr[0], ptr[0] + len2));
        ptr[0] += len2;
        var res = {
          id: varint_to_i32(ai[1][0].data),
          messages: []
        };
        ai[2].forEach(function(b2) {
          var mi = parse_shallow(b2.data);
          var fl = varint_to_i32(mi[3][0].data);
          res.messages.push({
            meta: mi,
            data: buf.slice(ptr[0], ptr[0] + fl)
          });
          ptr[0] += fl;
        });
        if ((_a2 = ai[3]) == null ? void 0 : _a2[0])
          res.merge = varint_to_i32(ai[3][0].data) >>> 0 > 0;
        out2.push(res);
      }
      return out2;
    }
    function write_iwa_file(ias) {
      var bufs = [];
      ias.forEach(function(ia) {
        var ai = [];
        ai[1] = [{ data: write_varint49(ia.id), type: 0 }];
        ai[2] = [];
        if (ia.merge != null)
          ai[3] = [{ data: write_varint49(+!!ia.merge), type: 0 }];
        var midata = [];
        ia.messages.forEach(function(mi) {
          midata.push(mi.data);
          mi.meta[3] = [{ type: 0, data: write_varint49(mi.data.length) }];
          ai[2].push({ data: write_shallow(mi.meta), type: 2 });
        });
        var aipayload = write_shallow(ai);
        bufs.push(write_varint49(aipayload.length));
        bufs.push(aipayload);
        midata.forEach(function(mid) {
          return bufs.push(mid);
        });
      });
      return u8concat(bufs);
    }
    function parse_snappy_chunk(type, buf) {
      if (type != 0)
        throw new Error("Unexpected Snappy chunk type ".concat(type));
      var ptr = [0];
      var usz = parse_varint49(buf, ptr);
      var chunks = [];
      while (ptr[0] < buf.length) {
        var tag = buf[ptr[0]] & 3;
        if (tag == 0) {
          var len2 = buf[ptr[0]++] >> 2;
          if (len2 < 60)
            ++len2;
          else {
            var c2 = len2 - 59;
            len2 = buf[ptr[0]];
            if (c2 > 1)
              len2 |= buf[ptr[0] + 1] << 8;
            if (c2 > 2)
              len2 |= buf[ptr[0] + 2] << 16;
            if (c2 > 3)
              len2 |= buf[ptr[0] + 3] << 24;
            len2 >>>= 0;
            len2++;
            ptr[0] += c2;
          }
          chunks.push(buf.slice(ptr[0], ptr[0] + len2));
          ptr[0] += len2;
          continue;
        } else {
          var offset2 = 0, length = 0;
          if (tag == 1) {
            length = (buf[ptr[0]] >> 2 & 7) + 4;
            offset2 = (buf[ptr[0]++] & 224) << 3;
            offset2 |= buf[ptr[0]++];
          } else {
            length = (buf[ptr[0]++] >> 2) + 1;
            if (tag == 2) {
              offset2 = buf[ptr[0]] | buf[ptr[0] + 1] << 8;
              ptr[0] += 2;
            } else {
              offset2 = (buf[ptr[0]] | buf[ptr[0] + 1] << 8 | buf[ptr[0] + 2] << 16 | buf[ptr[0] + 3] << 24) >>> 0;
              ptr[0] += 4;
            }
          }
          chunks = [u8concat(chunks)];
          if (offset2 == 0)
            throw new Error("Invalid offset 0");
          if (offset2 > chunks[0].length)
            throw new Error("Invalid offset beyond length");
          if (length >= offset2) {
            chunks.push(chunks[0].slice(-offset2));
            length -= offset2;
            while (length >= chunks[chunks.length - 1].length) {
              chunks.push(chunks[chunks.length - 1]);
              length -= chunks[chunks.length - 1].length;
            }
          }
          chunks.push(chunks[0].slice(-offset2, -offset2 + length));
        }
      }
      var o2 = u8concat(chunks);
      if (o2.length != usz)
        throw new Error("Unexpected length: ".concat(o2.length, " != ").concat(usz));
      return o2;
    }
    function decompress_iwa_file(buf) {
      var out2 = [];
      var l2 = 0;
      while (l2 < buf.length) {
        var t = buf[l2++];
        var len2 = buf[l2] | buf[l2 + 1] << 8 | buf[l2 + 2] << 16;
        l2 += 3;
        out2.push(parse_snappy_chunk(t, buf.slice(l2, l2 + len2)));
        l2 += len2;
      }
      if (l2 !== buf.length)
        throw new Error("data is not a valid framed stream!");
      return u8concat(out2);
    }
    function compress_iwa_file(buf) {
      var out2 = [];
      var l2 = 0;
      while (l2 < buf.length) {
        var c2 = Math.min(buf.length - l2, 268435455);
        var frame = new Uint8Array(4);
        out2.push(frame);
        var usz = write_varint49(c2);
        var L2 = usz.length;
        out2.push(usz);
        if (c2 <= 60) {
          L2++;
          out2.push(new Uint8Array([c2 - 1 << 2]));
        } else if (c2 <= 256) {
          L2 += 2;
          out2.push(new Uint8Array([240, c2 - 1 & 255]));
        } else if (c2 <= 65536) {
          L2 += 3;
          out2.push(new Uint8Array([244, c2 - 1 & 255, c2 - 1 >> 8 & 255]));
        } else if (c2 <= 16777216) {
          L2 += 4;
          out2.push(new Uint8Array([248, c2 - 1 & 255, c2 - 1 >> 8 & 255, c2 - 1 >> 16 & 255]));
        } else if (c2 <= 4294967296) {
          L2 += 5;
          out2.push(new Uint8Array([252, c2 - 1 & 255, c2 - 1 >> 8 & 255, c2 - 1 >> 16 & 255, c2 - 1 >>> 24 & 255]));
        }
        out2.push(buf.slice(l2, l2 + c2));
        L2 += c2;
        frame[0] = 0;
        frame[1] = L2 & 255;
        frame[2] = L2 >> 8 & 255;
        frame[3] = L2 >> 16 & 255;
        l2 += c2;
      }
      return u8concat(out2);
    }
    function write_new_storage(cell, sst) {
      var out2 = new Uint8Array(32), dv = u8_to_dataview(out2), l2 = 12, flags = 0;
      out2[0] = 5;
      switch (cell.t) {
        case "n":
          out2[1] = 2;
          writeDecimal128LE(out2, l2, cell.v);
          flags |= 1;
          l2 += 16;
          break;
        case "b":
          out2[1] = 6;
          dv.setFloat64(l2, cell.v ? 1 : 0, true);
          flags |= 2;
          l2 += 8;
          break;
        case "s":
          if (sst.indexOf(cell.v) == -1)
            throw new Error("Value ".concat(cell.v, " missing from SST!"));
          out2[1] = 3;
          dv.setUint32(l2, sst.indexOf(cell.v), true);
          flags |= 8;
          l2 += 4;
          break;
        default:
          throw "unsupported cell type " + cell.t;
      }
      dv.setUint32(8, flags, true);
      return out2.slice(0, l2);
    }
    function write_old_storage(cell, sst) {
      var out2 = new Uint8Array(32), dv = u8_to_dataview(out2), l2 = 12, flags = 0;
      out2[0] = 3;
      switch (cell.t) {
        case "n":
          out2[2] = 2;
          dv.setFloat64(l2, cell.v, true);
          flags |= 32;
          l2 += 8;
          break;
        case "b":
          out2[2] = 6;
          dv.setFloat64(l2, cell.v ? 1 : 0, true);
          flags |= 32;
          l2 += 8;
          break;
        case "s":
          if (sst.indexOf(cell.v) == -1)
            throw new Error("Value ".concat(cell.v, " missing from SST!"));
          out2[2] = 3;
          dv.setUint32(l2, sst.indexOf(cell.v), true);
          flags |= 16;
          l2 += 4;
          break;
        default:
          throw "unsupported cell type " + cell.t;
      }
      dv.setUint32(4, flags, true);
      return out2.slice(0, l2);
    }
    function parse_TSP_Reference(buf) {
      var pb = parse_shallow(buf);
      return parse_varint49(pb[1][0].data);
    }
    function write_tile_row(tri, data, SST) {
      var _a2, _b2, _c2, _d;
      if (!((_a2 = tri[6]) == null ? void 0 : _a2[0]) || !((_b2 = tri[7]) == null ? void 0 : _b2[0]))
        throw "Mutation only works on post-BNC storages!";
      var wide_offsets = ((_d = (_c2 = tri[8]) == null ? void 0 : _c2[0]) == null ? void 0 : _d.data) && varint_to_i32(tri[8][0].data) > 0 || false;
      if (wide_offsets)
        throw "Math only works with normal offsets";
      var cnt = 0;
      var dv = u8_to_dataview(tri[7][0].data), last_offset = 0, cell_storage = [];
      var _dv = u8_to_dataview(tri[4][0].data), _last_offset = 0, _cell_storage = [];
      for (var C2 = 0; C2 < data.length; ++C2) {
        if (data[C2] == null) {
          dv.setUint16(C2 * 2, 65535, true);
          _dv.setUint16(C2 * 2, 65535);
          continue;
        }
        dv.setUint16(C2 * 2, last_offset, true);
        _dv.setUint16(C2 * 2, _last_offset, true);
        var celload, _celload;
        switch (typeof data[C2]) {
          case "string":
            celload = write_new_storage({ t: "s", v: data[C2] }, SST);
            _celload = write_old_storage({ t: "s", v: data[C2] }, SST);
            break;
          case "number":
            celload = write_new_storage({ t: "n", v: data[C2] }, SST);
            _celload = write_old_storage({ t: "n", v: data[C2] }, SST);
            break;
          case "boolean":
            celload = write_new_storage({ t: "b", v: data[C2] }, SST);
            _celload = write_old_storage({ t: "b", v: data[C2] }, SST);
            break;
          default:
            throw new Error("Unsupported value " + data[C2]);
        }
        cell_storage.push(celload);
        last_offset += celload.length;
        _cell_storage.push(_celload);
        _last_offset += _celload.length;
        ++cnt;
      }
      tri[2][0].data = write_varint49(cnt);
      for (; C2 < tri[7][0].data.length / 2; ++C2) {
        dv.setUint16(C2 * 2, 65535, true);
        _dv.setUint16(C2 * 2, 65535, true);
      }
      tri[6][0].data = u8concat(cell_storage);
      tri[3][0].data = u8concat(_cell_storage);
      return cnt;
    }
    function write_numbers_iwa(wb, opts) {
      if (!opts || !opts.numbers)
        throw new Error("Must pass a `numbers` option -- check the README");
      var ws = wb.Sheets[wb.SheetNames[0]];
      if (wb.SheetNames.length > 1)
        console.error("The Numbers writer currently writes only the first table");
      var range2 = decode_range(ws["!ref"]);
      range2.s.r = range2.s.c = 0;
      var trunc = false;
      if (range2.e.c > 9) {
        trunc = true;
        range2.e.c = 9;
      }
      if (range2.e.r > 49) {
        trunc = true;
        range2.e.r = 49;
      }
      if (trunc)
        console.error("The Numbers writer is currently limited to ".concat(encode_range(range2)));
      var data = sheet_to_json(ws, { range: range2, header: 1 });
      var SST = ["~Sh33tJ5~"];
      data.forEach(function(row) {
        return row.forEach(function(cell) {
          if (typeof cell == "string")
            SST.push(cell);
        });
      });
      var dependents = {};
      var indices = [];
      var cfb = CFB.read(opts.numbers, { type: "base64" });
      cfb.FileIndex.map(function(fi, idx) {
        return [fi, cfb.FullPaths[idx]];
      }).forEach(function(row) {
        var fi = row[0], fp = row[1];
        if (fi.type != 2)
          return;
        if (!fi.name.match(/\.iwa/))
          return;
        var old_content = fi.content;
        var raw1 = decompress_iwa_file(old_content);
        var x22 = parse_iwa_file(raw1);
        x22.forEach(function(packet2) {
          indices.push(packet2.id);
          dependents[packet2.id] = { deps: [], location: fp, type: varint_to_i32(packet2.messages[0].meta[1][0].data) };
        });
      });
      indices.sort(function(x22, y2) {
        return x22 - y2;
      });
      var indices_varint = indices.filter(function(x22) {
        return x22 > 1;
      }).map(function(x22) {
        return [x22, write_varint49(x22)];
      });
      cfb.FileIndex.map(function(fi, idx) {
        return [fi, cfb.FullPaths[idx]];
      }).forEach(function(row) {
        var fi = row[0];
        row[1];
        if (!fi.name.match(/\.iwa/))
          return;
        var x22 = parse_iwa_file(decompress_iwa_file(fi.content));
        x22.forEach(function(ia) {
          ia.messages.forEach(function(m2) {
            indices_varint.forEach(function(ivi) {
              if (ia.messages.some(function(mess) {
                return varint_to_i32(mess.meta[1][0].data) != 11006 && u8contains(mess.data, ivi[1]);
              })) {
                dependents[ivi[0]].deps.push(ia.id);
              }
            });
          });
        });
      });
      var entry = CFB.find(cfb, dependents[1].location);
      var x2 = parse_iwa_file(decompress_iwa_file(entry.content));
      var docroot;
      for (var xi = 0; xi < x2.length; ++xi) {
        var packet = x2[xi];
        if (packet.id == 1)
          docroot = packet;
      }
      var sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[1][0].data);
      entry = CFB.find(cfb, dependents[sheetrootref].location);
      x2 = parse_iwa_file(decompress_iwa_file(entry.content));
      for (xi = 0; xi < x2.length; ++xi) {
        packet = x2[xi];
        if (packet.id == sheetrootref)
          docroot = packet;
      }
      sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data);
      entry = CFB.find(cfb, dependents[sheetrootref].location);
      x2 = parse_iwa_file(decompress_iwa_file(entry.content));
      for (xi = 0; xi < x2.length; ++xi) {
        packet = x2[xi];
        if (packet.id == sheetrootref)
          docroot = packet;
      }
      sheetrootref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[2][0].data);
      entry = CFB.find(cfb, dependents[sheetrootref].location);
      x2 = parse_iwa_file(decompress_iwa_file(entry.content));
      for (xi = 0; xi < x2.length; ++xi) {
        packet = x2[xi];
        if (packet.id == sheetrootref)
          docroot = packet;
      }
      var pb = parse_shallow(docroot.messages[0].data);
      {
        pb[6][0].data = write_varint49(range2.e.r + 1);
        pb[7][0].data = write_varint49(range2.e.c + 1);
        var cruidsref = parse_TSP_Reference(pb[46][0].data);
        var oldbucket = CFB.find(cfb, dependents[cruidsref].location);
        var _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
        {
          for (var j = 0; j < _x.length; ++j) {
            if (_x[j].id == cruidsref)
              break;
          }
          if (_x[j].id != cruidsref)
            throw "Bad ColumnRowUIDMapArchive";
          var cruids = parse_shallow(_x[j].messages[0].data);
          cruids[1] = [];
          cruids[2] = [], cruids[3] = [];
          for (var C2 = 0; C2 <= range2.e.c; ++C2) {
            var uuid = [];
            uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(C2 + 420690) }];
            cruids[1].push({ type: 2, data: write_shallow(uuid) });
            cruids[2].push({ type: 0, data: write_varint49(C2) });
            cruids[3].push({ type: 0, data: write_varint49(C2) });
          }
          cruids[4] = [];
          cruids[5] = [], cruids[6] = [];
          for (var R2 = 0; R2 <= range2.e.r; ++R2) {
            uuid = [];
            uuid[1] = uuid[2] = [{ type: 0, data: write_varint49(R2 + 726270) }];
            cruids[4].push({ type: 2, data: write_shallow(uuid) });
            cruids[5].push({ type: 0, data: write_varint49(R2) });
            cruids[6].push({ type: 0, data: write_varint49(R2) });
          }
          _x[j].messages[0].data = write_shallow(cruids);
        }
        oldbucket.content = compress_iwa_file(write_iwa_file(_x));
        oldbucket.size = oldbucket.content.length;
        delete pb[46];
        var store2 = parse_shallow(pb[4][0].data);
        {
          store2[7][0].data = write_varint49(range2.e.r + 1);
          var row_headers = parse_shallow(store2[1][0].data);
          var row_header_ref = parse_TSP_Reference(row_headers[2][0].data);
          oldbucket = CFB.find(cfb, dependents[row_header_ref].location);
          _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
          {
            if (_x[0].id != row_header_ref)
              throw "Bad HeaderStorageBucket";
            var base_bucket = parse_shallow(_x[0].messages[0].data);
            for (R2 = 0; R2 < data.length; ++R2) {
              var _bucket = parse_shallow(base_bucket[2][0].data);
              _bucket[1][0].data = write_varint49(R2);
              _bucket[4][0].data = write_varint49(data[R2].length);
              base_bucket[2][R2] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };
            }
            _x[0].messages[0].data = write_shallow(base_bucket);
          }
          oldbucket.content = compress_iwa_file(write_iwa_file(_x));
          oldbucket.size = oldbucket.content.length;
          var col_header_ref = parse_TSP_Reference(store2[2][0].data);
          oldbucket = CFB.find(cfb, dependents[col_header_ref].location);
          _x = parse_iwa_file(decompress_iwa_file(oldbucket.content));
          {
            if (_x[0].id != col_header_ref)
              throw "Bad HeaderStorageBucket";
            base_bucket = parse_shallow(_x[0].messages[0].data);
            for (C2 = 0; C2 <= range2.e.c; ++C2) {
              _bucket = parse_shallow(base_bucket[2][0].data);
              _bucket[1][0].data = write_varint49(C2);
              _bucket[4][0].data = write_varint49(range2.e.r + 1);
              base_bucket[2][C2] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };
            }
            _x[0].messages[0].data = write_shallow(base_bucket);
          }
          oldbucket.content = compress_iwa_file(write_iwa_file(_x));
          oldbucket.size = oldbucket.content.length;
          var sstref = parse_TSP_Reference(store2[4][0].data);
          (function() {
            var sentry = CFB.find(cfb, dependents[sstref].location);
            var sx = parse_iwa_file(decompress_iwa_file(sentry.content));
            var sstroot;
            for (var sxi = 0; sxi < sx.length; ++sxi) {
              var packet2 = sx[sxi];
              if (packet2.id == sstref)
                sstroot = packet2;
            }
            var sstdata = parse_shallow(sstroot.messages[0].data);
            {
              sstdata[3] = [];
              var newsst = [];
              SST.forEach(function(str, i2) {
                newsst[1] = [{ type: 0, data: write_varint49(i2) }];
                newsst[2] = [{ type: 0, data: write_varint49(1) }];
                newsst[3] = [{ type: 2, data: stru8(str) }];
                sstdata[3].push({ type: 2, data: write_shallow(newsst) });
              });
            }
            sstroot.messages[0].data = write_shallow(sstdata);
            var sy = write_iwa_file(sx);
            var raw32 = compress_iwa_file(sy);
            sentry.content = raw32;
            sentry.size = sentry.content.length;
          })();
          var tile = parse_shallow(store2[3][0].data);
          {
            var t = tile[1][0];
            delete tile[2];
            var tl = parse_shallow(t.data);
            {
              var tileref = parse_TSP_Reference(tl[2][0].data);
              (function() {
                var tentry = CFB.find(cfb, dependents[tileref].location);
                var tx = parse_iwa_file(decompress_iwa_file(tentry.content));
                var tileroot;
                for (var sxi = 0; sxi < tx.length; ++sxi) {
                  var packet2 = tx[sxi];
                  if (packet2.id == tileref)
                    tileroot = packet2;
                }
                var tiledata = parse_shallow(tileroot.messages[0].data);
                {
                  delete tiledata[6];
                  delete tile[7];
                  var rowload = new Uint8Array(tiledata[5][0].data);
                  tiledata[5] = [];
                  var cnt = 0;
                  for (var R22 = 0; R22 <= range2.e.r; ++R22) {
                    var tilerow = parse_shallow(rowload);
                    cnt += write_tile_row(tilerow, data[R22], SST);
                    tilerow[1][0].data = write_varint49(R22);
                    tiledata[5].push({ data: write_shallow(tilerow), type: 2 });
                  }
                  tiledata[1] = [{ type: 0, data: write_varint49(range2.e.c + 1) }];
                  tiledata[2] = [{ type: 0, data: write_varint49(range2.e.r + 1) }];
                  tiledata[3] = [{ type: 0, data: write_varint49(cnt) }];
                  tiledata[4] = [{ type: 0, data: write_varint49(range2.e.r + 1) }];
                }
                tileroot.messages[0].data = write_shallow(tiledata);
                var ty = write_iwa_file(tx);
                var raw32 = compress_iwa_file(ty);
                tentry.content = raw32;
                tentry.size = tentry.content.length;
              })();
            }
            t.data = write_shallow(tl);
          }
          store2[3][0].data = write_shallow(tile);
        }
        pb[4][0].data = write_shallow(store2);
      }
      docroot.messages[0].data = write_shallow(pb);
      var y = write_iwa_file(x2);
      var raw3 = compress_iwa_file(y);
      entry.content = raw3;
      entry.size = entry.content.length;
      return cfb;
    }
    function fix_opts_func(defaults2) {
      return function fix_opts(opts) {
        for (var i2 = 0; i2 != defaults2.length; ++i2) {
          var d2 = defaults2[i2];
          if (opts[d2[0]] === void 0) opts[d2[0]] = d2[1];
          if (d2[2] === "n") opts[d2[0]] = Number(opts[d2[0]]);
        }
      };
    }
    function fix_write_opts(opts) {
      fix_opts_func([
        ["cellDates", false],
        /* write date cells with type `d` */
        ["bookSST", false],
        /* Generate Shared String Table */
        ["bookType", "xlsx"],
        /* Type of workbook (xlsx/m/b) */
        ["compression", false],
        /* Use file compression */
        ["WTF", false]
        /* WTF mode (throws errors) */
      ])(opts);
    }
    function write_zip(wb, opts) {
      if (opts.bookType == "ods") return write_ods(wb, opts);
      if (opts.bookType == "numbers") return write_numbers_iwa(wb, opts);
      if (opts.bookType == "xlsb") return write_zip_xlsxb(wb, opts);
      return write_zip_xlsx(wb, opts);
    }
    function write_zip_xlsxb(wb, opts) {
      _shapeid = 1024;
      if (wb && !wb.SSF) {
        wb.SSF = dup(table_fmt);
      }
      if (wb && wb.SSF) {
        make_ssf();
        SSF_load_table(wb.SSF);
        opts.revssf = evert_num(wb.SSF);
        opts.revssf[wb.SSF[65535]] = 0;
        opts.ssf = wb.SSF;
      }
      opts.rels = {};
      opts.wbrels = {};
      opts.Strings = /*::((*/
      [];
      opts.Strings.Count = 0;
      opts.Strings.Unique = 0;
      if (browser_has_Map) opts.revStrings = /* @__PURE__ */ new Map();
      else {
        opts.revStrings = {};
        opts.revStrings.foo = [];
        delete opts.revStrings.foo;
      }
      var wbext = opts.bookType == "xlsb" ? "bin" : "xml";
      var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
      var ct2 = new_ct();
      fix_write_opts(opts = opts || {});
      var zip = zip_new();
      var f2 = "", rId = 0;
      opts.cellXfs = [];
      get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
      if (!wb.Props) wb.Props = {};
      f2 = "docProps/core.xml";
      zip_add_file(zip, f2, write_core_props(wb.Props, opts));
      ct2.coreprops.push(f2);
      add_rels(opts.rels, 2, f2, RELS.CORE_PROPS);
      f2 = "docProps/app.xml";
      if (wb.Props && wb.Props.SheetNames) ;
      else if (!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;
      else {
        var _sn = [];
        for (var _i = 0; _i < wb.SheetNames.length; ++_i)
          if ((wb.Workbook.Sheets[_i] || {}).Hidden != 2) _sn.push(wb.SheetNames[_i]);
        wb.Props.SheetNames = _sn;
      }
      wb.Props.Worksheets = wb.Props.SheetNames.length;
      zip_add_file(zip, f2, write_ext_props(wb.Props));
      ct2.extprops.push(f2);
      add_rels(opts.rels, 3, f2, RELS.EXT_PROPS);
      if (wb.Custprops !== wb.Props && keys(wb.Custprops || {}).length > 0) {
        f2 = "docProps/custom.xml";
        zip_add_file(zip, f2, write_cust_props(wb.Custprops));
        ct2.custprops.push(f2);
        add_rels(opts.rels, 4, f2, RELS.CUST_PROPS);
      }
      for (rId = 1; rId <= wb.SheetNames.length; ++rId) {
        var wsrels = { "!id": {} };
        var ws = wb.Sheets[wb.SheetNames[rId - 1]];
        var _type = (ws || {})["!type"] || "sheet";
        switch (_type) {
          case "chart":
          /* falls through */
          default:
            f2 = "xl/worksheets/sheet" + rId + "." + wbext;
            zip_add_file(zip, f2, write_ws(rId - 1, f2, opts, wb, wsrels));
            ct2.sheets.push(f2);
            add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
        }
        if (ws) {
          var comments = ws["!comments"];
          var need_vml = false;
          var cf = "";
          if (comments && comments.length > 0) {
            cf = "xl/comments" + rId + "." + wbext;
            zip_add_file(zip, cf, write_cmnt(comments, cf));
            ct2.comments.push(cf);
            add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
            need_vml = true;
          }
          if (ws["!legacy"]) {
            if (need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + rId + ".vml", write_comments_vml(rId, ws["!comments"]));
          }
          delete ws["!comments"];
          delete ws["!legacy"];
        }
        if (wsrels["!id"].rId1) zip_add_file(zip, get_rels_path(f2), write_rels(wsrels));
      }
      if (opts.Strings != null && opts.Strings.length > 0) {
        f2 = "xl/sharedStrings." + wbext;
        zip_add_file(zip, f2, write_sst(opts.Strings, f2, opts));
        ct2.strs.push(f2);
        add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
      }
      f2 = "xl/workbook." + wbext;
      zip_add_file(zip, f2, write_wb(wb, f2));
      ct2.workbooks.push(f2);
      add_rels(opts.rels, 1, f2, RELS.WB);
      f2 = "xl/theme/theme1.xml";
      zip_add_file(zip, f2, write_theme(wb.Themes, opts));
      ct2.themes.push(f2);
      add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
      f2 = "xl/styles." + wbext;
      zip_add_file(zip, f2, write_sty(wb, f2, opts));
      ct2.styles.push(f2);
      add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
      if (wb.vbaraw && vbafmt) {
        f2 = "xl/vbaProject.bin";
        zip_add_file(zip, f2, wb.vbaraw);
        ct2.vba.push(f2);
        add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
      }
      f2 = "xl/metadata." + wbext;
      zip_add_file(zip, f2, write_xlmeta(f2));
      ct2.metadata.push(f2);
      add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
      zip_add_file(zip, "[Content_Types].xml", write_ct(ct2, opts));
      zip_add_file(zip, "_rels/.rels", write_rels(opts.rels));
      zip_add_file(zip, "xl/_rels/workbook." + wbext + ".rels", write_rels(opts.wbrels));
      delete opts.revssf;
      delete opts.ssf;
      return zip;
    }
    function write_zip_xlsx(wb, opts) {
      _shapeid = 1024;
      if (wb && !wb.SSF) {
        wb.SSF = dup(table_fmt);
      }
      if (wb && wb.SSF) {
        make_ssf();
        SSF_load_table(wb.SSF);
        opts.revssf = evert_num(wb.SSF);
        opts.revssf[wb.SSF[65535]] = 0;
        opts.ssf = wb.SSF;
      }
      opts.rels = {};
      opts.wbrels = {};
      opts.Strings = /*::((*/
      [];
      opts.Strings.Count = 0;
      opts.Strings.Unique = 0;
      if (browser_has_Map) opts.revStrings = /* @__PURE__ */ new Map();
      else {
        opts.revStrings = {};
        opts.revStrings.foo = [];
        delete opts.revStrings.foo;
      }
      var wbext = "xml";
      var vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;
      var ct2 = new_ct();
      fix_write_opts(opts = opts || {});
      var zip = zip_new();
      var f2 = "", rId = 0;
      opts.cellXfs = [];
      get_cell_style(opts.cellXfs, {}, { revssf: { "General": 0 } });
      if (!wb.Props) wb.Props = {};
      f2 = "docProps/core.xml";
      zip_add_file(zip, f2, write_core_props(wb.Props, opts));
      ct2.coreprops.push(f2);
      add_rels(opts.rels, 2, f2, RELS.CORE_PROPS);
      f2 = "docProps/app.xml";
      if (wb.Props && wb.Props.SheetNames) ;
      else if (!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;
      else {
        var _sn = [];
        for (var _i = 0; _i < wb.SheetNames.length; ++_i)
          if ((wb.Workbook.Sheets[_i] || {}).Hidden != 2) _sn.push(wb.SheetNames[_i]);
        wb.Props.SheetNames = _sn;
      }
      wb.Props.Worksheets = wb.Props.SheetNames.length;
      zip_add_file(zip, f2, write_ext_props(wb.Props));
      ct2.extprops.push(f2);
      add_rels(opts.rels, 3, f2, RELS.EXT_PROPS);
      if (wb.Custprops !== wb.Props && keys(wb.Custprops || {}).length > 0) {
        f2 = "docProps/custom.xml";
        zip_add_file(zip, f2, write_cust_props(wb.Custprops));
        ct2.custprops.push(f2);
        add_rels(opts.rels, 4, f2, RELS.CUST_PROPS);
      }
      var people = ["SheetJ5"];
      opts.tcid = 0;
      for (rId = 1; rId <= wb.SheetNames.length; ++rId) {
        var wsrels = { "!id": {} };
        var ws = wb.Sheets[wb.SheetNames[rId - 1]];
        var _type = (ws || {})["!type"] || "sheet";
        switch (_type) {
          case "chart":
          /* falls through */
          default:
            f2 = "xl/worksheets/sheet" + rId + "." + wbext;
            zip_add_file(zip, f2, write_ws_xml(rId - 1, opts, wb, wsrels));
            ct2.sheets.push(f2);
            add_rels(opts.wbrels, -1, "worksheets/sheet" + rId + "." + wbext, RELS.WS[0]);
        }
        if (ws) {
          var comments = ws["!comments"];
          var need_vml = false;
          var cf = "";
          if (comments && comments.length > 0) {
            var needtc = false;
            comments.forEach(function(carr) {
              carr[1].forEach(function(c2) {
                if (c2.T == true) needtc = true;
              });
            });
            if (needtc) {
              cf = "xl/threadedComments/threadedComment" + rId + "." + wbext;
              zip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));
              ct2.threadedcomments.push(cf);
              add_rels(wsrels, -1, "../threadedComments/threadedComment" + rId + "." + wbext, RELS.TCMNT);
            }
            cf = "xl/comments" + rId + "." + wbext;
            zip_add_file(zip, cf, write_comments_xml(comments));
            ct2.comments.push(cf);
            add_rels(wsrels, -1, "../comments" + rId + "." + wbext, RELS.CMNT);
            need_vml = true;
          }
          if (ws["!legacy"]) {
            if (need_vml) zip_add_file(zip, "xl/drawings/vmlDrawing" + rId + ".vml", write_comments_vml(rId, ws["!comments"]));
          }
          delete ws["!comments"];
          delete ws["!legacy"];
        }
        if (wsrels["!id"].rId1) zip_add_file(zip, get_rels_path(f2), write_rels(wsrels));
      }
      if (opts.Strings != null && opts.Strings.length > 0) {
        f2 = "xl/sharedStrings." + wbext;
        zip_add_file(zip, f2, write_sst_xml(opts.Strings, opts));
        ct2.strs.push(f2);
        add_rels(opts.wbrels, -1, "sharedStrings." + wbext, RELS.SST);
      }
      f2 = "xl/workbook." + wbext;
      zip_add_file(zip, f2, write_wb_xml(wb));
      ct2.workbooks.push(f2);
      add_rels(opts.rels, 1, f2, RELS.WB);
      f2 = "xl/theme/theme1.xml";
      zip_add_file(zip, f2, write_theme(wb.Themes, opts));
      ct2.themes.push(f2);
      add_rels(opts.wbrels, -1, "theme/theme1.xml", RELS.THEME);
      f2 = "xl/styles." + wbext;
      zip_add_file(zip, f2, write_sty_xml(wb, opts));
      ct2.styles.push(f2);
      add_rels(opts.wbrels, -1, "styles." + wbext, RELS.STY);
      if (wb.vbaraw && vbafmt) {
        f2 = "xl/vbaProject.bin";
        zip_add_file(zip, f2, wb.vbaraw);
        ct2.vba.push(f2);
        add_rels(opts.wbrels, -1, "vbaProject.bin", RELS.VBA);
      }
      f2 = "xl/metadata." + wbext;
      zip_add_file(zip, f2, write_xlmeta_xml());
      ct2.metadata.push(f2);
      add_rels(opts.wbrels, -1, "metadata." + wbext, RELS.XLMETA);
      if (people.length > 1) {
        f2 = "xl/persons/person.xml";
        zip_add_file(zip, f2, write_people_xml(people));
        ct2.people.push(f2);
        add_rels(opts.wbrels, -1, "persons/person.xml", RELS.PEOPLE);
      }
      zip_add_file(zip, "[Content_Types].xml", write_ct(ct2, opts));
      zip_add_file(zip, "_rels/.rels", write_rels(opts.rels));
      zip_add_file(zip, "xl/_rels/workbook." + wbext + ".rels", write_rels(opts.wbrels));
      delete opts.revssf;
      delete opts.ssf;
      return zip;
    }
    function firstbyte(f2, o2) {
      var x2 = "";
      switch ((o2 || {}).type || "base64") {
        case "buffer":
          return [f2[0], f2[1], f2[2], f2[3], f2[4], f2[5], f2[6], f2[7]];
        case "base64":
          x2 = Base64_decode(f2.slice(0, 12));
          break;
        case "binary":
          x2 = f2;
          break;
        case "array":
          return [f2[0], f2[1], f2[2], f2[3], f2[4], f2[5], f2[6], f2[7]];
        default:
          throw new Error("Unrecognized type " + (o2 && o2.type || "undefined"));
      }
      return [x2.charCodeAt(0), x2.charCodeAt(1), x2.charCodeAt(2), x2.charCodeAt(3), x2.charCodeAt(4), x2.charCodeAt(5), x2.charCodeAt(6), x2.charCodeAt(7)];
    }
    function write_cfb_ctr(cfb, o2) {
      switch (o2.type) {
        case "base64":
        case "binary":
          break;
        case "buffer":
        case "array":
          o2.type = "";
          break;
        case "file":
          return write_dl(o2.file, CFB.write(cfb, { type: has_buf ? "buffer" : "" }));
        case "string":
          throw new Error("'string' output type invalid for '" + o2.bookType + "' files");
        default:
          throw new Error("Unrecognized type " + o2.type);
      }
      return CFB.write(cfb, o2);
    }
    function write_zip_type(wb, opts) {
      var o2 = dup(opts || {});
      var z2 = write_zip(wb, o2);
      return write_zip_denouement(z2, o2);
    }
    function write_zip_denouement(z2, o2) {
      var oopts = {};
      var ftype = has_buf ? "nodebuffer" : typeof Uint8Array !== "undefined" ? "array" : "string";
      if (o2.compression) oopts.compression = "DEFLATE";
      if (o2.password) oopts.type = ftype;
      else switch (o2.type) {
        case "base64":
          oopts.type = "base64";
          break;
        case "binary":
          oopts.type = "string";
          break;
        case "string":
          throw new Error("'string' output type invalid for '" + o2.bookType + "' files");
        case "buffer":
        case "file":
          oopts.type = ftype;
          break;
        default:
          throw new Error("Unrecognized type " + o2.type);
      }
      var out2 = z2.FullPaths ? CFB.write(z2, { fileType: "zip", type: (
        /*::(*/
        { "nodebuffer": "buffer", "string": "binary" }[oopts.type] || oopts.type
      ), compression: !!o2.compression }) : z2.generate(oopts);
      if (typeof Deno !== "undefined") {
        if (typeof out2 == "string") {
          if (o2.type == "binary" || o2.type == "base64") return out2;
          out2 = new Uint8Array(s2ab(out2));
        }
      }
      if (o2.password && typeof encrypt_agile !== "undefined") return write_cfb_ctr(encrypt_agile(out2, o2.password), o2);
      if (o2.type === "file") return write_dl(o2.file, out2);
      return o2.type == "string" ? utf8read(
        /*::(*/
        out2
        /*:: :any)*/
      ) : out2;
    }
    function write_cfb_type(wb, opts) {
      var o2 = opts || {};
      var cfb = write_xlscfb(wb, o2);
      return write_cfb_ctr(cfb, o2);
    }
    function write_string_type(out2, opts, bom) {
      if (!bom) bom = "";
      var o2 = bom + out2;
      switch (opts.type) {
        case "base64":
          return Base64_encode(utf8write(o2));
        case "binary":
          return utf8write(o2);
        case "string":
          return out2;
        case "file":
          return write_dl(opts.file, o2, "utf8");
        case "buffer": {
          if (has_buf) return Buffer_from(o2, "utf8");
          else if (typeof TextEncoder !== "undefined") return new TextEncoder().encode(o2);
          else return write_string_type(o2, { type: "binary" }).split("").map(function(c2) {
            return c2.charCodeAt(0);
          });
        }
      }
      throw new Error("Unrecognized type " + opts.type);
    }
    function write_stxt_type(out2, opts) {
      switch (opts.type) {
        case "base64":
          return Base64_encode(out2);
        case "binary":
          return out2;
        case "string":
          return out2;
        /* override in sheet_to_txt */
        case "file":
          return write_dl(opts.file, out2, "binary");
        case "buffer": {
          if (has_buf) return Buffer_from(out2, "binary");
          else return out2.split("").map(function(c2) {
            return c2.charCodeAt(0);
          });
        }
      }
      throw new Error("Unrecognized type " + opts.type);
    }
    function write_binary_type(out2, opts) {
      switch (opts.type) {
        case "string":
        case "base64":
        case "binary":
          var bstr = "";
          for (var i2 = 0; i2 < out2.length; ++i2) bstr += String.fromCharCode(out2[i2]);
          return opts.type == "base64" ? Base64_encode(bstr) : opts.type == "string" ? utf8read(bstr) : bstr;
        case "file":
          return write_dl(opts.file, out2);
        case "buffer":
          return out2;
        default:
          throw new Error("Unrecognized type " + opts.type);
      }
    }
    function writeSync(wb, opts) {
      reset_cp();
      check_wb(wb);
      var o2 = dup(opts || {});
      if (o2.cellStyles) {
        o2.cellNF = true;
        o2.sheetStubs = true;
      }
      if (o2.type == "array") {
        o2.type = "binary";
        var out2 = writeSync(wb, o2);
        o2.type = "array";
        return s2ab(out2);
      }
      var idx = 0;
      if (o2.sheet) {
        if (typeof o2.sheet == "number") idx = o2.sheet;
        else idx = wb.SheetNames.indexOf(o2.sheet);
        if (!wb.SheetNames[idx]) throw new Error("Sheet not found: " + o2.sheet + " : " + typeof o2.sheet);
      }
      switch (o2.bookType || "xlsb") {
        case "xml":
        case "xlml":
          return write_string_type(write_xlml(wb, o2), o2);
        case "slk":
        case "sylk":
          return write_string_type(SYLK.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "htm":
        case "html":
          return write_string_type(sheet_to_html(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "txt":
          return write_stxt_type(sheet_to_txt(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "csv":
          return write_string_type(sheet_to_csv(wb.Sheets[wb.SheetNames[idx]], o2), o2, "\uFEFF");
        case "dif":
          return write_string_type(DIF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "dbf":
          return write_binary_type(DBF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "prn":
          return write_string_type(PRN.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "rtf":
          return write_string_type(RTF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "eth":
          return write_string_type(ETH.from_sheet(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "fods":
          return write_string_type(write_ods(wb, o2), o2);
        case "wk1":
          return write_binary_type(WK_.sheet_to_wk1(wb.Sheets[wb.SheetNames[idx]], o2), o2);
        case "wk3":
          return write_binary_type(WK_.book_to_wk3(wb, o2), o2);
        case "biff2":
          if (!o2.biff) o2.biff = 2;
        /* falls through */
        case "biff3":
          if (!o2.biff) o2.biff = 3;
        /* falls through */
        case "biff4":
          if (!o2.biff) o2.biff = 4;
          return write_binary_type(write_biff_buf(wb, o2), o2);
        case "biff5":
          if (!o2.biff) o2.biff = 5;
        /* falls through */
        case "biff8":
        case "xla":
        case "xls":
          if (!o2.biff) o2.biff = 8;
          return write_cfb_type(wb, o2);
        case "xlsx":
        case "xlsm":
        case "xlam":
        case "xlsb":
        case "numbers":
        case "ods":
          return write_zip_type(wb, o2);
        default:
          throw new Error("Unrecognized bookType |" + o2.bookType + "|");
      }
    }
    function make_json_row(sheet, r, R2, cols, header, hdr, dense, o2) {
      var rr = encode_row(R2);
      var defval = o2.defval, raw = o2.raw || !Object.prototype.hasOwnProperty.call(o2, "raw");
      var isempty = true;
      var row = header === 1 ? [] : {};
      if (header !== 1) {
        if (Object.defineProperty) try {
          Object.defineProperty(row, "__rowNum__", { value: R2, enumerable: false });
        } catch (e2) {
          row.__rowNum__ = R2;
        }
        else row.__rowNum__ = R2;
      }
      if (!dense || sheet[R2]) for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
        var val = dense ? sheet[R2][C2] : sheet[cols[C2] + rr];
        if (val === void 0 || val.t === void 0) {
          if (defval === void 0) continue;
          if (hdr[C2] != null) {
            row[hdr[C2]] = defval;
          }
          continue;
        }
        var v4 = val.v;
        switch (val.t) {
          case "z":
            if (v4 == null) break;
            continue;
          case "e":
            v4 = v4 == 0 ? null : void 0;
            break;
          case "s":
          case "d":
          case "b":
          case "n":
            break;
          default:
            throw new Error("unrecognized type " + val.t);
        }
        if (hdr[C2] != null) {
          if (v4 == null) {
            if (val.t == "e" && v4 === null) row[hdr[C2]] = null;
            else if (defval !== void 0) row[hdr[C2]] = defval;
            else if (raw && v4 === null) row[hdr[C2]] = null;
            else continue;
          } else {
            row[hdr[C2]] = raw && (val.t !== "n" || val.t === "n" && o2.rawNumbers !== false) ? v4 : format_cell(val, v4, o2);
          }
          if (v4 != null) isempty = false;
        }
      }
      return { row, isempty };
    }
    function sheet_to_json(sheet, opts) {
      if (sheet == null || sheet["!ref"] == null) return [];
      var val = { t: "n", v: 0 }, header = 0, offset2 = 1, hdr = [], v4 = 0, vv = "";
      var r = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };
      var o2 = opts || {};
      var range2 = o2.range != null ? o2.range : sheet["!ref"];
      if (o2.header === 1) header = 1;
      else if (o2.header === "A") header = 2;
      else if (Array.isArray(o2.header)) header = 3;
      else if (o2.header == null) header = 0;
      switch (typeof range2) {
        case "string":
          r = safe_decode_range(range2);
          break;
        case "number":
          r = safe_decode_range(sheet["!ref"]);
          r.s.r = range2;
          break;
        default:
          r = range2;
      }
      if (header > 0) offset2 = 0;
      var rr = encode_row(r.s.r);
      var cols = [];
      var out2 = [];
      var outi = 0, counter = 0;
      var dense = Array.isArray(sheet);
      var R2 = r.s.r, C2 = 0;
      var header_cnt = {};
      if (dense && !sheet[R2]) sheet[R2] = [];
      var colinfo = o2.skipHidden && sheet["!cols"] || [];
      var rowinfo = o2.skipHidden && sheet["!rows"] || [];
      for (C2 = r.s.c; C2 <= r.e.c; ++C2) {
        if ((colinfo[C2] || {}).hidden) continue;
        cols[C2] = encode_col(C2);
        val = dense ? sheet[R2][C2] : sheet[cols[C2] + rr];
        switch (header) {
          case 1:
            hdr[C2] = C2 - r.s.c;
            break;
          case 2:
            hdr[C2] = cols[C2];
            break;
          case 3:
            hdr[C2] = o2.header[C2 - r.s.c];
            break;
          default:
            if (val == null) val = { w: "__EMPTY", t: "s" };
            vv = v4 = format_cell(val, null, o2);
            counter = header_cnt[v4] || 0;
            if (!counter) header_cnt[v4] = 1;
            else {
              do {
                vv = v4 + "_" + counter++;
              } while (header_cnt[vv]);
              header_cnt[v4] = counter;
              header_cnt[vv] = 1;
            }
            hdr[C2] = vv;
        }
      }
      for (R2 = r.s.r + offset2; R2 <= r.e.r; ++R2) {
        if ((rowinfo[R2] || {}).hidden) continue;
        var row = make_json_row(sheet, r, R2, cols, header, hdr, dense, o2);
        if (row.isempty === false || (header === 1 ? o2.blankrows !== false : !!o2.blankrows)) out2[outi++] = row.row;
      }
      out2.length = outi;
      return out2;
    }
    var qreg = /"/g;
    function make_csv_row(sheet, r, R2, cols, fs, rs, FS, o2) {
      var isempty = true;
      var row = [], txt = "", rr = encode_row(R2);
      for (var C2 = r.s.c; C2 <= r.e.c; ++C2) {
        if (!cols[C2]) continue;
        var val = o2.dense ? (sheet[R2] || [])[C2] : sheet[cols[C2] + rr];
        if (val == null) txt = "";
        else if (val.v != null) {
          isempty = false;
          txt = "" + (o2.rawNumbers && val.t == "n" ? val.v : format_cell(val, null, o2));
          for (var i2 = 0, cc = 0; i2 !== txt.length; ++i2) if ((cc = txt.charCodeAt(i2)) === fs || cc === rs || cc === 34 || o2.forceQuotes) {
            txt = '"' + txt.replace(qreg, '""') + '"';
            break;
          }
          if (txt == "ID") txt = '"ID"';
        } else if (val.f != null && !val.F) {
          isempty = false;
          txt = "=" + val.f;
          if (txt.indexOf(",") >= 0) txt = '"' + txt.replace(qreg, '""') + '"';
        } else txt = "";
        row.push(txt);
      }
      if (o2.blankrows === false && isempty) return null;
      return row.join(FS);
    }
    function sheet_to_csv(sheet, opts) {
      var out2 = [];
      var o2 = opts == null ? {} : opts;
      if (sheet == null || sheet["!ref"] == null) return "";
      var r = safe_decode_range(sheet["!ref"]);
      var FS = o2.FS !== void 0 ? o2.FS : ",", fs = FS.charCodeAt(0);
      var RS = o2.RS !== void 0 ? o2.RS : "\n", rs = RS.charCodeAt(0);
      var endregex = new RegExp((FS == "|" ? "\\|" : FS) + "+$");
      var row = "", cols = [];
      o2.dense = Array.isArray(sheet);
      var colinfo = o2.skipHidden && sheet["!cols"] || [];
      var rowinfo = o2.skipHidden && sheet["!rows"] || [];
      for (var C2 = r.s.c; C2 <= r.e.c; ++C2) if (!(colinfo[C2] || {}).hidden) cols[C2] = encode_col(C2);
      var w2 = 0;
      for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
        if ((rowinfo[R2] || {}).hidden) continue;
        row = make_csv_row(sheet, r, R2, cols, fs, rs, FS, o2);
        if (row == null) {
          continue;
        }
        if (o2.strip) row = row.replace(endregex, "");
        if (row || o2.blankrows !== false) out2.push((w2++ ? RS : "") + row);
      }
      delete o2.dense;
      return out2.join("");
    }
    function sheet_to_txt(sheet, opts) {
      if (!opts) opts = {};
      opts.FS = "	";
      opts.RS = "\n";
      var s2 = sheet_to_csv(sheet, opts);
      return s2;
    }
    function sheet_to_formulae(sheet) {
      var y = "", x2, val = "";
      if (sheet == null || sheet["!ref"] == null) return [];
      var r = safe_decode_range(sheet["!ref"]), rr = "", cols = [], C2;
      var cmds = [];
      var dense = Array.isArray(sheet);
      for (C2 = r.s.c; C2 <= r.e.c; ++C2) cols[C2] = encode_col(C2);
      for (var R2 = r.s.r; R2 <= r.e.r; ++R2) {
        rr = encode_row(R2);
        for (C2 = r.s.c; C2 <= r.e.c; ++C2) {
          y = cols[C2] + rr;
          x2 = dense ? (sheet[R2] || [])[C2] : sheet[y];
          val = "";
          if (x2 === void 0) continue;
          else if (x2.F != null) {
            y = x2.F;
            if (!x2.f) continue;
            val = x2.f;
            if (y.indexOf(":") == -1) y = y + ":" + y;
          }
          if (x2.f != null) val = x2.f;
          else if (x2.t == "z") continue;
          else if (x2.t == "n" && x2.v != null) val = "" + x2.v;
          else if (x2.t == "b") val = x2.v ? "TRUE" : "FALSE";
          else if (x2.w !== void 0) val = "'" + x2.w;
          else if (x2.v === void 0) continue;
          else if (x2.t == "s") val = "'" + x2.v;
          else val = "" + x2.v;
          cmds[cmds.length] = y + "=" + val;
        }
      }
      return cmds;
    }
    function sheet_add_json(_ws, js, opts) {
      var o2 = opts || {};
      var offset2 = +!o2.skipHeader;
      var ws = _ws || {};
      var _R = 0, _C = 0;
      if (ws && o2.origin != null) {
        if (typeof o2.origin == "number") _R = o2.origin;
        else {
          var _origin = typeof o2.origin == "string" ? decode_cell(o2.origin) : o2.origin;
          _R = _origin.r;
          _C = _origin.c;
        }
      }
      var cell;
      var range2 = { s: { c: 0, r: 0 }, e: { c: _C, r: _R + js.length - 1 + offset2 } };
      if (ws["!ref"]) {
        var _range = safe_decode_range(ws["!ref"]);
        range2.e.c = Math.max(range2.e.c, _range.e.c);
        range2.e.r = Math.max(range2.e.r, _range.e.r);
        if (_R == -1) {
          _R = _range.e.r + 1;
          range2.e.r = _R + js.length - 1 + offset2;
        }
      } else {
        if (_R == -1) {
          _R = 0;
          range2.e.r = js.length - 1 + offset2;
        }
      }
      var hdr = o2.header || [], C2 = 0;
      js.forEach(function(JS, R2) {
        keys(JS).forEach(function(k2) {
          if ((C2 = hdr.indexOf(k2)) == -1) hdr[C2 = hdr.length] = k2;
          var v4 = JS[k2];
          var t = "z";
          var z2 = "";
          var ref2 = encode_cell({ c: _C + C2, r: _R + R2 + offset2 });
          cell = ws_get_cell_stub(ws, ref2);
          if (v4 && typeof v4 === "object" && !(v4 instanceof Date)) {
            ws[ref2] = v4;
          } else {
            if (typeof v4 == "number") t = "n";
            else if (typeof v4 == "boolean") t = "b";
            else if (typeof v4 == "string") t = "s";
            else if (v4 instanceof Date) {
              t = "d";
              if (!o2.cellDates) {
                t = "n";
                v4 = datenum(v4);
              }
              z2 = o2.dateNF || table_fmt[14];
            } else if (v4 === null && o2.nullError) {
              t = "e";
              v4 = 0;
            }
            if (!cell) ws[ref2] = cell = { t, v: v4 };
            else {
              cell.t = t;
              cell.v = v4;
              delete cell.w;
              delete cell.R;
              if (z2) cell.z = z2;
            }
            if (z2) cell.z = z2;
          }
        });
      });
      range2.e.c = Math.max(range2.e.c, _C + hdr.length - 1);
      var __R = encode_row(_R);
      if (offset2) for (C2 = 0; C2 < hdr.length; ++C2) ws[encode_col(C2 + _C) + __R] = { t: "s", v: hdr[C2] };
      ws["!ref"] = encode_range(range2);
      return ws;
    }
    function json_to_sheet(js, opts) {
      return sheet_add_json(null, js, opts);
    }
    function ws_get_cell_stub(ws, R2, C2) {
      if (typeof R2 == "string") {
        if (Array.isArray(ws)) {
          var RC = decode_cell(R2);
          if (!ws[RC.r]) ws[RC.r] = [];
          return ws[RC.r][RC.c] || (ws[RC.r][RC.c] = { t: "z" });
        }
        return ws[R2] || (ws[R2] = { t: "z" });
      }
      if (typeof R2 != "number") return ws_get_cell_stub(ws, encode_cell(R2));
      return ws_get_cell_stub(ws, encode_cell({ r: R2, c: C2 || 0 }));
    }
    function wb_sheet_idx(wb, sh) {
      if (typeof sh == "number") {
        if (sh >= 0 && wb.SheetNames.length > sh) return sh;
        throw new Error("Cannot find sheet # " + sh);
      } else if (typeof sh == "string") {
        var idx = wb.SheetNames.indexOf(sh);
        if (idx > -1) return idx;
        throw new Error("Cannot find sheet name |" + sh + "|");
      } else throw new Error("Cannot find sheet |" + sh + "|");
    }
    function book_new() {
      return { SheetNames: [], Sheets: {} };
    }
    function book_append_sheet(wb, ws, name, roll) {
      var i2 = 1;
      if (!name) {
        for (; i2 <= 65535; ++i2, name = void 0) if (wb.SheetNames.indexOf(name = "Sheet" + i2) == -1) break;
      }
      if (!name || wb.SheetNames.length >= 65535) throw new Error("Too many worksheets");
      if (roll && wb.SheetNames.indexOf(name) >= 0) {
        var m2 = name.match(/(^.*?)(\d+)$/);
        i2 = m2 && +m2[2] || 0;
        var root2 = m2 && m2[1] || name;
        for (++i2; i2 <= 65535; ++i2) if (wb.SheetNames.indexOf(name = root2 + i2) == -1) break;
      }
      check_ws_name(name);
      if (wb.SheetNames.indexOf(name) >= 0) throw new Error("Worksheet with name |" + name + "| already exists!");
      wb.SheetNames.push(name);
      wb.Sheets[name] = ws;
      return name;
    }
    function book_set_sheet_visibility(wb, sh, vis) {
      if (!wb.Workbook) wb.Workbook = {};
      if (!wb.Workbook.Sheets) wb.Workbook.Sheets = [];
      var idx = wb_sheet_idx(wb, sh);
      if (!wb.Workbook.Sheets[idx]) wb.Workbook.Sheets[idx] = {};
      switch (vis) {
        case 0:
        case 1:
        case 2:
          break;
        default:
          throw new Error("Bad sheet visibility setting " + vis);
      }
      wb.Workbook.Sheets[idx].Hidden = vis;
    }
    function cell_set_number_format(cell, fmt) {
      cell.z = fmt;
      return cell;
    }
    function cell_set_hyperlink(cell, target, tooltip) {
      if (!target) {
        delete cell.l;
      } else {
        cell.l = { Target: target };
        if (tooltip) cell.l.Tooltip = tooltip;
      }
      return cell;
    }
    function cell_set_internal_link(cell, range2, tooltip) {
      return cell_set_hyperlink(cell, "#" + range2, tooltip);
    }
    function cell_add_comment(cell, text, author) {
      if (!cell.c) cell.c = [];
      cell.c.push({ t: text, a: author || "SheetJS" });
    }
    function sheet_set_array_formula(ws, range2, formula, dynamic) {
      var rng = typeof range2 != "string" ? range2 : safe_decode_range(range2);
      var rngstr = typeof range2 == "string" ? range2 : encode_range(range2);
      for (var R2 = rng.s.r; R2 <= rng.e.r; ++R2) for (var C2 = rng.s.c; C2 <= rng.e.c; ++C2) {
        var cell = ws_get_cell_stub(ws, R2, C2);
        cell.t = "n";
        cell.F = rngstr;
        delete cell.v;
        if (R2 == rng.s.r && C2 == rng.s.c) {
          cell.f = formula;
          if (dynamic) cell.D = true;
        }
      }
      return ws;
    }
    var utils$2 = {
      encode_col,
      encode_row,
      encode_cell,
      encode_range,
      decode_col,
      decode_row,
      split_cell,
      decode_cell,
      decode_range,
      format_cell,
      sheet_add_aoa,
      sheet_add_json,
      sheet_add_dom,
      aoa_to_sheet,
      json_to_sheet,
      table_to_sheet: parse_dom_table,
      table_to_book,
      sheet_to_csv,
      sheet_to_txt,
      sheet_to_json,
      sheet_to_html,
      sheet_to_formulae,
      sheet_to_row_object_array: sheet_to_json,
      sheet_get_cell: ws_get_cell_stub,
      book_new,
      book_append_sheet,
      book_set_sheet_visibility,
      cell_set_number_format,
      cell_set_hyperlink,
      cell_set_internal_link,
      cell_add_comment,
      sheet_set_array_formula,
      consts: {
        SHEET_VISIBLE: 0,
        SHEET_HIDDEN: 1,
        SHEET_VERY_HIDDEN: 2
      }
    };
    const _sfc_main$5 = {
      name: "DataReport",
      components: {
        Download: download_default,
        Printer: printer_default,
        PictureFilled: picture_filled_default
      },
      setup() {
        const activeTab = ref("curves");
        const mxComparisonChart = ref(null);
        const distributionChart = ref(null);
        const errorChart = ref(null);
        const curvesChart = ref(null);
        const imageRefs = ref([]);
        let chartInstances = [];
        const filterDate = ref([]);
        const filterGroups = ref("all");
        const selectedGroups = ref([1, 2, 3, 4, 5, 6]);
        const curveDisplayMode = ref("mixed");
        const imageData = ref([]);
        const handleHover = (img, index) => {
          imageData.value[index].hovering = true;
        };
        const handleHoverEnd = (index) => {
          imageData.value[index].hovering = false;
        };
        const groupData2 = ref([
          {
            group: 1,
            range: "0.03-0.15",
            color: "#1890ff",
            points: [
              { x: 0.03, y: 0.01 },
              { x: 0.06, y: 0.05 },
              { x: 0.09, y: 0.1 },
              { x: 0.11, y: 0.09 },
              { x: 0.13, y: 0.05 },
              { x: 0.15, y: 0.01 },
              { x: 0.17, y: 0 }
            ]
          },
          {
            group: 2,
            range: "0.09-0.33",
            color: "#ff9c6e",
            points: [
              { x: 0.09, y: 0 },
              { x: 0.11, y: 0.05 },
              { x: 0.13, y: 0.12 },
              { x: 0.15, y: 0.175 },
              { x: 0.17, y: 0.12 },
              { x: 0.21, y: 0.05 },
              { x: 0.33, y: 0 }
            ]
          },
          {
            group: 3,
            range: "0.23-0.59",
            color: "#52c41a",
            points: [
              { x: 0.23, y: 0 },
              { x: 0.3, y: 0.04 },
              { x: 0.37, y: 0.09 },
              { x: 0.42, y: 0.115 },
              { x: 0.48, y: 0.075 },
              { x: 0.54, y: 0.02 },
              { x: 0.59, y: 0 }
            ]
          },
          {
            group: 4,
            range: "0.45-1.15",
            color: "#f5222d",
            points: [
              { x: 0.45, y: 0 },
              { x: 0.55, y: 0.04 },
              { x: 0.65, y: 0.09 },
              { x: 0.75, y: 0.125 },
              { x: 0.85, y: 0.075 },
              { x: 0.95, y: 0.025 },
              { x: 1.15, y: 0 }
            ]
          },
          {
            group: 5,
            range: "0.84-2.12",
            color: "#722ed1",
            points: [
              { x: 0.84, y: 0 },
              { x: 1, y: 0.03 },
              { x: 1.16, y: 0.075 },
              { x: 1.32, y: 0.125 },
              { x: 1.48, y: 0.07 },
              { x: 1.72, y: 0.02 },
              { x: 2.12, y: 0 }
            ]
          },
          {
            group: 6,
            range: "1.82-3.98",
            color: "#a0522d",
            points: [
              { x: 1.82, y: 0 },
              { x: 2.2, y: 0.03 },
              { x: 2.7, y: 0.08 },
              { x: 3, y: 0.13 },
              { x: 3.3, y: 0.085 },
              { x: 3.6, y: 0.03 },
              { x: 3.98, y: 0 }
            ]
          }
        ]);
        const mxData = ref([
          { group: 1, screeningMx: 2, cameraMx: 2.05, loss: 7 },
          { group: 2, screeningMx: 3.05, cameraMx: 3.25, loss: 13.5 },
          { group: 3, screeningMx: 2.5, cameraMx: 2.7, loss: 10.2 },
          { group: 4, screeningMx: 2.35, cameraMx: 2.3, loss: 10.5 },
          { group: 5, screeningMx: 2.2, cameraMx: 2.25, loss: 9.5 },
          { group: 6, screeningMx: 2.7, cameraMx: 2.85, loss: 8.5 },
          { group: 7, screeningMx: 2.9, cameraMx: 3.05, loss: 11 },
          { group: 8, screeningMx: 2.7, cameraMx: 2.85, loss: 10.2 },
          { group: 9, screeningMx: 3.3, cameraMx: 3.2, loss: 14 },
          { group: 10, screeningMx: 3.5, cameraMx: 3.6, loss: 15.8 }
        ]);
        const filteredMxData = ref([...mxData.value]);
        const distributionData = ref([
          { range: "0.075-0.15", screening: 20, camera: 18.9, difference: -1.1 },
          { range: "0.15-0.3", screening: 10, camera: 10.2, difference: 0.2 },
          { range: "0.3-0.6", screening: 29, camera: 30.7, difference: 1.7 },
          { range: "0.6-1.18", screening: 31, camera: 29.2, difference: -1.8 },
          { range: "1.18-2.36", screening: 10, camera: 9.5, difference: -0.5 },
          { range: "2.36-4.75", screening: 0, camera: 1.5, difference: 1.5 }
        ]);
        const errorData = ref([
          { range: "0.15-0.3", totalError: 13, previousError: 0, nextError: 0 },
          { range: "0.3-0.6", totalError: 11.5, previousError: 2.8, nextError: 0.75 },
          { range: "0.6-1.18", totalError: 8.6, previousError: 1.07, nextError: 0.75 },
          { range: "1.18-2.36", totalError: 5.6, previousError: 0.77, nextError: 0.69 },
          { range: "2.36-4.75", totalError: 16.45, previousError: 3.54, nextError: 0.99 }
        ]);
        const createChart = (container, options) => {
          if (!container.value || !document.body.contains(container.value)) {
            return null;
          }
          if (container.value.offsetParent === null || container.value.offsetWidth === 0 || container.value.offsetHeight === 0) {
            return null;
          }
          try {
            const existingChart = chartInstances.find(
              (chart2) => chart2 && chart2.getDom && chart2.getDom() === container.value
            );
            if (existingChart) {
              existingChart.dispose();
              chartInstances = chartInstances.filter((chart2) => chart2 !== existingChart);
            }
            const chart = init$1(container.value, null, {
              renderer: "canvas",
              useDirtyRect: false
            });
            chart.setOption(options);
            chartInstances.push(chart);
            return chart;
          } catch (error) {
            console.error("创建图表失败:", error);
            return null;
          }
        };
        const createCurvesChart = () => {
          if (!curvesChart.value) return null;
          try {
            const series = [];
            if (curveDisplayMode.value === "combined") {
              groupData2.value.forEach((group, index) => {
                if (!selectedGroups.value.includes(group.group)) return;
                series.push({
                  name: `第 ${group.group} 组`,
                  type: "line",
                  smooth: true,
                  symbolSize: 5,
                  lineStyle: {
                    width: 3
                  },
                  itemStyle: {
                    color: group.color
                  },
                  data: group.points.map((point) => [point.x, point.y])
                });
              });
            } else {
              selectedGroups.value.forEach((groupId, index) => {
                const group = groupData2.value.find((g) => g.group === groupId);
                if (!group) return;
                series.push({
                  name: `第 ${group.group} 组`,
                  type: "line",
                  smooth: true,
                  symbolSize: 5,
                  lineStyle: {
                    width: 3,
                    type: curveDisplayMode.value === "original" ? "solid" : "dotted"
                  },
                  itemStyle: {
                    color: group.color
                  },
                  data: group.points.map((point) => [point.x, point.y])
                });
                if (curveDisplayMode.value === "mixed") {
                  series.push({
                    name: `第 ${group.group} 组拟合`,
                    type: "line",
                    smooth: true,
                    symbolSize: 0,
                    lineStyle: {
                      width: 2,
                      type: "dashed"
                    },
                    itemStyle: {
                      color: group.color
                    },
                    data: group.points.map((point) => [point.x, point.y * 0.95])
                  });
                }
              });
            }
            const option = {
              title: {
                text: "粒径分布",
                textStyle: {
                  color: "#00a8ff",
                  fontSize: 16
                }
              },
              tooltip: {
                trigger: "axis",
                formatter: function(params) {
                  let result = `粒径: ${params[0].data[0]}mm<br>`;
                  params.forEach((param) => {
                    if (!param.seriesName.includes("拟合")) {
                      result += `${param.seriesName}: ${(param.data[1] * 100).toFixed(2)}%<br>`;
                    }
                  });
                  return result;
                }
              },
              legend: {
                data: selectedGroups.value.map((groupId) => {
                  const group = groupData2.value.find((g) => g.group === groupId);
                  if (!group) return "";
                  return `第 ${group.group} 组: [${group.range}]`;
                }).filter(Boolean),
                textStyle: {
                  color: "#e6f7ff"
                },
                right: 10,
                orient: "vertical",
                top: 50,
                selected: selectedGroups.value.reduce((acc, groupId) => {
                  const group = groupData2.value.find((g) => g.group === groupId);
                  if (group) {
                    acc[`第 ${group.group} 组: [${group.range}]`] = true;
                  }
                  return acc;
                }, {})
              },
              grid: {
                left: "3%",
                right: "22%",
                bottom: "3%",
                containLabel: true
              },
              xAxis: {
                type: "value",
                name: "粒径 (mm)",
                min: 0,
                max: 4,
                axisLine: {
                  lineStyle: {
                    color: "#8b9eb0"
                  }
                },
                axisLabel: {
                  color: "#e6f7ff",
                  formatter: "{value}"
                },
                splitLine: {
                  lineStyle: {
                    color: "rgba(139, 158, 176, 0.1)"
                  }
                }
              },
              yAxis: {
                type: "value",
                name: "比例",
                min: 0,
                max: 0.2,
                axisLine: {
                  lineStyle: {
                    color: "#8b9eb0"
                  }
                },
                axisLabel: {
                  color: "#e6f7ff",
                  formatter: function(value) {
                    return (value * 100).toFixed(2) + "%";
                  }
                },
                splitLine: {
                  lineStyle: {
                    color: "rgba(139, 158, 176, 0.1)"
                  }
                }
              },
              series
            };
            const chart = createChart(curvesChart, option);
            if (chart) chartInstances.push(chart);
            return chart;
          } catch (error) {
            console.error("创建曲线图表失败:", error);
            return null;
          }
        };
        const updateCurvesChart = () => {
          if (activeTab.value !== "curves") return;
          disposeAllCharts();
          setTimeout(() => {
            createCurvesChart();
          }, 100);
        };
        const initCharts = async () => {
          try {
            disposeAllCharts();
            await nextTick();
            setTimeout(() => {
              if (document.visibilityState === "visible") {
                createChartByTab(activeTab.value);
              }
            }, 300);
          } catch (error) {
            console.error("初始化图表时出错:", error);
          }
        };
        const createChartByTab = (tab) => {
          disposeAllCharts();
          nextTick(() => {
            try {
              const containerMap = {
                mx: mxComparisonChart.value,
                distribution: distributionChart.value,
                error: errorChart.value,
                curves: curvesChart.value
              };
              if (!containerMap[tab] || !document.body.contains(containerMap[tab])) {
                return;
              }
              switch (tab) {
                case "mx":
                  createMxChart();
                  break;
                case "distribution":
                  createDistributionChart();
                  break;
                case "error":
                  createErrorChart();
                  break;
                case "curves":
                  createCurvesChart();
                  break;
              }
            } catch (error) {
              console.error("创建图表失败:", error);
            }
          });
        };
        const handleTabChange = (tab) => {
          disposeAllCharts();
          setTimeout(() => {
            createChartByTab(tab);
          }, 200);
        };
        const disposeAllCharts = () => {
          const disposedCharts = /* @__PURE__ */ new Set();
          chartInstances.forEach((chart) => {
            if (chart && !disposedCharts.has(chart)) {
              try {
                chart.dispose();
                disposedCharts.add(chart);
              } catch (e2) {
                console.warn("图表清理异常:", e2);
              }
            }
          });
          chartInstances = [];
        };
        onMounted(() => {
          const initTimeout = setTimeout(() => {
            initCharts();
            let resizeTimeout;
            const handleResize = () => {
              if (document.visibilityState === "visible") {
                chartInstances.forEach((chart) => {
                  if (chart && chart.getDom && document.body.contains(chart.getDom())) {
                    try {
                      requestAnimationFrame(() => {
                        chart.resize();
                      });
                    } catch (e2) {
                      console.warn("调整图表大小失败:", e2);
                    }
                  }
                });
              }
            };
            const debouncedResize = () => {
              if (resizeTimeout) {
                clearTimeout(resizeTimeout);
              }
              resizeTimeout = setTimeout(handleResize, 200);
            };
            window.addEventListener("resize", debouncedResize);
            watch(activeTab, (newTab) => {
              handleTabChange(newTab);
            });
            const visibilityHandler = () => {
              if (document.visibilityState === "visible") {
                setTimeout(initCharts, 200);
              }
            };
            document.addEventListener("visibilitychange", visibilityHandler);
            onUnmounted(() => {
              if (resizeTimeout) {
                clearTimeout(resizeTimeout);
              }
              if (initTimeout) {
                clearTimeout(initTimeout);
              }
              window.removeEventListener("resize", debouncedResize);
              document.removeEventListener("visibilitychange", visibilityHandler);
              disposeAllCharts();
            });
          }, 300);
        });
        const createMxChart = () => {
          if (!mxComparisonChart.value) return null;
          try {
            const options = {
              title: {
                text: "筛分法MX值与双相机MX值对比",
                textStyle: {
                  color: "#00a8ff",
                  fontSize: 16
                }
              },
              tooltip: {
                trigger: "axis",
                axisPointer: {
                  type: "shadow"
                }
              },
              legend: {
                data: ["筛分法MX", "双相机MX", "Loss"],
                textStyle: {
                  color: "#e6f7ff"
                }
              },
              grid: {
                left: "3%",
                right: "4%",
                bottom: "3%",
                containLabel: true
              },
              xAxis: [
                {
                  type: "category",
                  data: filteredMxData.value.map((item) => item.group),
                  name: "土组样本对比",
                  axisLine: {
                    lineStyle: {
                      color: "#8b9eb0"
                    }
                  },
                  axisLabel: {
                    color: "#e6f7ff"
                  }
                }
              ],
              yAxis: [
                {
                  type: "value",
                  name: "MX值",
                  position: "left",
                  axisLine: {
                    lineStyle: {
                      color: "#8b9eb0"
                    }
                  },
                  axisLabel: {
                    color: "#e6f7ff"
                  },
                  splitLine: {
                    lineStyle: {
                      color: "rgba(139, 158, 176, 0.1)"
                    }
                  }
                },
                {
                  type: "value",
                  name: "Loss (%)",
                  position: "right",
                  axisLine: {
                    lineStyle: {
                      color: "#8b9eb0"
                    }
                  },
                  axisLabel: {
                    color: "#e6f7ff"
                  },
                  splitLine: {
                    show: false
                  }
                }
              ],
              series: [
                {
                  name: "筛分法MX",
                  type: "bar",
                  data: filteredMxData.value.map((item) => item.screeningMx),
                  itemStyle: {
                    color: "#5470c6"
                  }
                },
                {
                  name: "双相机MX",
                  type: "bar",
                  data: filteredMxData.value.map((item) => item.cameraMx),
                  itemStyle: {
                    color: "#fac858"
                  }
                },
                {
                  name: "Loss",
                  type: "line",
                  yAxisIndex: 1,
                  data: filteredMxData.value.map((item) => item.loss),
                  itemStyle: {
                    color: "#91cc75"
                  },
                  lineStyle: {
                    width: 2
                  },
                  symbol: "circle",
                  symbolSize: 8
                }
              ]
            };
            const chart = createChart(mxComparisonChart, options);
            if (chart) chartInstances.push(chart);
            return chart;
          } catch (error) {
            console.error("创建MX图表失败:", error);
            return null;
          }
        };
        const createDistributionChart = () => {
          if (!distributionChart.value) return null;
          try {
            const options = {
              title: {
                text: "筛分法与双相机结果对比分析",
                textStyle: {
                  color: "#00a8ff",
                  fontSize: 16
                }
              },
              tooltip: {
                trigger: "axis",
                axisPointer: {
                  type: "shadow"
                }
              },
              legend: {
                data: ["筛分法", "双相机", "误差"],
                textStyle: {
                  color: "#e6f7ff"
                }
              },
              grid: {
                left: "3%",
                right: "4%",
                bottom: "3%",
                containLabel: true
              },
              xAxis: {
                type: "category",
                data: distributionData.value.map((item) => item.range),
                name: "粒径范围 (mm)",
                axisLine: {
                  lineStyle: {
                    color: "#8b9eb0"
                  }
                },
                axisLabel: {
                  color: "#e6f7ff"
                }
              },
              yAxis: [
                {
                  type: "value",
                  name: "百分比 (%)",
                  position: "left",
                  axisLine: {
                    lineStyle: {
                      color: "#8b9eb0"
                    }
                  },
                  axisLabel: {
                    color: "#e6f7ff"
                  },
                  splitLine: {
                    lineStyle: {
                      color: "rgba(139, 158, 176, 0.1)"
                    }
                  }
                },
                {
                  type: "value",
                  name: "误差 (%)",
                  position: "right",
                  axisLine: {
                    lineStyle: {
                      color: "#8b9eb0"
                    }
                  },
                  axisLabel: {
                    color: "#e6f7ff"
                  },
                  splitLine: {
                    show: false
                  }
                }
              ],
              series: [
                {
                  name: "筛分法",
                  type: "bar",
                  data: distributionData.value.map((item) => item.screening),
                  itemStyle: {
                    color: "#5470c6"
                  }
                },
                {
                  name: "双相机",
                  type: "bar",
                  data: distributionData.value.map((item) => item.camera),
                  itemStyle: {
                    color: "#fac858"
                  }
                },
                {
                  name: "误差",
                  type: "line",
                  yAxisIndex: 1,
                  data: distributionData.value.map((item) => item.difference),
                  itemStyle: {
                    color: "#ee6666"
                  },
                  lineStyle: {
                    width: 2
                  },
                  symbol: "circle",
                  symbolSize: 8
                }
              ]
            };
            const chart = createChart(distributionChart, options);
            if (chart) chartInstances.push(chart);
            return chart;
          } catch (error) {
            console.error("创建分布图表失败:", error);
            return null;
          }
        };
        const createErrorChart = () => {
          if (!errorChart.value) return null;
          try {
            const options = {
              title: {
                text: "不同粒径区间的错误分类概率对比",
                textStyle: {
                  color: "#00a8ff",
                  fontSize: 16
                }
              },
              tooltip: {
                trigger: "axis",
                axisPointer: {
                  type: "shadow"
                }
              },
              legend: {
                data: ["总错误分类概率", "错误分类到前一个区间", "错误分类到后一个区间"],
                textStyle: {
                  color: "#e6f7ff"
                }
              },
              grid: {
                left: "3%",
                right: "4%",
                bottom: "3%",
                containLabel: true
              },
              xAxis: {
                type: "category",
                data: errorData.value.map((item) => item.range),
                name: "粒径范围 (mm)",
                axisLine: {
                  lineStyle: {
                    color: "#8b9eb0"
                  }
                },
                axisLabel: {
                  color: "#e6f7ff"
                }
              },
              yAxis: {
                type: "value",
                name: "错误分类概率 (%)",
                axisLine: {
                  lineStyle: {
                    color: "#8b9eb0"
                  }
                },
                axisLabel: {
                  color: "#e6f7ff"
                },
                splitLine: {
                  lineStyle: {
                    color: "rgba(139, 158, 176, 0.1)"
                  }
                }
              },
              series: [
                {
                  name: "总错误分类概率",
                  data: errorData.value.map((item) => item.totalError),
                  type: "line",
                  smooth: true,
                  lineStyle: {
                    width: 3
                  },
                  symbol: "circle",
                  symbolSize: 10,
                  itemStyle: {
                    color: "#91cc75"
                  }
                },
                {
                  name: "错误分类到前一个区间",
                  type: "bar",
                  stack: "total",
                  data: errorData.value.map((item) => item.previousError),
                  itemStyle: {
                    color: "#fac858"
                  }
                },
                {
                  name: "错误分类到后一个区间",
                  type: "bar",
                  stack: "total",
                  data: errorData.value.map((item) => item.nextError),
                  itemStyle: {
                    color: "#ee6666"
                  }
                }
              ]
            };
            const chart = createChart(errorChart, options);
            if (chart) chartInstances.push(chart);
            return chart;
          } catch (error) {
            console.error("创建误差图表失败:", error);
            return null;
          }
        };
        const exportImage = () => {
          let activeChart = null;
          if (chartInstances.length > 0) {
            activeChart = chartInstances[0];
          }
          if (activeChart) {
            try {
              const url = activeChart.getDataURL({
                type: "png",
                pixelRatio: 2,
                backgroundColor: "#001529"
              });
              const link = document.createElement("a");
              link.download = `砂石级配分析_${activeTab.value}_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.png`;
              link.href = url;
              link.click();
            } catch (error) {
              console.error("导出图片失败:", error);
              ElMessage.error("导出图片失败，请重试");
            }
          }
        };
        const exportData = () => {
          const wb = utils$2.book_new();
          const mxWs = utils$2.json_to_sheet(mxData.value);
          utils$2.book_append_sheet(wb, mxWs, "MX值对比");
          const distributionWs = utils$2.json_to_sheet(distributionData.value);
          utils$2.book_append_sheet(wb, distributionWs, "粒径分布");
          const errorWs = utils$2.json_to_sheet(errorData.value);
          utils$2.book_append_sheet(wb, errorWs, "误差分析");
          const summaryData = [
            ["报告生成日期", (/* @__PURE__ */ new Date()).toLocaleDateString()],
            ["总样本数", mxData.value.length],
            [
              "平均筛分法MX",
              (mxData.value.reduce((sum2, item) => sum2 + item.screeningMx, 0) / mxData.value.length).toFixed(2)
            ],
            [
              "平均双相机MX",
              (mxData.value.reduce((sum2, item) => sum2 + item.cameraMx, 0) / mxData.value.length).toFixed(2)
            ],
            [
              "平均误差率",
              (mxData.value.reduce((sum2, item) => sum2 + item.loss, 0) / mxData.value.length).toFixed(
                2
              ) + "%"
            ]
          ];
          const summaryWs = utils$2.aoa_to_sheet(summaryData);
          utils$2.book_append_sheet(wb, summaryWs, "报告摘要");
          const wbout = writeSync(wb, { bookType: "xlsx", type: "array" });
          const blob = new Blob([wbout], { type: "application/octet-stream" });
          FileSaver_minExports.saveAs(blob, `砂石级配分析报告_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.xlsx`);
        };
        const printReport = () => {
          ElMessage.info("正在准备打印...");
          nextTick(() => {
            window.print();
          });
        };
        const applyFilter = () => {
          try {
            if (filterGroups.value === "all") {
              filteredMxData.value = [...mxData.value];
            } else {
              const count2 = parseInt(filterGroups.value);
              const startIdx = Math.max(0, mxData.value.length - count2);
              filteredMxData.value = mxData.value.slice(startIdx);
            }
            if (activeTab.value === "mx") {
              disposeAllCharts();
              setTimeout(() => {
                createMxChart();
              }, 100);
            }
            ElMessage.success(
              `已应用筛选: ${filterGroups.value === "all" ? "全部" : `最近${filterGroups.value}组`}数据`
            );
          } catch (error) {
            console.error("应用筛选失败:", error);
            ElMessage.error("应用筛选失败，请重试");
          }
        };
        const resetFilter = () => {
          try {
            filterDate.value = [];
            filterGroups.value = "all";
            filteredMxData.value = [...mxData.value];
            if (activeTab.value === "mx") {
              disposeAllCharts();
              setTimeout(() => {
                createMxChart();
              }, 100);
            }
            ElMessage.info("已重置筛选条件");
          } catch (error) {
            console.error("重置筛选失败:", error);
            ElMessage.error("重置筛选失败，请重试");
          }
        };
        watch(activeTab, (newTab, oldTab) => {
          if (newTab !== oldTab) {
            handleTabChange(newTab);
          }
        });
        watch([filterDate, filterGroups], () => {
        });
        onUnmounted(() => {
          disposeAllCharts();
        });
        return {
          activeTab,
          mxComparisonChart,
          distributionChart,
          errorChart,
          curvesChart,
          imageRefs,
          mxData,
          filteredMxData,
          distributionData,
          errorData,
          groupData: groupData2,
          selectedGroups,
          curveDisplayMode,
          imageData,
          exportData,
          exportImage,
          printReport,
          filterDate,
          filterGroups,
          applyFilter,
          resetFilter,
          updateCurvesChart,
          generateTestImages,
          handleHover,
          handleHoverEnd
        };
      }
    };
    const _hoisted_1$5 = { class: "data-report bg-white text-gray-900" };
    const _hoisted_2$5 = { class: "report-header bg-blue-50 p-4 rounded-lg mb-5 shadow-sm border border-blue-100" };
    const _hoisted_3$5 = { class: "report-actions flex items-center justify-between" };
    const _hoisted_4$5 = { class: "report-content bg-white border border-gray-200 rounded-lg shadow-sm p-5" };
    const _hoisted_5$5 = { class: "data-filter mb-5 bg-gray-50 p-4 rounded-lg border border-gray-200" };
    const _hoisted_6$5 = { class: "chart-container mb-5 border border-blue-100 rounded-lg shadow-sm bg-white p-4" };
    const _hoisted_7$5 = {
      ref: "curvesChart",
      class: "chart",
      style: { "height": "380px" }
    };
    const _hoisted_8$5 = { class: "control-panel mb-5 bg-blue-50 p-4 rounded-lg border border-blue-100" };
    const _hoisted_9$5 = { class: "legend-control mb-4" };
    const _hoisted_10$4 = { class: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3" };
    const _hoisted_11$3 = { class: "view-control" };
    const _hoisted_12$3 = { class: "chart-container mb-5 border border-blue-100 rounded-lg shadow-sm bg-white p-4" };
    const _hoisted_13$2 = {
      ref: "mxComparisonChart",
      class: "chart",
      style: { "height": "380px" }
    };
    const _hoisted_14$2 = { class: "data-table mb-5" };
    const _hoisted_15$2 = { class: "chart-container mb-5 border border-blue-100 rounded-lg shadow-sm bg-white p-4" };
    const _hoisted_16$2 = {
      ref: "distributionChart",
      class: "chart",
      style: { "height": "380px" }
    };
    const _hoisted_17$2 = { class: "data-table mb-5" };
    const _hoisted_18$2 = { class: "chart-container mb-5 border border-blue-100 rounded-lg shadow-sm bg-white p-4" };
    const _hoisted_19$2 = {
      ref: "errorChart",
      class: "chart",
      style: { "height": "380px" }
    };
    const _hoisted_20$2 = { class: "data-table mb-5" };
    function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_Download = resolveComponent("Download");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_button = resolveComponent("el-button");
      const _component_PictureFilled = resolveComponent("PictureFilled");
      const _component_Printer = resolveComponent("Printer");
      const _component_el_button_group = resolveComponent("el-button-group");
      const _component_el_date_picker = resolveComponent("el-date-picker");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_Search = resolveComponent("Search");
      const _component_RefreshRight = resolveComponent("RefreshRight");
      const _component_el_form = resolveComponent("el-form");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_el_radio_button = resolveComponent("el-radio-button");
      const _component_el_radio_group = resolveComponent("el-radio-group");
      const _component_el_tab_pane = resolveComponent("el-tab-pane");
      const _component_el_table_column = resolveComponent("el-table-column");
      const _component_el_table = resolveComponent("el-table");
      const _component_el_tabs = resolveComponent("el-tabs");
      return openBlock(), createElementBlock("div", _hoisted_1$5, [
        createBaseVNode("div", _hoisted_2$5, [
          _cache[7] || (_cache[7] = createBaseVNode("h2", { class: "text-blue-700 text-xl font-bold mb-3" }, "数据分析报表", -1)),
          createBaseVNode("div", _hoisted_3$5, [
            createVNode$1(_component_el_button_group, { class: "shadow-sm" }, {
              default: withCtx(() => [
                createVNode$1(_component_el_button, {
                  type: "primary",
                  size: "default",
                  onClick: $setup.exportData,
                  class: "bg-blue-600 hover:bg-blue-700 border-blue-700"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, { class: "mr-1" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_Download)
                      ]),
                      _: 1
                    }),
                    _cache[4] || (_cache[4] = createTextVNode(" 导出Excel "))
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                createVNode$1(_component_el_button, {
                  type: "success",
                  size: "default",
                  onClick: $setup.exportImage,
                  class: "bg-green-600 hover:bg-green-700 border-green-700"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, { class: "mr-1" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_PictureFilled)
                      ]),
                      _: 1
                    }),
                    _cache[5] || (_cache[5] = createTextVNode(" 导出图表 "))
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                createVNode$1(_component_el_button, {
                  type: "warning",
                  size: "default",
                  onClick: $setup.printReport,
                  class: "bg-amber-500 hover:bg-amber-600 border-amber-600"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, { class: "mr-1" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_Printer)
                      ]),
                      _: 1
                    }),
                    _cache[6] || (_cache[6] = createTextVNode(" 打印报表 "))
                  ]),
                  _: 1
                }, 8, ["onClick"])
              ]),
              _: 1
            })
          ])
        ]),
        createBaseVNode("div", _hoisted_4$5, [
          createBaseVNode("div", _hoisted_5$5, [
            _cache[10] || (_cache[10] = createBaseVNode("h3", { class: "text-blue-700 text-base font-semibold mb-3" }, "数据筛选", -1)),
            createVNode$1(_component_el_form, {
              inline: true,
              size: "default"
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_form_item, {
                  label: "数据日期",
                  class: "mb-0"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_date_picker, {
                      modelValue: $setup.filterDate,
                      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.filterDate = $event),
                      type: "daterange",
                      "value-format": "YYYY-MM-DD",
                      "range-separator": "至",
                      "start-placeholder": "开始日期",
                      "end-placeholder": "结束日期",
                      style: { "width": "280px" },
                      class: "rounded-md"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                createVNode$1(_component_el_form_item, {
                  label: "对比组数",
                  class: "mb-0"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_select, {
                      modelValue: $setup.filterGroups,
                      "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.filterGroups = $event),
                      placeholder: "选择组数",
                      class: "rounded-md"
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_option, {
                          label: "全部",
                          value: "all"
                        }),
                        createVNode$1(_component_el_option, {
                          label: "最近5组",
                          value: "5"
                        }),
                        createVNode$1(_component_el_option, {
                          label: "最近10组",
                          value: "10"
                        })
                      ]),
                      _: 1
                    }, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                createVNode$1(_component_el_form_item, { class: "mb-0" }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_button, {
                      type: "primary",
                      onClick: $setup.applyFilter,
                      class: "bg-blue-600 hover:bg-blue-700 border-blue-700 rounded-md"
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_icon, { class: "mr-1" }, {
                          default: withCtx(() => [
                            createVNode$1(_component_Search)
                          ]),
                          _: 1
                        }),
                        _cache[8] || (_cache[8] = createTextVNode(" 应用筛选 "))
                      ]),
                      _: 1
                    }, 8, ["onClick"]),
                    createVNode$1(_component_el_button, {
                      onClick: $setup.resetFilter,
                      class: "ml-2 rounded-md"
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_icon, { class: "mr-1" }, {
                          default: withCtx(() => [
                            createVNode$1(_component_RefreshRight)
                          ]),
                          _: 1
                        }),
                        _cache[9] || (_cache[9] = createTextVNode(" 重置 "))
                      ]),
                      _: 1
                    }, 8, ["onClick"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          createVNode$1(_component_el_tabs, {
            modelValue: $setup.activeTab,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.activeTab = $event),
            class: "border-b border-gray-200 custom-tabs"
          }, {
            default: withCtx(() => [
              createVNode$1(_component_el_tab_pane, {
                label: "粒径分布曲线",
                name: "curves"
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_6$5, [
                    _cache[11] || (_cache[11] = createBaseVNode("h3", { class: "text-blue-700 text-base font-semibold mb-3" }, "粒径分布曲线图", -1)),
                    createBaseVNode("div", _hoisted_7$5, null, 512)
                  ]),
                  createBaseVNode("div", _hoisted_8$5, [
                    createBaseVNode("div", _hoisted_9$5, [
                      _cache[12] || (_cache[12] = createBaseVNode("h4", { class: "text-blue-700 text-sm font-semibold mb-3" }, "数据组选择", -1)),
                      createBaseVNode("div", _hoisted_10$4, [
                        (openBlock(true), createElementBlock(Fragment, null, renderList($setup.groupData, (item) => {
                          return openBlock(), createBlock(_component_el_checkbox, {
                            key: item.group,
                            label: item.group,
                            class: "custom-checkbox"
                          }, {
                            default: withCtx(() => [
                              createTextVNode(" 第 " + toDisplayString(item.group) + " 组 [" + toDisplayString(item.range) + "] ", 1)
                            ]),
                            _: 2
                          }, 1032, ["label"]);
                        }), 128))
                      ])
                    ]),
                    createBaseVNode("div", _hoisted_11$3, [
                      _cache[16] || (_cache[16] = createBaseVNode("h4", { class: "text-blue-700 text-sm font-semibold mb-3" }, "显示模式", -1)),
                      createVNode$1(_component_el_radio_group, {
                        modelValue: $setup.curveDisplayMode,
                        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.curveDisplayMode = $event),
                        onChange: $setup.updateCurvesChart,
                        size: "default",
                        class: "custom-radio"
                      }, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_radio_button, { label: "original" }, {
                            default: withCtx(() => _cache[13] || (_cache[13] = [
                              createTextVNode("原始数据")
                            ])),
                            _: 1
                          }),
                          createVNode$1(_component_el_radio_button, { label: "mixed" }, {
                            default: withCtx(() => _cache[14] || (_cache[14] = [
                              createTextVNode("拟合曲线")
                            ])),
                            _: 1
                          }),
                          createVNode$1(_component_el_radio_button, { label: "combined" }, {
                            default: withCtx(() => _cache[15] || (_cache[15] = [
                              createTextVNode("全部组合")
                            ])),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue", "onChange"])
                    ])
                  ])
                ]),
                _: 1
              }),
              createVNode$1(_component_el_tab_pane, {
                label: "MX值对比",
                name: "mx"
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_12$3, [
                    _cache[17] || (_cache[17] = createBaseVNode("h3", { class: "text-blue-700 text-base font-semibold mb-3" }, "MX值对比图", -1)),
                    createBaseVNode("div", _hoisted_13$2, null, 512)
                  ]),
                  createBaseVNode("div", _hoisted_14$2, [
                    _cache[18] || (_cache[18] = createBaseVNode("h4", { class: "text-blue-700 text-base font-semibold mb-3" }, "MX值对比数据", -1)),
                    createVNode$1(_component_el_table, {
                      data: $setup.mxData,
                      border: "",
                      style: { "width": "100%" },
                      class: "custom-table rounded-lg overflow-hidden",
                      "header-cell-style": { background: "#EFF6FF", color: "#1D4ED8", fontWeight: "bold" },
                      "cell-style": { textAlign: "center" }
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_table_column, {
                          prop: "group",
                          label: "组别",
                          width: "100"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "screeningMx",
                          label: "筛分法MX"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "cameraMx",
                          label: "双相机MX"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "loss",
                          label: "Loss (%)"
                        })
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ])
                ]),
                _: 1
              }),
              createVNode$1(_component_el_tab_pane, {
                label: "粒径分布",
                name: "distribution"
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_15$2, [
                    _cache[19] || (_cache[19] = createBaseVNode("h3", { class: "text-blue-700 text-base font-semibold mb-3" }, "粒径分布对比图", -1)),
                    createBaseVNode("div", _hoisted_16$2, null, 512)
                  ]),
                  createBaseVNode("div", _hoisted_17$2, [
                    _cache[20] || (_cache[20] = createBaseVNode("h4", { class: "text-blue-700 text-base font-semibold mb-3" }, "粒径分布数据", -1)),
                    createVNode$1(_component_el_table, {
                      data: $setup.distributionData,
                      border: "",
                      style: { "width": "100%" },
                      class: "custom-table rounded-lg overflow-hidden",
                      "header-cell-style": { background: "#EFF6FF", color: "#1D4ED8", fontWeight: "bold" },
                      "cell-style": { textAlign: "center" }
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_table_column, {
                          prop: "range",
                          label: "粒径范围(mm)"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "screening",
                          label: "筛分法(%)"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "camera",
                          label: "双相机(%)"
                        })
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ])
                ]),
                _: 1
              }),
              createVNode$1(_component_el_tab_pane, {
                label: "误差分析",
                name: "error"
              }, {
                default: withCtx(() => [
                  createBaseVNode("div", _hoisted_18$2, [
                    _cache[21] || (_cache[21] = createBaseVNode("h3", { class: "text-blue-700 text-base font-semibold mb-3" }, "误差分析图", -1)),
                    createBaseVNode("div", _hoisted_19$2, null, 512)
                  ]),
                  createBaseVNode("div", _hoisted_20$2, [
                    _cache[22] || (_cache[22] = createBaseVNode("h4", { class: "text-blue-700 text-base font-semibold mb-3" }, "误差分析数据", -1)),
                    createVNode$1(_component_el_table, {
                      data: $setup.errorData,
                      border: "",
                      style: { "width": "100%" },
                      class: "custom-table rounded-lg overflow-hidden",
                      "header-cell-style": { background: "#EFF6FF", color: "#1D4ED8", fontWeight: "bold" },
                      "cell-style": { textAlign: "center" }
                    }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_table_column, {
                          prop: "range",
                          label: "粒径范围(mm)"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "totalError",
                          label: "总误差分类概率(%)"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "previousError",
                          label: "误差分类到前一个区间(%)"
                        }),
                        createVNode$1(_component_el_table_column, {
                          prop: "nextError",
                          label: "误差分类到后一个区间(%)"
                        })
                      ]),
                      _: 1
                    }, 8, ["data"])
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["modelValue"])
        ])
      ]);
    }
    const DataReport = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["render", _sfc_render$3], ["__scopeId", "data-v-b0f6474e"]]);
    /*!
     * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
     * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
     * Released under MIT License
     */
    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation.
    
    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.
    
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
    var extendStatics = function(d2, b2) {
      extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
        d3.__proto__ = b3;
      } || function(d3, b3) {
        for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2];
      };
      return extendStatics(d2, b2);
    };
    function __extends(d2, b2) {
      if (typeof b2 !== "function" && b2 !== null)
        throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
      extendStatics(d2, b2);
      function __() {
        this.constructor = d2;
      }
      d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
    }
    var __assign = function() {
      __assign = Object.assign || function __assign2(t) {
        for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
          s2 = arguments[i2];
          for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t[p2] = s2[p2];
        }
        return t;
      };
      return __assign.apply(this, arguments);
    };
    function __awaiter(thisArg, _arguments, P2, generator) {
      function adopt(value) {
        return value instanceof P2 ? value : new P2(function(resolve2) {
          resolve2(value);
        });
      }
      return new (P2 || (P2 = Promise))(function(resolve2, reject) {
        function fulfilled(value) {
          try {
            step(generator.next(value));
          } catch (e2) {
            reject(e2);
          }
        }
        function rejected(value) {
          try {
            step(generator["throw"](value));
          } catch (e2) {
            reject(e2);
          }
        }
        function step(result) {
          result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
        }
        step((generator = generator.apply(thisArg, [])).next());
      });
    }
    function __generator(thisArg, body) {
      var _2 = { label: 0, sent: function() {
        if (t[0] & 1) throw t[1];
        return t[1];
      }, trys: [], ops: [] }, f2, y, t, g;
      return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
        return this;
      }), g;
      function verb(n) {
        return function(v4) {
          return step([n, v4]);
        };
      }
      function step(op) {
        if (f2) throw new TypeError("Generator is already executing.");
        while (_2) try {
          if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
          if (y = 0, t) op = [op[0] & 2, t.value];
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
            case 4:
              _2.label++;
              return { value: op[1], done: false };
            case 5:
              _2.label++;
              y = op[1];
              op = [0];
              continue;
            case 7:
              op = _2.ops.pop();
              _2.trys.pop();
              continue;
            default:
              if (!(t = _2.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _2 = 0;
                continue;
              }
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _2.label = op[1];
                break;
              }
              if (op[0] === 6 && _2.label < t[1]) {
                _2.label = t[1];
                t = op;
                break;
              }
              if (t && _2.label < t[2]) {
                _2.label = t[2];
                _2.ops.push(op);
                break;
              }
              if (t[2]) _2.ops.pop();
              _2.trys.pop();
              continue;
          }
          op = body.call(thisArg, _2);
        } catch (e2) {
          op = [6, e2];
          y = 0;
        } finally {
          f2 = t = 0;
        }
        if (op[0] & 5) throw op[1];
        return { value: op[0] ? op[1] : void 0, done: true };
      }
    }
    function __spreadArray(to, from, pack2) {
      if (arguments.length === 2) for (var i2 = 0, l2 = from.length, ar; i2 < l2; i2++) {
        if (ar || !(i2 in from)) {
          if (!ar) ar = Array.prototype.slice.call(from, 0, i2);
          ar[i2] = from[i2];
        }
      }
      return to.concat(ar || from);
    }
    var Bounds = (
      /** @class */
      function() {
        function Bounds2(left, top, width, height) {
          this.left = left;
          this.top = top;
          this.width = width;
          this.height = height;
        }
        Bounds2.prototype.add = function(x2, y, w2, h2) {
          return new Bounds2(this.left + x2, this.top + y, this.width + w2, this.height + h2);
        };
        Bounds2.fromClientRect = function(context, clientRect) {
          return new Bounds2(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);
        };
        Bounds2.fromDOMRectList = function(context, domRectList) {
          var domRect = Array.from(domRectList).find(function(rect) {
            return rect.width !== 0;
          });
          return domRect ? new Bounds2(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height) : Bounds2.EMPTY;
        };
        Bounds2.EMPTY = new Bounds2(0, 0, 0, 0);
        return Bounds2;
      }()
    );
    var parseBounds = function(context, node) {
      return Bounds.fromClientRect(context, node.getBoundingClientRect());
    };
    var parseDocumentSize = function(document2) {
      var body = document2.body;
      var documentElement = document2.documentElement;
      if (!body || !documentElement) {
        throw new Error("Unable to get document size");
      }
      var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
      var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
      return new Bounds(0, 0, width, height);
    };
    var toCodePoints$1 = function(str) {
      var codePoints = [];
      var i2 = 0;
      var length = str.length;
      while (i2 < length) {
        var value = str.charCodeAt(i2++);
        if (value >= 55296 && value <= 56319 && i2 < length) {
          var extra = str.charCodeAt(i2++);
          if ((extra & 64512) === 56320) {
            codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536);
          } else {
            codePoints.push(value);
            i2--;
          }
        } else {
          codePoints.push(value);
        }
      }
      return codePoints;
    };
    var fromCodePoint$1 = function() {
      var codePoints = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        codePoints[_i] = arguments[_i];
      }
      if (String.fromCodePoint) {
        return String.fromCodePoint.apply(String, codePoints);
      }
      var length = codePoints.length;
      if (!length) {
        return "";
      }
      var codeUnits = [];
      var index = -1;
      var result = "";
      while (++index < length) {
        var codePoint = codePoints[index];
        if (codePoint <= 65535) {
          codeUnits.push(codePoint);
        } else {
          codePoint -= 65536;
          codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
        }
        if (index + 1 === length || codeUnits.length > 16384) {
          result += String.fromCharCode.apply(String, codeUnits);
          codeUnits.length = 0;
        }
      }
      return result;
    };
    var chars$2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var lookup$2 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
    for (var i$2 = 0; i$2 < chars$2.length; i$2++) {
      lookup$2[chars$2.charCodeAt(i$2)] = i$2;
    }
    var chars$1$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var lookup$1$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
    for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) {
      lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1;
    }
    var decode$1 = function(base642) {
      var bufferLength = base642.length * 0.75, len2 = base642.length, i2, p2 = 0, encoded1, encoded2, encoded3, encoded4;
      if (base642[base642.length - 1] === "=") {
        bufferLength--;
        if (base642[base642.length - 2] === "=") {
          bufferLength--;
        }
      }
      var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
      var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
      for (i2 = 0; i2 < len2; i2 += 4) {
        encoded1 = lookup$1$1[base642.charCodeAt(i2)];
        encoded2 = lookup$1$1[base642.charCodeAt(i2 + 1)];
        encoded3 = lookup$1$1[base642.charCodeAt(i2 + 2)];
        encoded4 = lookup$1$1[base642.charCodeAt(i2 + 3)];
        bytes[p2++] = encoded1 << 2 | encoded2 >> 4;
        bytes[p2++] = (encoded2 & 15) << 4 | encoded3 >> 2;
        bytes[p2++] = (encoded3 & 3) << 6 | encoded4 & 63;
      }
      return buffer;
    };
    var polyUint16Array$1 = function(buffer) {
      var length = buffer.length;
      var bytes = [];
      for (var i2 = 0; i2 < length; i2 += 2) {
        bytes.push(buffer[i2 + 1] << 8 | buffer[i2]);
      }
      return bytes;
    };
    var polyUint32Array$1 = function(buffer) {
      var length = buffer.length;
      var bytes = [];
      for (var i2 = 0; i2 < length; i2 += 4) {
        bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]);
      }
      return bytes;
    };
    var UTRIE2_SHIFT_2$1 = 5;
    var UTRIE2_SHIFT_1$1 = 6 + 5;
    var UTRIE2_INDEX_SHIFT$1 = 2;
    var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1;
    var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 65536 >> UTRIE2_SHIFT_2$1;
    var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1;
    var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1;
    var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 1024 >> UTRIE2_SHIFT_2$1;
    var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1;
    var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1;
    var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 2048 >> 6;
    var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1;
    var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 65536 >> UTRIE2_SHIFT_1$1;
    var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1;
    var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1;
    var slice16$1 = function(view, start2, end2) {
      if (view.slice) {
        return view.slice(start2, end2);
      }
      return new Uint16Array(Array.prototype.slice.call(view, start2, end2));
    };
    var slice32$1 = function(view, start2, end2) {
      if (view.slice) {
        return view.slice(start2, end2);
      }
      return new Uint32Array(Array.prototype.slice.call(view, start2, end2));
    };
    var createTrieFromBase64$1 = function(base642, _byteLength) {
      var buffer = decode$1(base642);
      var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer);
      var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer);
      var headerLength = 24;
      var index = slice16$1(view16, headerLength / 2, view32[4] / 2);
      var data = view32[5] === 2 ? slice16$1(view16, (headerLength + view32[4]) / 2) : slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4));
      return new Trie$1(view32[0], view32[1], view32[2], view32[3], index, data);
    };
    var Trie$1 = (
      /** @class */
      function() {
        function Trie2(initialValue, errorValue, highStart, highValueIndex, index, data) {
          this.initialValue = initialValue;
          this.errorValue = errorValue;
          this.highStart = highStart;
          this.highValueIndex = highValueIndex;
          this.index = index;
          this.data = data;
        }
        Trie2.prototype.get = function(codePoint) {
          var ix;
          if (codePoint >= 0) {
            if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
              ix = this.index[codePoint >> UTRIE2_SHIFT_2$1];
              ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
              return this.data[ix];
            }
            if (codePoint <= 65535) {
              ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + (codePoint - 55296 >> UTRIE2_SHIFT_2$1)];
              ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
              return this.data[ix];
            }
            if (codePoint < this.highStart) {
              ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1);
              ix = this.index[ix];
              ix += codePoint >> UTRIE2_SHIFT_2$1 & UTRIE2_INDEX_2_MASK$1;
              ix = this.index[ix];
              ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);
              return this.data[ix];
            }
            if (codePoint <= 1114111) {
              return this.data[this.highValueIndex];
            }
          }
          return this.errorValue;
        };
        return Trie2;
      }()
    );
    var chars$3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var lookup$3 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
    for (var i$3 = 0; i$3 < chars$3.length; i$3++) {
      lookup$3[chars$3.charCodeAt(i$3)] = i$3;
    }
    var base64$1 = " ";
    var LETTER_NUMBER_MODIFIER = 50;
    var BK = 1;
    var CR$1 = 2;
    var LF$1 = 3;
    var CM = 4;
    var NL = 5;
    var WJ = 7;
    var ZW = 8;
    var GL = 9;
    var SP = 10;
    var ZWJ$1 = 11;
    var B2 = 12;
    var BA = 13;
    var BB = 14;
    var HY = 15;
    var CB = 16;
    var CL = 17;
    var CP = 18;
    var EX = 19;
    var IN = 20;
    var NS = 21;
    var OP = 22;
    var QU = 23;
    var IS = 24;
    var NU = 25;
    var PO = 26;
    var PR = 27;
    var SY = 28;
    var AI = 29;
    var AL = 30;
    var CJ = 31;
    var EB = 32;
    var EM = 33;
    var H2 = 34;
    var H3 = 35;
    var HL = 36;
    var ID = 37;
    var JL = 38;
    var JV = 39;
    var JT = 40;
    var RI$1 = 41;
    var SA = 42;
    var XX = 43;
    var ea_OP = [9001, 65288];
    var BREAK_MANDATORY = "!";
    var BREAK_NOT_ALLOWED$1 = "×";
    var BREAK_ALLOWED$1 = "÷";
    var UnicodeTrie$1 = createTrieFromBase64$1(base64$1);
    var ALPHABETICS = [AL, HL];
    var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL];
    var SPACE$1 = [SP, ZW];
    var PREFIX_POSTFIX = [PR, PO];
    var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);
    var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
    var HYPHEN = [HY, BA];
    var codePointsToCharacterClasses = function(codePoints, lineBreak2) {
      if (lineBreak2 === void 0) {
        lineBreak2 = "strict";
      }
      var types2 = [];
      var indices = [];
      var categories = [];
      codePoints.forEach(function(codePoint, index) {
        var classType2 = UnicodeTrie$1.get(codePoint);
        if (classType2 > LETTER_NUMBER_MODIFIER) {
          categories.push(true);
          classType2 -= LETTER_NUMBER_MODIFIER;
        } else {
          categories.push(false);
        }
        if (["normal", "auto", "loose"].indexOf(lineBreak2) !== -1) {
          if ([8208, 8211, 12316, 12448].indexOf(codePoint) !== -1) {
            indices.push(index);
            return types2.push(CB);
          }
        }
        if (classType2 === CM || classType2 === ZWJ$1) {
          if (index === 0) {
            indices.push(index);
            return types2.push(AL);
          }
          var prev = types2[index - 1];
          if (LINE_BREAKS.indexOf(prev) === -1) {
            indices.push(indices[index - 1]);
            return types2.push(prev);
          }
          indices.push(index);
          return types2.push(AL);
        }
        indices.push(index);
        if (classType2 === CJ) {
          return types2.push(lineBreak2 === "strict" ? NS : ID);
        }
        if (classType2 === SA) {
          return types2.push(AL);
        }
        if (classType2 === AI) {
          return types2.push(AL);
        }
        if (classType2 === XX) {
          if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) {
            return types2.push(ID);
          } else {
            return types2.push(AL);
          }
        }
        types2.push(classType2);
      });
      return [indices, types2, categories];
    };
    var isAdjacentWithSpaceIgnored = function(a2, b2, currentIndex, classTypes) {
      var current = classTypes[currentIndex];
      if (Array.isArray(a2) ? a2.indexOf(current) !== -1 : a2 === current) {
        var i2 = currentIndex;
        while (i2 <= classTypes.length) {
          i2++;
          var next = classTypes[i2];
          if (next === b2) {
            return true;
          }
          if (next !== SP) {
            break;
          }
        }
      }
      if (current === SP) {
        var i2 = currentIndex;
        while (i2 > 0) {
          i2--;
          var prev = classTypes[i2];
          if (Array.isArray(a2) ? a2.indexOf(prev) !== -1 : a2 === prev) {
            var n = currentIndex;
            while (n <= classTypes.length) {
              n++;
              var next = classTypes[n];
              if (next === b2) {
                return true;
              }
              if (next !== SP) {
                break;
              }
            }
          }
          if (prev !== SP) {
            break;
          }
        }
      }
      return false;
    };
    var previousNonSpaceClassType = function(currentIndex, classTypes) {
      var i2 = currentIndex;
      while (i2 >= 0) {
        var type = classTypes[i2];
        if (type === SP) {
          i2--;
        } else {
          return type;
        }
      }
      return 0;
    };
    var _lineBreakAtIndex = function(codePoints, classTypes, indicies, index, forbiddenBreaks) {
      if (indicies[index] === 0) {
        return BREAK_NOT_ALLOWED$1;
      }
      var currentIndex = index - 1;
      if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {
        return BREAK_NOT_ALLOWED$1;
      }
      var beforeIndex = currentIndex - 1;
      var afterIndex = currentIndex + 1;
      var current = classTypes[currentIndex];
      var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;
      var next = classTypes[afterIndex];
      if (current === CR$1 && next === LF$1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (HARD_LINE_BREAKS.indexOf(current) !== -1) {
        return BREAK_MANDATORY;
      }
      if (HARD_LINE_BREAKS.indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (SPACE$1.indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {
        return BREAK_ALLOWED$1;
      }
      if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === WJ || next === WJ) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === GL) {
        return BREAK_NOT_ALLOWED$1;
      }
      if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {
        return BREAK_NOT_ALLOWED$1;
      }
      if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === SP) {
        return BREAK_ALLOWED$1;
      }
      if (current === QU || next === QU) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (next === CB || current === CB) {
        return BREAK_ALLOWED$1;
      }
      if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (before === HL && HYPHEN.indexOf(current) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === SY && next === HL) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (next === IN) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (
        // (PR | PO) × ( OP | HY )? NU
        [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) || // ( OP | HY ) × NU
        [OP, HY].indexOf(current) !== -1 && next === NU || // NU ×	(NU | SY | IS)
        current === NU && [NU, SY, IS].indexOf(next) !== -1
      ) {
        return BREAK_NOT_ALLOWED$1;
      }
      if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {
        var prevIndex = currentIndex;
        while (prevIndex >= 0) {
          var type = classTypes[prevIndex];
          if (type === NU) {
            return BREAK_NOT_ALLOWED$1;
          } else if ([SY, IS].indexOf(type) !== -1) {
            prevIndex--;
          } else {
            break;
          }
        }
      }
      if ([PR, PO].indexOf(next) !== -1) {
        var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;
        while (prevIndex >= 0) {
          var type = classTypes[prevIndex];
          if (type === NU) {
            return BREAK_NOT_ALLOWED$1;
          } else if ([SY, IS].indexOf(type) !== -1) {
            prevIndex--;
          } else {
            break;
          }
        }
      }
      if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === IS && ALPHABETICS.indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP && ea_OP.indexOf(codePoints[afterIndex]) === -1 || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) {
        return BREAK_NOT_ALLOWED$1;
      }
      if (current === RI$1 && next === RI$1) {
        var i2 = indicies[currentIndex];
        var count2 = 1;
        while (i2 > 0) {
          i2--;
          if (classTypes[i2] === RI$1) {
            count2++;
          } else {
            break;
          }
        }
        if (count2 % 2 !== 0) {
          return BREAK_NOT_ALLOWED$1;
        }
      }
      if (current === EB && next === EM) {
        return BREAK_NOT_ALLOWED$1;
      }
      return BREAK_ALLOWED$1;
    };
    var cssFormattedClasses = function(codePoints, options) {
      if (!options) {
        options = { lineBreak: "normal", wordBreak: "normal" };
      }
      var _a2 = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a2[0], classTypes = _a2[1], isLetterNumber = _a2[2];
      if (options.wordBreak === "break-all" || options.wordBreak === "break-word") {
        classTypes = classTypes.map(function(type) {
          return [NU, AL, SA].indexOf(type) !== -1 ? ID : type;
        });
      }
      var forbiddenBreakpoints = options.wordBreak === "keep-all" ? isLetterNumber.map(function(letterNumber, i2) {
        return letterNumber && codePoints[i2] >= 19968 && codePoints[i2] <= 40959;
      }) : void 0;
      return [indicies, classTypes, forbiddenBreakpoints];
    };
    var Break = (
      /** @class */
      function() {
        function Break2(codePoints, lineBreak2, start2, end2) {
          this.codePoints = codePoints;
          this.required = lineBreak2 === BREAK_MANDATORY;
          this.start = start2;
          this.end = end2;
        }
        Break2.prototype.slice = function() {
          return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));
        };
        return Break2;
      }()
    );
    var LineBreaker = function(str, options) {
      var codePoints = toCodePoints$1(str);
      var _a2 = cssFormattedClasses(codePoints, options), indicies = _a2[0], classTypes = _a2[1], forbiddenBreakpoints = _a2[2];
      var length = codePoints.length;
      var lastEnd = 0;
      var nextIndex = 0;
      return {
        next: function() {
          if (nextIndex >= length) {
            return { done: true, value: null };
          }
          var lineBreak2 = BREAK_NOT_ALLOWED$1;
          while (nextIndex < length && (lineBreak2 = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED$1) {
          }
          if (lineBreak2 !== BREAK_NOT_ALLOWED$1 || nextIndex === length) {
            var value = new Break(codePoints, lineBreak2, lastEnd, nextIndex);
            lastEnd = nextIndex;
            return { value, done: false };
          }
          return { done: true, value: null };
        }
      };
    };
    var FLAG_UNRESTRICTED = 1 << 0;
    var FLAG_ID = 1 << 1;
    var FLAG_INTEGER = 1 << 2;
    var FLAG_NUMBER = 1 << 3;
    var LINE_FEED = 10;
    var SOLIDUS = 47;
    var REVERSE_SOLIDUS = 92;
    var CHARACTER_TABULATION = 9;
    var SPACE = 32;
    var QUOTATION_MARK = 34;
    var EQUALS_SIGN = 61;
    var NUMBER_SIGN = 35;
    var DOLLAR_SIGN = 36;
    var PERCENTAGE_SIGN = 37;
    var APOSTROPHE = 39;
    var LEFT_PARENTHESIS = 40;
    var RIGHT_PARENTHESIS = 41;
    var LOW_LINE = 95;
    var HYPHEN_MINUS = 45;
    var EXCLAMATION_MARK = 33;
    var LESS_THAN_SIGN = 60;
    var GREATER_THAN_SIGN = 62;
    var COMMERCIAL_AT = 64;
    var LEFT_SQUARE_BRACKET = 91;
    var RIGHT_SQUARE_BRACKET = 93;
    var CIRCUMFLEX_ACCENT = 61;
    var LEFT_CURLY_BRACKET = 123;
    var QUESTION_MARK = 63;
    var RIGHT_CURLY_BRACKET = 125;
    var VERTICAL_LINE = 124;
    var TILDE = 126;
    var CONTROL = 128;
    var REPLACEMENT_CHARACTER = 65533;
    var ASTERISK = 42;
    var PLUS_SIGN = 43;
    var COMMA = 44;
    var COLON = 58;
    var SEMICOLON = 59;
    var FULL_STOP = 46;
    var NULL = 0;
    var BACKSPACE = 8;
    var LINE_TABULATION = 11;
    var SHIFT_OUT = 14;
    var INFORMATION_SEPARATOR_ONE = 31;
    var DELETE = 127;
    var EOF = -1;
    var ZERO = 48;
    var a = 97;
    var e = 101;
    var f = 102;
    var u = 117;
    var z = 122;
    var A = 65;
    var E = 69;
    var F = 70;
    var U = 85;
    var Z = 90;
    var isDigit = function(codePoint) {
      return codePoint >= ZERO && codePoint <= 57;
    };
    var isSurrogateCodePoint = function(codePoint) {
      return codePoint >= 55296 && codePoint <= 57343;
    };
    var isHex = function(codePoint) {
      return isDigit(codePoint) || codePoint >= A && codePoint <= F || codePoint >= a && codePoint <= f;
    };
    var isLowerCaseLetter = function(codePoint) {
      return codePoint >= a && codePoint <= z;
    };
    var isUpperCaseLetter = function(codePoint) {
      return codePoint >= A && codePoint <= Z;
    };
    var isLetter = function(codePoint) {
      return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint);
    };
    var isNonASCIICodePoint = function(codePoint) {
      return codePoint >= CONTROL;
    };
    var isWhiteSpace = function(codePoint) {
      return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;
    };
    var isNameStartCodePoint = function(codePoint) {
      return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;
    };
    var isNameCodePoint = function(codePoint) {
      return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;
    };
    var isNonPrintableCodePoint = function(codePoint) {
      return codePoint >= NULL && codePoint <= BACKSPACE || codePoint === LINE_TABULATION || codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE || codePoint === DELETE;
    };
    var isValidEscape = function(c1, c2) {
      if (c1 !== REVERSE_SOLIDUS) {
        return false;
      }
      return c2 !== LINE_FEED;
    };
    var isIdentifierStart = function(c1, c2, c3) {
      if (c1 === HYPHEN_MINUS) {
        return isNameStartCodePoint(c2) || isValidEscape(c2, c3);
      } else if (isNameStartCodePoint(c1)) {
        return true;
      } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {
        return true;
      }
      return false;
    };
    var isNumberStart = function(c1, c2, c3) {
      if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
        if (isDigit(c2)) {
          return true;
        }
        return c2 === FULL_STOP && isDigit(c3);
      }
      if (c1 === FULL_STOP) {
        return isDigit(c2);
      }
      return isDigit(c1);
    };
    var stringToNumber = function(codePoints) {
      var c2 = 0;
      var sign = 1;
      if (codePoints[c2] === PLUS_SIGN || codePoints[c2] === HYPHEN_MINUS) {
        if (codePoints[c2] === HYPHEN_MINUS) {
          sign = -1;
        }
        c2++;
      }
      var integers = [];
      while (isDigit(codePoints[c2])) {
        integers.push(codePoints[c2++]);
      }
      var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;
      if (codePoints[c2] === FULL_STOP) {
        c2++;
      }
      var fraction = [];
      while (isDigit(codePoints[c2])) {
        fraction.push(codePoints[c2++]);
      }
      var fracd = fraction.length;
      var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
      if (codePoints[c2] === E || codePoints[c2] === e) {
        c2++;
      }
      var expsign = 1;
      if (codePoints[c2] === PLUS_SIGN || codePoints[c2] === HYPHEN_MINUS) {
        if (codePoints[c2] === HYPHEN_MINUS) {
          expsign = -1;
        }
        c2++;
      }
      var exponent = [];
      while (isDigit(codePoints[c2])) {
        exponent.push(codePoints[c2++]);
      }
      var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0;
      return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);
    };
    var LEFT_PARENTHESIS_TOKEN = {
      type: 2
      /* LEFT_PARENTHESIS_TOKEN */
    };
    var RIGHT_PARENTHESIS_TOKEN = {
      type: 3
      /* RIGHT_PARENTHESIS_TOKEN */
    };
    var COMMA_TOKEN = {
      type: 4
      /* COMMA_TOKEN */
    };
    var SUFFIX_MATCH_TOKEN = {
      type: 13
      /* SUFFIX_MATCH_TOKEN */
    };
    var PREFIX_MATCH_TOKEN = {
      type: 8
      /* PREFIX_MATCH_TOKEN */
    };
    var COLUMN_TOKEN = {
      type: 21
      /* COLUMN_TOKEN */
    };
    var DASH_MATCH_TOKEN = {
      type: 9
      /* DASH_MATCH_TOKEN */
    };
    var INCLUDE_MATCH_TOKEN = {
      type: 10
      /* INCLUDE_MATCH_TOKEN */
    };
    var LEFT_CURLY_BRACKET_TOKEN = {
      type: 11
      /* LEFT_CURLY_BRACKET_TOKEN */
    };
    var RIGHT_CURLY_BRACKET_TOKEN = {
      type: 12
      /* RIGHT_CURLY_BRACKET_TOKEN */
    };
    var SUBSTRING_MATCH_TOKEN = {
      type: 14
      /* SUBSTRING_MATCH_TOKEN */
    };
    var BAD_URL_TOKEN = {
      type: 23
      /* BAD_URL_TOKEN */
    };
    var BAD_STRING_TOKEN = {
      type: 1
      /* BAD_STRING_TOKEN */
    };
    var CDO_TOKEN = {
      type: 25
      /* CDO_TOKEN */
    };
    var CDC_TOKEN = {
      type: 24
      /* CDC_TOKEN */
    };
    var COLON_TOKEN = {
      type: 26
      /* COLON_TOKEN */
    };
    var SEMICOLON_TOKEN = {
      type: 27
      /* SEMICOLON_TOKEN */
    };
    var LEFT_SQUARE_BRACKET_TOKEN = {
      type: 28
      /* LEFT_SQUARE_BRACKET_TOKEN */
    };
    var RIGHT_SQUARE_BRACKET_TOKEN = {
      type: 29
      /* RIGHT_SQUARE_BRACKET_TOKEN */
    };
    var WHITESPACE_TOKEN = {
      type: 31
      /* WHITESPACE_TOKEN */
    };
    var EOF_TOKEN = {
      type: 32
      /* EOF_TOKEN */
    };
    var Tokenizer = (
      /** @class */
      function() {
        function Tokenizer2() {
          this._value = [];
        }
        Tokenizer2.prototype.write = function(chunk) {
          this._value = this._value.concat(toCodePoints$1(chunk));
        };
        Tokenizer2.prototype.read = function() {
          var tokens = [];
          var token = this.consumeToken();
          while (token !== EOF_TOKEN) {
            tokens.push(token);
            token = this.consumeToken();
          }
          return tokens;
        };
        Tokenizer2.prototype.consumeToken = function() {
          var codePoint = this.consumeCodePoint();
          switch (codePoint) {
            case QUOTATION_MARK:
              return this.consumeStringToken(QUOTATION_MARK);
            case NUMBER_SIGN:
              var c1 = this.peekCodePoint(0);
              var c2 = this.peekCodePoint(1);
              var c3 = this.peekCodePoint(2);
              if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {
                var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;
                var value = this.consumeName();
                return { type: 5, value, flags };
              }
              break;
            case DOLLAR_SIGN:
              if (this.peekCodePoint(0) === EQUALS_SIGN) {
                this.consumeCodePoint();
                return SUFFIX_MATCH_TOKEN;
              }
              break;
            case APOSTROPHE:
              return this.consumeStringToken(APOSTROPHE);
            case LEFT_PARENTHESIS:
              return LEFT_PARENTHESIS_TOKEN;
            case RIGHT_PARENTHESIS:
              return RIGHT_PARENTHESIS_TOKEN;
            case ASTERISK:
              if (this.peekCodePoint(0) === EQUALS_SIGN) {
                this.consumeCodePoint();
                return SUBSTRING_MATCH_TOKEN;
              }
              break;
            case PLUS_SIGN:
              if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
                this.reconsumeCodePoint(codePoint);
                return this.consumeNumericToken();
              }
              break;
            case COMMA:
              return COMMA_TOKEN;
            case HYPHEN_MINUS:
              var e1 = codePoint;
              var e2 = this.peekCodePoint(0);
              var e3 = this.peekCodePoint(1);
              if (isNumberStart(e1, e2, e3)) {
                this.reconsumeCodePoint(codePoint);
                return this.consumeNumericToken();
              }
              if (isIdentifierStart(e1, e2, e3)) {
                this.reconsumeCodePoint(codePoint);
                return this.consumeIdentLikeToken();
              }
              if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {
                this.consumeCodePoint();
                this.consumeCodePoint();
                return CDC_TOKEN;
              }
              break;
            case FULL_STOP:
              if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {
                this.reconsumeCodePoint(codePoint);
                return this.consumeNumericToken();
              }
              break;
            case SOLIDUS:
              if (this.peekCodePoint(0) === ASTERISK) {
                this.consumeCodePoint();
                while (true) {
                  var c4 = this.consumeCodePoint();
                  if (c4 === ASTERISK) {
                    c4 = this.consumeCodePoint();
                    if (c4 === SOLIDUS) {
                      return this.consumeToken();
                    }
                  }
                  if (c4 === EOF) {
                    return this.consumeToken();
                  }
                }
              }
              break;
            case COLON:
              return COLON_TOKEN;
            case SEMICOLON:
              return SEMICOLON_TOKEN;
            case LESS_THAN_SIGN:
              if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS) {
                this.consumeCodePoint();
                this.consumeCodePoint();
                return CDO_TOKEN;
              }
              break;
            case COMMERCIAL_AT:
              var a1 = this.peekCodePoint(0);
              var a2 = this.peekCodePoint(1);
              var a3 = this.peekCodePoint(2);
              if (isIdentifierStart(a1, a2, a3)) {
                var value = this.consumeName();
                return { type: 7, value };
              }
              break;
            case LEFT_SQUARE_BRACKET:
              return LEFT_SQUARE_BRACKET_TOKEN;
            case REVERSE_SOLIDUS:
              if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                this.reconsumeCodePoint(codePoint);
                return this.consumeIdentLikeToken();
              }
              break;
            case RIGHT_SQUARE_BRACKET:
              return RIGHT_SQUARE_BRACKET_TOKEN;
            case CIRCUMFLEX_ACCENT:
              if (this.peekCodePoint(0) === EQUALS_SIGN) {
                this.consumeCodePoint();
                return PREFIX_MATCH_TOKEN;
              }
              break;
            case LEFT_CURLY_BRACKET:
              return LEFT_CURLY_BRACKET_TOKEN;
            case RIGHT_CURLY_BRACKET:
              return RIGHT_CURLY_BRACKET_TOKEN;
            case u:
            case U:
              var u1 = this.peekCodePoint(0);
              var u2 = this.peekCodePoint(1);
              if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {
                this.consumeCodePoint();
                this.consumeUnicodeRangeToken();
              }
              this.reconsumeCodePoint(codePoint);
              return this.consumeIdentLikeToken();
            case VERTICAL_LINE:
              if (this.peekCodePoint(0) === EQUALS_SIGN) {
                this.consumeCodePoint();
                return DASH_MATCH_TOKEN;
              }
              if (this.peekCodePoint(0) === VERTICAL_LINE) {
                this.consumeCodePoint();
                return COLUMN_TOKEN;
              }
              break;
            case TILDE:
              if (this.peekCodePoint(0) === EQUALS_SIGN) {
                this.consumeCodePoint();
                return INCLUDE_MATCH_TOKEN;
              }
              break;
            case EOF:
              return EOF_TOKEN;
          }
          if (isWhiteSpace(codePoint)) {
            this.consumeWhiteSpace();
            return WHITESPACE_TOKEN;
          }
          if (isDigit(codePoint)) {
            this.reconsumeCodePoint(codePoint);
            return this.consumeNumericToken();
          }
          if (isNameStartCodePoint(codePoint)) {
            this.reconsumeCodePoint(codePoint);
            return this.consumeIdentLikeToken();
          }
          return { type: 6, value: fromCodePoint$1(codePoint) };
        };
        Tokenizer2.prototype.consumeCodePoint = function() {
          var value = this._value.shift();
          return typeof value === "undefined" ? -1 : value;
        };
        Tokenizer2.prototype.reconsumeCodePoint = function(codePoint) {
          this._value.unshift(codePoint);
        };
        Tokenizer2.prototype.peekCodePoint = function(delta) {
          if (delta >= this._value.length) {
            return -1;
          }
          return this._value[delta];
        };
        Tokenizer2.prototype.consumeUnicodeRangeToken = function() {
          var digits = [];
          var codePoint = this.consumeCodePoint();
          while (isHex(codePoint) && digits.length < 6) {
            digits.push(codePoint);
            codePoint = this.consumeCodePoint();
          }
          var questionMarks = false;
          while (codePoint === QUESTION_MARK && digits.length < 6) {
            digits.push(codePoint);
            codePoint = this.consumeCodePoint();
            questionMarks = true;
          }
          if (questionMarks) {
            var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
              return digit === QUESTION_MARK ? ZERO : digit;
            })), 16);
            var end2 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) {
              return digit === QUESTION_MARK ? F : digit;
            })), 16);
            return { type: 30, start: start_1, end: end2 };
          }
          var start2 = parseInt(fromCodePoint$1.apply(void 0, digits), 16);
          if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
            this.consumeCodePoint();
            codePoint = this.consumeCodePoint();
            var endDigits = [];
            while (isHex(codePoint) && endDigits.length < 6) {
              endDigits.push(codePoint);
              codePoint = this.consumeCodePoint();
            }
            var end2 = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);
            return { type: 30, start: start2, end: end2 };
          } else {
            return { type: 30, start: start2, end: start2 };
          }
        };
        Tokenizer2.prototype.consumeIdentLikeToken = function() {
          var value = this.consumeName();
          if (value.toLowerCase() === "url" && this.peekCodePoint(0) === LEFT_PARENTHESIS) {
            this.consumeCodePoint();
            return this.consumeUrlToken();
          } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {
            this.consumeCodePoint();
            return { type: 19, value };
          }
          return { type: 20, value };
        };
        Tokenizer2.prototype.consumeUrlToken = function() {
          var value = [];
          this.consumeWhiteSpace();
          if (this.peekCodePoint(0) === EOF) {
            return { type: 22, value: "" };
          }
          var next = this.peekCodePoint(0);
          if (next === APOSTROPHE || next === QUOTATION_MARK) {
            var stringToken = this.consumeStringToken(this.consumeCodePoint());
            if (stringToken.type === 0) {
              this.consumeWhiteSpace();
              if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
                this.consumeCodePoint();
                return { type: 22, value: stringToken.value };
              }
            }
            this.consumeBadUrlRemnants();
            return BAD_URL_TOKEN;
          }
          while (true) {
            var codePoint = this.consumeCodePoint();
            if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
              return { type: 22, value: fromCodePoint$1.apply(void 0, value) };
            } else if (isWhiteSpace(codePoint)) {
              this.consumeWhiteSpace();
              if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
                this.consumeCodePoint();
                return { type: 22, value: fromCodePoint$1.apply(void 0, value) };
              }
              this.consumeBadUrlRemnants();
              return BAD_URL_TOKEN;
            } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) {
              this.consumeBadUrlRemnants();
              return BAD_URL_TOKEN;
            } else if (codePoint === REVERSE_SOLIDUS) {
              if (isValidEscape(codePoint, this.peekCodePoint(0))) {
                value.push(this.consumeEscapedCodePoint());
              } else {
                this.consumeBadUrlRemnants();
                return BAD_URL_TOKEN;
              }
            } else {
              value.push(codePoint);
            }
          }
        };
        Tokenizer2.prototype.consumeWhiteSpace = function() {
          while (isWhiteSpace(this.peekCodePoint(0))) {
            this.consumeCodePoint();
          }
        };
        Tokenizer2.prototype.consumeBadUrlRemnants = function() {
          while (true) {
            var codePoint = this.consumeCodePoint();
            if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {
              return;
            }
            if (isValidEscape(codePoint, this.peekCodePoint(0))) {
              this.consumeEscapedCodePoint();
            }
          }
        };
        Tokenizer2.prototype.consumeStringSlice = function(count2) {
          var SLICE_STACK_SIZE = 5e4;
          var value = "";
          while (count2 > 0) {
            var amount = Math.min(SLICE_STACK_SIZE, count2);
            value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));
            count2 -= amount;
          }
          this._value.shift();
          return value;
        };
        Tokenizer2.prototype.consumeStringToken = function(endingCodePoint) {
          var value = "";
          var i2 = 0;
          do {
            var codePoint = this._value[i2];
            if (codePoint === EOF || codePoint === void 0 || codePoint === endingCodePoint) {
              value += this.consumeStringSlice(i2);
              return { type: 0, value };
            }
            if (codePoint === LINE_FEED) {
              this._value.splice(0, i2);
              return BAD_STRING_TOKEN;
            }
            if (codePoint === REVERSE_SOLIDUS) {
              var next = this._value[i2 + 1];
              if (next !== EOF && next !== void 0) {
                if (next === LINE_FEED) {
                  value += this.consumeStringSlice(i2);
                  i2 = -1;
                  this._value.shift();
                } else if (isValidEscape(codePoint, next)) {
                  value += this.consumeStringSlice(i2);
                  value += fromCodePoint$1(this.consumeEscapedCodePoint());
                  i2 = -1;
                }
              }
            }
            i2++;
          } while (true);
        };
        Tokenizer2.prototype.consumeNumber = function() {
          var repr = [];
          var type = FLAG_INTEGER;
          var c1 = this.peekCodePoint(0);
          if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {
            repr.push(this.consumeCodePoint());
          }
          while (isDigit(this.peekCodePoint(0))) {
            repr.push(this.consumeCodePoint());
          }
          c1 = this.peekCodePoint(0);
          var c2 = this.peekCodePoint(1);
          if (c1 === FULL_STOP && isDigit(c2)) {
            repr.push(this.consumeCodePoint(), this.consumeCodePoint());
            type = FLAG_NUMBER;
            while (isDigit(this.peekCodePoint(0))) {
              repr.push(this.consumeCodePoint());
            }
          }
          c1 = this.peekCodePoint(0);
          c2 = this.peekCodePoint(1);
          var c3 = this.peekCodePoint(2);
          if ((c1 === E || c1 === e) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) {
            repr.push(this.consumeCodePoint(), this.consumeCodePoint());
            type = FLAG_NUMBER;
            while (isDigit(this.peekCodePoint(0))) {
              repr.push(this.consumeCodePoint());
            }
          }
          return [stringToNumber(repr), type];
        };
        Tokenizer2.prototype.consumeNumericToken = function() {
          var _a2 = this.consumeNumber(), number = _a2[0], flags = _a2[1];
          var c1 = this.peekCodePoint(0);
          var c2 = this.peekCodePoint(1);
          var c3 = this.peekCodePoint(2);
          if (isIdentifierStart(c1, c2, c3)) {
            var unit2 = this.consumeName();
            return { type: 15, number, flags, unit: unit2 };
          }
          if (c1 === PERCENTAGE_SIGN) {
            this.consumeCodePoint();
            return { type: 16, number, flags };
          }
          return { type: 17, number, flags };
        };
        Tokenizer2.prototype.consumeEscapedCodePoint = function() {
          var codePoint = this.consumeCodePoint();
          if (isHex(codePoint)) {
            var hex = fromCodePoint$1(codePoint);
            while (isHex(this.peekCodePoint(0)) && hex.length < 6) {
              hex += fromCodePoint$1(this.consumeCodePoint());
            }
            if (isWhiteSpace(this.peekCodePoint(0))) {
              this.consumeCodePoint();
            }
            var hexCodePoint = parseInt(hex, 16);
            if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 1114111) {
              return REPLACEMENT_CHARACTER;
            }
            return hexCodePoint;
          }
          if (codePoint === EOF) {
            return REPLACEMENT_CHARACTER;
          }
          return codePoint;
        };
        Tokenizer2.prototype.consumeName = function() {
          var result = "";
          while (true) {
            var codePoint = this.consumeCodePoint();
            if (isNameCodePoint(codePoint)) {
              result += fromCodePoint$1(codePoint);
            } else if (isValidEscape(codePoint, this.peekCodePoint(0))) {
              result += fromCodePoint$1(this.consumeEscapedCodePoint());
            } else {
              this.reconsumeCodePoint(codePoint);
              return result;
            }
          }
        };
        return Tokenizer2;
      }()
    );
    var Parser = (
      /** @class */
      function() {
        function Parser2(tokens) {
          this._tokens = tokens;
        }
        Parser2.create = function(value) {
          var tokenizer = new Tokenizer();
          tokenizer.write(value);
          return new Parser2(tokenizer.read());
        };
        Parser2.parseValue = function(value) {
          return Parser2.create(value).parseComponentValue();
        };
        Parser2.parseValues = function(value) {
          return Parser2.create(value).parseComponentValues();
        };
        Parser2.prototype.parseComponentValue = function() {
          var token = this.consumeToken();
          while (token.type === 31) {
            token = this.consumeToken();
          }
          if (token.type === 32) {
            throw new SyntaxError("Error parsing CSS component value, unexpected EOF");
          }
          this.reconsumeToken(token);
          var value = this.consumeComponentValue();
          do {
            token = this.consumeToken();
          } while (token.type === 31);
          if (token.type === 32) {
            return value;
          }
          throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one");
        };
        Parser2.prototype.parseComponentValues = function() {
          var values = [];
          while (true) {
            var value = this.consumeComponentValue();
            if (value.type === 32) {
              return values;
            }
            values.push(value);
            values.push();
          }
        };
        Parser2.prototype.consumeComponentValue = function() {
          var token = this.consumeToken();
          switch (token.type) {
            case 11:
            case 28:
            case 2:
              return this.consumeSimpleBlock(token.type);
            case 19:
              return this.consumeFunction(token);
          }
          return token;
        };
        Parser2.prototype.consumeSimpleBlock = function(type) {
          var block = { type, values: [] };
          var token = this.consumeToken();
          while (true) {
            if (token.type === 32 || isEndingTokenFor(token, type)) {
              return block;
            }
            this.reconsumeToken(token);
            block.values.push(this.consumeComponentValue());
            token = this.consumeToken();
          }
        };
        Parser2.prototype.consumeFunction = function(functionToken) {
          var cssFunction = {
            name: functionToken.value,
            values: [],
            type: 18
            /* FUNCTION */
          };
          while (true) {
            var token = this.consumeToken();
            if (token.type === 32 || token.type === 3) {
              return cssFunction;
            }
            this.reconsumeToken(token);
            cssFunction.values.push(this.consumeComponentValue());
          }
        };
        Parser2.prototype.consumeToken = function() {
          var token = this._tokens.shift();
          return typeof token === "undefined" ? EOF_TOKEN : token;
        };
        Parser2.prototype.reconsumeToken = function(token) {
          this._tokens.unshift(token);
        };
        return Parser2;
      }()
    );
    var isDimensionToken = function(token) {
      return token.type === 15;
    };
    var isNumberToken = function(token) {
      return token.type === 17;
    };
    var isIdentToken = function(token) {
      return token.type === 20;
    };
    var isStringToken = function(token) {
      return token.type === 0;
    };
    var isIdentWithValue = function(token, value) {
      return isIdentToken(token) && token.value === value;
    };
    var nonWhiteSpace = function(token) {
      return token.type !== 31;
    };
    var nonFunctionArgSeparator = function(token) {
      return token.type !== 31 && token.type !== 4;
    };
    var parseFunctionArgs = function(tokens) {
      var args = [];
      var arg = [];
      tokens.forEach(function(token) {
        if (token.type === 4) {
          if (arg.length === 0) {
            throw new Error("Error parsing function args, zero tokens for arg");
          }
          args.push(arg);
          arg = [];
          return;
        }
        if (token.type !== 31) {
          arg.push(token);
        }
      });
      if (arg.length) {
        args.push(arg);
      }
      return args;
    };
    var isEndingTokenFor = function(token, type) {
      if (type === 11 && token.type === 12) {
        return true;
      }
      if (type === 28 && token.type === 29) {
        return true;
      }
      return type === 2 && token.type === 3;
    };
    var isLength = function(token) {
      return token.type === 17 || token.type === 15;
    };
    var isLengthPercentage = function(token) {
      return token.type === 16 || isLength(token);
    };
    var parseLengthPercentageTuple = function(tokens) {
      return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];
    };
    var ZERO_LENGTH = {
      type: 17,
      number: 0,
      flags: FLAG_INTEGER
    };
    var FIFTY_PERCENT = {
      type: 16,
      number: 50,
      flags: FLAG_INTEGER
    };
    var HUNDRED_PERCENT = {
      type: 16,
      number: 100,
      flags: FLAG_INTEGER
    };
    var getAbsoluteValueForTuple = function(tuple, width, height) {
      var x2 = tuple[0], y = tuple[1];
      return [getAbsoluteValue(x2, width), getAbsoluteValue(typeof y !== "undefined" ? y : x2, height)];
    };
    var getAbsoluteValue = function(token, parent2) {
      if (token.type === 16) {
        return token.number / 100 * parent2;
      }
      if (isDimensionToken(token)) {
        switch (token.unit) {
          case "rem":
          case "em":
            return 16 * token.number;
          // TODO use correct font-size
          case "px":
          default:
            return token.number;
        }
      }
      return token.number;
    };
    var DEG = "deg";
    var GRAD = "grad";
    var RAD = "rad";
    var TURN = "turn";
    var angle = {
      name: "angle",
      parse: function(_context, value) {
        if (value.type === 15) {
          switch (value.unit) {
            case DEG:
              return Math.PI * value.number / 180;
            case GRAD:
              return Math.PI / 200 * value.number;
            case RAD:
              return value.number;
            case TURN:
              return Math.PI * 2 * value.number;
          }
        }
        throw new Error("Unsupported angle type");
      }
    };
    var isAngle = function(value) {
      if (value.type === 15) {
        if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {
          return true;
        }
      }
      return false;
    };
    var parseNamedSide = function(tokens) {
      var sideOrCorner = tokens.filter(isIdentToken).map(function(ident) {
        return ident.value;
      }).join(" ");
      switch (sideOrCorner) {
        case "to bottom right":
        case "to right bottom":
        case "left top":
        case "top left":
          return [ZERO_LENGTH, ZERO_LENGTH];
        case "to top":
        case "bottom":
          return deg(0);
        case "to bottom left":
        case "to left bottom":
        case "right top":
        case "top right":
          return [ZERO_LENGTH, HUNDRED_PERCENT];
        case "to right":
        case "left":
          return deg(90);
        case "to top left":
        case "to left top":
        case "right bottom":
        case "bottom right":
          return [HUNDRED_PERCENT, HUNDRED_PERCENT];
        case "to bottom":
        case "top":
          return deg(180);
        case "to top right":
        case "to right top":
        case "left bottom":
        case "bottom left":
          return [HUNDRED_PERCENT, ZERO_LENGTH];
        case "to left":
        case "right":
          return deg(270);
      }
      return 0;
    };
    var deg = function(deg2) {
      return Math.PI * deg2 / 180;
    };
    var color$1 = {
      name: "color",
      parse: function(context, value) {
        if (value.type === 18) {
          var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];
          if (typeof colorFunction === "undefined") {
            throw new Error('Attempting to parse an unsupported color function "' + value.name + '"');
          }
          return colorFunction(context, value.values);
        }
        if (value.type === 5) {
          if (value.value.length === 3) {
            var r = value.value.substring(0, 1);
            var g = value.value.substring(1, 2);
            var b2 = value.value.substring(2, 3);
            return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b2 + b2, 16), 1);
          }
          if (value.value.length === 4) {
            var r = value.value.substring(0, 1);
            var g = value.value.substring(1, 2);
            var b2 = value.value.substring(2, 3);
            var a2 = value.value.substring(3, 4);
            return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b2 + b2, 16), parseInt(a2 + a2, 16) / 255);
          }
          if (value.value.length === 6) {
            var r = value.value.substring(0, 2);
            var g = value.value.substring(2, 4);
            var b2 = value.value.substring(4, 6);
            return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b2, 16), 1);
          }
          if (value.value.length === 8) {
            var r = value.value.substring(0, 2);
            var g = value.value.substring(2, 4);
            var b2 = value.value.substring(4, 6);
            var a2 = value.value.substring(6, 8);
            return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b2, 16), parseInt(a2, 16) / 255);
          }
        }
        if (value.type === 20) {
          var namedColor = COLORS[value.value.toUpperCase()];
          if (typeof namedColor !== "undefined") {
            return namedColor;
          }
        }
        return COLORS.TRANSPARENT;
      }
    };
    var isTransparent = function(color2) {
      return (255 & color2) === 0;
    };
    var asString = function(color2) {
      var alpha = 255 & color2;
      var blue = 255 & color2 >> 8;
      var green = 255 & color2 >> 16;
      var red = 255 & color2 >> 24;
      return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")";
    };
    var pack = function(r, g, b2, a2) {
      return (r << 24 | g << 16 | b2 << 8 | Math.round(a2 * 255) << 0) >>> 0;
    };
    var getTokenColorValue = function(token, i2) {
      if (token.type === 17) {
        return token.number;
      }
      if (token.type === 16) {
        var max3 = i2 === 3 ? 1 : 255;
        return i2 === 3 ? token.number / 100 * max3 : Math.round(token.number / 100 * max3);
      }
      return 0;
    };
    var rgb = function(_context, args) {
      var tokens = args.filter(nonFunctionArgSeparator);
      if (tokens.length === 3) {
        var _a2 = tokens.map(getTokenColorValue), r = _a2[0], g = _a2[1], b2 = _a2[2];
        return pack(r, g, b2, 1);
      }
      if (tokens.length === 4) {
        var _b2 = tokens.map(getTokenColorValue), r = _b2[0], g = _b2[1], b2 = _b2[2], a2 = _b2[3];
        return pack(r, g, b2, a2);
      }
      return 0;
    };
    function hue2rgb(t1, t2, hue) {
      if (hue < 0) {
        hue += 1;
      }
      if (hue >= 1) {
        hue -= 1;
      }
      if (hue < 1 / 6) {
        return (t2 - t1) * hue * 6 + t1;
      } else if (hue < 1 / 2) {
        return t2;
      } else if (hue < 2 / 3) {
        return (t2 - t1) * 6 * (2 / 3 - hue) + t1;
      } else {
        return t1;
      }
    }
    var hsl = function(context, args) {
      var tokens = args.filter(nonFunctionArgSeparator);
      var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];
      var h2 = (hue.type === 17 ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2);
      var s2 = isLengthPercentage(saturation) ? saturation.number / 100 : 0;
      var l2 = isLengthPercentage(lightness) ? lightness.number / 100 : 0;
      var a2 = typeof alpha !== "undefined" && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;
      if (s2 === 0) {
        return pack(l2 * 255, l2 * 255, l2 * 255, 1);
      }
      var t2 = l2 <= 0.5 ? l2 * (s2 + 1) : l2 + s2 - l2 * s2;
      var t1 = l2 * 2 - t2;
      var r = hue2rgb(t1, t2, h2 + 1 / 3);
      var g = hue2rgb(t1, t2, h2);
      var b2 = hue2rgb(t1, t2, h2 - 1 / 3);
      return pack(r * 255, g * 255, b2 * 255, a2);
    };
    var SUPPORTED_COLOR_FUNCTIONS = {
      hsl,
      hsla: hsl,
      rgb,
      rgba: rgb
    };
    var parseColor = function(context, value) {
      return color$1.parse(context, Parser.create(value).parseComponentValue());
    };
    var COLORS = {
      ALICEBLUE: 4042850303,
      ANTIQUEWHITE: 4209760255,
      AQUA: 16777215,
      AQUAMARINE: 2147472639,
      AZURE: 4043309055,
      BEIGE: 4126530815,
      BISQUE: 4293182719,
      BLACK: 255,
      BLANCHEDALMOND: 4293643775,
      BLUE: 65535,
      BLUEVIOLET: 2318131967,
      BROWN: 2771004159,
      BURLYWOOD: 3736635391,
      CADETBLUE: 1604231423,
      CHARTREUSE: 2147418367,
      CHOCOLATE: 3530104575,
      CORAL: 4286533887,
      CORNFLOWERBLUE: 1687547391,
      CORNSILK: 4294499583,
      CRIMSON: 3692313855,
      CYAN: 16777215,
      DARKBLUE: 35839,
      DARKCYAN: 9145343,
      DARKGOLDENROD: 3095837695,
      DARKGRAY: 2846468607,
      DARKGREEN: 6553855,
      DARKGREY: 2846468607,
      DARKKHAKI: 3182914559,
      DARKMAGENTA: 2332068863,
      DARKOLIVEGREEN: 1433087999,
      DARKORANGE: 4287365375,
      DARKORCHID: 2570243327,
      DARKRED: 2332033279,
      DARKSALMON: 3918953215,
      DARKSEAGREEN: 2411499519,
      DARKSLATEBLUE: 1211993087,
      DARKSLATEGRAY: 793726975,
      DARKSLATEGREY: 793726975,
      DARKTURQUOISE: 13554175,
      DARKVIOLET: 2483082239,
      DEEPPINK: 4279538687,
      DEEPSKYBLUE: 12582911,
      DIMGRAY: 1768516095,
      DIMGREY: 1768516095,
      DODGERBLUE: 512819199,
      FIREBRICK: 2988581631,
      FLORALWHITE: 4294635775,
      FORESTGREEN: 579543807,
      FUCHSIA: 4278255615,
      GAINSBORO: 3705462015,
      GHOSTWHITE: 4177068031,
      GOLD: 4292280575,
      GOLDENROD: 3668254975,
      GRAY: 2155905279,
      GREEN: 8388863,
      GREENYELLOW: 2919182335,
      GREY: 2155905279,
      HONEYDEW: 4043305215,
      HOTPINK: 4285117695,
      INDIANRED: 3445382399,
      INDIGO: 1258324735,
      IVORY: 4294963455,
      KHAKI: 4041641215,
      LAVENDER: 3873897215,
      LAVENDERBLUSH: 4293981695,
      LAWNGREEN: 2096890111,
      LEMONCHIFFON: 4294626815,
      LIGHTBLUE: 2916673279,
      LIGHTCORAL: 4034953471,
      LIGHTCYAN: 3774873599,
      LIGHTGOLDENRODYELLOW: 4210742015,
      LIGHTGRAY: 3553874943,
      LIGHTGREEN: 2431553791,
      LIGHTGREY: 3553874943,
      LIGHTPINK: 4290167295,
      LIGHTSALMON: 4288707327,
      LIGHTSEAGREEN: 548580095,
      LIGHTSKYBLUE: 2278488831,
      LIGHTSLATEGRAY: 2005441023,
      LIGHTSLATEGREY: 2005441023,
      LIGHTSTEELBLUE: 2965692159,
      LIGHTYELLOW: 4294959359,
      LIME: 16711935,
      LIMEGREEN: 852308735,
      LINEN: 4210091775,
      MAGENTA: 4278255615,
      MAROON: 2147483903,
      MEDIUMAQUAMARINE: 1724754687,
      MEDIUMBLUE: 52735,
      MEDIUMORCHID: 3126187007,
      MEDIUMPURPLE: 2473647103,
      MEDIUMSEAGREEN: 1018393087,
      MEDIUMSLATEBLUE: 2070474495,
      MEDIUMSPRINGGREEN: 16423679,
      MEDIUMTURQUOISE: 1221709055,
      MEDIUMVIOLETRED: 3340076543,
      MIDNIGHTBLUE: 421097727,
      MINTCREAM: 4127193855,
      MISTYROSE: 4293190143,
      MOCCASIN: 4293178879,
      NAVAJOWHITE: 4292783615,
      NAVY: 33023,
      OLDLACE: 4260751103,
      OLIVE: 2155872511,
      OLIVEDRAB: 1804477439,
      ORANGE: 4289003775,
      ORANGERED: 4282712319,
      ORCHID: 3664828159,
      PALEGOLDENROD: 4008225535,
      PALEGREEN: 2566625535,
      PALETURQUOISE: 2951671551,
      PALEVIOLETRED: 3681588223,
      PAPAYAWHIP: 4293907967,
      PEACHPUFF: 4292524543,
      PERU: 3448061951,
      PINK: 4290825215,
      PLUM: 3718307327,
      POWDERBLUE: 2967529215,
      PURPLE: 2147516671,
      REBECCAPURPLE: 1714657791,
      RED: 4278190335,
      ROSYBROWN: 3163525119,
      ROYALBLUE: 1097458175,
      SADDLEBROWN: 2336560127,
      SALMON: 4202722047,
      SANDYBROWN: 4104413439,
      SEAGREEN: 780883967,
      SEASHELL: 4294307583,
      SIENNA: 2689740287,
      SILVER: 3233857791,
      SKYBLUE: 2278484991,
      SLATEBLUE: 1784335871,
      SLATEGRAY: 1887473919,
      SLATEGREY: 1887473919,
      SNOW: 4294638335,
      SPRINGGREEN: 16744447,
      STEELBLUE: 1182971135,
      TAN: 3535047935,
      TEAL: 8421631,
      THISTLE: 3636451583,
      TOMATO: 4284696575,
      TRANSPARENT: 0,
      TURQUOISE: 1088475391,
      VIOLET: 4001558271,
      WHEAT: 4125012991,
      WHITE: 4294967295,
      WHITESMOKE: 4126537215,
      YELLOW: 4294902015,
      YELLOWGREEN: 2597139199
    };
    var backgroundClip = {
      name: "background-clip",
      initialValue: "border-box",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return tokens.map(function(token) {
          if (isIdentToken(token)) {
            switch (token.value) {
              case "padding-box":
                return 1;
              case "content-box":
                return 2;
            }
          }
          return 0;
        });
      }
    };
    var backgroundColor = {
      name: "background-color",
      initialValue: "transparent",
      prefix: false,
      type: 3,
      format: "color"
    };
    var parseColorStop = function(context, args) {
      var color2 = color$1.parse(context, args[0]);
      var stop2 = args[1];
      return stop2 && isLengthPercentage(stop2) ? { color: color2, stop: stop2 } : { color: color2, stop: null };
    };
    var processColorStops = function(stops, lineLength) {
      var first = stops[0];
      var last2 = stops[stops.length - 1];
      if (first.stop === null) {
        first.stop = ZERO_LENGTH;
      }
      if (last2.stop === null) {
        last2.stop = HUNDRED_PERCENT;
      }
      var processStops = [];
      var previous = 0;
      for (var i2 = 0; i2 < stops.length; i2++) {
        var stop_1 = stops[i2].stop;
        if (stop_1 !== null) {
          var absoluteValue = getAbsoluteValue(stop_1, lineLength);
          if (absoluteValue > previous) {
            processStops.push(absoluteValue);
          } else {
            processStops.push(previous);
          }
          previous = absoluteValue;
        } else {
          processStops.push(null);
        }
      }
      var gapBegin = null;
      for (var i2 = 0; i2 < processStops.length; i2++) {
        var stop_2 = processStops[i2];
        if (stop_2 === null) {
          if (gapBegin === null) {
            gapBegin = i2;
          }
        } else if (gapBegin !== null) {
          var gapLength = i2 - gapBegin;
          var beforeGap = processStops[gapBegin - 1];
          var gapValue = (stop_2 - beforeGap) / (gapLength + 1);
          for (var g = 1; g <= gapLength; g++) {
            processStops[gapBegin + g - 1] = gapValue * g;
          }
          gapBegin = null;
        }
      }
      return stops.map(function(_a2, i3) {
        var color2 = _a2.color;
        return { color: color2, stop: Math.max(Math.min(1, processStops[i3] / lineLength), 0) };
      });
    };
    var getAngleFromCorner = function(corner, width, height) {
      var centerX = width / 2;
      var centerY = height / 2;
      var x2 = getAbsoluteValue(corner[0], width) - centerX;
      var y = centerY - getAbsoluteValue(corner[1], height);
      return (Math.atan2(y, x2) + Math.PI * 2) % (Math.PI * 2);
    };
    var calculateGradientDirection = function(angle2, width, height) {
      var radian = typeof angle2 === "number" ? angle2 : getAngleFromCorner(angle2, width, height);
      var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));
      var halfWidth = width / 2;
      var halfHeight = height / 2;
      var halfLineLength = lineLength / 2;
      var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;
      var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;
      return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];
    };
    var distance = function(a2, b2) {
      return Math.sqrt(a2 * a2 + b2 * b2);
    };
    var findCorner = function(width, height, x2, y, closest) {
      var corners = [
        [0, 0],
        [0, height],
        [width, 0],
        [width, height]
      ];
      return corners.reduce(function(stat, corner) {
        var cx = corner[0], cy = corner[1];
        var d2 = distance(x2 - cx, y - cy);
        if (closest ? d2 < stat.optimumDistance : d2 > stat.optimumDistance) {
          return {
            optimumCorner: corner,
            optimumDistance: d2
          };
        }
        return stat;
      }, {
        optimumDistance: closest ? Infinity : -Infinity,
        optimumCorner: null
      }).optimumCorner;
    };
    var calculateRadius = function(gradient, x2, y, width, height) {
      var rx = 0;
      var ry = 0;
      switch (gradient.size) {
        case 0:
          if (gradient.shape === 0) {
            rx = ry = Math.min(Math.abs(x2), Math.abs(x2 - width), Math.abs(y), Math.abs(y - height));
          } else if (gradient.shape === 1) {
            rx = Math.min(Math.abs(x2), Math.abs(x2 - width));
            ry = Math.min(Math.abs(y), Math.abs(y - height));
          }
          break;
        case 2:
          if (gradient.shape === 0) {
            rx = ry = Math.min(distance(x2, y), distance(x2, y - height), distance(x2 - width, y), distance(x2 - width, y - height));
          } else if (gradient.shape === 1) {
            var c2 = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x2), Math.abs(x2 - width));
            var _a2 = findCorner(width, height, x2, y, true), cx = _a2[0], cy = _a2[1];
            rx = distance(cx - x2, (cy - y) / c2);
            ry = c2 * rx;
          }
          break;
        case 1:
          if (gradient.shape === 0) {
            rx = ry = Math.max(Math.abs(x2), Math.abs(x2 - width), Math.abs(y), Math.abs(y - height));
          } else if (gradient.shape === 1) {
            rx = Math.max(Math.abs(x2), Math.abs(x2 - width));
            ry = Math.max(Math.abs(y), Math.abs(y - height));
          }
          break;
        case 3:
          if (gradient.shape === 0) {
            rx = ry = Math.max(distance(x2, y), distance(x2, y - height), distance(x2 - width, y), distance(x2 - width, y - height));
          } else if (gradient.shape === 1) {
            var c2 = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x2), Math.abs(x2 - width));
            var _b2 = findCorner(width, height, x2, y, false), cx = _b2[0], cy = _b2[1];
            rx = distance(cx - x2, (cy - y) / c2);
            ry = c2 * rx;
          }
          break;
      }
      if (Array.isArray(gradient.size)) {
        rx = getAbsoluteValue(gradient.size[0], width);
        ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;
      }
      return [rx, ry];
    };
    var linearGradient = function(context, tokens) {
      var angle$1 = deg(180);
      var stops = [];
      parseFunctionArgs(tokens).forEach(function(arg, i2) {
        if (i2 === 0) {
          var firstToken = arg[0];
          if (firstToken.type === 20 && firstToken.value === "to") {
            angle$1 = parseNamedSide(arg);
            return;
          } else if (isAngle(firstToken)) {
            angle$1 = angle.parse(context, firstToken);
            return;
          }
        }
        var colorStop = parseColorStop(context, arg);
        stops.push(colorStop);
      });
      return {
        angle: angle$1,
        stops,
        type: 1
        /* LINEAR_GRADIENT */
      };
    };
    var prefixLinearGradient = function(context, tokens) {
      var angle$1 = deg(180);
      var stops = [];
      parseFunctionArgs(tokens).forEach(function(arg, i2) {
        if (i2 === 0) {
          var firstToken = arg[0];
          if (firstToken.type === 20 && ["top", "left", "right", "bottom"].indexOf(firstToken.value) !== -1) {
            angle$1 = parseNamedSide(arg);
            return;
          } else if (isAngle(firstToken)) {
            angle$1 = (angle.parse(context, firstToken) + deg(270)) % deg(360);
            return;
          }
        }
        var colorStop = parseColorStop(context, arg);
        stops.push(colorStop);
      });
      return {
        angle: angle$1,
        stops,
        type: 1
        /* LINEAR_GRADIENT */
      };
    };
    var webkitGradient = function(context, tokens) {
      var angle2 = deg(180);
      var stops = [];
      var type = 1;
      var shape = 0;
      var size = 3;
      var position2 = [];
      parseFunctionArgs(tokens).forEach(function(arg, i2) {
        var firstToken = arg[0];
        if (i2 === 0) {
          if (isIdentToken(firstToken) && firstToken.value === "linear") {
            type = 1;
            return;
          } else if (isIdentToken(firstToken) && firstToken.value === "radial") {
            type = 2;
            return;
          }
        }
        if (firstToken.type === 18) {
          if (firstToken.name === "from") {
            var color2 = color$1.parse(context, firstToken.values[0]);
            stops.push({ stop: ZERO_LENGTH, color: color2 });
          } else if (firstToken.name === "to") {
            var color2 = color$1.parse(context, firstToken.values[0]);
            stops.push({ stop: HUNDRED_PERCENT, color: color2 });
          } else if (firstToken.name === "color-stop") {
            var values = firstToken.values.filter(nonFunctionArgSeparator);
            if (values.length === 2) {
              var color2 = color$1.parse(context, values[1]);
              var stop_1 = values[0];
              if (isNumberToken(stop_1)) {
                stops.push({
                  stop: { type: 16, number: stop_1.number * 100, flags: stop_1.flags },
                  color: color2
                });
              }
            }
          }
        }
      });
      return type === 1 ? {
        angle: (angle2 + deg(180)) % deg(360),
        stops,
        type
      } : { size, shape, stops, position: position2, type };
    };
    var CLOSEST_SIDE = "closest-side";
    var FARTHEST_SIDE = "farthest-side";
    var CLOSEST_CORNER = "closest-corner";
    var FARTHEST_CORNER = "farthest-corner";
    var CIRCLE = "circle";
    var ELLIPSE = "ellipse";
    var COVER = "cover";
    var CONTAIN = "contain";
    var radialGradient = function(context, tokens) {
      var shape = 0;
      var size = 3;
      var stops = [];
      var position2 = [];
      parseFunctionArgs(tokens).forEach(function(arg, i2) {
        var isColorStop = true;
        if (i2 === 0) {
          var isAtPosition_1 = false;
          isColorStop = arg.reduce(function(acc, token) {
            if (isAtPosition_1) {
              if (isIdentToken(token)) {
                switch (token.value) {
                  case "center":
                    position2.push(FIFTY_PERCENT);
                    return acc;
                  case "top":
                  case "left":
                    position2.push(ZERO_LENGTH);
                    return acc;
                  case "right":
                  case "bottom":
                    position2.push(HUNDRED_PERCENT);
                    return acc;
                }
              } else if (isLengthPercentage(token) || isLength(token)) {
                position2.push(token);
              }
            } else if (isIdentToken(token)) {
              switch (token.value) {
                case CIRCLE:
                  shape = 0;
                  return false;
                case ELLIPSE:
                  shape = 1;
                  return false;
                case "at":
                  isAtPosition_1 = true;
                  return false;
                case CLOSEST_SIDE:
                  size = 0;
                  return false;
                case COVER:
                case FARTHEST_SIDE:
                  size = 1;
                  return false;
                case CONTAIN:
                case CLOSEST_CORNER:
                  size = 2;
                  return false;
                case FARTHEST_CORNER:
                  size = 3;
                  return false;
              }
            } else if (isLength(token) || isLengthPercentage(token)) {
              if (!Array.isArray(size)) {
                size = [];
              }
              size.push(token);
              return false;
            }
            return acc;
          }, isColorStop);
        }
        if (isColorStop) {
          var colorStop = parseColorStop(context, arg);
          stops.push(colorStop);
        }
      });
      return {
        size,
        shape,
        stops,
        position: position2,
        type: 2
        /* RADIAL_GRADIENT */
      };
    };
    var prefixRadialGradient = function(context, tokens) {
      var shape = 0;
      var size = 3;
      var stops = [];
      var position2 = [];
      parseFunctionArgs(tokens).forEach(function(arg, i2) {
        var isColorStop = true;
        if (i2 === 0) {
          isColorStop = arg.reduce(function(acc, token) {
            if (isIdentToken(token)) {
              switch (token.value) {
                case "center":
                  position2.push(FIFTY_PERCENT);
                  return false;
                case "top":
                case "left":
                  position2.push(ZERO_LENGTH);
                  return false;
                case "right":
                case "bottom":
                  position2.push(HUNDRED_PERCENT);
                  return false;
              }
            } else if (isLengthPercentage(token) || isLength(token)) {
              position2.push(token);
              return false;
            }
            return acc;
          }, isColorStop);
        } else if (i2 === 1) {
          isColorStop = arg.reduce(function(acc, token) {
            if (isIdentToken(token)) {
              switch (token.value) {
                case CIRCLE:
                  shape = 0;
                  return false;
                case ELLIPSE:
                  shape = 1;
                  return false;
                case CONTAIN:
                case CLOSEST_SIDE:
                  size = 0;
                  return false;
                case FARTHEST_SIDE:
                  size = 1;
                  return false;
                case CLOSEST_CORNER:
                  size = 2;
                  return false;
                case COVER:
                case FARTHEST_CORNER:
                  size = 3;
                  return false;
              }
            } else if (isLength(token) || isLengthPercentage(token)) {
              if (!Array.isArray(size)) {
                size = [];
              }
              size.push(token);
              return false;
            }
            return acc;
          }, isColorStop);
        }
        if (isColorStop) {
          var colorStop = parseColorStop(context, arg);
          stops.push(colorStop);
        }
      });
      return {
        size,
        shape,
        stops,
        position: position2,
        type: 2
        /* RADIAL_GRADIENT */
      };
    };
    var isLinearGradient = function(background) {
      return background.type === 1;
    };
    var isRadialGradient = function(background) {
      return background.type === 2;
    };
    var image = {
      name: "image",
      parse: function(context, value) {
        if (value.type === 22) {
          var image_1 = {
            url: value.value,
            type: 0
            /* URL */
          };
          context.cache.addImage(value.value);
          return image_1;
        }
        if (value.type === 18) {
          var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];
          if (typeof imageFunction === "undefined") {
            throw new Error('Attempting to parse an unsupported image function "' + value.name + '"');
          }
          return imageFunction(context, value.values);
        }
        throw new Error("Unsupported image type " + value.type);
      }
    };
    function isSupportedImage(value) {
      return !(value.type === 20 && value.value === "none") && (value.type !== 18 || !!SUPPORTED_IMAGE_FUNCTIONS[value.name]);
    }
    var SUPPORTED_IMAGE_FUNCTIONS = {
      "linear-gradient": linearGradient,
      "-moz-linear-gradient": prefixLinearGradient,
      "-ms-linear-gradient": prefixLinearGradient,
      "-o-linear-gradient": prefixLinearGradient,
      "-webkit-linear-gradient": prefixLinearGradient,
      "radial-gradient": radialGradient,
      "-moz-radial-gradient": prefixRadialGradient,
      "-ms-radial-gradient": prefixRadialGradient,
      "-o-radial-gradient": prefixRadialGradient,
      "-webkit-radial-gradient": prefixRadialGradient,
      "-webkit-gradient": webkitGradient
    };
    var backgroundImage = {
      name: "background-image",
      initialValue: "none",
      type: 1,
      prefix: false,
      parse: function(context, tokens) {
        if (tokens.length === 0) {
          return [];
        }
        var first = tokens[0];
        if (first.type === 20 && first.value === "none") {
          return [];
        }
        return tokens.filter(function(value) {
          return nonFunctionArgSeparator(value) && isSupportedImage(value);
        }).map(function(value) {
          return image.parse(context, value);
        });
      }
    };
    var backgroundOrigin = {
      name: "background-origin",
      initialValue: "border-box",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return tokens.map(function(token) {
          if (isIdentToken(token)) {
            switch (token.value) {
              case "padding-box":
                return 1;
              case "content-box":
                return 2;
            }
          }
          return 0;
        });
      }
    };
    var backgroundPosition = {
      name: "background-position",
      initialValue: "0% 0%",
      type: 1,
      prefix: false,
      parse: function(_context, tokens) {
        return parseFunctionArgs(tokens).map(function(values) {
          return values.filter(isLengthPercentage);
        }).map(parseLengthPercentageTuple);
      }
    };
    var backgroundRepeat = {
      name: "background-repeat",
      initialValue: "repeat",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return parseFunctionArgs(tokens).map(function(values) {
          return values.filter(isIdentToken).map(function(token) {
            return token.value;
          }).join(" ");
        }).map(parseBackgroundRepeat);
      }
    };
    var parseBackgroundRepeat = function(value) {
      switch (value) {
        case "no-repeat":
          return 1;
        case "repeat-x":
        case "repeat no-repeat":
          return 2;
        case "repeat-y":
        case "no-repeat repeat":
          return 3;
        case "repeat":
        default:
          return 0;
      }
    };
    var BACKGROUND_SIZE;
    (function(BACKGROUND_SIZE2) {
      BACKGROUND_SIZE2["AUTO"] = "auto";
      BACKGROUND_SIZE2["CONTAIN"] = "contain";
      BACKGROUND_SIZE2["COVER"] = "cover";
    })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));
    var backgroundSize = {
      name: "background-size",
      initialValue: "0",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return parseFunctionArgs(tokens).map(function(values) {
          return values.filter(isBackgroundSizeInfoToken);
        });
      }
    };
    var isBackgroundSizeInfoToken = function(value) {
      return isIdentToken(value) || isLengthPercentage(value);
    };
    var borderColorForSide = function(side) {
      return {
        name: "border-" + side + "-color",
        initialValue: "transparent",
        prefix: false,
        type: 3,
        format: "color"
      };
    };
    var borderTopColor = borderColorForSide("top");
    var borderRightColor = borderColorForSide("right");
    var borderBottomColor = borderColorForSide("bottom");
    var borderLeftColor = borderColorForSide("left");
    var borderRadiusForSide = function(side) {
      return {
        name: "border-radius-" + side,
        initialValue: "0 0",
        prefix: false,
        type: 1,
        parse: function(_context, tokens) {
          return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));
        }
      };
    };
    var borderTopLeftRadius = borderRadiusForSide("top-left");
    var borderTopRightRadius = borderRadiusForSide("top-right");
    var borderBottomRightRadius = borderRadiusForSide("bottom-right");
    var borderBottomLeftRadius = borderRadiusForSide("bottom-left");
    var borderStyleForSide = function(side) {
      return {
        name: "border-" + side + "-style",
        initialValue: "solid",
        prefix: false,
        type: 2,
        parse: function(_context, style) {
          switch (style) {
            case "none":
              return 0;
            case "dashed":
              return 2;
            case "dotted":
              return 3;
            case "double":
              return 4;
          }
          return 1;
        }
      };
    };
    var borderTopStyle = borderStyleForSide("top");
    var borderRightStyle = borderStyleForSide("right");
    var borderBottomStyle = borderStyleForSide("bottom");
    var borderLeftStyle = borderStyleForSide("left");
    var borderWidthForSide = function(side) {
      return {
        name: "border-" + side + "-width",
        initialValue: "0",
        type: 0,
        prefix: false,
        parse: function(_context, token) {
          if (isDimensionToken(token)) {
            return token.number;
          }
          return 0;
        }
      };
    };
    var borderTopWidth = borderWidthForSide("top");
    var borderRightWidth = borderWidthForSide("right");
    var borderBottomWidth = borderWidthForSide("bottom");
    var borderLeftWidth = borderWidthForSide("left");
    var color = {
      name: "color",
      initialValue: "transparent",
      prefix: false,
      type: 3,
      format: "color"
    };
    var direction = {
      name: "direction",
      initialValue: "ltr",
      prefix: false,
      type: 2,
      parse: function(_context, direction2) {
        switch (direction2) {
          case "rtl":
            return 1;
          case "ltr":
          default:
            return 0;
        }
      }
    };
    var display = {
      name: "display",
      initialValue: "inline-block",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return tokens.filter(isIdentToken).reduce(
          function(bit, token) {
            return bit | parseDisplayValue(token.value);
          },
          0
          /* NONE */
        );
      }
    };
    var parseDisplayValue = function(display2) {
      switch (display2) {
        case "block":
        case "-webkit-box":
          return 2;
        case "inline":
          return 4;
        case "run-in":
          return 8;
        case "flow":
          return 16;
        case "flow-root":
          return 32;
        case "table":
          return 64;
        case "flex":
        case "-webkit-flex":
          return 128;
        case "grid":
        case "-ms-grid":
          return 256;
        case "ruby":
          return 512;
        case "subgrid":
          return 1024;
        case "list-item":
          return 2048;
        case "table-row-group":
          return 4096;
        case "table-header-group":
          return 8192;
        case "table-footer-group":
          return 16384;
        case "table-row":
          return 32768;
        case "table-cell":
          return 65536;
        case "table-column-group":
          return 131072;
        case "table-column":
          return 262144;
        case "table-caption":
          return 524288;
        case "ruby-base":
          return 1048576;
        case "ruby-text":
          return 2097152;
        case "ruby-base-container":
          return 4194304;
        case "ruby-text-container":
          return 8388608;
        case "contents":
          return 16777216;
        case "inline-block":
          return 33554432;
        case "inline-list-item":
          return 67108864;
        case "inline-table":
          return 134217728;
        case "inline-flex":
          return 268435456;
        case "inline-grid":
          return 536870912;
      }
      return 0;
    };
    var float = {
      name: "float",
      initialValue: "none",
      prefix: false,
      type: 2,
      parse: function(_context, float2) {
        switch (float2) {
          case "left":
            return 1;
          case "right":
            return 2;
          case "inline-start":
            return 3;
          case "inline-end":
            return 4;
        }
        return 0;
      }
    };
    var letterSpacing = {
      name: "letter-spacing",
      initialValue: "0",
      prefix: false,
      type: 0,
      parse: function(_context, token) {
        if (token.type === 20 && token.value === "normal") {
          return 0;
        }
        if (token.type === 17) {
          return token.number;
        }
        if (token.type === 15) {
          return token.number;
        }
        return 0;
      }
    };
    var LINE_BREAK;
    (function(LINE_BREAK2) {
      LINE_BREAK2["NORMAL"] = "normal";
      LINE_BREAK2["STRICT"] = "strict";
    })(LINE_BREAK || (LINE_BREAK = {}));
    var lineBreak = {
      name: "line-break",
      initialValue: "normal",
      prefix: false,
      type: 2,
      parse: function(_context, lineBreak2) {
        switch (lineBreak2) {
          case "strict":
            return LINE_BREAK.STRICT;
          case "normal":
          default:
            return LINE_BREAK.NORMAL;
        }
      }
    };
    var lineHeight = {
      name: "line-height",
      initialValue: "normal",
      prefix: false,
      type: 4
      /* TOKEN_VALUE */
    };
    var computeLineHeight = function(token, fontSize2) {
      if (isIdentToken(token) && token.value === "normal") {
        return 1.2 * fontSize2;
      } else if (token.type === 17) {
        return fontSize2 * token.number;
      } else if (isLengthPercentage(token)) {
        return getAbsoluteValue(token, fontSize2);
      }
      return fontSize2;
    };
    var listStyleImage = {
      name: "list-style-image",
      initialValue: "none",
      type: 0,
      prefix: false,
      parse: function(context, token) {
        if (token.type === 20 && token.value === "none") {
          return null;
        }
        return image.parse(context, token);
      }
    };
    var listStylePosition = {
      name: "list-style-position",
      initialValue: "outside",
      prefix: false,
      type: 2,
      parse: function(_context, position2) {
        switch (position2) {
          case "inside":
            return 0;
          case "outside":
          default:
            return 1;
        }
      }
    };
    var listStyleType = {
      name: "list-style-type",
      initialValue: "none",
      prefix: false,
      type: 2,
      parse: function(_context, type) {
        switch (type) {
          case "disc":
            return 0;
          case "circle":
            return 1;
          case "square":
            return 2;
          case "decimal":
            return 3;
          case "cjk-decimal":
            return 4;
          case "decimal-leading-zero":
            return 5;
          case "lower-roman":
            return 6;
          case "upper-roman":
            return 7;
          case "lower-greek":
            return 8;
          case "lower-alpha":
            return 9;
          case "upper-alpha":
            return 10;
          case "arabic-indic":
            return 11;
          case "armenian":
            return 12;
          case "bengali":
            return 13;
          case "cambodian":
            return 14;
          case "cjk-earthly-branch":
            return 15;
          case "cjk-heavenly-stem":
            return 16;
          case "cjk-ideographic":
            return 17;
          case "devanagari":
            return 18;
          case "ethiopic-numeric":
            return 19;
          case "georgian":
            return 20;
          case "gujarati":
            return 21;
          case "gurmukhi":
            return 22;
          case "hebrew":
            return 22;
          case "hiragana":
            return 23;
          case "hiragana-iroha":
            return 24;
          case "japanese-formal":
            return 25;
          case "japanese-informal":
            return 26;
          case "kannada":
            return 27;
          case "katakana":
            return 28;
          case "katakana-iroha":
            return 29;
          case "khmer":
            return 30;
          case "korean-hangul-formal":
            return 31;
          case "korean-hanja-formal":
            return 32;
          case "korean-hanja-informal":
            return 33;
          case "lao":
            return 34;
          case "lower-armenian":
            return 35;
          case "malayalam":
            return 36;
          case "mongolian":
            return 37;
          case "myanmar":
            return 38;
          case "oriya":
            return 39;
          case "persian":
            return 40;
          case "simp-chinese-formal":
            return 41;
          case "simp-chinese-informal":
            return 42;
          case "tamil":
            return 43;
          case "telugu":
            return 44;
          case "thai":
            return 45;
          case "tibetan":
            return 46;
          case "trad-chinese-formal":
            return 47;
          case "trad-chinese-informal":
            return 48;
          case "upper-armenian":
            return 49;
          case "disclosure-open":
            return 50;
          case "disclosure-closed":
            return 51;
          case "none":
          default:
            return -1;
        }
      }
    };
    var marginForSide = function(side) {
      return {
        name: "margin-" + side,
        initialValue: "0",
        prefix: false,
        type: 4
        /* TOKEN_VALUE */
      };
    };
    var marginTop = marginForSide("top");
    var marginRight = marginForSide("right");
    var marginBottom = marginForSide("bottom");
    var marginLeft = marginForSide("left");
    var overflow = {
      name: "overflow",
      initialValue: "visible",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return tokens.filter(isIdentToken).map(function(overflow2) {
          switch (overflow2.value) {
            case "hidden":
              return 1;
            case "scroll":
              return 2;
            case "clip":
              return 3;
            case "auto":
              return 4;
            case "visible":
            default:
              return 0;
          }
        });
      }
    };
    var overflowWrap = {
      name: "overflow-wrap",
      initialValue: "normal",
      prefix: false,
      type: 2,
      parse: function(_context, overflow2) {
        switch (overflow2) {
          case "break-word":
            return "break-word";
          case "normal":
          default:
            return "normal";
        }
      }
    };
    var paddingForSide = function(side) {
      return {
        name: "padding-" + side,
        initialValue: "0",
        prefix: false,
        type: 3,
        format: "length-percentage"
      };
    };
    var paddingTop = paddingForSide("top");
    var paddingRight = paddingForSide("right");
    var paddingBottom = paddingForSide("bottom");
    var paddingLeft = paddingForSide("left");
    var textAlign = {
      name: "text-align",
      initialValue: "left",
      prefix: false,
      type: 2,
      parse: function(_context, textAlign2) {
        switch (textAlign2) {
          case "right":
            return 2;
          case "center":
          case "justify":
            return 1;
          case "left":
          default:
            return 0;
        }
      }
    };
    var position = {
      name: "position",
      initialValue: "static",
      prefix: false,
      type: 2,
      parse: function(_context, position2) {
        switch (position2) {
          case "relative":
            return 1;
          case "absolute":
            return 2;
          case "fixed":
            return 3;
          case "sticky":
            return 4;
        }
        return 0;
      }
    };
    var textShadow = {
      name: "text-shadow",
      initialValue: "none",
      type: 1,
      prefix: false,
      parse: function(context, tokens) {
        if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
          return [];
        }
        return parseFunctionArgs(tokens).map(function(values) {
          var shadow = {
            color: COLORS.TRANSPARENT,
            offsetX: ZERO_LENGTH,
            offsetY: ZERO_LENGTH,
            blur: ZERO_LENGTH
          };
          var c2 = 0;
          for (var i2 = 0; i2 < values.length; i2++) {
            var token = values[i2];
            if (isLength(token)) {
              if (c2 === 0) {
                shadow.offsetX = token;
              } else if (c2 === 1) {
                shadow.offsetY = token;
              } else {
                shadow.blur = token;
              }
              c2++;
            } else {
              shadow.color = color$1.parse(context, token);
            }
          }
          return shadow;
        });
      }
    };
    var textTransform = {
      name: "text-transform",
      initialValue: "none",
      prefix: false,
      type: 2,
      parse: function(_context, textTransform2) {
        switch (textTransform2) {
          case "uppercase":
            return 2;
          case "lowercase":
            return 1;
          case "capitalize":
            return 3;
        }
        return 0;
      }
    };
    var transform$1 = {
      name: "transform",
      initialValue: "none",
      prefix: true,
      type: 0,
      parse: function(_context, token) {
        if (token.type === 20 && token.value === "none") {
          return null;
        }
        if (token.type === 18) {
          var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];
          if (typeof transformFunction === "undefined") {
            throw new Error('Attempting to parse an unsupported transform function "' + token.name + '"');
          }
          return transformFunction(token.values);
        }
        return null;
      }
    };
    var matrix = function(args) {
      var values = args.filter(function(arg) {
        return arg.type === 17;
      }).map(function(arg) {
        return arg.number;
      });
      return values.length === 6 ? values : null;
    };
    var matrix3d = function(args) {
      var values = args.filter(function(arg) {
        return arg.type === 17;
      }).map(function(arg) {
        return arg.number;
      });
      var a1 = values[0], b1 = values[1];
      values[2];
      values[3];
      var a2 = values[4], b2 = values[5];
      values[6];
      values[7];
      values[8];
      values[9];
      values[10];
      values[11];
      var a4 = values[12], b4 = values[13];
      values[14];
      values[15];
      return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;
    };
    var SUPPORTED_TRANSFORM_FUNCTIONS = {
      matrix,
      matrix3d
    };
    var DEFAULT_VALUE = {
      type: 16,
      number: 50,
      flags: FLAG_INTEGER
    };
    var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];
    var transformOrigin = {
      name: "transform-origin",
      initialValue: "50% 50%",
      prefix: true,
      type: 1,
      parse: function(_context, tokens) {
        var origins = tokens.filter(isLengthPercentage);
        if (origins.length !== 2) {
          return DEFAULT;
        }
        return [origins[0], origins[1]];
      }
    };
    var visibility = {
      name: "visible",
      initialValue: "none",
      prefix: false,
      type: 2,
      parse: function(_context, visibility2) {
        switch (visibility2) {
          case "hidden":
            return 1;
          case "collapse":
            return 2;
          case "visible":
          default:
            return 0;
        }
      }
    };
    var WORD_BREAK;
    (function(WORD_BREAK2) {
      WORD_BREAK2["NORMAL"] = "normal";
      WORD_BREAK2["BREAK_ALL"] = "break-all";
      WORD_BREAK2["KEEP_ALL"] = "keep-all";
    })(WORD_BREAK || (WORD_BREAK = {}));
    var wordBreak = {
      name: "word-break",
      initialValue: "normal",
      prefix: false,
      type: 2,
      parse: function(_context, wordBreak2) {
        switch (wordBreak2) {
          case "break-all":
            return WORD_BREAK.BREAK_ALL;
          case "keep-all":
            return WORD_BREAK.KEEP_ALL;
          case "normal":
          default:
            return WORD_BREAK.NORMAL;
        }
      }
    };
    var zIndex = {
      name: "z-index",
      initialValue: "auto",
      prefix: false,
      type: 0,
      parse: function(_context, token) {
        if (token.type === 20) {
          return { auto: true, order: 0 };
        }
        if (isNumberToken(token)) {
          return { auto: false, order: token.number };
        }
        throw new Error("Invalid z-index number parsed");
      }
    };
    var time = {
      name: "time",
      parse: function(_context, value) {
        if (value.type === 15) {
          switch (value.unit.toLowerCase()) {
            case "s":
              return 1e3 * value.number;
            case "ms":
              return value.number;
          }
        }
        throw new Error("Unsupported time type");
      }
    };
    var opacity = {
      name: "opacity",
      initialValue: "1",
      type: 0,
      prefix: false,
      parse: function(_context, token) {
        if (isNumberToken(token)) {
          return token.number;
        }
        return 1;
      }
    };
    var textDecorationColor = {
      name: "text-decoration-color",
      initialValue: "transparent",
      prefix: false,
      type: 3,
      format: "color"
    };
    var textDecorationLine = {
      name: "text-decoration-line",
      initialValue: "none",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        return tokens.filter(isIdentToken).map(function(token) {
          switch (token.value) {
            case "underline":
              return 1;
            case "overline":
              return 2;
            case "line-through":
              return 3;
            case "none":
              return 4;
          }
          return 0;
        }).filter(function(line) {
          return line !== 0;
        });
      }
    };
    var fontFamily = {
      name: "font-family",
      initialValue: "",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        var accumulator = [];
        var results = [];
        tokens.forEach(function(token) {
          switch (token.type) {
            case 20:
            case 0:
              accumulator.push(token.value);
              break;
            case 17:
              accumulator.push(token.number.toString());
              break;
            case 4:
              results.push(accumulator.join(" "));
              accumulator.length = 0;
              break;
          }
        });
        if (accumulator.length) {
          results.push(accumulator.join(" "));
        }
        return results.map(function(result) {
          return result.indexOf(" ") === -1 ? result : "'" + result + "'";
        });
      }
    };
    var fontSize = {
      name: "font-size",
      initialValue: "0",
      prefix: false,
      type: 3,
      format: "length"
    };
    var fontWeight = {
      name: "font-weight",
      initialValue: "normal",
      type: 0,
      prefix: false,
      parse: function(_context, token) {
        if (isNumberToken(token)) {
          return token.number;
        }
        if (isIdentToken(token)) {
          switch (token.value) {
            case "bold":
              return 700;
            case "normal":
            default:
              return 400;
          }
        }
        return 400;
      }
    };
    var fontVariant = {
      name: "font-variant",
      initialValue: "none",
      type: 1,
      prefix: false,
      parse: function(_context, tokens) {
        return tokens.filter(isIdentToken).map(function(token) {
          return token.value;
        });
      }
    };
    var fontStyle = {
      name: "font-style",
      initialValue: "normal",
      prefix: false,
      type: 2,
      parse: function(_context, overflow2) {
        switch (overflow2) {
          case "oblique":
            return "oblique";
          case "italic":
            return "italic";
          case "normal":
          default:
            return "normal";
        }
      }
    };
    var contains = function(bit, value) {
      return (bit & value) !== 0;
    };
    var content = {
      name: "content",
      initialValue: "none",
      type: 1,
      prefix: false,
      parse: function(_context, tokens) {
        if (tokens.length === 0) {
          return [];
        }
        var first = tokens[0];
        if (first.type === 20 && first.value === "none") {
          return [];
        }
        return tokens;
      }
    };
    var counterIncrement = {
      name: "counter-increment",
      initialValue: "none",
      prefix: true,
      type: 1,
      parse: function(_context, tokens) {
        if (tokens.length === 0) {
          return null;
        }
        var first = tokens[0];
        if (first.type === 20 && first.value === "none") {
          return null;
        }
        var increments = [];
        var filtered = tokens.filter(nonWhiteSpace);
        for (var i2 = 0; i2 < filtered.length; i2++) {
          var counter = filtered[i2];
          var next = filtered[i2 + 1];
          if (counter.type === 20) {
            var increment = next && isNumberToken(next) ? next.number : 1;
            increments.push({ counter: counter.value, increment });
          }
        }
        return increments;
      }
    };
    var counterReset = {
      name: "counter-reset",
      initialValue: "none",
      prefix: true,
      type: 1,
      parse: function(_context, tokens) {
        if (tokens.length === 0) {
          return [];
        }
        var resets = [];
        var filtered = tokens.filter(nonWhiteSpace);
        for (var i2 = 0; i2 < filtered.length; i2++) {
          var counter = filtered[i2];
          var next = filtered[i2 + 1];
          if (isIdentToken(counter) && counter.value !== "none") {
            var reset = next && isNumberToken(next) ? next.number : 0;
            resets.push({ counter: counter.value, reset });
          }
        }
        return resets;
      }
    };
    var duration = {
      name: "duration",
      initialValue: "0s",
      prefix: false,
      type: 1,
      parse: function(context, tokens) {
        return tokens.filter(isDimensionToken).map(function(token) {
          return time.parse(context, token);
        });
      }
    };
    var quotes = {
      name: "quotes",
      initialValue: "none",
      prefix: true,
      type: 1,
      parse: function(_context, tokens) {
        if (tokens.length === 0) {
          return null;
        }
        var first = tokens[0];
        if (first.type === 20 && first.value === "none") {
          return null;
        }
        var quotes2 = [];
        var filtered = tokens.filter(isStringToken);
        if (filtered.length % 2 !== 0) {
          return null;
        }
        for (var i2 = 0; i2 < filtered.length; i2 += 2) {
          var open_1 = filtered[i2].value;
          var close_1 = filtered[i2 + 1].value;
          quotes2.push({ open: open_1, close: close_1 });
        }
        return quotes2;
      }
    };
    var getQuote = function(quotes2, depth, open2) {
      if (!quotes2) {
        return "";
      }
      var quote = quotes2[Math.min(depth, quotes2.length - 1)];
      if (!quote) {
        return "";
      }
      return open2 ? quote.open : quote.close;
    };
    var boxShadow = {
      name: "box-shadow",
      initialValue: "none",
      type: 1,
      prefix: false,
      parse: function(context, tokens) {
        if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) {
          return [];
        }
        return parseFunctionArgs(tokens).map(function(values) {
          var shadow = {
            color: 255,
            offsetX: ZERO_LENGTH,
            offsetY: ZERO_LENGTH,
            blur: ZERO_LENGTH,
            spread: ZERO_LENGTH,
            inset: false
          };
          var c2 = 0;
          for (var i2 = 0; i2 < values.length; i2++) {
            var token = values[i2];
            if (isIdentWithValue(token, "inset")) {
              shadow.inset = true;
            } else if (isLength(token)) {
              if (c2 === 0) {
                shadow.offsetX = token;
              } else if (c2 === 1) {
                shadow.offsetY = token;
              } else if (c2 === 2) {
                shadow.blur = token;
              } else {
                shadow.spread = token;
              }
              c2++;
            } else {
              shadow.color = color$1.parse(context, token);
            }
          }
          return shadow;
        });
      }
    };
    var paintOrder = {
      name: "paint-order",
      initialValue: "normal",
      prefix: false,
      type: 1,
      parse: function(_context, tokens) {
        var DEFAULT_VALUE2 = [
          0,
          1,
          2
          /* MARKERS */
        ];
        var layers = [];
        tokens.filter(isIdentToken).forEach(function(token) {
          switch (token.value) {
            case "stroke":
              layers.push(
                1
                /* STROKE */
              );
              break;
            case "fill":
              layers.push(
                0
                /* FILL */
              );
              break;
            case "markers":
              layers.push(
                2
                /* MARKERS */
              );
              break;
          }
        });
        DEFAULT_VALUE2.forEach(function(value) {
          if (layers.indexOf(value) === -1) {
            layers.push(value);
          }
        });
        return layers;
      }
    };
    var webkitTextStrokeColor = {
      name: "-webkit-text-stroke-color",
      initialValue: "currentcolor",
      prefix: false,
      type: 3,
      format: "color"
    };
    var webkitTextStrokeWidth = {
      name: "-webkit-text-stroke-width",
      initialValue: "0",
      type: 0,
      prefix: false,
      parse: function(_context, token) {
        if (isDimensionToken(token)) {
          return token.number;
        }
        return 0;
      }
    };
    var CSSParsedDeclaration = (
      /** @class */
      function() {
        function CSSParsedDeclaration2(context, declaration) {
          var _a2, _b2;
          this.animationDuration = parse(context, duration, declaration.animationDuration);
          this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip);
          this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor);
          this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage);
          this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin);
          this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition);
          this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat);
          this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize);
          this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor);
          this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor);
          this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor);
          this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor);
          this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius);
          this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius);
          this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius);
          this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);
          this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle);
          this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle);
          this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle);
          this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle);
          this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth);
          this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth);
          this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth);
          this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth);
          this.boxShadow = parse(context, boxShadow, declaration.boxShadow);
          this.color = parse(context, color, declaration.color);
          this.direction = parse(context, direction, declaration.direction);
          this.display = parse(context, display, declaration.display);
          this.float = parse(context, float, declaration.cssFloat);
          this.fontFamily = parse(context, fontFamily, declaration.fontFamily);
          this.fontSize = parse(context, fontSize, declaration.fontSize);
          this.fontStyle = parse(context, fontStyle, declaration.fontStyle);
          this.fontVariant = parse(context, fontVariant, declaration.fontVariant);
          this.fontWeight = parse(context, fontWeight, declaration.fontWeight);
          this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing);
          this.lineBreak = parse(context, lineBreak, declaration.lineBreak);
          this.lineHeight = parse(context, lineHeight, declaration.lineHeight);
          this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage);
          this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition);
          this.listStyleType = parse(context, listStyleType, declaration.listStyleType);
          this.marginTop = parse(context, marginTop, declaration.marginTop);
          this.marginRight = parse(context, marginRight, declaration.marginRight);
          this.marginBottom = parse(context, marginBottom, declaration.marginBottom);
          this.marginLeft = parse(context, marginLeft, declaration.marginLeft);
          this.opacity = parse(context, opacity, declaration.opacity);
          var overflowTuple = parse(context, overflow, declaration.overflow);
          this.overflowX = overflowTuple[0];
          this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
          this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap);
          this.paddingTop = parse(context, paddingTop, declaration.paddingTop);
          this.paddingRight = parse(context, paddingRight, declaration.paddingRight);
          this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom);
          this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft);
          this.paintOrder = parse(context, paintOrder, declaration.paintOrder);
          this.position = parse(context, position, declaration.position);
          this.textAlign = parse(context, textAlign, declaration.textAlign);
          this.textDecorationColor = parse(context, textDecorationColor, (_a2 = declaration.textDecorationColor) !== null && _a2 !== void 0 ? _a2 : declaration.color);
          this.textDecorationLine = parse(context, textDecorationLine, (_b2 = declaration.textDecorationLine) !== null && _b2 !== void 0 ? _b2 : declaration.textDecoration);
          this.textShadow = parse(context, textShadow, declaration.textShadow);
          this.textTransform = parse(context, textTransform, declaration.textTransform);
          this.transform = parse(context, transform$1, declaration.transform);
          this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin);
          this.visibility = parse(context, visibility, declaration.visibility);
          this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);
          this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);
          this.wordBreak = parse(context, wordBreak, declaration.wordBreak);
          this.zIndex = parse(context, zIndex, declaration.zIndex);
        }
        CSSParsedDeclaration2.prototype.isVisible = function() {
          return this.display > 0 && this.opacity > 0 && this.visibility === 0;
        };
        CSSParsedDeclaration2.prototype.isTransparent = function() {
          return isTransparent(this.backgroundColor);
        };
        CSSParsedDeclaration2.prototype.isTransformed = function() {
          return this.transform !== null;
        };
        CSSParsedDeclaration2.prototype.isPositioned = function() {
          return this.position !== 0;
        };
        CSSParsedDeclaration2.prototype.isPositionedWithZIndex = function() {
          return this.isPositioned() && !this.zIndex.auto;
        };
        CSSParsedDeclaration2.prototype.isFloating = function() {
          return this.float !== 0;
        };
        CSSParsedDeclaration2.prototype.isInlineLevel = function() {
          return contains(
            this.display,
            4
            /* INLINE */
          ) || contains(
            this.display,
            33554432
            /* INLINE_BLOCK */
          ) || contains(
            this.display,
            268435456
            /* INLINE_FLEX */
          ) || contains(
            this.display,
            536870912
            /* INLINE_GRID */
          ) || contains(
            this.display,
            67108864
            /* INLINE_LIST_ITEM */
          ) || contains(
            this.display,
            134217728
            /* INLINE_TABLE */
          );
        };
        return CSSParsedDeclaration2;
      }()
    );
    var CSSParsedPseudoDeclaration = (
      /** @class */
      /* @__PURE__ */ function() {
        function CSSParsedPseudoDeclaration2(context, declaration) {
          this.content = parse(context, content, declaration.content);
          this.quotes = parse(context, quotes, declaration.quotes);
        }
        return CSSParsedPseudoDeclaration2;
      }()
    );
    var CSSParsedCounterDeclaration = (
      /** @class */
      /* @__PURE__ */ function() {
        function CSSParsedCounterDeclaration2(context, declaration) {
          this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement);
          this.counterReset = parse(context, counterReset, declaration.counterReset);
        }
        return CSSParsedCounterDeclaration2;
      }()
    );
    var parse = function(context, descriptor, style) {
      var tokenizer = new Tokenizer();
      var value = style !== null && typeof style !== "undefined" ? style.toString() : descriptor.initialValue;
      tokenizer.write(value);
      var parser = new Parser(tokenizer.read());
      switch (descriptor.type) {
        case 2:
          var token = parser.parseComponentValue();
          return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);
        case 0:
          return descriptor.parse(context, parser.parseComponentValue());
        case 1:
          return descriptor.parse(context, parser.parseComponentValues());
        case 4:
          return parser.parseComponentValue();
        case 3:
          switch (descriptor.format) {
            case "angle":
              return angle.parse(context, parser.parseComponentValue());
            case "color":
              return color$1.parse(context, parser.parseComponentValue());
            case "image":
              return image.parse(context, parser.parseComponentValue());
            case "length":
              var length_1 = parser.parseComponentValue();
              return isLength(length_1) ? length_1 : ZERO_LENGTH;
            case "length-percentage":
              var value_1 = parser.parseComponentValue();
              return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;
            case "time":
              return time.parse(context, parser.parseComponentValue());
          }
          break;
      }
    };
    var elementDebuggerAttribute = "data-html2canvas-debug";
    var getElementDebugType = function(element) {
      var attribute = element.getAttribute(elementDebuggerAttribute);
      switch (attribute) {
        case "all":
          return 1;
        case "clone":
          return 2;
        case "parse":
          return 3;
        case "render":
          return 4;
        default:
          return 0;
      }
    };
    var isDebugging = function(element, type) {
      var elementType = getElementDebugType(element);
      return elementType === 1 || type === elementType;
    };
    var ElementContainer = (
      /** @class */
      /* @__PURE__ */ function() {
        function ElementContainer2(context, element) {
          this.context = context;
          this.textNodes = [];
          this.elements = [];
          this.flags = 0;
          if (isDebugging(
            element,
            3
            /* PARSE */
          )) {
            debugger;
          }
          this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null));
          if (isHTMLElementNode(element)) {
            if (this.styles.animationDuration.some(function(duration2) {
              return duration2 > 0;
            })) {
              element.style.animationDuration = "0s";
            }
            if (this.styles.transform !== null) {
              element.style.transform = "none";
            }
          }
          this.bounds = parseBounds(this.context, element);
          if (isDebugging(
            element,
            4
            /* RENDER */
          )) {
            this.flags |= 16;
          }
        }
        return ElementContainer2;
      }()
    );
    var base64 = " ";
    var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var lookup$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
    for (var i$1 = 0; i$1 < chars$1.length; i$1++) {
      lookup$1[chars$1.charCodeAt(i$1)] = i$1;
    }
    var decode = function(base642) {
      var bufferLength = base642.length * 0.75, len2 = base642.length, i2, p2 = 0, encoded1, encoded2, encoded3, encoded4;
      if (base642[base642.length - 1] === "=") {
        bufferLength--;
        if (base642[base642.length - 2] === "=") {
          bufferLength--;
        }
      }
      var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength);
      var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);
      for (i2 = 0; i2 < len2; i2 += 4) {
        encoded1 = lookup$1[base642.charCodeAt(i2)];
        encoded2 = lookup$1[base642.charCodeAt(i2 + 1)];
        encoded3 = lookup$1[base642.charCodeAt(i2 + 2)];
        encoded4 = lookup$1[base642.charCodeAt(i2 + 3)];
        bytes[p2++] = encoded1 << 2 | encoded2 >> 4;
        bytes[p2++] = (encoded2 & 15) << 4 | encoded3 >> 2;
        bytes[p2++] = (encoded3 & 3) << 6 | encoded4 & 63;
      }
      return buffer;
    };
    var polyUint16Array = function(buffer) {
      var length = buffer.length;
      var bytes = [];
      for (var i2 = 0; i2 < length; i2 += 2) {
        bytes.push(buffer[i2 + 1] << 8 | buffer[i2]);
      }
      return bytes;
    };
    var polyUint32Array = function(buffer) {
      var length = buffer.length;
      var bytes = [];
      for (var i2 = 0; i2 < length; i2 += 4) {
        bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]);
      }
      return bytes;
    };
    var UTRIE2_SHIFT_2 = 5;
    var UTRIE2_SHIFT_1 = 6 + 5;
    var UTRIE2_INDEX_SHIFT = 2;
    var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;
    var UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2;
    var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;
    var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;
    var UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2;
    var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;
    var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;
    var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 2048 >> 6;
    var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;
    var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1;
    var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;
    var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;
    var slice16 = function(view, start2, end2) {
      if (view.slice) {
        return view.slice(start2, end2);
      }
      return new Uint16Array(Array.prototype.slice.call(view, start2, end2));
    };
    var slice32 = function(view, start2, end2) {
      if (view.slice) {
        return view.slice(start2, end2);
      }
      return new Uint32Array(Array.prototype.slice.call(view, start2, end2));
    };
    var createTrieFromBase64 = function(base642, _byteLength) {
      var buffer = decode(base642);
      var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);
      var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);
      var headerLength = 24;
      var index = slice16(view16, headerLength / 2, view32[4] / 2);
      var data = view32[5] === 2 ? slice16(view16, (headerLength + view32[4]) / 2) : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));
      return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);
    };
    var Trie = (
      /** @class */
      function() {
        function Trie2(initialValue, errorValue, highStart, highValueIndex, index, data) {
          this.initialValue = initialValue;
          this.errorValue = errorValue;
          this.highStart = highStart;
          this.highValueIndex = highValueIndex;
          this.index = index;
          this.data = data;
        }
        Trie2.prototype.get = function(codePoint) {
          var ix;
          if (codePoint >= 0) {
            if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) {
              ix = this.index[codePoint >> UTRIE2_SHIFT_2];
              ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
              return this.data[ix];
            }
            if (codePoint <= 65535) {
              ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 55296 >> UTRIE2_SHIFT_2)];
              ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
              return this.data[ix];
            }
            if (codePoint < this.highStart) {
              ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);
              ix = this.index[ix];
              ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK;
              ix = this.index[ix];
              ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);
              return this.data[ix];
            }
            if (codePoint <= 1114111) {
              return this.data[this.highValueIndex];
            }
          }
          return this.errorValue;
        };
        return Trie2;
      }()
    );
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
    for (var i = 0; i < chars.length; i++) {
      lookup[chars.charCodeAt(i)] = i;
    }
    var Prepend = 1;
    var CR = 2;
    var LF = 3;
    var Control = 4;
    var Extend = 5;
    var SpacingMark = 7;
    var L = 8;
    var V = 9;
    var T = 10;
    var LV = 11;
    var LVT = 12;
    var ZWJ = 13;
    var Extended_Pictographic = 14;
    var RI = 15;
    var toCodePoints = function(str) {
      var codePoints = [];
      var i2 = 0;
      var length = str.length;
      while (i2 < length) {
        var value = str.charCodeAt(i2++);
        if (value >= 55296 && value <= 56319 && i2 < length) {
          var extra = str.charCodeAt(i2++);
          if ((extra & 64512) === 56320) {
            codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536);
          } else {
            codePoints.push(value);
            i2--;
          }
        } else {
          codePoints.push(value);
        }
      }
      return codePoints;
    };
    var fromCodePoint = function() {
      var codePoints = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        codePoints[_i] = arguments[_i];
      }
      if (String.fromCodePoint) {
        return String.fromCodePoint.apply(String, codePoints);
      }
      var length = codePoints.length;
      if (!length) {
        return "";
      }
      var codeUnits = [];
      var index = -1;
      var result = "";
      while (++index < length) {
        var codePoint = codePoints[index];
        if (codePoint <= 65535) {
          codeUnits.push(codePoint);
        } else {
          codePoint -= 65536;
          codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320);
        }
        if (index + 1 === length || codeUnits.length > 16384) {
          result += String.fromCharCode.apply(String, codeUnits);
          codeUnits.length = 0;
        }
      }
      return result;
    };
    var UnicodeTrie = createTrieFromBase64(base64);
    var BREAK_NOT_ALLOWED = "×";
    var BREAK_ALLOWED = "÷";
    var codePointToClass = function(codePoint) {
      return UnicodeTrie.get(codePoint);
    };
    var _graphemeBreakAtIndex = function(_codePoints, classTypes, index) {
      var prevIndex = index - 2;
      var prev = classTypes[prevIndex];
      var current = classTypes[index - 1];
      var next = classTypes[index];
      if (current === CR && next === LF) {
        return BREAK_NOT_ALLOWED;
      }
      if (current === CR || current === LF || current === Control) {
        return BREAK_ALLOWED;
      }
      if (next === CR || next === LF || next === Control) {
        return BREAK_ALLOWED;
      }
      if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) {
        return BREAK_NOT_ALLOWED;
      }
      if ((current === LV || current === V) && (next === V || next === T)) {
        return BREAK_NOT_ALLOWED;
      }
      if ((current === LVT || current === T) && next === T) {
        return BREAK_NOT_ALLOWED;
      }
      if (next === ZWJ || next === Extend) {
        return BREAK_NOT_ALLOWED;
      }
      if (next === SpacingMark) {
        return BREAK_NOT_ALLOWED;
      }
      if (current === Prepend) {
        return BREAK_NOT_ALLOWED;
      }
      if (current === ZWJ && next === Extended_Pictographic) {
        while (prev === Extend) {
          prev = classTypes[--prevIndex];
        }
        if (prev === Extended_Pictographic) {
          return BREAK_NOT_ALLOWED;
        }
      }
      if (current === RI && next === RI) {
        var countRI = 0;
        while (prev === RI) {
          countRI++;
          prev = classTypes[--prevIndex];
        }
        if (countRI % 2 === 0) {
          return BREAK_NOT_ALLOWED;
        }
      }
      return BREAK_ALLOWED;
    };
    var GraphemeBreaker = function(str) {
      var codePoints = toCodePoints(str);
      var length = codePoints.length;
      var index = 0;
      var lastEnd = 0;
      var classTypes = codePoints.map(codePointToClass);
      return {
        next: function() {
          if (index >= length) {
            return { done: true, value: null };
          }
          var graphemeBreak = BREAK_NOT_ALLOWED;
          while (index < length && (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED) {
          }
          if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) {
            var value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index));
            lastEnd = index;
            return { value, done: false };
          }
          return { done: true, value: null };
        }
      };
    };
    var splitGraphemes = function(str) {
      var breaker = GraphemeBreaker(str);
      var graphemes = [];
      var bk;
      while (!(bk = breaker.next()).done) {
        if (bk.value) {
          graphemes.push(bk.value.slice());
        }
      }
      return graphemes;
    };
    var testRangeBounds = function(document2) {
      var TEST_HEIGHT = 123;
      if (document2.createRange) {
        var range2 = document2.createRange();
        if (range2.getBoundingClientRect) {
          var testElement = document2.createElement("boundtest");
          testElement.style.height = TEST_HEIGHT + "px";
          testElement.style.display = "block";
          document2.body.appendChild(testElement);
          range2.selectNode(testElement);
          var rangeBounds = range2.getBoundingClientRect();
          var rangeHeight = Math.round(rangeBounds.height);
          document2.body.removeChild(testElement);
          if (rangeHeight === TEST_HEIGHT) {
            return true;
          }
        }
      }
      return false;
    };
    var testIOSLineBreak = function(document2) {
      var testElement = document2.createElement("boundtest");
      testElement.style.width = "50px";
      testElement.style.display = "block";
      testElement.style.fontSize = "12px";
      testElement.style.letterSpacing = "0px";
      testElement.style.wordSpacing = "0px";
      document2.body.appendChild(testElement);
      var range2 = document2.createRange();
      testElement.innerHTML = typeof "".repeat === "function" ? "&#128104;".repeat(10) : "";
      var node = testElement.firstChild;
      var textList = toCodePoints$1(node.data).map(function(i2) {
        return fromCodePoint$1(i2);
      });
      var offset2 = 0;
      var prev = {};
      var supports = textList.every(function(text, i2) {
        range2.setStart(node, offset2);
        range2.setEnd(node, offset2 + text.length);
        var rect = range2.getBoundingClientRect();
        offset2 += text.length;
        var boundAhead = rect.x > prev.x || rect.y > prev.y;
        prev = rect;
        if (i2 === 0) {
          return true;
        }
        return boundAhead;
      });
      document2.body.removeChild(testElement);
      return supports;
    };
    var testCORS = function() {
      return typeof new Image().crossOrigin !== "undefined";
    };
    var testResponseType = function() {
      return typeof new XMLHttpRequest().responseType === "string";
    };
    var testSVG = function(document2) {
      var img = new Image();
      var canvas = document2.createElement("canvas");
      var ctx = canvas.getContext("2d");
      if (!ctx) {
        return false;
      }
      img.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
      try {
        ctx.drawImage(img, 0, 0);
        canvas.toDataURL();
      } catch (e2) {
        return false;
      }
      return true;
    };
    var isGreenPixel = function(data) {
      return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;
    };
    var testForeignObject = function(document2) {
      var canvas = document2.createElement("canvas");
      var size = 100;
      canvas.width = size;
      canvas.height = size;
      var ctx = canvas.getContext("2d");
      if (!ctx) {
        return Promise.reject(false);
      }
      ctx.fillStyle = "rgb(0, 255, 0)";
      ctx.fillRect(0, 0, size, size);
      var img = new Image();
      var greenImageSrc = canvas.toDataURL();
      img.src = greenImageSrc;
      var svg = createForeignObjectSVG(size, size, 0, 0, img);
      ctx.fillStyle = "red";
      ctx.fillRect(0, 0, size, size);
      return loadSerializedSVG$1(svg).then(function(img2) {
        ctx.drawImage(img2, 0, 0);
        var data = ctx.getImageData(0, 0, size, size).data;
        ctx.fillStyle = "red";
        ctx.fillRect(0, 0, size, size);
        var node = document2.createElement("div");
        node.style.backgroundImage = "url(" + greenImageSrc + ")";
        node.style.height = size + "px";
        return isGreenPixel(data) ? loadSerializedSVG$1(createForeignObjectSVG(size, size, 0, 0, node)) : Promise.reject(false);
      }).then(function(img2) {
        ctx.drawImage(img2, 0, 0);
        return isGreenPixel(ctx.getImageData(0, 0, size, size).data);
      }).catch(function() {
        return false;
      });
    };
    var createForeignObjectSVG = function(width, height, x2, y, node) {
      var xmlns = "http://www.w3.org/2000/svg";
      var svg = document.createElementNS(xmlns, "svg");
      var foreignObject = document.createElementNS(xmlns, "foreignObject");
      svg.setAttributeNS(null, "width", width.toString());
      svg.setAttributeNS(null, "height", height.toString());
      foreignObject.setAttributeNS(null, "width", "100%");
      foreignObject.setAttributeNS(null, "height", "100%");
      foreignObject.setAttributeNS(null, "x", x2.toString());
      foreignObject.setAttributeNS(null, "y", y.toString());
      foreignObject.setAttributeNS(null, "externalResourcesRequired", "true");
      svg.appendChild(foreignObject);
      foreignObject.appendChild(node);
      return svg;
    };
    var loadSerializedSVG$1 = function(svg) {
      return new Promise(function(resolve2, reject) {
        var img = new Image();
        img.onload = function() {
          return resolve2(img);
        };
        img.onerror = reject;
        img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
      });
    };
    var FEATURES = {
      get SUPPORT_RANGE_BOUNDS() {
        var value = testRangeBounds(document);
        Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", { value });
        return value;
      },
      get SUPPORT_WORD_BREAKING() {
        var value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);
        Object.defineProperty(FEATURES, "SUPPORT_WORD_BREAKING", { value });
        return value;
      },
      get SUPPORT_SVG_DRAWING() {
        var value = testSVG(document);
        Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", { value });
        return value;
      },
      get SUPPORT_FOREIGNOBJECT_DRAWING() {
        var value = typeof Array.from === "function" && typeof window.fetch === "function" ? testForeignObject(document) : Promise.resolve(false);
        Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", { value });
        return value;
      },
      get SUPPORT_CORS_IMAGES() {
        var value = testCORS();
        Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", { value });
        return value;
      },
      get SUPPORT_RESPONSE_TYPE() {
        var value = testResponseType();
        Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", { value });
        return value;
      },
      get SUPPORT_CORS_XHR() {
        var value = "withCredentials" in new XMLHttpRequest();
        Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", { value });
        return value;
      },
      get SUPPORT_NATIVE_TEXT_SEGMENTATION() {
        var value = !!(typeof Intl !== "undefined" && Intl.Segmenter);
        Object.defineProperty(FEATURES, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value });
        return value;
      }
    };
    var TextBounds = (
      /** @class */
      /* @__PURE__ */ function() {
        function TextBounds2(text, bounds) {
          this.text = text;
          this.bounds = bounds;
        }
        return TextBounds2;
      }()
    );
    var parseTextBounds = function(context, value, styles, node) {
      var textList = breakText(value, styles);
      var textBounds = [];
      var offset2 = 0;
      textList.forEach(function(text) {
        if (styles.textDecorationLine.length || text.trim().length > 0) {
          if (FEATURES.SUPPORT_RANGE_BOUNDS) {
            var clientRects = createRange(node, offset2, text.length).getClientRects();
            if (clientRects.length > 1) {
              var subSegments = segmentGraphemes(text);
              var subOffset_1 = 0;
              subSegments.forEach(function(subSegment) {
                textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset2, subSegment.length).getClientRects())));
                subOffset_1 += subSegment.length;
              });
            } else {
              textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));
            }
          } else {
            var replacementNode = node.splitText(text.length);
            textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
            node = replacementNode;
          }
        } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {
          node = node.splitText(text.length);
        }
        offset2 += text.length;
      });
      return textBounds;
    };
    var getWrapperBounds = function(context, node) {
      var ownerDocument = node.ownerDocument;
      if (ownerDocument) {
        var wrapper = ownerDocument.createElement("html2canvaswrapper");
        wrapper.appendChild(node.cloneNode(true));
        var parentNode2 = node.parentNode;
        if (parentNode2) {
          parentNode2.replaceChild(wrapper, node);
          var bounds = parseBounds(context, wrapper);
          if (wrapper.firstChild) {
            parentNode2.replaceChild(wrapper.firstChild, wrapper);
          }
          return bounds;
        }
      }
      return Bounds.EMPTY;
    };
    var createRange = function(node, offset2, length) {
      var ownerDocument = node.ownerDocument;
      if (!ownerDocument) {
        throw new Error("Node has no owner document");
      }
      var range2 = ownerDocument.createRange();
      range2.setStart(node, offset2);
      range2.setEnd(node, offset2 + length);
      return range2;
    };
    var segmentGraphemes = function(value) {
      if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
        var segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
        return Array.from(segmenter.segment(value)).map(function(segment) {
          return segment.segment;
        });
      }
      return splitGraphemes(value);
    };
    var segmentWords = function(value, styles) {
      if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
        var segmenter = new Intl.Segmenter(void 0, {
          granularity: "word"
        });
        return Array.from(segmenter.segment(value)).map(function(segment) {
          return segment.segment;
        });
      }
      return breakWords(value, styles);
    };
    var breakText = function(value, styles) {
      return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);
    };
    var wordSeparators = [32, 160, 4961, 65792, 65793, 4153, 4241];
    var breakWords = function(str, styles) {
      var breaker = LineBreaker(str, {
        lineBreak: styles.lineBreak,
        wordBreak: styles.overflowWrap === "break-word" ? "break-word" : styles.wordBreak
      });
      var words = [];
      var bk;
      var _loop_1 = function() {
        if (bk.value) {
          var value = bk.value.slice();
          var codePoints = toCodePoints$1(value);
          var word_1 = "";
          codePoints.forEach(function(codePoint) {
            if (wordSeparators.indexOf(codePoint) === -1) {
              word_1 += fromCodePoint$1(codePoint);
            } else {
              if (word_1.length) {
                words.push(word_1);
              }
              words.push(fromCodePoint$1(codePoint));
              word_1 = "";
            }
          });
          if (word_1.length) {
            words.push(word_1);
          }
        }
      };
      while (!(bk = breaker.next()).done) {
        _loop_1();
      }
      return words;
    };
    var TextContainer = (
      /** @class */
      /* @__PURE__ */ function() {
        function TextContainer2(context, node, styles) {
          this.text = transform(node.data, styles.textTransform);
          this.textBounds = parseTextBounds(context, this.text, styles, node);
        }
        return TextContainer2;
      }()
    );
    var transform = function(text, transform2) {
      switch (transform2) {
        case 1:
          return text.toLowerCase();
        case 3:
          return text.replace(CAPITALIZE, capitalize);
        case 2:
          return text.toUpperCase();
        default:
          return text;
      }
    };
    var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g;
    var capitalize = function(m2, p1, p2) {
      if (m2.length > 0) {
        return p1 + p2.toUpperCase();
      }
      return m2;
    };
    var ImageElementContainer = (
      /** @class */
      function(_super) {
        __extends(ImageElementContainer2, _super);
        function ImageElementContainer2(context, img) {
          var _this = _super.call(this, context, img) || this;
          _this.src = img.currentSrc || img.src;
          _this.intrinsicWidth = img.naturalWidth;
          _this.intrinsicHeight = img.naturalHeight;
          _this.context.cache.addImage(_this.src);
          return _this;
        }
        return ImageElementContainer2;
      }(ElementContainer)
    );
    var CanvasElementContainer = (
      /** @class */
      function(_super) {
        __extends(CanvasElementContainer2, _super);
        function CanvasElementContainer2(context, canvas) {
          var _this = _super.call(this, context, canvas) || this;
          _this.canvas = canvas;
          _this.intrinsicWidth = canvas.width;
          _this.intrinsicHeight = canvas.height;
          return _this;
        }
        return CanvasElementContainer2;
      }(ElementContainer)
    );
    var SVGElementContainer = (
      /** @class */
      function(_super) {
        __extends(SVGElementContainer2, _super);
        function SVGElementContainer2(context, img) {
          var _this = _super.call(this, context, img) || this;
          var s2 = new XMLSerializer();
          var bounds = parseBounds(context, img);
          img.setAttribute("width", bounds.width + "px");
          img.setAttribute("height", bounds.height + "px");
          _this.svg = "data:image/svg+xml," + encodeURIComponent(s2.serializeToString(img));
          _this.intrinsicWidth = img.width.baseVal.value;
          _this.intrinsicHeight = img.height.baseVal.value;
          _this.context.cache.addImage(_this.svg);
          return _this;
        }
        return SVGElementContainer2;
      }(ElementContainer)
    );
    var LIElementContainer = (
      /** @class */
      function(_super) {
        __extends(LIElementContainer2, _super);
        function LIElementContainer2(context, element) {
          var _this = _super.call(this, context, element) || this;
          _this.value = element.value;
          return _this;
        }
        return LIElementContainer2;
      }(ElementContainer)
    );
    var OLElementContainer = (
      /** @class */
      function(_super) {
        __extends(OLElementContainer2, _super);
        function OLElementContainer2(context, element) {
          var _this = _super.call(this, context, element) || this;
          _this.start = element.start;
          _this.reversed = typeof element.reversed === "boolean" && element.reversed === true;
          return _this;
        }
        return OLElementContainer2;
      }(ElementContainer)
    );
    var CHECKBOX_BORDER_RADIUS = [
      {
        type: 15,
        flags: 0,
        unit: "px",
        number: 3
      }
    ];
    var RADIO_BORDER_RADIUS = [
      {
        type: 16,
        flags: 0,
        number: 50
      }
    ];
    var reformatInputBounds = function(bounds) {
      if (bounds.width > bounds.height) {
        return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);
      } else if (bounds.width < bounds.height) {
        return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);
      }
      return bounds;
    };
    var getInputValue = function(node) {
      var value = node.type === PASSWORD ? new Array(node.value.length + 1).join("•") : node.value;
      return value.length === 0 ? node.placeholder || "" : value;
    };
    var CHECKBOX = "checkbox";
    var RADIO = "radio";
    var PASSWORD = "password";
    var INPUT_COLOR = 707406591;
    var InputElementContainer = (
      /** @class */
      function(_super) {
        __extends(InputElementContainer2, _super);
        function InputElementContainer2(context, input) {
          var _this = _super.call(this, context, input) || this;
          _this.type = input.type.toLowerCase();
          _this.checked = input.checked;
          _this.value = getInputValue(input);
          if (_this.type === CHECKBOX || _this.type === RADIO) {
            _this.styles.backgroundColor = 3739148031;
            _this.styles.borderTopColor = _this.styles.borderRightColor = _this.styles.borderBottomColor = _this.styles.borderLeftColor = 2779096575;
            _this.styles.borderTopWidth = _this.styles.borderRightWidth = _this.styles.borderBottomWidth = _this.styles.borderLeftWidth = 1;
            _this.styles.borderTopStyle = _this.styles.borderRightStyle = _this.styles.borderBottomStyle = _this.styles.borderLeftStyle = 1;
            _this.styles.backgroundClip = [
              0
              /* BORDER_BOX */
            ];
            _this.styles.backgroundOrigin = [
              0
              /* BORDER_BOX */
            ];
            _this.bounds = reformatInputBounds(_this.bounds);
          }
          switch (_this.type) {
            case CHECKBOX:
              _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS;
              break;
            case RADIO:
              _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS;
              break;
          }
          return _this;
        }
        return InputElementContainer2;
      }(ElementContainer)
    );
    var SelectElementContainer = (
      /** @class */
      function(_super) {
        __extends(SelectElementContainer2, _super);
        function SelectElementContainer2(context, element) {
          var _this = _super.call(this, context, element) || this;
          var option = element.options[element.selectedIndex || 0];
          _this.value = option ? option.text || "" : "";
          return _this;
        }
        return SelectElementContainer2;
      }(ElementContainer)
    );
    var TextareaElementContainer = (
      /** @class */
      function(_super) {
        __extends(TextareaElementContainer2, _super);
        function TextareaElementContainer2(context, element) {
          var _this = _super.call(this, context, element) || this;
          _this.value = element.value;
          return _this;
        }
        return TextareaElementContainer2;
      }(ElementContainer)
    );
    var IFrameElementContainer = (
      /** @class */
      function(_super) {
        __extends(IFrameElementContainer2, _super);
        function IFrameElementContainer2(context, iframe) {
          var _this = _super.call(this, context, iframe) || this;
          _this.src = iframe.src;
          _this.width = parseInt(iframe.width, 10) || 0;
          _this.height = parseInt(iframe.height, 10) || 0;
          _this.backgroundColor = _this.styles.backgroundColor;
          try {
            if (iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.documentElement) {
              _this.tree = parseTree(context, iframe.contentWindow.document.documentElement);
              var documentBackgroundColor = iframe.contentWindow.document.documentElement ? parseColor(context, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT;
              var bodyBackgroundColor = iframe.contentWindow.document.body ? parseColor(context, getComputedStyle(iframe.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT;
              _this.backgroundColor = isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? _this.styles.backgroundColor : bodyBackgroundColor : documentBackgroundColor;
            }
          } catch (e2) {
          }
          return _this;
        }
        return IFrameElementContainer2;
      }(ElementContainer)
    );
    var LIST_OWNERS = ["OL", "UL", "MENU"];
    var parseNodeTree = function(context, node, parent2, root2) {
      for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
        nextNode = childNode.nextSibling;
        if (isTextNode(childNode) && childNode.data.trim().length > 0) {
          parent2.textNodes.push(new TextContainer(context, childNode, parent2.styles));
        } else if (isElementNode(childNode)) {
          if (isSlotElement(childNode) && childNode.assignedNodes) {
            childNode.assignedNodes().forEach(function(childNode2) {
              return parseNodeTree(context, childNode2, parent2, root2);
            });
          } else {
            var container = createContainer(context, childNode);
            if (container.styles.isVisible()) {
              if (createsRealStackingContext(childNode, container, root2)) {
                container.flags |= 4;
              } else if (createsStackingContext(container.styles)) {
                container.flags |= 2;
              }
              if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {
                container.flags |= 8;
              }
              parent2.elements.push(container);
              childNode.slot;
              if (childNode.shadowRoot) {
                parseNodeTree(context, childNode.shadowRoot, container, root2);
              } else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) {
                parseNodeTree(context, childNode, container, root2);
              }
            }
          }
        }
      }
    };
    var createContainer = function(context, element) {
      if (isImageElement(element)) {
        return new ImageElementContainer(context, element);
      }
      if (isCanvasElement(element)) {
        return new CanvasElementContainer(context, element);
      }
      if (isSVGElement(element)) {
        return new SVGElementContainer(context, element);
      }
      if (isLIElement(element)) {
        return new LIElementContainer(context, element);
      }
      if (isOLElement(element)) {
        return new OLElementContainer(context, element);
      }
      if (isInputElement(element)) {
        return new InputElementContainer(context, element);
      }
      if (isSelectElement(element)) {
        return new SelectElementContainer(context, element);
      }
      if (isTextareaElement(element)) {
        return new TextareaElementContainer(context, element);
      }
      if (isIFrameElement(element)) {
        return new IFrameElementContainer(context, element);
      }
      return new ElementContainer(context, element);
    };
    var parseTree = function(context, element) {
      var container = createContainer(context, element);
      container.flags |= 4;
      parseNodeTree(context, element, container, container);
      return container;
    };
    var createsRealStackingContext = function(node, container, root2) {
      return container.styles.isPositionedWithZIndex() || container.styles.opacity < 1 || container.styles.isTransformed() || isBodyElement(node) && root2.styles.isTransparent();
    };
    var createsStackingContext = function(styles) {
      return styles.isPositioned() || styles.isFloating();
    };
    var isTextNode = function(node) {
      return node.nodeType === Node.TEXT_NODE;
    };
    var isElementNode = function(node) {
      return node.nodeType === Node.ELEMENT_NODE;
    };
    var isHTMLElementNode = function(node) {
      return isElementNode(node) && typeof node.style !== "undefined" && !isSVGElementNode(node);
    };
    var isSVGElementNode = function(element) {
      return typeof element.className === "object";
    };
    var isLIElement = function(node) {
      return node.tagName === "LI";
    };
    var isOLElement = function(node) {
      return node.tagName === "OL";
    };
    var isInputElement = function(node) {
      return node.tagName === "INPUT";
    };
    var isHTMLElement = function(node) {
      return node.tagName === "HTML";
    };
    var isSVGElement = function(node) {
      return node.tagName === "svg";
    };
    var isBodyElement = function(node) {
      return node.tagName === "BODY";
    };
    var isCanvasElement = function(node) {
      return node.tagName === "CANVAS";
    };
    var isVideoElement = function(node) {
      return node.tagName === "VIDEO";
    };
    var isImageElement = function(node) {
      return node.tagName === "IMG";
    };
    var isIFrameElement = function(node) {
      return node.tagName === "IFRAME";
    };
    var isStyleElement = function(node) {
      return node.tagName === "STYLE";
    };
    var isScriptElement = function(node) {
      return node.tagName === "SCRIPT";
    };
    var isTextareaElement = function(node) {
      return node.tagName === "TEXTAREA";
    };
    var isSelectElement = function(node) {
      return node.tagName === "SELECT";
    };
    var isSlotElement = function(node) {
      return node.tagName === "SLOT";
    };
    var isCustomElement = function(node) {
      return node.tagName.indexOf("-") > 0;
    };
    var CounterState = (
      /** @class */
      function() {
        function CounterState2() {
          this.counters = {};
        }
        CounterState2.prototype.getCounterValue = function(name) {
          var counter = this.counters[name];
          if (counter && counter.length) {
            return counter[counter.length - 1];
          }
          return 1;
        };
        CounterState2.prototype.getCounterValues = function(name) {
          var counter = this.counters[name];
          return counter ? counter : [];
        };
        CounterState2.prototype.pop = function(counters) {
          var _this = this;
          counters.forEach(function(counter) {
            return _this.counters[counter].pop();
          });
        };
        CounterState2.prototype.parse = function(style) {
          var _this = this;
          var counterIncrement2 = style.counterIncrement;
          var counterReset2 = style.counterReset;
          var canReset = true;
          if (counterIncrement2 !== null) {
            counterIncrement2.forEach(function(entry) {
              var counter = _this.counters[entry.counter];
              if (counter && entry.increment !== 0) {
                canReset = false;
                if (!counter.length) {
                  counter.push(1);
                }
                counter[Math.max(0, counter.length - 1)] += entry.increment;
              }
            });
          }
          var counterNames = [];
          if (canReset) {
            counterReset2.forEach(function(entry) {
              var counter = _this.counters[entry.counter];
              counterNames.push(entry.counter);
              if (!counter) {
                counter = _this.counters[entry.counter] = [];
              }
              counter.push(entry.reset);
            });
          }
          return counterNames;
        };
        return CounterState2;
      }()
    );
    var ROMAN_UPPER = {
      integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],
      values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"]
    };
    var ARMENIAN = {
      integers: [
        9e3,
        8e3,
        7e3,
        6e3,
        5e3,
        4e3,
        3e3,
        2e3,
        1e3,
        900,
        800,
        700,
        600,
        500,
        400,
        300,
        200,
        100,
        90,
        80,
        70,
        60,
        50,
        40,
        30,
        20,
        10,
        9,
        8,
        7,
        6,
        5,
        4,
        3,
        2,
        1
      ],
      values: [
        "Ք",
        "Փ",
        "Ւ",
        "Ց",
        "Ր",
        "Տ",
        "Վ",
        "Ս",
        "Ռ",
        "Ջ",
        "Պ",
        "Չ",
        "Ո",
        "Շ",
        "Ն",
        "Յ",
        "Մ",
        "Ճ",
        "Ղ",
        "Ձ",
        "Հ",
        "Կ",
        "Ծ",
        "Խ",
        "Լ",
        "Ի",
        "Ժ",
        "Թ",
        "Ը",
        "Է",
        "Զ",
        "Ե",
        "Դ",
        "Գ",
        "Բ",
        "Ա"
      ]
    };
    var HEBREW = {
      integers: [
        1e4,
        9e3,
        8e3,
        7e3,
        6e3,
        5e3,
        4e3,
        3e3,
        2e3,
        1e3,
        400,
        300,
        200,
        100,
        90,
        80,
        70,
        60,
        50,
        40,
        30,
        20,
        19,
        18,
        17,
        16,
        15,
        10,
        9,
        8,
        7,
        6,
        5,
        4,
        3,
        2,
        1
      ],
      values: [
        "י׳",
        "ט׳",
        "ח׳",
        "ז׳",
        "ו׳",
        "ה׳",
        "ד׳",
        "ג׳",
        "ב׳",
        "א׳",
        "ת",
        "ש",
        "ר",
        "ק",
        "צ",
        "פ",
        "ע",
        "ס",
        "נ",
        "מ",
        "ל",
        "כ",
        "יט",
        "יח",
        "יז",
        "טז",
        "טו",
        "י",
        "ט",
        "ח",
        "ז",
        "ו",
        "ה",
        "ד",
        "ג",
        "ב",
        "א"
      ]
    };
    var GEORGIAN = {
      integers: [
        1e4,
        9e3,
        8e3,
        7e3,
        6e3,
        5e3,
        4e3,
        3e3,
        2e3,
        1e3,
        900,
        800,
        700,
        600,
        500,
        400,
        300,
        200,
        100,
        90,
        80,
        70,
        60,
        50,
        40,
        30,
        20,
        10,
        9,
        8,
        7,
        6,
        5,
        4,
        3,
        2,
        1
      ],
      values: [
        "ჵ",
        "ჰ",
        "ჯ",
        "ჴ",
        "ხ",
        "ჭ",
        "წ",
        "ძ",
        "ც",
        "ჩ",
        "შ",
        "ყ",
        "ღ",
        "ქ",
        "ფ",
        "ჳ",
        "ტ",
        "ს",
        "რ",
        "ჟ",
        "პ",
        "ო",
        "ჲ",
        "ნ",
        "მ",
        "ლ",
        "კ",
        "ი",
        "თ",
        "ჱ",
        "ზ",
        "ვ",
        "ე",
        "დ",
        "გ",
        "ბ",
        "ა"
      ]
    };
    var createAdditiveCounter = function(value, min3, max3, symbols, fallback, suffix) {
      if (value < min3 || value > max3) {
        return createCounterText(value, fallback, suffix.length > 0);
      }
      return symbols.integers.reduce(function(string2, integer, index) {
        while (value >= integer) {
          value -= integer;
          string2 += symbols.values[index];
        }
        return string2;
      }, "") + suffix;
    };
    var createCounterStyleWithSymbolResolver = function(value, codePointRangeLength, isNumeric2, resolver) {
      var string2 = "";
      do {
        if (!isNumeric2) {
          value--;
        }
        string2 = resolver(value) + string2;
        value /= codePointRangeLength;
      } while (value * codePointRangeLength >= codePointRangeLength);
      return string2;
    };
    var createCounterStyleFromRange = function(value, codePointRangeStart, codePointRangeEnd, isNumeric2, suffix) {
      var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;
      return (value < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric2, function(codePoint) {
        return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);
      }) + suffix);
    };
    var createCounterStyleFromSymbols = function(value, symbols, suffix) {
      if (suffix === void 0) {
        suffix = ". ";
      }
      var codePointRangeLength = symbols.length;
      return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function(codePoint) {
        return symbols[Math.floor(codePoint % codePointRangeLength)];
      }) + suffix;
    };
    var CJK_ZEROS = 1 << 0;
    var CJK_TEN_COEFFICIENTS = 1 << 1;
    var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;
    var CJK_HUNDRED_COEFFICIENTS = 1 << 3;
    var createCJKCounter = function(value, numbers, multipliers, negativeSign, suffix, flags) {
      if (value < -9999 || value > 9999) {
        return createCounterText(value, 4, suffix.length > 0);
      }
      var tmp = Math.abs(value);
      var string2 = suffix;
      if (tmp === 0) {
        return numbers[0] + string2;
      }
      for (var digit = 0; tmp > 0 && digit <= 4; digit++) {
        var coefficient = tmp % 10;
        if (coefficient === 0 && contains(flags, CJK_ZEROS) && string2 !== "") {
          string2 = numbers[coefficient] + string2;
        } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS)) {
          string2 = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : "") + string2;
        } else if (coefficient === 1 && digit > 0) {
          string2 = multipliers[digit - 1] + string2;
        }
        tmp = Math.floor(tmp / 10);
      }
      return (value < 0 ? negativeSign : "") + string2;
    };
    var CHINESE_INFORMAL_MULTIPLIERS = "十百千萬";
    var CHINESE_FORMAL_MULTIPLIERS = "拾佰仟萬";
    var JAPANESE_NEGATIVE = "マイナス";
    var KOREAN_NEGATIVE = "마이너스";
    var createCounterText = function(value, type, appendSuffix) {
      var defaultSuffix = appendSuffix ? ". " : "";
      var cjkSuffix = appendSuffix ? "、" : "";
      var koreanSuffix = appendSuffix ? ", " : "";
      var spaceSuffix = appendSuffix ? " " : "";
      switch (type) {
        case 0:
          return "•" + spaceSuffix;
        case 1:
          return "◦" + spaceSuffix;
        case 2:
          return "◾" + spaceSuffix;
        case 5:
          var string2 = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
          return string2.length < 4 ? "0" + string2 : string2;
        case 4:
          return createCounterStyleFromSymbols(value, "〇一二三四五六七八九", cjkSuffix);
        case 6:
          return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix).toLowerCase();
        case 7:
          return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix);
        case 8:
          return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);
        case 9:
          return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);
        case 10:
          return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);
        case 11:
          return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);
        case 12:
        case 49:
          return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix);
        case 35:
          return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix).toLowerCase();
        case 13:
          return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);
        case 14:
        case 30:
          return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);
        case 15:
          return createCounterStyleFromSymbols(value, "子丑寅卯辰巳午未申酉戌亥", cjkSuffix);
        case 16:
          return createCounterStyleFromSymbols(value, "甲乙丙丁戊己庚辛壬癸", cjkSuffix);
        case 17:
        case 48:
          return createCJKCounter(value, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case 47:
          return createCJKCounter(value, "零壹貳參肆伍陸柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "負", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case 42:
          return createCJKCounter(value, "零一二三四五六七八九", CHINESE_INFORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case 41:
          return createCJKCounter(value, "零壹贰叁肆伍陆柒捌玖", CHINESE_FORMAL_MULTIPLIERS, "负", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);
        case 26:
          return createCJKCounter(value, "〇一二三四五六七八九", "十百千万", JAPANESE_NEGATIVE, cjkSuffix, 0);
        case 25:
          return createCJKCounter(value, "零壱弐参四伍六七八九", "拾百千万", JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case 31:
          return createCJKCounter(value, "영일이삼사오육칠팔구", "십백천만", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case 33:
          return createCJKCounter(value, "零一二三四五六七八九", "十百千萬", KOREAN_NEGATIVE, koreanSuffix, 0);
        case 32:
          return createCJKCounter(value, "零壹貳參四五六七八九", "拾百千", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);
        case 18:
          return createCounterStyleFromRange(value, 2406, 2415, true, defaultSuffix);
        case 20:
          return createAdditiveCounter(value, 1, 19999, GEORGIAN, 3, defaultSuffix);
        case 21:
          return createCounterStyleFromRange(value, 2790, 2799, true, defaultSuffix);
        case 22:
          return createCounterStyleFromRange(value, 2662, 2671, true, defaultSuffix);
        case 22:
          return createAdditiveCounter(value, 1, 10999, HEBREW, 3, defaultSuffix);
        case 23:
          return createCounterStyleFromSymbols(value, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");
        case 24:
          return createCounterStyleFromSymbols(value, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");
        case 27:
          return createCounterStyleFromRange(value, 3302, 3311, true, defaultSuffix);
        case 28:
          return createCounterStyleFromSymbols(value, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン", cjkSuffix);
        case 29:
          return createCounterStyleFromSymbols(value, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス", cjkSuffix);
        case 34:
          return createCounterStyleFromRange(value, 3792, 3801, true, defaultSuffix);
        case 37:
          return createCounterStyleFromRange(value, 6160, 6169, true, defaultSuffix);
        case 38:
          return createCounterStyleFromRange(value, 4160, 4169, true, defaultSuffix);
        case 39:
          return createCounterStyleFromRange(value, 2918, 2927, true, defaultSuffix);
        case 40:
          return createCounterStyleFromRange(value, 1776, 1785, true, defaultSuffix);
        case 43:
          return createCounterStyleFromRange(value, 3046, 3055, true, defaultSuffix);
        case 44:
          return createCounterStyleFromRange(value, 3174, 3183, true, defaultSuffix);
        case 45:
          return createCounterStyleFromRange(value, 3664, 3673, true, defaultSuffix);
        case 46:
          return createCounterStyleFromRange(value, 3872, 3881, true, defaultSuffix);
        case 3:
        default:
          return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);
      }
    };
    var IGNORE_ATTRIBUTE = "data-html2canvas-ignore";
    var DocumentCloner = (
      /** @class */
      function() {
        function DocumentCloner2(context, element, options) {
          this.context = context;
          this.options = options;
          this.scrolledElements = [];
          this.referenceElement = element;
          this.counters = new CounterState();
          this.quoteDepth = 0;
          if (!element.ownerDocument) {
            throw new Error("Cloned element does not have an owner document");
          }
          this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false);
        }
        DocumentCloner2.prototype.toIFrame = function(ownerDocument, windowSize) {
          var _this = this;
          var iframe = createIFrameContainer(ownerDocument, windowSize);
          if (!iframe.contentWindow) {
            return Promise.reject("Unable to find iframe window");
          }
          var scrollX = ownerDocument.defaultView.pageXOffset;
          var scrollY = ownerDocument.defaultView.pageYOffset;
          var cloneWindow = iframe.contentWindow;
          var documentClone = cloneWindow.document;
          var iframeLoad = iframeLoader(iframe).then(function() {
            return __awaiter(_this, void 0, void 0, function() {
              var onclone, referenceElement;
              return __generator(this, function(_a2) {
                switch (_a2.label) {
                  case 0:
                    this.scrolledElements.forEach(restoreNodeScroll);
                    if (cloneWindow) {
                      cloneWindow.scrollTo(windowSize.left, windowSize.top);
                      if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) {
                        this.context.logger.warn("Unable to restore scroll position for cloned document");
                        this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize.left, cloneWindow.scrollY - windowSize.top, 0, 0);
                      }
                    }
                    onclone = this.options.onclone;
                    referenceElement = this.clonedReferenceElement;
                    if (typeof referenceElement === "undefined") {
                      return [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")];
                    }
                    if (!(documentClone.fonts && documentClone.fonts.ready)) return [3, 2];
                    return [4, documentClone.fonts.ready];
                  case 1:
                    _a2.sent();
                    _a2.label = 2;
                  case 2:
                    if (!/(AppleWebKit)/g.test(navigator.userAgent)) return [3, 4];
                    return [4, imagesReady(documentClone)];
                  case 3:
                    _a2.sent();
                    _a2.label = 4;
                  case 4:
                    if (typeof onclone === "function") {
                      return [2, Promise.resolve().then(function() {
                        return onclone(documentClone, referenceElement);
                      }).then(function() {
                        return iframe;
                      })];
                    }
                    return [2, iframe];
                }
              });
            });
          });
          documentClone.open();
          documentClone.write(serializeDoctype(document.doctype) + "<html></html>");
          restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);
          documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);
          documentClone.close();
          return iframeLoad;
        };
        DocumentCloner2.prototype.createElementClone = function(node) {
          if (isDebugging(
            node,
            2
            /* CLONE */
          )) {
            debugger;
          }
          if (isCanvasElement(node)) {
            return this.createCanvasClone(node);
          }
          if (isVideoElement(node)) {
            return this.createVideoClone(node);
          }
          if (isStyleElement(node)) {
            return this.createStyleClone(node);
          }
          var clone2 = node.cloneNode(false);
          if (isImageElement(clone2)) {
            if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {
              clone2.src = node.currentSrc;
              clone2.srcset = "";
            }
            if (clone2.loading === "lazy") {
              clone2.loading = "eager";
            }
          }
          if (isCustomElement(clone2)) {
            return this.createCustomElementClone(clone2);
          }
          return clone2;
        };
        DocumentCloner2.prototype.createCustomElementClone = function(node) {
          var clone2 = document.createElement("html2canvascustomelement");
          copyCSSStyles(node.style, clone2);
          return clone2;
        };
        DocumentCloner2.prototype.createStyleClone = function(node) {
          try {
            var sheet = node.sheet;
            if (sheet && sheet.cssRules) {
              var css = [].slice.call(sheet.cssRules, 0).reduce(function(css2, rule) {
                if (rule && typeof rule.cssText === "string") {
                  return css2 + rule.cssText;
                }
                return css2;
              }, "");
              var style = node.cloneNode(false);
              style.textContent = css;
              return style;
            }
          } catch (e2) {
            this.context.logger.error("Unable to access cssRules property", e2);
            if (e2.name !== "SecurityError") {
              throw e2;
            }
          }
          return node.cloneNode(false);
        };
        DocumentCloner2.prototype.createCanvasClone = function(canvas) {
          var _a2;
          if (this.options.inlineImages && canvas.ownerDocument) {
            var img = canvas.ownerDocument.createElement("img");
            try {
              img.src = canvas.toDataURL();
              return img;
            } catch (e2) {
              this.context.logger.info("Unable to inline canvas contents, canvas is tainted", canvas);
            }
          }
          var clonedCanvas = canvas.cloneNode(false);
          try {
            clonedCanvas.width = canvas.width;
            clonedCanvas.height = canvas.height;
            var ctx = canvas.getContext("2d");
            var clonedCtx = clonedCanvas.getContext("2d");
            if (clonedCtx) {
              if (!this.options.allowTaint && ctx) {
                clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);
              } else {
                var gl = (_a2 = canvas.getContext("webgl2")) !== null && _a2 !== void 0 ? _a2 : canvas.getContext("webgl");
                if (gl) {
                  var attribs = gl.getContextAttributes();
                  if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) {
                    this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas);
                  }
                }
                clonedCtx.drawImage(canvas, 0, 0);
              }
            }
            return clonedCanvas;
          } catch (e2) {
            this.context.logger.info("Unable to clone canvas as it is tainted", canvas);
          }
          return clonedCanvas;
        };
        DocumentCloner2.prototype.createVideoClone = function(video) {
          var canvas = video.ownerDocument.createElement("canvas");
          canvas.width = video.offsetWidth;
          canvas.height = video.offsetHeight;
          var ctx = canvas.getContext("2d");
          try {
            if (ctx) {
              ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
              if (!this.options.allowTaint) {
                ctx.getImageData(0, 0, canvas.width, canvas.height);
              }
            }
            return canvas;
          } catch (e2) {
            this.context.logger.info("Unable to clone video as it is tainted", video);
          }
          var blankCanvas = video.ownerDocument.createElement("canvas");
          blankCanvas.width = video.offsetWidth;
          blankCanvas.height = video.offsetHeight;
          return blankCanvas;
        };
        DocumentCloner2.prototype.appendChildNode = function(clone2, child, copyStyles) {
          if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) {
            if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {
              clone2.appendChild(this.cloneNode(child, copyStyles));
            }
          }
        };
        DocumentCloner2.prototype.cloneChildNodes = function(node, clone2, copyStyles) {
          var _this = this;
          for (var child = node.shadowRoot ? node.shadowRoot.firstChild : node.firstChild; child; child = child.nextSibling) {
            if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === "function") {
              var assignedNodes = child.assignedNodes();
              if (assignedNodes.length) {
                assignedNodes.forEach(function(assignedNode) {
                  return _this.appendChildNode(clone2, assignedNode, copyStyles);
                });
              }
            } else {
              this.appendChildNode(clone2, child, copyStyles);
            }
          }
        };
        DocumentCloner2.prototype.cloneNode = function(node, copyStyles) {
          if (isTextNode(node)) {
            return document.createTextNode(node.data);
          }
          if (!node.ownerDocument) {
            return node.cloneNode(false);
          }
          var window2 = node.ownerDocument.defaultView;
          if (window2 && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {
            var clone2 = this.createElementClone(node);
            clone2.style.transitionProperty = "none";
            var style = window2.getComputedStyle(node);
            var styleBefore = window2.getComputedStyle(node, ":before");
            var styleAfter = window2.getComputedStyle(node, ":after");
            if (this.referenceElement === node && isHTMLElementNode(clone2)) {
              this.clonedReferenceElement = clone2;
            }
            if (isBodyElement(clone2)) {
              createPseudoHideStyles(clone2);
            }
            var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
            var before = this.resolvePseudoContent(node, clone2, styleBefore, PseudoElementType.BEFORE);
            if (isCustomElement(node)) {
              copyStyles = true;
            }
            if (!isVideoElement(node)) {
              this.cloneChildNodes(node, clone2, copyStyles);
            }
            if (before) {
              clone2.insertBefore(before, clone2.firstChild);
            }
            var after = this.resolvePseudoContent(node, clone2, styleAfter, PseudoElementType.AFTER);
            if (after) {
              clone2.appendChild(after);
            }
            this.counters.pop(counters);
            if (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node) || copyStyles) {
              copyCSSStyles(style, clone2);
            }
            if (node.scrollTop !== 0 || node.scrollLeft !== 0) {
              this.scrolledElements.push([clone2, node.scrollLeft, node.scrollTop]);
            }
            if ((isTextareaElement(node) || isSelectElement(node)) && (isTextareaElement(clone2) || isSelectElement(clone2))) {
              clone2.value = node.value;
            }
            return clone2;
          }
          return node.cloneNode(false);
        };
        DocumentCloner2.prototype.resolvePseudoContent = function(node, clone2, style, pseudoElt) {
          var _this = this;
          if (!style) {
            return;
          }
          var value = style.content;
          var document2 = clone2.ownerDocument;
          if (!document2 || !value || value === "none" || value === "-moz-alt-content" || style.display === "none") {
            return;
          }
          this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));
          var declaration = new CSSParsedPseudoDeclaration(this.context, style);
          var anonymousReplacedElement = document2.createElement("html2canvaspseudoelement");
          copyCSSStyles(style, anonymousReplacedElement);
          declaration.content.forEach(function(token) {
            if (token.type === 0) {
              anonymousReplacedElement.appendChild(document2.createTextNode(token.value));
            } else if (token.type === 22) {
              var img = document2.createElement("img");
              img.src = token.value;
              img.style.opacity = "1";
              anonymousReplacedElement.appendChild(img);
            } else if (token.type === 18) {
              if (token.name === "attr") {
                var attr = token.values.filter(isIdentToken);
                if (attr.length) {
                  anonymousReplacedElement.appendChild(document2.createTextNode(node.getAttribute(attr[0].value) || ""));
                }
              } else if (token.name === "counter") {
                var _a2 = token.values.filter(nonFunctionArgSeparator), counter = _a2[0], counterStyle = _a2[1];
                if (counter && isIdentToken(counter)) {
                  var counterState = _this.counters.getCounterValue(counter.value);
                  var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
                  anonymousReplacedElement.appendChild(document2.createTextNode(createCounterText(counterState, counterType, false)));
                }
              } else if (token.name === "counters") {
                var _b2 = token.values.filter(nonFunctionArgSeparator), counter = _b2[0], delim = _b2[1], counterStyle = _b2[2];
                if (counter && isIdentToken(counter)) {
                  var counterStates = _this.counters.getCounterValues(counter.value);
                  var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3;
                  var separator = delim && delim.type === 0 ? delim.value : "";
                  var text = counterStates.map(function(value2) {
                    return createCounterText(value2, counterType_1, false);
                  }).join(separator);
                  anonymousReplacedElement.appendChild(document2.createTextNode(text));
                }
              } else ;
            } else if (token.type === 20) {
              switch (token.value) {
                case "open-quote":
                  anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true)));
                  break;
                case "close-quote":
                  anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false)));
                  break;
                default:
                  anonymousReplacedElement.appendChild(document2.createTextNode(token.value));
              }
            }
          });
          anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
          var newClassName = pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;
          if (isSVGElementNode(clone2)) {
            clone2.className.baseValue += newClassName;
          } else {
            clone2.className += newClassName;
          }
          return anonymousReplacedElement;
        };
        DocumentCloner2.destroy = function(container) {
          if (container.parentNode) {
            container.parentNode.removeChild(container);
            return true;
          }
          return false;
        };
        return DocumentCloner2;
      }()
    );
    var PseudoElementType;
    (function(PseudoElementType2) {
      PseudoElementType2[PseudoElementType2["BEFORE"] = 0] = "BEFORE";
      PseudoElementType2[PseudoElementType2["AFTER"] = 1] = "AFTER";
    })(PseudoElementType || (PseudoElementType = {}));
    var createIFrameContainer = function(ownerDocument, bounds) {
      var cloneIframeContainer = ownerDocument.createElement("iframe");
      cloneIframeContainer.className = "html2canvas-container";
      cloneIframeContainer.style.visibility = "hidden";
      cloneIframeContainer.style.position = "fixed";
      cloneIframeContainer.style.left = "-10000px";
      cloneIframeContainer.style.top = "0px";
      cloneIframeContainer.style.border = "0";
      cloneIframeContainer.width = bounds.width.toString();
      cloneIframeContainer.height = bounds.height.toString();
      cloneIframeContainer.scrolling = "no";
      cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, "true");
      ownerDocument.body.appendChild(cloneIframeContainer);
      return cloneIframeContainer;
    };
    var imageReady = function(img) {
      return new Promise(function(resolve2) {
        if (img.complete) {
          resolve2();
          return;
        }
        if (!img.src) {
          resolve2();
          return;
        }
        img.onload = resolve2;
        img.onerror = resolve2;
      });
    };
    var imagesReady = function(document2) {
      return Promise.all([].slice.call(document2.images, 0).map(imageReady));
    };
    var iframeLoader = function(iframe) {
      return new Promise(function(resolve2, reject) {
        var cloneWindow = iframe.contentWindow;
        if (!cloneWindow) {
          return reject("No window assigned for iframe");
        }
        var documentClone = cloneWindow.document;
        cloneWindow.onload = iframe.onload = function() {
          cloneWindow.onload = iframe.onload = null;
          var interval = setInterval(function() {
            if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") {
              clearInterval(interval);
              resolve2(iframe);
            }
          }, 50);
        };
      });
    };
    var ignoredStyleProperties = [
      "all",
      "d",
      "content"
      // Safari shows pseudoelements if content is set
    ];
    var copyCSSStyles = function(style, target) {
      for (var i2 = style.length - 1; i2 >= 0; i2--) {
        var property2 = style.item(i2);
        if (ignoredStyleProperties.indexOf(property2) === -1) {
          target.style.setProperty(property2, style.getPropertyValue(property2));
        }
      }
      return target;
    };
    var serializeDoctype = function(doctype) {
      var str = "";
      if (doctype) {
        str += "<!DOCTYPE ";
        if (doctype.name) {
          str += doctype.name;
        }
        if (doctype.internalSubset) {
          str += doctype.internalSubset;
        }
        if (doctype.publicId) {
          str += '"' + doctype.publicId + '"';
        }
        if (doctype.systemId) {
          str += '"' + doctype.systemId + '"';
        }
        str += ">";
      }
      return str;
    };
    var restoreOwnerScroll = function(ownerDocument, x2, y) {
      if (ownerDocument && ownerDocument.defaultView && (x2 !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {
        ownerDocument.defaultView.scrollTo(x2, y);
      }
    };
    var restoreNodeScroll = function(_a2) {
      var element = _a2[0], x2 = _a2[1], y = _a2[2];
      element.scrollLeft = x2;
      element.scrollTop = y;
    };
    var PSEUDO_BEFORE = ":before";
    var PSEUDO_AFTER = ":after";
    var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before";
    var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after";
    var PSEUDO_HIDE_ELEMENT_STYLE = '{\n    content: "" !important;\n    display: none !important;\n}';
    var createPseudoHideStyles = function(body) {
      createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n         ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);
    };
    var createStyles = function(body, styles) {
      var document2 = body.ownerDocument;
      if (document2) {
        var style = document2.createElement("style");
        style.textContent = styles;
        body.appendChild(style);
      }
    };
    var CacheStorage = (
      /** @class */
      function() {
        function CacheStorage2() {
        }
        CacheStorage2.getOrigin = function(url) {
          var link = CacheStorage2._link;
          if (!link) {
            return "about:blank";
          }
          link.href = url;
          link.href = link.href;
          return link.protocol + link.hostname + link.port;
        };
        CacheStorage2.isSameOrigin = function(src) {
          return CacheStorage2.getOrigin(src) === CacheStorage2._origin;
        };
        CacheStorage2.setContext = function(window2) {
          CacheStorage2._link = window2.document.createElement("a");
          CacheStorage2._origin = CacheStorage2.getOrigin(window2.location.href);
        };
        CacheStorage2._origin = "about:blank";
        return CacheStorage2;
      }()
    );
    var Cache = (
      /** @class */
      function() {
        function Cache2(context, _options) {
          this.context = context;
          this._options = _options;
          this._cache = {};
        }
        Cache2.prototype.addImage = function(src) {
          var result = Promise.resolve();
          if (this.has(src)) {
            return result;
          }
          if (isBlobImage(src) || isRenderable(src)) {
            (this._cache[src] = this.loadImage(src)).catch(function() {
            });
            return result;
          }
          return result;
        };
        Cache2.prototype.match = function(src) {
          return this._cache[src];
        };
        Cache2.prototype.loadImage = function(key) {
          return __awaiter(this, void 0, void 0, function() {
            var isSameOrigin, useCORS, useProxy, src;
            var _this = this;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  isSameOrigin = CacheStorage.isSameOrigin(key);
                  useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;
                  useProxy = !isInlineImage(key) && !isSameOrigin && !isBlobImage(key) && typeof this._options.proxy === "string" && FEATURES.SUPPORT_CORS_XHR && !useCORS;
                  if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !isBlobImage(key) && !useProxy && !useCORS) {
                    return [
                      2
                      /*return*/
                    ];
                  }
                  src = key;
                  if (!useProxy) return [3, 2];
                  return [4, this.proxy(src)];
                case 1:
                  src = _a2.sent();
                  _a2.label = 2;
                case 2:
                  this.context.logger.debug("Added image " + key.substring(0, 256));
                  return [4, new Promise(function(resolve2, reject) {
                    var img = new Image();
                    img.onload = function() {
                      return resolve2(img);
                    };
                    img.onerror = reject;
                    if (isInlineBase64Image(src) || useCORS) {
                      img.crossOrigin = "anonymous";
                    }
                    img.src = src;
                    if (img.complete === true) {
                      setTimeout(function() {
                        return resolve2(img);
                      }, 500);
                    }
                    if (_this._options.imageTimeout > 0) {
                      setTimeout(function() {
                        return reject("Timed out (" + _this._options.imageTimeout + "ms) loading image");
                      }, _this._options.imageTimeout);
                    }
                  })];
                case 3:
                  return [2, _a2.sent()];
              }
            });
          });
        };
        Cache2.prototype.has = function(key) {
          return typeof this._cache[key] !== "undefined";
        };
        Cache2.prototype.keys = function() {
          return Promise.resolve(Object.keys(this._cache));
        };
        Cache2.prototype.proxy = function(src) {
          var _this = this;
          var proxy = this._options.proxy;
          if (!proxy) {
            throw new Error("No proxy defined");
          }
          var key = src.substring(0, 256);
          return new Promise(function(resolve2, reject) {
            var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
            var xhr = new XMLHttpRequest();
            xhr.onload = function() {
              if (xhr.status === 200) {
                if (responseType === "text") {
                  resolve2(xhr.response);
                } else {
                  var reader_1 = new FileReader();
                  reader_1.addEventListener("load", function() {
                    return resolve2(reader_1.result);
                  }, false);
                  reader_1.addEventListener("error", function(e2) {
                    return reject(e2);
                  }, false);
                  reader_1.readAsDataURL(xhr.response);
                }
              } else {
                reject("Failed to proxy resource " + key + " with status code " + xhr.status);
              }
            };
            xhr.onerror = reject;
            var queryString = proxy.indexOf("?") > -1 ? "&" : "?";
            xhr.open("GET", "" + proxy + queryString + "url=" + encodeURIComponent(src) + "&responseType=" + responseType);
            if (responseType !== "text" && xhr instanceof XMLHttpRequest) {
              xhr.responseType = responseType;
            }
            if (_this._options.imageTimeout) {
              var timeout_1 = _this._options.imageTimeout;
              xhr.timeout = timeout_1;
              xhr.ontimeout = function() {
                return reject("Timed out (" + timeout_1 + "ms) proxying " + key);
              };
            }
            xhr.send();
          });
        };
        return Cache2;
      }()
    );
    var INLINE_SVG = /^data:image\/svg\+xml/i;
    var INLINE_BASE64 = /^data:image\/.*;base64,/i;
    var INLINE_IMG = /^data:image\/.*/i;
    var isRenderable = function(src) {
      return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src);
    };
    var isInlineImage = function(src) {
      return INLINE_IMG.test(src);
    };
    var isInlineBase64Image = function(src) {
      return INLINE_BASE64.test(src);
    };
    var isBlobImage = function(src) {
      return src.substr(0, 4) === "blob";
    };
    var isSVG = function(src) {
      return src.substr(-3).toLowerCase() === "svg" || INLINE_SVG.test(src);
    };
    var Vector = (
      /** @class */
      function() {
        function Vector2(x2, y) {
          this.type = 0;
          this.x = x2;
          this.y = y;
        }
        Vector2.prototype.add = function(deltaX, deltaY) {
          return new Vector2(this.x + deltaX, this.y + deltaY);
        };
        return Vector2;
      }()
    );
    var lerp = function(a2, b2, t) {
      return new Vector(a2.x + (b2.x - a2.x) * t, a2.y + (b2.y - a2.y) * t);
    };
    var BezierCurve = (
      /** @class */
      function() {
        function BezierCurve2(start2, startControl, endControl, end2) {
          this.type = 1;
          this.start = start2;
          this.startControl = startControl;
          this.endControl = endControl;
          this.end = end2;
        }
        BezierCurve2.prototype.subdivide = function(t, firstHalf) {
          var ab = lerp(this.start, this.startControl, t);
          var bc = lerp(this.startControl, this.endControl, t);
          var cd = lerp(this.endControl, this.end, t);
          var abbc = lerp(ab, bc, t);
          var bccd = lerp(bc, cd, t);
          var dest = lerp(abbc, bccd, t);
          return firstHalf ? new BezierCurve2(this.start, ab, abbc, dest) : new BezierCurve2(dest, bccd, cd, this.end);
        };
        BezierCurve2.prototype.add = function(deltaX, deltaY) {
          return new BezierCurve2(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));
        };
        BezierCurve2.prototype.reverse = function() {
          return new BezierCurve2(this.end, this.endControl, this.startControl, this.start);
        };
        return BezierCurve2;
      }()
    );
    var isBezierCurve = function(path) {
      return path.type === 1;
    };
    var BoundCurves = (
      /** @class */
      /* @__PURE__ */ function() {
        function BoundCurves2(element) {
          var styles = element.styles;
          var bounds = element.bounds;
          var _a2 = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a2[0], tlv = _a2[1];
          var _b2 = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b2[0], trv = _b2[1];
          var _c2 = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c2[0], brv = _c2[1];
          var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1];
          var factors = [];
          factors.push((tlh + trh) / bounds.width);
          factors.push((blh + brh) / bounds.width);
          factors.push((tlv + blv) / bounds.height);
          factors.push((trv + brv) / bounds.height);
          var maxFactor = Math.max.apply(Math, factors);
          if (maxFactor > 1) {
            tlh /= maxFactor;
            tlv /= maxFactor;
            trh /= maxFactor;
            trv /= maxFactor;
            brh /= maxFactor;
            brv /= maxFactor;
            blh /= maxFactor;
            blv /= maxFactor;
          }
          var topWidth = bounds.width - trh;
          var rightHeight = bounds.height - brv;
          var bottomWidth = bounds.width - brh;
          var leftHeight = bounds.height - blv;
          var borderTopWidth2 = styles.borderTopWidth;
          var borderRightWidth2 = styles.borderRightWidth;
          var borderBottomWidth2 = styles.borderBottomWidth;
          var borderLeftWidth2 = styles.borderLeftWidth;
          var paddingTop2 = getAbsoluteValue(styles.paddingTop, element.bounds.width);
          var paddingRight2 = getAbsoluteValue(styles.paddingRight, element.bounds.width);
          var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, element.bounds.width);
          var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, element.bounds.width);
          this.topLeftBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3, tlh - borderLeftWidth2 / 3, tlv - borderTopWidth2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3);
          this.topRightBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 3, trh - borderRightWidth2 / 3, trv - borderTopWidth2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + borderTopWidth2 / 3);
          this.bottomRightBorderDoubleOuterBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 3, brv - borderBottomWidth2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3);
          this.bottomLeftBorderDoubleOuterBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 / 3, blv - borderBottomWidth2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3);
          this.topLeftBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3, tlh - borderLeftWidth2 * 2 / 3, tlv - borderTopWidth2 * 2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3);
          this.topRightBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 * 2 / 3, trh - borderRightWidth2 * 2 / 3, trv - borderTopWidth2 * 2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3);
          this.bottomRightBorderDoubleInnerBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 * 2 / 3, brv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3);
          this.bottomLeftBorderDoubleInnerBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 * 2 / 3, blv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3);
          this.topLeftBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2, tlh - borderLeftWidth2 / 2, tlv - borderTopWidth2 / 2, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2);
          this.topRightBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 2, trh - borderRightWidth2 / 2, trv - borderTopWidth2 / 2, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + borderTopWidth2 / 2);
          this.bottomRightBorderStroke = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 2, brv - borderBottomWidth2 / 2, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2);
          this.bottomLeftBorderStroke = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + leftHeight, blh - borderLeftWidth2 / 2, blv - borderBottomWidth2 / 2, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2);
          this.topLeftBorderBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new Vector(bounds.left, bounds.top);
          this.topRightBorderBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top);
          this.bottomRightBorderBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);
          this.bottomLeftBorderBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new Vector(bounds.left, bounds.top + bounds.height);
          this.topLeftPaddingBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2, Math.max(0, tlh - borderLeftWidth2), Math.max(0, tlv - borderTopWidth2), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2);
          this.topRightPaddingBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width - borderRightWidth2), bounds.top + borderTopWidth2, topWidth > bounds.width + borderRightWidth2 ? 0 : Math.max(0, trh - borderRightWidth2), Math.max(0, trv - borderTopWidth2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + borderTopWidth2);
          this.bottomRightPaddingBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth2), bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth2), Math.max(0, brh - borderRightWidth2), Math.max(0, brv - borderBottomWidth2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + bounds.height - borderBottomWidth2);
          this.bottomLeftPaddingBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth2), Math.max(0, blh - borderLeftWidth2), Math.max(0, blv - borderBottomWidth2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + bounds.height - borderBottomWidth2);
          this.topLeftContentBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2, Math.max(0, tlh - (borderLeftWidth2 + paddingLeft2)), Math.max(0, tlv - (borderTopWidth2 + paddingTop2)), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2);
          this.topRightContentBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth2 + paddingLeft2), bounds.top + borderTopWidth2 + paddingTop2, topWidth > bounds.width + borderLeftWidth2 + paddingLeft2 ? 0 : trh - borderLeftWidth2 + paddingLeft2, trv - (borderTopWidth2 + paddingTop2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + borderTopWidth2 + paddingTop2);
          this.bottomRightContentBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth2 + paddingLeft2)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth2 + paddingTop2), Math.max(0, brh - (borderRightWidth2 + paddingRight2)), brv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
          this.bottomLeftContentBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth2 + paddingLeft2)), blv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2));
        }
        return BoundCurves2;
      }()
    );
    var CORNER;
    (function(CORNER2) {
      CORNER2[CORNER2["TOP_LEFT"] = 0] = "TOP_LEFT";
      CORNER2[CORNER2["TOP_RIGHT"] = 1] = "TOP_RIGHT";
      CORNER2[CORNER2["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT";
      CORNER2[CORNER2["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT";
    })(CORNER || (CORNER = {}));
    var getCurvePoints = function(x2, y, r1, r2, position2) {
      var kappa = 4 * ((Math.sqrt(2) - 1) / 3);
      var ox = r1 * kappa;
      var oy = r2 * kappa;
      var xm = x2 + r1;
      var ym = y + r2;
      switch (position2) {
        case CORNER.TOP_LEFT:
          return new BezierCurve(new Vector(x2, ym), new Vector(x2, ym - oy), new Vector(xm - ox, y), new Vector(xm, y));
        case CORNER.TOP_RIGHT:
          return new BezierCurve(new Vector(x2, y), new Vector(x2 + ox, y), new Vector(xm, ym - oy), new Vector(xm, ym));
        case CORNER.BOTTOM_RIGHT:
          return new BezierCurve(new Vector(xm, y), new Vector(xm, y + oy), new Vector(x2 + ox, ym), new Vector(x2, ym));
        case CORNER.BOTTOM_LEFT:
        default:
          return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x2, y + oy), new Vector(x2, y));
      }
    };
    var calculateBorderBoxPath = function(curves) {
      return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];
    };
    var calculateContentBoxPath = function(curves) {
      return [
        curves.topLeftContentBox,
        curves.topRightContentBox,
        curves.bottomRightContentBox,
        curves.bottomLeftContentBox
      ];
    };
    var calculatePaddingBoxPath = function(curves) {
      return [
        curves.topLeftPaddingBox,
        curves.topRightPaddingBox,
        curves.bottomRightPaddingBox,
        curves.bottomLeftPaddingBox
      ];
    };
    var TransformEffect = (
      /** @class */
      /* @__PURE__ */ function() {
        function TransformEffect2(offsetX, offsetY, matrix2) {
          this.offsetX = offsetX;
          this.offsetY = offsetY;
          this.matrix = matrix2;
          this.type = 0;
          this.target = 2 | 4;
        }
        return TransformEffect2;
      }()
    );
    var ClipEffect = (
      /** @class */
      /* @__PURE__ */ function() {
        function ClipEffect2(path, target) {
          this.path = path;
          this.target = target;
          this.type = 1;
        }
        return ClipEffect2;
      }()
    );
    var OpacityEffect = (
      /** @class */
      /* @__PURE__ */ function() {
        function OpacityEffect2(opacity2) {
          this.opacity = opacity2;
          this.type = 2;
          this.target = 2 | 4;
        }
        return OpacityEffect2;
      }()
    );
    var isTransformEffect = function(effect) {
      return effect.type === 0;
    };
    var isClipEffect = function(effect) {
      return effect.type === 1;
    };
    var isOpacityEffect = function(effect) {
      return effect.type === 2;
    };
    var equalPath = function(a2, b2) {
      if (a2.length === b2.length) {
        return a2.some(function(v4, i2) {
          return v4 === b2[i2];
        });
      }
      return false;
    };
    var transformPath = function(path, deltaX, deltaY, deltaW, deltaH) {
      return path.map(function(point, index) {
        switch (index) {
          case 0:
            return point.add(deltaX, deltaY);
          case 1:
            return point.add(deltaX + deltaW, deltaY);
          case 2:
            return point.add(deltaX + deltaW, deltaY + deltaH);
          case 3:
            return point.add(deltaX, deltaY + deltaH);
        }
        return point;
      });
    };
    var StackingContext = (
      /** @class */
      /* @__PURE__ */ function() {
        function StackingContext2(container) {
          this.element = container;
          this.inlineLevel = [];
          this.nonInlineLevel = [];
          this.negativeZIndex = [];
          this.zeroOrAutoZIndexOrTransformedOrOpacity = [];
          this.positiveZIndex = [];
          this.nonPositionedFloats = [];
          this.nonPositionedInlineLevel = [];
        }
        return StackingContext2;
      }()
    );
    var ElementPaint = (
      /** @class */
      function() {
        function ElementPaint2(container, parent2) {
          this.container = container;
          this.parent = parent2;
          this.effects = [];
          this.curves = new BoundCurves(this.container);
          if (this.container.styles.opacity < 1) {
            this.effects.push(new OpacityEffect(this.container.styles.opacity));
          }
          if (this.container.styles.transform !== null) {
            var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;
            var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;
            var matrix2 = this.container.styles.transform;
            this.effects.push(new TransformEffect(offsetX, offsetY, matrix2));
          }
          if (this.container.styles.overflowX !== 0) {
            var borderBox = calculateBorderBoxPath(this.curves);
            var paddingBox2 = calculatePaddingBoxPath(this.curves);
            if (equalPath(borderBox, paddingBox2)) {
              this.effects.push(new ClipEffect(
                borderBox,
                2 | 4
                /* CONTENT */
              ));
            } else {
              this.effects.push(new ClipEffect(
                borderBox,
                2
                /* BACKGROUND_BORDERS */
              ));
              this.effects.push(new ClipEffect(
                paddingBox2,
                4
                /* CONTENT */
              ));
            }
          }
        }
        ElementPaint2.prototype.getEffects = function(target) {
          var inFlow = [
            2,
            3
            /* FIXED */
          ].indexOf(this.container.styles.position) === -1;
          var parent2 = this.parent;
          var effects = this.effects.slice(0);
          while (parent2) {
            var croplessEffects = parent2.effects.filter(function(effect) {
              return !isClipEffect(effect);
            });
            if (inFlow || parent2.container.styles.position !== 0 || !parent2.parent) {
              effects.unshift.apply(effects, croplessEffects);
              inFlow = [
                2,
                3
                /* FIXED */
              ].indexOf(parent2.container.styles.position) === -1;
              if (parent2.container.styles.overflowX !== 0) {
                var borderBox = calculateBorderBoxPath(parent2.curves);
                var paddingBox2 = calculatePaddingBoxPath(parent2.curves);
                if (!equalPath(borderBox, paddingBox2)) {
                  effects.unshift(new ClipEffect(
                    paddingBox2,
                    2 | 4
                    /* CONTENT */
                  ));
                }
              }
            } else {
              effects.unshift.apply(effects, croplessEffects);
            }
            parent2 = parent2.parent;
          }
          return effects.filter(function(effect) {
            return contains(effect.target, target);
          });
        };
        return ElementPaint2;
      }()
    );
    var parseStackTree = function(parent2, stackingContext, realStackingContext, listItems) {
      parent2.container.elements.forEach(function(child) {
        var treatAsRealStackingContext = contains(
          child.flags,
          4
          /* CREATES_REAL_STACKING_CONTEXT */
        );
        var createsStackingContext2 = contains(
          child.flags,
          2
          /* CREATES_STACKING_CONTEXT */
        );
        var paintContainer = new ElementPaint(child, parent2);
        if (contains(
          child.styles.display,
          2048
          /* LIST_ITEM */
        )) {
          listItems.push(paintContainer);
        }
        var listOwnerItems = contains(
          child.flags,
          8
          /* IS_LIST_OWNER */
        ) ? [] : listItems;
        if (treatAsRealStackingContext || createsStackingContext2) {
          var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;
          var stack2 = new StackingContext(paintContainer);
          if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {
            var order_1 = child.styles.zIndex.order;
            if (order_1 < 0) {
              var index_1 = 0;
              parentStack.negativeZIndex.some(function(current, i2) {
                if (order_1 > current.element.container.styles.zIndex.order) {
                  index_1 = i2;
                  return false;
                } else if (index_1 > 0) {
                  return true;
                }
                return false;
              });
              parentStack.negativeZIndex.splice(index_1, 0, stack2);
            } else if (order_1 > 0) {
              var index_2 = 0;
              parentStack.positiveZIndex.some(function(current, i2) {
                if (order_1 >= current.element.container.styles.zIndex.order) {
                  index_2 = i2 + 1;
                  return false;
                } else if (index_2 > 0) {
                  return true;
                }
                return false;
              });
              parentStack.positiveZIndex.splice(index_2, 0, stack2);
            } else {
              parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack2);
            }
          } else {
            if (child.styles.isFloating()) {
              parentStack.nonPositionedFloats.push(stack2);
            } else {
              parentStack.nonPositionedInlineLevel.push(stack2);
            }
          }
          parseStackTree(paintContainer, stack2, treatAsRealStackingContext ? stack2 : realStackingContext, listOwnerItems);
        } else {
          if (child.styles.isInlineLevel()) {
            stackingContext.inlineLevel.push(paintContainer);
          } else {
            stackingContext.nonInlineLevel.push(paintContainer);
          }
          parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);
        }
        if (contains(
          child.flags,
          8
          /* IS_LIST_OWNER */
        )) {
          processListItems(child, listOwnerItems);
        }
      });
    };
    var processListItems = function(owner, elements) {
      var numbering = owner instanceof OLElementContainer ? owner.start : 1;
      var reversed = owner instanceof OLElementContainer ? owner.reversed : false;
      for (var i2 = 0; i2 < elements.length; i2++) {
        var item = elements[i2];
        if (item.container instanceof LIElementContainer && typeof item.container.value === "number" && item.container.value !== 0) {
          numbering = item.container.value;
        }
        item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);
        numbering += reversed ? -1 : 1;
      }
    };
    var parseStackingContexts = function(container) {
      var paintContainer = new ElementPaint(container, null);
      var root2 = new StackingContext(paintContainer);
      var listItems = [];
      parseStackTree(paintContainer, root2, root2, listItems);
      processListItems(paintContainer.container, listItems);
      return root2;
    };
    var parsePathForBorder = function(curves, borderSide) {
      switch (borderSide) {
        case 0:
          return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox);
        case 1:
          return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox);
        case 2:
          return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox);
        case 3:
        default:
          return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox);
      }
    };
    var parsePathForBorderDoubleOuter = function(curves, borderSide) {
      switch (borderSide) {
        case 0:
          return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox, curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox);
        case 1:
          return createPathFromCurves(curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox, curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox);
        case 2:
          return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox, curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox);
        case 3:
        default:
          return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox, curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox);
      }
    };
    var parsePathForBorderDoubleInner = function(curves, borderSide) {
      switch (borderSide) {
        case 0:
          return createPathFromCurves(curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox, curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox);
        case 1:
          return createPathFromCurves(curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox, curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox);
        case 2:
          return createPathFromCurves(curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox);
        case 3:
        default:
          return createPathFromCurves(curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox, curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox);
      }
    };
    var parsePathForBorderStroke = function(curves, borderSide) {
      switch (borderSide) {
        case 0:
          return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);
        case 1:
          return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);
        case 2:
          return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);
        case 3:
        default:
          return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);
      }
    };
    var createStrokePathFromCurves = function(outer1, outer2) {
      var path = [];
      if (isBezierCurve(outer1)) {
        path.push(outer1.subdivide(0.5, false));
      } else {
        path.push(outer1);
      }
      if (isBezierCurve(outer2)) {
        path.push(outer2.subdivide(0.5, true));
      } else {
        path.push(outer2);
      }
      return path;
    };
    var createPathFromCurves = function(outer1, inner1, outer2, inner2) {
      var path = [];
      if (isBezierCurve(outer1)) {
        path.push(outer1.subdivide(0.5, false));
      } else {
        path.push(outer1);
      }
      if (isBezierCurve(outer2)) {
        path.push(outer2.subdivide(0.5, true));
      } else {
        path.push(outer2);
      }
      if (isBezierCurve(inner2)) {
        path.push(inner2.subdivide(0.5, true).reverse());
      } else {
        path.push(inner2);
      }
      if (isBezierCurve(inner1)) {
        path.push(inner1.subdivide(0.5, false).reverse());
      } else {
        path.push(inner1);
      }
      return path;
    };
    var paddingBox = function(element) {
      var bounds = element.bounds;
      var styles = element.styles;
      return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth));
    };
    var contentBox = function(element) {
      var styles = element.styles;
      var bounds = element.bounds;
      var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, bounds.width);
      var paddingRight2 = getAbsoluteValue(styles.paddingRight, bounds.width);
      var paddingTop2 = getAbsoluteValue(styles.paddingTop, bounds.width);
      var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, bounds.width);
      return bounds.add(paddingLeft2 + styles.borderLeftWidth, paddingTop2 + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft2 + paddingRight2), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop2 + paddingBottom2));
    };
    var calculateBackgroundPositioningArea = function(backgroundOrigin2, element) {
      if (backgroundOrigin2 === 0) {
        return element.bounds;
      }
      if (backgroundOrigin2 === 2) {
        return contentBox(element);
      }
      return paddingBox(element);
    };
    var calculateBackgroundPaintingArea = function(backgroundClip2, element) {
      if (backgroundClip2 === 0) {
        return element.bounds;
      }
      if (backgroundClip2 === 2) {
        return contentBox(element);
      }
      return paddingBox(element);
    };
    var calculateBackgroundRendering = function(container, index, intrinsicSize) {
      var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index), container);
      var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index), container);
      var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea);
      var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];
      var position2 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);
      var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position2, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);
      var offsetX = Math.round(backgroundPositioningArea.left + position2[0]);
      var offsetY = Math.round(backgroundPositioningArea.top + position2[1]);
      return [path, offsetX, offsetY, sizeWidth, sizeHeight];
    };
    var isAuto = function(token) {
      return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO;
    };
    var hasIntrinsicValue = function(value) {
      return typeof value === "number";
    };
    var calculateBackgroundSize = function(size, _a2, bounds) {
      var intrinsicWidth = _a2[0], intrinsicHeight = _a2[1], intrinsicProportion = _a2[2];
      var first = size[0], second = size[1];
      if (!first) {
        return [0, 0];
      }
      if (isLengthPercentage(first) && second && isLengthPercentage(second)) {
        return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];
      }
      var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);
      if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {
        if (hasIntrinsicValue(intrinsicProportion)) {
          var targetRatio = bounds.width / bounds.height;
          return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER) ? [bounds.width, bounds.width / intrinsicProportion] : [bounds.height * intrinsicProportion, bounds.height];
        }
        return [bounds.width, bounds.height];
      }
      var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);
      var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);
      var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;
      if (isAuto(first) && (!second || isAuto(second))) {
        if (hasIntrinsicWidth && hasIntrinsicHeight) {
          return [intrinsicWidth, intrinsicHeight];
        }
        if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {
          return [bounds.width, bounds.height];
        }
        if (hasIntrinsicDimensions && hasIntrinsicProportion) {
          var width_1 = hasIntrinsicWidth ? intrinsicWidth : intrinsicHeight * intrinsicProportion;
          var height_1 = hasIntrinsicHeight ? intrinsicHeight : intrinsicWidth / intrinsicProportion;
          return [width_1, height_1];
        }
        var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width;
        var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height;
        return [width_2, height_2];
      }
      if (hasIntrinsicProportion) {
        var width_3 = 0;
        var height_3 = 0;
        if (isLengthPercentage(first)) {
          width_3 = getAbsoluteValue(first, bounds.width);
        } else if (isLengthPercentage(second)) {
          height_3 = getAbsoluteValue(second, bounds.height);
        }
        if (isAuto(first)) {
          width_3 = height_3 * intrinsicProportion;
        } else if (!second || isAuto(second)) {
          height_3 = width_3 / intrinsicProportion;
        }
        return [width_3, height_3];
      }
      var width = null;
      var height = null;
      if (isLengthPercentage(first)) {
        width = getAbsoluteValue(first, bounds.width);
      } else if (second && isLengthPercentage(second)) {
        height = getAbsoluteValue(second, bounds.height);
      }
      if (width !== null && (!second || isAuto(second))) {
        height = hasIntrinsicWidth && hasIntrinsicHeight ? width / intrinsicWidth * intrinsicHeight : bounds.height;
      }
      if (height !== null && isAuto(first)) {
        width = hasIntrinsicWidth && hasIntrinsicHeight ? height / intrinsicHeight * intrinsicWidth : bounds.width;
      }
      if (width !== null && height !== null) {
        return [width, height];
      }
      throw new Error("Unable to calculate background-size for element");
    };
    var getBackgroundValueForIndex = function(values, index) {
      var value = values[index];
      if (typeof value === "undefined") {
        return values[0];
      }
      return value;
    };
    var calculateBackgroundRepeatPath = function(repeat, _a2, _b2, backgroundPositioningArea, backgroundPaintingArea) {
      var x2 = _a2[0], y = _a2[1];
      var width = _b2[0], height = _b2[1];
      switch (repeat) {
        case 2:
          return [
            new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),
            new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y)),
            new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height + backgroundPositioningArea.top + y)),
            new Vector(Math.round(backgroundPositioningArea.left), Math.round(height + backgroundPositioningArea.top + y))
          ];
        case 3:
          return [
            new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top)),
            new Vector(Math.round(backgroundPositioningArea.left + x2 + width), Math.round(backgroundPositioningArea.top)),
            new Vector(Math.round(backgroundPositioningArea.left + x2 + width), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),
            new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))
          ];
        case 1:
          return [
            new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top + y)),
            new Vector(Math.round(backgroundPositioningArea.left + x2 + width), Math.round(backgroundPositioningArea.top + y)),
            new Vector(Math.round(backgroundPositioningArea.left + x2 + width), Math.round(backgroundPositioningArea.top + y + height)),
            new Vector(Math.round(backgroundPositioningArea.left + x2), Math.round(backgroundPositioningArea.top + y + height))
          ];
        default:
          return [
            new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),
            new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),
            new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),
            new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))
          ];
      }
    };
    var SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
    var SAMPLE_TEXT = "Hidden Text";
    var FontMetrics = (
      /** @class */
      function() {
        function FontMetrics2(document2) {
          this._data = {};
          this._document = document2;
        }
        FontMetrics2.prototype.parseMetrics = function(fontFamily2, fontSize2) {
          var container = this._document.createElement("div");
          var img = this._document.createElement("img");
          var span = this._document.createElement("span");
          var body = this._document.body;
          container.style.visibility = "hidden";
          container.style.fontFamily = fontFamily2;
          container.style.fontSize = fontSize2;
          container.style.margin = "0";
          container.style.padding = "0";
          container.style.whiteSpace = "nowrap";
          body.appendChild(container);
          img.src = SMALL_IMAGE;
          img.width = 1;
          img.height = 1;
          img.style.margin = "0";
          img.style.padding = "0";
          img.style.verticalAlign = "baseline";
          span.style.fontFamily = fontFamily2;
          span.style.fontSize = fontSize2;
          span.style.margin = "0";
          span.style.padding = "0";
          span.appendChild(this._document.createTextNode(SAMPLE_TEXT));
          container.appendChild(span);
          container.appendChild(img);
          var baseline = img.offsetTop - span.offsetTop + 2;
          container.removeChild(span);
          container.appendChild(this._document.createTextNode(SAMPLE_TEXT));
          container.style.lineHeight = "normal";
          img.style.verticalAlign = "super";
          var middle = img.offsetTop - container.offsetTop + 2;
          body.removeChild(container);
          return { baseline, middle };
        };
        FontMetrics2.prototype.getMetrics = function(fontFamily2, fontSize2) {
          var key = fontFamily2 + " " + fontSize2;
          if (typeof this._data[key] === "undefined") {
            this._data[key] = this.parseMetrics(fontFamily2, fontSize2);
          }
          return this._data[key];
        };
        return FontMetrics2;
      }()
    );
    var Renderer = (
      /** @class */
      /* @__PURE__ */ function() {
        function Renderer2(context, options) {
          this.context = context;
          this.options = options;
        }
        return Renderer2;
      }()
    );
    var MASK_OFFSET = 1e4;
    var CanvasRenderer = (
      /** @class */
      function(_super) {
        __extends(CanvasRenderer2, _super);
        function CanvasRenderer2(context, options) {
          var _this = _super.call(this, context, options) || this;
          _this._activeEffects = [];
          _this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
          _this.ctx = _this.canvas.getContext("2d");
          if (!options.canvas) {
            _this.canvas.width = Math.floor(options.width * options.scale);
            _this.canvas.height = Math.floor(options.height * options.scale);
            _this.canvas.style.width = options.width + "px";
            _this.canvas.style.height = options.height + "px";
          }
          _this.fontMetrics = new FontMetrics(document);
          _this.ctx.scale(_this.options.scale, _this.options.scale);
          _this.ctx.translate(-options.x, -options.y);
          _this.ctx.textBaseline = "bottom";
          _this._activeEffects = [];
          _this.context.logger.debug("Canvas renderer initialized (" + options.width + "x" + options.height + ") with scale " + options.scale);
          return _this;
        }
        CanvasRenderer2.prototype.applyEffects = function(effects) {
          var _this = this;
          while (this._activeEffects.length) {
            this.popEffect();
          }
          effects.forEach(function(effect) {
            return _this.applyEffect(effect);
          });
        };
        CanvasRenderer2.prototype.applyEffect = function(effect) {
          this.ctx.save();
          if (isOpacityEffect(effect)) {
            this.ctx.globalAlpha = effect.opacity;
          }
          if (isTransformEffect(effect)) {
            this.ctx.translate(effect.offsetX, effect.offsetY);
            this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);
            this.ctx.translate(-effect.offsetX, -effect.offsetY);
          }
          if (isClipEffect(effect)) {
            this.path(effect.path);
            this.ctx.clip();
          }
          this._activeEffects.push(effect);
        };
        CanvasRenderer2.prototype.popEffect = function() {
          this._activeEffects.pop();
          this.ctx.restore();
        };
        CanvasRenderer2.prototype.renderStack = function(stack2) {
          return __awaiter(this, void 0, void 0, function() {
            var styles;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  styles = stack2.element.container.styles;
                  if (!styles.isVisible()) return [3, 2];
                  return [4, this.renderStackContent(stack2)];
                case 1:
                  _a2.sent();
                  _a2.label = 2;
                case 2:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderNode = function(paint) {
          return __awaiter(this, void 0, void 0, function() {
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  if (contains(
                    paint.container.flags,
                    16
                    /* DEBUG_RENDER */
                  )) {
                    debugger;
                  }
                  if (!paint.container.styles.isVisible()) return [3, 3];
                  return [4, this.renderNodeBackgroundAndBorders(paint)];
                case 1:
                  _a2.sent();
                  return [4, this.renderNodeContent(paint)];
                case 2:
                  _a2.sent();
                  _a2.label = 3;
                case 3:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderTextWithLetterSpacing = function(text, letterSpacing2, baseline) {
          var _this = this;
          if (letterSpacing2 === 0) {
            this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);
          } else {
            var letters = segmentGraphemes(text.text);
            letters.reduce(function(left, letter) {
              _this.ctx.fillText(letter, left, text.bounds.top + baseline);
              return left + _this.ctx.measureText(letter).width;
            }, text.bounds.left);
          }
        };
        CanvasRenderer2.prototype.createFontStyle = function(styles) {
          var fontVariant2 = styles.fontVariant.filter(function(variant) {
            return variant === "normal" || variant === "small-caps";
          }).join("");
          var fontFamily2 = fixIOSSystemFonts(styles.fontFamily).join(", ");
          var fontSize2 = isDimensionToken(styles.fontSize) ? "" + styles.fontSize.number + styles.fontSize.unit : styles.fontSize.number + "px";
          return [
            [styles.fontStyle, fontVariant2, styles.fontWeight, fontSize2, fontFamily2].join(" "),
            fontFamily2,
            fontSize2
          ];
        };
        CanvasRenderer2.prototype.renderTextNode = function(text, styles) {
          return __awaiter(this, void 0, void 0, function() {
            var _a2, font, fontFamily2, fontSize2, _b2, baseline, middle, paintOrder2;
            var _this = this;
            return __generator(this, function(_c2) {
              _a2 = this.createFontStyle(styles), font = _a2[0], fontFamily2 = _a2[1], fontSize2 = _a2[2];
              this.ctx.font = font;
              this.ctx.direction = styles.direction === 1 ? "rtl" : "ltr";
              this.ctx.textAlign = "left";
              this.ctx.textBaseline = "alphabetic";
              _b2 = this.fontMetrics.getMetrics(fontFamily2, fontSize2), baseline = _b2.baseline, middle = _b2.middle;
              paintOrder2 = styles.paintOrder;
              text.textBounds.forEach(function(text2) {
                paintOrder2.forEach(function(paintOrderLayer) {
                  switch (paintOrderLayer) {
                    case 0:
                      _this.ctx.fillStyle = asString(styles.color);
                      _this.renderTextWithLetterSpacing(text2, styles.letterSpacing, baseline);
                      var textShadows = styles.textShadow;
                      if (textShadows.length && text2.text.trim().length) {
                        textShadows.slice(0).reverse().forEach(function(textShadow2) {
                          _this.ctx.shadowColor = asString(textShadow2.color);
                          _this.ctx.shadowOffsetX = textShadow2.offsetX.number * _this.options.scale;
                          _this.ctx.shadowOffsetY = textShadow2.offsetY.number * _this.options.scale;
                          _this.ctx.shadowBlur = textShadow2.blur.number;
                          _this.renderTextWithLetterSpacing(text2, styles.letterSpacing, baseline);
                        });
                        _this.ctx.shadowColor = "";
                        _this.ctx.shadowOffsetX = 0;
                        _this.ctx.shadowOffsetY = 0;
                        _this.ctx.shadowBlur = 0;
                      }
                      if (styles.textDecorationLine.length) {
                        _this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);
                        styles.textDecorationLine.forEach(function(textDecorationLine2) {
                          switch (textDecorationLine2) {
                            case 1:
                              _this.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top + baseline), text2.bounds.width, 1);
                              break;
                            case 2:
                              _this.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top), text2.bounds.width, 1);
                              break;
                            case 3:
                              _this.ctx.fillRect(text2.bounds.left, Math.ceil(text2.bounds.top + middle), text2.bounds.width, 1);
                              break;
                          }
                        });
                      }
                      break;
                    case 1:
                      if (styles.webkitTextStrokeWidth && text2.text.trim().length) {
                        _this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);
                        _this.ctx.lineWidth = styles.webkitTextStrokeWidth;
                        _this.ctx.lineJoin = !!window.chrome ? "miter" : "round";
                        _this.ctx.strokeText(text2.text, text2.bounds.left, text2.bounds.top + baseline);
                      }
                      _this.ctx.strokeStyle = "";
                      _this.ctx.lineWidth = 0;
                      _this.ctx.lineJoin = "miter";
                      break;
                  }
                });
              });
              return [
                2
                /*return*/
              ];
            });
          });
        };
        CanvasRenderer2.prototype.renderReplacedElement = function(container, curves, image2) {
          if (image2 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {
            var box2 = contentBox(container);
            var path = calculatePaddingBoxPath(curves);
            this.path(path);
            this.ctx.save();
            this.ctx.clip();
            this.ctx.drawImage(image2, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box2.left, box2.top, box2.width, box2.height);
            this.ctx.restore();
          }
        };
        CanvasRenderer2.prototype.renderNodeContent = function(paint) {
          return __awaiter(this, void 0, void 0, function() {
            var container, curves, styles, _i, _a2, child, image2, image2, iframeRenderer, canvas, size, _b2, fontFamily2, fontSize2, baseline, bounds, x2, textBounds, img, image2, url, fontFamily2, bounds;
            return __generator(this, function(_c2) {
              switch (_c2.label) {
                case 0:
                  this.applyEffects(paint.getEffects(
                    4
                    /* CONTENT */
                  ));
                  container = paint.container;
                  curves = paint.curves;
                  styles = container.styles;
                  _i = 0, _a2 = container.textNodes;
                  _c2.label = 1;
                case 1:
                  if (!(_i < _a2.length)) return [3, 4];
                  child = _a2[_i];
                  return [4, this.renderTextNode(child, styles)];
                case 2:
                  _c2.sent();
                  _c2.label = 3;
                case 3:
                  _i++;
                  return [3, 1];
                case 4:
                  if (!(container instanceof ImageElementContainer)) return [3, 8];
                  _c2.label = 5;
                case 5:
                  _c2.trys.push([5, 7, , 8]);
                  return [4, this.context.cache.match(container.src)];
                case 6:
                  image2 = _c2.sent();
                  this.renderReplacedElement(container, curves, image2);
                  return [3, 8];
                case 7:
                  _c2.sent();
                  this.context.logger.error("Error loading image " + container.src);
                  return [3, 8];
                case 8:
                  if (container instanceof CanvasElementContainer) {
                    this.renderReplacedElement(container, curves, container.canvas);
                  }
                  if (!(container instanceof SVGElementContainer)) return [3, 12];
                  _c2.label = 9;
                case 9:
                  _c2.trys.push([9, 11, , 12]);
                  return [4, this.context.cache.match(container.svg)];
                case 10:
                  image2 = _c2.sent();
                  this.renderReplacedElement(container, curves, image2);
                  return [3, 12];
                case 11:
                  _c2.sent();
                  this.context.logger.error("Error loading svg " + container.svg.substring(0, 255));
                  return [3, 12];
                case 12:
                  if (!(container instanceof IFrameElementContainer && container.tree)) return [3, 14];
                  iframeRenderer = new CanvasRenderer2(this.context, {
                    scale: this.options.scale,
                    backgroundColor: container.backgroundColor,
                    x: 0,
                    y: 0,
                    width: container.width,
                    height: container.height
                  });
                  return [4, iframeRenderer.render(container.tree)];
                case 13:
                  canvas = _c2.sent();
                  if (container.width && container.height) {
                    this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);
                  }
                  _c2.label = 14;
                case 14:
                  if (container instanceof InputElementContainer) {
                    size = Math.min(container.bounds.width, container.bounds.height);
                    if (container.type === CHECKBOX) {
                      if (container.checked) {
                        this.ctx.save();
                        this.path([
                          new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),
                          new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),
                          new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),
                          new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),
                          new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),
                          new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),
                          new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)
                        ]);
                        this.ctx.fillStyle = asString(INPUT_COLOR);
                        this.ctx.fill();
                        this.ctx.restore();
                      }
                    } else if (container.type === RADIO) {
                      if (container.checked) {
                        this.ctx.save();
                        this.ctx.beginPath();
                        this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);
                        this.ctx.fillStyle = asString(INPUT_COLOR);
                        this.ctx.fill();
                        this.ctx.restore();
                      }
                    }
                  }
                  if (isTextInputElement(container) && container.value.length) {
                    _b2 = this.createFontStyle(styles), fontFamily2 = _b2[0], fontSize2 = _b2[1];
                    baseline = this.fontMetrics.getMetrics(fontFamily2, fontSize2).baseline;
                    this.ctx.font = fontFamily2;
                    this.ctx.fillStyle = asString(styles.color);
                    this.ctx.textBaseline = "alphabetic";
                    this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);
                    bounds = contentBox(container);
                    x2 = 0;
                    switch (container.styles.textAlign) {
                      case 1:
                        x2 += bounds.width / 2;
                        break;
                      case 2:
                        x2 += bounds.width;
                        break;
                    }
                    textBounds = bounds.add(x2, 0, 0, -bounds.height / 2 + 1);
                    this.ctx.save();
                    this.path([
                      new Vector(bounds.left, bounds.top),
                      new Vector(bounds.left + bounds.width, bounds.top),
                      new Vector(bounds.left + bounds.width, bounds.top + bounds.height),
                      new Vector(bounds.left, bounds.top + bounds.height)
                    ]);
                    this.ctx.clip();
                    this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing, baseline);
                    this.ctx.restore();
                    this.ctx.textBaseline = "alphabetic";
                    this.ctx.textAlign = "left";
                  }
                  if (!contains(
                    container.styles.display,
                    2048
                    /* LIST_ITEM */
                  )) return [3, 20];
                  if (!(container.styles.listStyleImage !== null)) return [3, 19];
                  img = container.styles.listStyleImage;
                  if (!(img.type === 0)) return [3, 18];
                  image2 = void 0;
                  url = img.url;
                  _c2.label = 15;
                case 15:
                  _c2.trys.push([15, 17, , 18]);
                  return [4, this.context.cache.match(url)];
                case 16:
                  image2 = _c2.sent();
                  this.ctx.drawImage(image2, container.bounds.left - (image2.width + 10), container.bounds.top);
                  return [3, 18];
                case 17:
                  _c2.sent();
                  this.context.logger.error("Error loading list-style-image " + url);
                  return [3, 18];
                case 18:
                  return [3, 20];
                case 19:
                  if (paint.listValue && container.styles.listStyleType !== -1) {
                    fontFamily2 = this.createFontStyle(styles)[0];
                    this.ctx.font = fontFamily2;
                    this.ctx.fillStyle = asString(styles.color);
                    this.ctx.textBaseline = "middle";
                    this.ctx.textAlign = "right";
                    bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);
                    this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2);
                    this.ctx.textBaseline = "bottom";
                    this.ctx.textAlign = "left";
                  }
                  _c2.label = 20;
                case 20:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderStackContent = function(stack2) {
          return __awaiter(this, void 0, void 0, function() {
            var _i, _a2, child, _b2, _c2, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
            return __generator(this, function(_p) {
              switch (_p.label) {
                case 0:
                  if (contains(
                    stack2.element.container.flags,
                    16
                    /* DEBUG_RENDER */
                  )) {
                    debugger;
                  }
                  return [4, this.renderNodeBackgroundAndBorders(stack2.element)];
                case 1:
                  _p.sent();
                  _i = 0, _a2 = stack2.negativeZIndex;
                  _p.label = 2;
                case 2:
                  if (!(_i < _a2.length)) return [3, 5];
                  child = _a2[_i];
                  return [4, this.renderStack(child)];
                case 3:
                  _p.sent();
                  _p.label = 4;
                case 4:
                  _i++;
                  return [3, 2];
                case 5:
                  return [4, this.renderNodeContent(stack2.element)];
                case 6:
                  _p.sent();
                  _b2 = 0, _c2 = stack2.nonInlineLevel;
                  _p.label = 7;
                case 7:
                  if (!(_b2 < _c2.length)) return [3, 10];
                  child = _c2[_b2];
                  return [4, this.renderNode(child)];
                case 8:
                  _p.sent();
                  _p.label = 9;
                case 9:
                  _b2++;
                  return [3, 7];
                case 10:
                  _d = 0, _e = stack2.nonPositionedFloats;
                  _p.label = 11;
                case 11:
                  if (!(_d < _e.length)) return [3, 14];
                  child = _e[_d];
                  return [4, this.renderStack(child)];
                case 12:
                  _p.sent();
                  _p.label = 13;
                case 13:
                  _d++;
                  return [3, 11];
                case 14:
                  _f = 0, _g = stack2.nonPositionedInlineLevel;
                  _p.label = 15;
                case 15:
                  if (!(_f < _g.length)) return [3, 18];
                  child = _g[_f];
                  return [4, this.renderStack(child)];
                case 16:
                  _p.sent();
                  _p.label = 17;
                case 17:
                  _f++;
                  return [3, 15];
                case 18:
                  _h = 0, _j = stack2.inlineLevel;
                  _p.label = 19;
                case 19:
                  if (!(_h < _j.length)) return [3, 22];
                  child = _j[_h];
                  return [4, this.renderNode(child)];
                case 20:
                  _p.sent();
                  _p.label = 21;
                case 21:
                  _h++;
                  return [3, 19];
                case 22:
                  _k = 0, _l = stack2.zeroOrAutoZIndexOrTransformedOrOpacity;
                  _p.label = 23;
                case 23:
                  if (!(_k < _l.length)) return [3, 26];
                  child = _l[_k];
                  return [4, this.renderStack(child)];
                case 24:
                  _p.sent();
                  _p.label = 25;
                case 25:
                  _k++;
                  return [3, 23];
                case 26:
                  _m = 0, _o = stack2.positiveZIndex;
                  _p.label = 27;
                case 27:
                  if (!(_m < _o.length)) return [3, 30];
                  child = _o[_m];
                  return [4, this.renderStack(child)];
                case 28:
                  _p.sent();
                  _p.label = 29;
                case 29:
                  _m++;
                  return [3, 27];
                case 30:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.mask = function(paths) {
          this.ctx.beginPath();
          this.ctx.moveTo(0, 0);
          this.ctx.lineTo(this.canvas.width, 0);
          this.ctx.lineTo(this.canvas.width, this.canvas.height);
          this.ctx.lineTo(0, this.canvas.height);
          this.ctx.lineTo(0, 0);
          this.formatPath(paths.slice(0).reverse());
          this.ctx.closePath();
        };
        CanvasRenderer2.prototype.path = function(paths) {
          this.ctx.beginPath();
          this.formatPath(paths);
          this.ctx.closePath();
        };
        CanvasRenderer2.prototype.formatPath = function(paths) {
          var _this = this;
          paths.forEach(function(point, index) {
            var start2 = isBezierCurve(point) ? point.start : point;
            if (index === 0) {
              _this.ctx.moveTo(start2.x, start2.y);
            } else {
              _this.ctx.lineTo(start2.x, start2.y);
            }
            if (isBezierCurve(point)) {
              _this.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);
            }
          });
        };
        CanvasRenderer2.prototype.renderRepeat = function(path, pattern, offsetX, offsetY) {
          this.path(path);
          this.ctx.fillStyle = pattern;
          this.ctx.translate(offsetX, offsetY);
          this.ctx.fill();
          this.ctx.translate(-offsetX, -offsetY);
        };
        CanvasRenderer2.prototype.resizeImage = function(image2, width, height) {
          var _a2;
          if (image2.width === width && image2.height === height) {
            return image2;
          }
          var ownerDocument = (_a2 = this.canvas.ownerDocument) !== null && _a2 !== void 0 ? _a2 : document;
          var canvas = ownerDocument.createElement("canvas");
          canvas.width = Math.max(1, width);
          canvas.height = Math.max(1, height);
          var ctx = canvas.getContext("2d");
          ctx.drawImage(image2, 0, 0, image2.width, image2.height, 0, 0, width, height);
          return canvas;
        };
        CanvasRenderer2.prototype.renderBackgroundImage = function(container) {
          return __awaiter(this, void 0, void 0, function() {
            var index, _loop_1, this_1, _i, _a2, backgroundImage2;
            return __generator(this, function(_b2) {
              switch (_b2.label) {
                case 0:
                  index = container.styles.backgroundImage.length - 1;
                  _loop_1 = function(backgroundImage3) {
                    var image2, url, _c2, path, x2, y, width, height, pattern, _d, path, x2, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path, left, top_1, width, height, position2, x2, y, _g, rx, ry, radialGradient_1, midX, midY, f2, invF;
                    return __generator(this, function(_h) {
                      switch (_h.label) {
                        case 0:
                          if (!(backgroundImage3.type === 0)) return [3, 5];
                          image2 = void 0;
                          url = backgroundImage3.url;
                          _h.label = 1;
                        case 1:
                          _h.trys.push([1, 3, , 4]);
                          return [4, this_1.context.cache.match(url)];
                        case 2:
                          image2 = _h.sent();
                          return [3, 4];
                        case 3:
                          _h.sent();
                          this_1.context.logger.error("Error loading background-image " + url);
                          return [3, 4];
                        case 4:
                          if (image2) {
                            _c2 = calculateBackgroundRendering(container, index, [
                              image2.width,
                              image2.height,
                              image2.width / image2.height
                            ]), path = _c2[0], x2 = _c2[1], y = _c2[2], width = _c2[3], height = _c2[4];
                            pattern = this_1.ctx.createPattern(this_1.resizeImage(image2, width, height), "repeat");
                            this_1.renderRepeat(path, pattern, x2, y);
                          }
                          return [3, 6];
                        case 5:
                          if (isLinearGradient(backgroundImage3)) {
                            _d = calculateBackgroundRendering(container, index, [null, null, null]), path = _d[0], x2 = _d[1], y = _d[2], width = _d[3], height = _d[4];
                            _e = calculateGradientDirection(backgroundImage3.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];
                            canvas = document.createElement("canvas");
                            canvas.width = width;
                            canvas.height = height;
                            ctx = canvas.getContext("2d");
                            gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1);
                            processColorStops(backgroundImage3.stops, lineLength).forEach(function(colorStop) {
                              return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
                            });
                            ctx.fillStyle = gradient_1;
                            ctx.fillRect(0, 0, width, height);
                            if (width > 0 && height > 0) {
                              pattern = this_1.ctx.createPattern(canvas, "repeat");
                              this_1.renderRepeat(path, pattern, x2, y);
                            }
                          } else if (isRadialGradient(backgroundImage3)) {
                            _f = calculateBackgroundRendering(container, index, [
                              null,
                              null,
                              null
                            ]), path = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4];
                            position2 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position;
                            x2 = getAbsoluteValue(position2[0], width);
                            y = getAbsoluteValue(position2[position2.length - 1], height);
                            _g = calculateRadius(backgroundImage3, x2, y, width, height), rx = _g[0], ry = _g[1];
                            if (rx > 0 && ry > 0) {
                              radialGradient_1 = this_1.ctx.createRadialGradient(left + x2, top_1 + y, 0, left + x2, top_1 + y, rx);
                              processColorStops(backgroundImage3.stops, rx * 2).forEach(function(colorStop) {
                                return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));
                              });
                              this_1.path(path);
                              this_1.ctx.fillStyle = radialGradient_1;
                              if (rx !== ry) {
                                midX = container.bounds.left + 0.5 * container.bounds.width;
                                midY = container.bounds.top + 0.5 * container.bounds.height;
                                f2 = ry / rx;
                                invF = 1 / f2;
                                this_1.ctx.save();
                                this_1.ctx.translate(midX, midY);
                                this_1.ctx.transform(1, 0, 0, f2, 0, 0);
                                this_1.ctx.translate(-midX, -midY);
                                this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF);
                                this_1.ctx.restore();
                              } else {
                                this_1.ctx.fill();
                              }
                            }
                          }
                          _h.label = 6;
                        case 6:
                          index--;
                          return [
                            2
                            /*return*/
                          ];
                      }
                    });
                  };
                  this_1 = this;
                  _i = 0, _a2 = container.styles.backgroundImage.slice(0).reverse();
                  _b2.label = 1;
                case 1:
                  if (!(_i < _a2.length)) return [3, 4];
                  backgroundImage2 = _a2[_i];
                  return [5, _loop_1(backgroundImage2)];
                case 2:
                  _b2.sent();
                  _b2.label = 3;
                case 3:
                  _i++;
                  return [3, 1];
                case 4:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderSolidBorder = function(color2, side, curvePoints) {
          return __awaiter(this, void 0, void 0, function() {
            return __generator(this, function(_a2) {
              this.path(parsePathForBorder(curvePoints, side));
              this.ctx.fillStyle = asString(color2);
              this.ctx.fill();
              return [
                2
                /*return*/
              ];
            });
          });
        };
        CanvasRenderer2.prototype.renderDoubleBorder = function(color2, width, side, curvePoints) {
          return __awaiter(this, void 0, void 0, function() {
            var outerPaths, innerPaths;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  if (!(width < 3)) return [3, 2];
                  return [4, this.renderSolidBorder(color2, side, curvePoints)];
                case 1:
                  _a2.sent();
                  return [
                    2
                    /*return*/
                  ];
                case 2:
                  outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);
                  this.path(outerPaths);
                  this.ctx.fillStyle = asString(color2);
                  this.ctx.fill();
                  innerPaths = parsePathForBorderDoubleInner(curvePoints, side);
                  this.path(innerPaths);
                  this.ctx.fill();
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderNodeBackgroundAndBorders = function(paint) {
          return __awaiter(this, void 0, void 0, function() {
            var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
            var _this = this;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  this.applyEffects(paint.getEffects(
                    2
                    /* BACKGROUND_BORDERS */
                  ));
                  styles = paint.container.styles;
                  hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;
                  borders = [
                    { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },
                    { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },
                    { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },
                    { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }
                  ];
                  backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);
                  if (!(hasBackground || styles.boxShadow.length)) return [3, 2];
                  this.ctx.save();
                  this.path(backgroundPaintingArea);
                  this.ctx.clip();
                  if (!isTransparent(styles.backgroundColor)) {
                    this.ctx.fillStyle = asString(styles.backgroundColor);
                    this.ctx.fill();
                  }
                  return [4, this.renderBackgroundImage(paint.container)];
                case 1:
                  _a2.sent();
                  this.ctx.restore();
                  styles.boxShadow.slice(0).reverse().forEach(function(shadow) {
                    _this.ctx.save();
                    var borderBoxArea = calculateBorderBoxPath(paint.curves);
                    var maskOffset = shadow.inset ? 0 : MASK_OFFSET;
                    var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));
                    if (shadow.inset) {
                      _this.path(borderBoxArea);
                      _this.ctx.clip();
                      _this.mask(shadowPaintingArea);
                    } else {
                      _this.mask(borderBoxArea);
                      _this.ctx.clip();
                      _this.path(shadowPaintingArea);
                    }
                    _this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;
                    _this.ctx.shadowOffsetY = shadow.offsetY.number;
                    _this.ctx.shadowColor = asString(shadow.color);
                    _this.ctx.shadowBlur = shadow.blur.number;
                    _this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : "rgba(0,0,0,1)";
                    _this.ctx.fill();
                    _this.ctx.restore();
                  });
                  _a2.label = 2;
                case 2:
                  side = 0;
                  _i = 0, borders_1 = borders;
                  _a2.label = 3;
                case 3:
                  if (!(_i < borders_1.length)) return [3, 13];
                  border = borders_1[_i];
                  if (!(border.style !== 0 && !isTransparent(border.color) && border.width > 0)) return [3, 11];
                  if (!(border.style === 2)) return [3, 5];
                  return [4, this.renderDashedDottedBorder(
                    border.color,
                    border.width,
                    side,
                    paint.curves,
                    2
                    /* DASHED */
                  )];
                case 4:
                  _a2.sent();
                  return [3, 11];
                case 5:
                  if (!(border.style === 3)) return [3, 7];
                  return [4, this.renderDashedDottedBorder(
                    border.color,
                    border.width,
                    side,
                    paint.curves,
                    3
                    /* DOTTED */
                  )];
                case 6:
                  _a2.sent();
                  return [3, 11];
                case 7:
                  if (!(border.style === 4)) return [3, 9];
                  return [4, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];
                case 8:
                  _a2.sent();
                  return [3, 11];
                case 9:
                  return [4, this.renderSolidBorder(border.color, side, paint.curves)];
                case 10:
                  _a2.sent();
                  _a2.label = 11;
                case 11:
                  side++;
                  _a2.label = 12;
                case 12:
                  _i++;
                  return [3, 3];
                case 13:
                  return [
                    2
                    /*return*/
                  ];
              }
            });
          });
        };
        CanvasRenderer2.prototype.renderDashedDottedBorder = function(color2, width, side, curvePoints, style) {
          return __awaiter(this, void 0, void 0, function() {
            var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
            return __generator(this, function(_a2) {
              this.ctx.save();
              strokePaths = parsePathForBorderStroke(curvePoints, side);
              boxPaths = parsePathForBorder(curvePoints, side);
              if (style === 2) {
                this.path(boxPaths);
                this.ctx.clip();
              }
              if (isBezierCurve(boxPaths[0])) {
                startX = boxPaths[0].start.x;
                startY = boxPaths[0].start.y;
              } else {
                startX = boxPaths[0].x;
                startY = boxPaths[0].y;
              }
              if (isBezierCurve(boxPaths[1])) {
                endX = boxPaths[1].end.x;
                endY = boxPaths[1].end.y;
              } else {
                endX = boxPaths[1].x;
                endY = boxPaths[1].y;
              }
              if (side === 0 || side === 2) {
                length = Math.abs(startX - endX);
              } else {
                length = Math.abs(startY - endY);
              }
              this.ctx.beginPath();
              if (style === 3) {
                this.formatPath(strokePaths);
              } else {
                this.formatPath(boxPaths.slice(0, 2));
              }
              dashLength = width < 3 ? width * 3 : width * 2;
              spaceLength = width < 3 ? width * 2 : width;
              if (style === 3) {
                dashLength = width;
                spaceLength = width;
              }
              useLineDash = true;
              if (length <= dashLength * 2) {
                useLineDash = false;
              } else if (length <= dashLength * 2 + spaceLength) {
                multiplier = length / (2 * dashLength + spaceLength);
                dashLength *= multiplier;
                spaceLength *= multiplier;
              } else {
                numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));
                minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);
                maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;
                spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace;
              }
              if (useLineDash) {
                if (style === 3) {
                  this.ctx.setLineDash([0, dashLength + spaceLength]);
                } else {
                  this.ctx.setLineDash([dashLength, spaceLength]);
                }
              }
              if (style === 3) {
                this.ctx.lineCap = "round";
                this.ctx.lineWidth = width;
              } else {
                this.ctx.lineWidth = width * 2 + 1.1;
              }
              this.ctx.strokeStyle = asString(color2);
              this.ctx.stroke();
              this.ctx.setLineDash([]);
              if (style === 2) {
                if (isBezierCurve(boxPaths[0])) {
                  path1 = boxPaths[3];
                  path2 = boxPaths[0];
                  this.ctx.beginPath();
                  this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
                  this.ctx.stroke();
                }
                if (isBezierCurve(boxPaths[1])) {
                  path1 = boxPaths[1];
                  path2 = boxPaths[2];
                  this.ctx.beginPath();
                  this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);
                  this.ctx.stroke();
                }
              }
              this.ctx.restore();
              return [
                2
                /*return*/
              ];
            });
          });
        };
        CanvasRenderer2.prototype.render = function(element) {
          return __awaiter(this, void 0, void 0, function() {
            var stack2;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  if (this.options.backgroundColor) {
                    this.ctx.fillStyle = asString(this.options.backgroundColor);
                    this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);
                  }
                  stack2 = parseStackingContexts(element);
                  return [4, this.renderStack(stack2)];
                case 1:
                  _a2.sent();
                  this.applyEffects([]);
                  return [2, this.canvas];
              }
            });
          });
        };
        return CanvasRenderer2;
      }(Renderer)
    );
    var isTextInputElement = function(container) {
      if (container instanceof TextareaElementContainer) {
        return true;
      } else if (container instanceof SelectElementContainer) {
        return true;
      } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {
        return true;
      }
      return false;
    };
    var calculateBackgroundCurvedPaintingArea = function(clip2, curves) {
      switch (clip2) {
        case 0:
          return calculateBorderBoxPath(curves);
        case 2:
          return calculateContentBoxPath(curves);
        case 1:
        default:
          return calculatePaddingBoxPath(curves);
      }
    };
    var canvasTextAlign = function(textAlign2) {
      switch (textAlign2) {
        case 1:
          return "center";
        case 2:
          return "right";
        case 0:
        default:
          return "left";
      }
    };
    var iOSBrokenFonts = ["-apple-system", "system-ui"];
    var fixIOSSystemFonts = function(fontFamilies) {
      return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent) ? fontFamilies.filter(function(fontFamily2) {
        return iOSBrokenFonts.indexOf(fontFamily2) === -1;
      }) : fontFamilies;
    };
    var ForeignObjectRenderer = (
      /** @class */
      function(_super) {
        __extends(ForeignObjectRenderer2, _super);
        function ForeignObjectRenderer2(context, options) {
          var _this = _super.call(this, context, options) || this;
          _this.canvas = options.canvas ? options.canvas : document.createElement("canvas");
          _this.ctx = _this.canvas.getContext("2d");
          _this.options = options;
          _this.canvas.width = Math.floor(options.width * options.scale);
          _this.canvas.height = Math.floor(options.height * options.scale);
          _this.canvas.style.width = options.width + "px";
          _this.canvas.style.height = options.height + "px";
          _this.ctx.scale(_this.options.scale, _this.options.scale);
          _this.ctx.translate(-options.x, -options.y);
          _this.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale);
          return _this;
        }
        ForeignObjectRenderer2.prototype.render = function(element) {
          return __awaiter(this, void 0, void 0, function() {
            var svg, img;
            return __generator(this, function(_a2) {
              switch (_a2.label) {
                case 0:
                  svg = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element);
                  return [4, loadSerializedSVG(svg)];
                case 1:
                  img = _a2.sent();
                  if (this.options.backgroundColor) {
                    this.ctx.fillStyle = asString(this.options.backgroundColor);
                    this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);
                  }
                  this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);
                  return [2, this.canvas];
              }
            });
          });
        };
        return ForeignObjectRenderer2;
      }(Renderer)
    );
    var loadSerializedSVG = function(svg) {
      return new Promise(function(resolve2, reject) {
        var img = new Image();
        img.onload = function() {
          resolve2(img);
        };
        img.onerror = reject;
        img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg));
      });
    };
    var Logger = (
      /** @class */
      function() {
        function Logger2(_a2) {
          var id = _a2.id, enabled = _a2.enabled;
          this.id = id;
          this.enabled = enabled;
          this.start = Date.now();
        }
        Logger2.prototype.debug = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (this.enabled) {
            if (typeof window !== "undefined" && window.console && typeof console.debug === "function") {
              console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
            } else {
              this.info.apply(this, args);
            }
          }
        };
        Logger2.prototype.getTime = function() {
          return Date.now() - this.start;
        };
        Logger2.prototype.info = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (this.enabled) {
            if (typeof window !== "undefined" && window.console && typeof console.info === "function") {
              console.info.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
            }
          }
        };
        Logger2.prototype.warn = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (this.enabled) {
            if (typeof window !== "undefined" && window.console && typeof console.warn === "function") {
              console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
            } else {
              this.info.apply(this, args);
            }
          }
        };
        Logger2.prototype.error = function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          if (this.enabled) {
            if (typeof window !== "undefined" && window.console && typeof console.error === "function") {
              console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args));
            } else {
              this.info.apply(this, args);
            }
          }
        };
        Logger2.instances = {};
        return Logger2;
      }()
    );
    var Context = (
      /** @class */
      function() {
        function Context2(options, windowBounds) {
          var _a2;
          this.windowBounds = windowBounds;
          this.instanceName = "#" + Context2.instanceCount++;
          this.logger = new Logger({ id: this.instanceName, enabled: options.logging });
          this.cache = (_a2 = options.cache) !== null && _a2 !== void 0 ? _a2 : new Cache(this, options);
        }
        Context2.instanceCount = 1;
        return Context2;
      }()
    );
    var html2canvas = function(element, options) {
      if (options === void 0) {
        options = {};
      }
      return renderElement(element, options);
    };
    if (typeof window !== "undefined") {
      CacheStorage.setContext(window);
    }
    var renderElement = function(element, opts) {
      return __awaiter(void 0, void 0, void 0, function() {
        var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a2, width, height, left, top, backgroundColor2, renderOptions, canvas, renderer2, root2, renderer2;
        var _b2, _c2, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t2;
        return __generator(this, function(_u) {
          switch (_u.label) {
            case 0:
              if (!element || typeof element !== "object") {
                return [2, Promise.reject("Invalid element provided as first argument")];
              }
              ownerDocument = element.ownerDocument;
              if (!ownerDocument) {
                throw new Error("Element is not attached to a Document");
              }
              defaultView = ownerDocument.defaultView;
              if (!defaultView) {
                throw new Error("Document is not attached to a Window");
              }
              resourceOptions = {
                allowTaint: (_b2 = opts.allowTaint) !== null && _b2 !== void 0 ? _b2 : false,
                imageTimeout: (_c2 = opts.imageTimeout) !== null && _c2 !== void 0 ? _c2 : 15e3,
                proxy: opts.proxy,
                useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
              };
              contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);
              windowOptions = {
                windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,
                windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,
                scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,
                scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset
              };
              windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);
              context = new Context(contextOptions, windowBounds);
              foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;
              cloneOptions = {
                allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,
                onclone: opts.onclone,
                ignoreElements: opts.ignoreElements,
                inlineImages: foreignObjectRendering,
                copyStyles: foreignObjectRendering
              };
              context.logger.debug("Starting document clone with size " + windowBounds.width + "x" + windowBounds.height + " scrolled to " + -windowBounds.left + "," + -windowBounds.top);
              documentCloner = new DocumentCloner(context, element, cloneOptions);
              clonedElement = documentCloner.clonedReferenceElement;
              if (!clonedElement) {
                return [2, Promise.reject("Unable to find element in cloned iframe")];
              }
              return [4, documentCloner.toIFrame(ownerDocument, windowBounds)];
            case 1:
              container = _u.sent();
              _a2 = isBodyElement(clonedElement) || isHTMLElement(clonedElement) ? parseDocumentSize(clonedElement.ownerDocument) : parseBounds(context, clonedElement), width = _a2.width, height = _a2.height, left = _a2.left, top = _a2.top;
              backgroundColor2 = parseBackgroundColor(context, clonedElement, opts.backgroundColor);
              renderOptions = {
                canvas: opts.canvas,
                backgroundColor: backgroundColor2,
                scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1,
                x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left,
                y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top,
                width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width),
                height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height)
              };
              if (!foreignObjectRendering) return [3, 3];
              context.logger.debug("Document cloned, using foreign object rendering");
              renderer2 = new ForeignObjectRenderer(context, renderOptions);
              return [4, renderer2.render(clonedElement)];
            case 2:
              canvas = _u.sent();
              return [3, 5];
            case 3:
              context.logger.debug("Document cloned, element located at " + left + "," + top + " with size " + width + "x" + height + " using computed rendering");
              context.logger.debug("Starting DOM parsing");
              root2 = parseTree(context, clonedElement);
              if (backgroundColor2 === root2.styles.backgroundColor) {
                root2.styles.backgroundColor = COLORS.TRANSPARENT;
              }
              context.logger.debug("Starting renderer for element at " + renderOptions.x + "," + renderOptions.y + " with size " + renderOptions.width + "x" + renderOptions.height);
              renderer2 = new CanvasRenderer(context, renderOptions);
              return [4, renderer2.render(root2)];
            case 4:
              canvas = _u.sent();
              _u.label = 5;
            case 5:
              if ((_t2 = opts.removeContainer) !== null && _t2 !== void 0 ? _t2 : true) {
                if (!DocumentCloner.destroy(container)) {
                  context.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore");
                }
              }
              context.logger.debug("Finished rendering");
              return [2, canvas];
          }
        });
      });
    };
    var parseBackgroundColor = function(context, element, backgroundColorOverride) {
      var ownerDocument = element.ownerDocument;
      var documentBackgroundColor = ownerDocument.documentElement ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor) : COLORS.TRANSPARENT;
      var bodyBackgroundColor = ownerDocument.body ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor) : COLORS.TRANSPARENT;
      var defaultBackgroundColor = typeof backgroundColorOverride === "string" ? parseColor(context, backgroundColorOverride) : backgroundColorOverride === null ? COLORS.TRANSPARENT : 4294967295;
      return element === ownerDocument.documentElement ? isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? defaultBackgroundColor : bodyBackgroundColor : documentBackgroundColor : defaultBackgroundColor;
    };
    function bind(fn2, thisArg) {
      return function wrap() {
        return fn2.apply(thisArg, arguments);
      };
    }
    const { toString } = Object.prototype;
    const { getPrototypeOf } = Object;
    const { iterator, toStringTag } = Symbol;
    const kindOf = /* @__PURE__ */ ((cache2) => (thing) => {
      const str = toString.call(thing);
      return cache2[str] || (cache2[str] = str.slice(8, -1).toLowerCase());
    })(/* @__PURE__ */ Object.create(null));
    const kindOfTest = (type) => {
      type = type.toLowerCase();
      return (thing) => kindOf(thing) === type;
    };
    const typeOfTest = (type) => (thing) => typeof thing === type;
    const { isArray } = Array;
    const isUndefined = typeOfTest("undefined");
    function isBuffer(val) {
      return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
    }
    const isArrayBuffer = kindOfTest("ArrayBuffer");
    function isArrayBufferView(val) {
      let result;
      if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
        result = ArrayBuffer.isView(val);
      } else {
        result = val && val.buffer && isArrayBuffer(val.buffer);
      }
      return result;
    }
    const isString = typeOfTest("string");
    const isFunction = typeOfTest("function");
    const isNumber = typeOfTest("number");
    const isObject$1 = (thing) => thing !== null && typeof thing === "object";
    const isBoolean = (thing) => thing === true || thing === false;
    const isPlainObject = (val) => {
      if (kindOf(val) !== "object") {
        return false;
      }
      const prototype2 = getPrototypeOf(val);
      return (prototype2 === null || prototype2 === Object.prototype || Object.getPrototypeOf(prototype2) === null) && !(toStringTag in val) && !(iterator in val);
    };
    const isDate = kindOfTest("Date");
    const isFile = kindOfTest("File");
    const isBlob = kindOfTest("Blob");
    const isFileList = kindOfTest("FileList");
    const isStream = (val) => isObject$1(val) && isFunction(val.pipe);
    const isFormData = (thing) => {
      let kind;
      return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
      kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
    };
    const isURLSearchParams = kindOfTest("URLSearchParams");
    const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
    const trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
    function forEach(obj, fn2, { allOwnKeys = false } = {}) {
      if (obj === null || typeof obj === "undefined") {
        return;
      }
      let i2;
      let l2;
      if (typeof obj !== "object") {
        obj = [obj];
      }
      if (isArray(obj)) {
        for (i2 = 0, l2 = obj.length; i2 < l2; i2++) {
          fn2.call(null, obj[i2], i2, obj);
        }
      } else {
        const keys2 = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
        const len2 = keys2.length;
        let key;
        for (i2 = 0; i2 < len2; i2++) {
          key = keys2[i2];
          fn2.call(null, obj[key], key, obj);
        }
      }
    }
    function findKey(obj, key) {
      key = key.toLowerCase();
      const keys2 = Object.keys(obj);
      let i2 = keys2.length;
      let _key;
      while (i2-- > 0) {
        _key = keys2[i2];
        if (key === _key.toLowerCase()) {
          return _key;
        }
      }
      return null;
    }
    const _global = (() => {
      if (typeof globalThis !== "undefined") return globalThis;
      return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
    })();
    const isContextDefined = (context) => !isUndefined(context) && context !== _global;
    function merge() {
      const { caseless } = isContextDefined(this) && this || {};
      const result = {};
      const assignValue2 = (val, key) => {
        const targetKey = caseless && findKey(result, key) || key;
        if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
          result[targetKey] = merge(result[targetKey], val);
        } else if (isPlainObject(val)) {
          result[targetKey] = merge({}, val);
        } else if (isArray(val)) {
          result[targetKey] = val.slice();
        } else {
          result[targetKey] = val;
        }
      };
      for (let i2 = 0, l2 = arguments.length; i2 < l2; i2++) {
        arguments[i2] && forEach(arguments[i2], assignValue2);
      }
      return result;
    }
    const extend = (a2, b2, thisArg, { allOwnKeys } = {}) => {
      forEach(b2, (val, key) => {
        if (thisArg && isFunction(val)) {
          a2[key] = bind(val, thisArg);
        } else {
          a2[key] = val;
        }
      }, { allOwnKeys });
      return a2;
    };
    const stripBOM = (content2) => {
      if (content2.charCodeAt(0) === 65279) {
        content2 = content2.slice(1);
      }
      return content2;
    };
    const inherits = (constructor, superConstructor, props2, descriptors2) => {
      constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
      constructor.prototype.constructor = constructor;
      Object.defineProperty(constructor, "super", {
        value: superConstructor.prototype
      });
      props2 && Object.assign(constructor.prototype, props2);
    };
    const toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
      let props2;
      let i2;
      let prop;
      const merged = {};
      destObj = destObj || {};
      if (sourceObj == null) return destObj;
      do {
        props2 = Object.getOwnPropertyNames(sourceObj);
        i2 = props2.length;
        while (i2-- > 0) {
          prop = props2[i2];
          if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
            destObj[prop] = sourceObj[prop];
            merged[prop] = true;
          }
        }
        sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
      } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
      return destObj;
    };
    const endsWith = (str, searchString, position2) => {
      str = String(str);
      if (position2 === void 0 || position2 > str.length) {
        position2 = str.length;
      }
      position2 -= searchString.length;
      const lastIndex = str.indexOf(searchString, position2);
      return lastIndex !== -1 && lastIndex === position2;
    };
    const toArray = (thing) => {
      if (!thing) return null;
      if (isArray(thing)) return thing;
      let i2 = thing.length;
      if (!isNumber(i2)) return null;
      const arr = new Array(i2);
      while (i2-- > 0) {
        arr[i2] = thing[i2];
      }
      return arr;
    };
    const isTypedArray = /* @__PURE__ */ ((TypedArray) => {
      return (thing) => {
        return TypedArray && thing instanceof TypedArray;
      };
    })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
    const forEachEntry = (obj, fn2) => {
      const generator = obj && obj[iterator];
      const _iterator = generator.call(obj);
      let result;
      while ((result = _iterator.next()) && !result.done) {
        const pair = result.value;
        fn2.call(obj, pair[0], pair[1]);
      }
    };
    const matchAll = (regExp, str) => {
      let matches;
      const arr = [];
      while ((matches = regExp.exec(str)) !== null) {
        arr.push(matches);
      }
      return arr;
    };
    const isHTMLForm = kindOfTest("HTMLFormElement");
    const toCamelCase = (str) => {
      return str.toLowerCase().replace(
        /[-_\s]([a-z\d])(\w*)/g,
        function replacer2(m2, p1, p2) {
          return p1.toUpperCase() + p2;
        }
      );
    };
    const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
    const isRegExp = kindOfTest("RegExp");
    const reduceDescriptors = (obj, reducer) => {
      const descriptors2 = Object.getOwnPropertyDescriptors(obj);
      const reducedDescriptors = {};
      forEach(descriptors2, (descriptor, name) => {
        let ret;
        if ((ret = reducer(descriptor, name, obj)) !== false) {
          reducedDescriptors[name] = ret || descriptor;
        }
      });
      Object.defineProperties(obj, reducedDescriptors);
    };
    const freezeMethods = (obj) => {
      reduceDescriptors(obj, (descriptor, name) => {
        if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
          return false;
        }
        const value = obj[name];
        if (!isFunction(value)) return;
        descriptor.enumerable = false;
        if ("writable" in descriptor) {
          descriptor.writable = false;
          return;
        }
        if (!descriptor.set) {
          descriptor.set = () => {
            throw Error("Can not rewrite read-only method '" + name + "'");
          };
        }
      });
    };
    const toObjectSet = (arrayOrString, delimiter) => {
      const obj = {};
      const define = (arr) => {
        arr.forEach((value) => {
          obj[value] = true;
        });
      };
      isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
      return obj;
    };
    const noop = () => {
    };
    const toFiniteNumber = (value, defaultValue) => {
      return value != null && Number.isFinite(value = +value) ? value : defaultValue;
    };
    function isSpecCompliantForm(thing) {
      return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
    }
    const toJSONObject = (obj) => {
      const stack2 = new Array(10);
      const visit = (source, i2) => {
        if (isObject$1(source)) {
          if (stack2.indexOf(source) >= 0) {
            return;
          }
          if (!("toJSON" in source)) {
            stack2[i2] = source;
            const target = isArray(source) ? [] : {};
            forEach(source, (value, key) => {
              const reducedValue = visit(value, i2 + 1);
              !isUndefined(reducedValue) && (target[key] = reducedValue);
            });
            stack2[i2] = void 0;
            return target;
          }
        }
        return source;
      };
      return visit(obj, 0);
    };
    const isAsyncFn = kindOfTest("AsyncFunction");
    const isThenable = (thing) => thing && (isObject$1(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
    const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
      if (setImmediateSupported) {
        return setImmediate;
      }
      return postMessageSupported ? ((token, callbacks) => {
        _global.addEventListener("message", ({ source, data }) => {
          if (source === _global && data === token) {
            callbacks.length && callbacks.shift()();
          }
        }, false);
        return (cb) => {
          callbacks.push(cb);
          _global.postMessage(token, "*");
        };
      })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
    })(
      typeof setImmediate === "function",
      isFunction(_global.postMessage)
    );
    const asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate;
    const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
    const utils$1 = {
      isArray,
      isArrayBuffer,
      isBuffer,
      isFormData,
      isArrayBufferView,
      isString,
      isNumber,
      isBoolean,
      isObject: isObject$1,
      isPlainObject,
      isReadableStream,
      isRequest,
      isResponse,
      isHeaders,
      isUndefined,
      isDate,
      isFile,
      isBlob,
      isRegExp,
      isFunction,
      isStream,
      isURLSearchParams,
      isTypedArray,
      isFileList,
      forEach,
      merge,
      extend,
      trim,
      stripBOM,
      inherits,
      toFlatObject,
      kindOf,
      kindOfTest,
      endsWith,
      toArray,
      forEachEntry,
      matchAll,
      isHTMLForm,
      hasOwnProperty,
      hasOwnProp: hasOwnProperty,
      // an alias to avoid ESLint no-prototype-builtins detection
      reduceDescriptors,
      freezeMethods,
      toObjectSet,
      toCamelCase,
      noop,
      toFiniteNumber,
      findKey,
      global: _global,
      isContextDefined,
      isSpecCompliantForm,
      toJSONObject,
      isAsyncFn,
      isThenable,
      setImmediate: _setImmediate,
      asap,
      isIterable
    };
    function AxiosError$1(message2, code, config, request, response) {
      Error.call(this);
      if (Error.captureStackTrace) {
        Error.captureStackTrace(this, this.constructor);
      } else {
        this.stack = new Error().stack;
      }
      this.message = message2;
      this.name = "AxiosError";
      code && (this.code = code);
      config && (this.config = config);
      request && (this.request = request);
      if (response) {
        this.response = response;
        this.status = response.status ? response.status : null;
      }
    }
    utils$1.inherits(AxiosError$1, Error, {
      toJSON: function toJSON() {
        return {
          // Standard
          message: this.message,
          name: this.name,
          // Microsoft
          description: this.description,
          number: this.number,
          // Mozilla
          fileName: this.fileName,
          lineNumber: this.lineNumber,
          columnNumber: this.columnNumber,
          stack: this.stack,
          // Axios
          config: utils$1.toJSONObject(this.config),
          code: this.code,
          status: this.status
        };
      }
    });
    const prototype$1 = AxiosError$1.prototype;
    const descriptors = {};
    [
      "ERR_BAD_OPTION_VALUE",
      "ERR_BAD_OPTION",
      "ECONNABORTED",
      "ETIMEDOUT",
      "ERR_NETWORK",
      "ERR_FR_TOO_MANY_REDIRECTS",
      "ERR_DEPRECATED",
      "ERR_BAD_RESPONSE",
      "ERR_BAD_REQUEST",
      "ERR_CANCELED",
      "ERR_NOT_SUPPORT",
      "ERR_INVALID_URL"
      // eslint-disable-next-line func-names
    ].forEach((code) => {
      descriptors[code] = { value: code };
    });
    Object.defineProperties(AxiosError$1, descriptors);
    Object.defineProperty(prototype$1, "isAxiosError", { value: true });
    AxiosError$1.from = (error, code, config, request, response, customProps) => {
      const axiosError = Object.create(prototype$1);
      utils$1.toFlatObject(error, axiosError, function filter2(obj) {
        return obj !== Error.prototype;
      }, (prop) => {
        return prop !== "isAxiosError";
      });
      AxiosError$1.call(axiosError, error.message, code, config, request, response);
      axiosError.cause = error;
      axiosError.name = error.name;
      customProps && Object.assign(axiosError, customProps);
      return axiosError;
    };
    const httpAdapter = null;
    function isVisitable(thing) {
      return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
    }
    function removeBrackets(key) {
      return utils$1.endsWith(key, "[]") ? key.slice(0, -2) : key;
    }
    function renderKey(path, key, dots) {
      if (!path) return key;
      return path.concat(key).map(function each2(token, i2) {
        token = removeBrackets(token);
        return !dots && i2 ? "[" + token + "]" : token;
      }).join(dots ? "." : "");
    }
    function isFlatArray(arr) {
      return utils$1.isArray(arr) && !arr.some(isVisitable);
    }
    const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter2(prop) {
      return /^is[A-Z]/.test(prop);
    });
    function toFormData$1(obj, formData, options) {
      if (!utils$1.isObject(obj)) {
        throw new TypeError("target must be an object");
      }
      formData = formData || new FormData();
      options = utils$1.toFlatObject(options, {
        metaTokens: true,
        dots: false,
        indexes: false
      }, false, function defined(option, source) {
        return !utils$1.isUndefined(source[option]);
      });
      const metaTokens = options.metaTokens;
      const visitor = options.visitor || defaultVisitor;
      const dots = options.dots;
      const indexes = options.indexes;
      const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
      const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
      if (!utils$1.isFunction(visitor)) {
        throw new TypeError("visitor must be a function");
      }
      function convertValue(value) {
        if (value === null) return "";
        if (utils$1.isDate(value)) {
          return value.toISOString();
        }
        if (!useBlob && utils$1.isBlob(value)) {
          throw new AxiosError$1("Blob is not supported. Use a Buffer instead.");
        }
        if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
          return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
        }
        return value;
      }
      function defaultVisitor(value, key, path) {
        let arr = value;
        if (value && !path && typeof value === "object") {
          if (utils$1.endsWith(key, "{}")) {
            key = metaTokens ? key : key.slice(0, -2);
            value = JSON.stringify(value);
          } else if (utils$1.isArray(value) && isFlatArray(value) || (utils$1.isFileList(value) || utils$1.endsWith(key, "[]")) && (arr = utils$1.toArray(value))) {
            key = removeBrackets(key);
            arr.forEach(function each2(el, index) {
              !(utils$1.isUndefined(el) || el === null) && formData.append(
                // eslint-disable-next-line no-nested-ternary
                indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
                convertValue(el)
              );
            });
            return false;
          }
        }
        if (isVisitable(value)) {
          return true;
        }
        formData.append(renderKey(path, key, dots), convertValue(value));
        return false;
      }
      const stack2 = [];
      const exposedHelpers = Object.assign(predicates, {
        defaultVisitor,
        convertValue,
        isVisitable
      });
      function build(value, path) {
        if (utils$1.isUndefined(value)) return;
        if (stack2.indexOf(value) !== -1) {
          throw Error("Circular reference detected in " + path.join("."));
        }
        stack2.push(value);
        utils$1.forEach(value, function each2(el, key) {
          const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
            formData,
            el,
            utils$1.isString(key) ? key.trim() : key,
            path,
            exposedHelpers
          );
          if (result === true) {
            build(el, path ? path.concat(key) : [key]);
          }
        });
        stack2.pop();
      }
      if (!utils$1.isObject(obj)) {
        throw new TypeError("data must be an object");
      }
      build(obj);
      return formData;
    }
    function encode$1(str) {
      const charMap = {
        "!": "%21",
        "'": "%27",
        "(": "%28",
        ")": "%29",
        "~": "%7E",
        "%20": "+",
        "%00": "\0"
      };
      return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer2(match) {
        return charMap[match];
      });
    }
    function AxiosURLSearchParams(params, options) {
      this._pairs = [];
      params && toFormData$1(params, this, options);
    }
    const prototype = AxiosURLSearchParams.prototype;
    prototype.append = function append(name, value) {
      this._pairs.push([name, value]);
    };
    prototype.toString = function toString2(encoder) {
      const _encode = encoder ? function(value) {
        return encoder.call(this, value, encode$1);
      } : encode$1;
      return this._pairs.map(function each2(pair) {
        return _encode(pair[0]) + "=" + _encode(pair[1]);
      }, "").join("&");
    };
    function encode(val) {
      return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
    }
    function buildURL(url, params, options) {
      if (!params) {
        return url;
      }
      const _encode = options && options.encode || encode;
      if (utils$1.isFunction(options)) {
        options = {
          serialize: options
        };
      }
      const serializeFn = options && options.serialize;
      let serializedParams;
      if (serializeFn) {
        serializedParams = serializeFn(params, options);
      } else {
        serializedParams = utils$1.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams(params, options).toString(_encode);
      }
      if (serializedParams) {
        const hashmarkIndex = url.indexOf("#");
        if (hashmarkIndex !== -1) {
          url = url.slice(0, hashmarkIndex);
        }
        url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
      }
      return url;
    }
    class InterceptorManager {
      constructor() {
        this.handlers = [];
      }
      /**
       * Add a new interceptor to the stack
       *
       * @param {Function} fulfilled The function to handle `then` for a `Promise`
       * @param {Function} rejected The function to handle `reject` for a `Promise`
       *
       * @return {Number} An ID used to remove interceptor later
       */
      use(fulfilled, rejected, options) {
        this.handlers.push({
          fulfilled,
          rejected,
          synchronous: options ? options.synchronous : false,
          runWhen: options ? options.runWhen : null
        });
        return this.handlers.length - 1;
      }
      /**
       * Remove an interceptor from the stack
       *
       * @param {Number} id The ID that was returned by `use`
       *
       * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
       */
      eject(id) {
        if (this.handlers[id]) {
          this.handlers[id] = null;
        }
      }
      /**
       * Clear all interceptors from the stack
       *
       * @returns {void}
       */
      clear() {
        if (this.handlers) {
          this.handlers = [];
        }
      }
      /**
       * Iterate over all the registered interceptors
       *
       * This method is particularly useful for skipping over any
       * interceptors that may have become `null` calling `eject`.
       *
       * @param {Function} fn The function to call for each interceptor
       *
       * @returns {void}
       */
      forEach(fn2) {
        utils$1.forEach(this.handlers, function forEachHandler(h2) {
          if (h2 !== null) {
            fn2(h2);
          }
        });
      }
    }
    const transitionalDefaults = {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    };
    const URLSearchParams$1 = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams;
    const FormData$1 = typeof FormData !== "undefined" ? FormData : null;
    const Blob$1 = typeof Blob !== "undefined" ? Blob : null;
    const platform$1 = {
      isBrowser: true,
      classes: {
        URLSearchParams: URLSearchParams$1,
        FormData: FormData$1,
        Blob: Blob$1
      },
      protocols: ["http", "https", "file", "blob", "url", "data"]
    };
    const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
    const _navigator = typeof navigator === "object" && navigator || void 0;
    const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
    const hasStandardBrowserWebWorkerEnv = (() => {
      return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
      self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
    })();
    const origin = hasBrowserEnv && window.location.href || "http://localhost";
    const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
      __proto__: null,
      hasBrowserEnv,
      hasStandardBrowserEnv,
      hasStandardBrowserWebWorkerEnv,
      navigator: _navigator,
      origin
    }, Symbol.toStringTag, { value: "Module" }));
    const platform = {
      ...utils,
      ...platform$1
    };
    function toURLEncodedForm(data, options) {
      return toFormData$1(data, new platform.classes.URLSearchParams(), Object.assign({
        visitor: function(value, key, path, helpers) {
          if (platform.isNode && utils$1.isBuffer(value)) {
            this.append(key, value.toString("base64"));
            return false;
          }
          return helpers.defaultVisitor.apply(this, arguments);
        }
      }, options));
    }
    function parsePropPath(name) {
      return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
        return match[0] === "[]" ? "" : match[1] || match[0];
      });
    }
    function arrayToObject(arr) {
      const obj = {};
      const keys2 = Object.keys(arr);
      let i2;
      const len2 = keys2.length;
      let key;
      for (i2 = 0; i2 < len2; i2++) {
        key = keys2[i2];
        obj[key] = arr[key];
      }
      return obj;
    }
    function formDataToJSON(formData) {
      function buildPath2(path, value, target, index) {
        let name = path[index++];
        if (name === "__proto__") return true;
        const isNumericKey = Number.isFinite(+name);
        const isLast = index >= path.length;
        name = !name && utils$1.isArray(target) ? target.length : name;
        if (isLast) {
          if (utils$1.hasOwnProp(target, name)) {
            target[name] = [target[name], value];
          } else {
            target[name] = value;
          }
          return !isNumericKey;
        }
        if (!target[name] || !utils$1.isObject(target[name])) {
          target[name] = [];
        }
        const result = buildPath2(path, value, target[name], index);
        if (result && utils$1.isArray(target[name])) {
          target[name] = arrayToObject(target[name]);
        }
        return !isNumericKey;
      }
      if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
        const obj = {};
        utils$1.forEachEntry(formData, (name, value) => {
          buildPath2(parsePropPath(name), value, obj, 0);
        });
        return obj;
      }
      return null;
    }
    function stringifySafely(rawValue, parser, encoder) {
      if (utils$1.isString(rawValue)) {
        try {
          (parser || JSON.parse)(rawValue);
          return utils$1.trim(rawValue);
        } catch (e2) {
          if (e2.name !== "SyntaxError") {
            throw e2;
          }
        }
      }
      return (encoder || JSON.stringify)(rawValue);
    }
    const defaults = {
      transitional: transitionalDefaults,
      adapter: ["xhr", "http", "fetch"],
      transformRequest: [function transformRequest(data, headers) {
        const contentType = headers.getContentType() || "";
        const hasJSONContentType = contentType.indexOf("application/json") > -1;
        const isObjectPayload = utils$1.isObject(data);
        if (isObjectPayload && utils$1.isHTMLForm(data)) {
          data = new FormData(data);
        }
        const isFormData2 = utils$1.isFormData(data);
        if (isFormData2) {
          return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
        }
        if (utils$1.isArrayBuffer(data) || utils$1.isBuffer(data) || utils$1.isStream(data) || utils$1.isFile(data) || utils$1.isBlob(data) || utils$1.isReadableStream(data)) {
          return data;
        }
        if (utils$1.isArrayBufferView(data)) {
          return data.buffer;
        }
        if (utils$1.isURLSearchParams(data)) {
          headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
          return data.toString();
        }
        let isFileList2;
        if (isObjectPayload) {
          if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
            return toURLEncodedForm(data, this.formSerializer).toString();
          }
          if ((isFileList2 = utils$1.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
            const _FormData = this.env && this.env.FormData;
            return toFormData$1(
              isFileList2 ? { "files[]": data } : data,
              _FormData && new _FormData(),
              this.formSerializer
            );
          }
        }
        if (isObjectPayload || hasJSONContentType) {
          headers.setContentType("application/json", false);
          return stringifySafely(data);
        }
        return data;
      }],
      transformResponse: [function transformResponse(data) {
        const transitional = this.transitional || defaults.transitional;
        const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
        const JSONRequested = this.responseType === "json";
        if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
          return data;
        }
        if (data && utils$1.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
          const silentJSONParsing = transitional && transitional.silentJSONParsing;
          const strictJSONParsing = !silentJSONParsing && JSONRequested;
          try {
            return JSON.parse(data);
          } catch (e2) {
            if (strictJSONParsing) {
              if (e2.name === "SyntaxError") {
                throw AxiosError$1.from(e2, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
              }
              throw e2;
            }
          }
        }
        return data;
      }],
      /**
       * A timeout in milliseconds to abort a request. If set to 0 (default) a
       * timeout is not created.
       */
      timeout: 0,
      xsrfCookieName: "XSRF-TOKEN",
      xsrfHeaderName: "X-XSRF-TOKEN",
      maxContentLength: -1,
      maxBodyLength: -1,
      env: {
        FormData: platform.classes.FormData,
        Blob: platform.classes.Blob
      },
      validateStatus: function validateStatus(status) {
        return status >= 200 && status < 300;
      },
      headers: {
        common: {
          "Accept": "application/json, text/plain, */*",
          "Content-Type": void 0
        }
      }
    };
    utils$1.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
      defaults.headers[method] = {};
    });
    const ignoreDuplicateOf = utils$1.toObjectSet([
      "age",
      "authorization",
      "content-length",
      "content-type",
      "etag",
      "expires",
      "from",
      "host",
      "if-modified-since",
      "if-unmodified-since",
      "last-modified",
      "location",
      "max-forwards",
      "proxy-authorization",
      "referer",
      "retry-after",
      "user-agent"
    ]);
    const parseHeaders = (rawHeaders) => {
      const parsed = {};
      let key;
      let val;
      let i2;
      rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
        i2 = line.indexOf(":");
        key = line.substring(0, i2).trim().toLowerCase();
        val = line.substring(i2 + 1).trim();
        if (!key || parsed[key] && ignoreDuplicateOf[key]) {
          return;
        }
        if (key === "set-cookie") {
          if (parsed[key]) {
            parsed[key].push(val);
          } else {
            parsed[key] = [val];
          }
        } else {
          parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
        }
      });
      return parsed;
    };
    const $internals = Symbol("internals");
    function normalizeHeader(header) {
      return header && String(header).trim().toLowerCase();
    }
    function normalizeValue(value) {
      if (value === false || value == null) {
        return value;
      }
      return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
    }
    function parseTokens(str) {
      const tokens = /* @__PURE__ */ Object.create(null);
      const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
      let match;
      while (match = tokensRE.exec(str)) {
        tokens[match[1]] = match[2];
      }
      return tokens;
    }
    const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
    function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
      if (utils$1.isFunction(filter2)) {
        return filter2.call(this, value, header);
      }
      if (isHeaderNameFilter) {
        value = header;
      }
      if (!utils$1.isString(value)) return;
      if (utils$1.isString(filter2)) {
        return value.indexOf(filter2) !== -1;
      }
      if (utils$1.isRegExp(filter2)) {
        return filter2.test(value);
      }
    }
    function formatHeader(header) {
      return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w2, char, str) => {
        return char.toUpperCase() + str;
      });
    }
    function buildAccessors(obj, header) {
      const accessorName = utils$1.toCamelCase(" " + header);
      ["get", "set", "has"].forEach((methodName) => {
        Object.defineProperty(obj, methodName + accessorName, {
          value: function(arg1, arg2, arg3) {
            return this[methodName].call(this, header, arg1, arg2, arg3);
          },
          configurable: true
        });
      });
    }
    let AxiosHeaders$1 = class AxiosHeaders {
      constructor(headers) {
        headers && this.set(headers);
      }
      set(header, valueOrRewrite, rewrite) {
        const self2 = this;
        function setHeader(_value, _header, _rewrite) {
          const lHeader = normalizeHeader(_header);
          if (!lHeader) {
            throw new Error("header name must be a non-empty string");
          }
          const key = utils$1.findKey(self2, lHeader);
          if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
            self2[key || _header] = normalizeValue(_value);
          }
        }
        const setHeaders = (headers, _rewrite) => utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
        if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
          setHeaders(header, valueOrRewrite);
        } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
          setHeaders(parseHeaders(header), valueOrRewrite);
        } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
          let obj = {}, dest, key;
          for (const entry of header) {
            if (!utils$1.isArray(entry)) {
              throw TypeError("Object iterator must return a key-value pair");
            }
            obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1];
          }
          setHeaders(obj, valueOrRewrite);
        } else {
          header != null && setHeader(valueOrRewrite, header, rewrite);
        }
        return this;
      }
      get(header, parser) {
        header = normalizeHeader(header);
        if (header) {
          const key = utils$1.findKey(this, header);
          if (key) {
            const value = this[key];
            if (!parser) {
              return value;
            }
            if (parser === true) {
              return parseTokens(value);
            }
            if (utils$1.isFunction(parser)) {
              return parser.call(this, value, key);
            }
            if (utils$1.isRegExp(parser)) {
              return parser.exec(value);
            }
            throw new TypeError("parser must be boolean|regexp|function");
          }
        }
      }
      has(header, matcher) {
        header = normalizeHeader(header);
        if (header) {
          const key = utils$1.findKey(this, header);
          return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
        }
        return false;
      }
      delete(header, matcher) {
        const self2 = this;
        let deleted = false;
        function deleteHeader(_header) {
          _header = normalizeHeader(_header);
          if (_header) {
            const key = utils$1.findKey(self2, _header);
            if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
              delete self2[key];
              deleted = true;
            }
          }
        }
        if (utils$1.isArray(header)) {
          header.forEach(deleteHeader);
        } else {
          deleteHeader(header);
        }
        return deleted;
      }
      clear(matcher) {
        const keys2 = Object.keys(this);
        let i2 = keys2.length;
        let deleted = false;
        while (i2--) {
          const key = keys2[i2];
          if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
            delete this[key];
            deleted = true;
          }
        }
        return deleted;
      }
      normalize(format2) {
        const self2 = this;
        const headers = {};
        utils$1.forEach(this, (value, header) => {
          const key = utils$1.findKey(headers, header);
          if (key) {
            self2[key] = normalizeValue(value);
            delete self2[header];
            return;
          }
          const normalized = format2 ? formatHeader(header) : String(header).trim();
          if (normalized !== header) {
            delete self2[header];
          }
          self2[normalized] = normalizeValue(value);
          headers[normalized] = true;
        });
        return this;
      }
      concat(...targets) {
        return this.constructor.concat(this, ...targets);
      }
      toJSON(asStrings) {
        const obj = /* @__PURE__ */ Object.create(null);
        utils$1.forEach(this, (value, header) => {
          value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(", ") : value);
        });
        return obj;
      }
      [Symbol.iterator]() {
        return Object.entries(this.toJSON())[Symbol.iterator]();
      }
      toString() {
        return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
      }
      getSetCookie() {
        return this.get("set-cookie") || [];
      }
      get [Symbol.toStringTag]() {
        return "AxiosHeaders";
      }
      static from(thing) {
        return thing instanceof this ? thing : new this(thing);
      }
      static concat(first, ...targets) {
        const computed2 = new this(first);
        targets.forEach((target) => computed2.set(target));
        return computed2;
      }
      static accessor(header) {
        const internals = this[$internals] = this[$internals] = {
          accessors: {}
        };
        const accessors = internals.accessors;
        const prototype2 = this.prototype;
        function defineAccessor(_header) {
          const lHeader = normalizeHeader(_header);
          if (!accessors[lHeader]) {
            buildAccessors(prototype2, _header);
            accessors[lHeader] = true;
          }
        }
        utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
        return this;
      }
    };
    AxiosHeaders$1.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
    utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
      let mapped = key[0].toUpperCase() + key.slice(1);
      return {
        get: () => value,
        set(headerValue) {
          this[mapped] = headerValue;
        }
      };
    });
    utils$1.freezeMethods(AxiosHeaders$1);
    function transformData(fns, response) {
      const config = this || defaults;
      const context = response || config;
      const headers = AxiosHeaders$1.from(context.headers);
      let data = context.data;
      utils$1.forEach(fns, function transform2(fn2) {
        data = fn2.call(config, data, headers.normalize(), response ? response.status : void 0);
      });
      headers.normalize();
      return data;
    }
    function isCancel$1(value) {
      return !!(value && value.__CANCEL__);
    }
    function CanceledError$1(message2, config, request) {
      AxiosError$1.call(this, message2 == null ? "canceled" : message2, AxiosError$1.ERR_CANCELED, config, request);
      this.name = "CanceledError";
    }
    utils$1.inherits(CanceledError$1, AxiosError$1, {
      __CANCEL__: true
    });
    function settle(resolve2, reject, response) {
      const validateStatus = response.config.validateStatus;
      if (!response.status || !validateStatus || validateStatus(response.status)) {
        resolve2(response);
      } else {
        reject(new AxiosError$1(
          "Request failed with status code " + response.status,
          [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
          response.config,
          response.request,
          response
        ));
      }
    }
    function parseProtocol(url) {
      const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
      return match && match[1] || "";
    }
    function speedometer(samplesCount, min3) {
      samplesCount = samplesCount || 10;
      const bytes = new Array(samplesCount);
      const timestamps = new Array(samplesCount);
      let head = 0;
      let tail = 0;
      let firstSampleTS;
      min3 = min3 !== void 0 ? min3 : 1e3;
      return function push2(chunkLength) {
        const now2 = Date.now();
        const startedAt = timestamps[tail];
        if (!firstSampleTS) {
          firstSampleTS = now2;
        }
        bytes[head] = chunkLength;
        timestamps[head] = now2;
        let i2 = tail;
        let bytesCount = 0;
        while (i2 !== head) {
          bytesCount += bytes[i2++];
          i2 = i2 % samplesCount;
        }
        head = (head + 1) % samplesCount;
        if (head === tail) {
          tail = (tail + 1) % samplesCount;
        }
        if (now2 - firstSampleTS < min3) {
          return;
        }
        const passed = startedAt && now2 - startedAt;
        return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
      };
    }
    function throttle(fn2, freq) {
      let timestamp = 0;
      let threshold = 1e3 / freq;
      let lastArgs;
      let timer;
      const invoke = (args, now2 = Date.now()) => {
        timestamp = now2;
        lastArgs = null;
        if (timer) {
          clearTimeout(timer);
          timer = null;
        }
        fn2.apply(null, args);
      };
      const throttled = (...args) => {
        const now2 = Date.now();
        const passed = now2 - timestamp;
        if (passed >= threshold) {
          invoke(args, now2);
        } else {
          lastArgs = args;
          if (!timer) {
            timer = setTimeout(() => {
              timer = null;
              invoke(lastArgs);
            }, threshold - passed);
          }
        }
      };
      const flush = () => lastArgs && invoke(lastArgs);
      return [throttled, flush];
    }
    const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
      let bytesNotified = 0;
      const _speedometer = speedometer(50, 250);
      return throttle((e2) => {
        const loaded = e2.loaded;
        const total2 = e2.lengthComputable ? e2.total : void 0;
        const progressBytes = loaded - bytesNotified;
        const rate = _speedometer(progressBytes);
        const inRange = loaded <= total2;
        bytesNotified = loaded;
        const data = {
          loaded,
          total: total2,
          progress: total2 ? loaded / total2 : void 0,
          bytes: progressBytes,
          rate: rate ? rate : void 0,
          estimated: rate && total2 && inRange ? (total2 - loaded) / rate : void 0,
          event: e2,
          lengthComputable: total2 != null,
          [isDownloadStream ? "download" : "upload"]: true
        };
        listener(data);
      }, freq);
    };
    const progressEventDecorator = (total2, throttled) => {
      const lengthComputable = total2 != null;
      return [(loaded) => throttled[0]({
        lengthComputable,
        total: total2,
        loaded
      }), throttled[1]];
    };
    const asyncDecorator = (fn2) => (...args) => utils$1.asap(() => fn2(...args));
    const isURLSameOrigin = platform.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => {
      url = new URL(url, platform.origin);
      return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port);
    })(
      new URL(platform.origin),
      platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
    ) : () => true;
    const cookies = platform.hasStandardBrowserEnv ? (
      // Standard browser envs support document.cookie
      {
        write(name, value, expires, path, domain, secure) {
          const cookie = [name + "=" + encodeURIComponent(value)];
          utils$1.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
          utils$1.isString(path) && cookie.push("path=" + path);
          utils$1.isString(domain) && cookie.push("domain=" + domain);
          secure === true && cookie.push("secure");
          document.cookie = cookie.join("; ");
        },
        read(name) {
          const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
          return match ? decodeURIComponent(match[3]) : null;
        },
        remove(name) {
          this.write(name, "", Date.now() - 864e5);
        }
      }
    ) : (
      // Non-standard browser env (web workers, react-native) lack needed support.
      {
        write() {
        },
        read() {
          return null;
        },
        remove() {
        }
      }
    );
    function isAbsoluteURL(url) {
      return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
    }
    function combineURLs(baseURL, relativeURL) {
      return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
    }
    function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
      let isRelativeUrl = !isAbsoluteURL(requestedURL);
      if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
        return combineURLs(baseURL, requestedURL);
      }
      return requestedURL;
    }
    const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
    function mergeConfig$1(config1, config2) {
      config2 = config2 || {};
      const config = {};
      function getMergedValue(target, source, prop, caseless) {
        if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
          return utils$1.merge.call({ caseless }, target, source);
        } else if (utils$1.isPlainObject(source)) {
          return utils$1.merge({}, source);
        } else if (utils$1.isArray(source)) {
          return source.slice();
        }
        return source;
      }
      function mergeDeepProperties(a2, b2, prop, caseless) {
        if (!utils$1.isUndefined(b2)) {
          return getMergedValue(a2, b2, prop, caseless);
        } else if (!utils$1.isUndefined(a2)) {
          return getMergedValue(void 0, a2, prop, caseless);
        }
      }
      function valueFromConfig2(a2, b2) {
        if (!utils$1.isUndefined(b2)) {
          return getMergedValue(void 0, b2);
        }
      }
      function defaultToConfig2(a2, b2) {
        if (!utils$1.isUndefined(b2)) {
          return getMergedValue(void 0, b2);
        } else if (!utils$1.isUndefined(a2)) {
          return getMergedValue(void 0, a2);
        }
      }
      function mergeDirectKeys(a2, b2, prop) {
        if (prop in config2) {
          return getMergedValue(a2, b2);
        } else if (prop in config1) {
          return getMergedValue(void 0, a2);
        }
      }
      const mergeMap = {
        url: valueFromConfig2,
        method: valueFromConfig2,
        data: valueFromConfig2,
        baseURL: defaultToConfig2,
        transformRequest: defaultToConfig2,
        transformResponse: defaultToConfig2,
        paramsSerializer: defaultToConfig2,
        timeout: defaultToConfig2,
        timeoutMessage: defaultToConfig2,
        withCredentials: defaultToConfig2,
        withXSRFToken: defaultToConfig2,
        adapter: defaultToConfig2,
        responseType: defaultToConfig2,
        xsrfCookieName: defaultToConfig2,
        xsrfHeaderName: defaultToConfig2,
        onUploadProgress: defaultToConfig2,
        onDownloadProgress: defaultToConfig2,
        decompress: defaultToConfig2,
        maxContentLength: defaultToConfig2,
        maxBodyLength: defaultToConfig2,
        beforeRedirect: defaultToConfig2,
        transport: defaultToConfig2,
        httpAgent: defaultToConfig2,
        httpsAgent: defaultToConfig2,
        cancelToken: defaultToConfig2,
        socketPath: defaultToConfig2,
        responseEncoding: defaultToConfig2,
        validateStatus: mergeDirectKeys,
        headers: (a2, b2, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b2), prop, true)
      };
      utils$1.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
        const merge2 = mergeMap[prop] || mergeDeepProperties;
        const configValue = merge2(config1[prop], config2[prop], prop);
        utils$1.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
      });
      return config;
    }
    const resolveConfig = (config) => {
      const newConfig = mergeConfig$1({}, config);
      let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
      newConfig.headers = headers = AxiosHeaders$1.from(headers);
      newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
      if (auth) {
        headers.set(
          "Authorization",
          "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
        );
      }
      let contentType;
      if (utils$1.isFormData(data)) {
        if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
          headers.setContentType(void 0);
        } else if ((contentType = headers.getContentType()) !== false) {
          const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
          headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
        }
      }
      if (platform.hasStandardBrowserEnv) {
        withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
        if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
          const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
          if (xsrfValue) {
            headers.set(xsrfHeaderName, xsrfValue);
          }
        }
      }
      return newConfig;
    };
    const isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
    const xhrAdapter = isXHRAdapterSupported && function(config) {
      return new Promise(function dispatchXhrRequest(resolve2, reject) {
        const _config = resolveConfig(config);
        let requestData = _config.data;
        const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
        let { responseType, onUploadProgress, onDownloadProgress } = _config;
        let onCanceled;
        let uploadThrottled, downloadThrottled;
        let flushUpload, flushDownload;
        function done() {
          flushUpload && flushUpload();
          flushDownload && flushDownload();
          _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
          _config.signal && _config.signal.removeEventListener("abort", onCanceled);
        }
        let request = new XMLHttpRequest();
        request.open(_config.method.toUpperCase(), _config.url, true);
        request.timeout = _config.timeout;
        function onloadend() {
          if (!request) {
            return;
          }
          const responseHeaders = AxiosHeaders$1.from(
            "getAllResponseHeaders" in request && request.getAllResponseHeaders()
          );
          const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
          const response = {
            data: responseData,
            status: request.status,
            statusText: request.statusText,
            headers: responseHeaders,
            config,
            request
          };
          settle(function _resolve(value) {
            resolve2(value);
            done();
          }, function _reject(err) {
            reject(err);
            done();
          }, response);
          request = null;
        }
        if ("onloadend" in request) {
          request.onloadend = onloadend;
        } else {
          request.onreadystatechange = function handleLoad() {
            if (!request || request.readyState !== 4) {
              return;
            }
            if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
              return;
            }
            setTimeout(onloadend);
          };
        }
        request.onabort = function handleAbort() {
          if (!request) {
            return;
          }
          reject(new AxiosError$1("Request aborted", AxiosError$1.ECONNABORTED, config, request));
          request = null;
        };
        request.onerror = function handleError2() {
          reject(new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request));
          request = null;
        };
        request.ontimeout = function handleTimeout() {
          let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
          const transitional = _config.transitional || transitionalDefaults;
          if (_config.timeoutErrorMessage) {
            timeoutErrorMessage = _config.timeoutErrorMessage;
          }
          reject(new AxiosError$1(
            timeoutErrorMessage,
            transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
            config,
            request
          ));
          request = null;
        };
        requestData === void 0 && requestHeaders.setContentType(null);
        if ("setRequestHeader" in request) {
          utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
            request.setRequestHeader(key, val);
          });
        }
        if (!utils$1.isUndefined(_config.withCredentials)) {
          request.withCredentials = !!_config.withCredentials;
        }
        if (responseType && responseType !== "json") {
          request.responseType = _config.responseType;
        }
        if (onDownloadProgress) {
          [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
          request.addEventListener("progress", downloadThrottled);
        }
        if (onUploadProgress && request.upload) {
          [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
          request.upload.addEventListener("progress", uploadThrottled);
          request.upload.addEventListener("loadend", flushUpload);
        }
        if (_config.cancelToken || _config.signal) {
          onCanceled = (cancel) => {
            if (!request) {
              return;
            }
            reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
            request.abort();
            request = null;
          };
          _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
          if (_config.signal) {
            _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
          }
        }
        const protocol = parseProtocol(_config.url);
        if (protocol && platform.protocols.indexOf(protocol) === -1) {
          reject(new AxiosError$1("Unsupported protocol " + protocol + ":", AxiosError$1.ERR_BAD_REQUEST, config));
          return;
        }
        request.send(requestData || null);
      });
    };
    const composeSignals = (signals, timeout) => {
      const { length } = signals = signals ? signals.filter(Boolean) : [];
      if (timeout || length) {
        let controller = new AbortController();
        let aborted;
        const onabort = function(reason) {
          if (!aborted) {
            aborted = true;
            unsubscribe();
            const err = reason instanceof Error ? reason : this.reason;
            controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
          }
        };
        let timer = timeout && setTimeout(() => {
          timer = null;
          onabort(new AxiosError$1(`timeout ${timeout} of ms exceeded`, AxiosError$1.ETIMEDOUT));
        }, timeout);
        const unsubscribe = () => {
          if (signals) {
            timer && clearTimeout(timer);
            timer = null;
            signals.forEach((signal2) => {
              signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
            });
            signals = null;
          }
        };
        signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
        const { signal } = controller;
        signal.unsubscribe = () => utils$1.asap(unsubscribe);
        return signal;
      }
    };
    const streamChunk = function* (chunk, chunkSize) {
      let len2 = chunk.byteLength;
      if (len2 < chunkSize) {
        yield chunk;
        return;
      }
      let pos = 0;
      let end2;
      while (pos < len2) {
        end2 = pos + chunkSize;
        yield chunk.slice(pos, end2);
        pos = end2;
      }
    };
    const readBytes = async function* (iterable, chunkSize) {
      for await (const chunk of readStream(iterable)) {
        yield* streamChunk(chunk, chunkSize);
      }
    };
    const readStream = async function* (stream) {
      if (stream[Symbol.asyncIterator]) {
        yield* stream;
        return;
      }
      const reader = stream.getReader();
      try {
        for (; ; ) {
          const { done, value } = await reader.read();
          if (done) {
            break;
          }
          yield value;
        }
      } finally {
        await reader.cancel();
      }
    };
    const trackStream = (stream, chunkSize, onProgress, onFinish) => {
      const iterator2 = readBytes(stream, chunkSize);
      let bytes = 0;
      let done;
      let _onFinish = (e2) => {
        if (!done) {
          done = true;
          onFinish && onFinish(e2);
        }
      };
      return new ReadableStream({
        async pull(controller) {
          try {
            const { done: done2, value } = await iterator2.next();
            if (done2) {
              _onFinish();
              controller.close();
              return;
            }
            let len2 = value.byteLength;
            if (onProgress) {
              let loadedBytes = bytes += len2;
              onProgress(loadedBytes);
            }
            controller.enqueue(new Uint8Array(value));
          } catch (err) {
            _onFinish(err);
            throw err;
          }
        },
        cancel(reason) {
          _onFinish(reason);
          return iterator2.return();
        }
      }, {
        highWaterMark: 2
      });
    };
    const isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
    const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
    const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : async (str) => new Uint8Array(await new Response(str).arrayBuffer()));
    const test = (fn2, ...args) => {
      try {
        return !!fn2(...args);
      } catch (e2) {
        return false;
      }
    };
    const supportsRequestStream = isReadableStreamSupported && test(() => {
      let duplexAccessed = false;
      const hasContentType = new Request(platform.origin, {
        body: new ReadableStream(),
        method: "POST",
        get duplex() {
          duplexAccessed = true;
          return "half";
        }
      }).headers.has("Content-Type");
      return duplexAccessed && !hasContentType;
    });
    const DEFAULT_CHUNK_SIZE = 64 * 1024;
    const supportsResponseStream = isReadableStreamSupported && test(() => utils$1.isReadableStream(new Response("").body));
    const resolvers = {
      stream: supportsResponseStream && ((res) => res.body)
    };
    isFetchSupported && ((res) => {
      ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
        !resolvers[type] && (resolvers[type] = utils$1.isFunction(res[type]) ? (res2) => res2[type]() : (_2, config) => {
          throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
        });
      });
    })(new Response());
    const getBodyLength = async (body) => {
      if (body == null) {
        return 0;
      }
      if (utils$1.isBlob(body)) {
        return body.size;
      }
      if (utils$1.isSpecCompliantForm(body)) {
        const _request = new Request(platform.origin, {
          method: "POST",
          body
        });
        return (await _request.arrayBuffer()).byteLength;
      }
      if (utils$1.isArrayBufferView(body) || utils$1.isArrayBuffer(body)) {
        return body.byteLength;
      }
      if (utils$1.isURLSearchParams(body)) {
        body = body + "";
      }
      if (utils$1.isString(body)) {
        return (await encodeText(body)).byteLength;
      }
    };
    const resolveBodyLength = async (headers, body) => {
      const length = utils$1.toFiniteNumber(headers.getContentLength());
      return length == null ? getBodyLength(body) : length;
    };
    const fetchAdapter = isFetchSupported && (async (config) => {
      let {
        url,
        method,
        data,
        signal,
        cancelToken,
        timeout,
        onDownloadProgress,
        onUploadProgress,
        responseType,
        headers,
        withCredentials = "same-origin",
        fetchOptions
      } = resolveConfig(config);
      responseType = responseType ? (responseType + "").toLowerCase() : "text";
      let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
      let request;
      const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
        composedSignal.unsubscribe();
      });
      let requestContentLength;
      try {
        if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
          let _request = new Request(url, {
            method: "POST",
            body: data,
            duplex: "half"
          });
          let contentTypeHeader;
          if (utils$1.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
            headers.setContentType(contentTypeHeader);
          }
          if (_request.body) {
            const [onProgress, flush] = progressEventDecorator(
              requestContentLength,
              progressEventReducer(asyncDecorator(onUploadProgress))
            );
            data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
          }
        }
        if (!utils$1.isString(withCredentials)) {
          withCredentials = withCredentials ? "include" : "omit";
        }
        const isCredentialsSupported = "credentials" in Request.prototype;
        request = new Request(url, {
          ...fetchOptions,
          signal: composedSignal,
          method: method.toUpperCase(),
          headers: headers.normalize().toJSON(),
          body: data,
          duplex: "half",
          credentials: isCredentialsSupported ? withCredentials : void 0
        });
        let response = await fetch(request);
        const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
        if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
          const options = {};
          ["status", "statusText", "headers"].forEach((prop) => {
            options[prop] = response[prop];
          });
          const responseContentLength = utils$1.toFiniteNumber(response.headers.get("content-length"));
          const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
            responseContentLength,
            progressEventReducer(asyncDecorator(onDownloadProgress), true)
          ) || [];
          response = new Response(
            trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
              flush && flush();
              unsubscribe && unsubscribe();
            }),
            options
          );
        }
        responseType = responseType || "text";
        let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || "text"](response, config);
        !isStreamResponse && unsubscribe && unsubscribe();
        return await new Promise((resolve2, reject) => {
          settle(resolve2, reject, {
            data: responseData,
            headers: AxiosHeaders$1.from(response.headers),
            status: response.status,
            statusText: response.statusText,
            config,
            request
          });
        });
      } catch (err) {
        unsubscribe && unsubscribe();
        if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) {
          throw Object.assign(
            new AxiosError$1("Network Error", AxiosError$1.ERR_NETWORK, config, request),
            {
              cause: err.cause || err
            }
          );
        }
        throw AxiosError$1.from(err, err && err.code, config, request);
      }
    });
    const knownAdapters = {
      http: httpAdapter,
      xhr: xhrAdapter,
      fetch: fetchAdapter
    };
    utils$1.forEach(knownAdapters, (fn2, value) => {
      if (fn2) {
        try {
          Object.defineProperty(fn2, "name", { value });
        } catch (e2) {
        }
        Object.defineProperty(fn2, "adapterName", { value });
      }
    });
    const renderReason = (reason) => `- ${reason}`;
    const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
    const adapters = {
      getAdapter: (adapters2) => {
        adapters2 = utils$1.isArray(adapters2) ? adapters2 : [adapters2];
        const { length } = adapters2;
        let nameOrAdapter;
        let adapter;
        const rejectedReasons = {};
        for (let i2 = 0; i2 < length; i2++) {
          nameOrAdapter = adapters2[i2];
          let id;
          adapter = nameOrAdapter;
          if (!isResolvedHandle(nameOrAdapter)) {
            adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
            if (adapter === void 0) {
              throw new AxiosError$1(`Unknown adapter '${id}'`);
            }
          }
          if (adapter) {
            break;
          }
          rejectedReasons[id || "#" + i2] = adapter;
        }
        if (!adapter) {
          const reasons = Object.entries(rejectedReasons).map(
            ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
          );
          let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
          throw new AxiosError$1(
            `There is no suitable adapter to dispatch the request ` + s2,
            "ERR_NOT_SUPPORT"
          );
        }
        return adapter;
      },
      adapters: knownAdapters
    };
    function throwIfCancellationRequested(config) {
      if (config.cancelToken) {
        config.cancelToken.throwIfRequested();
      }
      if (config.signal && config.signal.aborted) {
        throw new CanceledError$1(null, config);
      }
    }
    function dispatchRequest(config) {
      throwIfCancellationRequested(config);
      config.headers = AxiosHeaders$1.from(config.headers);
      config.data = transformData.call(
        config,
        config.transformRequest
      );
      if (["post", "put", "patch"].indexOf(config.method) !== -1) {
        config.headers.setContentType("application/x-www-form-urlencoded", false);
      }
      const adapter = adapters.getAdapter(config.adapter || defaults.adapter);
      return adapter(config).then(function onAdapterResolution(response) {
        throwIfCancellationRequested(config);
        response.data = transformData.call(
          config,
          config.transformResponse,
          response
        );
        response.headers = AxiosHeaders$1.from(response.headers);
        return response;
      }, function onAdapterRejection(reason) {
        if (!isCancel$1(reason)) {
          throwIfCancellationRequested(config);
          if (reason && reason.response) {
            reason.response.data = transformData.call(
              config,
              config.transformResponse,
              reason.response
            );
            reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
          }
        }
        return Promise.reject(reason);
      });
    }
    const VERSION$1 = "1.9.0";
    const validators$1 = {};
    ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => {
      validators$1[type] = function validator2(thing) {
        return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type;
      };
    });
    const deprecatedWarnings = {};
    validators$1.transitional = function transitional(validator2, version2, message2) {
      function formatMessage(opt, desc) {
        return "[Axios v" + VERSION$1 + "] Transitional option '" + opt + "'" + desc + (message2 ? ". " + message2 : "");
      }
      return (value, opt, opts) => {
        if (validator2 === false) {
          throw new AxiosError$1(
            formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")),
            AxiosError$1.ERR_DEPRECATED
          );
        }
        if (version2 && !deprecatedWarnings[opt]) {
          deprecatedWarnings[opt] = true;
          console.warn(
            formatMessage(
              opt,
              " has been deprecated since v" + version2 + " and will be removed in the near future"
            )
          );
        }
        return validator2 ? validator2(value, opt, opts) : true;
      };
    };
    validators$1.spelling = function spelling(correctSpelling) {
      return (value, opt) => {
        console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
        return true;
      };
    };
    function assertOptions(options, schema, allowUnknown) {
      if (typeof options !== "object") {
        throw new AxiosError$1("options must be an object", AxiosError$1.ERR_BAD_OPTION_VALUE);
      }
      const keys2 = Object.keys(options);
      let i2 = keys2.length;
      while (i2-- > 0) {
        const opt = keys2[i2];
        const validator2 = schema[opt];
        if (validator2) {
          const value = options[opt];
          const result = value === void 0 || validator2(value, opt, options);
          if (result !== true) {
            throw new AxiosError$1("option " + opt + " must be " + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
          }
          continue;
        }
        if (allowUnknown !== true) {
          throw new AxiosError$1("Unknown option " + opt, AxiosError$1.ERR_BAD_OPTION);
        }
      }
    }
    const validator = {
      assertOptions,
      validators: validators$1
    };
    const validators = validator.validators;
    let Axios$1 = class Axios {
      constructor(instanceConfig) {
        this.defaults = instanceConfig || {};
        this.interceptors = {
          request: new InterceptorManager(),
          response: new InterceptorManager()
        };
      }
      /**
       * Dispatch a request
       *
       * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
       * @param {?Object} config
       *
       * @returns {Promise} The Promise to be fulfilled
       */
      async request(configOrUrl, config) {
        try {
          return await this._request(configOrUrl, config);
        } catch (err) {
          if (err instanceof Error) {
            let dummy = {};
            Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error();
            const stack2 = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
            try {
              if (!err.stack) {
                err.stack = stack2;
              } else if (stack2 && !String(err.stack).endsWith(stack2.replace(/^.+\n.+\n/, ""))) {
                err.stack += "\n" + stack2;
              }
            } catch (e2) {
            }
          }
          throw err;
        }
      }
      _request(configOrUrl, config) {
        if (typeof configOrUrl === "string") {
          config = config || {};
          config.url = configOrUrl;
        } else {
          config = configOrUrl || {};
        }
        config = mergeConfig$1(this.defaults, config);
        const { transitional, paramsSerializer, headers } = config;
        if (transitional !== void 0) {
          validator.assertOptions(transitional, {
            silentJSONParsing: validators.transitional(validators.boolean),
            forcedJSONParsing: validators.transitional(validators.boolean),
            clarifyTimeoutError: validators.transitional(validators.boolean)
          }, false);
        }
        if (paramsSerializer != null) {
          if (utils$1.isFunction(paramsSerializer)) {
            config.paramsSerializer = {
              serialize: paramsSerializer
            };
          } else {
            validator.assertOptions(paramsSerializer, {
              encode: validators.function,
              serialize: validators.function
            }, true);
          }
        }
        if (config.allowAbsoluteUrls !== void 0) ;
        else if (this.defaults.allowAbsoluteUrls !== void 0) {
          config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
        } else {
          config.allowAbsoluteUrls = true;
        }
        validator.assertOptions(config, {
          baseUrl: validators.spelling("baseURL"),
          withXsrfToken: validators.spelling("withXSRFToken")
        }, true);
        config.method = (config.method || this.defaults.method || "get").toLowerCase();
        let contextHeaders = headers && utils$1.merge(
          headers.common,
          headers[config.method]
        );
        headers && utils$1.forEach(
          ["delete", "get", "head", "post", "put", "patch", "common"],
          (method) => {
            delete headers[method];
          }
        );
        config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
        const requestInterceptorChain = [];
        let synchronousRequestInterceptors = true;
        this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
          if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
            return;
          }
          synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
          requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
        });
        const responseInterceptorChain = [];
        this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
          responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
        });
        let promise;
        let i2 = 0;
        let len2;
        if (!synchronousRequestInterceptors) {
          const chain = [dispatchRequest.bind(this), void 0];
          chain.unshift.apply(chain, requestInterceptorChain);
          chain.push.apply(chain, responseInterceptorChain);
          len2 = chain.length;
          promise = Promise.resolve(config);
          while (i2 < len2) {
            promise = promise.then(chain[i2++], chain[i2++]);
          }
          return promise;
        }
        len2 = requestInterceptorChain.length;
        let newConfig = config;
        i2 = 0;
        while (i2 < len2) {
          const onFulfilled = requestInterceptorChain[i2++];
          const onRejected = requestInterceptorChain[i2++];
          try {
            newConfig = onFulfilled(newConfig);
          } catch (error) {
            onRejected.call(this, error);
            break;
          }
        }
        try {
          promise = dispatchRequest.call(this, newConfig);
        } catch (error) {
          return Promise.reject(error);
        }
        i2 = 0;
        len2 = responseInterceptorChain.length;
        while (i2 < len2) {
          promise = promise.then(responseInterceptorChain[i2++], responseInterceptorChain[i2++]);
        }
        return promise;
      }
      getUri(config) {
        config = mergeConfig$1(this.defaults, config);
        const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
        return buildURL(fullPath, config.params, config.paramsSerializer);
      }
    };
    utils$1.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
      Axios$1.prototype[method] = function(url, config) {
        return this.request(mergeConfig$1(config || {}, {
          method,
          url,
          data: (config || {}).data
        }));
      };
    });
    utils$1.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
      function generateHTTPMethod(isForm) {
        return function httpMethod(url, data, config) {
          return this.request(mergeConfig$1(config || {}, {
            method,
            headers: isForm ? {
              "Content-Type": "multipart/form-data"
            } : {},
            url,
            data
          }));
        };
      }
      Axios$1.prototype[method] = generateHTTPMethod();
      Axios$1.prototype[method + "Form"] = generateHTTPMethod(true);
    });
    let CancelToken$1 = class CancelToken2 {
      constructor(executor) {
        if (typeof executor !== "function") {
          throw new TypeError("executor must be a function.");
        }
        let resolvePromise;
        this.promise = new Promise(function promiseExecutor(resolve2) {
          resolvePromise = resolve2;
        });
        const token = this;
        this.promise.then((cancel) => {
          if (!token._listeners) return;
          let i2 = token._listeners.length;
          while (i2-- > 0) {
            token._listeners[i2](cancel);
          }
          token._listeners = null;
        });
        this.promise.then = (onfulfilled) => {
          let _resolve;
          const promise = new Promise((resolve2) => {
            token.subscribe(resolve2);
            _resolve = resolve2;
          }).then(onfulfilled);
          promise.cancel = function reject() {
            token.unsubscribe(_resolve);
          };
          return promise;
        };
        executor(function cancel(message2, config, request) {
          if (token.reason) {
            return;
          }
          token.reason = new CanceledError$1(message2, config, request);
          resolvePromise(token.reason);
        });
      }
      /**
       * Throws a `CanceledError` if cancellation has been requested.
       */
      throwIfRequested() {
        if (this.reason) {
          throw this.reason;
        }
      }
      /**
       * Subscribe to the cancel signal
       */
      subscribe(listener) {
        if (this.reason) {
          listener(this.reason);
          return;
        }
        if (this._listeners) {
          this._listeners.push(listener);
        } else {
          this._listeners = [listener];
        }
      }
      /**
       * Unsubscribe from the cancel signal
       */
      unsubscribe(listener) {
        if (!this._listeners) {
          return;
        }
        const index = this._listeners.indexOf(listener);
        if (index !== -1) {
          this._listeners.splice(index, 1);
        }
      }
      toAbortSignal() {
        const controller = new AbortController();
        const abort = (err) => {
          controller.abort(err);
        };
        this.subscribe(abort);
        controller.signal.unsubscribe = () => this.unsubscribe(abort);
        return controller.signal;
      }
      /**
       * Returns an object that contains a new `CancelToken` and a function that, when called,
       * cancels the `CancelToken`.
       */
      static source() {
        let cancel;
        const token = new CancelToken2(function executor(c2) {
          cancel = c2;
        });
        return {
          token,
          cancel
        };
      }
    };
    function spread$1(callback) {
      return function wrap(arr) {
        return callback.apply(null, arr);
      };
    }
    function isAxiosError$1(payload) {
      return utils$1.isObject(payload) && payload.isAxiosError === true;
    }
    const HttpStatusCode$1 = {
      Continue: 100,
      SwitchingProtocols: 101,
      Processing: 102,
      EarlyHints: 103,
      Ok: 200,
      Created: 201,
      Accepted: 202,
      NonAuthoritativeInformation: 203,
      NoContent: 204,
      ResetContent: 205,
      PartialContent: 206,
      MultiStatus: 207,
      AlreadyReported: 208,
      ImUsed: 226,
      MultipleChoices: 300,
      MovedPermanently: 301,
      Found: 302,
      SeeOther: 303,
      NotModified: 304,
      UseProxy: 305,
      Unused: 306,
      TemporaryRedirect: 307,
      PermanentRedirect: 308,
      BadRequest: 400,
      Unauthorized: 401,
      PaymentRequired: 402,
      Forbidden: 403,
      NotFound: 404,
      MethodNotAllowed: 405,
      NotAcceptable: 406,
      ProxyAuthenticationRequired: 407,
      RequestTimeout: 408,
      Conflict: 409,
      Gone: 410,
      LengthRequired: 411,
      PreconditionFailed: 412,
      PayloadTooLarge: 413,
      UriTooLong: 414,
      UnsupportedMediaType: 415,
      RangeNotSatisfiable: 416,
      ExpectationFailed: 417,
      ImATeapot: 418,
      MisdirectedRequest: 421,
      UnprocessableEntity: 422,
      Locked: 423,
      FailedDependency: 424,
      TooEarly: 425,
      UpgradeRequired: 426,
      PreconditionRequired: 428,
      TooManyRequests: 429,
      RequestHeaderFieldsTooLarge: 431,
      UnavailableForLegalReasons: 451,
      InternalServerError: 500,
      NotImplemented: 501,
      BadGateway: 502,
      ServiceUnavailable: 503,
      GatewayTimeout: 504,
      HttpVersionNotSupported: 505,
      VariantAlsoNegotiates: 506,
      InsufficientStorage: 507,
      LoopDetected: 508,
      NotExtended: 510,
      NetworkAuthenticationRequired: 511
    };
    Object.entries(HttpStatusCode$1).forEach(([key, value]) => {
      HttpStatusCode$1[value] = key;
    });
    function createInstance(defaultConfig) {
      const context = new Axios$1(defaultConfig);
      const instance = bind(Axios$1.prototype.request, context);
      utils$1.extend(instance, Axios$1.prototype, context, { allOwnKeys: true });
      utils$1.extend(instance, context, null, { allOwnKeys: true });
      instance.create = function create2(instanceConfig) {
        return createInstance(mergeConfig$1(defaultConfig, instanceConfig));
      };
      return instance;
    }
    const axios = createInstance(defaults);
    axios.Axios = Axios$1;
    axios.CanceledError = CanceledError$1;
    axios.CancelToken = CancelToken$1;
    axios.isCancel = isCancel$1;
    axios.VERSION = VERSION$1;
    axios.toFormData = toFormData$1;
    axios.AxiosError = AxiosError$1;
    axios.Cancel = axios.CanceledError;
    axios.all = function all2(promises) {
      return Promise.all(promises);
    };
    axios.spread = spread$1;
    axios.isAxiosError = isAxiosError$1;
    axios.mergeConfig = mergeConfig$1;
    axios.AxiosHeaders = AxiosHeaders$1;
    axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
    axios.getAdapter = adapters.getAdapter;
    axios.HttpStatusCode = HttpStatusCode$1;
    axios.default = axios;
    const {
      Axios,
      AxiosError,
      CanceledError,
      isCancel,
      CancelToken,
      VERSION,
      all,
      Cancel,
      isAxiosError,
      spread,
      toFormData,
      AxiosHeaders,
      HttpStatusCode,
      formToJSON,
      getAdapter,
      mergeConfig
    } = axios;
    const api = axios.create({
      baseURL: "http://localhost:8000",
      timeout: 5e3,
      headers: {
        "Content-Type": "application/json"
      }
    });
    api.interceptors.request.use(
      (config) => {
        return config;
      },
      (error) => {
        console.error("请求错误:", error);
        return Promise.reject(error);
      }
    );
    api.interceptors.response.use(
      (response) => {
        return response.data;
      },
      (error) => {
        console.error("响应错误:", error);
        return Promise.reject(error);
      }
    );
    const initializeSystem = (config) => {
      return api.post("/initialize", config);
    };
    const openLight = () => {
      return api.post("/light/open");
    };
    const closeLight = () => {
      return api.post("/light/close");
    };
    const startProcess = (config) => {
      return api.post("/start", config);
    };
    const stopProcess = () => {
      return api.post("/stop");
    };
    const cleanSand = (options = {}) => {
      return api.post("/clean", options);
    };
    const getCleanStatus = () => {
      return api.get("/clean/status");
    };
    const stopCleanProcess = () => {
      return api.post("/clean/stop");
    };
    const getScalePorts = () => {
      return api.get("/scale/ports");
    };
    const getScaleStatus = () => {
      return api.get("/scale/status");
    };
    const connectScale = (port) => {
      return api.post(`/scale/connect/${port}`);
    };
    const disconnectScale = () => {
      return api.post("/scale/disconnect");
    };
    const calibrateZero = () => {
      return api.post("/scale/calibrate/zero");
    };
    const calibrateGain = (calibrationWeight, slaveAddress = 1) => {
      return api.post("/scale/calibrate/gain", {
        calibration_weight: calibrationWeight,
        slave_address: slaveAddress
      });
    };
    const getWeight = () => {
      return api.get("/scale/weight");
    };
    const getDirectoryImages = (directory) => {
      return api.get("/images/list", { params: { directory } });
    };
    const getImageUrl = (imagePath) => {
      return `${api.defaults.baseURL}/images/file?path=${encodeURIComponent(imagePath)}`;
    };
    const XFYUN_API_URL = "/xfyun-api/v1/chat/completions";
    const AUTH_TOKEN = "pFKHvqJefKoFYrsZVvqJ:QneWSeXeqoeefFUBsAcV";
    const chatWithXfyun = async (userMessage) => {
      try {
        const requestBody = {
          model: "4.0Ultra",
          messages: [
            {
              role: "user",
              content: userMessage
            }
          ],
          stream: false
        };
        const headers = {
          Authorization: `Bearer ${AUTH_TOKEN}`,
          "Content-Type": "application/json"
        };
        const response = await axios.post(XFYUN_API_URL, requestBody, { headers });
        if (response.data && response.data.choices && response.data.choices.length > 0) {
          return response.data.choices[0].message.content;
        } else {
          throw new Error("无效的API响应格式");
        }
      } catch (error) {
        console.error("调用讯飞星火大模型API失败:", error);
        throw error;
      }
    };
    const _sfc_main$4 = {
      name: "SandGradingReport",
      components: {
        Refresh: refresh_default,
        Printer: printer_default,
        Picture: picture_default
      },
      setup() {
        const showLineChart = ref(true);
        const reportData = ref({
          categories: [
            "<0.075",
            "0.075~0.15",
            "0.15~0.3",
            "0.3~0.6",
            "0.6~1.18",
            "1.18~2.36",
            "2.36~4.75"
          ],
          percentages: [5.2, 7.36, 13.25, 18.4, 22.65, 25.84, 7.3],
          cumulative: [5.2, 12.56, 25.81, 44.21, 66.86, 92.7, 100]
        });
        const fineModulus = ref("2.54");
        const reportNumber = ref("ICDIO-2025-0425-001");
        const pieChartRef = ref(null);
        const lineChartRef = ref(null);
        const currentDateTime = ref("2025-04-25 14:30");
        let pieChart = null;
        let lineChart = null;
        const aiLoading = ref(false);
        const aiRecommendation = ref({
          conclusion: "本次检测的机制砂样品细度模数为2.54，符合中砂级配范围。粒径分布呈现明显的中间粒级含量高、两端粒级含量低的特征。其中1.18~2.36占比最高，达25.84%，0.6~1.18次之，为22.65%。",
          optimizationSuggestions: [
            "当前级配中细粉含量(<0.075mm)为5.20%，处于合理范围内，有利于提高混凝土的和易性。",
            "中间粒级(0.3~2.36mm)含量较高(66.89%)，有利于减少孔隙率，但可考虑适当增加2.36~4.75mm粒级含量，以完善机制砂级配的连续性。",
            "建议在混凝土配合比设计时，可适当调整水灰比和掺合料用量，以充分发挥当前机制砂级配特点的优势。"
          ],
          applicationSuitability: "当前级配的机制砂适合应用于C25-C40强度等级的普通混凝土工程，如建筑结构、路面等。细度模数为2.54的中砂特性使其具有良好的工作性能，适合大多数常规混凝土应用场景。"
        });
        const generateRandomData = () => {
          aiLoading.value = true;
          let percentages = [];
          let total2 = 0;
          for (let i2 = 0; i2 < 7; i2++) {
            const rand = Math.random() * 20 + 5;
            percentages.push(rand);
            total2 += rand;
          }
          const normalizedPercentages = percentages.map(
            (p2) => parseFloat((p2 / total2 * 100).toFixed(2))
          );
          let sum2 = normalizedPercentages.reduce((a2, b2) => a2 + b2, 0);
          if (sum2 !== 100) {
            const diff = 100 - sum2;
            normalizedPercentages[0] += diff;
            normalizedPercentages[0] = parseFloat(normalizedPercentages[0].toFixed(2));
          }
          const cumulativeValues = [];
          let cumulative = 0;
          for (let i2 = 0; i2 < normalizedPercentages.length; i2++) {
            cumulative += normalizedPercentages[i2];
            cumulativeValues.push(parseFloat(cumulative.toFixed(2)));
          }
          reportData.value = {
            categories: [
              "<0.075",
              "0.075~0.15",
              "0.15~0.3",
              "0.3~0.6",
              "0.6~1.18",
              "1.18~2.36",
              "2.36~4.75"
            ],
            percentages: normalizedPercentages,
            cumulative: cumulativeValues
          };
          calculateFineModulus();
          reportNumber.value = `ICDIO-2025-0425-${Math.floor(Math.random() * 1e3)}`;
          const now2 = /* @__PURE__ */ new Date();
          currentDateTime.value = `${now2.getFullYear()}-${String(now2.getMonth() + 1).padStart(2, "0")}-${String(now2.getDate()).padStart(2, "0")} ${String(now2.getHours()).padStart(2, "0")}:${String(now2.getMinutes()).padStart(2, "0")}`;
          generateAIRecommendation();
          nextTick(() => {
            if (pieChart) {
              initPieChart();
            }
            if (lineChart && showLineChart.value) {
              initLineChart();
            }
          });
        };
        const calculateFineModulus = () => {
          const cumulativeRetained = reportData.value.cumulative.map((val) => 100 - val);
          const sum2 = cumulativeRetained.reduce((acc, val) => acc + val, 0) + 100;
          fineModulus.value = (sum2 / 100).toFixed(2);
        };
        const generateAIRecommendation = async () => {
          try {
            const fm = parseFloat(fineModulus.value);
            let sandType = "";
            if (fm >= 3.7) {
              sandType = "超粗砂";
            } else if (fm >= 3.1) {
              sandType = "粗砂";
            } else if (fm >= 2.3) {
              sandType = "中砂";
            } else if (fm >= 1.6) {
              sandType = "细砂";
            } else if (fm >= 0.7) {
              sandType = "特细砂";
            } else {
              sandType = "极细砂";
            }
            const midSizeContent = reportData.value.percentages[3] + reportData.value.percentages[4] + reportData.value.percentages[5];
            const midSizeContentStr = midSizeContent.toFixed(2);
            const fineContent = reportData.value.percentages[0].toFixed(2);
            const prompt = `
作为一名专业的砂石级配分析专家，请根据以下机制砂级配数据进行分析并给出专业建议：

1. 细度模数：${fm}，砂类型：${sandType}
2. 粒径分布数据（百分比）：
   - <0.075mm: ${reportData.value.percentages[0].toFixed(2)}%
   - 0.075~0.15mm: ${reportData.value.percentages[1].toFixed(2)}%
   - 0.15~0.3mm: ${reportData.value.percentages[2].toFixed(2)}%
   - 0.3~0.6mm: ${reportData.value.percentages[3].toFixed(2)}%
   - 0.6~1.18mm: ${reportData.value.percentages[4].toFixed(2)}%
   - 1.18~2.36mm: ${reportData.value.percentages[5].toFixed(2)}%
   - 2.36~4.75mm: ${reportData.value.percentages[6].toFixed(2)}%
3. 中间粒级(0.3~2.36mm)含量：${midSizeContentStr}%
4. 细粉含量(<0.075mm)：${fineContent}%

请提供以下三部分内容：
1. 分析结论：对当前级配特点的简要总结，包括细度模数是否符合砂类型范围、粒径分布特征等。
2. 优化建议：针对当前级配提出3点具体改进建议，包括如何调整各粒径含量以优化级配。
3. 应用适宜性：说明当前级配的机制砂适合应用的混凝土类型和工程场景。

请确保回答专业、简洁，每部分不超过100字。回答格式为JSON，包含conclusion、optimizationSuggestions（数组）和applicationSuitability三个字段。
`;
            const response = await chatWithXfyun(prompt);
            try {
              const aiResponse = JSON.parse(response);
              aiRecommendation.value = {
                conclusion: aiResponse.conclusion || "无法获取分析结论",
                optimizationSuggestions: aiResponse.optimizationSuggestions || ["无法获取优化建议"],
                applicationSuitability: aiResponse.applicationSuitability || "无法获取应用适宜性分析"
              };
            } catch (parseError) {
              console.error("解析AI响应失败:", parseError);
              generateLocalAIRecommendation();
            }
          } catch (error) {
            console.error("获取AI建议失败:", error);
            ElMessage.error("获取AI建议失败，将使用本地生成的建议");
            generateLocalAIRecommendation();
          } finally {
            aiLoading.value = false;
          }
        };
        const generateLocalAIRecommendation = () => {
          const fm = parseFloat(fineModulus.value);
          let sandType = "";
          if (fm >= 3.7) {
            sandType = "超粗砂";
          } else if (fm >= 3.1) {
            sandType = "粗砂";
          } else if (fm >= 2.3) {
            sandType = "中砂";
          } else if (fm >= 1.6) {
            sandType = "细砂";
          } else if (fm >= 0.7) {
            sandType = "特细砂";
          } else {
            sandType = "极细砂";
          }
          const midSizeContent = reportData.value.percentages[3] + reportData.value.percentages[4] + reportData.value.percentages[5];
          const midSizeContentStr = midSizeContent.toFixed(2);
          const fineContent = reportData.value.percentages[0].toFixed(2);
          const conclusion = `本次检测的机制砂样品细度模数为${fm}，${fm >= 3.7 ? "超出" : "符合"}${sandType}级配范围。粒径分布呈现明显的中间粒级含量高、两端粒级含量低的特征。其中1.18~2.36占比最高，达${reportData.value.percentages[5].toFixed(2)}%，0.6~1.18次之，为${reportData.value.percentages[4].toFixed(2)}%。`;
          const suggestions = [
            `当前级配中细粉含量(<0.075mm)为${fineContent}%，${parseFloat(fineContent) > 7 ? "偏高，应适当降低以减少用水量，建议控制在7%以下" : "处于合理范围内，有利于提高混凝土的和易性"}。`,
            `中间粒级(0.3~2.36mm)含量${parseFloat(midSizeContentStr) > 60 ? "较高" : "适中"}(${midSizeContentStr}%)，有利于减少孔隙率，但可考虑适当${parseFloat(reportData.value.percentages[6].toFixed(2)) < 10 ? "增加2.36~4.75mm粒级含量，以完善机制砂级配的连续性" : "平衡各粒径含量，提高级配的均匀性"}。`,
            `建议在混凝土配合比设计时，可适当调整水灰比和掺合料用量，以充分发挥当前机制砂级配特点的优势。`
          ];
          let suitability = "";
          if (fm >= 3.7) {
            suitability = `当前级配的机制砂适合应用于C40以上强度等级的混凝土工程，如高强度混凝土结构、重要水工建筑等。细度模数为${fm}的${sandType}特性使其具有较高的强度发展能力，但需注意提高混凝土的和易性。`;
          } else if (fm >= 3.1) {
            suitability = `当前级配的机制砂适合应用于C30-C50强度等级的普通混凝土工程，如建筑结构、路面、一般水工建筑等。细度模数为${fm}的${sandType}特性使其具有良好的工作性能和力学性能平衡，可获得较好的混凝土和易性和强度发展。`;
          } else if (fm >= 2.3) {
            suitability = `当前级配的机制砂适合应用于C25-C40强度等级的普通混凝土工程，如建筑结构、路面等。细度模数为${fm}的${sandType}特性使其具有良好的工作性能，适合大多数常规混凝土应用场景。`;
          } else {
            suitability = `当前级配的机制砂适合应用于对和易性要求较高、强度要求不太高的混凝土工程，如抹灰砂浆、填充混凝土等。细度模数为${fm}的${sandType}特性使其需水量较大，但具有良好的粘聚性和可泵性。`;
          }
          aiRecommendation.value = {
            conclusion,
            optimizationSuggestions: suggestions,
            applicationSuitability: suitability
          };
        };
        const initPieChart = () => {
          if (!pieChartRef.value) return;
          if (pieChart) {
            pieChart.dispose();
          }
          nextTick(() => {
            try {
              console.log("初始化饼图", pieChartRef.value);
              pieChart = init$1(pieChartRef.value);
              const pieData = reportData.value.categories.map((category, index) => {
                return {
                  name: category,
                  value: reportData.value.percentages[index]
                };
              });
              const pieOption = {
                tooltip: {
                  trigger: "item",
                  formatter: "{b}: {c}% ({d}%)"
                },
                legend: {
                  orient: "vertical",
                  right: 10,
                  top: "center",
                  itemWidth: 10,
                  itemHeight: 10,
                  textStyle: {
                    fontSize: 8
                  }
                },
                series: [
                  {
                    name: "粒径占比",
                    type: "pie",
                    radius: ["30%", "70%"],
                    center: ["40%", "50%"],
                    avoidLabelOverlap: false,
                    itemStyle: {
                      borderRadius: 4,
                      borderColor: "#fff",
                      borderWidth: 1
                    },
                    label: {
                      show: false
                    },
                    emphasis: {
                      label: {
                        show: false
                      }
                    },
                    labelLine: {
                      show: false
                    },
                    data: pieData
                  }
                ]
              };
              pieChart.setOption(pieOption);
              setTimeout(() => {
                try {
                  const pieImgUrl = pieChart.getDataURL({
                    type: "png",
                    pixelRatio: 2,
                    backgroundColor: "#fff"
                  });
                  const staticPieImg = document.getElementById("staticPieChart");
                  if (staticPieImg) {
                    staticPieImg.src = pieImgUrl;
                  }
                } catch (e2) {
                  console.error("生成饼图静态图失败:", e2);
                }
              }, 500);
            } catch (e2) {
              console.error("饼图初始化失败:", e2);
            }
          });
        };
        const initLineChart = () => {
          if (!lineChartRef.value) return;
          if (lineChart) {
            lineChart.dispose();
          }
          lineChart = init$1(lineChartRef.value);
          const lineOption = {
            grid: {
              left: 60,
              right: 20,
              bottom: 60,
              top: 20
            },
            xAxis: {
              type: "category",
              data: reportData.value.categories,
              axisLabel: {
                rotate: 30,
                fontSize: 10,
                interval: 0
              },
              name: "粒径 (mm)",
              nameLocation: "middle",
              nameGap: 35,
              nameTextStyle: {
                fontSize: 10
              }
            },
            yAxis: {
              type: "value",
              name: "累计百分比 (%)",
              nameLocation: "middle",
              nameGap: 40,
              nameTextStyle: {
                fontSize: 10
              },
              splitLine: {
                lineStyle: {
                  color: "#ddd"
                }
              },
              max: 100
            },
            series: [
              {
                name: "累计百分比",
                type: "line",
                data: reportData.value.cumulative,
                symbol: "circle",
                symbolSize: 6,
                lineStyle: {
                  width: 2,
                  color: "#666",
                  type: "solid"
                },
                itemStyle: {
                  color: "#666",
                  borderWidth: 1,
                  borderColor: "#fff"
                },
                label: {
                  show: true,
                  position: "top",
                  formatter: "{c}%",
                  fontSize: 9,
                  color: "#000"
                }
              }
            ]
          };
          lineChart.setOption(lineOption);
          setTimeout(() => {
            try {
              const lineImgUrl = lineChart.getDataURL({
                type: "png",
                pixelRatio: 2,
                backgroundColor: "#fff"
              });
              const staticLineImg = document.getElementById("staticLineChart");
              if (staticLineImg) {
                staticLineImg.src = lineImgUrl;
              }
            } catch (e2) {
              console.error("生成折线图静态图失败:", e2);
            }
          }, 500);
        };
        const exportPDF = () => {
          nextTick(() => {
            if (pieChart) {
              try {
                const pieImgUrl = pieChart.getDataURL({
                  type: "png",
                  pixelRatio: 2,
                  backgroundColor: "#fff"
                });
                const staticPieImg = document.getElementById("staticPieChart");
                if (staticPieImg) {
                  staticPieImg.src = pieImgUrl;
                }
              } catch (e2) {
                console.error("生成饼图静态图失败:", e2);
              }
            }
            if (lineChart && showLineChart.value) {
              try {
                const lineImgUrl = lineChart.getDataURL({
                  type: "png",
                  pixelRatio: 2,
                  backgroundColor: "#fff"
                });
                const staticLineImg = document.getElementById("staticLineChart");
                if (staticLineImg) {
                  staticLineImg.src = lineImgUrl;
                }
              } catch (e2) {
                console.error("生成折线图静态图失败:", e2);
              }
            }
            setTimeout(() => {
              window.print();
            }, 500);
          });
        };
        const exportAsImage = async () => {
          try {
            ElMessage.info("正在生成图片，请稍候...");
            await nextTick();
            const printContainer = document.querySelector(".print-container");
            if (!printContainer) {
              ElMessage.error("未找到报告容器");
              return;
            }
            const canvas = await html2canvas(printContainer, {
              scale: 2,
              // 提高清晰度
              useCORS: true,
              // 允许加载跨域图片
              logging: false,
              backgroundColor: "#ffffff"
            });
            const imgData = canvas.toDataURL("image/png");
            const link = document.createElement("a");
            link.href = imgData;
            link.download = `砂级配报告_${reportNumber.value}.png`;
            document.body.appendChild(link);
            link.click();
            document.body.removeChild(link);
            ElMessage.success("图片已生成并下载");
          } catch (error) {
            console.error("导出图片失败:", error);
            ElMessage.error("导出图片失败，请重试");
          }
        };
        const handleResize = () => {
          if (pieChart) {
            pieChart.resize();
          }
          if (lineChart) {
            lineChart.resize();
          }
        };
        onMounted(() => {
          nextTick(() => {
            initPieChart();
            if (showLineChart.value) {
              initLineChart();
            }
          });
          window.addEventListener("resize", handleResize);
          window.addEventListener("beforeprint", () => {
            if (pieChart) {
              try {
                const pieImgUrl = pieChart.getDataURL({
                  type: "png",
                  pixelRatio: 2,
                  backgroundColor: "#fff"
                });
                const staticPieImg = document.getElementById("staticPieChart");
                if (staticPieImg) {
                  staticPieImg.src = pieImgUrl;
                }
              } catch (e2) {
                console.error("生成饼图静态图失败:", e2);
              }
            }
            if (lineChart && showLineChart.value) {
              try {
                const lineImgUrl = lineChart.getDataURL({
                  type: "png",
                  pixelRatio: 2,
                  backgroundColor: "#fff"
                });
                const staticLineImg = document.getElementById("staticLineChart");
                if (staticLineImg) {
                  staticLineImg.src = lineImgUrl;
                }
              } catch (e2) {
                console.error("生成折线图静态图失败:", e2);
              }
            }
          });
        });
        return {
          showLineChart,
          reportData,
          fineModulus,
          reportNumber,
          pieChartRef,
          lineChartRef,
          currentDateTime,
          aiRecommendation,
          aiLoading,
          generateRandomData,
          exportPDF,
          exportAsImage
        };
      }
    };
    const _hoisted_1$4 = { class: "sand-grading-report bg-white text-gray-900" };
    const _hoisted_2$4 = { class: "report-header bg-gray-100 p-3 rounded-md mb-4" };
    const _hoisted_3$4 = { class: "report-actions flex items-center justify-between" };
    const _hoisted_4$4 = { class: "mx-auto py-4 px-3 print-container bg-white border border-gray-200 rounded-md shadow-sm" };
    const _hoisted_5$4 = { class: "mb-3 border-b-2 border-blue-600 pb-2 flex items-center justify-between" };
    const _hoisted_6$4 = { class: "flex items-center" };
    const _hoisted_7$4 = { class: "text-sm font-bold mr-2 text-gray-700" };
    const _hoisted_8$4 = { class: "w-10 h-10 bg-white flex items-center justify-center border border-gray-300 rounded-sm" };
    const _hoisted_9$4 = ["src"];
    const _hoisted_10$3 = { class: "mb-2 text-xs leading-4" };
    const _hoisted_11$2 = { class: "mb-0.5" };
    const _hoisted_12$2 = { class: "mb-0.5" };
    const _hoisted_13$1 = { class: "mb-0.5" };
    const _hoisted_14$1 = { class: "mb-2 bg-gray-100 border-l-4 border-blue-600 p-1 relative" };
    const _hoisted_15$1 = { class: "flex items-center justify-between" };
    const _hoisted_16$1 = { class: "flex items-center" };
    const _hoisted_17$1 = { class: "text-xs mr-3" };
    const _hoisted_18$1 = { class: "font-bold" };
    const _hoisted_19$1 = { class: "text-xs flex items-center" };
    const _hoisted_20$1 = { class: "mb-2" };
    const _hoisted_21$1 = { class: "w-full border-collapse border border-gray-400 text-xs" };
    const _hoisted_22$1 = { class: "bg-gray-200" };
    const _hoisted_23$1 = { class: "text-center" };
    const _hoisted_24$1 = {
      key: 0,
      class: "mb-2"
    };
    const _hoisted_25$1 = {
      id: "lineChartContainer",
      ref: "lineChartRef",
      class: "border border-gray-200 bg-gray-50 chart-container print-chart rounded-sm shadow-sm",
      style: { "height": "200px", "overflow": "hidden" }
    };
    const _hoisted_26$1 = { class: "flex gap-2 mb-2" };
    const _hoisted_27$1 = { class: "w-2/3" };
    const _hoisted_28$1 = { class: "border border-gray-400 p-1 bg-gray-50 text-xs leading-4 rounded-sm" };
    const _hoisted_29$1 = { class: "flex mb-1" };
    const _hoisted_30$1 = { class: "w-full pr-1" };
    const _hoisted_31$1 = { class: "w-full border border-gray-400 text-xs" };
    const _hoisted_32$1 = { class: "text-center" };
    const _hoisted_33$1 = { class: "border border-gray-400 p-1 bg-gray-50 mb-1 rounded-sm" };
    const _hoisted_34$1 = { class: "mb-0.5" };
    const _hoisted_35$1 = { class: "w-1/3 h-full" };
    const _hoisted_36$1 = {
      id: "pieChartContainer",
      ref: "pieChartRef",
      class: "border border-gray-200 bg-gray-50 chart-container print-chart rounded-sm shadow-sm",
      style: { "height": "180px", "overflow": "hidden" }
    };
    const _hoisted_37$1 = { class: "mb-2" };
    const _hoisted_38$1 = { class: "border border-green-200 p-2 bg-green-50 text-xs leading-4 rounded-sm" };
    const _hoisted_39$1 = {
      key: 0,
      class: "flex justify-center items-center py-4"
    };
    const _hoisted_40$1 = { key: 1 };
    const _hoisted_41 = { class: "list-decimal pl-4 space-y-0.5" };
    const _hoisted_42 = { class: "flex justify-between items-center border-t pt-2 mt-2" };
    const _hoisted_43 = { class: "flex items-center space-x-2" };
    const _hoisted_44 = { class: "text-xs" };
    function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_Refresh = resolveComponent("Refresh");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_button = resolveComponent("el-button");
      const _component_Printer = resolveComponent("Printer");
      const _component_Picture = resolveComponent("Picture");
      const _component_el_button_group = resolveComponent("el-button-group");
      const _component_el_checkbox = resolveComponent("el-checkbox");
      const _component_el_progress = resolveComponent("el-progress");
      return openBlock(), createElementBlock("div", _hoisted_1$4, [
        createBaseVNode("div", _hoisted_2$4, [
          _cache[5] || (_cache[5] = createBaseVNode("h2", { class: "text-blue-700 mb-2" }, "机制砂级配检测报告", -1)),
          createBaseVNode("div", _hoisted_3$4, [
            createVNode$1(_component_el_button_group, null, {
              default: withCtx(() => [
                createVNode$1(_component_el_button, {
                  type: "primary",
                  size: "small",
                  onClick: $setup.generateRandomData,
                  class: "bg-blue-600 hover:bg-blue-700"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(_component_Refresh)
                      ]),
                      _: 1
                    }),
                    _cache[1] || (_cache[1] = createTextVNode(" AI建议 "))
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                createVNode$1(_component_el_button, {
                  type: "success",
                  size: "small",
                  onClick: $setup.exportPDF,
                  class: "bg-green-600 hover:bg-green-700"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(_component_Printer)
                      ]),
                      _: 1
                    }),
                    _cache[2] || (_cache[2] = createTextVNode(" 打印报告 "))
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                createVNode$1(_component_el_button, {
                  type: "warning",
                  size: "small",
                  onClick: $setup.exportAsImage,
                  class: "bg-amber-500 hover:bg-amber-600"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(_component_Picture)
                      ]),
                      _: 1
                    }),
                    _cache[3] || (_cache[3] = createTextVNode(" 导出长图片 "))
                  ]),
                  _: 1
                }, 8, ["onClick"])
              ]),
              _: 1
            }),
            createVNode$1(_component_el_checkbox, {
              modelValue: $setup.showLineChart,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.showLineChart = $event),
              class: "ml-4 text-gray-700"
            }, {
              default: withCtx(() => _cache[4] || (_cache[4] = [
                createTextVNode("显示级配曲线图")
              ])),
              _: 1
            }, 8, ["modelValue"])
          ])
        ]),
        createBaseVNode("div", _hoisted_4$4, [
          createBaseVNode("div", _hoisted_5$4, [
            _cache[6] || (_cache[6] = createBaseVNode("h1", { class: "text-xl font-bold text-blue-800" }, "机制砂级配检测报告", -1)),
            createBaseVNode("div", _hoisted_6$4, [
              createBaseVNode("span", _hoisted_7$4, "报告编号: " + toDisplayString($setup.reportNumber), 1),
              createBaseVNode("div", _hoisted_8$4, [
                createBaseVNode("img", {
                  src: `https://api.qrserver.com/v1/create-qr-code/?size=70x70&data=${$setup.reportNumber}`,
                  alt: "报告二维码",
                  class: "w-full h-full"
                }, null, 8, _hoisted_9$4)
              ])
            ])
          ]),
          createBaseVNode("div", _hoisted_10$3, [
            createBaseVNode("p", _hoisted_11$2, [
              _cache[7] || (_cache[7] = createBaseVNode("strong", null, "送检单位：", -1)),
              _cache[8] || (_cache[8] = createTextVNode("中交一公局集团有限公司 ")),
              _cache[9] || (_cache[9] = createBaseVNode("strong", { class: "ml-2" }, "送检人：", -1)),
              _cache[10] || (_cache[10] = createTextVNode("王强 ")),
              _cache[11] || (_cache[11] = createBaseVNode("strong", { class: "ml-2" }, "采样时间：", -1)),
              createTextVNode(toDisplayString($setup.currentDateTime), 1)
            ]),
            createBaseVNode("p", _hoisted_12$2, [
              _cache[12] || (_cache[12] = createBaseVNode("strong", null, "收样时间：", -1)),
              createTextVNode(toDisplayString($setup.currentDateTime) + " ", 1),
              _cache[13] || (_cache[13] = createBaseVNode("strong", { class: "ml-2" }, "采样批次编号：", -1)),
              createTextVNode(toDisplayString(Math.floor(Math.random() * 1e3)) + " ", 1),
              _cache[14] || (_cache[14] = createBaseVNode("strong", { class: "ml-2" }, "样品编号：", -1)),
              createTextVNode(toDisplayString(Math.floor(Math.random() * 100)), 1)
            ]),
            createBaseVNode("p", _hoisted_13$1, [
              _cache[15] || (_cache[15] = createBaseVNode("strong", null, "检测人：", -1)),
              _cache[16] || (_cache[16] = createTextVNode("张明 ")),
              _cache[17] || (_cache[17] = createBaseVNode("strong", { class: "ml-2" }, "检测时间：", -1)),
              createTextVNode(toDisplayString($setup.currentDateTime) + " ", 1),
              _cache[18] || (_cache[18] = createBaseVNode("strong", { class: "ml-2" }, "报告时间：", -1)),
              createTextVNode(toDisplayString($setup.currentDateTime), 1)
            ]),
            _cache[19] || (_cache[19] = createBaseVNode("p", { class: "mb-0.5" }, [
              createBaseVNode("strong", null, "复核人："),
              createTextVNode("李华 "),
              createBaseVNode("strong", { class: "ml-2" }, "审核人："),
              createTextVNode("吴涛 ")
            ], -1))
          ]),
          createBaseVNode("div", _hoisted_14$1, [
            createBaseVNode("div", _hoisted_15$1, [
              createBaseVNode("div", _hoisted_16$1, [
                createBaseVNode("p", _hoisted_17$1, [
                  _cache[20] || (_cache[20] = createBaseVNode("strong", null, "细度模数：", -1)),
                  createBaseVNode("span", _hoisted_18$1, toDisplayString($setup.fineModulus), 1)
                ]),
                createBaseVNode("p", _hoisted_19$1, [
                  _cache[21] || (_cache[21] = createBaseVNode("strong", null, "检测结论：", -1)),
                  createBaseVNode("span", {
                    class: normalizeClass(["font-bold ml-1", {
                      "text-green-700": parseFloat($setup.fineModulus) >= 2.3 && parseFloat($setup.fineModulus) <= 3.7,
                      "text-red-600": parseFloat($setup.fineModulus) < 2.3 || parseFloat($setup.fineModulus) > 3.7
                    }])
                  }, toDisplayString(parseFloat($setup.fineModulus) >= 2.3 && parseFloat($setup.fineModulus) <= 3.7 ? "合格" : "不合格"), 3)
                ])
              ])
            ])
          ]),
          createBaseVNode("div", _hoisted_20$1, [
            _cache[25] || (_cache[25] = createBaseVNode("h2", { class: "text-xs font-semibold mb-1 text-blue-800" }, "级配表格", -1)),
            createBaseVNode("table", _hoisted_21$1, [
              createBaseVNode("thead", _hoisted_22$1, [
                createBaseVNode("tr", null, [
                  _cache[22] || (_cache[22] = createBaseVNode("th", { class: "border px-1 py-0.5" }, "粒径 (mm)", -1)),
                  (openBlock(true), createElementBlock(Fragment, null, renderList($setup.reportData.categories, (category, index) => {
                    return openBlock(), createElementBlock("th", {
                      key: index,
                      class: "border px-1 py-0.5"
                    }, toDisplayString(category), 1);
                  }), 128))
                ])
              ]),
              createBaseVNode("tbody", _hoisted_23$1, [
                createBaseVNode("tr", null, [
                  _cache[23] || (_cache[23] = createBaseVNode("td", { class: "border px-1 py-0.5 font-semibold" }, "占比 (%)", -1)),
                  (openBlock(true), createElementBlock(Fragment, null, renderList($setup.reportData.percentages, (percentage, index) => {
                    return openBlock(), createElementBlock("td", {
                      key: index,
                      class: "border px-1 py-0.5"
                    }, toDisplayString(percentage.toFixed(2)), 1);
                  }), 128))
                ]),
                createBaseVNode("tr", null, [
                  _cache[24] || (_cache[24] = createBaseVNode("td", { class: "border px-1 py-0.5 font-semibold" }, "累计占比 (%)", -1)),
                  (openBlock(true), createElementBlock(Fragment, null, renderList($setup.reportData.cumulative, (cumulative, index) => {
                    return openBlock(), createElementBlock("td", {
                      key: index,
                      class: "border px-1 py-0.5"
                    }, toDisplayString(cumulative.toFixed(2)), 1);
                  }), 128))
                ])
              ])
            ])
          ]),
          $setup.showLineChart ? (openBlock(), createElementBlock("div", _hoisted_24$1, [
            _cache[27] || (_cache[27] = createBaseVNode("h2", { class: "text-xs font-semibold mb-1 text-blue-800" }, "级配曲线图", -1)),
            createBaseVNode("div", _hoisted_25$1, _cache[26] || (_cache[26] = [
              createBaseVNode("img", {
                id: "staticLineChart",
                class: "static-chart",
                alt: "机制砂级配曲线图"
              }, null, -1)
            ]), 512)
          ])) : createCommentVNode("", true),
          createBaseVNode("div", _hoisted_26$1, [
            createBaseVNode("div", _hoisted_27$1, [
              _cache[43] || (_cache[43] = createBaseVNode("h2", { class: "text-xs font-semibold mb-1 text-blue-800" }, "标准解释", -1)),
              createBaseVNode("div", _hoisted_28$1, [
                createBaseVNode("div", _hoisted_29$1, [
                  createBaseVNode("div", _hoisted_30$1, [
                    _cache[37] || (_cache[37] = createBaseVNode("p", { class: "font-semibold mb-0.5" }, "机制砂分类标准（GB/T 14684-2022）：", -1)),
                    createBaseVNode("table", _hoisted_31$1, [
                      _cache[36] || (_cache[36] = createBaseVNode("thead", { class: "bg-gray-200" }, [
                        createBaseVNode("tr", null, [
                          createBaseVNode("th", { class: "border px-1 py-0.5" }, "砂的类别"),
                          createBaseVNode("th", { class: "border px-1 py-0.5" }, "细度模数范围"),
                          createBaseVNode("th", { class: "border px-1 py-0.5" }, "特点")
                        ])
                      ], -1)),
                      createBaseVNode("tbody", _hoisted_32$1, [
                        createBaseVNode("tr", null, [
                          _cache[28] || (_cache[28] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "粗砂", -1)),
                          createBaseVNode("td", {
                            class: normalizeClass(["border px-1 py-0.5", {
                              "bg-gray-200": parseFloat($setup.fineModulus) >= 3.1 && parseFloat($setup.fineModulus) <= 3.7
                            }])
                          }, " 3.7~3.1 ", 2),
                          _cache[29] || (_cache[29] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "粒径较大，表面积小", -1))
                        ]),
                        createBaseVNode("tr", null, [
                          _cache[30] || (_cache[30] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "中砂", -1)),
                          createBaseVNode("td", {
                            class: normalizeClass(["border px-1 py-0.5", {
                              "bg-gray-200": parseFloat($setup.fineModulus) >= 2.3 && parseFloat($setup.fineModulus) < 3.1
                            }])
                          }, " 3.0~2.3 ", 2),
                          _cache[31] || (_cache[31] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "粒径中等，性能均衡", -1))
                        ]),
                        createBaseVNode("tr", null, [
                          _cache[32] || (_cache[32] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "细砂", -1)),
                          createBaseVNode("td", {
                            class: normalizeClass(["border px-1 py-0.5", {
                              "bg-gray-200": parseFloat($setup.fineModulus) >= 1.6 && parseFloat($setup.fineModulus) < 2.3
                            }])
                          }, " 2.2~1.6 ", 2),
                          _cache[33] || (_cache[33] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "粒径较小，表面积大", -1))
                        ]),
                        createBaseVNode("tr", null, [
                          _cache[34] || (_cache[34] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "特细砂", -1)),
                          createBaseVNode("td", {
                            class: normalizeClass(["border px-1 py-0.5", {
                              "bg-gray-200": parseFloat($setup.fineModulus) >= 0.7 && parseFloat($setup.fineModulus) < 1.6
                            }])
                          }, " 1.5~0.7 ", 2),
                          _cache[35] || (_cache[35] = createBaseVNode("td", { class: "border px-1 py-0.5" }, "粒径极小，需水量大", -1))
                        ])
                      ])
                    ])
                  ])
                ]),
                createBaseVNode("div", _hoisted_33$1, [
                  _cache[38] || (_cache[38] = createBaseVNode("p", { class: "font-semibold mb-0.5 text-blue-800" }, "细度模数计算方法：", -1)),
                  _cache[39] || (_cache[39] = createBaseVNode("p", { class: "mb-0.5" }, "细度模数(MF) = (各筛孔累计筛余百分率之和) ÷ 100", -1)),
                  _cache[40] || (_cache[40] = createBaseVNode("p", { class: "mb-0.5" }, "本样品计算：", -1)),
                  createBaseVNode("p", _hoisted_34$1, " MF = (" + toDisplayString($setup.reportData.cumulative.map((val) => (100 - val).toFixed(2)).join(" + ")) + " + 100) ÷ 100 = " + toDisplayString($setup.fineModulus), 1)
                ]),
                _cache[41] || (_cache[41] = createBaseVNode("p", { class: "font-semibold mb-0.5 mt-1 text-blue-800" }, "机制砂质量要求（部分）：", -1)),
                _cache[42] || (_cache[42] = createBaseVNode("ul", { class: "list-disc pl-4 space-y-0.5" }, [
                  createBaseVNode("li", null, "石粉含量(<0.075mm)：Ⅰ类≤3.0%，Ⅱ类≤5.0%，Ⅲ类≤7.0%"),
                  createBaseVNode("li", null, "压碎值指标：≤26%（高强混凝土）；≤30%（普通混凝土）"),
                  createBaseVNode("li", null, "MB值：≤1.4（高性能混凝土）；≤1.8（普通混凝土）")
                ], -1))
              ])
            ]),
            createBaseVNode("div", _hoisted_35$1, [
              _cache[45] || (_cache[45] = createBaseVNode("h2", { class: "text-xs font-semibold mb-1 text-blue-800" }, "粒径占比饼图", -1)),
              createBaseVNode("div", _hoisted_36$1, _cache[44] || (_cache[44] = [
                createBaseVNode("img", {
                  id: "staticPieChart",
                  class: "static-chart",
                  alt: "机制砂粒径占比饼图"
                }, null, -1)
              ]), 512)
            ])
          ]),
          createBaseVNode("div", _hoisted_37$1, [
            _cache[50] || (_cache[50] = createBaseVNode("h2", { class: "text-xs font-semibold mb-1 text-blue-800" }, "AI智能分析建议", -1)),
            createBaseVNode("div", _hoisted_38$1, [
              $setup.aiLoading ? (openBlock(), createElementBlock("div", _hoisted_39$1, [
                createVNode$1(_component_el_progress, {
                  type: "circle",
                  percentage: 100,
                  width: 50,
                  "stroke-width": 4,
                  status: "success",
                  indeterminate: ""
                }),
                _cache[46] || (_cache[46] = createBaseVNode("span", { class: "ml-3 text-gray-600" }, "正在分析数据，请稍候...", -1))
              ])) : (openBlock(), createElementBlock("div", _hoisted_40$1, [
                _cache[47] || (_cache[47] = createBaseVNode("p", { class: "font-semibold mb-0.5 text-blue-800" }, "分析结论：", -1)),
                createBaseVNode("p", null, toDisplayString($setup.aiRecommendation.conclusion), 1),
                _cache[48] || (_cache[48] = createBaseVNode("p", { class: "font-semibold mb-0.5 mt-1 text-blue-800" }, "优化建议：", -1)),
                createBaseVNode("ol", _hoisted_41, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList($setup.aiRecommendation.optimizationSuggestions, (suggestion, index) => {
                    return openBlock(), createElementBlock("li", { key: index }, toDisplayString(suggestion), 1);
                  }), 128))
                ]),
                _cache[49] || (_cache[49] = createBaseVNode("p", { class: "font-semibold mb-0.5 mt-1 text-green-800" }, "应用适宜性：", -1)),
                createBaseVNode("p", null, toDisplayString($setup.aiRecommendation.applicationSuitability), 1)
              ]))
            ])
          ]),
          createBaseVNode("div", _hoisted_42, [
            createBaseVNode("div", _hoisted_43, [
              _cache[51] || (_cache[51] = createStaticVNode('<div class="w-24 h-10 bg-gray-200 flex items-center justify-center border" data-v-38478525><svg xmlns="http://www.w3.org/2000/svg" width="80" height="30" viewBox="0 0 80 30" data-v-38478525><rect x="5" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="8" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="12" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="16" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="20" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="24" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="28" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="32" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="36" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="40" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="44" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="48" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="52" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="56" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="60" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="64" y="5" width="1" height="20" fill="black" data-v-38478525></rect><rect x="68" y="5" width="2" height="20" fill="black" data-v-38478525></rect><rect x="72" y="5" width="1" height="20" fill="black" data-v-38478525></rect></svg></div>', 1)),
              createBaseVNode("span", _hoisted_44, toDisplayString($setup.reportNumber), 1)
            ]),
            _cache[52] || (_cache[52] = createBaseVNode("p", { class: "text-xs text-gray-500" }, "2023 ICDIO检验中心", -1))
          ])
        ])
      ]);
    }
    const SandGradingReport = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render$2], ["__scopeId", "data-v-38478525"]]);
    const _sfc_main$3 = {
      name: "ScaleControl",
      setup() {
        const availablePorts = ref([]);
        const selectedPort = ref("");
        const scaleStatus = ref({
          is_connected: false,
          port: null,
          current_weight: null,
          last_calibration: null
        });
        const currentWeight = ref(null);
        const connecting = ref(false);
        const disconnecting = ref(false);
        const calibrating = ref(false);
        const gainDialogVisible = ref(false);
        const calibrationForm = ref({
          weight: 1.24
        });
        let weightInterval = null;
        const fetchPorts = async () => {
          try {
            const response = await getScalePorts();
            availablePorts.value = response.available_ports;
          } catch (error) {
            ElMessage.error("获取串口列表失败");
            console.error("获取串口列表失败:", error);
          }
        };
        const fetchStatus = async () => {
          try {
            const response = await getScaleStatus();
            scaleStatus.value = response;
            if (response.is_connected) {
              startWeightPolling();
            }
          } catch (error) {
            ElMessage.error("获取电子秤状态失败");
            console.error("获取电子秤状态失败:", error);
          }
        };
        const handleConnect = async () => {
          if (!selectedPort.value) {
            ElMessage.warning("请选择串口");
            return;
          }
          connecting.value = true;
          try {
            await connectScale(selectedPort.value);
            await fetchStatus();
            ElMessage.success("连接成功");
            startWeightPolling();
          } catch (error) {
            ElMessage.error(error.response?.data?.detail || "连接失败");
            console.error("连接失败:", error);
          } finally {
            connecting.value = false;
          }
        };
        const handleDisconnect = async () => {
          disconnecting.value = true;
          try {
            await disconnectScale();
            stopWeightPolling();
            await fetchStatus();
            ElMessage.success("已断开连接");
          } catch (error) {
            ElMessage.error("断开连接失败");
          } finally {
            disconnecting.value = false;
          }
        };
        const handleZeroCalibration = async () => {
          calibrating.value = true;
          try {
            await calibrateZero();
            await fetchStatus();
            ElMessage.success("零点校准完成");
          } catch (error) {
            ElMessage.error(error.response?.data?.detail || "校准失败");
          } finally {
            calibrating.value = false;
          }
        };
        const showGainCalibration = () => {
          gainDialogVisible.value = true;
        };
        const handleGainCalibration = async () => {
          calibrating.value = true;
          try {
            await calibrateGain(calibrationForm.value.weight);
            await fetchStatus();
            gainDialogVisible.value = false;
            ElMessage.success("增益校准完成");
          } catch (error) {
            ElMessage.error(error.response?.data?.detail || "校准失败");
          } finally {
            calibrating.value = false;
          }
        };
        const startWeightPolling = () => {
          stopWeightPolling();
          weightInterval = setInterval(async () => {
            try {
              const response = await getWeight();
              currentWeight.value = response.weight;
            } catch (error) {
              console.error("获取重量失败:", error);
            }
          }, 500);
        };
        const stopWeightPolling = () => {
          if (weightInterval) {
            clearInterval(weightInterval);
            weightInterval = null;
          }
        };
        onMounted(() => {
          fetchPorts();
          fetchStatus();
        });
        onUnmounted(() => {
          stopWeightPolling();
        });
        return {
          availablePorts,
          selectedPort,
          scaleStatus,
          currentWeight,
          connecting,
          disconnecting,
          calibrating,
          gainDialogVisible,
          calibrationForm,
          handleConnect,
          handleDisconnect,
          handleZeroCalibration,
          showGainCalibration,
          handleGainCalibration
        };
      }
    };
    const _hoisted_1$3 = { class: "scale-control" };
    const _hoisted_2$3 = { class: "scale-header" };
    const _hoisted_3$3 = { class: "control-section" };
    const _hoisted_4$3 = {
      key: 0,
      class: "port-select"
    };
    const _hoisted_5$3 = {
      key: 0,
      class: "weight-display"
    };
    const _hoisted_6$3 = { class: "weight-value" };
    const _hoisted_7$3 = {
      key: 1,
      class: "calibration-section"
    };
    const _hoisted_8$3 = { class: "calibration-controls" };
    const _hoisted_9$3 = {
      key: 0,
      class: "last-calibration"
    };
    const _hoisted_10$2 = { class: "dialog-footer" };
    function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_el_option = resolveComponent("el-option");
      const _component_el_select = resolveComponent("el-select");
      const _component_el_button = resolveComponent("el-button");
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_form = resolveComponent("el-form");
      const _component_el_dialog = resolveComponent("el-dialog");
      return openBlock(), createElementBlock("div", _hoisted_1$3, [
        createBaseVNode("div", _hoisted_2$3, [
          _cache[4] || (_cache[4] = createBaseVNode("h2", null, "电子秤控制", -1)),
          createBaseVNode("div", {
            class: normalizeClass(["scale-status", { connected: $setup.scaleStatus.is_connected }])
          }, toDisplayString($setup.scaleStatus.is_connected ? "已连接" : "未连接"), 3)
        ]),
        createBaseVNode("div", _hoisted_3$3, [
          !$setup.scaleStatus.is_connected ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
            createVNode$1(_component_el_select, {
              modelValue: $setup.selectedPort,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.selectedPort = $event),
              placeholder: "选择串口"
            }, {
              default: withCtx(() => [
                (openBlock(true), createElementBlock(Fragment, null, renderList($setup.availablePorts, (port) => {
                  return openBlock(), createBlock(_component_el_option, {
                    key: port,
                    label: port,
                    value: port
                  }, null, 8, ["label", "value"]);
                }), 128))
              ]),
              _: 1
            }, 8, ["modelValue"]),
            createVNode$1(_component_el_button, {
              type: "primary",
              onClick: $setup.handleConnect,
              loading: $setup.connecting
            }, {
              default: withCtx(() => _cache[5] || (_cache[5] = [
                createTextVNode(" 连接 ")
              ])),
              _: 1
            }, 8, ["onClick", "loading"])
          ])) : (openBlock(), createBlock(_component_el_button, {
            key: 1,
            type: "danger",
            onClick: $setup.handleDisconnect,
            loading: $setup.disconnecting
          }, {
            default: withCtx(() => _cache[6] || (_cache[6] = [
              createTextVNode(" 断开连接 ")
            ])),
            _: 1
          }, 8, ["onClick", "loading"]))
        ]),
        $setup.scaleStatus.is_connected ? (openBlock(), createElementBlock("div", _hoisted_5$3, [
          createBaseVNode("div", _hoisted_6$3, [
            createTextVNode(toDisplayString($setup.currentWeight === null ? "--" : ($setup.currentWeight / 1e3).toFixed(3)) + " ", 1),
            _cache[7] || (_cache[7] = createBaseVNode("span", { class: "weight-unit" }, "g", -1))
          ]),
          _cache[8] || (_cache[8] = createBaseVNode("div", { class: "weight-label" }, "当前重量", -1))
        ])) : createCommentVNode("", true),
        $setup.scaleStatus.is_connected ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
          createBaseVNode("div", _hoisted_8$3, [
            createVNode$1(_component_el_button, {
              onClick: $setup.handleZeroCalibration,
              loading: $setup.calibrating
            }, {
              default: withCtx(() => _cache[9] || (_cache[9] = [
                createTextVNode(" 零点校准 ")
              ])),
              _: 1
            }, 8, ["onClick", "loading"]),
            createVNode$1(_component_el_button, {
              onClick: $setup.showGainCalibration,
              loading: $setup.calibrating
            }, {
              default: withCtx(() => _cache[10] || (_cache[10] = [
                createTextVNode(" 增益校准 ")
              ])),
              _: 1
            }, 8, ["onClick", "loading"])
          ]),
          $setup.scaleStatus.last_calibration ? (openBlock(), createElementBlock("div", _hoisted_9$3, " 上次校准: " + toDisplayString($setup.scaleStatus.last_calibration), 1)) : createCommentVNode("", true)
        ])) : createCommentVNode("", true),
        createVNode$1(_component_el_dialog, {
          modelValue: $setup.gainDialogVisible,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.gainDialogVisible = $event),
          title: "增益校准",
          width: "400px",
          "append-to-body": "",
          modal: true,
          "close-on-click-modal": false,
          "z-index": 2e3,
          "destroy-on-close": ""
        }, {
          footer: withCtx(() => [
            createBaseVNode("span", _hoisted_10$2, [
              createVNode$1(_component_el_button, {
                onClick: _cache[2] || (_cache[2] = ($event) => $setup.gainDialogVisible = false)
              }, {
                default: withCtx(() => _cache[11] || (_cache[11] = [
                  createTextVNode("取消")
                ])),
                _: 1
              }),
              createVNode$1(_component_el_button, {
                type: "primary",
                onClick: $setup.handleGainCalibration,
                loading: $setup.calibrating
              }, {
                default: withCtx(() => _cache[12] || (_cache[12] = [
                  createTextVNode(" 确认校准 ")
                ])),
                _: 1
              }, 8, ["onClick", "loading"])
            ])
          ]),
          default: withCtx(() => [
            createVNode$1(_component_el_form, {
              model: $setup.calibrationForm,
              "label-width": "100px"
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_form_item, { label: "校准重量(g)" }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_input_number, {
                      modelValue: $setup.calibrationForm.weight,
                      "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.calibrationForm.weight = $event),
                      precision: 3,
                      step: 0.1,
                      min: 0
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["model"])
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]);
    }
    const ScaleControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["render", _sfc_render$1], ["__scopeId", "data-v-9d0c77e3"]]);
    const _hoisted_1$2 = { class: "clean-sand-control" };
    const _hoisted_2$2 = { class: "control-header" };
    const _hoisted_3$2 = { class: "control-body" };
    const _hoisted_4$2 = { class: "control-options" };
    const _hoisted_5$2 = { class: "control-actions" };
    const _hoisted_6$2 = {
      key: 0,
      class: "control-logs"
    };
    const _hoisted_7$2 = { class: "logs-container" };
    const _hoisted_8$2 = { class: "log-time" };
    const _hoisted_9$2 = { class: "log-message" };
    const _sfc_main$2 = {
      __name: "CleanSandControl",
      setup(__props) {
        const status = ref("idle");
        const cleaning = ref(false);
        const logs = ref([]);
        const statusCheckInterval = ref(null);
        const cleanOptions = ref({
          testCycles: 1,
          testMode: false
        });
        const statusText = computed(() => {
          switch (status.value) {
            case "idle":
              return "空闲";
            case "cleaning":
              return "清砂中";
            case "error":
              return "错误";
            default:
              return "未知";
          }
        });
        const statusType = computed(() => {
          switch (status.value) {
            case "idle":
              return "info";
            case "cleaning":
              return "success";
            case "error":
              return "danger";
            default:
              return "info";
          }
        });
        const addLog = (message2, type = "info") => {
          const now2 = /* @__PURE__ */ new Date();
          const timeStr = `${now2.getHours().toString().padStart(2, "0")}:${now2.getMinutes().toString().padStart(2, "0")}:${now2.getSeconds().toString().padStart(2, "0")}`;
          logs.value.unshift({
            time: timeStr,
            message: message2,
            type
          });
          if (logs.value.length > 20) {
            logs.value.pop();
          }
        };
        const startCleanSand = async () => {
          try {
            await ElMessageBox.confirm("确定要开始清砂操作吗？", "操作确认", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            });
            cleaning.value = true;
            status.value = "cleaning";
            addLog(`开始清砂操作，循环次数: ${cleanOptions.value.testCycles}`);
            const response = await cleanSand({
              testCycles: cleanOptions.value.testCycles,
              testMode: cleanOptions.value.testMode
            });
            startStatusCheck();
            ElMessage.success("清砂操作已开始");
          } catch (error) {
            if (error !== "cancel") {
              status.value = "error";
              addLog(`清砂操作失败: ${error.message || "未知错误"}`, "error");
              ElMessage.error(`清砂操作失败: ${error.message || "未知错误"}`);
              cleaning.value = false;
            }
          }
        };
        const stopCleanSand = async () => {
          try {
            await ElMessageBox.confirm("确定要停止清砂操作吗？", "操作确认", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            });
            addLog("正在停止清砂操作...");
            await stopCleanProcess();
            cleaning.value = false;
            status.value = "idle";
            addLog("清砂操作已停止");
            ElMessage.info("清砂操作已停止");
            stopStatusCheck();
          } catch (error) {
            if (error !== "cancel") {
              addLog(`停止清砂操作失败: ${error.message || "未知错误"}`, "error");
              ElMessage.error(`停止清砂操作失败: ${error.message || "未知错误"}`);
            }
          }
        };
        const startStatusCheck = () => {
          statusCheckInterval.value = setInterval(async () => {
            try {
              const statusData = await getCleanStatus();
              if (statusData.status === "completed") {
                cleaning.value = false;
                status.value = "idle";
                addLog("清砂操作已完成");
                ElMessage.success("清砂操作已完成");
                stopStatusCheck();
              } else if (statusData.status === "error") {
                cleaning.value = false;
                status.value = "error";
                addLog(`清砂操作出错: ${statusData.message || "未知错误"}`, "error");
                ElMessage.error(`清砂操作出错: ${statusData.message || "未知错误"}`);
                stopStatusCheck();
              } else if (statusData.status === "cleaning") {
                if (statusData.progress) {
                  addLog(`清砂进度: ${statusData.progress}`);
                }
              }
            } catch (error) {
              console.error("获取清砂状态失败:", error);
            }
          }, 3e3);
        };
        const stopStatusCheck = () => {
          if (statusCheckInterval.value) {
            clearInterval(statusCheckInterval.value);
            statusCheckInterval.value = null;
          }
        };
        onMounted(async () => {
          try {
            const statusData = await getCleanStatus();
            if (statusData.status === "cleaning") {
              cleaning.value = true;
              status.value = "cleaning";
              addLog("检测到正在进行的清砂操作");
              startStatusCheck();
            }
          } catch (error) {
            console.error("获取清砂状态失败:", error);
          }
        });
        onUnmounted(() => {
          stopStatusCheck();
        });
        return (_ctx, _cache) => {
          const _component_el_tag = resolveComponent("el-tag");
          const _component_el_input_number = resolveComponent("el-input-number");
          const _component_el_form_item = resolveComponent("el-form-item");
          const _component_el_form = resolveComponent("el-form");
          const _component_el_button = resolveComponent("el-button");
          return openBlock(), createElementBlock("div", _hoisted_1$2, [
            createBaseVNode("div", _hoisted_2$2, [
              _cache[1] || (_cache[1] = createBaseVNode("h3", null, "清砂控制", -1)),
              createVNode$1(_component_el_tag, {
                type: statusType.value,
                effect: "dark"
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(statusText.value), 1)
                ]),
                _: 1
              }, 8, ["type"])
            ]),
            createBaseVNode("div", _hoisted_3$2, [
              createBaseVNode("div", _hoisted_4$2, [
                createVNode$1(_component_el_form, {
                  model: cleanOptions.value,
                  "label-width": "100px",
                  size: "small"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_form_item, { label: "测试循环次数" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_input_number, {
                          modelValue: cleanOptions.value.testCycles,
                          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => cleanOptions.value.testCycles = $event),
                          min: 1,
                          max: 10,
                          disabled: cleaning.value
                        }, null, 8, ["modelValue", "disabled"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["model"])
              ]),
              createBaseVNode("div", _hoisted_5$2, [
                createVNode$1(_component_el_button, {
                  type: "primary",
                  icon: unref(brush_default),
                  loading: cleaning.value,
                  onClick: startCleanSand,
                  disabled: cleaning.value
                }, {
                  default: withCtx(() => _cache[2] || (_cache[2] = [
                    createTextVNode(" 开始清砂 ")
                  ])),
                  _: 1
                }, 8, ["icon", "loading", "disabled"]),
                createVNode$1(_component_el_button, {
                  type: "danger",
                  icon: unref(circle_close_default),
                  onClick: stopCleanSand,
                  disabled: !cleaning.value
                }, {
                  default: withCtx(() => _cache[3] || (_cache[3] = [
                    createTextVNode(" 停止清砂 ")
                  ])),
                  _: 1
                }, 8, ["icon", "disabled"])
              ])
            ]),
            logs.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
              _cache[4] || (_cache[4] = createBaseVNode("h4", null, "操作日志", -1)),
              createBaseVNode("div", _hoisted_7$2, [
                (openBlock(true), createElementBlock(Fragment, null, renderList(logs.value, (log, index) => {
                  return openBlock(), createElementBlock("p", {
                    key: index,
                    class: normalizeClass({ "error-log": log.type === "error" })
                  }, [
                    createBaseVNode("span", _hoisted_8$2, toDisplayString(log.time), 1),
                    createBaseVNode("span", _hoisted_9$2, toDisplayString(log.message), 1)
                  ], 2);
                }), 128))
              ])
            ])) : createCommentVNode("", true)
          ]);
        };
      }
    };
    const CleanSandControl = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__scopeId", "data-v-3cc57ea7"]]);
    const _sfc_main$1 = {
      name: "Dashboard",
      components: {
        ProgressChart,
        FeedingChart,
        DataReport,
        SandGradingReport,
        ScaleControl,
        CleanSandControl,
        VideoCamera: video_camera_default,
        Connection: connection_default,
        Monitor: monitor_default,
        Picture: picture_default,
        Camera: camera_default,
        VideoPlay: video_play_default,
        Delete: delete_default,
        Download: download_default,
        DataAnalysis: data_analysis_default,
        Document: document_default,
        SwitchButton: switch_button_default
      },
      setup() {
        const isRunning = ref(false);
        const isInitialized = ref(false);
        const cameraConnected = ref(false);
        const controllerConnected = ref(false);
        const sensorConnected = ref(false);
        const light_status = ref("打开灯光");
        const dataPath = ref("F:/sand_data/test");
        const totalGroups = ref(5);
        const photosPerGroup = ref(5);
        const feedingAmount = ref(0.1);
        const completedGroups = ref(0);
        const currentPhoto = ref(0);
        const elapsedTime = ref(0);
        const feedingData = ref([]);
        const latestPhotos = ref([
          { path: "", group: 0, photo: 0, time: "" },
          { path: "", group: 0, photo: 0, time: "" },
          { path: "", group: 0, photo: 0, time: "" },
          { path: "", group: 0, photo: 0, time: "" }
        ]);
        const globalImagesPath = ref("");
        const localImagesPath = ref("");
        const imageRefreshInterval = ref(5e3);
        const currentImageIndex = ref(0);
        const cachedImages = ref([]);
        const initLoading = ref(false);
        ref(false);
        const LightLoading = ref(false);
        const startLoading = ref(false);
        const stopLoading = ref(false);
        const reportDialogVisible = ref(false);
        const sandGradingReportDialogVisible = ref(false);
        const experimentProgress = computed(() => {
          const totalPhotos = totalGroups.value * photosPerGroup.value;
          const completedPhotos = completedGroups.value * photosPerGroup.value + currentPhoto.value;
          if (totalPhotos > 0) {
            return Math.round(completedPhotos / totalPhotos * 100);
          }
          return 0;
        });
        const systemLogs = ref([]);
        const initSystem = async () => {
          try {
            initLoading.value = true;
            await initializeSystem();
            isInitialized.value = true;
            ElMessage.success("系统初始化成功");
          } catch (error) {
            ElMessage.error("系统初始化失败");
            console.log(error);
          } finally {
            initLoading.value = false;
          }
        };
        const start_openOrClose_Light = async () => {
          if (light_status.value === "打开灯光") {
            try {
              LightLoading.value = true;
              await openLight();
              light_status.value = "关闭灯光";
              addLog("灯光已打开", "success");
            } catch (error) {
              addLog("打开灯光失败", "error");
            } finally {
              LightLoading.value = false;
            }
          } else {
            try {
              LightLoading.value = true;
              await closeLight();
              light_status.value = "打开灯光";
              addLog("灯光已关闭", "success");
            } catch (error) {
              addLog("关闭灯光失败", "error");
            } finally {
              LightLoading.value = false;
            }
          }
        };
        const startExperiment = async () => {
          try {
            startLoading.value = true;
            await startProcess({
              base_path: dataPath.value,
              start_group: totalGroups.value,
              photos_per_group: photosPerGroup.value,
              once_count: feedingAmount.value
            });
            isRunning.value = true;
            ElMessage.success("实验开始");
          } catch (error) {
            ElMessage.error("实验启动失败");
          } finally {
            startLoading.value = false;
          }
        };
        const stopExperiment = async () => {
          try {
            stopLoading.value = true;
            await stopProcess();
            isRunning.value = false;
            ElMessage.success("实验已停止");
          } catch (error) {
            ElMessage.error("实验停止失败");
          } finally {
            stopLoading.value = false;
          }
        };
        const addLog = (content2, type = "info") => {
          const levels = {
            info: "INFO",
            warning: "WARN",
            error: "ERROR",
            success: "SUCCESS"
          };
          systemLogs.value.unshift({
            time: (/* @__PURE__ */ new Date()).toLocaleTimeString(),
            level: levels[type],
            content: content2,
            type
          });
          if (systemLogs.value.length > 100) {
            systemLogs.value.pop();
          }
        };
        const updateFeedingData = () => {
          const now2 = /* @__PURE__ */ new Date();
          const baseValue = feedingAmount.value;
          const time2 = Date.now() / 1e3;
          const wave1 = Math.sin(time2) * 0.2;
          const wave2 = Math.sin(time2 * 2) * 0.1;
          const wave3 = Math.sin(time2 * 0.5) * 0.15;
          const noise = (Math.random() - 0.5) * 0.1;
          const value = baseValue + wave1 + wave2 + wave3 + noise;
          feedingData.value.push({
            time: now2.toLocaleTimeString(),
            value: Math.max(0, value).toFixed(2)
          });
          if (feedingData.value.length > 30) {
            feedingData.value.shift();
          }
        };
        const loadLocalImages = async () => {
          try {
            globalImagesPath.value = `${dataPath.value}/global`;
            localImagesPath.value = `${dataPath.value}/local`;
            const globalResponse = await getDirectoryImages(globalImagesPath.value);
            const globalFiles = globalResponse.data || [];
            const localResponse = await getDirectoryImages(localImagesPath.value);
            const localFiles = localResponse.data || [];
            const globalImages = globalFiles.map((file) => {
              const fileNameMatch = file.name.match(/(\d+)_(\d+)\.jpg$/i) || [];
              const group = fileNameMatch[1] ? parseInt(fileNameMatch[1]) : 1;
              const photo = fileNameMatch[2] ? parseInt(fileNameMatch[2]) : 1;
              return {
                path: getImageUrl(file.path),
                actualPath: file.path,
                group,
                photo,
                source: "global",
                time: new Date(file.modifiedTime).toLocaleTimeString()
              };
            });
            const localImages = localFiles.map((file) => {
              const fileNameMatch = file.name.match(/(\d+)_(\d+)\.jpg$/i) || [];
              const group = fileNameMatch[1] ? parseInt(fileNameMatch[1]) : 1;
              const photo = fileNameMatch[2] ? parseInt(fileNameMatch[2]) : 1;
              return {
                path: getImageUrl(file.path),
                actualPath: file.path,
                group,
                photo,
                source: "local",
                time: new Date(file.modifiedTime).toLocaleTimeString()
              };
            });
            const imageMap = /* @__PURE__ */ new Map();
            globalImages.forEach((img) => {
              const key = `${img.group}_${img.photo}`;
              if (!imageMap.has(key)) {
                imageMap.set(key, { global: null, local: null });
              }
              imageMap.get(key).global = img;
            });
            localImages.forEach((img) => {
              const key = `${img.group}_${img.photo}`;
              if (!imageMap.has(key)) {
                imageMap.set(key, { global: null, local: null });
              }
              imageMap.get(key).local = img;
            });
            const sortedKeys = Array.from(imageMap.keys()).sort((a2, b2) => {
              const [aGroup, aPhoto] = a2.split("_").map(Number);
              const [bGroup, bPhoto] = b2.split("_").map(Number);
              if (aGroup !== bGroup) return aGroup - bGroup;
              return aPhoto - bPhoto;
            });
            cachedImages.value = [];
            sortedKeys.forEach((key) => {
              const pair = imageMap.get(key);
              if (pair.global) cachedImages.value.push(pair.global);
              if (pair.local) cachedImages.value.push(pair.local);
            });
            if (cachedImages.value.length === 0) {
              addLog(
                `未找到图片，使用测试图片代替。查找路径: ${globalImagesPath.value} 和 ${localImagesPath.value}`,
                "warning"
              );
              const imgPath = "/test-image.jpg";
              cachedImages.value = [
                {
                  path: imgPath,
                  actualPath: `${globalImagesPath.value}/5_1.jpg (测试图片)`,
                  group: 5,
                  photo: 1,
                  source: "global",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  actualPath: `${localImagesPath.value}/5_1.jpg (测试图片)`,
                  group: 5,
                  photo: 1,
                  source: "local",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  actualPath: `${globalImagesPath.value}/5_2.jpg (测试图片)`,
                  group: 5,
                  photo: 2,
                  source: "global",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  actualPath: `${localImagesPath.value}/5_2.jpg (测试图片)`,
                  group: 5,
                  photo: 2,
                  source: "local",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                }
              ];
            } else {
              addLog(`成功加载 ${cachedImages.value.length} 张图片`, "success");
            }
            updateLatestPhotos();
          } catch (error) {
            console.error("加载图片失败:", error);
            addLog("加载图片失败: " + error.message, "error");
            const imgPath = "/test-image.jpg";
            cachedImages.value = [
              {
                path: imgPath,
                actualPath: `${dataPath.value}/global/5_1.jpg (测试图片)`,
                group: 5,
                photo: 1,
                source: "global",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                actualPath: `${dataPath.value}/local/5_1.jpg (测试图片)`,
                group: 5,
                photo: 1,
                source: "local",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                actualPath: `${dataPath.value}/global/5_2.jpg (测试图片)`,
                group: 5,
                photo: 2,
                source: "global",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                actualPath: `${dataPath.value}/local/5_2.jpg (测试图片)`,
                group: 5,
                photo: 2,
                source: "local",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              }
            ];
            updateLatestPhotos();
          }
        };
        const handleImageError = (e2) => {
          console.error("图片加载失败:", e2.target.src);
          const index = latestPhotos.value.findIndex((photo) => photo.path === e2.target.src);
          if (index !== -1) {
            console.log("应该访问的实际路径:", latestPhotos.value[index].actualPath);
            latestPhotos.value[index].path = "";
            addLog(`图片加载失败: ${e2.target.src}`, "error");
          }
        };
        const handleImageLoad = (e2) => {
          console.log("图片加载成功:", e2.target.src);
          addLog(`图片加载成功: ${e2.target.src}`, "success");
        };
        const testProgress = () => {
          if (currentPhoto.value < photosPerGroup.value - 1) {
            currentPhoto.value++;
          } else {
            currentPhoto.value = 0;
            if (completedGroups.value < totalGroups.value - 1) {
              completedGroups.value++;
            } else {
              completedGroups.value = 0;
              currentPhoto.value = 0;
            }
          }
          addLog(
            `当前进度：第 ${completedGroups.value + 1} 组，第 ${currentPhoto.value + 1} 张照片`,
            "info"
          );
        };
        const addGroup = () => {
          if (totalGroups.value < 100) {
            totalGroups.value++;
            addLog(`修改总组数为: ${totalGroups.value}`, "info");
          }
        };
        const addPhotos = () => {
          if (photosPerGroup.value < 100) {
            photosPerGroup.value++;
            addLog(`修改每组照片数为: ${photosPerGroup.value}`, "info");
          }
        };
        const testUpdatePhotos = () => {
          addLog("测试图片显示", "info");
          const imgPath = "/test-image.jpg";
          latestPhotos.value = [
            {
              path: imgPath,
              group: 5,
              photo: 1,
              source: "global",
              time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
            },
            {
              path: imgPath,
              group: 5,
              photo: 1,
              source: "local",
              time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
            },
            {
              path: imgPath,
              group: 5,
              photo: 2,
              source: "global",
              time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
            },
            {
              path: imgPath,
              group: 5,
              photo: 2,
              source: "local",
              time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
            }
          ];
          addLog("图片显示测试完成", "success");
        };
        const showReport = () => {
          reportDialogVisible.value = true;
        };
        const showSandGradingReport = () => {
          sandGradingReportDialogVisible.value = true;
        };
        const handleLogout = () => {
          ElMessageBox.confirm("确定要退出登录吗？", "退出提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(() => {
            localStorage.removeItem("isLoggedIn");
            localStorage.removeItem("username");
            ElMessage({
              type: "success",
              message: "已成功退出登录"
            });
            const router2 = useRouter();
            router2.push("/login");
          }).catch(() => {
          });
        };
        let timer;
        let imageRefreshTimer;
        onMounted(() => {
          for (let i2 = 0; i2 < 10; i2++) {
            updateFeedingData();
          }
          addLog("系统启动完成，等待初始化...", "info");
          addLog("正在检查设备连接状态...", "info");
          loadLocalImages();
          updateLatestPhotos();
          timer = setInterval(() => {
            if (isRunning.value) {
              updateFeedingData();
              elapsedTime.value++;
              if (elapsedTime.value % 5 === 0) {
                if (currentPhoto.value < photosPerGroup.value - 1) {
                  currentPhoto.value++;
                } else {
                  currentPhoto.value = 0;
                  if (completedGroups.value < totalGroups.value - 1) {
                    completedGroups.value++;
                  } else {
                    completedGroups.value = totalGroups.value;
                    currentPhoto.value = photosPerGroup.value;
                    isRunning.value = false;
                    addLog("实验已完成", "success");
                  }
                }
              }
              if (Math.random() < 0.1) {
                const events = [
                  { content: "相机拍摄完成", type: "success" },
                  { content: "给料电机运行正常", type: "info" },
                  { content: "传感器数据采集中...", type: "info" },
                  { content: "网络连接延迟较高", type: "warning" }
                ];
                const event = events[Math.floor(Math.random() * events.length)];
                addLog(event.content, event.type);
              }
            }
          }, 1e3);
          imageRefreshTimer = setInterval(() => {
            updateLatestPhotos();
          }, imageRefreshInterval.value);
        });
        onUnmounted(() => {
          if (timer) {
            clearInterval(timer);
          }
          if (imageRefreshTimer) {
            clearInterval(imageRefreshTimer);
          }
        });
        const updateLatestPhotos = () => {
          try {
            if (cachedImages.value.length === 0) {
              const imgPath = "/test-image.jpg";
              latestPhotos.value = [
                {
                  path: imgPath,
                  group: 5,
                  photo: 1,
                  source: "global",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  group: 5,
                  photo: 1,
                  source: "local",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  group: 5,
                  photo: 2,
                  source: "global",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                },
                {
                  path: imgPath,
                  group: 5,
                  photo: 2,
                  source: "local",
                  time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
                }
              ];
              loadLocalImages();
              return;
            }
            const startIndex = currentImageIndex.value % cachedImages.value.length;
            const selectedFiles = [];
            for (let i2 = 0; i2 < 4; i2++) {
              const index = (startIndex + i2) % cachedImages.value.length;
              selectedFiles.push(cachedImages.value[index]);
            }
            currentImageIndex.value = (startIndex + 4) % cachedImages.value.length;
            latestPhotos.value = selectedFiles.map((img, index) => {
              return {
                path: img.path,
                // 这里使用后端提供的图片路径
                actualPath: img.actualPath,
                // 保存实际路径用于调试
                group: img.group,
                photo: img.photo,
                source: img.source,
                time: img.time
              };
            });
            const logMessage = selectedFiles.map((img) => `${img.source}/${img.group}_${img.photo}`).join(", ");
            addLog(`图片更新成功 (当前显示: ${logMessage})`, "success");
          } catch (error) {
            console.error("获取图片失败:", error);
            addLog("获取图片失败", "error");
            const imgPath = "/test-image.jpg";
            latestPhotos.value = [
              {
                path: imgPath,
                group: 5,
                photo: 1,
                source: "global",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                group: 5,
                photo: 1,
                source: "local",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                group: 5,
                photo: 2,
                source: "global",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              },
              {
                path: imgPath,
                group: 5,
                photo: 2,
                source: "local",
                time: (/* @__PURE__ */ new Date()).toLocaleTimeString()
              }
            ];
          }
        };
        return {
          // 状态
          isRunning,
          isInitialized,
          cameraConnected,
          controllerConnected,
          sensorConnected,
          light_status,
          // 参数
          dataPath,
          totalGroups,
          photosPerGroup,
          feedingAmount,
          // 进度
          completedGroups,
          currentPhoto,
          elapsedTime,
          feedingData,
          experimentProgress,
          latestPhotos,
          // 图片路径
          globalImagesPath,
          localImagesPath,
          // 加载状态
          initLoading,
          LightLoading,
          startLoading,
          stopLoading,
          // 系统日志数据
          systemLogs,
          addLog,
          // 方法
          initSystem,
          start_openOrClose_Light,
          startExperiment,
          stopExperiment,
          testProgress,
          addGroup,
          addPhotos,
          testUpdatePhotos,
          handleImageError,
          handleImageLoad,
          reportDialogVisible,
          showReport,
          sandGradingReportDialogVisible,
          showSandGradingReport,
          handleLogout
        };
      }
    };
    const _hoisted_1$1 = { class: "dashboard" };
    const _hoisted_2$1 = { class: "dashboard-header" };
    const _hoisted_3$1 = { class: "header-left" };
    const _hoisted_4$1 = { class: "header-right" };
    const _hoisted_5$1 = { class: "dashboard-content" };
    const _hoisted_6$1 = { class: "left-panel" };
    const _hoisted_7$1 = { class: "control-section" };
    const _hoisted_8$1 = { class: "control-body" };
    const _hoisted_9$1 = { class: "form-row" };
    const _hoisted_10$1 = { class: "control-buttons" };
    const _hoisted_11$1 = { class: "control-buttons" };
    const _hoisted_12$1 = { class: "right-panel" };
    const _hoisted_13 = { class: "top-row" };
    const _hoisted_14 = { class: "progress-section" };
    const _hoisted_15 = { class: "progress-header" };
    const _hoisted_16 = { class: "progress-stats" };
    const _hoisted_17 = { class: "stat-item" };
    const _hoisted_18 = { class: "stat-value" };
    const _hoisted_19 = { class: "stat-item" };
    const _hoisted_20 = { class: "stat-value" };
    const _hoisted_21 = { class: "stat-item" };
    const _hoisted_22 = { class: "stat-value" };
    const _hoisted_23 = { class: "progress-container" };
    const _hoisted_24 = { class: "feeding-section" };
    const _hoisted_25 = { class: "chart-container" };
    const _hoisted_26 = { class: "bottom-row" };
    const _hoisted_27 = { class: "photos-section" };
    const _hoisted_28 = { class: "photo-grid" };
    const _hoisted_29 = {
      key: 0,
      class: "photo-placeholder"
    };
    const _hoisted_30 = {
      key: 1,
      class: "photo-image"
    };
    const _hoisted_31 = ["src"];
    const _hoisted_32 = { class: "photo-info" };
    const _hoisted_33 = { class: "console-section" };
    const _hoisted_34 = { class: "console-container" };
    const _hoisted_35 = { class: "console-header" };
    const _hoisted_36 = { class: "console-controls" };
    const _hoisted_37 = { class: "console-body" };
    const _hoisted_38 = { class: "log-list" };
    const _hoisted_39 = { class: "log-time" };
    const _hoisted_40 = { class: "log-content" };
    function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
      const _component_DataAnalysis = resolveComponent("DataAnalysis");
      const _component_el_icon = resolveComponent("el-icon");
      const _component_el_button = resolveComponent("el-button");
      const _component_Document = resolveComponent("Document");
      const _component_SwitchButton = resolveComponent("SwitchButton");
      const _component_el_input = resolveComponent("el-input");
      const _component_el_form_item = resolveComponent("el-form-item");
      const _component_el_input_number = resolveComponent("el-input-number");
      const _component_el_form = resolveComponent("el-form");
      const _component_ScaleControl = resolveComponent("ScaleControl");
      const _component_CleanSandControl = resolveComponent("CleanSandControl");
      const _component_progress_chart = resolveComponent("progress-chart");
      const _component_feeding_chart = resolveComponent("feeding-chart");
      const _component_Picture = resolveComponent("Picture");
      const _component_Delete = resolveComponent("Delete");
      const _component_Download = resolveComponent("Download");
      const _component_data_report = resolveComponent("data-report");
      const _component_el_dialog = resolveComponent("el-dialog");
      const _component_sand_grading_report = resolveComponent("sand-grading-report");
      return openBlock(), createElementBlock("div", _hoisted_1$1, [
        createBaseVNode("div", _hoisted_2$1, [
          createBaseVNode("div", _hoisted_3$1, [
            _cache[8] || (_cache[8] = createBaseVNode("h1", null, "砂石级配实验监控平台", -1)),
            createBaseVNode("div", {
              class: normalizeClass(["system-status", { "status-running": $setup.isRunning }])
            }, " 系统" + toDisplayString($setup.isRunning ? "运行中" : "已停止"), 3)
          ]),
          createBaseVNode("div", _hoisted_4$1, [
            createVNode$1(_component_el_button, {
              type: "primary",
              onClick: $setup.showReport,
              class: "report-button"
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_icon, null, {
                  default: withCtx(() => [
                    createVNode$1(_component_DataAnalysis)
                  ]),
                  _: 1
                }),
                _cache[9] || (_cache[9] = createTextVNode(" 数据报表 "))
              ]),
              _: 1
            }, 8, ["onClick"]),
            createVNode$1(_component_el_button, {
              type: "success",
              onClick: $setup.showSandGradingReport,
              class: "report-button"
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_icon, null, {
                  default: withCtx(() => [
                    createVNode$1(_component_Document)
                  ]),
                  _: 1
                }),
                _cache[10] || (_cache[10] = createTextVNode(" 砂级配报告 "))
              ]),
              _: 1
            }, 8, ["onClick"]),
            createVNode$1(_component_el_button, {
              type: "danger",
              onClick: $setup.handleLogout
            }, {
              default: withCtx(() => [
                createVNode$1(_component_el_icon, null, {
                  default: withCtx(() => [
                    createVNode$1(_component_SwitchButton)
                  ]),
                  _: 1
                }),
                _cache[11] || (_cache[11] = createTextVNode(" 退出登录 "))
              ]),
              _: 1
            }, 8, ["onClick"])
          ])
        ]),
        createBaseVNode("div", _hoisted_5$1, [
          createBaseVNode("div", _hoisted_6$1, [
            createBaseVNode("div", _hoisted_7$1, [
              _cache[15] || (_cache[15] = createBaseVNode("div", { class: "control-header" }, [
                createBaseVNode("h2", null, "实验控制")
              ], -1)),
              createBaseVNode("div", _hoisted_8$1, [
                createVNode$1(_component_el_form, {
                  class: "control-form",
                  "label-width": "100px",
                  size: "default"
                }, {
                  default: withCtx(() => [
                    createVNode$1(_component_el_form_item, { label: "数据路径" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_input, {
                          modelValue: $setup.dataPath,
                          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.dataPath = $event),
                          placeholder: "请输入数据保存路径",
                          disabled: $setup.isRunning
                        }, null, 8, ["modelValue", "disabled"])
                      ]),
                      _: 1
                    }),
                    createBaseVNode("div", _hoisted_9$1, [
                      createVNode$1(_component_el_form_item, {
                        label: "总组数",
                        class: "form-item-half"
                      }, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_input_number, {
                            modelValue: $setup.totalGroups,
                            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $setup.totalGroups = $event),
                            min: 1,
                            max: 100,
                            disabled: $setup.isRunning,
                            "controls-position": "right",
                            style: { "width": "100%" }
                          }, null, 8, ["modelValue", "disabled"])
                        ]),
                        _: 1
                      }),
                      createVNode$1(_component_el_form_item, {
                        label: "每组照片",
                        class: "form-item-half"
                      }, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_input_number, {
                            modelValue: $setup.photosPerGroup,
                            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $setup.photosPerGroup = $event),
                            min: 1,
                            max: 100,
                            disabled: $setup.isRunning,
                            "controls-position": "right",
                            style: { "width": "100%" }
                          }, null, 8, ["modelValue", "disabled"])
                        ]),
                        _: 1
                      })
                    ]),
                    createVNode$1(_component_el_form_item, { label: "给料量(克)" }, {
                      default: withCtx(() => [
                        createVNode$1(_component_el_input_number, {
                          modelValue: $setup.feedingAmount,
                          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $setup.feedingAmount = $event),
                          min: 0.1,
                          max: 10,
                          step: 0.1,
                          precision: 1,
                          disabled: $setup.isRunning,
                          "controls-position": "right",
                          style: { "width": "100%" }
                        }, null, 8, ["modelValue", "disabled"])
                      ]),
                      _: 1
                    }),
                    createBaseVNode("div", _hoisted_10$1, [
                      createVNode$1(_component_el_button, {
                        type: "primary",
                        onClick: $setup.initSystem,
                        loading: $setup.initLoading,
                        disabled: $setup.isInitialized || $setup.isRunning
                      }, {
                        default: withCtx(() => _cache[12] || (_cache[12] = [
                          createTextVNode(" 初始化系统 ")
                        ])),
                        _: 1
                      }, 8, ["onClick", "loading", "disabled"]),
                      createVNode$1(_component_el_button, {
                        type: "primary",
                        onClick: $setup.start_openOrClose_Light,
                        loading: $setup.LightLoading,
                        disabled: $setup.isRunning
                      }, {
                        default: withCtx(() => [
                          createTextVNode(toDisplayString($setup.light_status), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick", "loading", "disabled"])
                    ]),
                    createBaseVNode("div", _hoisted_11$1, [
                      createVNode$1(_component_el_button, {
                        type: "success",
                        onClick: $setup.startExperiment,
                        loading: $setup.startLoading,
                        disabled: !$setup.isInitialized || $setup.isRunning
                      }, {
                        default: withCtx(() => _cache[13] || (_cache[13] = [
                          createTextVNode(" 开始实验 ")
                        ])),
                        _: 1
                      }, 8, ["onClick", "loading", "disabled"]),
                      createVNode$1(_component_el_button, {
                        type: "danger",
                        onClick: $setup.stopExperiment,
                        loading: $setup.stopLoading,
                        disabled: !$setup.isRunning
                      }, {
                        default: withCtx(() => _cache[14] || (_cache[14] = [
                          createTextVNode(" 停止实验 ")
                        ])),
                        _: 1
                      }, 8, ["onClick", "loading", "disabled"])
                    ])
                  ]),
                  _: 1
                })
              ])
            ]),
            createVNode$1(_component_ScaleControl, { class: "scale-section" }),
            createVNode$1(_component_CleanSandControl, { class: "scale-section" })
          ]),
          createBaseVNode("div", _hoisted_12$1, [
            createBaseVNode("div", _hoisted_13, [
              createBaseVNode("div", _hoisted_14, [
                createBaseVNode("div", _hoisted_15, [
                  _cache[19] || (_cache[19] = createBaseVNode("h2", null, "实验进度", -1)),
                  createBaseVNode("div", _hoisted_16, [
                    createBaseVNode("div", _hoisted_17, [
                      _cache[16] || (_cache[16] = createBaseVNode("div", { class: "stat-label" }, "已完成组数", -1)),
                      createBaseVNode("div", _hoisted_18, toDisplayString($setup.completedGroups) + "/" + toDisplayString($setup.totalGroups), 1)
                    ]),
                    createBaseVNode("div", _hoisted_19, [
                      _cache[17] || (_cache[17] = createBaseVNode("div", { class: "stat-label" }, "当前照片", -1)),
                      createBaseVNode("div", _hoisted_20, toDisplayString($setup.currentPhoto) + "/" + toDisplayString($setup.photosPerGroup), 1)
                    ]),
                    createBaseVNode("div", _hoisted_21, [
                      _cache[18] || (_cache[18] = createBaseVNode("div", { class: "stat-label" }, "运行时间", -1)),
                      createBaseVNode("div", _hoisted_22, toDisplayString($setup.elapsedTime) + "s", 1)
                    ])
                  ])
                ]),
                createBaseVNode("div", _hoisted_23, [
                  createVNode$1(_component_progress_chart, { progress: $setup.experimentProgress }, null, 8, ["progress"])
                ])
              ]),
              createBaseVNode("div", _hoisted_24, [
                _cache[20] || (_cache[20] = createBaseVNode("h2", null, "给料状态", -1)),
                createBaseVNode("div", _hoisted_25, [
                  createVNode$1(_component_feeding_chart, { data: $setup.feedingData }, null, 8, ["data"])
                ])
              ])
            ]),
            createBaseVNode("div", _hoisted_26, [
              createBaseVNode("div", _hoisted_27, [
                _cache[21] || (_cache[21] = createBaseVNode("h2", null, "最新照片", -1)),
                createBaseVNode("div", _hoisted_28, [
                  (openBlock(true), createElementBlock(Fragment, null, renderList($setup.latestPhotos, (photo, index) => {
                    return openBlock(), createElementBlock("div", {
                      key: index,
                      class: "photo-item"
                    }, [
                      !photo.path ? (openBlock(), createElementBlock("div", _hoisted_29, [
                        createVNode$1(_component_el_icon, null, {
                          default: withCtx(() => [
                            createVNode$1(_component_Picture)
                          ]),
                          _: 1
                        })
                      ])) : (openBlock(), createElementBlock("div", _hoisted_30, [
                        createBaseVNode("img", {
                          src: photo.path,
                          alt: "实验照片",
                          onError: _cache[4] || (_cache[4] = (...args) => $setup.handleImageError && $setup.handleImageError(...args)),
                          onLoad: _cache[5] || (_cache[5] = (...args) => $setup.handleImageLoad && $setup.handleImageLoad(...args))
                        }, null, 40, _hoisted_31)
                      ])),
                      createBaseVNode("div", _hoisted_32, [
                        createBaseVNode("span", null, "组" + toDisplayString(photo.group) + " - 照片" + toDisplayString(photo.photo), 1),
                        createBaseVNode("span", null, toDisplayString(photo.time), 1)
                      ])
                    ]);
                  }), 128))
                ])
              ]),
              createBaseVNode("div", _hoisted_33, [
                _cache[23] || (_cache[23] = createBaseVNode("h2", null, "控制台监控", -1)),
                createBaseVNode("div", _hoisted_34, [
                  createBaseVNode("div", _hoisted_35, [
                    _cache[22] || (_cache[22] = createBaseVNode("div", { class: "console-tabs" }, [
                      createBaseVNode("div", { class: "tab active" }, "系统日志"),
                      createBaseVNode("div", { class: "tab" }, "运行状态")
                    ], -1)),
                    createBaseVNode("div", _hoisted_36, [
                      createVNode$1(_component_el_icon, { class: "control-icon" }, {
                        default: withCtx(() => [
                          createVNode$1(_component_Delete)
                        ]),
                        _: 1
                      }),
                      createVNode$1(_component_el_icon, { class: "control-icon" }, {
                        default: withCtx(() => [
                          createVNode$1(_component_Download)
                        ]),
                        _: 1
                      })
                    ])
                  ]),
                  createBaseVNode("div", _hoisted_37, [
                    createBaseVNode("div", _hoisted_38, [
                      (openBlock(true), createElementBlock(Fragment, null, renderList($setup.systemLogs, (log, index) => {
                        return openBlock(), createElementBlock("div", {
                          key: index,
                          class: normalizeClass(["log-item", log.type])
                        }, [
                          createBaseVNode("span", _hoisted_39, toDisplayString(log.time), 1),
                          createBaseVNode("span", _hoisted_40, toDisplayString(log.content), 1)
                        ], 2);
                      }), 128))
                    ])
                  ])
                ])
              ])
            ])
          ])
        ]),
        createVNode$1(_component_el_dialog, {
          modelValue: $setup.reportDialogVisible,
          "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.reportDialogVisible = $event),
          title: "数据分析报表",
          width: "90%",
          "destroy-on-close": true,
          class: "report-dialog"
        }, {
          default: withCtx(() => [
            createVNode$1(_component_data_report)
          ]),
          _: 1
        }, 8, ["modelValue"]),
        createVNode$1(_component_el_dialog, {
          modelValue: $setup.sandGradingReportDialogVisible,
          "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.sandGradingReportDialogVisible = $event),
          title: "砂级配报告",
          width: "90%",
          "destroy-on-close": true,
          class: "report-dialog"
        }, {
          default: withCtx(() => [
            createVNode$1(_component_sand_grading_report)
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]);
    }
    const Dashboard = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-bb1f0bdb"]]);
    const _hoisted_1 = { class: "login-page" };
    const _hoisted_2 = { class: "login-container" };
    const _hoisted_3 = { class: "login-info" };
    const _hoisted_4 = { class: "logo-area" };
    const _hoisted_5 = { class: "logo-icon" };
    const _hoisted_6 = { class: "info-features" };
    const _hoisted_7 = { class: "feature-item" };
    const _hoisted_8 = { class: "feature-item" };
    const _hoisted_9 = { class: "feature-item" };
    const _hoisted_10 = { class: "login-form-area" };
    const _hoisted_11 = { class: "login-form-container" };
    const _hoisted_12 = { class: "login-options" };
    const _sfc_main = {
      __name: "Login",
      setup(__props) {
        const router2 = useRouter();
        const loginFormRef = ref(null);
        const loading = ref(false);
        const rememberMe = ref(false);
        const loginForm = reactive({
          username: "",
          password: ""
        });
        const loginRules = {
          username: [
            { required: true, message: "请输入用户名", trigger: "blur" },
            { min: 3, max: 20, message: "用户名长度应为3-20个字符", trigger: "blur" }
          ],
          password: [
            { required: true, message: "请输入密码", trigger: "blur" },
            { min: 6, max: 20, message: "密码长度应为6-20个字符", trigger: "blur" }
          ]
        };
        const handleLogin = () => {
          loginFormRef.value.validate((valid) => {
            if (!valid) return;
            loading.value = true;
            setTimeout(() => {
              if (loginForm.username === "admin" && loginForm.password === "123456") {
                ElMessage({
                  message: "登录成功，正在进入系统...",
                  type: "success",
                  duration: 2e3
                });
                localStorage.setItem("isLoggedIn", "true");
                if (rememberMe.value) {
                  localStorage.setItem("username", loginForm.username);
                } else {
                  localStorage.removeItem("username");
                }
                setTimeout(() => {
                  router2.push("/dashboard");
                }, 1e3);
              } else {
                ElMessage({
                  message: "用户名或密码错误",
                  type: "error",
                  duration: 2e3
                });
              }
              loading.value = false;
            }, 1500);
          });
        };
        const checkRememberedUser = () => {
          const rememberedUsername = localStorage.getItem("username");
          if (rememberedUsername) {
            loginForm.username = rememberedUsername;
            rememberMe.value = true;
          }
        };
        const initParticles = () => {
          const script = document.createElement("script");
          script.src = "https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js";
          script.onload = () => {
            window.particlesJS("particles-js", {
              particles: {
                number: {
                  value: 80,
                  density: {
                    enable: true,
                    value_area: 800
                  }
                },
                color: {
                  value: "#00a8ff"
                },
                shape: {
                  type: "circle",
                  stroke: {
                    width: 0,
                    color: "#000000"
                  }
                },
                opacity: {
                  value: 0.3,
                  random: true,
                  anim: {
                    enable: true,
                    speed: 1,
                    opacity_min: 0.1,
                    sync: false
                  }
                },
                size: {
                  value: 3,
                  random: true,
                  anim: {
                    enable: true,
                    speed: 2,
                    size_min: 0.1,
                    sync: false
                  }
                },
                line_linked: {
                  enable: true,
                  distance: 150,
                  color: "#00a8ff",
                  opacity: 0.2,
                  width: 1
                },
                move: {
                  enable: true,
                  speed: 1,
                  direction: "none",
                  random: true,
                  straight: false,
                  out_mode: "out",
                  bounce: false,
                  attract: {
                    enable: false,
                    rotateX: 600,
                    rotateY: 1200
                  }
                }
              },
              interactivity: {
                detect_on: "canvas",
                events: {
                  onhover: {
                    enable: true,
                    mode: "grab"
                  },
                  onclick: {
                    enable: true,
                    mode: "push"
                  },
                  resize: true
                },
                modes: {
                  grab: {
                    distance: 140,
                    line_linked: {
                      opacity: 0.5
                    }
                  },
                  push: {
                    particles_nb: 4
                  }
                }
              },
              retina_detect: true
            });
          };
          document.body.appendChild(script);
        };
        onMounted(() => {
          checkRememberedUser();
          initParticles();
        });
        return (_ctx, _cache) => {
          const _component_el_icon = resolveComponent("el-icon");
          const _component_el_input = resolveComponent("el-input");
          const _component_el_form_item = resolveComponent("el-form-item");
          const _component_el_checkbox = resolveComponent("el-checkbox");
          const _component_el_button = resolveComponent("el-button");
          const _component_el_form = resolveComponent("el-form");
          return openBlock(), createElementBlock("div", _hoisted_1, [
            _cache[14] || (_cache[14] = createBaseVNode("div", {
              id: "particles-js",
              class: "particles-container"
            }, null, -1)),
            createBaseVNode("div", _hoisted_2, [
              createBaseVNode("div", _hoisted_3, [
                createBaseVNode("div", _hoisted_4, [
                  createBaseVNode("div", _hoisted_5, [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(unref(monitor_default))
                      ]),
                      _: 1
                    })
                  ])
                ]),
                _cache[6] || (_cache[6] = createBaseVNode("h1", { class: "system-title" }, "砂石级配实验监控平台", -1)),
                _cache[7] || (_cache[7] = createBaseVNode("p", { class: "system-subtitle" }, "Sand Gradation Experiment Monitoring System", -1)),
                createBaseVNode("div", _hoisted_6, [
                  createBaseVNode("div", _hoisted_7, [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(unref(data_analysis_default))
                      ]),
                      _: 1
                    }),
                    _cache[3] || (_cache[3] = createBaseVNode("span", null, "实时数据监控", -1))
                  ]),
                  createBaseVNode("div", _hoisted_8, [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(unref(picture_filled_default))
                      ]),
                      _: 1
                    }),
                    _cache[4] || (_cache[4] = createBaseVNode("span", null, "高精度图像分析", -1))
                  ]),
                  createBaseVNode("div", _hoisted_9, [
                    createVNode$1(_component_el_icon, null, {
                      default: withCtx(() => [
                        createVNode$1(unref(histogram_default))
                      ]),
                      _: 1
                    }),
                    _cache[5] || (_cache[5] = createBaseVNode("span", null, "专业数据报表", -1))
                  ])
                ])
              ]),
              createBaseVNode("div", _hoisted_10, [
                createBaseVNode("div", _hoisted_11, [
                  _cache[11] || (_cache[11] = createBaseVNode("h2", { class: "welcome-text" }, "欢迎使用", -1)),
                  _cache[12] || (_cache[12] = createBaseVNode("p", { class: "login-desc" }, "请使用您的账号密码登录系统", -1)),
                  createVNode$1(_component_el_form, {
                    ref_key: "loginFormRef",
                    ref: loginFormRef,
                    model: loginForm,
                    rules: loginRules,
                    class: "login-form",
                    size: "large"
                  }, {
                    default: withCtx(() => [
                      createVNode$1(_component_el_form_item, { prop: "username" }, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_input, {
                            modelValue: loginForm.username,
                            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => loginForm.username = $event),
                            placeholder: "用户名",
                            "prefix-icon": unref(user_default),
                            clearable: "",
                            onKeyup: withKeys(handleLogin, ["enter"])
                          }, null, 8, ["modelValue", "prefix-icon"])
                        ]),
                        _: 1
                      }),
                      createVNode$1(_component_el_form_item, { prop: "password" }, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_input, {
                            modelValue: loginForm.password,
                            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => loginForm.password = $event),
                            type: "password",
                            placeholder: "密码",
                            "prefix-icon": unref(lock_default),
                            "show-password": "",
                            clearable: "",
                            onKeyup: withKeys(handleLogin, ["enter"])
                          }, null, 8, ["modelValue", "prefix-icon"])
                        ]),
                        _: 1
                      }),
                      createBaseVNode("div", _hoisted_12, [
                        createVNode$1(_component_el_checkbox, {
                          modelValue: rememberMe.value,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => rememberMe.value = $event)
                        }, {
                          default: withCtx(() => _cache[8] || (_cache[8] = [
                            createTextVNode("记住我")
                          ])),
                          _: 1
                        }, 8, ["modelValue"]),
                        createVNode$1(_component_el_button, {
                          type: "text",
                          class: "forgot-password"
                        }, {
                          default: withCtx(() => _cache[9] || (_cache[9] = [
                            createTextVNode("忘记密码?")
                          ])),
                          _: 1
                        })
                      ]),
                      createVNode$1(_component_el_form_item, null, {
                        default: withCtx(() => [
                          createVNode$1(_component_el_button, {
                            type: "primary",
                            class: "login-button",
                            loading: loading.value,
                            onClick: handleLogin
                          }, {
                            default: withCtx(() => _cache[10] || (_cache[10] = [
                              createTextVNode(" 登录系统 ")
                            ])),
                            _: 1
                          }, 8, ["loading"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }, 8, ["model"]),
                  _cache[13] || (_cache[13] = createBaseVNode("div", { class: "login-footer" }, [
                    createBaseVNode("p", { class: "version-info" }, "系统版本 V1.0.0"),
                    createBaseVNode("p", { class: "copyright" }, "2025 砂石级配实验监控平台 - 版权所有")
                  ], -1))
                ])
              ])
            ])
          ]);
        };
      }
    };
    const Login = /* @__PURE__ */ _export_sfc$1(_sfc_main, [["__scopeId", "data-v-c9c436ef"]]);
    const routes = [
      {
        path: "/",
        redirect: "/login"
      },
      {
        path: "/login",
        name: "Login",
        component: Login,
        meta: { requiresAuth: false }
      },
      {
        path: "/dashboard",
        name: "Dashboard",
        component: Dashboard,
        meta: { requiresAuth: true }
      },
      {
        path: "/sand-grading-report",
        name: "SandGradingReport",
        component: SandGradingReport,
        meta: { requiresAuth: true }
      }
    ];
    const router = createRouter({
      history: createWebHistory("/"),
      routes
    });
    router.beforeEach((to, from, next) => {
      const isLoggedIn = localStorage.getItem("isLoggedIn") === "true";
      if (to.meta.requiresAuth && !isLoggedIn) {
        next({ name: "Login" });
      } else if (to.name === "Login" && isLoggedIn) {
        next({ name: "Dashboard" });
      } else {
        next();
      }
    });
    /*!
     * vuex v4.1.0
     * (c) 2022 Evan You
     * @license MIT
     */
    var storeKey = "store";
    function forEachValue(obj, fn2) {
      Object.keys(obj).forEach(function(key) {
        return fn2(obj[key], key);
      });
    }
    function isObject(obj) {
      return obj !== null && typeof obj === "object";
    }
    function isPromise(val) {
      return val && typeof val.then === "function";
    }
    function partial(fn2, arg) {
      return function() {
        return fn2(arg);
      };
    }
    function genericSubscribe(fn2, subs, options) {
      if (subs.indexOf(fn2) < 0) {
        options && options.prepend ? subs.unshift(fn2) : subs.push(fn2);
      }
      return function() {
        var i2 = subs.indexOf(fn2);
        if (i2 > -1) {
          subs.splice(i2, 1);
        }
      };
    }
    function resetStore(store2, hot) {
      store2._actions = /* @__PURE__ */ Object.create(null);
      store2._mutations = /* @__PURE__ */ Object.create(null);
      store2._wrappedGetters = /* @__PURE__ */ Object.create(null);
      store2._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
      var state = store2.state;
      installModule(store2, state, [], store2._modules.root, true);
      resetStoreState(store2, state, hot);
    }
    function resetStoreState(store2, state, hot) {
      var oldState = store2._state;
      var oldScope = store2._scope;
      store2.getters = {};
      store2._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
      var wrappedGetters = store2._wrappedGetters;
      var computedObj = {};
      var computedCache = {};
      var scope = effectScope(true);
      scope.run(function() {
        forEachValue(wrappedGetters, function(fn2, key) {
          computedObj[key] = partial(fn2, store2);
          computedCache[key] = computed(function() {
            return computedObj[key]();
          });
          Object.defineProperty(store2.getters, key, {
            get: function() {
              return computedCache[key].value;
            },
            enumerable: true
            // for local getters
          });
        });
      });
      store2._state = reactive({
        data: state
      });
      store2._scope = scope;
      if (store2.strict) {
        enableStrictMode(store2);
      }
      if (oldState) {
        if (hot) {
          store2._withCommit(function() {
            oldState.data = null;
          });
        }
      }
      if (oldScope) {
        oldScope.stop();
      }
    }
    function installModule(store2, rootState, path, module2, hot) {
      var isRoot = !path.length;
      var namespace = store2._modules.getNamespace(path);
      if (module2.namespaced) {
        if (store2._modulesNamespaceMap[namespace] && false) ;
        store2._modulesNamespaceMap[namespace] = module2;
      }
      if (!isRoot && !hot) {
        var parentState = getNestedState(rootState, path.slice(0, -1));
        var moduleName = path[path.length - 1];
        store2._withCommit(function() {
          parentState[moduleName] = module2.state;
        });
      }
      var local = module2.context = makeLocalContext(store2, namespace, path);
      module2.forEachMutation(function(mutation, key) {
        var namespacedType = namespace + key;
        registerMutation(store2, namespacedType, mutation, local);
      });
      module2.forEachAction(function(action, key) {
        var type = action.root ? key : namespace + key;
        var handler = action.handler || action;
        registerAction(store2, type, handler, local);
      });
      module2.forEachGetter(function(getter, key) {
        var namespacedType = namespace + key;
        registerGetter(store2, namespacedType, getter, local);
      });
      module2.forEachChild(function(child, key) {
        installModule(store2, rootState, path.concat(key), child, hot);
      });
    }
    function makeLocalContext(store2, namespace, path) {
      var noNamespace = namespace === "";
      var local = {
        dispatch: noNamespace ? store2.dispatch : function(_type, _payload, _options) {
          var args = unifyObjectStyle(_type, _payload, _options);
          var payload = args.payload;
          var options = args.options;
          var type = args.type;
          if (!options || !options.root) {
            type = namespace + type;
          }
          return store2.dispatch(type, payload);
        },
        commit: noNamespace ? store2.commit : function(_type, _payload, _options) {
          var args = unifyObjectStyle(_type, _payload, _options);
          var payload = args.payload;
          var options = args.options;
          var type = args.type;
          if (!options || !options.root) {
            type = namespace + type;
          }
          store2.commit(type, payload, options);
        }
      };
      Object.defineProperties(local, {
        getters: {
          get: noNamespace ? function() {
            return store2.getters;
          } : function() {
            return makeLocalGetters(store2, namespace);
          }
        },
        state: {
          get: function() {
            return getNestedState(store2.state, path);
          }
        }
      });
      return local;
    }
    function makeLocalGetters(store2, namespace) {
      if (!store2._makeLocalGettersCache[namespace]) {
        var gettersProxy = {};
        var splitPos = namespace.length;
        Object.keys(store2.getters).forEach(function(type) {
          if (type.slice(0, splitPos) !== namespace) {
            return;
          }
          var localType = type.slice(splitPos);
          Object.defineProperty(gettersProxy, localType, {
            get: function() {
              return store2.getters[type];
            },
            enumerable: true
          });
        });
        store2._makeLocalGettersCache[namespace] = gettersProxy;
      }
      return store2._makeLocalGettersCache[namespace];
    }
    function registerMutation(store2, type, handler, local) {
      var entry = store2._mutations[type] || (store2._mutations[type] = []);
      entry.push(function wrappedMutationHandler(payload) {
        handler.call(store2, local.state, payload);
      });
    }
    function registerAction(store2, type, handler, local) {
      var entry = store2._actions[type] || (store2._actions[type] = []);
      entry.push(function wrappedActionHandler(payload) {
        var res = handler.call(store2, {
          dispatch: local.dispatch,
          commit: local.commit,
          getters: local.getters,
          state: local.state,
          rootGetters: store2.getters,
          rootState: store2.state
        }, payload);
        if (!isPromise(res)) {
          res = Promise.resolve(res);
        }
        if (store2._devtoolHook) {
          return res.catch(function(err) {
            store2._devtoolHook.emit("vuex:error", err);
            throw err;
          });
        } else {
          return res;
        }
      });
    }
    function registerGetter(store2, type, rawGetter, local) {
      if (store2._wrappedGetters[type]) {
        return;
      }
      store2._wrappedGetters[type] = function wrappedGetter(store22) {
        return rawGetter(
          local.state,
          // local state
          local.getters,
          // local getters
          store22.state,
          // root state
          store22.getters
          // root getters
        );
      };
    }
    function enableStrictMode(store2) {
      watch(function() {
        return store2._state.data;
      }, function() {
      }, { deep: true, flush: "sync" });
    }
    function getNestedState(state, path) {
      return path.reduce(function(state2, key) {
        return state2[key];
      }, state);
    }
    function unifyObjectStyle(type, payload, options) {
      if (isObject(type) && type.type) {
        options = payload;
        payload = type;
        type = type.type;
      }
      return { type, payload, options };
    }
    var LABEL_VUEX_BINDINGS = "vuex bindings";
    var MUTATIONS_LAYER_ID = "vuex:mutations";
    var ACTIONS_LAYER_ID = "vuex:actions";
    var INSPECTOR_ID = "vuex";
    var actionId = 0;
    function addDevtools(app2, store2) {
      setupDevtoolsPlugin(
        {
          id: "org.vuejs.vuex",
          app: app2,
          label: "Vuex",
          homepage: "https://next.vuex.vuejs.org/",
          logo: "https://vuejs.org/images/icons/favicon-96x96.png",
          packageName: "vuex",
          componentStateTypes: [LABEL_VUEX_BINDINGS]
        },
        function(api2) {
          api2.addTimelineLayer({
            id: MUTATIONS_LAYER_ID,
            label: "Vuex Mutations",
            color: COLOR_LIME_500
          });
          api2.addTimelineLayer({
            id: ACTIONS_LAYER_ID,
            label: "Vuex Actions",
            color: COLOR_LIME_500
          });
          api2.addInspector({
            id: INSPECTOR_ID,
            label: "Vuex",
            icon: "storage",
            treeFilterPlaceholder: "Filter stores..."
          });
          api2.on.getInspectorTree(function(payload) {
            if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
              if (payload.filter) {
                var nodes = [];
                flattenStoreForInspectorTree(nodes, store2._modules.root, payload.filter, "");
                payload.rootNodes = nodes;
              } else {
                payload.rootNodes = [
                  formatStoreForInspectorTree(store2._modules.root, "")
                ];
              }
            }
          });
          api2.on.getInspectorState(function(payload) {
            if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
              var modulePath = payload.nodeId;
              makeLocalGetters(store2, modulePath);
              payload.state = formatStoreForInspectorState(
                getStoreModule(store2._modules, modulePath),
                modulePath === "root" ? store2.getters : store2._makeLocalGettersCache,
                modulePath
              );
            }
          });
          api2.on.editInspectorState(function(payload) {
            if (payload.app === app2 && payload.inspectorId === INSPECTOR_ID) {
              var modulePath = payload.nodeId;
              var path = payload.path;
              if (modulePath !== "root") {
                path = modulePath.split("/").filter(Boolean).concat(path);
              }
              store2._withCommit(function() {
                payload.set(store2._state.data, path, payload.state.value);
              });
            }
          });
          store2.subscribe(function(mutation, state) {
            var data = {};
            if (mutation.payload) {
              data.payload = mutation.payload;
            }
            data.state = state;
            api2.notifyComponentUpdate();
            api2.sendInspectorTree(INSPECTOR_ID);
            api2.sendInspectorState(INSPECTOR_ID);
            api2.addTimelineEvent({
              layerId: MUTATIONS_LAYER_ID,
              event: {
                time: Date.now(),
                title: mutation.type,
                data
              }
            });
          });
          store2.subscribeAction({
            before: function(action, state) {
              var data = {};
              if (action.payload) {
                data.payload = action.payload;
              }
              action._id = actionId++;
              action._time = Date.now();
              data.state = state;
              api2.addTimelineEvent({
                layerId: ACTIONS_LAYER_ID,
                event: {
                  time: action._time,
                  title: action.type,
                  groupId: action._id,
                  subtitle: "start",
                  data
                }
              });
            },
            after: function(action, state) {
              var data = {};
              var duration2 = Date.now() - action._time;
              data.duration = {
                _custom: {
                  type: "duration",
                  display: duration2 + "ms",
                  tooltip: "Action duration",
                  value: duration2
                }
              };
              if (action.payload) {
                data.payload = action.payload;
              }
              data.state = state;
              api2.addTimelineEvent({
                layerId: ACTIONS_LAYER_ID,
                event: {
                  time: Date.now(),
                  title: action.type,
                  groupId: action._id,
                  subtitle: "end",
                  data
                }
              });
            }
          });
        }
      );
    }
    var COLOR_LIME_500 = 8702998;
    var COLOR_DARK = 6710886;
    var COLOR_WHITE = 16777215;
    var TAG_NAMESPACED = {
      label: "namespaced",
      textColor: COLOR_WHITE,
      backgroundColor: COLOR_DARK
    };
    function extractNameFromPath(path) {
      return path && path !== "root" ? path.split("/").slice(-2, -1)[0] : "Root";
    }
    function formatStoreForInspectorTree(module2, path) {
      return {
        id: path || "root",
        // all modules end with a `/`, we want the last segment only
        // cart/ -> cart
        // nested/cart/ -> cart
        label: extractNameFromPath(path),
        tags: module2.namespaced ? [TAG_NAMESPACED] : [],
        children: Object.keys(module2._children).map(
          function(moduleName) {
            return formatStoreForInspectorTree(
              module2._children[moduleName],
              path + moduleName + "/"
            );
          }
        )
      };
    }
    function flattenStoreForInspectorTree(result, module2, filter2, path) {
      if (path.includes(filter2)) {
        result.push({
          id: path || "root",
          label: path.endsWith("/") ? path.slice(0, path.length - 1) : path || "Root",
          tags: module2.namespaced ? [TAG_NAMESPACED] : []
        });
      }
      Object.keys(module2._children).forEach(function(moduleName) {
        flattenStoreForInspectorTree(result, module2._children[moduleName], filter2, path + moduleName + "/");
      });
    }
    function formatStoreForInspectorState(module2, getters, path) {
      getters = path === "root" ? getters : getters[path];
      var gettersKeys = Object.keys(getters);
      var storeState = {
        state: Object.keys(module2.state).map(function(key) {
          return {
            key,
            editable: true,
            value: module2.state[key]
          };
        })
      };
      if (gettersKeys.length) {
        var tree = transformPathsToObjectTree(getters);
        storeState.getters = Object.keys(tree).map(function(key) {
          return {
            key: key.endsWith("/") ? extractNameFromPath(key) : key,
            editable: false,
            value: canThrow(function() {
              return tree[key];
            })
          };
        });
      }
      return storeState;
    }
    function transformPathsToObjectTree(getters) {
      var result = {};
      Object.keys(getters).forEach(function(key) {
        var path = key.split("/");
        if (path.length > 1) {
          var target = result;
          var leafKey = path.pop();
          path.forEach(function(p2) {
            if (!target[p2]) {
              target[p2] = {
                _custom: {
                  value: {},
                  display: p2,
                  tooltip: "Module",
                  abstract: true
                }
              };
            }
            target = target[p2]._custom.value;
          });
          target[leafKey] = canThrow(function() {
            return getters[key];
          });
        } else {
          result[key] = canThrow(function() {
            return getters[key];
          });
        }
      });
      return result;
    }
    function getStoreModule(moduleMap, path) {
      var names2 = path.split("/").filter(function(n) {
        return n;
      });
      return names2.reduce(
        function(module2, moduleName, i2) {
          var child = module2[moduleName];
          if (!child) {
            throw new Error('Missing module "' + moduleName + '" for path "' + path + '".');
          }
          return i2 === names2.length - 1 ? child : child._children;
        },
        path === "root" ? moduleMap : moduleMap.root._children
      );
    }
    function canThrow(cb) {
      try {
        return cb();
      } catch (e2) {
        return e2;
      }
    }
    var Module = function Module2(rawModule, runtime) {
      this.runtime = runtime;
      this._children = /* @__PURE__ */ Object.create(null);
      this._rawModule = rawModule;
      var rawState = rawModule.state;
      this.state = (typeof rawState === "function" ? rawState() : rawState) || {};
    };
    var prototypeAccessors$1 = { namespaced: { configurable: true } };
    prototypeAccessors$1.namespaced.get = function() {
      return !!this._rawModule.namespaced;
    };
    Module.prototype.addChild = function addChild2(key, module2) {
      this._children[key] = module2;
    };
    Module.prototype.removeChild = function removeChild2(key) {
      delete this._children[key];
    };
    Module.prototype.getChild = function getChild(key) {
      return this._children[key];
    };
    Module.prototype.hasChild = function hasChild(key) {
      return key in this._children;
    };
    Module.prototype.update = function update(rawModule) {
      this._rawModule.namespaced = rawModule.namespaced;
      if (rawModule.actions) {
        this._rawModule.actions = rawModule.actions;
      }
      if (rawModule.mutations) {
        this._rawModule.mutations = rawModule.mutations;
      }
      if (rawModule.getters) {
        this._rawModule.getters = rawModule.getters;
      }
    };
    Module.prototype.forEachChild = function forEachChild(fn2) {
      forEachValue(this._children, fn2);
    };
    Module.prototype.forEachGetter = function forEachGetter(fn2) {
      if (this._rawModule.getters) {
        forEachValue(this._rawModule.getters, fn2);
      }
    };
    Module.prototype.forEachAction = function forEachAction(fn2) {
      if (this._rawModule.actions) {
        forEachValue(this._rawModule.actions, fn2);
      }
    };
    Module.prototype.forEachMutation = function forEachMutation(fn2) {
      if (this._rawModule.mutations) {
        forEachValue(this._rawModule.mutations, fn2);
      }
    };
    Object.defineProperties(Module.prototype, prototypeAccessors$1);
    var ModuleCollection = function ModuleCollection2(rawRootModule) {
      this.register([], rawRootModule, false);
    };
    ModuleCollection.prototype.get = function get2(path) {
      return path.reduce(function(module2, key) {
        return module2.getChild(key);
      }, this.root);
    };
    ModuleCollection.prototype.getNamespace = function getNamespace(path) {
      var module2 = this.root;
      return path.reduce(function(namespace, key) {
        module2 = module2.getChild(key);
        return namespace + (module2.namespaced ? key + "/" : "");
      }, "");
    };
    ModuleCollection.prototype.update = function update$1(rawRootModule) {
      update2([], this.root, rawRootModule);
    };
    ModuleCollection.prototype.register = function register2(path, rawModule, runtime) {
      var this$1$1 = this;
      if (runtime === void 0) runtime = true;
      var newModule = new Module(rawModule, runtime);
      if (path.length === 0) {
        this.root = newModule;
      } else {
        var parent2 = this.get(path.slice(0, -1));
        parent2.addChild(path[path.length - 1], newModule);
      }
      if (rawModule.modules) {
        forEachValue(rawModule.modules, function(rawChildModule, key) {
          this$1$1.register(path.concat(key), rawChildModule, runtime);
        });
      }
    };
    ModuleCollection.prototype.unregister = function unregister2(path) {
      var parent2 = this.get(path.slice(0, -1));
      var key = path[path.length - 1];
      var child = parent2.getChild(key);
      if (!child) {
        return;
      }
      if (!child.runtime) {
        return;
      }
      parent2.removeChild(key);
    };
    ModuleCollection.prototype.isRegistered = function isRegistered(path) {
      var parent2 = this.get(path.slice(0, -1));
      var key = path[path.length - 1];
      if (parent2) {
        return parent2.hasChild(key);
      }
      return false;
    };
    function update2(path, targetModule, newModule) {
      targetModule.update(newModule);
      if (newModule.modules) {
        for (var key in newModule.modules) {
          if (!targetModule.getChild(key)) {
            return;
          }
          update2(
            path.concat(key),
            targetModule.getChild(key),
            newModule.modules[key]
          );
        }
      }
    }
    function createStore(options) {
      return new Store(options);
    }
    var Store = function Store2(options) {
      var this$1$1 = this;
      if (options === void 0) options = {};
      var plugins = options.plugins;
      if (plugins === void 0) plugins = [];
      var strict = options.strict;
      if (strict === void 0) strict = false;
      var devtools = options.devtools;
      this._committing = false;
      this._actions = /* @__PURE__ */ Object.create(null);
      this._actionSubscribers = [];
      this._mutations = /* @__PURE__ */ Object.create(null);
      this._wrappedGetters = /* @__PURE__ */ Object.create(null);
      this._modules = new ModuleCollection(options);
      this._modulesNamespaceMap = /* @__PURE__ */ Object.create(null);
      this._subscribers = [];
      this._makeLocalGettersCache = /* @__PURE__ */ Object.create(null);
      this._scope = null;
      this._devtools = devtools;
      var store2 = this;
      var ref2 = this;
      var dispatch2 = ref2.dispatch;
      var commit2 = ref2.commit;
      this.dispatch = function boundDispatch(type, payload) {
        return dispatch2.call(store2, type, payload);
      };
      this.commit = function boundCommit(type, payload, options2) {
        return commit2.call(store2, type, payload, options2);
      };
      this.strict = strict;
      var state = this._modules.root.state;
      installModule(this, state, [], this._modules.root);
      resetStoreState(this, state);
      plugins.forEach(function(plugin) {
        return plugin(this$1$1);
      });
    };
    var prototypeAccessors = { state: { configurable: true } };
    Store.prototype.install = function install2(app2, injectKey) {
      app2.provide(injectKey || storeKey, this);
      app2.config.globalProperties.$store = this;
      var useDevtools = this._devtools !== void 0 ? this._devtools : false;
      if (useDevtools) {
        addDevtools(app2, this);
      }
    };
    prototypeAccessors.state.get = function() {
      return this._state.data;
    };
    prototypeAccessors.state.set = function(v4) {
    };
    Store.prototype.commit = function commit(_type, _payload, _options) {
      var this$1$1 = this;
      var ref2 = unifyObjectStyle(_type, _payload, _options);
      var type = ref2.type;
      var payload = ref2.payload;
      var mutation = { type, payload };
      var entry = this._mutations[type];
      if (!entry) {
        return;
      }
      this._withCommit(function() {
        entry.forEach(function commitIterator(handler) {
          handler(payload);
        });
      });
      this._subscribers.slice().forEach(function(sub2) {
        return sub2(mutation, this$1$1.state);
      });
    };
    Store.prototype.dispatch = function dispatch(_type, _payload) {
      var this$1$1 = this;
      var ref2 = unifyObjectStyle(_type, _payload);
      var type = ref2.type;
      var payload = ref2.payload;
      var action = { type, payload };
      var entry = this._actions[type];
      if (!entry) {
        return;
      }
      try {
        this._actionSubscribers.slice().filter(function(sub2) {
          return sub2.before;
        }).forEach(function(sub2) {
          return sub2.before(action, this$1$1.state);
        });
      } catch (e2) {
      }
      var result = entry.length > 1 ? Promise.all(entry.map(function(handler) {
        return handler(payload);
      })) : entry[0](payload);
      return new Promise(function(resolve2, reject) {
        result.then(function(res) {
          try {
            this$1$1._actionSubscribers.filter(function(sub2) {
              return sub2.after;
            }).forEach(function(sub2) {
              return sub2.after(action, this$1$1.state);
            });
          } catch (e2) {
          }
          resolve2(res);
        }, function(error) {
          try {
            this$1$1._actionSubscribers.filter(function(sub2) {
              return sub2.error;
            }).forEach(function(sub2) {
              return sub2.error(action, this$1$1.state, error);
            });
          } catch (e2) {
          }
          reject(error);
        });
      });
    };
    Store.prototype.subscribe = function subscribe(fn2, options) {
      return genericSubscribe(fn2, this._subscribers, options);
    };
    Store.prototype.subscribeAction = function subscribeAction(fn2, options) {
      var subs = typeof fn2 === "function" ? { before: fn2 } : fn2;
      return genericSubscribe(subs, this._actionSubscribers, options);
    };
    Store.prototype.watch = function watch$12(getter, cb, options) {
      var this$1$1 = this;
      return watch(function() {
        return getter(this$1$1.state, this$1$1.getters);
      }, cb, Object.assign({}, options));
    };
    Store.prototype.replaceState = function replaceState(state) {
      var this$1$1 = this;
      this._withCommit(function() {
        this$1$1._state.data = state;
      });
    };
    Store.prototype.registerModule = function registerModule(path, rawModule, options) {
      if (options === void 0) options = {};
      if (typeof path === "string") {
        path = [path];
      }
      this._modules.register(path, rawModule);
      installModule(this, this.state, path, this._modules.get(path), options.preserveState);
      resetStoreState(this, this.state);
    };
    Store.prototype.unregisterModule = function unregisterModule(path) {
      var this$1$1 = this;
      if (typeof path === "string") {
        path = [path];
      }
      this._modules.unregister(path);
      this._withCommit(function() {
        var parentState = getNestedState(this$1$1.state, path.slice(0, -1));
        delete parentState[path[path.length - 1]];
      });
      resetStore(this);
    };
    Store.prototype.hasModule = function hasModule(path) {
      if (typeof path === "string") {
        path = [path];
      }
      return this._modules.isRegistered(path);
    };
    Store.prototype.hotUpdate = function hotUpdate(newOptions) {
      this._modules.update(newOptions);
      resetStore(this, true);
    };
    Store.prototype._withCommit = function _withCommit(fn2) {
      var committing = this._committing;
      this._committing = true;
      fn2();
      this._committing = committing;
    };
    Object.defineProperties(Store.prototype, prototypeAccessors);
    const API_BASE_URL = "http://127.0.0.1:8000";
    const store = createStore({
      state: {
        systemStatus: {
          is_running: false,
          current_config: null,
          start_time: null,
          elapsed_time: null,
          current_group: null,
          current_photo: null,
          remaining_sand: null
        },
        initialized: false,
        error: null,
        initializationError: null,
        // 新增初始化错误状态
        errorType: null,
        // 新增错误类型
        statusUpdateInterval: null
      },
      getters: {
        isRunning: (state) => state.systemStatus.is_running,
        systemStatus: (state) => state.systemStatus,
        isInitialized: (state) => state.initialized,
        error: (state) => state.error
      },
      mutations: {
        SET_SYSTEM_STATUS(state, status) {
          state.systemStatus = status;
        },
        SET_INITIALIZED(state, value) {
          state.initialized = value;
        },
        SET_ERROR(state, error) {
          state.error = error;
        },
        CLEAR_ERROR(state) {
          state.error = null;
          state.errorType = null;
        },
        SET_INITIALIZATION_ERROR(state, { error, type }) {
          state.initializationError = error;
          state.errorType = type;
          state.initialized = false;
        },
        CLEAR_INITIALIZATION_ERROR(state) {
          state.initializationError = null;
          state.errorType = null;
        },
        SET_STATUS_UPDATE_INTERVAL(state, interval) {
          state.statusUpdateInterval = interval;
        }
      },
      actions: {
        // 获取系统状态
        async fetchSystemStatus({ commit }) {
          try {
            const response = await axios.get(`${API_BASE_URL}/status`);
            commit("SET_SYSTEM_STATUS", response.data);
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "获取系统状态失败");
            throw error;
          }
        },
        // 初始化系统
        async initialize({ commit }) {
          try {
            commit("CLEAR_ERROR");
            commit("CLEAR_INITIALIZATION_ERROR");
            const response = await axios.post(`${API_BASE_URL}/initialize`);
            commit("SET_INITIALIZED", true);
            return response.data;
          } catch (error) {
            const errorMessage = error.response?.data?.detail || "系统初始化失败";
            let errorType = "UNKNOWN";
            if (errorMessage.includes("串口") || errorMessage.includes("COM")) {
              errorType = "SERIAL_PORT";
            } else if (errorMessage.includes("相机") || errorMessage.includes("设备未找到")) {
              errorType = "CAMERA";
            } else if (errorMessage.includes("Socket") || errorMessage.includes("连接被拒绝")) {
              errorType = "SOCKET";
            } else if (errorMessage.includes("Modbus") || errorMessage.includes("控制台")) {
              errorType = "MODBUS";
            }
            commit("SET_INITIALIZATION_ERROR", {
              error: errorMessage,
              type: errorType
            });
            commit("SET_ERROR", errorMessage);
            throw error;
          }
        },
        // 开始状态更新
        startStatusUpdate({ commit, state }) {
          if (state.statusUpdateInterval) {
            clearInterval(state.statusUpdateInterval);
          }
          const updateStatus = async () => {
            try {
              const response = await axios.get(`${API_BASE_URL}/status`);
              commit("SET_SYSTEM_STATUS", response.data);
            } catch (error) {
              console.error("获取状态更新失败:", error);
            }
          };
          updateStatus();
          const interval = setInterval(updateStatus, 1e3);
          commit("SET_STATUS_UPDATE_INTERVAL", interval);
        },
        // 停止状态更新
        stopStatusUpdate({ state, commit }) {
          if (state.statusUpdateInterval) {
            clearInterval(state.statusUpdateInterval);
            commit("SET_STATUS_UPDATE_INTERVAL", null);
          }
        },
        // 启动流程时开始状态更新
        async startProcess({ dispatch, commit }, config) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/process/start`, config);
            dispatch("startStatusUpdate");
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "启动流程失败");
            throw error;
          }
        },
        // 停止流程时停止状态更新
        async stopProcess({ dispatch, commit }) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/process/stop`);
            dispatch("stopStatusUpdate");
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "停止流程失败");
            throw error;
          }
        },
        // 配置相机
        async configureCamera({ commit }, config) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/camera/config`, config);
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "配置相机失败");
            throw error;
          }
        },
        // 测试给料
        async testFeeding({ commit }, amount = 1) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/test/feeding?amount=${amount}`);
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "测试给料失败");
            throw error;
          }
        },
        // 测试相机
        async testCamera({ commit }) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/test/camera`);
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "测试相机失败");
            throw error;
          }
        },
        // 测试清砂
        async testCleaning({ commit }) {
          try {
            commit("CLEAR_ERROR");
            const response = await axios.post(`${API_BASE_URL}/test/clean`);
            return response.data;
          } catch (error) {
            commit("SET_ERROR", error.response?.data?.detail || "测试清砂失败");
            throw error;
          }
        }
      }
    });
    var zhCn = {
      name: "zh-cn",
      el: {
        breadcrumb: {
          label: "面包屑"
        },
        colorpicker: {
          confirm: "确定",
          clear: "清空",
          defaultLabel: "颜色选择器",
          description: "当前颜色 {color}，按 Enter 键选择新颜色",
          alphaLabel: "选择透明度的值"
        },
        datepicker: {
          now: "此刻",
          today: "今天",
          cancel: "取消",
          clear: "清空",
          confirm: "确定",
          dateTablePrompt: "使用方向键与 Enter 键可选择日期",
          monthTablePrompt: "使用方向键与 Enter 键可选择月份",
          yearTablePrompt: "使用方向键与 Enter 键可选择年份",
          selectedDate: "已选日期",
          selectDate: "选择日期",
          selectTime: "选择时间",
          startDate: "开始日期",
          startTime: "开始时间",
          endDate: "结束日期",
          endTime: "结束时间",
          prevYear: "前一年",
          nextYear: "后一年",
          prevMonth: "上个月",
          nextMonth: "下个月",
          year: "年",
          month1: "1 月",
          month2: "2 月",
          month3: "3 月",
          month4: "4 月",
          month5: "5 月",
          month6: "6 月",
          month7: "7 月",
          month8: "8 月",
          month9: "9 月",
          month10: "10 月",
          month11: "11 月",
          month12: "12 月",
          weeks: {
            sun: "日",
            mon: "一",
            tue: "二",
            wed: "三",
            thu: "四",
            fri: "五",
            sat: "六"
          },
          weeksFull: {
            sun: "星期日",
            mon: "星期一",
            tue: "星期二",
            wed: "星期三",
            thu: "星期四",
            fri: "星期五",
            sat: "星期六"
          },
          months: {
            jan: "一月",
            feb: "二月",
            mar: "三月",
            apr: "四月",
            may: "五月",
            jun: "六月",
            jul: "七月",
            aug: "八月",
            sep: "九月",
            oct: "十月",
            nov: "十一月",
            dec: "十二月"
          }
        },
        inputNumber: {
          decrease: "减少数值",
          increase: "增加数值"
        },
        select: {
          loading: "加载中",
          noMatch: "无匹配数据",
          noData: "无数据",
          placeholder: "请选择"
        },
        dropdown: {
          toggleDropdown: "切换下拉选项"
        },
        mention: {
          loading: "加载中"
        },
        cascader: {
          noMatch: "无匹配数据",
          loading: "加载中",
          placeholder: "请选择",
          noData: "暂无数据"
        },
        pagination: {
          goto: "前往",
          pagesize: "条/页",
          total: "共 {total} 条",
          pageClassifier: "页",
          page: "页",
          prev: "上一页",
          next: "下一页",
          currentPage: "第 {pager} 页",
          prevPages: "向前 {pager} 页",
          nextPages: "向后 {pager} 页",
          deprecationWarning: "你使用了一些已被废弃的用法，请参考 el-pagination 的官方文档"
        },
        dialog: {
          close: "关闭此对话框"
        },
        drawer: {
          close: "关闭此对话框"
        },
        messagebox: {
          title: "提示",
          confirm: "确定",
          cancel: "取消",
          error: "输入的数据不合法!",
          close: "关闭此对话框"
        },
        upload: {
          deleteTip: "按 Delete 键可删除",
          delete: "删除",
          preview: "查看图片",
          continue: "继续上传"
        },
        slider: {
          defaultLabel: "滑块介于 {min} 至 {max}",
          defaultRangeStartLabel: "选择起始值",
          defaultRangeEndLabel: "选择结束值"
        },
        table: {
          emptyText: "暂无数据",
          confirmFilter: "筛选",
          resetFilter: "重置",
          clearFilter: "全部",
          sumText: "合计"
        },
        tour: {
          next: "下一步",
          previous: "上一步",
          finish: "结束导览"
        },
        tree: {
          emptyText: "暂无数据"
        },
        transfer: {
          noMatch: "无匹配数据",
          noData: "无数据",
          titles: ["列表 1", "列表 2"],
          filterPlaceholder: "请输入搜索内容",
          noCheckedFormat: "共 {total} 项",
          hasCheckedFormat: "已选 {checked}/{total} 项"
        },
        image: {
          error: "加载失败"
        },
        pageHeader: {
          title: "返回"
        },
        popconfirm: {
          confirmButtonText: "确定",
          cancelButtonText: "取消"
        },
        carousel: {
          leftArrow: "上一张幻灯片",
          rightArrow: "下一张幻灯片",
          indicator: "幻灯片切换至索引 {index}"
        }
      }
    };
    const app = createApp(App);
    app.use(router);
    app.use(store);
    app.use(installer, {
      locale: zhCn
    });
    for (const [key, component2] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component2);
    }
    app.mount("#app");
  }
});
export default require_index_001();
